@prosekit/vue 0.7.0-beta.3 → 0.7.0-beta.5
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/dist/editor-context.js +0 -2
- package/dist/editor-context.js.map +1 -1
- package/dist/prosekit-vue-autocomplete.d.ts +12 -63
- package/dist/prosekit-vue-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-vue-autocomplete.js +7 -52
- package/dist/prosekit-vue-autocomplete.js.map +1 -1
- package/dist/prosekit-vue-block-handle.d.ts +12 -63
- package/dist/prosekit-vue-block-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-block-handle.js +7 -52
- package/dist/prosekit-vue-block-handle.js.map +1 -1
- package/dist/prosekit-vue-drop-indicator.d.ts +2 -13
- package/dist/prosekit-vue-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-vue-drop-indicator.js +1 -10
- package/dist/prosekit-vue-drop-indicator.js.map +1 -1
- package/dist/prosekit-vue-inline-popover.d.ts +9 -40
- package/dist/prosekit-vue-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-inline-popover.js +5 -32
- package/dist/prosekit-vue-inline-popover.js.map +1 -1
- package/dist/prosekit-vue-menu.d.ts +49 -89
- package/dist/prosekit-vue-menu.d.ts.map +1 -1
- package/dist/prosekit-vue-menu.js +72 -76
- package/dist/prosekit-vue-menu.js.map +1 -1
- package/dist/prosekit-vue-popover.d.ts +10 -51
- package/dist/prosekit-vue-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-popover.js +6 -42
- package/dist/prosekit-vue-popover.js.map +1 -1
- package/dist/prosekit-vue-resizable.d.ts +6 -27
- package/dist/prosekit-vue-resizable.d.ts.map +1 -1
- package/dist/prosekit-vue-resizable.js +4 -22
- package/dist/prosekit-vue-resizable.js.map +1 -1
- package/dist/prosekit-vue-table-handle.d.ts +22 -133
- package/dist/prosekit-vue-table-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-table-handle.js +11 -110
- package/dist/prosekit-vue-table-handle.js.map +1 -1
- package/dist/prosekit-vue-tooltip.d.ts +10 -51
- package/dist/prosekit-vue-tooltip.d.ts.map +1 -1
- package/dist/prosekit-vue-tooltip.js +6 -42
- package/dist/prosekit-vue-tooltip.js.map +1 -1
- package/dist/prosekit-vue.d.ts +0 -19
- package/dist/prosekit-vue.d.ts.map +1 -1
- package/dist/prosekit-vue.js +0 -24
- package/dist/prosekit-vue.js.map +1 -1
- package/package.json +3 -3
- package/src/components/autocomplete/autocomplete-empty.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-item.gen.ts +3 -15
- package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -15
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-root.gen.ts +3 -15
- package/src/components/autocomplete/index.gen.ts +4 -8
- package/src/components/block-handle/block-handle-add.gen.ts +3 -13
- package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
- package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
- package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
- package/src/components/block-handle/block-handle-root.gen.ts +3 -15
- package/src/components/block-handle/index.gen.ts +2 -6
- package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
- package/src/components/drop-indicator/index.gen.ts +1 -3
- package/src/components/inline-popover/index.gen.ts +2 -6
- package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
- package/src/components/inline-popover/inline-popover-root.gen.ts +4 -16
- package/src/components/menu/index.gen.ts +4 -8
- package/src/components/menu/menu-item.gen.ts +3 -15
- package/src/components/menu/menu-popup.gen.ts +3 -13
- package/src/components/menu/menu-positioner.gen.ts +3 -13
- package/src/components/menu/menu-root.gen.ts +3 -15
- package/src/components/menu/menu-submenu-root.gen.ts +68 -21
- package/src/components/menu/menu-submenu-trigger.gen.ts +41 -21
- package/src/components/menu/menu-trigger.gen.ts +3 -15
- package/src/components/popover/index.gen.ts +3 -7
- package/src/components/popover/popover-popup.gen.ts +3 -13
- package/src/components/popover/popover-positioner.gen.ts +3 -13
- package/src/components/popover/popover-root.gen.ts +3 -15
- package/src/components/popover/popover-trigger.gen.ts +3 -15
- package/src/components/resizable/index.gen.ts +2 -6
- package/src/components/resizable/resizable-handle.gen.ts +3 -13
- package/src/components/resizable/resizable-root.gen.ts +3 -15
- package/src/components/table-handle/index.gen.ts +1 -3
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
- package/src/components/table-handle/table-handle-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
- package/src/components/tooltip/index.gen.ts +2 -6
- package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
- package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
- package/src/components/tooltip/tooltip-root.gen.ts +3 -15
- package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
package/dist/prosekit-vue.js
CHANGED
|
@@ -2,7 +2,6 @@ import { n as useEditorContext, t as provideEditor } from "./editor-context.js";
|
|
|
2
2
|
import { Teleport, computed, defineComponent, h, markRaw, onMounted, onUnmounted, shallowRef, toValue, triggerRef, watchPostEffect } from "vue";
|
|
3
3
|
import { EditorNotFoundError, ProseKitError, defineDocChangeHandler, defineKeymap, defineMarkViewComponent, defineMarkViewFactory, defineMountHandler, defineNodeViewComponent, defineNodeViewFactory, defineUpdateHandler, union, withPriority } from "@prosekit/core";
|
|
4
4
|
import { AbstractVueMarkView, AbstractVueNodeView, buildVueMarkViewCreator, buildVueNodeViewCreator, useVueRenderer } from "@prosemirror-adapter/vue";
|
|
5
|
-
//#region src/extensions/vue-mark-view.ts
|
|
6
5
|
var ProseKitVueMarkView = class extends AbstractVueMarkView {
|
|
7
6
|
constructor(..._args) {
|
|
8
7
|
super(..._args);
|
|
@@ -45,8 +44,6 @@ function defineVueMarkView(options) {
|
|
|
45
44
|
args: options
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/extensions/vue-node-view.ts
|
|
50
47
|
var ProseKitVueNodeView = class extends AbstractVueNodeView {
|
|
51
48
|
constructor(..._args) {
|
|
52
49
|
super(..._args);
|
|
@@ -89,8 +86,6 @@ function defineVueNodeView(options) {
|
|
|
89
86
|
args: options
|
|
90
87
|
});
|
|
91
88
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/hooks/use-editor-extension.ts
|
|
94
89
|
/**
|
|
95
90
|
* @internal
|
|
96
91
|
*/
|
|
@@ -103,8 +98,6 @@ function useEditorExtension(editorRef, extensionRef) {
|
|
|
103
98
|
if (extension) onCleanup(editor.use(extension));
|
|
104
99
|
});
|
|
105
100
|
}
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/components/view-renderer.ts
|
|
108
101
|
/**
|
|
109
102
|
* @internal
|
|
110
103
|
*/
|
|
@@ -120,8 +113,6 @@ const ViewRenderer = defineComponent({
|
|
|
120
113
|
return () => [slots.default?.(), render()];
|
|
121
114
|
}
|
|
122
115
|
});
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/components/prosekit.ts
|
|
125
116
|
/**
|
|
126
117
|
* The root component for a ProseKit editor.
|
|
127
118
|
*
|
|
@@ -138,8 +129,6 @@ const ProseKit = defineComponent({
|
|
|
138
129
|
return () => h(ViewRenderer, { editor: props.editor }, () => slots.default?.());
|
|
139
130
|
}
|
|
140
131
|
});
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region src/hooks/use-priority-extension.ts
|
|
143
132
|
/**
|
|
144
133
|
* @internal
|
|
145
134
|
*/
|
|
@@ -149,8 +138,6 @@ function usePriorityExtension(extension, priority) {
|
|
|
149
138
|
return ext && priority ? withPriority(ext, priority) : ext;
|
|
150
139
|
});
|
|
151
140
|
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/hooks/use-extension.ts
|
|
154
141
|
/**
|
|
155
142
|
* Add an extension to the editor.
|
|
156
143
|
*
|
|
@@ -159,8 +146,6 @@ function usePriorityExtension(extension, priority) {
|
|
|
159
146
|
function useExtension(extension, options) {
|
|
160
147
|
useEditorExtension(options?.editor, usePriorityExtension(extension, options?.priority));
|
|
161
148
|
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/hooks/use-doc-change.ts
|
|
164
149
|
/**
|
|
165
150
|
* Calls the given handler whenever the editor document changes.
|
|
166
151
|
*
|
|
@@ -169,8 +154,6 @@ function useExtension(extension, options) {
|
|
|
169
154
|
function useDocChange(handler, options) {
|
|
170
155
|
useExtension(defineDocChangeHandler((view) => handler(view.state.doc)), options);
|
|
171
156
|
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/hooks/use-editor.ts
|
|
174
157
|
/**
|
|
175
158
|
* Retrieves the editor instance from the nearest ProseKit component.
|
|
176
159
|
*
|
|
@@ -190,8 +173,6 @@ function useEditor(options) {
|
|
|
190
173
|
}
|
|
191
174
|
return editorRef;
|
|
192
175
|
}
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region src/hooks/use-editor-derived-value.ts
|
|
195
176
|
/**
|
|
196
177
|
* Runs a function to derive a value from the editor instance after editor state
|
|
197
178
|
* changes.
|
|
@@ -209,13 +190,9 @@ function useEditorDerivedValue(derive, options) {
|
|
|
209
190
|
const editorAccessor = initialEditor ? computed(() => toValue(initialEditor)) : useEditor({ update: true });
|
|
210
191
|
return computed(() => derive(toValue(editorAccessor)));
|
|
211
192
|
}
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/hooks/use-keymap.ts
|
|
214
193
|
function useKeymap(keymap, options) {
|
|
215
194
|
useExtension(computed(() => defineKeymap(toValue(keymap))), options);
|
|
216
195
|
}
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region src/hooks/use-state-update.ts
|
|
219
196
|
/**
|
|
220
197
|
* Calls the given handler whenever the editor state changes.
|
|
221
198
|
*
|
|
@@ -224,7 +201,6 @@ function useKeymap(keymap, options) {
|
|
|
224
201
|
function useStateUpdate(handler, options) {
|
|
225
202
|
useExtension(defineUpdateHandler((view) => handler(view.state)), options);
|
|
226
203
|
}
|
|
227
|
-
//#endregion
|
|
228
204
|
export { ProseKit, defineVueMarkView, defineVueNodeView, useDocChange, useEditor, useEditorDerivedValue, useExtension, useKeymap, useStateUpdate };
|
|
229
205
|
|
|
230
206
|
//# sourceMappingURL=prosekit-vue.js.map
|
package/dist/prosekit-vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-vue.js","names":[],"sources":["../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueMarkView,\n buildVueMarkViewCreator,\n type MarkViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\n/**\n * @public\n */\nexport interface VueMarkViewProps extends MarkViewContext {}\n\n/**\n * @public\n */\nexport type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>\n\n/**\n * Options for {@link defineVueMarkView}.\n *\n * @public\n */\nexport interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nclass ProseKitVueMarkView extends AbstractVueMarkView<VueMarkViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorMarkView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueMarkViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueMarkViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueMarkView)\n return defineMarkViewFactory<VueMarkViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Vue component.\n *\n * @public\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n return defineMarkViewComponent<VueMarkViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueNodeView,\n buildVueNodeViewCreator,\n type NodeViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\n/**\n * @public\n */\nexport interface VueNodeViewProps extends NodeViewContext {}\n\n/**\n * @public\n */\nexport type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>\n\n/**\n * Options for {@link defineVueNodeView}.\n *\n * @public\n */\nexport interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nclass ProseKitVueNodeView extends AbstractVueNodeView<VueNodeViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorNodeView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueNodeViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueNodeViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueNodeView)\n return defineNodeViewFactory<VueNodeViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Vue component.\n *\n * @public\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n return defineNodeViewComponent<VueNodeViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { toValue, watchPostEffect, type MaybeRefOrGetter } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorRef: MaybeRefOrGetter<Editor> | null | undefined,\n extensionRef: MaybeRefOrGetter<Extension | null> | null,\n): void {\n const editorContext = useEditorContext()\n\n watchPostEffect((onCleanup) => {\n const editor = toValue(editorRef) || toValue(editorContext)\n const extension = toValue(extensionRef)\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import { union, type Editor } from '@prosekit/core'\nimport { useVueRenderer } from '@prosemirror-adapter/vue'\nimport { defineComponent, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { defineVueMarkViewFactory } from '../extensions/vue-mark-view.ts'\nimport { defineVueNodeViewFactory } from '../extensions/vue-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\n/**\n * @internal\n */\ninterface ViewRendererProps {\n editor: Editor\n}\n\n/**\n * @internal\n */\nexport const ViewRenderer: DefineSetupFnComponent<ViewRendererProps> = defineComponent<ViewRendererProps>({\n name: 'ViewRenderer',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n const { renderVueRenderer, removeVueRenderer, render } = useVueRenderer()\n\n const extension = union([\n defineVueMarkViewFactory(renderVueRenderer, removeVueRenderer),\n defineVueNodeViewFactory(renderVueRenderer, removeVueRenderer),\n ])\n\n useEditorExtension(() => props.editor, extension)\n\n return () => [slots.default?.(), render()]\n },\n})\n","import type { Editor } from '@prosekit/core'\nimport { defineComponent, h, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { provideEditor } from '../injection/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\n\nexport interface ProseKitProps {\n editor: Editor\n}\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: DefineSetupFnComponent<ProseKitProps> = defineComponent<ProseKitProps>({\n name: 'ProseKit',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n provideEditor(props.editor)\n return () =>\n h(\n ViewRenderer,\n { editor: props.editor },\n () => slots.default?.(),\n )\n },\n})\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from 'vue'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: MaybeRefOrGetter<T | null>,\n priority: Priority | null | undefined,\n): ComputedRef<T | null> {\n return computed(() => {\n const ext = toValue(extension)\n return ext && priority ? withPriority(ext, priority) : ext\n })\n}\n","import type { Editor, Extension, Priority } from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n *\n * @public\n */\nexport function useExtension(\n /**\n * The ref to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: MaybeRefOrGetter<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(extension, options)\n}\n","import { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { onMounted, onUnmounted, shallowRef, triggerRef, type ShallowRef } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): ShallowRef<Editor<E>> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const editorRef = shallowRef<Editor<E>>(editor)\n\n if (update) {\n const forceUpdate = () => triggerRef(editorRef)\n onMounted(() => {\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n const dispose = editor.use(extension)\n onUnmounted(dispose)\n })\n }\n\n return editorRef\n}\n","import type { Editor, Extension } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue'\n\nimport { useEditor } from './use-editor.ts'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns a shallow ref of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): ShallowRef<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Ref<Editor<E>> = initialEditor\n ? computed(() => toValue(initialEditor))\n : useEditor<E>({ update: true })\n\n return computed(() => derive(toValue(editorAccessor)))\n}\n","import { defineKeymap, type Keymap } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\nexport function useKeymap(\n keymap: MaybeRefOrGetter<Keymap>,\n options?: UseExtensionOptions,\n): void {\n const extension = computed(() => defineKeymap(toValue(keymap)))\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(extension, options)\n}\n"],"mappings":";;;;;AAiCA,IAAM,sBAAN,cAAkC,oBAA0C;;;sBACrC;G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B,OAAO;AAE/C,KAAI,QAAQ;EACV,MAAM,oBAAoB,WAAW,UAAU;AAC/C,kBAAgB;GACd,MAAM,YAAY,MAChB,mBAAmB,YAAY,EAC/B,oBAAoB,YAAY,CACjC;AAED,eADgB,OAAO,IAAI,UAAU,CACjB;IACpB;;AAGJ,QAAO;;;;;;;;;;;;;;;;ACjBT,SAAgB,sBAOd,QACA,SACqB;CACrB,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiC,gBACnC,eAAe,QAAQ,cAAc,CAAC,GACtC,UAAa,EAAE,QAAQ,MAAM,CAAC;AAElC,QAAO,eAAe,OAAO,QAAQ,eAAe,CAAC,CAAC;;;;ACnCxD,SAAgB,UACd,QACA,SACM;AAEN,cADkB,eAAe,aAAa,QAAQ,OAAO,CAAC,CAAC,EACvC,QAAQ;;;;;;;;;ACAlC,SAAgB,eACd,SACA,SACM;AAEN,cADkB,qBAAqB,SAAS,QAAQ,KAAK,MAAM,CAAC,EAC5C,QAAQ"}
|
|
1
|
+
{"version":3,"file":"prosekit-vue.js","names":[],"sources":["../src/extensions/vue-mark-view.ts","../src/extensions/vue-node-view.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueMarkView,\n buildVueMarkViewCreator,\n type MarkViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\n/**\n * @public\n */\nexport interface VueMarkViewProps extends MarkViewContext {}\n\n/**\n * @public\n */\nexport type VueMarkViewComponent = DefineComponent<VueMarkViewProps, any, any>\n\n/**\n * Options for {@link defineVueMarkView}.\n *\n * @public\n */\nexport interface VueMarkViewOptions extends CoreMarkViewUserOptions<VueMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nclass ProseKitVueMarkView extends AbstractVueMarkView<VueMarkViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorMarkView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueMarkViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueMarkViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueMarkView)\n return defineMarkViewFactory<VueMarkViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Vue component.\n *\n * @public\n */\nexport function defineVueMarkView(options: VueMarkViewOptions): Extension {\n return defineMarkViewComponent<VueMarkViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractVueNodeView,\n buildVueNodeViewCreator,\n type NodeViewContext,\n type VueRendererComponent,\n type VueRendererResult,\n} from '@prosemirror-adapter/vue'\nimport { defineComponent, h, markRaw, Teleport, type DefineComponent } from 'vue'\n\n/**\n * @public\n */\nexport interface VueNodeViewProps extends NodeViewContext {}\n\n/**\n * @public\n */\nexport type VueNodeViewComponent = DefineComponent<VueNodeViewProps, any, any>\n\n/**\n * Options for {@link defineVueNodeView}.\n *\n * @public\n */\nexport interface VueNodeViewOptions extends CoreNodeViewUserOptions<VueNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nclass ProseKitVueNodeView extends AbstractVueNodeView<VueNodeViewComponent> {\n render = (): VueRendererComponent => {\n const UserComponent = this.component\n const render = () => {\n const props = this.context\n return h(Teleport, { key: this.key, to: this.dom }, [h(UserComponent, props)])\n }\n const RendererComponent: VueRendererComponent = defineComponent({\n name: 'ProsemirrorNodeView',\n setup: () => {\n return render\n },\n })\n return markRaw(RendererComponent)\n }\n}\n\n/**\n * @internal\n */\nexport function defineVueNodeViewFactory(\n renderVueRenderer: VueRendererResult['renderVueRenderer'],\n removeVueRenderer: VueRendererResult['removeVueRenderer'],\n): Extension {\n const factory = buildVueNodeViewCreator(renderVueRenderer, removeVueRenderer, ProseKitVueNodeView)\n return defineNodeViewFactory<VueNodeViewOptions>({\n group: 'vue',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Vue component.\n *\n * @public\n */\nexport function defineVueNodeView(options: VueNodeViewOptions): Extension {\n return defineNodeViewComponent<VueNodeViewOptions>({\n group: 'vue',\n name: options.name,\n args: options,\n })\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { toValue, watchPostEffect, type MaybeRefOrGetter } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorRef: MaybeRefOrGetter<Editor> | null | undefined,\n extensionRef: MaybeRefOrGetter<Extension | null> | null,\n): void {\n const editorContext = useEditorContext()\n\n watchPostEffect((onCleanup) => {\n const editor = toValue(editorRef) || toValue(editorContext)\n const extension = toValue(extensionRef)\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import { union, type Editor } from '@prosekit/core'\nimport { useVueRenderer } from '@prosemirror-adapter/vue'\nimport { defineComponent, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { defineVueMarkViewFactory } from '../extensions/vue-mark-view.ts'\nimport { defineVueNodeViewFactory } from '../extensions/vue-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\n/**\n * @internal\n */\ninterface ViewRendererProps {\n editor: Editor\n}\n\n/**\n * @internal\n */\nexport const ViewRenderer: DefineSetupFnComponent<ViewRendererProps> = defineComponent<ViewRendererProps>({\n name: 'ViewRenderer',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n const { renderVueRenderer, removeVueRenderer, render } = useVueRenderer()\n\n const extension = union([\n defineVueMarkViewFactory(renderVueRenderer, removeVueRenderer),\n defineVueNodeViewFactory(renderVueRenderer, removeVueRenderer),\n ])\n\n useEditorExtension(() => props.editor, extension)\n\n return () => [slots.default?.(), render()]\n },\n})\n","import type { Editor } from '@prosekit/core'\nimport { defineComponent, h, type DefineSetupFnComponent, type PropType } from 'vue'\n\nimport { provideEditor } from '../injection/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\n\nexport interface ProseKitProps {\n editor: Editor\n}\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: DefineSetupFnComponent<ProseKitProps> = defineComponent<ProseKitProps>({\n name: 'ProseKit',\n props: { editor: { type: Object as PropType<Editor>, required: true } },\n setup: (props, { slots }) => {\n provideEditor(props.editor)\n return () =>\n h(\n ViewRenderer,\n { editor: props.editor },\n () => slots.default?.(),\n )\n },\n})\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from 'vue'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: MaybeRefOrGetter<T | null>,\n priority: Priority | null | undefined,\n): ComputedRef<T | null> {\n return computed(() => {\n const ext = toValue(extension)\n return ext && priority ? withPriority(ext, priority) : ext\n })\n}\n","import type { Editor, Extension, Priority } from '@prosekit/core'\nimport type { MaybeRefOrGetter } from 'vue'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n *\n * @public\n */\nexport function useExtension(\n /**\n * The ref to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: MaybeRefOrGetter<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(extension, options)\n}\n","import { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { onMounted, onUnmounted, shallowRef, triggerRef, type ShallowRef } from 'vue'\n\nimport { useEditorContext } from '../injection/editor-context.ts'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): ShallowRef<Editor<E>> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const editorRef = shallowRef<Editor<E>>(editor)\n\n if (update) {\n const forceUpdate = () => triggerRef(editorRef)\n onMounted(() => {\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n const dispose = editor.use(extension)\n onUnmounted(dispose)\n })\n }\n\n return editorRef\n}\n","import type { Editor, Extension } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue'\n\nimport { useEditor } from './use-editor.ts'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeRefOrGetter<Editor<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns a shallow ref of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): ShallowRef<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Ref<Editor<E>> = initialEditor\n ? computed(() => toValue(initialEditor))\n : useEditor<E>({ update: true })\n\n return computed(() => derive(toValue(editorAccessor)))\n}\n","import { defineKeymap, type Keymap } from '@prosekit/core'\nimport { computed, toValue, type MaybeRefOrGetter } from 'vue'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\nexport function useKeymap(\n keymap: MaybeRefOrGetter<Keymap>,\n options?: UseExtensionOptions,\n): void {\n const extension = computed(() => defineKeymap(toValue(keymap)))\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(extension, options)\n}\n"],"mappings":";;;;AAiCA,IAAM,sBAAN,cAAkC,oBAA0C;;;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E/C,KAAI,QAAQ;EACV,MAAM,oBAAoB,WAAW,UAAU;AAC/C,kBAAgB;GACd,MAAM,YAAY,MAChB,mBAAmB,YAAY,EAC/B,oBAAoB,YAAY,CACjC;AAED,eADgB,OAAO,IAAI,UAAU,CACjB;IACpB;;AAGJ,QAAO;;;;;;;;;;;;;;ACjBT,SAAgB,sBAOd,QACA,SACqB;CACrB,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiC,gBACnC,eAAe,QAAQ,cAAc,CAAC,GACtC,UAAa,EAAE,QAAQ,MAAM,CAAC;AAElC,QAAO,eAAe,OAAO,QAAQ,eAAe,CAAC,CAAC;;ACnCxD,SAAgB,UACd,QACA,SACM;AAEN,cADkB,eAAe,aAAa,QAAQ,OAAO,CAAC,CAAC,EACvC,QAAQ;;;;;;;ACAlC,SAAgB,eACd,SACA,SACM;AAEN,cADkB,qBAAqB,SAAS,QAAQ,KAAK,MAAM,CAAC,EAC5C,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.0-beta.
|
|
4
|
+
"version": "0.7.0-beta.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Vue components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@prosemirror-adapter/vue": "^0.5.3",
|
|
77
77
|
"@prosekit/core": "^0.12.0-beta.0",
|
|
78
78
|
"@prosekit/pm": "^0.1.15",
|
|
79
|
-
"@prosekit/web": "^0.8.0-beta.
|
|
79
|
+
"@prosekit/web": "^0.8.0-beta.4"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"vue": ">= 3.0.0"
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"vitest-browser-vue": "^2.1.0",
|
|
96
96
|
"vue": "^3.5.32",
|
|
97
97
|
"@prosekit/config-ts": "0.0.0",
|
|
98
|
-
"@prosekit/config-tsdown": "0.0.0",
|
|
99
98
|
"@prosekit/config-vitest": "0.0.0",
|
|
99
|
+
"@prosekit/config-tsdown": "0.0.0",
|
|
100
100
|
"@prosekit/testing": "0.0.0"
|
|
101
101
|
},
|
|
102
102
|
"publishConfig": {
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerAutocompleteEmptyElement } from '@prosekit/web/autocomplete';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link AutocompleteEmpty} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link AutocompleteEmpty} Vue component. */
|
|
13
7
|
export interface AutocompleteEmptyProps {}
|
|
14
8
|
|
|
15
|
-
/**
|
|
16
|
-
* A Vue component that renders an `prosekit-autocomplete-empty` custom element.
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
9
|
+
/** A Vue component that renders an `prosekit-autocomplete-empty` custom element. */
|
|
20
10
|
export const AutocompleteEmpty: DefineSetupFnComponent<AutocompleteEmptyProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteEmptyProps & HTMLAttributes>(
|
|
21
11
|
(props, { slots }) => {
|
|
22
12
|
registerAutocompleteEmptyElement();
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerAutocompleteItemElement, type AutocompleteItemEvents, type AutocompleteItemProps as AutocompleteItemElementProps } from '@prosekit/web/autocomplete';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link AutocompleteItem} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link AutocompleteItem} Vue component. */
|
|
13
7
|
export interface AutocompleteItemProps {
|
|
14
8
|
/**
|
|
15
9
|
* The value of the item, which will be matched against the query.
|
|
@@ -29,11 +23,7 @@ export interface AutocompleteItemProps {
|
|
|
29
23
|
onSelect?: (event: AutocompleteItemEvents['select']) => void;
|
|
30
24
|
}
|
|
31
25
|
|
|
32
|
-
/**
|
|
33
|
-
* A Vue component that renders an `prosekit-autocomplete-item` custom element.
|
|
34
|
-
*
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
26
|
+
/** A Vue component that renders an `prosekit-autocomplete-item` custom element. */
|
|
37
27
|
export const AutocompleteItem: DefineSetupFnComponent<AutocompleteItemProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteItemProps & HTMLAttributes>(
|
|
38
28
|
(props, { slots }) => {
|
|
39
29
|
registerAutocompleteItemElement();
|
|
@@ -83,5 +73,3 @@ export const AutocompleteItem: DefineSetupFnComponent<AutocompleteItemProps & HT
|
|
|
83
73
|
},
|
|
84
74
|
{ props: ['disabled', 'value', 'onSelect'] },
|
|
85
75
|
);
|
|
86
|
-
|
|
87
|
-
export type { AutocompleteItemEvents };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerAutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link AutocompletePopup} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link AutocompletePopup} Vue component. */
|
|
13
7
|
export interface AutocompletePopupProps {
|
|
14
8
|
/**
|
|
15
9
|
* Emitted when the selected value changes. Only available when multiple is
|
|
@@ -23,11 +17,7 @@ export interface AutocompletePopupProps {
|
|
|
23
17
|
onValuesChange?: (event: AutocompletePopupEvents['valuesChange']) => void;
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
/**
|
|
27
|
-
* A Vue component that renders an `prosekit-autocomplete-popup` custom element.
|
|
28
|
-
*
|
|
29
|
-
* @public
|
|
30
|
-
*/
|
|
20
|
+
/** A Vue component that renders an `prosekit-autocomplete-popup` custom element. */
|
|
31
21
|
export const AutocompletePopup: DefineSetupFnComponent<AutocompletePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePopupProps & HTMLAttributes>(
|
|
32
22
|
(props, { slots }) => {
|
|
33
23
|
registerAutocompletePopupElement();
|
|
@@ -76,5 +66,3 @@ export const AutocompletePopup: DefineSetupFnComponent<AutocompletePopupProps &
|
|
|
76
66
|
},
|
|
77
67
|
{ props: ['onValueChange', 'onValuesChange'] },
|
|
78
68
|
);
|
|
79
|
-
|
|
80
|
-
export type { AutocompletePopupEvents };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerAutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link AutocompletePositioner} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link AutocompletePositioner} Vue component. */
|
|
13
7
|
export interface AutocompletePositionerProps {
|
|
14
8
|
/**
|
|
15
9
|
* The placement of the popover, relative to the text cursor.
|
|
@@ -115,11 +109,7 @@ export interface AutocompletePositionerProps {
|
|
|
115
109
|
altBoundary?: AutocompletePositionerElementProps['altBoundary'];
|
|
116
110
|
}
|
|
117
111
|
|
|
118
|
-
/**
|
|
119
|
-
* A Vue component that renders an `prosekit-autocomplete-positioner` custom element.
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
112
|
+
/** A Vue component that renders an `prosekit-autocomplete-positioner` custom element. */
|
|
123
113
|
export const AutocompletePositioner: DefineSetupFnComponent<AutocompletePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompletePositionerProps & HTMLAttributes>(
|
|
124
114
|
(props, { slots }) => {
|
|
125
115
|
registerAutocompletePositionerElement();
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerAutocompleteRootElement, type AutocompleteRootEvents, type AutocompleteRootProps as AutocompleteRootElementProps } from '@prosekit/web/autocomplete';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
6
|
import { useEditorContext } from '../../injection/editor-context.ts';
|
|
9
7
|
|
|
10
|
-
/**
|
|
11
|
-
* Props for the {@link AutocompleteRoot} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link AutocompleteRoot} Vue component. */
|
|
15
9
|
export interface AutocompleteRootProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -49,11 +43,7 @@ export interface AutocompleteRootProps {
|
|
|
49
43
|
onValuesChange?: (event: AutocompleteRootEvents['valuesChange']) => void;
|
|
50
44
|
}
|
|
51
45
|
|
|
52
|
-
/**
|
|
53
|
-
* A Vue component that renders an `prosekit-autocomplete-root` custom element.
|
|
54
|
-
*
|
|
55
|
-
* @public
|
|
56
|
-
*/
|
|
46
|
+
/** A Vue component that renders an `prosekit-autocomplete-root` custom element. */
|
|
57
47
|
export const AutocompleteRoot: DefineSetupFnComponent<AutocompleteRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<AutocompleteRootProps & HTMLAttributes>(
|
|
58
48
|
(props, { slots }) => {
|
|
59
49
|
registerAutocompleteRootElement();
|
|
@@ -108,5 +98,3 @@ export const AutocompleteRoot: DefineSetupFnComponent<AutocompleteRootProps & HT
|
|
|
108
98
|
},
|
|
109
99
|
{ props: ['editor', 'filter', 'regex', 'onOpenChange', 'onQueryChange', 'onValueChange', 'onValuesChange'] },
|
|
110
100
|
);
|
|
111
|
-
|
|
112
|
-
export type { AutocompleteRootEvents };
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
export { AutocompleteEmpty, type AutocompleteEmptyProps } from './autocomplete-empty.gen.ts';
|
|
6
4
|
|
|
7
|
-
export { AutocompleteItem, type AutocompleteItemProps
|
|
5
|
+
export { AutocompleteItem, type AutocompleteItemProps } from './autocomplete-item.gen.ts';
|
|
8
6
|
|
|
9
|
-
export { AutocompletePopup, type AutocompletePopupProps
|
|
7
|
+
export { AutocompletePopup, type AutocompletePopupProps } from './autocomplete-popup.gen.ts';
|
|
10
8
|
|
|
11
9
|
export { AutocompletePositioner, type AutocompletePositionerProps } from './autocomplete-positioner.gen.ts';
|
|
12
10
|
|
|
13
|
-
export { AutocompleteRoot, type AutocompleteRootProps
|
|
14
|
-
|
|
15
|
-
export { OpenChangeEvent, QueryChangeEvent, SelectEvent, ValueChangeEvent, ValuesChangeEvent } from '@prosekit/web/autocomplete';
|
|
11
|
+
export { AutocompleteRoot, type AutocompleteRootProps } from './autocomplete-root.gen.ts';
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerBlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
6
|
import { useEditorContext } from '../../injection/editor-context.ts';
|
|
9
7
|
|
|
10
|
-
/**
|
|
11
|
-
* Props for the {@link BlockHandleAdd} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link BlockHandleAdd} Vue component. */
|
|
15
9
|
export interface BlockHandleAddProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -22,11 +16,7 @@ export interface BlockHandleAddProps {
|
|
|
22
16
|
editor?: BlockHandleAddElementProps['editor'];
|
|
23
17
|
}
|
|
24
18
|
|
|
25
|
-
/**
|
|
26
|
-
* A Vue component that renders an `prosekit-block-handle-add` custom element.
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
19
|
+
/** A Vue component that renders an `prosekit-block-handle-add` custom element. */
|
|
30
20
|
export const BlockHandleAdd: DefineSetupFnComponent<BlockHandleAddProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleAddProps & HTMLAttributes>(
|
|
31
21
|
(props, { slots }) => {
|
|
32
22
|
registerBlockHandleAddElement();
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerBlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
6
|
import { useEditorContext } from '../../injection/editor-context.ts';
|
|
9
7
|
|
|
10
|
-
/**
|
|
11
|
-
* Props for the {@link BlockHandleDraggable} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link BlockHandleDraggable} Vue component. */
|
|
15
9
|
export interface BlockHandleDraggableProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -22,11 +16,7 @@ export interface BlockHandleDraggableProps {
|
|
|
22
16
|
editor?: BlockHandleDraggableElementProps['editor'];
|
|
23
17
|
}
|
|
24
18
|
|
|
25
|
-
/**
|
|
26
|
-
* A Vue component that renders an `prosekit-block-handle-draggable` custom element.
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
19
|
+
/** A Vue component that renders an `prosekit-block-handle-draggable` custom element. */
|
|
30
20
|
export const BlockHandleDraggable: DefineSetupFnComponent<BlockHandleDraggableProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleDraggableProps & HTMLAttributes>(
|
|
31
21
|
(props, { slots }) => {
|
|
32
22
|
registerBlockHandleDraggableElement();
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerBlockHandlePopupElement } from '@prosekit/web/block-handle';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link BlockHandlePopup} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link BlockHandlePopup} Vue component. */
|
|
13
7
|
export interface BlockHandlePopupProps {}
|
|
14
8
|
|
|
15
|
-
/**
|
|
16
|
-
* A Vue component that renders an `prosekit-block-handle-popup` custom element.
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
9
|
+
/** A Vue component that renders an `prosekit-block-handle-popup` custom element. */
|
|
20
10
|
export const BlockHandlePopup: DefineSetupFnComponent<BlockHandlePopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePopupProps & HTMLAttributes>(
|
|
21
11
|
(props, { slots }) => {
|
|
22
12
|
registerBlockHandlePopupElement();
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerBlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link BlockHandlePositioner} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link BlockHandlePositioner} Vue component. */
|
|
13
7
|
export interface BlockHandlePositionerProps {
|
|
14
8
|
/**
|
|
15
9
|
* The placement of the popover, relative to the hovered block.
|
|
@@ -133,11 +127,7 @@ export interface BlockHandlePositionerProps {
|
|
|
133
127
|
altBoundary?: BlockHandlePositionerElementProps['altBoundary'];
|
|
134
128
|
}
|
|
135
129
|
|
|
136
|
-
/**
|
|
137
|
-
* A Vue component that renders an `prosekit-block-handle-positioner` custom element.
|
|
138
|
-
*
|
|
139
|
-
* @public
|
|
140
|
-
*/
|
|
130
|
+
/** A Vue component that renders an `prosekit-block-handle-positioner` custom element. */
|
|
141
131
|
export const BlockHandlePositioner: DefineSetupFnComponent<BlockHandlePositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandlePositionerProps & HTMLAttributes>(
|
|
142
132
|
(props, { slots }) => {
|
|
143
133
|
registerBlockHandlePositionerElement();
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerBlockHandleRootElement, type BlockHandleRootEvents, type BlockHandleRootProps as BlockHandleRootElementProps } from '@prosekit/web/block-handle';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
6
|
import { useEditorContext } from '../../injection/editor-context.ts';
|
|
9
7
|
|
|
10
|
-
/**
|
|
11
|
-
* Props for the {@link BlockHandleRoot} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link BlockHandleRoot} Vue component. */
|
|
15
9
|
export interface BlockHandleRootProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -24,11 +18,7 @@ export interface BlockHandleRootProps {
|
|
|
24
18
|
onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
/**
|
|
28
|
-
* A Vue component that renders an `prosekit-block-handle-root` custom element.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
21
|
+
/** A Vue component that renders an `prosekit-block-handle-root` custom element. */
|
|
32
22
|
export const BlockHandleRoot: DefineSetupFnComponent<BlockHandleRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<BlockHandleRootProps & HTMLAttributes>(
|
|
33
23
|
(props, { slots }) => {
|
|
34
24
|
registerBlockHandleRootElement();
|
|
@@ -80,5 +70,3 @@ export const BlockHandleRoot: DefineSetupFnComponent<BlockHandleRootProps & HTML
|
|
|
80
70
|
},
|
|
81
71
|
{ props: ['editor', 'onStateChange'] },
|
|
82
72
|
);
|
|
83
|
-
|
|
84
|
-
export type { BlockHandleRootEvents };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
export { BlockHandleAdd, type BlockHandleAddProps } from './block-handle-add.gen.ts';
|
|
6
4
|
|
|
@@ -10,6 +8,4 @@ export { BlockHandlePopup, type BlockHandlePopupProps } from './block-handle-pop
|
|
|
10
8
|
|
|
11
9
|
export { BlockHandlePositioner, type BlockHandlePositionerProps } from './block-handle-positioner.gen.ts';
|
|
12
10
|
|
|
13
|
-
export { BlockHandleRoot, type BlockHandleRootProps
|
|
14
|
-
|
|
15
|
-
export { BlockHandleStateChangeEvent } from '@prosekit/web/block-handle';
|
|
11
|
+
export { BlockHandleRoot, type BlockHandleRootProps } from './block-handle-root.gen.ts';
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
import { registerDropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
6
|
import { useEditorContext } from '../../injection/editor-context.ts';
|
|
9
7
|
|
|
10
|
-
/**
|
|
11
|
-
* Props for the {@link DropIndicator} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link DropIndicator} Vue component. */
|
|
15
9
|
export interface DropIndicatorProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -28,11 +22,7 @@ export interface DropIndicatorProps {
|
|
|
28
22
|
width?: DropIndicatorElementProps['width'];
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
/**
|
|
32
|
-
* A Vue component that renders an `prosekit-drop-indicator` custom element.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
25
|
+
/** A Vue component that renders an `prosekit-drop-indicator` custom element. */
|
|
36
26
|
export const DropIndicator: DefineSetupFnComponent<DropIndicatorProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<DropIndicatorProps & HTMLAttributes>(
|
|
37
27
|
(props, { slots }) => {
|
|
38
28
|
registerDropIndicatorElement();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
export { DropIndicator, type DropIndicatorProps } from './drop-indicator.gen.ts';
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
-
*/
|
|
1
|
+
// This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
|
|
4
2
|
|
|
5
3
|
export { InlinePopoverPopup, type InlinePopoverPopupProps } from './inline-popover-popup.gen.ts';
|
|
6
4
|
|
|
7
5
|
export { InlinePopoverPositioner, type InlinePopoverPositionerProps } from './inline-popover-positioner.gen.ts';
|
|
8
6
|
|
|
9
|
-
export { InlinePopoverRoot, type InlinePopoverRootProps
|
|
10
|
-
|
|
11
|
-
export { OpenChangeEvent } from '@prosekit/web/inline-popover';
|
|
7
|
+
export { InlinePopoverRoot, type InlinePopoverRootProps } from './inline-popover-root.gen.ts';
|