Brian Hung
Brian Hung
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/063c09f5361fb081e09221d955c565f4c60fd0f1/types/prosemirror-view/index.d.ts#L242 https://github.com/ProseMirror/prosemirror-view/blob/427d278aaaacde422ed1f2b8c84bb53337162775/src/index.js#L46
Don't know enough typescript to know exactly why `Node` is different from `Node` ``` Argument of type 'Node | ((p: Node) => void) | { mount: Node; } | undefined'...
Still working on it; need to remove assumptions in codebase that editor.options.element is always an HtmlElement. We can instead use editor.view.dom but test cases are not passing so have to...
@bdbch Sorry I've been quite busy over the last few months :sweat_smile: If you can take over this PR, that'd be great.
``` const MyToolbar = () => { const editor = useCurrentEditor() const bold = editor?.isActive('bold') // do something with editor } ``` > With this PR, we can reduce the...
There's a nice [`use-sync-external-store`](https://www.npmjs.com/package/use-sync-external-store) package now that can shim for React 18 and < React 18. Example of how another state management library integrated it https://github.com/pmndrs/valtio/pull/234
@umar-ahmed Could you possibly post of a gist of integrating `use-sync-external-store` with `Editor`? There's not much documentation / examples on using `use-sync-external-store` surprisingly. 😅
Thanks for the helpful pointer! Created a quick gist of providing the same functionality but tied to ProseMirror directly: instead of listening to `editor.on('transaction')`, we create a native prosemirror-view plugin...
Here's an example of how I managed to get [dynamic importing of languages for TipTap](https://gist.github.com/BrianHung/08146f89ea903f893946963570263040) (I used CodeMirror for syntax highlighting though, not prism). What happens is that we first...
Two caveats with working with asynchronous code w.r.t. ProseMirror I see here: 1. Need to move `this.editor` after the async call: this is to avoid a `mismatched transaction` error, because...