@domternal/vue 0.8.0 → 0.9.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.
Files changed (62) hide show
  1. package/dist/index.d.ts +4 -5
  2. package/dist/index.js +1 -2
  3. package/dist/index.js.map +1 -1
  4. package/package.json +12 -11
  5. package/LICENSE +0 -21
  6. package/dist/Domternal.d.ts +0 -34
  7. package/dist/Domternal.d.ts.map +0 -1
  8. package/dist/DomternalEditor.d.ts +0 -224
  9. package/dist/DomternalEditor.d.ts.map +0 -1
  10. package/dist/DomternalFloatingMenu.d.ts +0 -94
  11. package/dist/DomternalFloatingMenu.d.ts.map +0 -1
  12. package/dist/EditorContent.d.ts +0 -44
  13. package/dist/EditorContent.d.ts.map +0 -1
  14. package/dist/EditorContext.d.ts +0 -38
  15. package/dist/EditorContext.d.ts.map +0 -1
  16. package/dist/bubble-menu/DomternalBubbleMenu.d.ts +0 -98
  17. package/dist/bubble-menu/DomternalBubbleMenu.d.ts.map +0 -1
  18. package/dist/bubble-menu/useBubbleMenu.d.ts +0 -57
  19. package/dist/bubble-menu/useBubbleMenu.d.ts.map +0 -1
  20. package/dist/emoji-picker/DomternalEmojiPicker.d.ts +0 -31
  21. package/dist/emoji-picker/DomternalEmojiPicker.d.ts.map +0 -1
  22. package/dist/emoji-picker/useEmojiPicker.d.ts +0 -24
  23. package/dist/emoji-picker/useEmojiPicker.d.ts.map +0 -1
  24. package/dist/index.d.ts.map +0 -1
  25. package/dist/node-views/NodeViewContent.d.ts +0 -30
  26. package/dist/node-views/NodeViewContent.d.ts.map +0 -1
  27. package/dist/node-views/NodeViewWrapper.d.ts +0 -29
  28. package/dist/node-views/NodeViewWrapper.d.ts.map +0 -1
  29. package/dist/node-views/VueNodeViewContext.d.ts +0 -27
  30. package/dist/node-views/VueNodeViewContext.d.ts.map +0 -1
  31. package/dist/node-views/VueNodeViewRenderer.d.ts +0 -88
  32. package/dist/node-views/VueNodeViewRenderer.d.ts.map +0 -1
  33. package/dist/notion-color-picker/DomternalNotionColorPicker.d.ts +0 -22
  34. package/dist/notion-color-picker/DomternalNotionColorPicker.d.ts.map +0 -1
  35. package/dist/notion-color-picker/index.d.ts +0 -5
  36. package/dist/notion-color-picker/index.d.ts.map +0 -1
  37. package/dist/notion-color-picker/useNotionColorPicker.d.ts +0 -35
  38. package/dist/notion-color-picker/useNotionColorPicker.d.ts.map +0 -1
  39. package/dist/toolbar/DomternalToolbar.d.ts +0 -41
  40. package/dist/toolbar/DomternalToolbar.d.ts.map +0 -1
  41. package/dist/toolbar/ToolbarButton.d.ts +0 -72
  42. package/dist/toolbar/ToolbarButton.d.ts.map +0 -1
  43. package/dist/toolbar/ToolbarDropdown.d.ts +0 -76
  44. package/dist/toolbar/ToolbarDropdown.d.ts.map +0 -1
  45. package/dist/toolbar/ToolbarDropdownPanel.d.ts +0 -34
  46. package/dist/toolbar/ToolbarDropdownPanel.d.ts.map +0 -1
  47. package/dist/toolbar/useComputedStyle.d.ts +0 -12
  48. package/dist/toolbar/useComputedStyle.d.ts.map +0 -1
  49. package/dist/toolbar/useKeyboardNav.d.ts +0 -9
  50. package/dist/toolbar/useKeyboardNav.d.ts.map +0 -1
  51. package/dist/toolbar/useToolbarController.d.ts +0 -24
  52. package/dist/toolbar/useToolbarController.d.ts.map +0 -1
  53. package/dist/toolbar/useToolbarIcons.d.ts +0 -12
  54. package/dist/toolbar/useToolbarIcons.d.ts.map +0 -1
  55. package/dist/toolbar/useTooltip.d.ts +0 -5
  56. package/dist/toolbar/useTooltip.d.ts.map +0 -1
  57. package/dist/useEditor.d.ts +0 -63
  58. package/dist/useEditor.d.ts.map +0 -1
  59. package/dist/useEditorState.d.ts +0 -28
  60. package/dist/useEditorState.d.ts.map +0 -1
  61. package/dist/utils.d.ts +0 -39
  62. package/dist/utils.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domternal/vue",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Vue 3 components for Domternal editor",
