GoTipe + Vue 3: a toolbar that keeps the selection #16505
veniameen
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I maintain GoTipe, an editor library. This small Vue 3 example lets you select a word, click Bold and see the resulting Markdown.
Try the live example · Edit in StackBlitz · Source and local run instructions
The StackBlitz copy can be edited without signing in. Save or fork it in your own account to keep your changes.
The button uses
@mousedown.preventfollowed byeditor.chain().focus().toggleBold().run(). The mouse click keeps the selection in the document;useEditorStatesupplies the pressed and disabled states for Bold, Undo and Redo.Two things to try after editing: unmount the editor, or mount a deliberately invalid document.
useEditorStatusowns creation and cleanup. The invalid document produces the actual schema error, and mounting fresh notes starts a new document with empty undo history.The example uses published packages and application-owned CSS. The initial notes use HTML and the Markdown is converted output; this example does not retain source Markdown or save anything. The README records the build and browser checks, including their limits.
The example, GoTipe core and Vue adapter are MIT. GoTipe's separate ready-made editor UI and themes are commercial and are not included. Prepared with AI assistance; package source, build and browser behavior were checked.
All reactions