prosekit / prosekit

Framework agnostic and headless rich text editor

Home Page:https://prosekit.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exporting extensions/utils

ManUtopiK opened this issue · comments

Let's say I want to build my own heading extension.
If I copy the packages/extensions/src/heading/index.ts, I can replace the import ../input-rule by prosekit/extensions/input-rule.
But I can't replace '../utils/with-skip-code-block'.
Something like prosekit/extensions/utils will be helpfull.

I didn't export every util function because I want to keep a small API interface. Sometimes people do want to re-use these utils from ProseKit, so I might export them with @internal JSDoc comment so that (a) they won't show up in https://prosekit.dev/references, and (b) I don't need to follow SemVer when I change these utils in the future.

At this moment, you can just copy and paste with-skip-code-block.ts (and also is-in-code-block.ts) into your project. They are just some small functions and should be easy to understand.

This is what I did. I copied those files.
Thanks for your advice !

These @internal functions are exported in prosekit/core now.