@tiptap/vue-2 3.30.2 → 3.30.3
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/index.cjs +402 -488
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -79
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +84 -79
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +371 -449
- package/dist/index.js.map +1 -1
- package/dist/menus/index.cjs +151 -2537
- package/dist/menus/index.cjs.map +1 -1
- package/dist/menus/index.d.cts +39 -222
- package/dist/menus/index.d.cts.map +1 -0
- package/dist/menus/index.d.ts +39 -222
- package/dist/menus/index.d.ts.map +1 -0
- package/dist/menus/index.js +149 -2509
- package/dist/menus/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Editor.ts","../src/EditorContent.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/VueNodeViewRenderer.ts","../src/Vue.ts","../src/VueRenderer.ts","../src/VueWidgetRenderer.ts","../src/utils/createWidgetConstructor.ts"],"sourcesContent":["export { Editor } from './Editor.js'\nexport * from './EditorContent.js'\nexport * from './NodeViewContent.js'\nexport * from './NodeViewWrapper.js'\nexport * from './VueNodeViewRenderer.js'\nexport * from './VueRenderer.js'\nexport * from './VueWidgetRenderer.js'\nexport * from '@tiptap/core'\n","import { Editor as CoreEditor } from '@tiptap/core'\nimport type Vue from 'vue'\n\nexport class Editor extends CoreEditor {\n public contentComponent: Vue | null = null\n}\n","import type { Component, CreateElement, PropType } from 'vue'\nimport type Vue from 'vue'\n\nimport type { Editor } from './Editor.js'\n\nexport interface EditorContentInterface extends Vue {\n editor: Editor\n}\n\nexport const EditorContent: Component = {\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(this: EditorContentInterface, editor: Editor) {\n if (editor && editor.options.element) {\n this.$nextTick(() => {\n const element = this.$el\n\n if (!element || !editor.view.dom?.parentNode) {\n return\n }\n\n element.append(...editor.view.dom.parentNode.childNodes)\n editor.contentComponent = this\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n },\n },\n },\n\n render(createElement: CreateElement) {\n return createElement('div')\n },\n\n beforeDestroy(this: EditorContentInterface) {\n const { editor } = this\n\n if (!editor) {\n return\n }\n\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n if (!editor.view.dom?.parentNode) {\n return\n }\n\n // TODO using the new editor.mount method might allow us to remove this\n const newElement = document.createElement('div')\n\n newElement.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element: newElement,\n })\n },\n}\n","import type { Component, CreateElement } from 'vue'\nimport type Vue from 'vue'\n\nexport interface NodeViewContentInterface extends Vue {\n as: string\n}\n\nexport const NodeViewContent: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: {\n nodeViewContentRef: { default: undefined },\n },\n\n mounted(this: any) {\n if (this.nodeViewContentRef && this.$el) {\n this.nodeViewContentRef(this.$el)\n }\n },\n\n beforeDestroy(this: any) {\n if (this.nodeViewContentRef) {\n this.nodeViewContentRef(null)\n }\n },\n\n render(this: NodeViewContentInterface, createElement: CreateElement) {\n return createElement(this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n attrs: {\n 'data-node-view-content': '',\n },\n })\n },\n}\n","import type { Component, CreateElement } from 'vue'\nimport type Vue from 'vue'\n\nexport interface NodeViewWrapperInterface extends Vue {\n as: string\n decorationClasses: {\n value: string\n }\n onDragStart: () => void\n}\n\nexport const NodeViewWrapper: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render(this: NodeViewWrapperInterface, createElement: CreateElement) {\n return createElement(\n this.as,\n {\n class: this.decorationClasses.value,\n style: {\n whiteSpace: 'normal',\n },\n attrs: {\n 'data-node-view-wrapper': '',\n },\n on: {\n dragstart: this.onDragStart,\n },\n },\n this.$slots.default,\n )\n },\n}\n","import type {\n DecorationWithType,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { isNodeViewSelected, NodeView } from '@tiptap/core'\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport type { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport type { VueConstructor } from 'vue'\nimport { booleanProp, functionProp, objectProp } from 'vue-ts-types'\n\nimport type { Editor } from './Editor.js'\nimport { Vue } from './Vue.js'\nimport { VueRenderer } from './VueRenderer.js'\n\nexport const nodeViewProps = {\n editor: objectProp<NodeViewProps['editor']>().required,\n node: objectProp<NodeViewProps['node']>().required,\n decorations: objectProp<NodeViewProps['decorations']>().required,\n selected: booleanProp().required,\n extension: objectProp<NodeViewProps['extension']>().required,\n getPos: functionProp<NodeViewProps['getPos']>().required,\n updateAttributes: functionProp<NodeViewProps['updateAttributes']>().required,\n deleteNode: functionProp<NodeViewProps['deleteNode']>().required,\n}\n\nexport interface VueNodeViewRendererOptions extends NodeViewRendererOptions {\n update:\n | ((props: {\n oldNode: ProseMirrorNode\n oldDecorations: readonly Decoration[]\n oldInnerDecorations: DecorationSource\n newNode: ProseMirrorNode\n newDecorations: readonly Decoration[]\n innerDecorations: DecorationSource\n updateProps: () => void\n }) => boolean)\n | null\n}\n\nclass VueNodeView extends NodeView<Vue | VueConstructor, Editor, VueNodeViewRendererOptions> {\n renderer!: VueRenderer\n\n decorationClasses!: {\n value: string\n }\n\n /**\n * The element that holds the rich-text content of the node.\n * Always created for non-leaf nodes to guarantee a valid contentDOM,\n * even when the user's component does not include a NodeViewContent.\n * Must NOT have an initializer because class field initializers run\n * after super() and would overwrite the value set by mount().\n */\n contentDOMElement!: HTMLElement | null\n\n private currentPos: number | undefined\n\n constructor(\n component: Vue | VueConstructor,\n props: NodeViewRendererProps,\n options?: Partial<VueNodeViewRendererOptions>,\n ) {\n super(component, props, options)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.on('update', this.handlePositionUpdate)\n }\n }\n\n private handlePositionUpdate = () => {\n const newPos = this.getPos()\n if (typeof newPos !== 'number' || newPos === this.currentPos) {\n return\n }\n this.currentPos = newPos\n this.renderer.updateProps({ getPos: () => this.getPos() })\n }\n\n /**\n * Called when the node view is mounted.\n */\n mount() {\n const props: Record<string, any> = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations as DecorationWithType[],\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extension,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n }\n\n const mountProps = props as NodeViewProps\n\n const onDragStart = this.onDragStart.bind(this)\n\n this.decorationClasses = Vue.observable({\n value: this.getDecorationClasses(),\n })\n\n // @ts-ignore\n const vue = this.editor.contentComponent?.$options._base ?? Vue // oxlint-disable-line\n\n const Component = vue.extend(this.component).extend({\n props: Object.keys(props),\n provide: () => {\n return {\n onDragStart,\n decorationClasses: this.decorationClasses,\n nodeViewContentRef: (el: HTMLElement | null) => {\n if (!this.contentDOMElement) return\n\n if (el && el.firstChild !== this.contentDOMElement) {\n // NodeViewContent mounted: move the contentDOMElement inside it\n el.appendChild(this.contentDOMElement)\n }\n },\n }\n },\n })\n\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this)\n this.editor.on('selectionUpdate', this.handleSelectionUpdate)\n\n this.currentPos = this.getPos()\n\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag)\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? 'span' : 'div')\n }\n this.contentDOMElement.style.whiteSpace = 'inherit'\n // Use a distinct attribute to avoid clashing with the user's\n // <node-view-content> element (which carries data-node-view-content).\n // Matches React's data-node-view-content-react convention.\n this.contentDOMElement.dataset.nodeViewContentVue = ''\n }\n\n this.renderer = new VueRenderer(Component, {\n parent: this.editor.contentComponent,\n propsData: mountProps,\n })\n }\n\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n if (!this.renderer.element.hasAttribute('data-node-view-wrapper')) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element as HTMLElement\n }\n\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.contentDOMElement\n }\n\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n const pos = this.getPos()\n\n if (typeof pos !== 'number') {\n return\n }\n\n const isSelected = isNodeViewSelected({\n selection: this.editor.state.selection,\n pos,\n nodeSize: this.node.nodeSize,\n selectedOnTextSelection: this.options.selectedOnTextSelection,\n })\n\n if (isSelected) {\n if (this.renderer.ref.$props.selected) {\n return\n }\n\n this.selectNode()\n } else {\n if (!this.renderer.ref.$props.selected) {\n return\n }\n\n this.deselectNode()\n }\n }\n\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(\n node: ProseMirrorNode,\n decorations: readonly Decoration[],\n innerDecorations: DecorationSource,\n ): boolean {\n const rerenderComponent = (props?: Record<string, any>) => {\n this.decorationClasses.value = this.getDecorationClasses()\n this.renderer.updateProps(props)\n }\n\n if (typeof this.options.update === 'function') {\n const oldNode = this.node\n const oldDecorations = this.decorations\n const oldInnerDecorations = this.innerDecorations\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({ node, decorations, innerDecorations }),\n })\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n const nodeChanged = node !== this.node\n\n // Node reference unchanged — only decorations may have changed.\n // ProseMirror renders decorations independently on the contentDOM,\n // and the getPos closure (bound in mount()) calls through to\n // ProseMirror's position function at call time, so it is always\n // current. Update internal refs, refresh decoration classes for\n // the wrapper component, and skip the Vue re-render.\n if (!nodeChanged) {\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.decorationClasses.value = this.getDecorationClasses()\n return true\n }\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = this.getPos()\n\n const extraProps: Record<string, any> = {\n node,\n decorations,\n innerDecorations,\n }\n\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos()\n }\n\n rerenderComponent(extraProps)\n\n return true\n }\n\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true,\n })\n this.renderer.element.classList.add('ProseMirror-selectednode')\n }\n\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n this.renderer.element.classList.remove('ProseMirror-selectednode')\n }\n\n getDecorationClasses() {\n return (\n this.decorations\n // @ts-ignore\n .flatMap(item => item.type.attrs.class)\n .join(' ')\n )\n }\n\n destroy() {\n this.renderer.destroy()\n this.editor.off('selectionUpdate', this.handleSelectionUpdate)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.off('update', this.handlePositionUpdate)\n }\n\n this.contentDOMElement = null\n }\n}\n\nexport function VueNodeViewRenderer(\n component: Vue | VueConstructor,\n options?: Partial<VueNodeViewRendererOptions>,\n): NodeViewRenderer {\n return props => {\n // try to get the parent component\n // this is important for vue devtools to show the component hierarchy correctly\n // maybe it’s `undefined` because <editor-content> isn’t rendered yet\n if (!(props.editor as Editor).contentComponent) {\n return {} as unknown as ProseMirrorNodeView\n }\n\n return new VueNodeView(component, props, options)\n }\n}\n","import type { VueConstructor } from 'vue'\nimport VueDefault from 'vue'\n\n// With nodenext module resolution, TypeScript treats the default import as the module type.\n// We need to explicitly type it as VueConstructor to access static methods like extend and observable.\n// This is necessary because Vue 2's type definitions export Vue as VueConstructor, but nodenext\n// doesn't correctly infer the default export type.\nexport const Vue: VueConstructor = VueDefault as unknown as VueConstructor\n","import type { VueConstructor } from 'vue'\n\nimport { Vue } from './Vue.js'\n\n/**\n * The VueRenderer class is responsible for rendering a Vue component as a ProseMirror node view.\n */\nexport class VueRenderer {\n ref!: Vue\n\n constructor(component: Vue | VueConstructor, props: any) {\n const Component = typeof component === 'function' ? component : Vue.extend(component)\n\n this.ref = new Component(props).$mount()\n }\n\n get element(): Element {\n return this.ref.$el\n }\n\n updateProps(props: Record<string, any> = {}): void {\n if (!this.ref.$props) {\n return\n }\n\n // prevents `Avoid mutating a prop directly` error message\n // Fix: `VueNodeViewRenderer` change vue Constructor `config.silent` not working\n const currentVueConstructor = this.ref.$props.editor?.contentComponent?.$options._base ?? Vue // oxlint-disable-line\n const originalSilent = currentVueConstructor.config.silent\n\n currentVueConstructor.config.silent = true\n\n Object.entries(props).forEach(([key, value]) => {\n this.ref.$props[key] = value\n })\n\n currentVueConstructor.config.silent = originalSilent\n }\n\n destroy(): void {\n this.ref.$destroy()\n }\n}\n","import { createWidgetDecoration } from '@tiptap/core'\nimport type {\n Editor as CoreEditor,\n WidgetDecoration,\n WidgetDecorationOptions,\n WidgetRenderer,\n} from '@tiptap/core'\nimport type { Component, VueConstructor } from 'vue'\n\nimport type { Editor } from './Editor.js'\nimport { createWidgetConstructor } from './utils/createWidgetConstructor.js'\nimport { VueRenderer } from './VueRenderer.js'\n\n/**\n * Props every widget-decoration component receives in addition to the props you\n * pass through `VueWidgetRenderer`. Declare the ones you use on your component.\n */\nexport interface VueWidgetDecorationProps {\n editor: CoreEditor\n getPos: () => number | undefined\n}\n\nexport interface VueWidgetRendererOptions<\n P extends Record<string, any> = object,\n> extends WidgetDecorationOptions {\n /**\n * The editor instance.\n */\n editor: Editor\n /**\n * The document position the widget is rendered at.\n */\n pos: number\n /**\n * A stable, position-independent identifier for the widget.\n * Reusing the same key keeps the component mounted across re-renders.\n * Good: `comment-${id}`. Bad: paragraph index or document position.\n */\n key: string\n /**\n * Props passed to the component (merged with {@link VueWidgetDecorationProps}).\n * The component must render a single root element.\n */\n props?: P\n}\n\nconst WIDGET_CACHE = Symbol('tiptapVue2WidgetCache')\n\n// @ts-ignore\nconst isDev = process.env.NODE_ENV !== 'production'\n\n/** The `VueRenderer` plus the warning wrapper the widget cache drives. */\ninterface WidgetRendererEntry extends WidgetRenderer {\n renderer: VueRenderer\n}\n\n// Vue 2 fixes the prop list at construction. Keys absent on first mount are\n// never declared, so updateProps silently drops them on later updates.\nfunction warnUndeclaredProps(renderer: VueRenderer, props: Record<string, any>, key: string): void {\n if (!isDev) {\n return\n }\n\n const declared = renderer.ref.$props ?? {}\n\n for (const name of Object.keys(props)) {\n if (!(name in declared)) {\n console.warn(\n `[tiptap warn]: VueWidgetRenderer prop \"${name}\" was not passed on first mount for widget \"${key}\".`,\n 'Vue 2 cannot declare new props after mount, so this value is ignored.',\n )\n }\n }\n}\n\n// Wrap the renderer so every prop push warns, whether it comes from the first\n// render or from the deferred flush.\nfunction withPropWarnings(renderer: VueRenderer, key: string): WidgetRendererEntry {\n return {\n renderer,\n updateProps: props => {\n warnUndeclaredProps(renderer, props, key)\n renderer.updateProps(props)\n },\n destroy: () => renderer.destroy(),\n }\n}\n\n/**\n * Renders a Vue 2 component into a ProseMirror widget decoration.\n * Reuses Tiptap's `VueRenderer` so the component is mounted under the editor's\n * content component (inject/provide works as usual). Use a stable `key` for\n * stateful widgets. The component must render a single root element.\n * @example\n * addDecorations() {\n * return {\n * create: ({ editor, state }) =>\n * findMatches(state.doc).map(match =>\n * VueWidgetRenderer(MyWidget, {\n * editor, pos: match.pos, key: `match-${match.id}`,\n * props: { label: match.label },\n * }),\n * ),\n * }\n * }\n */\nexport function VueWidgetRenderer<P extends Record<string, any> = object>(\n component: Component,\n options: VueWidgetRendererOptions<P>,\n): WidgetDecoration {\n const { editor, key, props = {} as P } = options\n\n return createWidgetDecoration<WidgetRendererEntry>({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n // `view` is not passed on purpose: Vue 2 deeply observes props and\n // observing a ProseMirror view corrupts its internals.\n context: getPos => ({ editor, getPos }),\n create: renderProps => {\n const base = (editor.contentComponent?.$options as any)?._base as VueConstructor | undefined\n const Constructor = createWidgetConstructor(base, component, renderProps)\n\n return withPropWarnings(\n new VueRenderer(Constructor, {\n parent: editor.contentComponent,\n propsData: renderProps,\n }),\n key,\n )\n },\n materialize: entry => entry.renderer.element as HTMLElement,\n })\n}\n","import type { Component, VueConstructor } from 'vue'\n\nimport { Vue } from '../Vue.js'\n\n/**\n * Builds the Vue 2 constructor for a widget component.\n *\n * Extends the editor's own Vue constructor so the widget shares its context,\n * then auto-declares every passed prop the component does not declare itself.\n * Vue 2 fixes the prop list at construction, so undeclared keys would be\n * dropped. Existing declarations keep their type, default and validator.\n *\n * @param base The editor's Vue constructor, or undefined to fall back to `Vue`.\n * @param component The widget component.\n * @param props The props the widget is mounted with.\n * @returns A constructor that accepts every key in `props`.\n * @example\n * createWidgetConstructor(undefined, MyWidget, { editor, getPos, label: 'a' })\n */\nexport function createWidgetConstructor(\n base: VueConstructor | undefined,\n component: Component,\n props: Record<string, any>,\n): VueConstructor {\n const VueBase = base ?? Vue\n const Extended = VueBase.extend(component as any)\n const declaredProps = {\n ...(Extended as unknown as { options: { props?: Record<string, any> } }).options.props,\n }\n\n for (const name of Object.keys(props)) {\n if (!Object.prototype.hasOwnProperty.call(declaredProps, name)) {\n declaredProps[name] = null\n }\n }\n\n return Extended.extend({ props: declaredProps })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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AI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,QAAM,YAAW,cAAS,IAAI,WAAb,YAAuB,CAAC;AAEzC,aAAW,QAAQ,OAAO,KAAK,KAAK,GAAG;AACrC,QAAI,EAAE,QAAQ,WAAW;AACvB,cAAQ;AAAA,QACN,0CAA0C,IAAI,+CAA+C,GAAG;AAAA,QAChG;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAIA,SAAS,iBAAiB,UAAuB,KAAkC;AACjF,SAAO;AAAA,IACL;AAAA,IACA,aAAa,WAAS;AACpB,0BAAoB,UAAU,OAAO,GAAG;AACxC,eAAS,YAAY,KAAK;AAAA,IAC5B;AAAA,IACA,SAAS,MAAM,SAAS,QAAQ;AAAA,EAClC;AACF;AAoBO,SAAS,kBACd,WACA,SACkB;AAClB,QAAM,EAAE,QAAQ,KAAK,QAAQ,CAAC,EAAO,IAAI;AAEzC,aAAO,qCAA4C;AAAA;AAAA,IAEjD,GAAG;AAAA,IACH;AAAA,IACA,UAAU;AAAA;AAAA;AAAA,IAGV,SAAS,aAAW,EAAE,QAAQ,OAAO;AAAA,IACrC,QAAQ,iBAAe;AAxH3B;AAyHM,YAAM,QAAQ,kBAAO,qBAAP,mBAAyB,aAAzB,mBAA2C;AACzD,YAAM,cAAc,wBAAwB,MAAM,WAAW,WAAW;AAExE,aAAO;AAAA,QACL,IAAI,YAAY,aAAa;AAAA,UAC3B,QAAQ,OAAO;AAAA,UACf,WAAW;AAAA,QACb,CAAC;AAAA,QACD;AAAA,MACF;AAAA,IACF;AAAA,IACA,aAAa,WAAS,MAAM,SAAS;AAAA,EACvC,CAAC;AACH;;;AR/HA,0BAAc,yBAPd;","names":["CoreEditor","import_core","VueDefault","import_core"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CoreEditor","VueDefault","NodeView"],"sources":["../src/Editor.ts","../src/EditorContent.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/Vue.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts","../src/utils/createWidgetConstructor.ts","../src/VueWidgetRenderer.ts"],"sourcesContent":["import { Editor as CoreEditor } from '@tiptap/core'\nimport type Vue from 'vue'\n\nexport class Editor extends CoreEditor {\n public contentComponent: Vue | null = null\n}\n","import type { Component, CreateElement, PropType } from 'vue'\nimport type Vue from 'vue'\n\nimport type { Editor } from './Editor.js'\n\nexport interface EditorContentInterface extends Vue {\n editor: Editor\n}\n\nexport const EditorContent: Component = {\n name: 'EditorContent',\n\n props: {\n editor: {\n default: null,\n type: Object as PropType<Editor>,\n },\n },\n\n watch: {\n editor: {\n immediate: true,\n handler(this: EditorContentInterface, editor: Editor) {\n if (editor && editor.options.element) {\n this.$nextTick(() => {\n const element = this.$el\n\n if (!element || !editor.view.dom?.parentNode) {\n return\n }\n\n element.append(...editor.view.dom.parentNode.childNodes)\n editor.contentComponent = this\n\n editor.setOptions({\n element,\n })\n\n editor.createNodeViews()\n })\n }\n },\n },\n },\n\n render(createElement: CreateElement) {\n return createElement('div')\n },\n\n beforeDestroy(this: EditorContentInterface) {\n const { editor } = this\n\n if (!editor) {\n return\n }\n\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n if (!editor.view.dom?.parentNode) {\n return\n }\n\n // TODO using the new editor.mount method might allow us to remove this\n const newElement = document.createElement('div')\n\n newElement.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element: newElement,\n })\n },\n}\n","import type { Component, CreateElement } from 'vue'\nimport type Vue from 'vue'\n\nexport interface NodeViewContentInterface extends Vue {\n as: string\n}\n\nexport const NodeViewContent: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: {\n nodeViewContentRef: { default: undefined },\n },\n\n mounted(this: any) {\n if (this.nodeViewContentRef && this.$el) {\n this.nodeViewContentRef(this.$el)\n }\n },\n\n beforeDestroy(this: any) {\n if (this.nodeViewContentRef) {\n this.nodeViewContentRef(null)\n }\n },\n\n render(this: NodeViewContentInterface, createElement: CreateElement) {\n return createElement(this.as, {\n style: {\n whiteSpace: 'pre-wrap',\n },\n attrs: {\n 'data-node-view-content': '',\n },\n })\n },\n}\n","import type { Component, CreateElement } from 'vue'\nimport type Vue from 'vue'\n\nexport interface NodeViewWrapperInterface extends Vue {\n as: string\n decorationClasses: {\n value: string\n }\n onDragStart: () => void\n}\n\nexport const NodeViewWrapper: Component = {\n props: {\n as: {\n type: String,\n default: 'div',\n },\n },\n\n inject: ['onDragStart', 'decorationClasses'],\n\n render(this: NodeViewWrapperInterface, createElement: CreateElement) {\n return createElement(\n this.as,\n {\n class: this.decorationClasses.value,\n style: {\n whiteSpace: 'normal',\n },\n attrs: {\n 'data-node-view-wrapper': '',\n },\n on: {\n dragstart: this.onDragStart,\n },\n },\n this.$slots.default,\n )\n },\n}\n","import type { VueConstructor } from 'vue'\nimport VueDefault from 'vue'\n\n// With nodenext module resolution, TypeScript treats the default import as the module type.\n// We need to explicitly type it as VueConstructor to access static methods like extend and observable.\n// This is necessary because Vue 2's type definitions export Vue as VueConstructor, but nodenext\n// doesn't correctly infer the default export type.\nexport const Vue: VueConstructor = VueDefault as unknown as VueConstructor\n","import type { VueConstructor } from 'vue'\n\nimport { Vue } from './Vue.js'\n\n/**\n * The VueRenderer class is responsible for rendering a Vue component as a ProseMirror node view.\n */\nexport class VueRenderer {\n ref!: Vue\n\n constructor(component: Vue | VueConstructor, props: any) {\n const Component = typeof component === 'function' ? component : Vue.extend(component)\n\n this.ref = new Component(props).$mount()\n }\n\n get element(): Element {\n return this.ref.$el\n }\n\n updateProps(props: Record<string, any> = {}): void {\n if (!this.ref.$props) {\n return\n }\n\n // prevents `Avoid mutating a prop directly` error message\n // Fix: `VueNodeViewRenderer` change vue Constructor `config.silent` not working\n const currentVueConstructor = this.ref.$props.editor?.contentComponent?.$options._base ?? Vue // oxlint-disable-line\n const originalSilent = currentVueConstructor.config.silent\n\n currentVueConstructor.config.silent = true\n\n Object.entries(props).forEach(([key, value]) => {\n this.ref.$props[key] = value\n })\n\n currentVueConstructor.config.silent = originalSilent\n }\n\n destroy(): void {\n this.ref.$destroy()\n }\n}\n","import type {\n DecorationWithType,\n NodeViewProps,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { isNodeViewSelected, NodeView } from '@tiptap/core'\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport type { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport type { VueConstructor } from 'vue'\nimport { booleanProp, functionProp, objectProp } from 'vue-ts-types'\n\nimport type { Editor } from './Editor.js'\nimport { Vue } from './Vue.js'\nimport { VueRenderer } from './VueRenderer.js'\n\nexport const nodeViewProps = {\n editor: objectProp<NodeViewProps['editor']>().required,\n node: objectProp<NodeViewProps['node']>().required,\n decorations: objectProp<NodeViewProps['decorations']>().required,\n selected: booleanProp().required,\n extension: objectProp<NodeViewProps['extension']>().required,\n getPos: functionProp<NodeViewProps['getPos']>().required,\n updateAttributes: functionProp<NodeViewProps['updateAttributes']>().required,\n deleteNode: functionProp<NodeViewProps['deleteNode']>().required,\n}\n\nexport interface VueNodeViewRendererOptions extends NodeViewRendererOptions {\n update:\n | ((props: {\n oldNode: ProseMirrorNode\n oldDecorations: readonly Decoration[]\n oldInnerDecorations: DecorationSource\n newNode: ProseMirrorNode\n newDecorations: readonly Decoration[]\n innerDecorations: DecorationSource\n updateProps: () => void\n }) => boolean)\n | null\n}\n\nclass VueNodeView extends NodeView<Vue | VueConstructor, Editor, VueNodeViewRendererOptions> {\n renderer!: VueRenderer\n\n decorationClasses!: {\n value: string\n }\n\n /**\n * The element that holds the rich-text content of the node.\n * Always created for non-leaf nodes to guarantee a valid contentDOM,\n * even when the user's component does not include a NodeViewContent.\n * Must NOT have an initializer because class field initializers run\n * after super() and would overwrite the value set by mount().\n */\n contentDOMElement!: HTMLElement | null\n\n private currentPos: number | undefined\n\n constructor(\n component: Vue | VueConstructor,\n props: NodeViewRendererProps,\n options?: Partial<VueNodeViewRendererOptions>,\n ) {\n super(component, props, options)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.on('update', this.handlePositionUpdate)\n }\n }\n\n private handlePositionUpdate = () => {\n const newPos = this.getPos()\n if (typeof newPos !== 'number' || newPos === this.currentPos) {\n return\n }\n this.currentPos = newPos\n this.renderer.updateProps({ getPos: () => this.getPos() })\n }\n\n /**\n * Called when the node view is mounted.\n */\n mount() {\n const props: Record<string, any> = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations as DecorationWithType[],\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extension,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n }\n\n const mountProps = props as NodeViewProps\n\n const onDragStart = this.onDragStart.bind(this)\n\n this.decorationClasses = Vue.observable({\n value: this.getDecorationClasses(),\n })\n\n // @ts-ignore\n const vue = this.editor.contentComponent?.$options._base ?? Vue // oxlint-disable-line\n\n const Component = vue.extend(this.component).extend({\n props: Object.keys(props),\n provide: () => {\n return {\n onDragStart,\n decorationClasses: this.decorationClasses,\n nodeViewContentRef: (el: HTMLElement | null) => {\n if (!this.contentDOMElement) return\n\n if (el && el.firstChild !== this.contentDOMElement) {\n // NodeViewContent mounted: move the contentDOMElement inside it\n el.appendChild(this.contentDOMElement)\n }\n },\n }\n },\n })\n\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this)\n this.editor.on('selectionUpdate', this.handleSelectionUpdate)\n\n this.currentPos = this.getPos()\n\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag)\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? 'span' : 'div')\n }\n this.contentDOMElement.style.whiteSpace = 'inherit'\n // Use a distinct attribute to avoid clashing with the user's\n // <node-view-content> element (which carries data-node-view-content).\n // Matches React's data-node-view-content-react convention.\n this.contentDOMElement.dataset.nodeViewContentVue = ''\n }\n\n this.renderer = new VueRenderer(Component, {\n parent: this.editor.contentComponent,\n propsData: mountProps,\n })\n }\n\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n if (!this.renderer.element.hasAttribute('data-node-view-wrapper')) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element as HTMLElement\n }\n\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.contentDOMElement\n }\n\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n const pos = this.getPos()\n\n if (typeof pos !== 'number') {\n return\n }\n\n const isSelected = isNodeViewSelected({\n selection: this.editor.state.selection,\n pos,\n nodeSize: this.node.nodeSize,\n selectedOnTextSelection: this.options.selectedOnTextSelection,\n })\n\n if (isSelected) {\n if (this.renderer.ref.$props.selected) {\n return\n }\n\n this.selectNode()\n } else {\n if (!this.renderer.ref.$props.selected) {\n return\n }\n\n this.deselectNode()\n }\n }\n\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(\n node: ProseMirrorNode,\n decorations: readonly Decoration[],\n innerDecorations: DecorationSource,\n ): boolean {\n const rerenderComponent = (props?: Record<string, any>) => {\n this.decorationClasses.value = this.getDecorationClasses()\n this.renderer.updateProps(props)\n }\n\n if (typeof this.options.update === 'function') {\n const oldNode = this.node\n const oldDecorations = this.decorations\n const oldInnerDecorations = this.innerDecorations\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({ node, decorations, innerDecorations }),\n })\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n const nodeChanged = node !== this.node\n\n // Node reference unchanged — only decorations may have changed.\n // ProseMirror renders decorations independently on the contentDOM,\n // and the getPos closure (bound in mount()) calls through to\n // ProseMirror's position function at call time, so it is always\n // current. Update internal refs, refresh decoration classes for\n // the wrapper component, and skip the Vue re-render.\n if (!nodeChanged) {\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.decorationClasses.value = this.getDecorationClasses()\n return true\n }\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = this.getPos()\n\n const extraProps: Record<string, any> = {\n node,\n decorations,\n innerDecorations,\n }\n\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos()\n }\n\n rerenderComponent(extraProps)\n\n return true\n }\n\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true,\n })\n this.renderer.element.classList.add('ProseMirror-selectednode')\n }\n\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false,\n })\n this.renderer.element.classList.remove('ProseMirror-selectednode')\n }\n\n getDecorationClasses() {\n return (\n this.decorations\n // @ts-ignore\n .flatMap(item => item.type.attrs.class)\n .join(' ')\n )\n }\n\n destroy() {\n this.renderer.destroy()\n this.editor.off('selectionUpdate', this.handleSelectionUpdate)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.off('update', this.handlePositionUpdate)\n }\n\n this.contentDOMElement = null\n }\n}\n\nexport function VueNodeViewRenderer(\n component: Vue | VueConstructor,\n options?: Partial<VueNodeViewRendererOptions>,\n): NodeViewRenderer {\n return props => {\n // try to get the parent component\n // this is important for vue devtools to show the component hierarchy correctly\n // maybe it’s `undefined` because <editor-content> isn’t rendered yet\n if (!(props.editor as Editor).contentComponent) {\n return {} as unknown as ProseMirrorNodeView\n }\n\n return new VueNodeView(component, props, options)\n }\n}\n","import type { Component, VueConstructor } from 'vue'\n\nimport { Vue } from '../Vue.js'\n\n/**\n * Builds the Vue 2 constructor for a widget component.\n *\n * Extends the editor's own Vue constructor so the widget shares its context,\n * then auto-declares every passed prop the component does not declare itself.\n * Vue 2 fixes the prop list at construction, so undeclared keys would be\n * dropped. Existing declarations keep their type, default and validator.\n *\n * @param base The editor's Vue constructor, or undefined to fall back to `Vue`.\n * @param component The widget component.\n * @param props The props the widget is mounted with.\n * @returns A constructor that accepts every key in `props`.\n * @example\n * createWidgetConstructor(undefined, MyWidget, { editor, getPos, label: 'a' })\n */\nexport function createWidgetConstructor(\n base: VueConstructor | undefined,\n component: Component,\n props: Record<string, any>,\n): VueConstructor {\n const VueBase = base ?? Vue\n const Extended = VueBase.extend(component as any)\n const declaredProps = {\n ...(Extended as unknown as { options: { props?: Record<string, any> } }).options.props,\n }\n\n for (const name of Object.keys(props)) {\n if (!Object.prototype.hasOwnProperty.call(declaredProps, name)) {\n declaredProps[name] = null\n }\n }\n\n return Extended.extend({ props: declaredProps })\n}\n","import { createWidgetDecoration } from '@tiptap/core'\nimport type {\n Editor as CoreEditor,\n WidgetDecoration,\n WidgetDecorationOptions,\n WidgetRenderer,\n} from '@tiptap/core'\nimport type { Component, VueConstructor } from 'vue'\n\nimport type { Editor } from './Editor.js'\nimport { createWidgetConstructor } from './utils/createWidgetConstructor.js'\nimport { VueRenderer } from './VueRenderer.js'\n\n/**\n * Props every widget-decoration component receives in addition to the props you\n * pass through `VueWidgetRenderer`. Declare the ones you use on your component.\n */\nexport interface VueWidgetDecorationProps {\n editor: CoreEditor\n getPos: () => number | undefined\n}\n\nexport interface VueWidgetRendererOptions<\n P extends Record<string, any> = object,\n> extends WidgetDecorationOptions {\n /**\n * The editor instance.\n */\n editor: Editor\n /**\n * The document position the widget is rendered at.\n */\n pos: number\n /**\n * A stable, position-independent identifier for the widget.\n * Reusing the same key keeps the component mounted across re-renders.\n * Good: `comment-${id}`. Bad: paragraph index or document position.\n */\n key: string\n /**\n * Props passed to the component (merged with {@link VueWidgetDecorationProps}).\n * The component must render a single root element.\n */\n props?: P\n}\n\nconst WIDGET_CACHE = Symbol('tiptapVue2WidgetCache')\n\n// @ts-ignore\nconst isDev = process.env.NODE_ENV !== 'production'\n\n/** The `VueRenderer` plus the warning wrapper the widget cache drives. */\ninterface WidgetRendererEntry extends WidgetRenderer {\n renderer: VueRenderer\n}\n\n// Vue 2 fixes the prop list at construction. Keys absent on first mount are\n// never declared, so updateProps silently drops them on later updates.\nfunction warnUndeclaredProps(renderer: VueRenderer, props: Record<string, any>, key: string): void {\n if (!isDev) {\n return\n }\n\n const declared = renderer.ref.$props ?? {}\n\n for (const name of Object.keys(props)) {\n if (!(name in declared)) {\n console.warn(\n `[tiptap warn]: VueWidgetRenderer prop \"${name}\" was not passed on first mount for widget \"${key}\".`,\n 'Vue 2 cannot declare new props after mount, so this value is ignored.',\n )\n }\n }\n}\n\n// Wrap the renderer so every prop push warns, whether it comes from the first\n// render or from the deferred flush.\nfunction withPropWarnings(renderer: VueRenderer, key: string): WidgetRendererEntry {\n return {\n renderer,\n updateProps: props => {\n warnUndeclaredProps(renderer, props, key)\n renderer.updateProps(props)\n },\n destroy: () => renderer.destroy(),\n }\n}\n\n/**\n * Renders a Vue 2 component into a ProseMirror widget decoration.\n * Reuses Tiptap's `VueRenderer` so the component is mounted under the editor's\n * content component (inject/provide works as usual). Use a stable `key` for\n * stateful widgets. The component must render a single root element.\n * @example\n * addDecorations() {\n * return {\n * create: ({ editor, state }) =>\n * findMatches(state.doc).map(match =>\n * VueWidgetRenderer(MyWidget, {\n * editor, pos: match.pos, key: `match-${match.id}`,\n * props: { label: match.label },\n * }),\n * ),\n * }\n * }\n */\nexport function VueWidgetRenderer<P extends Record<string, any> = object>(\n component: Component,\n options: VueWidgetRendererOptions<P>,\n): WidgetDecoration {\n const { editor, key, props = {} as P } = options\n\n return createWidgetDecoration<WidgetRendererEntry>({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n // `view` is not passed on purpose: Vue 2 deeply observes props and\n // observing a ProseMirror view corrupts its internals.\n context: getPos => ({ editor, getPos }),\n create: renderProps => {\n const base = (editor.contentComponent?.$options as any)?._base as VueConstructor | undefined\n const Constructor = createWidgetConstructor(base, component, renderProps)\n\n return withPropWarnings(\n new VueRenderer(Constructor, {\n parent: editor.contentComponent,\n propsData: renderProps,\n }),\n key,\n )\n },\n materialize: entry => entry.renderer.element as HTMLElement,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAa,SAAb,cAA4BA,aAAAA,OAAW;;;EACrC,KAAO,mBAA+B;;AACxC;;;ACIA,MAAa,gBAA2B;CACtC,MAAM;CAEN,OAAO,EACL,QAAQ;EACN,SAAS;EACT,MAAM;CACR,EACF;CAEA,OAAO,EACL,QAAQ;EACN,WAAW;EACX,QAAsC,QAAgB;GACpD,IAAI,UAAU,OAAO,QAAQ,SAC3B,KAAK,gBAAgB;;IACnB,MAAM,UAAU,KAAK;IAErB,IAAI,CAAC,WAAW,GAAA,mBAAC,OAAO,KAAK,SAAA,QAAA,qBAAA,KAAA,IAAA,KAAA,IAAA,iBAAK,aAChC;IAGF,QAAQ,OAAO,GAAG,OAAO,KAAK,IAAI,WAAW,UAAU;IACvD,OAAO,mBAAmB;IAE1B,OAAO,WAAW,EAChB,QACF,CAAC;IAED,OAAO,gBAAgB;GACzB,CAAC;EAEL;CACF,EACF;CAEA,OAAO,eAA8B;EACnC,OAAO,cAAc,KAAK;CAC5B;CAEA,gBAA4C;;EAC1C,MAAM,EAAE,WAAW;EAEnB,IAAI,CAAC,QACH;EAGF,IAAI,CAAC,OAAO,aACV,OAAO,KAAK,SAAS,EACnB,WAAW,CAAC,EACd,CAAC;EAGH,OAAO,mBAAmB;EAE1B,IAAI,GAAA,oBAAC,OAAO,KAAK,SAAA,QAAA,sBAAA,KAAA,IAAA,KAAA,IAAA,kBAAK,aACpB;EAIF,MAAM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
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { Decoration, DecorationSource } from '@tiptap/pm/view';
|
|
8
|
-
|
|
1
|
+
import { DecorationWithType, Editor as Editor$1, NodeViewRenderer, NodeViewRendererOptions, WidgetDecoration, WidgetDecorationOptions } from "@tiptap/core";
|
|
2
|
+
import { Component, VueConstructor } from "vue";
|
|
3
|
+
import { Node } from "@tiptap/pm/model";
|
|
4
|
+
import { Decoration, DecorationSource } from "@tiptap/pm/view";
|
|
5
|
+
export * from "@tiptap/core";
|
|
6
|
+
//#region src/Editor.d.ts
|
|
9
7
|
declare class Editor extends Editor$1 {
|
|
10
|
-
|
|
8
|
+
contentComponent: Vue | null;
|
|
11
9
|
}
|
|
12
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/EditorContent.d.ts
|
|
13
12
|
interface EditorContentInterface extends Vue {
|
|
14
|
-
|
|
13
|
+
editor: Editor;
|
|
15
14
|
}
|
|
16
15
|
declare const EditorContent: Component;
|
|
17
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/NodeViewContent.d.ts
|
|
18
18
|
interface NodeViewContentInterface extends Vue {
|
|
19
|
-
|
|
19
|
+
as: string;
|
|
20
20
|
}
|
|
21
21
|
declare const NodeViewContent: Component;
|
|
22
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/NodeViewWrapper.d.ts
|
|
23
24
|
interface NodeViewWrapperInterface extends Vue {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
as: string;
|
|
26
|
+
decorationClasses: {
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
onDragStart: () => void;
|
|
29
30
|
}
|
|
30
31
|
declare const NodeViewWrapper: Component;
|
|
31
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/VueNodeViewRenderer.d.ts
|
|
32
34
|
declare const nodeViewProps: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
editor: import("vue-ts-types/dist/types.js").RequiredPropOptions<import("@tiptap/core").Editor>;
|
|
36
|
+
node: import("vue-ts-types/dist/types.js").RequiredPropOptions<Node>;
|
|
37
|
+
decorations: import("vue-ts-types/dist/types.js").RequiredPropOptions<readonly DecorationWithType[]>;
|
|
38
|
+
selected: import("vue-ts-types/dist/types.js").RequiredPropOptions<boolean>;
|
|
39
|
+
extension: import("vue-ts-types/dist/types.js").RequiredPropOptions<import("@tiptap/core").Node<any, any>>;
|
|
40
|
+
getPos: import("vue-ts-types/dist/types.js").PropOptions<() => number | undefined> & {
|
|
41
|
+
required: true;
|
|
42
|
+
} & {
|
|
43
|
+
default?: (() => () => number | undefined) | undefined;
|
|
44
|
+
};
|
|
45
|
+
updateAttributes: import("vue-ts-types/dist/types.js").PropOptions<(attributes: Record<string, any>) => void> & {
|
|
46
|
+
required: true;
|
|
47
|
+
} & {
|
|
48
|
+
default?: (() => (attributes: Record<string, any>) => void) | undefined;
|
|
49
|
+
};
|
|
50
|
+
deleteNode: import("vue-ts-types/dist/types.js").PropOptions<() => void> & {
|
|
51
|
+
required: true;
|
|
52
|
+
} & {
|
|
53
|
+
default?: (() => () => void) | undefined;
|
|
54
|
+
};
|
|
53
55
|
};
|
|
54
56
|
interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
update: ((props: {
|
|
58
|
+
oldNode: Node;
|
|
59
|
+
oldDecorations: readonly Decoration[];
|
|
60
|
+
oldInnerDecorations: DecorationSource;
|
|
61
|
+
newNode: Node;
|
|
62
|
+
newDecorations: readonly Decoration[];
|
|
63
|
+
innerDecorations: DecorationSource;
|
|
64
|
+
updateProps: () => void;
|
|
65
|
+
}) => boolean) | null;
|
|
64
66
|
}
|
|
65
67
|
declare function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
66
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/VueRenderer.d.ts
|
|
67
70
|
/**
|
|
68
71
|
* The VueRenderer class is responsible for rendering a Vue component as a ProseMirror node view.
|
|
69
72
|
*/
|
|
70
73
|
declare class VueRenderer {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
ref: Vue;
|
|
75
|
+
constructor(component: Vue | VueConstructor, props: any);
|
|
76
|
+
get element(): Element;
|
|
77
|
+
updateProps(props?: Record<string, any>): void;
|
|
78
|
+
destroy(): void;
|
|
76
79
|
}
|
|
77
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/VueWidgetRenderer.d.ts
|
|
78
82
|
/**
|
|
79
83
|
* Props every widget-decoration component receives in addition to the props you
|
|
80
84
|
* pass through `VueWidgetRenderer`. Declare the ones you use on your component.
|
|
81
85
|
*/
|
|
82
86
|
interface VueWidgetDecorationProps {
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
editor: Editor$1;
|
|
88
|
+
getPos: () => number | undefined;
|
|
85
89
|
}
|
|
86
90
|
interface VueWidgetRendererOptions<P extends Record<string, any> = object> extends WidgetDecorationOptions {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
/**
|
|
92
|
+
* The editor instance.
|
|
93
|
+
*/
|
|
94
|
+
editor: Editor;
|
|
95
|
+
/**
|
|
96
|
+
* The document position the widget is rendered at.
|
|
97
|
+
*/
|
|
98
|
+
pos: number;
|
|
99
|
+
/**
|
|
100
|
+
* A stable, position-independent identifier for the widget.
|
|
101
|
+
* Reusing the same key keeps the component mounted across re-renders.
|
|
102
|
+
* Good: `comment-${id}`. Bad: paragraph index or document position.
|
|
103
|
+
*/
|
|
104
|
+
key: string;
|
|
105
|
+
/**
|
|
106
|
+
* Props passed to the component (merged with {@link VueWidgetDecorationProps}).
|
|
107
|
+
* The component must render a single root element.
|
|
108
|
+
*/
|
|
109
|
+
props?: P;
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* Renders a Vue 2 component into a ProseMirror widget decoration.
|
|
@@ -123,5 +127,6 @@ interface VueWidgetRendererOptions<P extends Record<string, any> = object> exten
|
|
|
123
127
|
* }
|
|
124
128
|
*/
|
|
125
129
|
declare function VueWidgetRenderer<P extends Record<string, any> = object>(component: Component, options: VueWidgetRendererOptions<P>): WidgetDecoration;
|
|
126
|
-
|
|
127
|
-
export { Editor, EditorContent,
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Editor, EditorContent, EditorContentInterface, NodeViewContent, NodeViewContentInterface, NodeViewWrapper, NodeViewWrapperInterface, VueNodeViewRenderer, VueNodeViewRendererOptions, VueRenderer, VueWidgetDecorationProps, VueWidgetRenderer, VueWidgetRendererOptions, nodeViewProps };
|
|
132
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/Editor.ts","../src/EditorContent.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/VueNodeViewRenderer.ts","../src/VueRenderer.ts","../src/VueWidgetRenderer.ts"],"mappings":";;;;;;cAGa,eAAe;EACnB,kBAAkB;;;;UCCV,+BAA+B;EAC9C,QAAQ;;cAGG,eAAe;;;UCNX,iCAAiC;EAChD;;cAGW,iBAAiB;;;UCJb,iCAAiC;EAChD;EACA;IACE;;EAEF;;cAGW,iBAAiB;;;cCMjB;;;;;;;;;;;;;;;;;;;;;;UAWI,mCAAmC;EAClD,UACM;IACA,SAAS;IACT,yBAAyB;IACzB,qBAAqB;IACrB,SAAS;IACT,yBAAyB;IACzB,kBAAkB;IAClB;;;iBAiSQ,oBACd,WAAW,MAAM,gBACjB,UAAU,QAAQ,8BACjB;;;;;;cClUU;EACX,KAAM;EAEM,YAAA,WAAW,MAAM,gBAAgB;MAMzC,WAAW;EAIf,YAAY,QAAO;EAmBnB;;;;;;;;UCtBe;EACf,QAAQ;EACR;;UAGe,yBACf,UAAU,sCACF;;;;EAIR,QAAQ;;;;EAIR;;;;;;EAMA;;;;;EAKA,QAAQ;;;;;;;;;;;;;;;;;;;;iBA+DM,kBAAkB,UAAU,8BAC1C,WAAW,WACX,SAAS,yBAAyB,KACjC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,108 +1,112 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { Decoration, DecorationSource } from '@tiptap/pm/view';
|
|
8
|
-
|
|
1
|
+
import { DecorationWithType, Editor as Editor$1, NodeViewRenderer, NodeViewRendererOptions, WidgetDecoration, WidgetDecorationOptions } from "@tiptap/core";
|
|
2
|
+
import { Component, VueConstructor } from "vue";
|
|
3
|
+
import { Node } from "@tiptap/pm/model";
|
|
4
|
+
import { Decoration, DecorationSource } from "@tiptap/pm/view";
|
|
5
|
+
export * from "@tiptap/core";
|
|
6
|
+
//#region src/Editor.d.ts
|
|
9
7
|
declare class Editor extends Editor$1 {
|
|
10
|
-
|
|
8
|
+
contentComponent: Vue | null;
|
|
11
9
|
}
|
|
12
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/EditorContent.d.ts
|
|
13
12
|
interface EditorContentInterface extends Vue {
|
|
14
|
-
|
|
13
|
+
editor: Editor;
|
|
15
14
|
}
|
|
16
15
|
declare const EditorContent: Component;
|
|
17
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/NodeViewContent.d.ts
|
|
18
18
|
interface NodeViewContentInterface extends Vue {
|
|
19
|
-
|
|
19
|
+
as: string;
|
|
20
20
|
}
|
|
21
21
|
declare const NodeViewContent: Component;
|
|
22
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/NodeViewWrapper.d.ts
|
|
23
24
|
interface NodeViewWrapperInterface extends Vue {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
as: string;
|
|
26
|
+
decorationClasses: {
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
onDragStart: () => void;
|
|
29
30
|
}
|
|
30
31
|
declare const NodeViewWrapper: Component;
|
|
31
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/VueNodeViewRenderer.d.ts
|
|
32
34
|
declare const nodeViewProps: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
editor: import("vue-ts-types/dist/types.js").RequiredPropOptions<import("@tiptap/core").Editor>;
|
|
36
|
+
node: import("vue-ts-types/dist/types.js").RequiredPropOptions<Node>;
|
|
37
|
+
decorations: import("vue-ts-types/dist/types.js").RequiredPropOptions<readonly DecorationWithType[]>;
|
|
38
|
+
selected: import("vue-ts-types/dist/types.js").RequiredPropOptions<boolean>;
|
|
39
|
+
extension: import("vue-ts-types/dist/types.js").RequiredPropOptions<import("@tiptap/core").Node<any, any>>;
|
|
40
|
+
getPos: import("vue-ts-types/dist/types.js").PropOptions<() => number | undefined> & {
|
|
41
|
+
required: true;
|
|
42
|
+
} & {
|
|
43
|
+
default?: (() => () => number | undefined) | undefined;
|
|
44
|
+
};
|
|
45
|
+
updateAttributes: import("vue-ts-types/dist/types.js").PropOptions<(attributes: Record<string, any>) => void> & {
|
|
46
|
+
required: true;
|
|
47
|
+
} & {
|
|
48
|
+
default?: (() => (attributes: Record<string, any>) => void) | undefined;
|
|
49
|
+
};
|
|
50
|
+
deleteNode: import("vue-ts-types/dist/types.js").PropOptions<() => void> & {
|
|
51
|
+
required: true;
|
|
52
|
+
} & {
|
|
53
|
+
default?: (() => () => void) | undefined;
|
|
54
|
+
};
|
|
53
55
|
};
|
|
54
56
|
interface VueNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
update: ((props: {
|
|
58
|
+
oldNode: Node;
|
|
59
|
+
oldDecorations: readonly Decoration[];
|
|
60
|
+
oldInnerDecorations: DecorationSource;
|
|
61
|
+
newNode: Node;
|
|
62
|
+
newDecorations: readonly Decoration[];
|
|
63
|
+
innerDecorations: DecorationSource;
|
|
64
|
+
updateProps: () => void;
|
|
65
|
+
}) => boolean) | null;
|
|
64
66
|
}
|
|
65
67
|
declare function VueNodeViewRenderer(component: Vue | VueConstructor, options?: Partial<VueNodeViewRendererOptions>): NodeViewRenderer;
|
|
66
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/VueRenderer.d.ts
|
|
67
70
|
/**
|
|
68
71
|
* The VueRenderer class is responsible for rendering a Vue component as a ProseMirror node view.
|
|
69
72
|
*/
|
|
70
73
|
declare class VueRenderer {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
ref: Vue;
|
|
75
|
+
constructor(component: Vue | VueConstructor, props: any);
|
|
76
|
+
get element(): Element;
|
|
77
|
+
updateProps(props?: Record<string, any>): void;
|
|
78
|
+
destroy(): void;
|
|
76
79
|
}
|
|
77
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/VueWidgetRenderer.d.ts
|
|
78
82
|
/**
|
|
79
83
|
* Props every widget-decoration component receives in addition to the props you
|
|
80
84
|
* pass through `VueWidgetRenderer`. Declare the ones you use on your component.
|
|
81
85
|
*/
|
|
82
86
|
interface VueWidgetDecorationProps {
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
editor: Editor$1;
|
|
88
|
+
getPos: () => number | undefined;
|
|
85
89
|
}
|
|
86
90
|
interface VueWidgetRendererOptions<P extends Record<string, any> = object> extends WidgetDecorationOptions {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
/**
|
|
92
|
+
* The editor instance.
|
|
93
|
+
*/
|
|
94
|
+
editor: Editor;
|
|
95
|
+
/**
|
|
96
|
+
* The document position the widget is rendered at.
|
|
97
|
+
*/
|
|
98
|
+
pos: number;
|
|
99
|
+
/**
|
|
100
|
+
* A stable, position-independent identifier for the widget.
|
|
101
|
+
* Reusing the same key keeps the component mounted across re-renders.
|
|
102
|
+
* Good: `comment-${id}`. Bad: paragraph index or document position.
|
|
103
|
+
*/
|
|
104
|
+
key: string;
|
|
105
|
+
/**
|
|
106
|
+
* Props passed to the component (merged with {@link VueWidgetDecorationProps}).
|
|
107
|
+
* The component must render a single root element.
|
|
108
|
+
*/
|
|
109
|
+
props?: P;
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* Renders a Vue 2 component into a ProseMirror widget decoration.
|
|
@@ -123,5 +127,6 @@ interface VueWidgetRendererOptions<P extends Record<string, any> = object> exten
|
|
|
123
127
|
* }
|
|
124
128
|
*/
|
|
125
129
|
declare function VueWidgetRenderer<P extends Record<string, any> = object>(component: Component, options: VueWidgetRendererOptions<P>): WidgetDecoration;
|
|
126
|
-
|
|
127
|
-
export { Editor, EditorContent,
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Editor, EditorContent, EditorContentInterface, NodeViewContent, NodeViewContentInterface, NodeViewWrapper, NodeViewWrapperInterface, VueNodeViewRenderer, VueNodeViewRendererOptions, VueRenderer, VueWidgetDecorationProps, VueWidgetRenderer, VueWidgetRendererOptions, nodeViewProps };
|
|
132
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/Editor.ts","../src/EditorContent.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/VueNodeViewRenderer.ts","../src/VueRenderer.ts","../src/VueWidgetRenderer.ts"],"mappings":";;;;;;cAGa,eAAe;EACnB,kBAAkB;;;;UCCV,+BAA+B;EAC9C,QAAQ;;cAGG,eAAe;;;UCNX,iCAAiC;EAChD;;cAGW,iBAAiB;;;UCJb,iCAAiC;EAChD;EACA;IACE;;EAEF;;cAGW,iBAAiB;;;cCMjB;;;;;;;;;;;;;;;;;;;;;;UAWI,mCAAmC;EAClD,UACM;IACA,SAAS;IACT,yBAAyB;IACzB,qBAAqB;IACrB,SAAS;IACT,yBAAyB;IACzB,kBAAkB;IAClB;;;iBAiSQ,oBACd,WAAW,MAAM,gBACjB,UAAU,QAAQ,8BACjB;;;;;;cClUU;EACX,KAAM;EAEM,YAAA,WAAW,MAAM,gBAAgB;MAMzC,WAAW;EAIf,YAAY,QAAO;EAmBnB;;;;;;;;UCtBe;EACf,QAAQ;EACR;;UAGe,yBACf,UAAU,sCACF;;;;EAIR,QAAQ;;;;EAIR;;;;;;EAMA;;;;;EAKA,QAAQ;;;;;;;;;;;;;;;;;;;;iBA+DM,kBAAkB,UAAU,8BAC1C,WAAW,WACX,SAAS,yBAAyB,KACjC"}
|