@prosekit/vue 0.7.0-beta.4 → 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 +10 -61
- package/dist/prosekit-vue-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-vue-autocomplete.js +5 -50
- package/dist/prosekit-vue-autocomplete.js.map +1 -1
- package/dist/prosekit-vue-block-handle.d.ts +10 -61
- package/dist/prosekit-vue-block-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-block-handle.js +5 -50
- 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 +6 -37
- package/dist/prosekit-vue-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-inline-popover.js +3 -30
- package/dist/prosekit-vue-inline-popover.js.map +1 -1
- package/dist/prosekit-vue-menu.d.ts +48 -88
- package/dist/prosekit-vue-menu.d.ts.map +1 -1
- package/dist/prosekit-vue-menu.js +70 -74
- package/dist/prosekit-vue-menu.js.map +1 -1
- package/dist/prosekit-vue-popover.d.ts +8 -49
- package/dist/prosekit-vue-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-popover.js +4 -40
- package/dist/prosekit-vue-popover.js.map +1 -1
- package/dist/prosekit-vue-resizable.d.ts +4 -25
- package/dist/prosekit-vue-resizable.d.ts.map +1 -1
- package/dist/prosekit-vue-resizable.js +2 -20
- 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 +8 -49
- package/dist/prosekit-vue-tooltip.d.ts.map +1 -1
- package/dist/prosekit-vue-tooltip.js +4 -40
- 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 -13
- package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-root.gen.ts +3 -13
- package/src/components/autocomplete/index.gen.ts +1 -3
- 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 -13
- package/src/components/block-handle/index.gen.ts +1 -3
- 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 +1 -3
- 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 +3 -13
- package/src/components/menu/index.gen.ts +1 -3
- package/src/components/menu/menu-item.gen.ts +3 -13
- 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 -13
- 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 -13
- package/src/components/popover/index.gen.ts +1 -3
- 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 -13
- package/src/components/popover/popover-trigger.gen.ts +3 -13
- package/src/components/resizable/index.gen.ts +1 -3
- package/src/components/resizable/resizable-handle.gen.ts +3 -13
- package/src/components/resizable/resizable-root.gen.ts +3 -13
- 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 +1 -3
- 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 -13
- package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
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":"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"}
|
|
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":"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"}
|
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();
|
|
@@ -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();
|
|
@@ -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();
|
|
@@ -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 { AutocompleteEmpty, type AutocompleteEmptyProps } from './autocomplete-empty.gen.ts';
|
|
6
4
|
|
|
@@ -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();
|
|
@@ -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
|
|
|
@@ -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,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 { InlinePopoverPopup, type InlinePopoverPopupProps } from './inline-popover-popup.gen.ts';
|
|
6
4
|
|
|
@@ -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 { registerInlinePopoverPopupElement } from '@prosekit/web/inline-popover';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link InlinePopoverPopup} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link InlinePopoverPopup} Vue component. */
|
|
13
7
|
export interface InlinePopoverPopupProps {}
|
|
14
8
|
|
|
15
|
-
/**
|
|
16
|
-
* A Vue component that renders an `prosekit-inline-popover-popup` custom element.
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
9
|
+
/** A Vue component that renders an `prosekit-inline-popover-popup` custom element. */
|
|
20
10
|
export const InlinePopoverPopup: DefineSetupFnComponent<InlinePopoverPopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPopupProps & HTMLAttributes>(
|
|
21
11
|
(props, { slots }) => {
|
|
22
12
|
registerInlinePopoverPopupElement();
|
|
@@ -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 { registerInlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link InlinePopoverPositioner} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link InlinePopoverPositioner} Vue component. */
|
|
13
7
|
export interface InlinePopoverPositionerProps {
|
|
14
8
|
/**
|
|
15
9
|
* The initial placement of the floating element
|
|
@@ -139,11 +133,7 @@ export interface InlinePopoverPositionerProps {
|
|
|
139
133
|
altBoundary?: InlinePopoverPositionerElementProps['altBoundary'];
|
|
140
134
|
}
|
|
141
135
|
|
|
142
|
-
/**
|
|
143
|
-
* A Vue component that renders an `prosekit-inline-popover-positioner` custom element.
|
|
144
|
-
*
|
|
145
|
-
* @public
|
|
146
|
-
*/
|
|
136
|
+
/** A Vue component that renders an `prosekit-inline-popover-positioner` custom element. */
|
|
147
137
|
export const InlinePopoverPositioner: DefineSetupFnComponent<InlinePopoverPositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverPositionerProps & HTMLAttributes>(
|
|
148
138
|
(props, { slots }) => {
|
|
149
139
|
registerInlinePopoverPositionerElement();
|
|
@@ -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 { registerInlinePopoverRootElement, type InlinePopoverRootEvents, type InlinePopoverRootProps as InlinePopoverRootElementProps } from '@prosekit/web/inline-popover';
|
|
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 InlinePopoverRoot} Vue component.
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
8
|
+
/** Props for the {@link InlinePopoverRoot} Vue component. */
|
|
15
9
|
export interface InlinePopoverRootProps {
|
|
16
10
|
/**
|
|
17
11
|
* The ProseKit editor instance.
|
|
@@ -48,11 +42,7 @@ export interface InlinePopoverRootProps {
|
|
|
48
42
|
onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
/**
|
|
52
|
-
* A Vue component that renders an `prosekit-inline-popover-root` custom element.
|
|
53
|
-
*
|
|
54
|
-
* @public
|
|
55
|
-
*/
|
|
45
|
+
/** A Vue component that renders an `prosekit-inline-popover-root` custom element. */
|
|
56
46
|
export const InlinePopoverRoot: DefineSetupFnComponent<InlinePopoverRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<InlinePopoverRootProps & HTMLAttributes>(
|
|
57
47
|
(props, { slots }) => {
|
|
58
48
|
registerInlinePopoverRootElement();
|
|
@@ -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 { registerMenuItemElement, type MenuItemEvents, type MenuItemProps as MenuItemElementProps } from '@prosekit/web/menu';
|
|
6
4
|
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
5
|
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link MenuItem} Vue component.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
6
|
+
/** Props for the {@link MenuItem} Vue component. */
|
|
13
7
|
export interface MenuItemProps {
|
|
14
8
|
/**
|
|
15
9
|
* The unique value for this menu item.
|
|
@@ -33,11 +27,7 @@ export interface MenuItemProps {
|
|
|
33
27
|
onSelect?: (event: MenuItemEvents['select']) => void;
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
37
|
-
* A Vue component that renders an `prosekit-menu-item` custom element.
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
30
|
+
/** A Vue component that renders an `prosekit-menu-item` custom element. */
|
|
41
31
|
export const MenuItem: DefineSetupFnComponent<MenuItemProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<MenuItemProps & HTMLAttributes>(
|
|
42
32
|
(props, { slots }) => {
|
|
43
33
|
registerMenuItemElement();
|