{"version":3,"file":"razroo-ngx-tiptap.mjs","sources":["../../../projects/ngx-tiptap/src/lib/editor.directive.ts","../../../projects/ngx-tiptap/src/lib/floating-menu.directive.ts","../../../projects/ngx-tiptap/src/lib/bubble-menu.directive.ts","../../../projects/ngx-tiptap/src/lib/draggable.directive.ts","../../../projects/ngx-tiptap/src/lib/node-view-content.directive.ts","../../../projects/ngx-tiptap/src/lib/node-view.component.ts","../../../projects/ngx-tiptap/src/lib/ngx-tiptap.module.ts","../../../projects/ngx-tiptap/src/lib/AngularRenderer.ts","../../../projects/ngx-tiptap/src/lib/NodeViewRenderer.ts","../../../projects/ngx-tiptap/src/public-api.ts","../../../projects/ngx-tiptap/src/razroo-ngx-tiptap.ts"],"sourcesContent":["import {\n  AfterViewInit, ChangeDetectorRef, Directive,\n  ElementRef, forwardRef, Input, OnInit, Renderer2,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Content, Editor, type EditorEvents } from '@tiptap/core';\n\n@Directive({\n  selector: 'tiptap[editor], [tiptap][editor], tiptap-editor[editor], [tiptapEditor][editor]',\n  providers: [{\n    provide: NG_VALUE_ACCESSOR,\n    useExisting: forwardRef(() => EditorDirective),\n    multi: true,\n  }],\n})\n\nexport class EditorDirective implements OnInit, AfterViewInit, ControlValueAccessor {\n  @Input() editor!: Editor;\n  @Input() outputFormat: 'json' | 'html' = 'html';\n\n  constructor(\n    protected elRef: ElementRef<HTMLElement>,\n    protected renderer: Renderer2,\n    protected changeDetectorRef: ChangeDetectorRef,\n  ) { }\n\n  protected onChange: (value: Content) => void = () => { /** */ };\n  protected onTouched: () => void = () => { /** */ };\n\n  // Writes a new value to the element.\n  // This methods is called when programmatic changes from model to view are requested.\n  writeValue(value: Content): void {\n    if (!this.outputFormat && typeof value === 'string') {\n      this.outputFormat = 'html';\n    }\n\n    this.editor.chain().setContent(value, false).run();\n  }\n\n  // Registers a callback function that is called when the control's value changes in the UI.\n  registerOnChange(fn: () => void): void {\n    this.onChange = fn;\n  }\n\n  // Registers a callback function that is called by the forms API on initialization to update the form model on blur.\n  registerOnTouched(fn: () => void): void {\n    this.onTouched = fn;\n  }\n\n  // Called by the forms api to enable or disable the element\n  setDisabledState(isDisabled: boolean): void {\n    this.editor.setEditable(!isDisabled);\n    this.renderer.setProperty(this.elRef.nativeElement, 'disabled', isDisabled);\n  }\n\n  protected handleChange = ({ editor, transaction }: EditorEvents['transaction']): void => {\n    if (!transaction.docChanged) {\n      return;\n    }\n\n    // Needed for ChangeDetectionStrategy.OnPush to get notified about changes\n    this.changeDetectorRef.markForCheck();\n\n    if (this.outputFormat === 'html') {\n      this.onChange(editor.getHTML());\n      return;\n    }\n\n    this.onChange(editor.getJSON());\n  };\n\n  ngOnInit(): void {\n    if (!this.editor) {\n      throw new Error('Required: Input `editor`');\n    }\n\n    // take the inner contents and clear the block\n    const { innerHTML } = this.elRef.nativeElement;\n    this.elRef.nativeElement.innerHTML = '';\n\n    // insert the editor in the dom\n    this.elRef.nativeElement.append(...Array.from(this.editor.options.element.childNodes));\n\n    // update the options for the editor\n    this.editor.setOptions({ element: this.elRef.nativeElement });\n\n    // update content to the editor\n    if (innerHTML) {\n      this.editor.chain().setContent(innerHTML, false).run();\n    }\n\n    // register blur handler to update `touched` property\n    this.editor.on('blur', () => {\n      this.onTouched();\n    });\n\n    // register update handler to listen to changes on update\n    this.editor.on('update', this.handleChange);\n\n    // Needed for ChangeDetectionStrategy.OnPush to get notified\n    this.editor.on('selectionUpdate', () => this.changeDetectorRef.markForCheck());\n  }\n\n  ngAfterViewInit(): void {\n    this.changeDetectorRef.detectChanges();\n  }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\nimport { Editor } from '@tiptap/core';\nimport { FloatingMenuPlugin, FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';\n\n@Directive({\n  selector: 'tiptap-floating-menu[editor], [tiptapFloatingMenu][editor]',\n})\n\nexport class FloatingMenuDirective implements OnInit, OnDestroy {\n  @Input() pluginKey: FloatingMenuPluginProps['pluginKey'] = 'NgxTiptapFloatingMenu';\n  @Input() editor!: Editor;\n  @Input() tippyOptions: FloatingMenuPluginProps['tippyOptions'] = {};\n  @Input() shouldShow: FloatingMenuPluginProps['shouldShow'] = null;\n\n  constructor(private elRef: ElementRef<HTMLElement>) { }\n\n  ngOnInit(): void {\n    if (!this.editor) {\n      throw new Error('Required: Input `editor`');\n    }\n\n    this.editor.registerPlugin(FloatingMenuPlugin({\n      pluginKey: this.pluginKey,\n      editor: this.editor,\n      element: this.elRef.nativeElement,\n      tippyOptions: this.tippyOptions,\n      shouldShow: this.shouldShow,\n    }));\n  }\n\n  ngOnDestroy(): void {\n    this.editor.unregisterPlugin(this.pluginKey);\n  }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\nimport { Editor } from '@tiptap/core';\nimport { BubbleMenuPlugin, BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';\n\n@Directive({\n  selector: 'tiptap-bubble-menu[editor], [tiptapBubbleMenu][editor]',\n})\nexport class BubbleMenuDirective implements OnInit, OnDestroy {\n  @Input() pluginKey: BubbleMenuPluginProps['pluginKey'] = 'NgxTiptapBubbleMenu';\n  @Input() editor!: Editor;\n  @Input() tippyOptions: BubbleMenuPluginProps['tippyOptions'] = {};\n  @Input() shouldShow: BubbleMenuPluginProps['shouldShow'] = null;\n  @Input() updateDelay: BubbleMenuPluginProps['updateDelay'];\n\n  constructor(private elRef: ElementRef<HTMLElement>) { }\n\n  ngOnInit(): void {\n    if (!this.editor) {\n      throw new Error('Required: Input `editor`');\n    }\n\n    this.editor.registerPlugin(BubbleMenuPlugin({\n      pluginKey: this.pluginKey,\n      editor: this.editor,\n      element: this.elRef.nativeElement,\n      tippyOptions: this.tippyOptions,\n      shouldShow: this.shouldShow,\n      updateDelay: this.updateDelay,\n    }));\n  }\n\n  ngOnDestroy(): void {\n    this.editor.unregisterPlugin(this.pluginKey);\n  }\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n  selector: '[tiptapDraggable]',\n})\nexport class DraggableDirective {\n  @HostBinding('attr.draggable') draggable = true;\n  @HostBinding('attr.data-drag-handle') handle = '';\n}\n","import { Directive, HostBinding } from '@angular/core';\n\n@Directive({\n  selector: '[tiptapNodeViewContent]',\n})\nexport class NodeViewContentDirective {\n  @HostBinding('attr.data-node-view-content') handle = '';\n  @HostBinding('style.white-space') whiteSpace = 'pre-wrap';\n}\n","import { Component, Input } from '@angular/core';\nimport type { NodeViewProps } from '@tiptap/core';\n\n@Component({ template: '' })\nexport class AngularNodeViewComponent implements NodeViewProps {\n  @Input() editor!: NodeViewProps['editor'];\n  @Input() node!: NodeViewProps['node'];\n  @Input() decorations!: NodeViewProps['decorations'];\n  @Input() selected!: NodeViewProps['selected'];\n  @Input() extension!: NodeViewProps['extension'];\n  @Input() getPos!: NodeViewProps['getPos'];\n  @Input() updateAttributes!: NodeViewProps['updateAttributes'];\n  @Input() deleteNode!: NodeViewProps['deleteNode'];\n}\n","import { NgModule } from '@angular/core';\n\nimport { EditorDirective } from './editor.directive';\nimport { FloatingMenuDirective } from './floating-menu.directive';\nimport { BubbleMenuDirective } from './bubble-menu.directive';\nimport { DraggableDirective } from './draggable.directive';\nimport { NodeViewContentDirective } from './node-view-content.directive';\n\n@NgModule({\n  declarations: [\n    EditorDirective,\n    FloatingMenuDirective,\n    BubbleMenuDirective,\n    DraggableDirective,\n    NodeViewContentDirective,\n  ],\n  exports: [\n    EditorDirective,\n    FloatingMenuDirective,\n    BubbleMenuDirective,\n    DraggableDirective,\n    NodeViewContentDirective,\n  ],\n})\nexport class NgxTiptapModule { }\n","import {\n  ApplicationRef, ComponentRef, ElementRef,\n  Injector, Type, createComponent,\n} from '@angular/core';\n\nexport class AngularRenderer<C, P> {\n  private applicationRef: ApplicationRef;\n  private componentRef: ComponentRef<C>;\n\n  constructor(ViewComponent: Type<C>, injector: Injector, props: Partial<P>) {\n    this.applicationRef = injector.get(ApplicationRef);\n\n    this.componentRef = createComponent(ViewComponent, {\n      environmentInjector: this.applicationRef.injector,\n      elementInjector: injector,\n    });\n\n    // set input props to the component\n    this.updateProps(props);\n\n    this.applicationRef.attachView(this.componentRef.hostView);\n  }\n\n  get instance(): C {\n    return this.componentRef.instance;\n  }\n\n  get elementRef(): ElementRef {\n    return this.componentRef.injector.get(ElementRef);\n  }\n\n  get dom(): HTMLElement {\n    return this.elementRef.nativeElement;\n  }\n\n  updateProps<T extends P>(props: Partial<T>): void {\n    Object.entries(props).forEach(([key, value]) => {\n      this.componentRef.setInput(key, value);\n    });\n  }\n\n  detectChanges(): void {\n    this.componentRef.changeDetectorRef.detectChanges();\n  }\n\n  destroy(): void {\n    this.componentRef.destroy();\n    this.applicationRef.detachView(this.componentRef.hostView);\n  }\n}\n","import { Injector, Type } from '@angular/core';\nimport {\n  Editor, NodeView, NodeViewProps,\n  NodeViewRenderer, NodeViewRendererProps, NodeViewRendererOptions, DecorationWithType,\n} from '@tiptap/core';\nimport type { Decoration } from '@tiptap/pm/view';\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model';\n\nimport { AngularRenderer } from './AngularRenderer';\nimport { AngularNodeViewComponent } from './node-view.component';\n\ninterface RendererUpdateProps {\n  oldNode: ProseMirrorNode;\n  oldDecorations: Decoration[];\n  newNode: ProseMirrorNode;\n  newDecorations: Decoration[];\n  updateProps: () => void;\n}\n\ninterface AngularNodeViewRendererOptions extends NodeViewRendererOptions {\n  update?: ((props: RendererUpdateProps) => boolean) | null;\n  injector: Injector;\n}\n\nclass AngularNodeView extends NodeView<Type<AngularNodeViewComponent>, Editor, AngularNodeViewRendererOptions> {\n  renderer!: AngularRenderer<AngularNodeViewComponent, NodeViewProps>;\n  contentDOMElement!: HTMLElement | null;\n\n  override mount() {\n    const injector = this.options.injector as Injector;\n\n    const props: NodeViewProps = {\n      editor: this.editor,\n      node: this.node,\n      decorations: this.decorations,\n      selected: false,\n      extension: this.extension,\n      getPos: () => this.getPos(),\n      updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n      deleteNode: () => this.deleteNode(),\n    };\n\n    this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);\n    this.editor.on('selectionUpdate', this.handleSelectionUpdate);\n\n    // create renderer\n    this.renderer = new AngularRenderer(this.component, injector, props);\n\n    // Register drag handler\n    if (this.extension.config.draggable) {\n      this.renderer.elementRef.nativeElement.ondragstart = (e: DragEvent) => {\n        this.onDragStart(e);\n      };\n    }\n\n    this.contentDOMElement = this.node.isLeaf ? null : document.createElement(this.node.isInline ? 'span' : 'div');\n\n    if (this.contentDOMElement) {\n      // For some reason the whiteSpace prop is not inherited properly in Chrome and Safari\n      // With this fix it seems to work fine\n      // See: https://github.com/ueberdosis/tiptap/issues/1197\n      this.contentDOMElement.style.whiteSpace = 'inherit';\n\n      // Required for editable node views\n      // The content won't be rendered if `editable` is set to `false`\n      this.renderer.detectChanges();\n    }\n\n    this.appendContendDom();\n  }\n\n  override get dom() {\n    return this.renderer.dom;\n  }\n\n  override get contentDOM() {\n    if (this.node.isLeaf) {\n      return null;\n    }\n\n    return this.contentDOMElement;\n  }\n\n  private appendContendDom() {\n    const contentElement = this.dom.querySelector('[data-node-view-content]');\n\n    if (\n      this.contentDOMElement\n      && contentElement\n      && !contentElement.contains(this.contentDOMElement)\n    ) {\n      contentElement.appendChild(this.contentDOMElement);\n    }\n  }\n\n  handleSelectionUpdate() {\n    const { from, to } = this.editor.state.selection;\n\n    if (from <= this.getPos() && to >= this.getPos() + this.node.nodeSize) {\n      this.selectNode();\n    } else {\n      this.deselectNode();\n    }\n  }\n\n  update(node: ProseMirrorNode, decorations: DecorationWithType[]): boolean {\n    const updateProps = () => {\n      this.renderer.updateProps({ node, decorations });\n    };\n\n    if (this.options.update) {\n      const oldNode = this.node;\n      const oldDecorations = this.decorations;\n\n      this.node = node;\n      this.decorations = decorations;\n\n      return this.options.update({\n        oldNode,\n        oldDecorations,\n        newNode: node,\n        newDecorations: decorations,\n        updateProps: () => updateProps(),\n      });\n    }\n\n    if (node.type !== this.node.type) {\n      return false;\n    }\n\n    if (node === this.node && this.decorations === decorations) {\n      return true;\n    }\n\n    this.node = node;\n    this.decorations = decorations;\n    updateProps();\n\n    return true;\n  }\n\n  selectNode() {\n    this.renderer.updateProps({ selected: true });\n  }\n\n  deselectNode() {\n    this.renderer.updateProps({ selected: false });\n  }\n\n  destroy() {\n    this.renderer.destroy();\n    this.editor.off('selectionUpdate', this.handleSelectionUpdate);\n    this.contentDOMElement = null;\n  }\n}\n\nexport const AngularNodeViewRenderer = (\n  ViewComponent: Type<AngularNodeViewComponent>,\n  options: Partial<AngularNodeViewRendererOptions>,\n): NodeViewRenderer => {\n  return (props: NodeViewRendererProps) => {\n    return new AngularNodeView(ViewComponent, props, options);\n  };\n};\n","/*\n * Public API Surface of ngx-tiptap\n */\n\nexport * from './lib/editor.directive';\nexport * from './lib/floating-menu.directive';\nexport * from './lib/bubble-menu.directive';\nexport * from './lib/draggable.directive';\nexport * from './lib/node-view-content.directive';\nexport * from './lib/node-view.component';\nexport * from './lib/ngx-tiptap.module';\n\nexport * from './lib/AngularRenderer';\nexport * from './lib/NodeViewRenderer';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAgBa,eAAe,CAAA;AAI1B,IAAA,WAAA,CACY,KAA8B,EAC9B,QAAmB,EACnB,iBAAoC,EAAA;QAFpC,IAAK,CAAA,KAAA,GAAL,KAAK,CAAyB;QAC9B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;QACnB,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;QALvC,IAAY,CAAA,YAAA,GAAoB,MAAM,CAAC;AAQtC,QAAA,IAAA,CAAA,QAAQ,GAA6B,MAAK,GAAW,CAAC;AACtD,QAAA,IAAA,CAAA,SAAS,GAAe,MAAK,GAAW,CAAC;QA4BzC,IAAY,CAAA,YAAA,GAAG,CAAC,EAAE,MAAM,EAAE,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