{"version":3,"file":"index.cjs","sources":["../src/BubbleMenu.ts","../src/Editor.ts","../src/EditorContent.ts","../src/FloatingMenu.ts","../src/NodeViewContent.ts","../src/NodeViewWrapper.ts","../src/useEditor.ts","../src/VueRenderer.ts","../src/VueNodeViewRenderer.ts"],"sourcesContent":["import { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\nimport {\n  defineComponent,\n  h,\n  onBeforeUnmount,\n  onMounted,\n  PropType,\n  ref,\n} from 'vue'\n\nexport const BubbleMenu = defineComponent({\n  name: 'BubbleMenu',\n\n  props: {\n    pluginKey: {\n      type: [String, Object] as PropType<BubbleMenuPluginProps['pluginKey']>,\n      default: 'bubbleMenu',\n    },\n\n    editor: {\n      type: Object as PropType<BubbleMenuPluginProps['editor']>,\n      required: true,\n    },\n\n    updateDelay: {\n      type: Number as PropType<BubbleMenuPluginProps['updateDelay']>,\n      default: undefined,\n    },\n\n    tippyOptions: {\n      type: Object as PropType<BubbleMenuPluginProps['tippyOptions']>,\n      default: () => ({}),\n    },\n\n    shouldShow: {\n      type: Function as PropType<Exclude<Required<BubbleMenuPluginProps>['shouldShow'], null>>,\n      default: null,\n    },\n  },\n\n  setup(props, { slots }) {\n    const root = ref<HTMLElement | null>(null)\n\n    onMounted(() => {\n      const {\n        updateDelay,\n        editor,\n        pluginKey,\n        shouldShow,\n        tippyOptions,\n      } = props\n\n      editor.registerPlugin(BubbleMenuPlugin({\n        updateDelay,\n        editor,\n        element: root.value as HTMLElement,\n        pluginKey,\n        shouldShow,\n        tippyOptions,\n      }))\n    })\n\n    onBeforeUnmount(() => {\n      const { pluginKey, editor } = props\n\n      editor.unregisterPlugin(pluginKey)\n    })\n\n    return () => h('div', { ref: root }, slots.default?.())\n  },\n})\n","/* eslint-disable react-hooks/rules-of-hooks */\nimport { Editor as CoreEditor, EditorOptions } from '@tiptap/core'\nimport { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'\nimport {\n  AppContext,\n  ComponentInternalInstance,\n  ComponentPublicInstance,\n  customRef,\n  markRaw,\n  Ref,\n} from 'vue'\n\nfunction useDebouncedRef<T>(value: T) {\n  return customRef<T>((track, trigger) => {\n    return {\n      get() {\n        track()\n        return value\n      },\n      set(newValue) {\n        // update state\n        value = newValue\n\n        // update view as soon as possible\n        requestAnimationFrame(() => {\n          requestAnimationFrame(() => {\n            trigger()\n          })\n        })\n      },\n    }\n  })\n}\n\nexport type ContentComponent = ComponentInternalInstance & {\n  ctx: ComponentPublicInstance\n}\n\nexport class Editor extends CoreEditor {\n  private reactiveState: Ref<EditorState>\n\n  private reactiveExtensionStorage: Ref<Record<string, any>>\n\n  public contentComponent: ContentComponent | null = null\n\n  public appContext: AppContext | null = null\n\n  constructor(options: Partial<EditorOptions> = {}) {\n    super(options)\n\n    this.reactiveState = useDebouncedRef(this.view.state)\n    this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage)\n\n    this.on('beforeTransaction', ({ nextState }) => {\n      this.reactiveState.value = nextState\n      this.reactiveExtensionStorage.value = this.extensionStorage\n    })\n\n    return markRaw(this) // eslint-disable-line\n  }\n\n  get state() {\n    return this.reactiveState ? this.reactiveState.value : this.view.state\n  }\n\n  get storage() {\n    return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage\n  }\n\n  /**\n   * Register a ProseMirror plugin.\n   */\n  public registerPlugin(\n    plugin: Plugin,\n    handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[],\n  ): EditorState {\n    const nextState = super.registerPlugin(plugin, handlePlugins)\n\n    if (this.reactiveState) {\n      this.reactiveState.value = nextState\n    }\n\n    return nextState\n  }\n\n  /**\n   * Unregister a ProseMirror plugin.\n   */\n  public unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined {\n    const nextState = super.unregisterPlugin(nameOrPluginKey)\n\n    if (this.reactiveState && nextState) {\n      this.reactiveState.value = nextState\n    }\n\n    return nextState\n  }\n}\n","import {\n  defineComponent,\n  getCurrentInstance,\n  h,\n  nextTick,\n  onBeforeUnmount,\n  PropType,\n  Ref,\n  ref,\n  unref,\n  watchEffect,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const EditorContent = defineComponent({\n  name: 'EditorContent',\n\n  props: {\n    editor: {\n      default: null,\n      type: Object as PropType<Editor>,\n    },\n  },\n\n  setup(props) {\n    const rootEl: Ref<Element | undefined> = ref()\n    const instance = getCurrentInstance()\n\n    watchEffect(() => {\n      const editor = props.editor\n\n      if (editor && editor.options.element && rootEl.value) {\n        nextTick(() => {\n          if (!rootEl.value || !editor.options.element.firstChild) {\n            return\n          }\n\n          const element = unref(rootEl.value)\n\n          rootEl.value.append(...editor.options.element.childNodes)\n\n          // @ts-ignore\n          editor.contentComponent = instance.ctx._\n\n          if (instance) {\n            editor.appContext = {\n              ...instance.appContext,\n              // Vue internally uses prototype chain to forward/shadow injects across the entire component chain\n              // so don't use object spread operator or 'Object.assign' and just set `provides` as is on editor's appContext\n              // @ts-expect-error forward instance's 'provides' into appContext\n              provides: instance.provides,\n            }\n          }\n\n          editor.setOptions({\n            element,\n          })\n\n          editor.createNodeViews()\n        })\n      }\n    })\n\n    onBeforeUnmount(() => {\n      const editor = props.editor\n\n      if (!editor) {\n        return\n      }\n\n      editor.contentComponent = null\n      editor.appContext = null\n    })\n\n    return { rootEl }\n  },\n\n  render() {\n    return h(\n      'div',\n      {\n        ref: (el: any) => { this.rootEl = el },\n      },\n    )\n  },\n})\n","import { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\nimport {\n  defineComponent,\n  h,\n  onBeforeUnmount,\n  onMounted,\n  PropType,\n  ref,\n} from 'vue'\n\nexport const FloatingMenu = defineComponent({\n  name: 'FloatingMenu',\n\n  props: {\n    pluginKey: {\n      // TODO: TypeScript breaks :(\n      // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],\n      type: null,\n      default: 'floatingMenu',\n    },\n\n    editor: {\n      type: Object as PropType<FloatingMenuPluginProps['editor']>,\n      required: true,\n    },\n\n    tippyOptions: {\n      type: Object as PropType<FloatingMenuPluginProps['tippyOptions']>,\n      default: () => ({}),\n    },\n\n    shouldShow: {\n      type: Function as PropType<Exclude<Required<FloatingMenuPluginProps>['shouldShow'], null>>,\n      default: null,\n    },\n  },\n\n  setup(props, { slots }) {\n    const root = ref<HTMLElement | null>(null)\n\n    onMounted(() => {\n      const {\n        pluginKey,\n        editor,\n        tippyOptions,\n        shouldShow,\n      } = props\n\n      editor.registerPlugin(FloatingMenuPlugin({\n        pluginKey,\n        editor,\n        element: root.value as HTMLElement,\n        tippyOptions,\n        shouldShow,\n      }))\n    })\n\n    onBeforeUnmount(() => {\n      const { pluginKey, editor } = props\n\n      editor.unregisterPlugin(pluginKey)\n    })\n\n    return () => h('div', { ref: root }, slots.default?.())\n  },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewContent = defineComponent({\n  name: 'NodeViewContent',\n\n  props: {\n    as: {\n      type: String,\n      default: 'div',\n    },\n  },\n\n  render() {\n    return h(this.as, {\n      style: {\n        whiteSpace: 'pre-wrap',\n      },\n      'data-node-view-content': '',\n    })\n  },\n})\n","import { defineComponent, h } from 'vue'\n\nexport const NodeViewWrapper = defineComponent({\n  name: 'NodeViewWrapper',\n\n  props: {\n    as: {\n      type: String,\n      default: 'div',\n    },\n  },\n\n  inject: ['onDragStart', 'decorationClasses'],\n\n  render() {\n    return h(\n      this.as,\n      {\n        // @ts-ignore\n        class: this.decorationClasses,\n        style: {\n          whiteSpace: 'normal',\n        },\n        'data-node-view-wrapper': '',\n        // @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)\n        onDragstart: this.onDragStart,\n      },\n      this.$slots.default?.(),\n    )\n  },\n})\n","import { EditorOptions } from '@tiptap/core'\nimport { onBeforeUnmount, onMounted, shallowRef } from 'vue'\n\nimport { Editor } from './Editor.js'\n\nexport const useEditor = (options: Partial<EditorOptions> = {}) => {\n  const editor = shallowRef<Editor>()\n\n  onMounted(() => {\n    editor.value = new Editor(options)\n  })\n\n  onBeforeUnmount(() => {\n    // Cloning root node (and its children) to avoid content being lost by destroy\n    const nodes = editor.value?.options.element\n    const newEl = nodes?.cloneNode(true) as HTMLElement\n\n    nodes?.parentNode?.replaceChild(newEl, nodes)\n\n    editor.value?.destroy()\n  })\n\n  return editor\n}\n","import { Editor } from '@tiptap/core'\nimport {\n  Component, DefineComponent, h, markRaw, reactive, render,\n} from 'vue'\n\nimport { Editor as ExtendedEditor } from './Editor.js'\n\nexport interface VueRendererOptions {\n  editor: Editor;\n  props?: Record<string, any>;\n}\n\ntype ExtendedVNode = ReturnType<typeof h> | null;\n\ninterface RenderedComponent {\n  vNode: ExtendedVNode;\n  destroy: () => void;\n  el: Element | null;\n}\n\n/**\n * This class is used to render Vue components inside the editor.\n */\nexport class VueRenderer {\n  renderedComponent!: RenderedComponent\n\n  editor: ExtendedEditor\n\n  component: Component\n\n  el: Element | null\n\n  props: Record<string, any>\n\n  constructor(component: Component, { props = {}, editor }: VueRendererOptions) {\n    this.editor = editor as ExtendedEditor\n    this.component = markRaw(component)\n    this.el = document.createElement('div')\n    this.props = reactive(props)\n    this.renderedComponent = this.renderComponent()\n  }\n\n  get element(): Element | null {\n    return this.renderedComponent.el\n  }\n\n  get ref(): any {\n    // Composition API\n    if (this.renderedComponent.vNode?.component?.exposed) {\n      return this.renderedComponent.vNode.component.exposed\n    }\n    // Option API\n    return this.renderedComponent.vNode?.component?.proxy\n  }\n\n  renderComponent() {\n    let vNode: ExtendedVNode = h(this.component as DefineComponent, this.props)\n\n    if (this.editor.appContext) {\n      vNode.appContext = this.editor.appContext\n    }\n    if (typeof document !== 'undefined' && this.el) {\n      render(vNode, this.el)\n    }\n\n    const destroy = () => {\n      if (this.el) {\n        render(null, this.el)\n      }\n      this.el = null\n      vNode = null\n    }\n\n    return { vNode, destroy, el: this.el ? this.el.firstElementChild : null }\n  }\n\n  updateProps(props: Record<string, any> = {}): void {\n    Object.entries(props).forEach(([key, value]) => {\n      this.props[key] = value\n    })\n    this.renderComponent()\n  }\n\n  destroy(): void {\n    this.renderedComponent.destroy()\n  }\n}\n","/* eslint-disable no-underscore-dangle */\nimport {\n  DecorationWithType,\n  NodeView,\n  NodeViewProps,\n  NodeViewRenderer,\n  NodeViewRendererOptions,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport {\n  Component, defineComponent, PropType, provide, Ref, ref,\n} from 'vue'\n\nimport { Editor } from './Editor.js'\nimport { VueRenderer } from './VueRenderer.js'\n\nexport const nodeViewProps = {\n  editor: {\n    type: Object as PropType<NodeViewProps['editor']>,\n    required: true as const,\n  },\n  node: {\n    type: Object as PropType<NodeViewProps['node']>,\n    required: true as const,\n  },\n  decorations: {\n    type: Object as PropType<NodeViewProps['decorations']>,\n    required: true as const,\n  },\n  selected: {\n    type: Boolean as PropType<NodeViewProps['selected']>,\n    required: true as const,\n  },\n  extension: {\n    type: Object as PropType<NodeViewProps['extension']>,\n    required: true as const,\n  },\n  getPos: {\n    type: Function as PropType<NodeViewProps['getPos']>,\n    required: true as const,\n  },\n  updateAttributes: {\n    type: Function as PropType<NodeViewProps['updateAttributes']>,\n    required: true as const,\n  },\n  deleteNode: {\n    type: Function as PropType<NodeViewProps['deleteNode']>,\n    required: true as const,\n  },\n  view: {\n    type: Object as PropType<NodeViewProps['view']>,\n    required: true as const,\n  },\n  innerDecorations: {\n    type: Object as PropType<NodeViewProps['innerDecorations']>,\n    required: true as const,\n  },\n  HTMLAttributes: {\n    type: Object as PropType<NodeViewProps['HTMLAttributes']>,\n    required: true as const,\n  },\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<Component, Editor, VueNodeViewRendererOptions> {\n  renderer!: VueRenderer\n\n  decorationClasses!: Ref<string>\n\n  mount() {\n    const props = {\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    } satisfies NodeViewProps\n\n    const onDragStart = this.onDragStart.bind(this)\n\n    this.decorationClasses = ref(this.getDecorationClasses())\n\n    const extendedComponent = defineComponent({\n      extends: { ...this.component },\n      props: Object.keys(props),\n      template: (this.component as any).template,\n      setup: reactiveProps => {\n        provide('onDragStart', onDragStart)\n        provide('decorationClasses', this.decorationClasses)\n\n        return (this.component as any).setup?.(reactiveProps, {\n          expose: () => undefined,\n        })\n      },\n      // add support for scoped styles\n      // @ts-ignore\n      // eslint-disable-next-line\n      __scopeId: this.component.__scopeId,\n      // add support for CSS Modules\n      // @ts-ignore\n      // eslint-disable-next-line\n      __cssModules: this.component.__cssModules,\n      // add support for vue devtools\n      // @ts-ignore\n      // eslint-disable-next-line\n      __name: this.component.__name,\n      // @ts-ignore\n      // eslint-disable-next-line\n      __file: this.component.__file,\n    })\n\n    this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this)\n    this.editor.on('selectionUpdate', this.handleSelectionUpdate)\n\n    this.renderer = new VueRenderer(extendedComponent, {\n      editor: this.editor,\n      props,\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 || !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.dom.querySelector('[data-node-view-content]') as HTMLElement | null\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 { from, to } = this.editor.state.selection\n    const pos = this.getPos()\n\n    if (typeof pos !== 'number') {\n      return\n    }\n\n    if (from <= pos && to >= pos + this.node.nodeSize) {\n      if (this.renderer.props.selected) {\n        return\n      }\n\n      this.selectNode()\n    } else {\n      if (!this.renderer.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    if (node === this.node && this.decorations === decorations && this.innerDecorations === innerDecorations) {\n      return true\n    }\n\n    this.node = node\n    this.decorations = decorations\n    this.innerDecorations = innerDecorations\n\n    rerenderComponent({ node, decorations, innerDecorations })\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    if (this.renderer.element) {\n      this.renderer.element.classList.add('ProseMirror-selectednode')\n    }\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    if (this.renderer.element) {\n      this.renderer.element.classList.remove('ProseMirror-selectednode')\n    }\n  }\n\n  getDecorationClasses() {\n    return (\n      this.decorations\n        // @ts-ignore\n        .map(item => item.type.attrs.class)\n        .flat()\n        .join(' ')\n    )\n  }\n\n  destroy() {\n    this.renderer.destroy()\n    this.editor.off('selectionUpdate', this.handleSelectionUpdate)\n  }\n}\n\nexport function VueNodeViewRenderer(\n  component: Component<NodeViewProps>,\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    // check for class-component and normalize if neccessary\n    const normalizedComponent = typeof component === 'function' && '__vccOpts' in component\n      ? (component.__vccOpts as Component)\n      : component\n\n    return new VueNodeView(normalizedComponent, props, options)\n  }\n}\n"],"names":["defineComponent","ref","onMounted","BubbleMenuPlugin","onBeforeUnmount","h","customRef","CoreEditor","markRaw","getCurrentInstance","watchEffect","nextTick","unref","FloatingMenuPlugin","shallowRef","reactive","render","NodeView","provide"],"mappings":";;;;;;;AAUO,MAAM,UAAU,GAAGA,mBAAe,CAAC;AACxC,IAAA,IAAI,EAAE,YAAY;AAElB,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAiD;AACtE,YAAA,OAAO,EAAE,YAAY;AACtB,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAAmD;AACzD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AAED,QAAA,WAAW,EAAE;AACX,YA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