@domternal/vue 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,14 +21,14 @@ See <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> for a ful
21
21
  - **Vue components** - composable `Domternal` component, `useEditor`/`useEditorState` composables, toolbar, bubble menu, floating menu, emoji picker, notion color picker, custom node views (Vue 3.3+)
22
22
  - **Vanilla wrapper** - framework-free class-based API for Astro, Svelte, Solid, plain HTML, and Web Components - editor, toolbar, bubble menu, floating menu, emoji picker, notion color picker
23
23
  - **Notion-style block UX** - drag-to-reorder, block context menu, slash command, smart paste, keyboard reorder, floating Table of Contents
24
- - **65+ extensions across 15 packages** - nodes, marks, and behavior extensions
25
- - **120+ chainable commands** - `editor.chain().focus().toggleBold().run()`
24
+ - **70+ extensions across 16 packages** - nodes, marks, and behavior extensions
25
+ - **125+ chainable commands** - `editor.chain().focus().toggleBold().run()`
26
26
  - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
27
27
  - **Tree-shakeable** - import only what you use, your bundler strips the rest
28
28
  - **~44 KB gzipped** (own code), <u>[see Packages](https://domternal.dev/v1/packages)</u> for full bundle breakdown with ProseMirror
29
29
  - **TypeScript first** - 100% typed, zero `any`
30
30
  - **15,000+ tests** - 4,000+ unit and 11,000+ E2E across 230+ Playwright specs and 4 demo apps
31
- - **Light and dark theme** - 70+ CSS custom properties for full visual control
31
+ - **Light and dark theme** - 120+ CSS custom properties for full visual control
32
32
  - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
33
33
  - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
34
34
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, computed, Fragment, ref, watch, shallowRef, onMounted, nextTick, onScopeDispose, watchEffect, Teleport, inject, provide, getCurrentInstance, customRef, markRaw, shallowReactive, render } from 'vue';
2
- import { positionFloatingOnce, PluginKey, positionFloating, ToolbarController, createFloatingMenuPlugin, FloatingMenuController, defaultIcons, defaultBubbleContexts, createBubbleMenuPlugin, Editor, Document, Paragraph, Text, BaseKeymap, History } from '@domternal/core';
2
+ import { positionFloatingOnce, PluginKey, positionFloating, ToolbarController, refocusEditorAfterCommand, createFloatingMenuPlugin, FloatingMenuController, defaultIcons, defaultBubbleContexts, createBubbleMenuPlugin, Editor, Document, Paragraph, Text, BaseKeymap, History } from '@domternal/core';
3
3
  export { Editor, generateHTML, generateJSON, generateText } from '@domternal/core';
4
4
 
5
5
  // src/useEditor.ts
@@ -858,9 +858,7 @@ var DomternalToolbar = defineComponent({
858
858
  return;
859
859
  }
860
860
  executeCommand(item);
861
- requestAnimationFrame(() => {
862
- editor.view.focus();
863
- });
861
+ refocusEditorAfterCommand(editor.view);
864
862
  }
865
863
  function onDropdownItemClick(item, event) {
866
864
  const editor = props.editor ?? contextEditor.value;
@@ -876,9 +874,7 @@ var DomternalToolbar = defineComponent({
876
874
  } else {
877
875
  executeCommand(item);
878
876
  }
879
- requestAnimationFrame(() => {
880
- editor.view.focus();
881
- });
877
+ refocusEditorAfterCommand(editor.view);
882
878
  }
883
879
  function onButtonFocus(name) {
884
880
  const index = controllerRef.current?.getFlatIndex(name) ?? -1;
@@ -1385,9 +1381,7 @@ var DomternalBubbleMenu = defineComponent({
1385
1381
  const ed = editorRef.value;
1386
1382
  if (!ed) return;
1387
1383
  ToolbarController.executeItem(ed, sub);
1388
- requestAnimationFrame(() => {
1389
- ed.view.focus();
1390
- });
1384
+ refocusEditorAfterCommand(ed.view);
1391
1385
  };
1392
1386
  const colorBtnRef = ref();
1393
1387
  const blockMenuBtnRef = ref();
@@ -1700,9 +1694,7 @@ var DomternalFloatingMenu = defineComponent({
1700
1694
  const ed = currentEditor;
1701
1695
  if (!ctl || !ed) return;
1702
1696
  ctl.execute(item);
1703
- requestAnimationFrame(() => {
1704
- ed.view.focus();
1705
- });
1697
+ refocusEditorAfterCommand(ed.view);
1706
1698
  };
1707
1699
  const onMenuKeyDown = (e) => {
1708
1700
  const ctl = controller.value;