5
5
  "author": "https://github.com/ThomasNowHere",
6
6
  "license": "MIT",
@@ -20,8 +20,15 @@
20
20
  ],
21
21
  "peerDependencies": {
22
22
  "vue": ">=3.3",
23
- "@domternal/core": ">=0.8.0",
24
- "@domternal/extension-block-menu": ">=0.8.0"
23
+ "@domternal/core": ">=0.9.0"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup",
27
+ "dev": "tsup --watch",
28
+ "lint": "eslint src",
29
+ "typecheck": "tsc --noEmit",
30
+ "prepublishOnly": "pnpm build && node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.devDependencies;if(p.dependencies){for(const[k,v]of Object.entries(p.dependencies)){if(v==='workspace:*')p.dependencies[k]='>=0.9.0'}}require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
31
+ "postpublish": "git checkout package.json"
25
32
  },
26
33
  "keywords": [
27
34
  "vue",
@@ -39,11 +46,5 @@
39
46
  "bugs": {
40
47
  "url": "https://github.com/domternal/domternal/issues"
41
48
  },
42
- "homepage": "https://domternal.dev",
43
- "scripts": {
44
- "build": "tsup",
45
- "dev": "tsup --watch",
46
- "lint": "eslint src",
47
- "typecheck": "tsc --noEmit"
48
- }
49
- }
49
+ "homepage": "https://domternal.dev"
50
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Domternal contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,34 +0,0 @@
1
- import type { Component } from 'vue';
2
- import { type UseEditorOptions } from './useEditor.js';
3
- export interface DomternalProps extends UseEditorOptions {
4
- }
5
- /**
6
- * Composable root component that creates an editor and provides it to all
7
- * subcomponents via inject. No need to pass `editor` prop to children.
8
- *
9
- * Supports namespaced subcomponents in `<script setup>` templates:
10
- *
11
- * @example
12
- * ```vue
13
- * <script setup>
14
- * import { Domternal } from '@domternal/vue';
15
- * </script>
16
- * <template>
17
- * <Domternal :extensions="extensions" :content="content">
18
- * <Domternal.Toolbar />
19
- * <Domternal.Content />
20
- * <Domternal.BubbleMenu :contexts="{ text: ['bold', 'italic'] }" />
21
- * <Domternal.EmojiPicker :emojis="emojis" />
22
- * </Domternal>
23
- * </template>
24
- * ```
25
- */
26
- export declare const Domternal: Component & {
27
- Content: Component;
28
- Loading: Component;
29
- Toolbar: Component;
30
- BubbleMenu: Component;
31
- FloatingMenu: Component;
32
- EmojiPicker: Component;
33
- };
34
- //# sourceMappingURL=Domternal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Domternal.d.ts","sourceRoot":"","sources":["../src/Domternal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAY,MAAM,KAAK,CAAC;AAE/C,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlE,MAAM,WAAW,cAAe,SAAQ,gBAAgB;CAEvD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,EA4CL,SAAS,GAAG;IAC3B,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,SAAS,CAAC;CACxB,CAAC"}
@@ -1,224 +0,0 @@
1
- import type { PropType } from 'vue';
2
- import type { Content, AnyExtension, FocusPosition, JSONContent, Editor } from '@domternal/core';
3
- export interface DomternalEditorProps {
4
- extensions?: AnyExtension[];
5
- content?: Content;
6
- editable?: boolean;
7
- autofocus?: FocusPosition;
8
- immediatelyRender?: boolean;
9
- outputFormat?: 'html' | 'json';
10
- modelValue?: Content;
11
- class?: string;
12
- onCreate?: (editor: Editor) => void;
13
- onUpdate?: (props: {
14
- editor: Editor;
15
- }) => void;
16
- onSelectionChange?: (props: {
17
- editor: Editor;
18
- }) => void;
19
- onFocus?: (props: {
20
- editor: Editor;
21
- event: FocusEvent;
22
- }) => void;
23
- onBlur?: (props: {
24
- editor: Editor;
25
- event: FocusEvent;
26
- }) => void;
27
- onDestroy?: () => void;
28
- }
29
- /**
30
- * All-in-one editor component with v-model support and integrated context.
31
- *
32
- * Wraps children with provideEditor automatically, so toolbar, bubble menu,
33
- * and emoji picker components can access the editor via inject.
34
- *
35
- * @example Basic usage
36
- * ```vue
37
- * <DomternalEditor
38
- * :extensions="[Bold, Italic, Heading]"
39
- * content="<p>Hello</p>"
40
- * />
41
- * ```
42
- *
43
- * @example v-model (two-way binding)
44
- * ```vue
45
- * <DomternalEditor v-model="content" :extensions="extensions" />
46
- * ```
47
- *
48
- * @example With children (toolbar, bubble menu)
49
- * ```vue
50
- * <DomternalEditor :extensions="extensions" v-model="content">
51
- * <DomternalToolbar />
52
- * <DomternalBubbleMenu :contexts="{ text: ['bold', 'italic'] }" />
53
- * </DomternalEditor>
54
- * ```
55
- */
56
- export declare const DomternalEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
57
- extensions: {
58
- type: PropType<AnyExtension[]>;
59
- default: undefined;
60
- };
61
- content: {
62
- type: PropType<Content>;
63
- default: undefined;
64
- };
65
- editable: {
66
- type: BooleanConstructor;
67
- default: boolean;
68
- };
69
- autofocus: {
70
- type: PropType<FocusPosition>;
71
- default: boolean;
72
- };
73
- immediatelyRender: {
74
- type: BooleanConstructor;
75
- default: boolean;
76
- };
77
- outputFormat: {
78
- type: PropType<"html" | "json">;
79
- default: string;
80
- };
81
- modelValue: {
82
- type: PropType<Content>;
83
- default: undefined;
84
- };
85
- class: {
86
- type: StringConstructor;
87
- default: undefined;
88
- };
89
- onCreate: {
90
- type: PropType<(editor: Editor) => void>;
91
- default: undefined;
92
- };
93
- onUpdate: {
94
- type: PropType<(props: {
95
- editor: Editor;
96
- }) => void>;
97
- default: undefined;
98
- };
99
- onSelectionChange: {
100
- type: PropType<(props: {
101
- editor: Editor;
102
- }) => void>;
103
- default: undefined;
104
- };
105
- onFocus: {
106
- type: PropType<(props: {
107
- editor: Editor;
108
- event: FocusEvent;
109
- }) => void>;
110
- default: undefined;
111
- };
112
- onBlur: {
113
- type: PropType<(props: {
114
- editor: Editor;
115
- event: FocusEvent;
116
- }) => void>;
117
- default: undefined;
118
- };
119
- onDestroy: {
120
- type: PropType<() => void>;
121
- default: undefined;
122
- };
123
- }>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
124
- [key: string]: any;
125
- }> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
126
- [key: string]: any;
127
- }>[] | undefined)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
128
- 'update:modelValue': (_value: Content | JSONContent) => true;
129
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
130
- extensions: {
131
- type: PropType<AnyExtension[]>;
132
- default: undefined;
133
- };
134
- content: {
135
- type: PropType<Content>;
136
- default: undefined;
137
- };
138
- editable: {
139
- type: BooleanConstructor;
140
- default: boolean;
141
- };
142
- autofocus: {
143
- type: PropType<FocusPosition>;
144
- default: boolean;
145
- };
146
- immediatelyRender: {
147
- type: BooleanConstructor;
148
- default: boolean;
149
- };
150
- outputFormat: {
151
- type: PropType<"html" | "json">;
152
- default: string;
153
- };
154
- modelValue: {
155
- type: PropType<Content>;
156
- default: undefined;
157
- };
158
- class: {
159
- type: StringConstructor;
160
- default: undefined;
161
- };
162
- onCreate: {
163
- type: PropType<(editor: Editor) => void>;
164
- default: undefined;
165
- };
166
- onUpdate: {
167
- type: PropType<(props: {
168
- editor: Editor;
169
- }) => void>;
170
- default: undefined;
171
- };
172
- onSelectionChange: {
173
- type: PropType<(props: {
174
- editor: Editor;
175
- }) => void>;
176
- default: undefined;
177
- };
178
- onFocus: {
179
- type: PropType<(props: {
180
- editor: Editor;
181
- event: FocusEvent;
182
- }) => void>;
183
- default: undefined;
184
- };
185
- onBlur: {
186
- type: PropType<(props: {
187
- editor: Editor;
188
- event: FocusEvent;
189
- }) => void>;
190
- default: undefined;
191
- };
192
- onDestroy: {
193
- type: PropType<() => void>;
194
- default: undefined;
195
- };
196
- }>> & Readonly<{
197
- "onUpdate:modelValue"?: (_value: Content) => any;
198
- }>, {
199
- onFocus: (props: {
200
- editor: Editor;
201
- event: FocusEvent;
202
- }) => void;
203
- class: string;
204
- onBlur: (props: {
205
- editor: Editor;
206
- event: FocusEvent;
207
- }) => void;
208
- content: Content;
209
- onCreate: (editor: Editor) => void;
210
- onUpdate: (props: {
211
- editor: Editor;
212
- }) => void;
213
- onSelectionChange: (props: {
214
- editor: Editor;
215
- }) => void;
216
- onDestroy: () => void;
217
- extensions: AnyExtension[];
218
- editable: boolean;
219
- autofocus: FocusPosition;
220
- outputFormat: "html" | "json";
221
- immediatelyRender: boolean;
222
- modelValue: Content;
223
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
224
- //# sourceMappingURL=DomternalEditor.d.ts.map
@@ -1 +0,0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AAC;;;;cACvD,QAAQ,CAAC,CAAC,KAAK,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,UAAU,CAAA;SAAE,KAAK,IAAI,CAAC;;;;cACjE,QAAQ,CAAC,CAAC,KAAK,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,UAAU,CAAA;SAAE,KAAK,IAAI,CAAC;;;;cAC7D,QAAQ,CAAC,MAAM,IAAI,CAAC;;;;;;qBAFL;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI;;oBAC/C;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI;;uBAJ3C,MAAM,KAAK,IAAI;sBAChB;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;+BAClB;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;qBAGrC,IAAI;;;;;;;4EA6FpD,CAAC"}
@@ -1,94 +0,0 @@
1
- import type { PropType } from 'vue';
2
- import type { Editor, FloatingMenuItemsOverride, IconSet } from '@domternal/core';
3
- import type { FloatingMenuKeymap, FloatingMenuOptions } from '@domternal/extension-block-menu';
4
- export interface DomternalFloatingMenuProps {
5
- editor?: Editor;
6
- shouldShow?: FloatingMenuOptions['shouldShow'];
7
- offset?: number;
8
- items?: FloatingMenuItemsOverride;
9
- keymap?: FloatingMenuKeymap;
10
- icons?: IconSet;
11
- /**
12
- * When true, the menu does NOT auto-show on every empty paragraph;
13
- * it only opens when the BlockHandle `+` button (or any caller of
14
- * `showFloatingMenu`) explicitly triggers it. Notion-style behaviour
15
- * - empty rows show a placeholder, the slash menu is the keyboard
16
- * trigger, the `+` button is the gutter trigger.
17
- * @default false
18
- */
19
- requireExplicitTrigger?: boolean;
20
- }
21
- export declare const DomternalFloatingMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
22
- editor: {
23
- type: PropType<Editor>;
24
- default: undefined;
25
- };
26
- shouldShow: {
27
- type: PropType<FloatingMenuOptions["shouldShow"]>;
28
- default: undefined;
29
- };
30
- offset: {
31
- type: NumberConstructor;
32
- default: number;
33
- };
34
- items: {
35
- type: PropType<FloatingMenuItemsOverride>;
36
- default: undefined;
37
- };
38
- keymap: {
39
- type: PropType<FloatingMenuKeymap>;
40
- default: undefined;
41
- };
42
- icons: {
43
- type: PropType<IconSet>;
44
- default: undefined;
45
- };
46
- requireExplicitTrigger: {
47
- type: BooleanConstructor;
48
- default: boolean;
49
- };
50
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
51
- [key: string]: any;
52
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
- editor: {
54
- type: PropType<Editor>;
55
- default: undefined;
56
- };
57
- shouldShow: {
58
- type: PropType<FloatingMenuOptions["shouldShow"]>;
59
- default: undefined;
60
- };
61
- offset: {
62
- type: NumberConstructor;
63
- default: number;
64
- };
65
- items: {
66
- type: PropType<FloatingMenuItemsOverride>;
67
- default: undefined;
68
- };
69
- keymap: {
70
- type: PropType<FloatingMenuKeymap>;
71
- default: undefined;
72
- };
73
- icons: {
74
- type: PropType<IconSet>;
75
- default: undefined;
76
- };
77
- requireExplicitTrigger: {
78
- type: BooleanConstructor;
79
- default: boolean;
80
- };
81
- }>> & Readonly<{}>, {
82
- editor: Editor;
83
- icons: IconSet;
84
- shouldShow: (props: {
85
- editor: Editor;
86
- view: import("prosemirror-view").EditorView;
87
- state: import("prosemirror-state").EditorState;
88
- }) => boolean;
89
- offset: number;
90
- items: FloatingMenuItemsOverride;
91
- keymap: FloatingMenuKeymap;
92
- requireExplicitTrigger: boolean;
93
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
94
- //# sourceMappingURL=DomternalFloatingMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DomternalFloatingMenu.d.ts","sourceRoot":"","sources":["../src/DomternalFloatingMenu.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAMpC,OAAO,KAAK,EACV,MAAM,EAEN,yBAAyB,EACzB,OAAO,EACR,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAGzC,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,yBAAyB,CAAC;IAClC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,qBAAqB;;cAGJ,QAAQ,CAAC,MAAM,CAAC;;;;cACV,QAAQ,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;;;;;;;;cAG9C,QAAQ,CAAC,yBAAyB,CAAC;;;;cAGtC,QAAQ,CAAC,kBAAkB,CAAC;;;;cAC7B,QAAQ,CAAC,OAAO,CAAC;;;;;;;;;;;cARhB,QAAQ,CAAC,MAAM,CAAC;;;;cACV,QAAQ,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;;;;;;;;cAG9C,QAAQ,CAAC,yBAAyB,CAAC;;;;cAGtC,QAAQ,CAAC,kBAAkB,CAAC;;;;cAC7B,QAAQ,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;4EAsO5C,CAAC"}
@@ -1,44 +0,0 @@
1
- import type { PropType } from 'vue';
2
- import type { Editor } from '@domternal/core';
3
- /**
4
- * Renders the ProseMirror editor view into a div element.
5
- *
6
- * Use this with `useEditor` for a flexible, decoupled pattern where the
7
- * editor composable and rendering are separated.
8
- *
9
- * @example
10
- * ```vue
11
- * <script setup>
12
- * import { useEditor, EditorContent } from '@domternal/vue';
13
- * const { editor } = useEditor({ extensions, content });
14
- * </script>
15
- * <template>
16
- * <EditorContent :editor="editor" class="my-editor" />
17
- * </template>
18
- * ```
19
- */
20
- export declare const EditorContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
21
- editor: {
22
- type: PropType<Editor | null>;
23
- default: null;
24
- };
25
- class: {
26
- type: StringConstructor;
27
- default: undefined;
28
- };
29
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
30
- [key: string]: any;
31
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
- editor: {
33
- type: PropType<Editor | null>;
34
- default: null;
35
- };
36
- class: {
37
- type: StringConstructor;
38
- default: undefined;
39
- };
40
- }>> & Readonly<{}>, {
41
- class: string;
42
- editor: Editor | null;
43
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
44
- //# sourceMappingURL=EditorContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorContent.d.ts","sourceRoot":"","sources":["../src/EditorContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa;;cAIJ,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;;;;;;cAAvB,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;;;;;;;;;;4EA6B3C,CAAC"}
@@ -1,38 +0,0 @@
1
- import type { InjectionKey, ShallowRef } from 'vue';
2
- import type { Editor } from '@domternal/core';
3
- /**
4
- * Typed injection key for the editor instance.
5
- * Components use this via provide/inject to share the editor
6
- * without prop drilling.
7
- */
8
- export declare const EDITOR_KEY: InjectionKey<ShallowRef<Editor | null>>;
9
- /**
10
- * Provides an editor instance to all descendant components via Vue's
11
- * provide/inject system. Also stores the appContext in the WeakMap
12
- * for VueNodeViewRenderer to forward the provide/inject chain.
13
- *
14
- * @example
15
- * ```ts
16
- * const { editor } = useEditor({ extensions, content });
17
- * provideEditor(editor);
18
- * ```
19
- */
20
- export declare function provideEditor(editor: ShallowRef<Editor | null>): void;
21
- /**
22
- * Access the editor instance from the nearest provider.
23
- *
24
- * @returns `{ editor }` where editor is a ShallowRef that may be null
25
- * if the provider has no editor yet or if used outside a provider.
26
- *
27
- * @example
28
- * ```ts
29
- * const { editor } = useCurrentEditor();
30
- * if (editor.value) {
31
- * editor.value.commands.toggleBold();
32
- * }
33
- * ```
34
- */
35
- export declare function useCurrentEditor(): {
36
- editor: ShallowRef<Editor | null>;
37
- };
38
- //# sourceMappingURL=EditorContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EditorContext.d.ts","sourceRoot":"","sources":["../src/EditorContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAA8B,CAAC;AAE9F;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CA8BrE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI;IAAE,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CAAE,CAGxE"}
@@ -1,98 +0,0 @@
1
- import type { PropType, VNode } from 'vue';
2
- import type { Editor, IconSet, BubbleMenuOptions } from '@domternal/core';
3
- export interface DomternalBubbleMenuProps {
4
- editor?: Editor;
5
- shouldShow?: BubbleMenuOptions['shouldShow'];
6
- placement?: 'top' | 'bottom';
7
- offset?: number;
8
- updateDelay?: number;
9
- items?: string[];
10
- contexts?: Record<string, string[] | true | null>;
11
- /** Custom icon overrides. Falls back to default Phosphor icons for unmapped keys. */
12
- icons?: IconSet;
13
- }
14
- export declare const DomternalBubbleMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
- editor: {
16
- type: PropType<Editor>;
17
- default: undefined;
18
- };
19
- shouldShow: {
20
- type: PropType<BubbleMenuOptions["shouldShow"]>;
21
- default: undefined;
22
- };
23
- placement: {
24
- type: PropType<"top" | "bottom">;
25
- default: string;
26
- };
27
- offset: {
28
- type: NumberConstructor;
29
- default: number;
30
- };
31
- updateDelay: {
32
- type: NumberConstructor;
33
- default: number;
34
- };
35
- items: {
36
- type: PropType<string[]>;
37
- default: undefined;
38
- };
39
- contexts: {
40
- type: PropType<Record<string, string[] | true | null>>;
41
- default: undefined;
42
- };
43
- icons: {
44
- type: PropType<IconSet>;
45
- default: undefined;
46
- };
47
- }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
48
- [key: string]: any;
49
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
50
- editor: {
51
- type: PropType<Editor>;
52
- default: undefined;
53
- };
54
- shouldShow: {
55
- type: PropType<BubbleMenuOptions["shouldShow"]>;
56
- default: undefined;
57
- };
58
- placement: {
59
- type: PropType<"top" | "bottom">;
60
- default: string;
61
- };
62
- offset: {
63
- type: NumberConstructor;
64
- default: number;
65
- };
66
- updateDelay: {
67
- type: NumberConstructor;
68
- default: number;
69
- };
70
- items: {
71
- type: PropType<string[]>;
72
- default: undefined;
73
- };
74
- contexts: {
75
- type: PropType<Record<string, string[] | true | null>>;
76
- default: undefined;
77
- };
78
- icons: {
79
- type: PropType<IconSet>;
80
- default: undefined;
81
- };
82
- }>> & Readonly<{}>, {
83
- placement: "bottom" | "top";
84
- editor: Editor;
85
- icons: IconSet;
86
- shouldShow: (props: {
87
- editor: Editor;
88
- view: import("prosemirror-view").EditorView;
89
- state: import("prosemirror-state").EditorState;
90
- from: number;
91
- to: number;
92
- }) => boolean;
93
- offset: number;
94
- updateDelay: number;
95
- items: string[];
96
- contexts: Record<string, true | string[] | null>;
97
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
98
- //# sourceMappingURL=DomternalBubbleMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DomternalBubbleMenu.d.ts","sourceRoot":"","sources":["../../src/bubble-menu/DomternalBubbleMenu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAc,KAAK,EAAE,MAAM,KAAK,CAAC;AAKvD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAkC,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAQ1G,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAClD,qFAAqF;IACrF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB;;cAGF,QAAQ,CAAC,MAAM,CAAC;;;;cACV,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;;;;cAC5C,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;;;;;;;;;;;;cAG/B,QAAQ,CAAC,MAAM,EAAE,CAAC;;;;cACd,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;;;;cACnD,QAAQ,CAAC,OAAO,CAAC;;;;;;;cAPhB,QAAQ,CAAC,MAAM,CAAC;;;;cACV,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;;;;cAC5C,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;;;;;;;;;;;;cAG/B,QAAQ,CAAC,MAAM,EAAE,CAAC;;;;cACd,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;;;;cACnD,QAAQ,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;4EAwJ5C,CAAC"}
@@ -1,57 +0,0 @@
1
- import type { Ref, ShallowRef } from 'vue';
2
- import type { Editor, IconSet, ToolbarButton, ToolbarDropdown, BubbleMenuOptions } from '@domternal/core';
3
- interface BubbleMenuSeparator {
4
- type: 'separator';
5
- name: string;
6
- }
7
- export type BubbleMenuItem = ToolbarButton | ToolbarDropdown | BubbleMenuSeparator;
8
- /**
9
- * Live state for the bubble-menu trailing buttons. Mirrors Angular's
10
- * `syncTrailingButtonsState` output. Computed per editor transaction and
11
- * coalesced into a single object so each transaction triggers at most one
12
- * re-render.
13
- */
14
- export interface BubbleMenuTrailingState {
15
- /** True when current selection is a NodeSelection (image, HR, ...). Trailing buttons hide in that case. */
16
- isNodeSelection: boolean;
17
- /** True when the `notionColorPicker` extension is loaded on this editor (cached once per editor). */
18
- showColorPickerButton: boolean;
19
- /** True when the `blockContextMenu` extension is loaded on this editor (cached once per editor). */
20
- showBlockMenuButton: boolean;
21
- /** True when the selection spans more than one top-level block (multi-block "..." disable). */
22
- blockMenuButtonDisabled: boolean;
23
- /** CSS color value for the "A" trigger glyph (e.g. `var(--dm-block-text-yellow)`), or null. */
24
- currentTextColorVar: string | null;
25
- /** CSS color value for the "A" trigger underline, or null. */
26
- currentBgColorVar: string | null;
27
- /** True when any token-based text or background color is applied at the cursor. */
28
- hasAnyColor: boolean;
29
- }
30
- export interface UseBubbleMenuOptions {
31
- editor: ShallowRef<Editor | null>;
32
- shouldShow?: BubbleMenuOptions['shouldShow'] | undefined;
33
- placement?: 'top' | 'bottom' | undefined;
34
- offset?: number | undefined;
35
- updateDelay?: number | undefined;
36
- items?: string[] | undefined;
37
- contexts?: Record<string, string[] | true | null> | undefined;
38
- icons?: ShallowRef<IconSet | undefined> | undefined;
39
- }
40
- export interface UseBubbleMenuResult {
41
- menuRef: Ref<HTMLDivElement | undefined>;
42
- resolvedItems: ShallowRef<BubbleMenuItem[]>;
43
- isItemActive: (item: ToolbarButton) => boolean;
44
- isItemDisabled: (item: ToolbarButton) => boolean;
45
- executeCommand: (item: ToolbarButton, event?: Event) => void;
46
- activeVersion: Ref<number>;
47
- getCachedIcon: (name: string) => string;
48
- /** Live trailing-button state (color preview, node-selection gate, multi-block disable). */
49
- trailing: ShallowRef<BubbleMenuTrailingState>;
50
- /** Open the Notion color picker by emitting `notionColorOpen` with the trigger as anchor. */
51
- openColorPicker: (anchor: HTMLElement) => void;
52
- /** Open the block context menu by dispatching `dm:block-context-menu-open` on `.dm-editor`. */
53
- openBlockContextMenu: (anchor: HTMLElement) => void;
54
- }
55
- export declare function useBubbleMenu(options: UseBubbleMenuOptions): UseBubbleMenuResult;
56
- export {};
57
- //# sourceMappingURL=useBubbleMenu.d.ts.map