@domternal/vanilla 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 +3 -3
- package/dist/index.js +5 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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
|
-
- **
|
|
25
|
-
- **
|
|
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** -
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { Document, Paragraph, Text, BaseKeymap, History, PluginKey, defaultIcons, Editor, ToolbarController, positionFloatingOnce, defaultBubbleContexts, createBubbleMenuPlugin, createFloatingMenuPlugin, FloatingMenuController, positionFloating } from '@domternal/core';
|
|
1
|
+
import { Document, Paragraph, Text, BaseKeymap, History, PluginKey, defaultIcons, Editor, ToolbarController, positionFloatingOnce, refocusEditorAfterCommand, defaultBubbleContexts, createBubbleMenuPlugin, createFloatingMenuPlugin, FloatingMenuController, positionFloating } from '@domternal/core';
|
|
2
2
|
|
|
3
3
|
// src/shared/isBrowser.ts
|
|
4
4
|
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
@@ -757,9 +757,7 @@ var DomternalToolbar = class extends EventTarget {
|
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
759
|
this.#controller.executeCommand(item);
|
|
760
|
-
|
|
761
|
-
this.#editor.view.focus();
|
|
762
|
-
});
|
|
760
|
+
refocusEditorAfterCommand(this.#editor.view);
|
|
763
761
|
}
|
|
764
762
|
#onDropdownToggle(dd) {
|
|
765
763
|
const wasOpen = this.#controller.openDropdown === dd.name;
|
|
@@ -791,9 +789,7 @@ var DomternalToolbar = class extends EventTarget {
|
|
|
791
789
|
} else {
|
|
792
790
|
this.#controller.executeCommand(item);
|
|
793
791
|
}
|
|
794
|
-
|
|
795
|
-
this.#editor.view.focus();
|
|
796
|
-
});
|
|
792
|
+
refocusEditorAfterCommand(this.#editor.view);
|
|
797
793
|
}
|
|
798
794
|
#onButtonFocus(name) {
|
|
799
795
|
const index = this.#controller.getFlatIndex(name);
|
|
@@ -1560,9 +1556,7 @@ var DomternalBubbleMenu = class extends EventTarget {
|
|
|
1560
1556
|
#onDropdownItemClick(sub) {
|
|
1561
1557
|
this.closeDropdown();
|
|
1562
1558
|
ToolbarController.executeItem(this.#editor, sub);
|
|
1563
|
-
|
|
1564
|
-
this.#editor.view.focus();
|
|
1565
|
-
});
|
|
1559
|
+
refocusEditorAfterCommand(this.#editor.view);
|
|
1566
1560
|
}
|
|
1567
1561
|
// === Dropdown lifecycle ===
|
|
1568
1562
|
#attachDropdownListeners(trigger, panel) {
|
|
@@ -1811,9 +1805,7 @@ var DomternalFloatingMenu = class extends EventTarget {
|
|
|
1811
1805
|
#onItemClick(item) {
|
|
1812
1806
|
if (this.#destroyed || !this.#controller) return;
|
|
1813
1807
|
this.#controller.execute(item);
|
|
1814
|
-
|
|
1815
|
-
this.#editor.view.focus();
|
|
1816
|
-
});
|
|
1808
|
+
refocusEditorAfterCommand(this.#editor.view);
|
|
1817
1809
|
}
|
|
1818
1810
|
#onKeyDown(event) {
|
|
1819
1811
|
if (!this.#controller) return;
|