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MwE,KAIvD,GAAIxE,EAAKsO,YACP,OAAO,EAMNtO,EAAKyI,MAAMO,QAAO5I,GAAQA,EAAKZ,OAASnB,KAAKmB,OAAMiX,MAAKrW,GAAQke,OAAOgC,OAAOlgB,EAAKmJ,OAAOkN,MAAKpW,KAAWA,OAE3GuK,EAAG2V,WAAW/b,EAAKA,EAAMxE,EAAKuK,SAAUlM,KAAKmB,K,KAI1C,CAAI,E,uCC/GN,MAAAghB,E,UAAOhjB,GAAKC,OAAO,CAC9BC,KAAM,OACNI,MAAO,U,oDC6BI,MAAA2iB,EAAY3gB,EAAAA,GAAKrC,OAAyB,CACrDC,KAAM,YAENC,WAAUA,KACD,CACLC,eAAgB,CAAC,IAIrBI,UAASA,IACA,CACL,CACEC,IAAK,KAEP,CACEgC,MAAO,kBACP6c,WAAW,EACX/c,SAAUE,KAAWA,EAAiBkQ,SAAS,cAAe,CAAC,IAKrEjS,UAAAA,CAAUC,GAAmB,IAAlB,eAAEP,GAAgBO,EAC3B,MAAO,CAAC,KAAKC,EAAAA,EAAAA,IAAgBC,KAAKC,QAAQV,eAAgBA,GAAiB,E,EAG7EW,WAAAA,GACE,MAAO,CACLmiB,aAAcA,IAAMjiB,IAAiB,IAAhB,SAAEC,GAAUD,EAC/B,OAAOC,EAAS8B,QAAQnC,KAAKX,KAAK,EAEpCijB,gBAAiBA,IAAM9hB,IAAiB,IAAhB,SAAEH,GAAUG,EAClC,OAAOH,EAASgC,WAAWrC,KAAKX,KAAK,EAEvCkjB,eAAgBA,IAAM5hB,IAAiB,IAAhB,SAAEN,GAAUM,EACjC,OAAON,EAASkC,UAAUvC,KAAKX,KAAK,E,EAK1CwB,oBAAAA,GACE,MAAO,CACL,QAAS2hB,IAAMxiB,KAAKe,OAAOV,SAASiiB,kBACpC,QAASG,IAAMziB,KAAKe,OAAOV,SAASiiB,kB","sources":["../node_modules/@tiptap/extension-blockquote/src/blockquote.ts","../node_modules/@tiptap/extension-bold/src/bold.ts","../node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.ts","../node_modules/@tiptap/extension-bubble-menu/src/bubble-menu.ts","../node_modules/@tiptap/extension-bullet-list/src/bullet-list.ts","../node_modules/@tiptap/extension-code-block/src/code-block.ts","../node_modules/@tiptap/extension-code/src/code.ts","../node_modules/@tiptap/extension-color/src/color.ts","../node_modules/@tiptap/extension-document/src/document.ts","../node_modules/@tiptap/extension-dropcursor/src/dropcursor.ts","../node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.ts","../node_modules/@tiptap/extension-floating-menu/src/floating-menu.ts","../node_modules/@tiptap/extension-font-family/src/font-family.ts","../node_modules/@tiptap/extension-gapcursor/src/gapcursor.ts","../node_modules/@tiptap/extension-hard-break/src/hard-break.ts","../node_modules/@tiptap/extension-heading/src/heading.ts","../node_modules/@tiptap/extension-highlight/src/highlight.ts","../node_modules/@tiptap/extension-history/src/history.ts","../node_modules/@tiptap/extension-horizontal-rule/src/horizontal-rule.ts","../node_modules/@tiptap/extension-italic/src/italic.ts","../node_modules/@tiptap/extension-link/src/link.ts","../node_modules/@tiptap/extension-link/src/helpers/autolink.ts","../node_modules/@tiptap/extension-link/src/helpers/clickHandler.ts","../node_modules/@tiptap/extension-link/src/helpers/pasteHandler.ts","../node_modules/@tiptap/extension-list-item/src/list-item.ts","../node_modules/@tiptap/extension-mention/src/mention.ts","../node_modules/@tiptap/extension-ordered-list/src/ordered-list.ts","../node_modules/@tiptap/extension-paragraph/src/paragraph.ts","../node_modules/@tiptap/extension-placeholder/src/placeholder.ts","../node_modules/@tiptap/extension-strike/src/strike.ts","../node_modules/@tiptap/extension-task-item/src/task-item.ts","../node_modules/@tiptap/extension-task-list/src/task-list.ts","../node_modules/@tiptap/extension-text-align/src/text-align.ts","../node_modules/@tiptap/extension-text-style/src/text-style.ts","../node_modules/@tiptap/extension-text/src/text.ts","../node_modules/@tiptap/extension-underline/src/underline.ts"],"sourcesContent":["import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'\n\nexport interface BlockquoteOptions {\n /**\n * HTML attributes to add to the blockquote element\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n blockQuote: {\n /**\n * Set a blockquote node\n */\n setBlockquote: () => ReturnType,\n /**\n * Toggle a blockquote node\n */\n toggleBlockquote: () => ReturnType,\n /**\n * Unset a blockquote node\n */\n unsetBlockquote: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches a blockquote to a `>` as input.\n */\nexport const inputRegex = /^\\s*>\\s$/\n\n/**\n * This extension allows you to create blockquotes.\n * @see https://tiptap.dev/api/nodes/blockquote\n */\nexport const Blockquote = Node.create({\n\n name: 'blockquote',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n group: 'block',\n\n defining: true,\n\n parseHTML() {\n return [\n { tag: 'blockquote' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['blockquote', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setBlockquote: () => ({ commands }) => {\n return commands.wrapIn(this.name)\n },\n toggleBlockquote: () => ({ commands }) => {\n return commands.toggleWrap(this.name)\n },\n unsetBlockquote: () => ({ commands }) => {\n return commands.lift(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-b': () => this.editor.commands.toggleBlockquote(),\n }\n },\n\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import {\n Mark,\n markInputRule,\n markPasteRule,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface BoldOptions {\n /**\n * HTML attributes to add to the bold element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n bold: {\n /**\n * Set a bold mark\n */\n setBold: () => ReturnType,\n /**\n * Toggle a bold mark\n */\n toggleBold: () => ReturnType,\n /**\n * Unset a bold mark\n */\n unsetBold: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches bold text via `**` as input.\n */\nexport const starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/\n\n/**\n * Matches bold text via `**` while pasting.\n */\nexport const starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g\n\n/**\n * Matches bold text via `__` as input.\n */\nexport const underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/\n\n/**\n * Matches bold text via `__` while pasting.\n */\nexport const underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g\n\n/**\n * This extension allows you to mark text as bold.\n * @see https://tiptap.dev/api/marks/bold\n */\nexport const Bold = Mark.create({\n name: 'bold',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'strong',\n },\n {\n tag: 'b',\n getAttrs: node => (node as HTMLElement).style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight=400',\n clearMark: mark => mark.type.name === this.name,\n },\n {\n style: 'font-weight',\n getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value as string) && null,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['strong', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setBold: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleBold: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetBold: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-b': () => this.editor.commands.toggleBold(),\n 'Mod-B': () => this.editor.commands.toggleBold(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type,\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type,\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import {\n Editor, isNodeSelection, isTextSelection, posToDOMRect,\n} from '@tiptap/core'\nimport { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'\nimport { EditorView } from '@tiptap/pm/view'\nimport tippy, { Instance, Props } from 'tippy.js'\n\nexport interface BubbleMenuPluginProps {\n /**\n * The plugin key.\n * @type {PluginKey | string}\n * @default 'bubbleMenu'\n */\n pluginKey: PluginKey | string\n\n /**\n * The editor instance.\n */\n editor: Editor\n\n /**\n * The DOM element that contains your menu.\n * @type {HTMLElement}\n * @default null\n */\n element: HTMLElement\n\n /**\n * The options for the tippy.js instance.\n * @see https://atomiks.github.io/tippyjs/v6/all-props/\n */\n tippyOptions?: Partial\n\n /**\n * The delay in milliseconds before the menu should be updated.\n * This can be useful to prevent performance issues.\n * @type {number}\n * @default 250\n */\n updateDelay?: number\n\n /**\n * A function that determines whether the menu should be shown or not.\n * If this function returns `false`, the menu will be hidden, otherwise it will be shown.\n */\n shouldShow?:\n | ((props: {\n editor: Editor\n element: HTMLElement\n view: EditorView\n state: EditorState\n oldState?: EditorState\n from: number\n to: number\n }) => boolean)\n | null\n}\n\nexport type BubbleMenuViewProps = BubbleMenuPluginProps & {\n view: EditorView\n}\n\nexport class BubbleMenuView {\n public editor: Editor\n\n public element: HTMLElement\n\n public view: EditorView\n\n public preventHide = false\n\n public tippy: Instance | undefined\n\n public tippyOptions?: Partial\n\n public updateDelay: number\n\n private updateDebounceTimer: number | undefined\n\n public shouldShow: Exclude = ({\n view,\n state,\n from,\n to,\n }) => {\n const { doc, selection } = state\n const { empty } = selection\n\n // Sometime check for `empty` is not enough.\n // Doubleclick an empty paragraph returns a node size of 2.\n // So we check also for an empty text size.\n const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection)\n\n // When clicking on a element inside the bubble menu the editor \"blur\" event\n // is called and the bubble menu item is focussed. In this case we should\n // consider the menu as part of the editor and keep showing the menu\n const isChildOfMenu = this.element.contains(document.activeElement)\n\n const hasEditorFocus = view.hasFocus() || isChildOfMenu\n\n if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {\n return false\n }\n\n return true\n }\n\n constructor({\n editor,\n element,\n view,\n tippyOptions = {},\n updateDelay = 250,\n shouldShow,\n }: BubbleMenuViewProps) {\n this.editor = editor\n this.element = element\n this.view = view\n this.updateDelay = updateDelay\n\n if (shouldShow) {\n this.shouldShow = shouldShow\n }\n\n this.element.addEventListener('mousedown', this.mousedownHandler, { capture: true })\n this.view.dom.addEventListener('dragstart', this.dragstartHandler)\n this.editor.on('focus', this.focusHandler)\n this.editor.on('blur', this.blurHandler)\n this.tippyOptions = tippyOptions\n // Detaches menu content from its current parent\n this.element.remove()\n this.element.style.visibility = 'visible'\n }\n\n mousedownHandler = () => {\n this.preventHide = true\n }\n\n dragstartHandler = () => {\n this.hide()\n }\n\n focusHandler = () => {\n // we use `setTimeout` to make sure `selection` is already updated\n setTimeout(() => this.update(this.editor.view))\n }\n\n blurHandler = ({ event }: { event: FocusEvent }) => {\n if (this.preventHide) {\n this.preventHide = false\n\n return\n }\n\n if (event?.relatedTarget && this.element.parentNode?.contains(event.relatedTarget as Node)) {\n return\n }\n\n if (\n event?.relatedTarget === this.editor.view.dom\n ) {\n return\n }\n\n this.hide()\n }\n\n tippyBlurHandler = (event: FocusEvent) => {\n this.blurHandler({ event })\n }\n\n createTooltip() {\n const { element: editorElement } = this.editor.options\n const editorIsAttached = !!editorElement.parentElement\n\n if (this.tippy || !editorIsAttached) {\n return\n }\n\n this.tippy = tippy(editorElement, {\n duration: 0,\n getReferenceClientRect: null,\n content: this.element,\n interactive: true,\n trigger: 'manual',\n placement: 'top',\n hideOnClick: 'toggle',\n ...this.tippyOptions,\n })\n\n // maybe we have to hide tippy on its own blur event as well\n if (this.tippy.popper.firstChild) {\n (this.tippy.popper.firstChild as HTMLElement).addEventListener('blur', this.tippyBlurHandler)\n }\n }\n\n update(view: EditorView, oldState?: EditorState) {\n const { state } = view\n const hasValidSelection = state.selection.from !== state.selection.to\n\n if (this.updateDelay > 0 && hasValidSelection) {\n this.handleDebouncedUpdate(view, oldState)\n return\n }\n\n const selectionChanged = !oldState?.selection.eq(view.state.selection)\n const docChanged = !oldState?.doc.eq(view.state.doc)\n\n this.updateHandler(view, selectionChanged, docChanged, oldState)\n }\n\n handleDebouncedUpdate = (view: EditorView, oldState?: EditorState) => {\n const selectionChanged = !oldState?.selection.eq(view.state.selection)\n const docChanged = !oldState?.doc.eq(view.state.doc)\n\n if (!selectionChanged && !docChanged) {\n return\n }\n\n if (this.updateDebounceTimer) {\n clearTimeout(this.updateDebounceTimer)\n }\n\n this.updateDebounceTimer = window.setTimeout(() => {\n this.updateHandler(view, selectionChanged, docChanged, oldState)\n }, this.updateDelay)\n }\n\n updateHandler = (view: EditorView, selectionChanged: boolean, docChanged: boolean, oldState?: EditorState) => {\n const { state, composing } = view\n const { selection } = state\n\n const isSame = !selectionChanged && !docChanged\n\n if (composing || isSame) {\n return\n }\n\n this.createTooltip()\n\n // support for CellSelections\n const { ranges } = selection\n const from = Math.min(...ranges.map(range => range.$from.pos))\n const to = Math.max(...ranges.map(range => range.$to.pos))\n\n const shouldShow = this.shouldShow?.({\n editor: this.editor,\n element: this.element,\n view,\n state,\n oldState,\n from,\n to,\n })\n\n if (!shouldShow) {\n this.hide()\n\n return\n }\n\n this.tippy?.setProps({\n getReferenceClientRect:\n this.tippyOptions?.getReferenceClientRect\n || (() => {\n if (isNodeSelection(state.selection)) {\n let node = view.nodeDOM(from) as HTMLElement\n\n if (node) {\n const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector('[data-node-view-wrapper]')\n\n if (nodeViewWrapper) {\n node = nodeViewWrapper.firstChild as HTMLElement\n }\n\n if (node) {\n return node.getBoundingClientRect()\n }\n }\n }\n\n return posToDOMRect(view, from, to)\n }),\n })\n\n this.show()\n }\n\n show() {\n this.tippy?.show()\n }\n\n hide() {\n this.tippy?.hide()\n }\n\n destroy() {\n if (this.tippy?.popper.firstChild) {\n (this.tippy.popper.firstChild as HTMLElement).removeEventListener(\n 'blur',\n this.tippyBlurHandler,\n )\n }\n this.tippy?.destroy()\n this.element.removeEventListener('mousedown', this.mousedownHandler, { capture: true })\n this.view.dom.removeEventListener('dragstart', this.dragstartHandler)\n this.editor.off('focus', this.focusHandler)\n this.editor.off('blur', this.blurHandler)\n }\n}\n\nexport const BubbleMenuPlugin = (options: BubbleMenuPluginProps) => {\n return new Plugin({\n key:\n typeof options.pluginKey === 'string' ? new PluginKey(options.pluginKey) : options.pluginKey,\n view: view => new BubbleMenuView({ view, ...options }),\n })\n}\n","import { Extension } from '@tiptap/core'\n\nimport { BubbleMenuPlugin, BubbleMenuPluginProps } from './bubble-menu-plugin.js'\n\nexport type BubbleMenuOptions = Omit & {\n /**\n * The DOM element that contains your menu.\n * @type {HTMLElement}\n * @default null\n */\n element: HTMLElement | null,\n}\n\n/**\n * This extension allows you to create a bubble menu.\n * @see https://tiptap.dev/api/extensions/bubble-menu\n */\nexport const BubbleMenu = Extension.create({\n name: 'bubbleMenu',\n\n addOptions() {\n return {\n element: null,\n tippyOptions: {},\n pluginKey: 'bubbleMenu',\n updateDelay: undefined,\n shouldShow: null,\n }\n },\n\n addProseMirrorPlugins() {\n if (!this.options.element) {\n return []\n }\n\n return [\n BubbleMenuPlugin({\n pluginKey: this.options.pluginKey,\n editor: this.editor,\n element: this.options.element,\n tippyOptions: this.options.tippyOptions,\n updateDelay: this.options.updateDelay,\n shouldShow: this.options.shouldShow,\n }),\n ]\n },\n})\n","import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'\n\nconst ListItemName = 'listItem'\nconst TextStyleName = 'textStyle'\n\nexport interface BulletListOptions {\n /**\n * The node name for the list items\n * @default 'listItem'\n * @example 'paragraph'\n */\n itemTypeName: string,\n\n /**\n * HTML attributes to add to the bullet list element\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n\n /**\n * Keep the marks when splitting the list\n * @default false\n * @example true\n */\n keepMarks: boolean,\n\n /**\n * Keep the attributes when splitting the list\n * @default false\n * @example true\n */\n keepAttributes: boolean,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n bulletList: {\n /**\n * Toggle a bullet list\n */\n toggleBulletList: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches a bullet list to a dash or asterisk.\n */\nexport const inputRegex = /^\\s*([-+*])\\s$/\n\n/**\n * This extension allows you to create bullet lists.\n * This requires the ListItem extension\n * @see https://tiptap.dev/api/nodes/bullet-list\n * @see https://tiptap.dev/api/nodes/list-item.\n */\nexport const BulletList = Node.create({\n name: 'bulletList',\n\n addOptions() {\n return {\n itemTypeName: 'listItem',\n HTMLAttributes: {},\n keepMarks: false,\n keepAttributes: false,\n }\n },\n\n group: 'block list',\n\n content() {\n return `${this.options.itemTypeName}+`\n },\n\n parseHTML() {\n return [\n { tag: 'ul' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n toggleBulletList: () => ({ commands, chain }) => {\n if (this.options.keepAttributes) {\n return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run()\n }\n return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-8': () => this.editor.commands.toggleBulletList(),\n }\n },\n\n addInputRules() {\n let inputRule = wrappingInputRule({\n find: inputRegex,\n type: this.type,\n })\n\n if (this.options.keepMarks || this.options.keepAttributes) {\n inputRule = wrappingInputRule({\n find: inputRegex,\n type: this.type,\n keepMarks: this.options.keepMarks,\n keepAttributes: this.options.keepAttributes,\n getAttributes: () => { return this.editor.getAttributes(TextStyleName) },\n editor: this.editor,\n })\n }\n return [\n inputRule,\n ]\n },\n})\n","import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core'\nimport {\n Plugin,\n PluginKey,\n Selection,\n TextSelection,\n} from '@tiptap/pm/state'\n\nexport interface CodeBlockOptions {\n /**\n * Adds a prefix to language classes that are applied to code tags.\n * @default 'language-'\n */\n languageClassPrefix: string\n /**\n * Define whether the node should be exited on triple enter.\n * @default true\n */\n exitOnTripleEnter: boolean\n /**\n * Define whether the node should be exited on arrow down if there is no node after it.\n * @default true\n */\n exitOnArrowDown: boolean\n /**\n * The default language.\n * @default null\n * @example 'js'\n */\n defaultLanguage: string | null | undefined\n /**\n * Custom HTML attributes that should be added to the rendered HTML tag.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n codeBlock: {\n /**\n * Set a code block\n * @param attributes Code block attributes\n * @example editor.commands.setCodeBlock({ language: 'javascript' })\n */\n setCodeBlock: (attributes?: { language: string }) => ReturnType\n /**\n * Toggle a code block\n * @param attributes Code block attributes\n * @example editor.commands.toggleCodeBlock({ language: 'javascript' })\n */\n toggleCodeBlock: (attributes?: { language: string }) => ReturnType\n }\n }\n}\n\n/**\n * Matches a code block with backticks.\n */\nexport const backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/\n\n/**\n * Matches a code block with tildes.\n */\nexport const tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/\n\n/**\n * This extension allows you to create code blocks.\n * @see https://tiptap.dev/api/nodes/code-block\n */\nexport const CodeBlock = Node.create({\n name: 'codeBlock',\n\n addOptions() {\n return {\n languageClassPrefix: 'language-',\n exitOnTripleEnter: true,\n exitOnArrowDown: true,\n defaultLanguage: null,\n HTMLAttributes: {},\n }\n },\n\n content: 'text*',\n\n marks: '',\n\n group: 'block',\n\n code: true,\n\n defining: true,\n\n addAttributes() {\n return {\n language: {\n default: this.options.defaultLanguage,\n parseHTML: element => {\n const { languageClassPrefix } = this.options\n const classNames = [...(element.firstElementChild?.classList || [])]\n const languages = classNames\n .filter(className => className.startsWith(languageClassPrefix))\n .map(className => className.replace(languageClassPrefix, ''))\n const language = languages[0]\n\n if (!language) {\n return null\n }\n\n return language\n },\n rendered: false,\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'pre',\n preserveWhitespace: 'full',\n },\n ]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n return [\n 'pre',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n [\n 'code',\n {\n class: node.attrs.language\n ? this.options.languageClassPrefix + node.attrs.language\n : null,\n },\n 0,\n ],\n ]\n },\n\n addCommands() {\n return {\n setCodeBlock:\n attributes => ({ commands }) => {\n return commands.setNode(this.name, attributes)\n },\n toggleCodeBlock:\n attributes => ({ commands }) => {\n return commands.toggleNode(this.name, 'paragraph', attributes)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Alt-c': () => this.editor.commands.toggleCodeBlock(),\n\n // remove code block when at start of document or code block is empty\n Backspace: () => {\n const { empty, $anchor } = this.editor.state.selection\n const isAtStart = $anchor.pos === 1\n\n if (!empty || $anchor.parent.type.name !== this.name) {\n return false\n }\n\n if (isAtStart || !$anchor.parent.textContent.length) {\n return this.editor.commands.clearNodes()\n }\n\n return false\n },\n\n // exit node on triple enter\n Enter: ({ editor }) => {\n if (!this.options.exitOnTripleEnter) {\n return false\n }\n\n const { state } = editor\n const { selection } = state\n const { $from, empty } = selection\n\n if (!empty || $from.parent.type !== this.type) {\n return false\n }\n\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2\n const endsWithDoubleNewline = $from.parent.textContent.endsWith('\\n\\n')\n\n if (!isAtEnd || !endsWithDoubleNewline) {\n return false\n }\n\n return editor\n .chain()\n .command(({ tr }) => {\n tr.delete($from.pos - 2, $from.pos)\n\n return true\n })\n .exitCode()\n .run()\n },\n\n // exit node on arrow down\n ArrowDown: ({ editor }) => {\n if (!this.options.exitOnArrowDown) {\n return false\n }\n\n const { state } = editor\n const { selection, doc } = state\n const { $from, empty } = selection\n\n if (!empty || $from.parent.type !== this.type) {\n return false\n }\n\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2\n\n if (!isAtEnd) {\n return false\n }\n\n const after = $from.after()\n\n if (after === undefined) {\n return false\n }\n\n const nodeAfter = doc.nodeAt(after)\n\n if (nodeAfter) {\n return editor.commands.command(({ tr }) => {\n tr.setSelection(Selection.near(doc.resolve(after)))\n return true\n })\n }\n\n return editor.commands.exitCode()\n },\n }\n },\n\n addInputRules() {\n return [\n textblockTypeInputRule({\n find: backtickInputRegex,\n type: this.type,\n getAttributes: match => ({\n language: match[1],\n }),\n }),\n textblockTypeInputRule({\n find: tildeInputRegex,\n type: this.type,\n getAttributes: match => ({\n language: match[1],\n }),\n }),\n ]\n },\n\n addProseMirrorPlugins() {\n return [\n // this plugin creates a code block for pasted content from VS Code\n // we can also detect the copied code language\n new Plugin({\n key: new PluginKey('codeBlockVSCodeHandler'),\n props: {\n handlePaste: (view, event) => {\n if (!event.clipboardData) {\n return false\n }\n\n // don’t create a new code block within code blocks\n if (this.editor.isActive(this.type.name)) {\n return false\n }\n\n const text = event.clipboardData.getData('text/plain')\n const vscode = event.clipboardData.getData('vscode-editor-data')\n const vscodeData = vscode ? JSON.parse(vscode) : undefined\n const language = vscodeData?.mode\n\n if (!text || !language) {\n return false\n }\n\n const { tr, schema } = view.state\n\n // prepare a text node\n // strip carriage return chars from text pasted as code\n // see: https://github.com/ProseMirror/prosemirror-view/commit/a50a6bcceb4ce52ac8fcc6162488d8875613aacd\n const textNode = schema.text(text.replace(/\\r\\n?/g, '\\n'))\n\n // create a code block with the text node\n // replace selection with the code block\n tr.replaceSelectionWith(this.type.create({ language }, textNode))\n\n if (tr.selection.$from.parent.type !== this.type) {\n // put cursor inside the newly created code block\n tr.setSelection(TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2))))\n }\n\n // store meta information\n // this is useful for other plugins that depends on the paste event\n // like the paste rule plugin\n tr.setMeta('paste', true)\n\n view.dispatch(tr)\n\n return true\n },\n },\n }),\n ]\n },\n})\n","import {\n Mark,\n markInputRule,\n markPasteRule,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface CodeOptions {\n /**\n * The HTML attributes applied to the code element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n code: {\n /**\n * Set a code mark\n */\n setCode: () => ReturnType,\n /**\n * Toggle inline code\n */\n toggleCode: () => ReturnType,\n /**\n * Unset a code mark\n */\n unsetCode: () => ReturnType,\n }\n }\n}\n\n/**\n * Regular expressions to match inline code blocks enclosed in backticks.\n * It matches:\n * - An opening backtick, followed by\n * - Any text that doesn't include a backtick (captured for marking), followed by\n * - A closing backtick.\n * This ensures that any text between backticks is formatted as code,\n * regardless of the surrounding characters (exception being another backtick).\n */\nexport const inputRegex = /(^|[^`])`([^`]+)`(?!`)/\n\n/**\n * Matches inline code while pasting.\n */\nexport const pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g\n\n/**\n * This extension allows you to mark text as inline code.\n * @see https://tiptap.dev/api/marks/code\n */\nexport const Code = Mark.create({\n name: 'code',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n excludes: '_',\n\n code: true,\n\n exitable: true,\n\n parseHTML() {\n return [\n { tag: 'code' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['code', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setCode: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleCode: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetCode: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-e': () => this.editor.commands.toggleCode(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: inputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import '@tiptap/extension-text-style'\n\nimport { Extension } from '@tiptap/core'\n\nexport type ColorOptions = {\n /**\n * The types where the color can be applied\n * @default ['textStyle']\n * @example ['heading', 'paragraph']\n */\n types: string[],\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n color: {\n /**\n * Set the text color\n * @param color The color to set\n * @example editor.commands.setColor('red')\n */\n setColor: (color: string) => ReturnType,\n\n /**\n * Unset the text color\n * @example editor.commands.unsetColor()\n */\n unsetColor: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to color your text.\n * @see https://tiptap.dev/api/extensions/color\n */\nexport const Color = Extension.create({\n name: 'color',\n\n addOptions() {\n return {\n types: ['textStyle'],\n }\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n color: {\n default: null,\n parseHTML: element => element.style.color?.replace(/['\"]+/g, ''),\n renderHTML: attributes => {\n if (!attributes.color) {\n return {}\n }\n\n return {\n style: `color: ${attributes.color}`,\n }\n },\n },\n },\n },\n ]\n },\n\n addCommands() {\n return {\n setColor: color => ({ chain }) => {\n return chain()\n .setMark('textStyle', { color })\n .run()\n },\n unsetColor: () => ({ chain }) => {\n return chain()\n .setMark('textStyle', { color: null })\n .removeEmptyTextStyle()\n .run()\n },\n }\n },\n})\n","import { Node } from '@tiptap/core'\n\n/**\n * The default document node which represents the top level node of the editor.\n * @see https://tiptap.dev/api/nodes/document\n */\nexport const Document = Node.create({\n name: 'doc',\n topNode: true,\n content: 'block+',\n})\n","import { Extension } from '@tiptap/core'\nimport { dropCursor } from '@tiptap/pm/dropcursor'\n\nexport interface DropcursorOptions {\n /**\n * The color of the drop cursor\n * @default 'currentColor'\n * @example 'red'\n */\n color: string | undefined,\n\n /**\n * The width of the drop cursor\n * @default 1\n * @example 2\n */\n width: number | undefined,\n\n /**\n * The class of the drop cursor\n * @default undefined\n * @example 'drop-cursor'\n */\n class: string | undefined,\n}\n\n/**\n * This extension allows you to add a drop cursor to your editor.\n * A drop cursor is a line that appears when you drag and drop content\n * inbetween nodes.\n * @see https://tiptap.dev/api/extensions/dropcursor\n */\nexport const Dropcursor = Extension.create({\n name: 'dropCursor',\n\n addOptions() {\n return {\n color: 'currentColor',\n width: 1,\n class: undefined,\n }\n },\n\n addProseMirrorPlugins() {\n return [\n dropCursor(this.options),\n ]\n },\n})\n","import {\n Editor, getText, getTextSerializersFromSchema, posToDOMRect,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'\nimport { EditorView } from '@tiptap/pm/view'\nimport tippy, { Instance, Props } from 'tippy.js'\n\nexport interface FloatingMenuPluginProps {\n /**\n * The plugin key for the floating menu.\n * @default 'floatingMenu'\n */\n pluginKey: PluginKey | string\n\n /**\n * The editor instance.\n * @default null\n */\n editor: Editor\n\n /**\n * The DOM element that contains your menu.\n * @default null\n */\n element: HTMLElement\n\n /**\n * The options for the tippy instance.\n * @default {}\n * @see https://atomiks.github.io/tippyjs/v6/all-props/\n */\n tippyOptions?: Partial\n\n /**\n * A function that determines whether the menu should be shown or not.\n * If this function returns `false`, the menu will be hidden, otherwise it will be shown.\n * @default null\n */\n shouldShow?:\n | ((props: {\n editor: Editor\n view: EditorView\n state: EditorState\n oldState?: EditorState\n }) => boolean)\n | null\n}\n\nexport type FloatingMenuViewProps = FloatingMenuPluginProps & {\n /**\n * The editor view.\n */\n view: EditorView\n}\n\nexport class FloatingMenuView {\n public editor: Editor\n\n public element: HTMLElement\n\n public view: EditorView\n\n public preventHide = false\n\n public tippy: Instance | undefined\n\n public tippyOptions?: Partial\n\n private getTextContent(node:ProseMirrorNode) {\n return getText(node, { textSerializers: getTextSerializersFromSchema(this.editor.schema) })\n }\n\n public shouldShow: Exclude = ({ view, state }) => {\n const { selection } = state\n const { $anchor, empty } = selection\n const isRootDepth = $anchor.depth === 1\n\n const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0 && !this.getTextContent($anchor.parent)\n\n if (\n !view.hasFocus()\n || !empty\n || !isRootDepth\n || !isEmptyTextBlock\n || !this.editor.isEditable\n ) {\n return false\n }\n\n return true\n }\n\n constructor({\n editor, element, view, tippyOptions = {}, shouldShow,\n }: FloatingMenuViewProps) {\n this.editor = editor\n this.element = element\n this.view = view\n\n if (shouldShow) {\n this.shouldShow = shouldShow\n }\n\n this.element.addEventListener('mousedown', this.mousedownHandler, { capture: true })\n this.editor.on('focus', this.focusHandler)\n this.editor.on('blur', this.blurHandler)\n this.tippyOptions = tippyOptions\n // Detaches menu content from its current parent\n this.element.remove()\n this.element.style.visibility = 'visible'\n }\n\n mousedownHandler = () => {\n this.preventHide = true\n }\n\n focusHandler = () => {\n // we use `setTimeout` to make sure `selection` is already updated\n setTimeout(() => this.update(this.editor.view))\n }\n\n blurHandler = ({ event }: { event: FocusEvent }) => {\n if (this.preventHide) {\n this.preventHide = false\n\n return\n }\n\n if (event?.relatedTarget && this.element.parentNode?.contains(event.relatedTarget as Node)) {\n return\n }\n\n if (\n event?.relatedTarget === this.editor.view.dom\n ) {\n return\n }\n\n this.hide()\n }\n\n tippyBlurHandler = (event: FocusEvent) => {\n this.blurHandler({ event })\n }\n\n createTooltip() {\n const { element: editorElement } = this.editor.options\n const editorIsAttached = !!editorElement.parentElement\n\n if (this.tippy || !editorIsAttached) {\n return\n }\n\n this.tippy = tippy(editorElement, {\n duration: 0,\n getReferenceClientRect: null,\n content: this.element,\n interactive: true,\n trigger: 'manual',\n placement: 'right',\n hideOnClick: 'toggle',\n ...this.tippyOptions,\n })\n\n // maybe we have to hide tippy on its own blur event as well\n if (this.tippy.popper.firstChild) {\n (this.tippy.popper.firstChild as HTMLElement).addEventListener('blur', this.tippyBlurHandler)\n }\n }\n\n update(view: EditorView, oldState?: EditorState) {\n const { state } = view\n const { doc, selection } = state\n const { from, to } = selection\n const isSame = oldState && oldState.doc.eq(doc) && oldState.selection.eq(selection)\n\n if (isSame) {\n return\n }\n\n this.createTooltip()\n\n const shouldShow = this.shouldShow?.({\n editor: this.editor,\n view,\n state,\n oldState,\n })\n\n if (!shouldShow) {\n this.hide()\n\n return\n }\n\n this.tippy?.setProps({\n getReferenceClientRect:\n this.tippyOptions?.getReferenceClientRect || (() => posToDOMRect(view, from, to)),\n })\n\n this.show()\n }\n\n show() {\n this.tippy?.show()\n }\n\n hide() {\n this.tippy?.hide()\n }\n\n destroy() {\n if (this.tippy?.popper.firstChild) {\n (this.tippy.popper.firstChild as HTMLElement).removeEventListener(\n 'blur',\n this.tippyBlurHandler,\n )\n }\n this.tippy?.destroy()\n this.element.removeEventListener('mousedown', this.mousedownHandler, { capture: true })\n this.editor.off('focus', this.focusHandler)\n this.editor.off('blur', this.blurHandler)\n }\n}\n\nexport const FloatingMenuPlugin = (options: FloatingMenuPluginProps) => {\n return new Plugin({\n key:\n typeof options.pluginKey === 'string' ? new PluginKey(options.pluginKey) : options.pluginKey,\n view: view => new FloatingMenuView({ view, ...options }),\n })\n}\n","import { Extension } from '@tiptap/core'\n\nimport { FloatingMenuPlugin, FloatingMenuPluginProps } from './floating-menu-plugin.js'\n\nexport type FloatingMenuOptions = Omit & {\n /**\n * The DOM element that contains your menu.\n * @type {HTMLElement}\n * @default null\n */\n element: HTMLElement | null,\n}\n\n/**\n * This extension allows you to create a floating menu.\n * @see https://tiptap.dev/api/extensions/floating-menu\n */\nexport const FloatingMenu = Extension.create({\n name: 'floatingMenu',\n\n addOptions() {\n return {\n element: null,\n tippyOptions: {},\n pluginKey: 'floatingMenu',\n shouldShow: null,\n }\n },\n\n addProseMirrorPlugins() {\n if (!this.options.element) {\n return []\n }\n\n return [\n FloatingMenuPlugin({\n pluginKey: this.options.pluginKey,\n editor: this.editor,\n element: this.options.element,\n tippyOptions: this.options.tippyOptions,\n shouldShow: this.options.shouldShow,\n }),\n ]\n },\n})\n","import '@tiptap/extension-text-style'\n\nimport { Extension } from '@tiptap/core'\n\nexport type FontFamilyOptions = {\n /**\n * A list of node names where the font family can be applied.\n * @default ['textStyle']\n * @example ['heading', 'paragraph']\n */\n types: string[],\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n fontFamily: {\n /**\n * Set the font family\n * @param fontFamily The font family\n * @example editor.commands.setFontFamily('Arial')\n */\n setFontFamily: (fontFamily: string) => ReturnType,\n /**\n * Unset the font family\n * @example editor.commands.unsetFontFamily()\n */\n unsetFontFamily: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to set a font family for text.\n * @see https://www.tiptap.dev/api/extensions/font-family\n */\nexport const FontFamily = Extension.create({\n name: 'fontFamily',\n\n addOptions() {\n return {\n types: ['textStyle'],\n }\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n fontFamily: {\n default: null,\n parseHTML: element => element.style.fontFamily,\n renderHTML: attributes => {\n if (!attributes.fontFamily) {\n return {}\n }\n\n return {\n style: `font-family: ${attributes.fontFamily}`,\n }\n },\n },\n },\n },\n ]\n },\n\n addCommands() {\n return {\n setFontFamily: fontFamily => ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontFamily })\n .run()\n },\n unsetFontFamily: () => ({ chain }) => {\n return chain()\n .setMark('textStyle', { fontFamily: null })\n .removeEmptyTextStyle()\n .run()\n },\n }\n },\n})\n","import {\n callOrReturn,\n Extension,\n getExtensionField,\n ParentConfig,\n} from '@tiptap/core'\nimport { gapCursor } from '@tiptap/pm/gapcursor'\n\ndeclare module '@tiptap/core' {\n interface NodeConfig {\n /**\n * A function to determine whether the gap cursor is allowed at the current position. Must return `true` or `false`.\n * @default null\n */\n allowGapCursor?:\n | boolean\n | null\n | ((this: {\n name: string,\n options: Options,\n storage: Storage,\n parent: ParentConfig>['allowGapCursor'],\n }) => boolean | null),\n }\n}\n\n/**\n * This extension allows you to add a gap cursor to your editor.\n * A gap cursor is a cursor that appears when you click on a place\n * where no content is present, for example inbetween nodes.\n * @see https://tiptap.dev/api/extensions/gapcursor\n */\nexport const Gapcursor = Extension.create({\n name: 'gapCursor',\n\n addProseMirrorPlugins() {\n return [\n gapCursor(),\n ]\n },\n\n extendNodeSchema(extension) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n }\n\n return {\n allowGapCursor: callOrReturn(getExtensionField(extension, 'allowGapCursor', context)) ?? null,\n }\n },\n})\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface HardBreakOptions {\n /**\n * Controls if marks should be kept after being split by a hard break.\n * @default true\n * @example false\n */\n keepMarks: boolean,\n\n /**\n * HTML attributes to add to the hard break element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n hardBreak: {\n /**\n * Add a hard break\n * @example editor.commands.setHardBreak()\n */\n setHardBreak: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to insert hard breaks.\n * @see https://www.tiptap.dev/api/nodes/hard-break\n */\nexport const HardBreak = Node.create({\n name: 'hardBreak',\n\n addOptions() {\n return {\n keepMarks: true,\n HTMLAttributes: {},\n }\n },\n\n inline: true,\n\n group: 'inline',\n\n selectable: false,\n\n linebreakReplacement: true,\n\n parseHTML() {\n return [\n { tag: 'br' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['br', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]\n },\n\n renderText() {\n return '\\n'\n },\n\n addCommands() {\n return {\n setHardBreak: () => ({\n commands,\n chain,\n state,\n editor,\n }) => {\n return commands.first([\n () => commands.exitCode(),\n () => commands.command(() => {\n const { selection, storedMarks } = state\n\n if (selection.$from.parent.type.spec.isolating) {\n return false\n }\n\n const { keepMarks } = this.options\n const { splittableMarks } = editor.extensionManager\n const marks = storedMarks\n || (selection.$to.parentOffset && selection.$from.marks())\n\n return chain()\n .insertContent({ type: this.name })\n .command(({ tr, dispatch }) => {\n if (dispatch && marks && keepMarks) {\n const filteredMarks = marks\n .filter(mark => splittableMarks.includes(mark.type.name))\n\n tr.ensureMarks(filteredMarks)\n }\n\n return true\n })\n .run()\n }),\n ])\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Enter': () => this.editor.commands.setHardBreak(),\n 'Shift-Enter': () => this.editor.commands.setHardBreak(),\n }\n },\n})\n","import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core'\n\n/**\n * The heading level options.\n */\nexport type Level = 1 | 2 | 3 | 4 | 5 | 6\n\nexport interface HeadingOptions {\n /**\n * The available heading levels.\n * @default [1, 2, 3, 4, 5, 6]\n * @example [1, 2, 3]\n */\n levels: Level[],\n\n /**\n * The HTML attributes for a heading node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n heading: {\n /**\n * Set a heading node\n * @param attributes The heading attributes\n * @example editor.commands.setHeading({ level: 1 })\n */\n setHeading: (attributes: { level: Level }) => ReturnType,\n /**\n * Toggle a heading node\n * @param attributes The heading attributes\n * @example editor.commands.toggleHeading({ level: 1 })\n */\n toggleHeading: (attributes: { level: Level }) => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to create headings.\n * @see https://www.tiptap.dev/api/nodes/heading\n */\nexport const Heading = Node.create({\n name: 'heading',\n\n addOptions() {\n return {\n levels: [1, 2, 3, 4, 5, 6],\n HTMLAttributes: {},\n }\n },\n\n content: 'inline*',\n\n group: 'block',\n\n defining: true,\n\n addAttributes() {\n return {\n level: {\n default: 1,\n rendered: false,\n },\n }\n },\n\n parseHTML() {\n return this.options.levels\n .map((level: Level) => ({\n tag: `h${level}`,\n attrs: { level },\n }))\n },\n\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level)\n const level = hasLevel\n ? node.attrs.level\n : this.options.levels[0]\n\n return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setHeading: attributes => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false\n }\n\n return commands.setNode(this.name, attributes)\n },\n toggleHeading: attributes => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false\n }\n\n return commands.toggleNode(this.name, 'paragraph', attributes)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return this.options.levels.reduce((items, level) => ({\n ...items,\n ...{\n [`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level }),\n },\n }), {})\n },\n\n addInputRules() {\n return this.options.levels.map(level => {\n return textblockTypeInputRule({\n find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\\\s$`),\n type: this.type,\n getAttributes: {\n level,\n },\n })\n })\n },\n})\n","import {\n Mark,\n markInputRule,\n markPasteRule,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface HighlightOptions {\n /**\n * Allow multiple highlight colors\n * @default false\n * @example true\n */\n multicolor: boolean,\n\n /**\n * HTML attributes to add to the highlight element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n highlight: {\n /**\n * Set a highlight mark\n * @param attributes The highlight attributes\n * @example editor.commands.setHighlight({ color: 'red' })\n */\n setHighlight: (attributes?: { color: string }) => ReturnType,\n /**\n * Toggle a highlight mark\n * @param attributes The highlight attributes\n * @example editor.commands.toggleHighlight({ color: 'red' })\n */\n toggleHighlight: (attributes?: { color: string }) => ReturnType,\n /**\n * Unset a highlight mark\n * @example editor.commands.unsetHighlight()\n */\n unsetHighlight: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches a highlight to a ==highlight== on input.\n */\nexport const inputRegex = /(?:^|\\s)(==(?!\\s+==)((?:[^=]+))==(?!\\s+==))$/\n\n/**\n * Matches a highlight to a ==highlight== on paste.\n */\nexport const pasteRegex = /(?:^|\\s)(==(?!\\s+==)((?:[^=]+))==(?!\\s+==))/g\n\n/**\n * This extension allows you to highlight text.\n * @see https://www.tiptap.dev/api/marks/highlight\n */\nexport const Highlight = Mark.create({\n name: 'highlight',\n\n addOptions() {\n return {\n multicolor: false,\n HTMLAttributes: {},\n }\n },\n\n addAttributes() {\n if (!this.options.multicolor) {\n return {}\n }\n\n return {\n color: {\n default: null,\n parseHTML: element => element.getAttribute('data-color') || element.style.backgroundColor,\n renderHTML: attributes => {\n if (!attributes.color) {\n return {}\n }\n\n return {\n 'data-color': attributes.color,\n style: `background-color: ${attributes.color}; color: inherit`,\n }\n },\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'mark',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['mark', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setHighlight: attributes => ({ commands }) => {\n return commands.setMark(this.name, attributes)\n },\n toggleHighlight: attributes => ({ commands }) => {\n return commands.toggleMark(this.name, attributes)\n },\n unsetHighlight: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-h': () => this.editor.commands.toggleHighlight(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: inputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import { Extension } from '@tiptap/core'\nimport { history, redo, undo } from '@tiptap/pm/history'\n\nexport interface HistoryOptions {\n /**\n * The amount of history events that are collected before the oldest events are discarded.\n * @default 100\n * @example 50\n */\n depth: number,\n\n /**\n * The delay (in milliseconds) between changes after which a new group should be started.\n * @default 500\n * @example 1000\n */\n newGroupDelay: number,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n history: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType,\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to undo and redo recent changes.\n * @see https://www.tiptap.dev/api/extensions/history\n *\n * **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n * the `history` extension, as it is not compatible with the `collaboration` extension.\n *\n * `@tiptap/extension-collaboration` uses its own history implementation.\n */\nexport const History = Extension.create({\n name: 'history',\n\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500,\n }\n },\n\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch)\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch)\n },\n }\n },\n\n addProseMirrorPlugins() {\n return [\n history(this.options),\n ]\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n 'Mod-y': () => this.editor.commands.redo(),\n\n // Russian keyboard layouts\n 'Mod-я': () => this.editor.commands.undo(),\n 'Shift-Mod-я': () => this.editor.commands.redo(),\n }\n },\n})\n","import {\n isNodeSelection, mergeAttributes, Node, nodeInputRule,\n} from '@tiptap/core'\nimport { NodeSelection, TextSelection } from '@tiptap/pm/state'\n\nexport interface HorizontalRuleOptions {\n /**\n * The HTML attributes for a horizontal rule node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n horizontalRule: {\n /**\n * Add a horizontal rule\n * @example editor.commands.setHorizontalRule()\n */\n setHorizontalRule: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to insert horizontal rules.\n * @see https://www.tiptap.dev/api/nodes/horizontal-rule\n */\nexport const HorizontalRule = Node.create({\n name: 'horizontalRule',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block',\n\n parseHTML() {\n return [{ tag: 'hr' }]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['hr', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]\n },\n\n addCommands() {\n return {\n setHorizontalRule:\n () => ({ chain, state }) => {\n const { selection } = state\n const { $from: $originFrom, $to: $originTo } = selection\n\n const currentChain = chain()\n\n if ($originFrom.parentOffset === 0) {\n currentChain.insertContentAt(\n {\n from: Math.max($originFrom.pos - 1, 0),\n to: $originTo.pos,\n },\n {\n type: this.name,\n },\n )\n } else if (isNodeSelection(selection)) {\n currentChain.insertContentAt($originTo.pos, {\n type: this.name,\n })\n } else {\n currentChain.insertContent({ type: this.name })\n }\n\n return (\n currentChain\n // set cursor after horizontal rule\n .command(({ tr, dispatch }) => {\n if (dispatch) {\n const { $to } = tr.selection\n const posAfter = $to.end()\n\n if ($to.nodeAfter) {\n if ($to.nodeAfter.isTextblock) {\n tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1))\n } else if ($to.nodeAfter.isBlock) {\n tr.setSelection(NodeSelection.create(tr.doc, $to.pos))\n } else {\n tr.setSelection(TextSelection.create(tr.doc, $to.pos))\n }\n } else {\n // add node after horizontal rule if it’s the end of the document\n const node = $to.parent.type.contentMatch.defaultType?.create()\n\n if (node) {\n tr.insert(posAfter, node)\n tr.setSelection(TextSelection.create(tr.doc, posAfter + 1))\n }\n }\n\n tr.scrollIntoView()\n }\n\n return true\n })\n .run()\n )\n },\n }\n },\n\n addInputRules() {\n return [\n nodeInputRule({\n find: /^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,\n type: this.type,\n }),\n ]\n },\n})\n","import {\n Mark,\n markInputRule,\n markPasteRule,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface ItalicOptions {\n /**\n * HTML attributes to add to the italic element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n italic: {\n /**\n * Set an italic mark\n * @example editor.commands.setItalic()\n */\n setItalic: () => ReturnType,\n /**\n * Toggle an italic mark\n * @example editor.commands.toggleItalic()\n */\n toggleItalic: () => ReturnType,\n /**\n * Unset an italic mark\n * @example editor.commands.unsetItalic()\n */\n unsetItalic: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches an italic to a *italic* on input.\n */\nexport const starInputRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/\n\n/**\n * Matches an italic to a *italic* on paste.\n */\nexport const starPasteRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g\n\n/**\n * Matches an italic to a _italic_ on input.\n */\nexport const underscoreInputRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/\n\n/**\n * Matches an italic to a _italic_ on paste.\n */\nexport const underscorePasteRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g\n\n/**\n * This extension allows you to create italic text.\n * @see https://www.tiptap.dev/api/marks/italic\n */\nexport const Italic = Mark.create({\n name: 'italic',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'em',\n },\n {\n tag: 'i',\n getAttrs: node => (node as HTMLElement).style.fontStyle !== 'normal' && null,\n },\n {\n style: 'font-style=normal',\n clearMark: mark => mark.type.name === this.name,\n },\n {\n style: 'font-style=italic',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['em', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setItalic: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleItalic: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetItalic: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-i': () => this.editor.commands.toggleItalic(),\n 'Mod-I': () => this.editor.commands.toggleItalic(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type,\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type,\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import {\n Mark, markPasteRule, mergeAttributes, PasteRuleMatch,\n} from '@tiptap/core'\nimport { Plugin } from '@tiptap/pm/state'\nimport { find, registerCustomProtocol, reset } from 'linkifyjs'\n\nimport { autolink } from './helpers/autolink.js'\nimport { clickHandler } from './helpers/clickHandler.js'\nimport { pasteHandler } from './helpers/pasteHandler.js'\n\nexport interface LinkProtocolOptions {\n /**\n * The protocol scheme to be registered.\n * @default '''\n * @example 'ftp'\n * @example 'git'\n */\n scheme: string;\n\n /**\n * If enabled, it allows optional slashes after the protocol.\n * @default false\n * @example true\n */\n optionalSlashes?: boolean;\n}\n\nexport const pasteRegex = /https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z]{2,}\\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi\n\n/**\n * @deprecated The default behavior is now to open links when the editor is not editable.\n */\ntype DeprecatedOpenWhenNotEditable = 'whenNotEditable';\n\nexport interface LinkOptions {\n /**\n * If enabled, the extension will automatically add links as you type.\n * @default true\n * @example false\n */\n autolink: boolean;\n\n /**\n * An array of custom protocols to be registered with linkifyjs.\n * @default []\n * @example ['ftp', 'git']\n */\n protocols: Array;\n\n /**\n * Default protocol to use when no protocol is specified.\n * @default 'http'\n */\n defaultProtocol: string;\n /**\n * If enabled, links will be opened on click.\n * @default true\n * @example false\n */\n openOnClick: boolean | DeprecatedOpenWhenNotEditable;\n /**\n * Adds a link to the current selection if the pasted content only contains an url.\n * @default true\n * @example false\n */\n linkOnPaste: boolean;\n\n /**\n * HTML attributes to add to the link element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record;\n\n /**\n * @deprecated Use the `shouldAutoLink` option instead.\n * A validation function that modifies link verification for the auto linker.\n * @param url - The url to be validated.\n * @returns - True if the url is valid, false otherwise.\n */\n validate: (url: string) => boolean;\n\n /**\n * A validation function which is used for configuring link verification for preventing XSS attacks.\n * Only modify this if you know what you're doing.\n *\n * @returns {boolean} `true` if the URL is valid, `false` otherwise.\n *\n * @example\n * isAllowedUri: (url, { defaultValidate, protocols, defaultProtocol }) => {\n * return url.startsWith('./') || defaultValidate(url)\n * }\n */\n isAllowedUri: (\n /**\n * The URL to be validated.\n */\n url: string,\n ctx: {\n /**\n * The default validation function.\n */\n defaultValidate: (url: string) => boolean;\n /**\n * An array of allowed protocols for the URL (e.g., \"http\", \"https\"). As defined in the `protocols` option.\n */\n protocols: Array;\n /**\n * A string that represents the default protocol (e.g., 'http'). As defined in the `defaultProtocol` option.\n */\n defaultProtocol: string;\n }\n ) => boolean;\n\n /**\n * Determines whether a valid link should be automatically linked in the content.\n *\n * @param {string} url - The URL that has already been validated.\n * @returns {boolean} - True if the link should be auto-linked; false if it should not be auto-linked.\n */\n shouldAutoLink: (url: string) => boolean;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n link: {\n /**\n * Set a link mark\n * @param attributes The link attributes\n * @example editor.commands.setLink({ href: 'https://tiptap.dev' })\n */\n setLink: (attributes: {\n href: string;\n target?: string | null;\n rel?: string | null;\n class?: string | null;\n }) => ReturnType;\n /**\n * Toggle a link mark\n * @param attributes The link attributes\n * @example editor.commands.toggleLink({ href: 'https://tiptap.dev' })\n */\n toggleLink: (attributes: {\n href: string;\n target?: string | null;\n rel?: string | null;\n class?: string | null;\n }) => ReturnType;\n /**\n * Unset a link mark\n * @example editor.commands.unsetLink()\n */\n unsetLink: () => ReturnType;\n };\n }\n}\n\n// From DOMPurify\n// https://github.com/cure53/DOMPurify/blob/main/src/regexp.js\n// eslint-disable-next-line no-control-regex\nconst ATTR_WHITESPACE = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g\n\nexport function isAllowedUri(uri: string | undefined, protocols?: LinkOptions['protocols']) {\n const allowedProtocols: string[] = [\n 'http',\n 'https',\n 'ftp',\n 'ftps',\n 'mailto',\n 'tel',\n 'callto',\n 'sms',\n 'cid',\n 'xmpp',\n ]\n\n if (protocols) {\n protocols.forEach(protocol => {\n const nextProtocol = typeof protocol === 'string' ? protocol : protocol.scheme\n\n if (nextProtocol) {\n allowedProtocols.push(nextProtocol)\n }\n })\n }\n\n return (\n !uri\n || uri\n .replace(ATTR_WHITESPACE, '')\n .match(\n new RegExp(\n // eslint-disable-next-line no-useless-escape\n `^(?:(?:${allowedProtocols.join('|')}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,\n 'i',\n ),\n )\n )\n}\n\n/**\n * This extension allows you to create links.\n * @see https://www.tiptap.dev/api/marks/link\n */\nexport const Link = Mark.create({\n name: 'link',\n\n priority: 1000,\n\n keepOnSplit: false,\n\n exitable: true,\n\n onCreate() {\n if (this.options.validate && !this.options.shouldAutoLink) {\n // Copy the validate function to the shouldAutoLink option\n this.options.shouldAutoLink = this.options.validate\n console.warn(\n 'The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.',\n )\n }\n this.options.protocols.forEach(protocol => {\n if (typeof protocol === 'string') {\n registerCustomProtocol(protocol)\n return\n }\n registerCustomProtocol(protocol.scheme, protocol.optionalSlashes)\n })\n },\n\n onDestroy() {\n reset()\n },\n\n inclusive() {\n return this.options.autolink\n },\n\n addOptions() {\n return {\n openOnClick: true,\n linkOnPaste: true,\n autolink: true,\n protocols: [],\n defaultProtocol: 'http',\n HTMLAttributes: {\n target: '_blank',\n rel: 'noopener noreferrer nofollow',\n class: null,\n },\n isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),\n validate: url => !!url,\n shouldAutoLink: url => !!url,\n }\n },\n\n addAttributes() {\n return {\n href: {\n default: null,\n parseHTML(element) {\n return element.getAttribute('href')\n },\n },\n target: {\n default: this.options.HTMLAttributes.target,\n },\n rel: {\n default: this.options.HTMLAttributes.rel,\n },\n class: {\n default: this.options.HTMLAttributes.class,\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'a[href]',\n getAttrs: dom => {\n const href = (dom as HTMLElement).getAttribute('href')\n\n // prevent XSS attacks\n if (\n !href\n || !this.options.isAllowedUri(href, {\n defaultValidate: url => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol,\n })\n ) {\n return false\n }\n return null\n },\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n // prevent XSS attacks\n if (\n !this.options.isAllowedUri(HTMLAttributes.href, {\n defaultValidate: href => !!isAllowedUri(href, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol,\n })\n ) {\n // strip out the href\n return [\n 'a',\n mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: '' }),\n 0,\n ]\n }\n\n return ['a', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setLink:\n attributes => ({ chain }) => {\n const { href } = attributes\n\n if (!this.options.isAllowedUri(href, {\n defaultValidate: url => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol,\n })) {\n return false\n }\n\n return chain().setMark(this.name, attributes).setMeta('preventAutolink', true).run()\n },\n\n toggleLink:\n attributes => ({ chain }) => {\n const { href } = attributes\n\n if (!this.options.isAllowedUri(href, {\n defaultValidate: url => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol,\n })) {\n return false\n }\n\n return chain()\n .toggleMark(this.name, attributes, { extendEmptyMarkRange: true })\n .setMeta('preventAutolink', true)\n .run()\n },\n\n unsetLink:\n () => ({ chain }) => {\n return chain()\n .unsetMark(this.name, { extendEmptyMarkRange: true })\n .setMeta('preventAutolink', true)\n .run()\n },\n }\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: text => {\n const foundLinks: PasteRuleMatch[] = []\n\n if (text) {\n const { protocols, defaultProtocol } = this.options\n const links = find(text).filter(\n item => item.isLink\n && this.options.isAllowedUri(item.value, {\n defaultValidate: href => !!isAllowedUri(href, protocols),\n protocols,\n defaultProtocol,\n }),\n )\n\n if (links.length) {\n links.forEach(link => foundLinks.push({\n text: link.value,\n data: {\n href: link.href,\n },\n index: link.start,\n }))\n }\n }\n\n return foundLinks\n },\n type: this.type,\n getAttributes: match => {\n return {\n href: match.data?.href,\n }\n },\n }),\n ]\n },\n\n addProseMirrorPlugins() {\n const plugins: Plugin[] = []\n const { protocols, defaultProtocol } = this.options\n\n if (this.options.autolink) {\n plugins.push(\n autolink({\n type: this.type,\n defaultProtocol: this.options.defaultProtocol,\n validate: url => this.options.isAllowedUri(url, {\n defaultValidate: href => !!isAllowedUri(href, protocols),\n protocols,\n defaultProtocol,\n }),\n shouldAutoLink: this.options.shouldAutoLink,\n }),\n )\n }\n\n if (this.options.openOnClick === true) {\n plugins.push(\n clickHandler({\n type: this.type,\n }),\n )\n }\n\n if (this.options.linkOnPaste) {\n plugins.push(\n pasteHandler({\n editor: this.editor,\n defaultProtocol: this.options.defaultProtocol,\n type: this.type,\n }),\n )\n }\n\n return plugins\n },\n})\n","import {\n combineTransactionSteps,\n findChildrenInRange,\n getChangedRanges,\n getMarksBetween,\n NodeWithPos,\n} from '@tiptap/core'\nimport { MarkType } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { MultiToken, tokenize } from 'linkifyjs'\n\n/**\n * Check if the provided tokens form a valid link structure, which can either be a single link token\n * or a link token surrounded by parentheses or square brackets.\n *\n * This ensures that only complete and valid text is hyperlinked, preventing cases where a valid\n * top-level domain (TLD) is immediately followed by an invalid character, like a number. For\n * example, with the `find` method from Linkify, entering `example.com1` would result in\n * `example.com` being linked and the trailing `1` left as plain text. By using the `tokenize`\n * method, we can perform more comprehensive validation on the input text.\n */\nfunction isValidLinkStructure(tokens: Array>) {\n if (tokens.length === 1) {\n return tokens[0].isLink\n }\n\n if (tokens.length === 3 && tokens[1].isLink) {\n return ['()', '[]'].includes(tokens[0].value + tokens[2].value)\n }\n\n return false\n}\n\ntype AutolinkOptions = {\n type: MarkType\n defaultProtocol: string\n validate: (url: string) => boolean\n shouldAutoLink: (url: string) => boolean\n}\n\n/**\n * This plugin allows you to automatically add links to your editor.\n * @param options The plugin options\n * @returns The plugin instance\n */\nexport function autolink(options: AutolinkOptions): Plugin {\n return new Plugin({\n key: new PluginKey('autolink'),\n appendTransaction: (transactions, oldState, newState) => {\n /**\n * Does the transaction change the document?\n */\n const docChanges = transactions.some(transaction => transaction.docChanged) && !oldState.doc.eq(newState.doc)\n\n /**\n * Prevent autolink if the transaction is not a document change or if the transaction has the meta `preventAutolink`.\n */\n const preventAutolink = transactions.some(transaction => transaction.getMeta('preventAutolink'))\n\n /**\n * Prevent autolink if the transaction is not a document change\n * or if the transaction has the meta `preventAutolink`.\n */\n if (!docChanges || preventAutolink) {\n return\n }\n\n const { tr } = newState\n const transform = combineTransactionSteps(oldState.doc, [...transactions])\n const changes = getChangedRanges(transform)\n\n changes.forEach(({ newRange }) => {\n // Now let’s see if we can add new links.\n const nodesInChangedRanges = findChildrenInRange(\n newState.doc,\n newRange,\n node => node.isTextblock,\n )\n\n let textBlock: NodeWithPos | undefined\n let textBeforeWhitespace: string | undefined\n\n if (nodesInChangedRanges.length > 1) {\n // Grab the first node within the changed ranges (ex. the first of two paragraphs when hitting enter).\n textBlock = nodesInChangedRanges[0]\n textBeforeWhitespace = newState.doc.textBetween(\n textBlock.pos,\n textBlock.pos + textBlock.node.nodeSize,\n undefined,\n ' ',\n )\n } else if (\n nodesInChangedRanges.length\n // We want to make sure to include the block seperator argument to treat hard breaks like spaces.\n && newState.doc.textBetween(newRange.from, newRange.to, ' ', ' ').endsWith(' ')\n ) {\n textBlock = nodesInChangedRanges[0]\n textBeforeWhitespace = newState.doc.textBetween(\n textBlock.pos,\n newRange.to,\n undefined,\n ' ',\n )\n }\n\n if (textBlock && textBeforeWhitespace) {\n const wordsBeforeWhitespace = textBeforeWhitespace.split(' ').filter(s => s !== '')\n\n if (wordsBeforeWhitespace.length <= 0) {\n return false\n }\n\n const lastWordBeforeSpace = wordsBeforeWhitespace[wordsBeforeWhitespace.length - 1]\n const lastWordAndBlockOffset = textBlock.pos + textBeforeWhitespace.lastIndexOf(lastWordBeforeSpace)\n\n if (!lastWordBeforeSpace) {\n return false\n }\n\n const linksBeforeSpace = tokenize(lastWordBeforeSpace).map(t => t.toObject(options.defaultProtocol))\n\n if (!isValidLinkStructure(linksBeforeSpace)) {\n return false\n }\n\n linksBeforeSpace\n .filter(link => link.isLink)\n // Calculate link position.\n .map(link => ({\n ...link,\n from: lastWordAndBlockOffset + link.start + 1,\n to: lastWordAndBlockOffset + link.end + 1,\n }))\n // ignore link inside code mark\n .filter(link => {\n if (!newState.schema.marks.code) {\n return true\n }\n\n return !newState.doc.rangeHasMark(\n link.from,\n link.to,\n newState.schema.marks.code,\n )\n })\n // validate link\n .filter(link => options.validate(link.value))\n // check whether should autolink\n .filter(link => options.shouldAutoLink(link.value))\n // Add link mark.\n .forEach(link => {\n if (getMarksBetween(link.from, link.to, newState.doc).some(item => item.mark.type === options.type)) {\n return\n }\n\n tr.addMark(\n link.from,\n link.to,\n options.type.create({\n href: link.href,\n }),\n )\n })\n }\n })\n\n if (!tr.steps.length) {\n return\n }\n\n return tr\n },\n })\n}\n","import { getAttributes } from '@tiptap/core'\nimport { MarkType } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\n\ntype ClickHandlerOptions = {\n type: MarkType;\n}\n\nexport function clickHandler(options: ClickHandlerOptions): Plugin {\n return new Plugin({\n key: new PluginKey('handleClickLink'),\n props: {\n handleClick: (view, pos, event) => {\n if (event.button !== 0) {\n return false\n }\n\n if (!view.editable) {\n return false\n }\n\n let a = event.target as HTMLElement\n const els = []\n\n while (a.nodeName !== 'DIV') {\n els.push(a)\n a = a.parentNode as HTMLElement\n }\n\n if (!els.find(value => value.nodeName === 'A')) {\n return false\n }\n\n const attrs = getAttributes(view.state, options.type.name)\n const link = (event.target as HTMLAnchorElement)\n\n const href = link?.href ?? attrs.href\n const target = link?.target ?? attrs.target\n\n if (link && href) {\n window.open(href, target)\n\n return true\n }\n\n return false\n },\n },\n })\n}\n","import { Editor } from '@tiptap/core'\nimport { MarkType } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { find } from 'linkifyjs'\n\ntype PasteHandlerOptions = {\n editor: Editor\n defaultProtocol: string\n type: MarkType\n}\n\nexport function pasteHandler(options: PasteHandlerOptions): Plugin {\n return new Plugin({\n key: new PluginKey('handlePasteLink'),\n props: {\n handlePaste: (view, event, slice) => {\n const { state } = view\n const { selection } = state\n const { empty } = selection\n\n if (empty) {\n return false\n }\n\n let textContent = ''\n\n slice.content.forEach(node => {\n textContent += node.textContent\n })\n\n const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find(item => item.isLink && item.value === textContent)\n\n if (!textContent || !link) {\n return false\n }\n\n return options.editor.commands.setMark(options.type, {\n href: link.href,\n })\n },\n },\n })\n}\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ListItemOptions {\n /**\n * The HTML attributes for a list item node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n\n /**\n * The node type for bulletList nodes\n * @default 'bulletList'\n * @example 'myCustomBulletList'\n */\n bulletListTypeName: string\n\n /**\n * The node type for orderedList nodes\n * @default 'orderedList'\n * @example 'myCustomOrderedList'\n */\n orderedListTypeName: string\n}\n\n/**\n * This extension allows you to create list items.\n * @see https://www.tiptap.dev/api/nodes/list-item\n */\nexport const ListItem = Node.create({\n name: 'listItem',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n bulletListTypeName: 'bulletList',\n orderedListTypeName: 'orderedList',\n }\n },\n\n content: 'paragraph block*',\n\n defining: true,\n\n parseHTML() {\n return [\n {\n tag: 'li',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['li', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addKeyboardShortcuts() {\n return {\n Enter: () => this.editor.commands.splitListItem(this.name),\n Tab: () => this.editor.commands.sinkListItem(this.name),\n 'Shift-Tab': () => this.editor.commands.liftListItem(this.name),\n }\n },\n})\n","import { mergeAttributes, Node } from '@tiptap/core'\nimport { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { PluginKey } from '@tiptap/pm/state'\nimport Suggestion, { SuggestionOptions } from '@tiptap/suggestion'\n\n// See `addAttributes` below\nexport interface MentionNodeAttrs {\n /**\n * The identifier for the selected item that was mentioned, stored as a `data-id`\n * attribute.\n */\n id: string | null;\n /**\n * The label to be rendered by the editor as the displayed text for this mentioned\n * item, if provided. Stored as a `data-label` attribute. See `renderLabel`.\n */\n label?: string | null;\n}\n\nexport type MentionOptions = MentionNodeAttrs> = {\n /**\n * The HTML attributes for a mention node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record\n\n /**\n * A function to render the label of a mention.\n * @deprecated use renderText and renderHTML instead\n * @param props The render props\n * @returns The label\n * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`\n */\n renderLabel?: (props: { options: MentionOptions; node: ProseMirrorNode }) => string\n\n /**\n * A function to render the text of a mention.\n * @param props The render props\n * @returns The text\n * @example ({ options, node }) => `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`\n */\n renderText: (props: { options: MentionOptions; node: ProseMirrorNode }) => string\n\n /**\n * A function to render the HTML of a mention.\n * @param props The render props\n * @returns The HTML as a ProseMirror DOM Output Spec\n * @example ({ options, node }) => ['span', { 'data-type': 'mention' }, `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`]\n */\n renderHTML: (props: { options: MentionOptions; node: ProseMirrorNode }) => DOMOutputSpec\n\n /**\n * Whether to delete the trigger character with backspace.\n * @default false\n */\n deleteTriggerWithBackspace: boolean\n\n /**\n * The suggestion options.\n * @default {}\n * @example { char: '@', pluginKey: MentionPluginKey, command: ({ editor, range, props }) => { ... } }\n */\n suggestion: Omit, 'editor'>\n}\n\n/**\n * The plugin key for the mention plugin.\n * @default 'mention'\n */\nexport const MentionPluginKey = new PluginKey('mention')\n\n/**\n * This extension allows you to insert mentions into the editor.\n * @see https://www.tiptap.dev/api/extensions/mention\n */\nexport const Mention = Node.create({\n name: 'mention',\n\n priority: 101,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n renderText({ options, node }) {\n return `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`\n },\n deleteTriggerWithBackspace: false,\n renderHTML({ options, node }) {\n return [\n 'span',\n mergeAttributes(this.HTMLAttributes, options.HTMLAttributes),\n `${options.suggestion.char}${node.attrs.label ?? node.attrs.id}`,\n ]\n },\n suggestion: {\n char: '@',\n pluginKey: MentionPluginKey,\n command: ({ editor, range, props }) => {\n // increase range.to by one when the next node is of type \"text\"\n // and starts with a space character\n const nodeAfter = editor.view.state.selection.$to.nodeAfter\n const overrideSpace = nodeAfter?.text?.startsWith(' ')\n\n if (overrideSpace) {\n range.to += 1\n }\n\n editor\n .chain()\n .focus()\n .insertContentAt(range, [\n {\n type: this.name,\n attrs: props,\n },\n {\n type: 'text',\n text: ' ',\n },\n ])\n .run()\n\n // get reference to `window` object from editor element, to support cross-frame JS usage\n editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()\n },\n allow: ({ state, range }) => {\n const $from = state.doc.resolve(range.from)\n const type = state.schema.nodes[this.name]\n const allow = !!$from.parent.type.contentMatch.matchType(type)\n\n return allow\n },\n },\n }\n },\n\n group: 'inline',\n\n inline: true,\n\n selectable: false,\n\n atom: true,\n\n addAttributes() {\n return {\n id: {\n default: null,\n parseHTML: element => element.getAttribute('data-id'),\n renderHTML: attributes => {\n if (!attributes.id) {\n return {}\n }\n\n return {\n 'data-id': attributes.id,\n }\n },\n },\n\n label: {\n default: null,\n parseHTML: element => element.getAttribute('data-label'),\n renderHTML: attributes => {\n if (!attributes.label) {\n return {}\n }\n\n return {\n 'data-label': attributes.label,\n }\n },\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: `span[data-type=\"${this.name}\"]`,\n },\n ]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n if (this.options.renderLabel !== undefined) {\n console.warn('renderLabel is deprecated use renderText and renderHTML instead')\n return [\n 'span',\n mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes),\n this.options.renderLabel({\n options: this.options,\n node,\n }),\n ]\n }\n const mergedOptions = { ...this.options }\n\n mergedOptions.HTMLAttributes = mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes)\n const html = this.options.renderHTML({\n options: mergedOptions,\n node,\n })\n\n if (typeof html === 'string') {\n return [\n 'span',\n mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes),\n html,\n ]\n }\n return html\n },\n\n renderText({ node }) {\n if (this.options.renderLabel !== undefined) {\n console.warn('renderLabel is deprecated use renderText and renderHTML instead')\n return this.options.renderLabel({\n options: this.options,\n node,\n })\n }\n return this.options.renderText({\n options: this.options,\n node,\n })\n },\n\n addKeyboardShortcuts() {\n return {\n Backspace: () => this.editor.commands.command(({ tr, state }) => {\n let isMention = false\n const { selection } = state\n const { empty, anchor } = selection\n\n if (!empty) {\n return false\n }\n\n state.doc.nodesBetween(anchor - 1, anchor, (node, pos) => {\n if (node.type.name === this.name) {\n isMention = true\n tr.insertText(\n this.options.deleteTriggerWithBackspace ? '' : this.options.suggestion.char || '',\n pos,\n pos + node.nodeSize,\n )\n\n return false\n }\n })\n\n return isMention\n }),\n }\n },\n\n addProseMirrorPlugins() {\n return [\n Suggestion({\n editor: this.editor,\n ...this.options.suggestion,\n }),\n ]\n },\n})\n","import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'\n\nconst ListItemName = 'listItem'\nconst TextStyleName = 'textStyle'\n\nexport interface OrderedListOptions {\n /**\n * The node type name for list items.\n * @default 'listItem'\n * @example 'myListItem'\n */\n itemTypeName: string,\n\n /**\n * The HTML attributes for an ordered list node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n\n /**\n * Keep the marks when splitting a list item.\n * @default false\n * @example true\n */\n keepMarks: boolean,\n\n /**\n * Keep the attributes when splitting a list item.\n * @default false\n * @example true\n */\n keepAttributes: boolean,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n orderedList: {\n /**\n * Toggle an ordered list\n * @example editor.commands.toggleOrderedList()\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches an ordered list to a 1. on input (or any number followed by a dot).\n */\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\n/**\n * This extension allows you to create ordered lists.\n * This requires the ListItem extension\n * @see https://www.tiptap.dev/api/nodes/ordered-list\n * @see https://www.tiptap.dev/api/nodes/list-item\n */\nexport const OrderedList = Node.create({\n name: 'orderedList',\n\n addOptions() {\n return {\n itemTypeName: 'listItem',\n HTMLAttributes: {},\n keepMarks: false,\n keepAttributes: false,\n }\n },\n\n group: 'block list',\n\n content() {\n return `${this.options.itemTypeName}+`\n },\n\n addAttributes() {\n return {\n start: {\n default: 1,\n parseHTML: element => {\n return element.hasAttribute('start')\n ? parseInt(element.getAttribute('start') || '', 10)\n : 1\n },\n },\n type: {\n default: undefined,\n parseHTML: element => element.getAttribute('type'),\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'ol',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n const { start, ...attributesWithoutStart } = HTMLAttributes\n\n return start === 1\n ? ['ol', mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0]\n : ['ol', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n toggleOrderedList: () => ({ commands, chain }) => {\n if (this.options.keepAttributes) {\n return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run()\n }\n return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),\n }\n },\n\n addInputRules() {\n let inputRule = wrappingInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => ({ start: +match[1] }),\n joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],\n })\n\n if (this.options.keepMarks || this.options.keepAttributes) {\n inputRule = wrappingInputRule({\n find: inputRegex,\n type: this.type,\n keepMarks: this.options.keepMarks,\n keepAttributes: this.options.keepAttributes,\n getAttributes: match => ({ start: +match[1], ...this.editor.getAttributes(TextStyleName) }),\n joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],\n editor: this.editor,\n })\n }\n return [\n inputRule,\n ]\n },\n})\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ParagraphOptions {\n /**\n * The HTML attributes for a paragraph node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n paragraph: {\n /**\n * Toggle a paragraph\n * @example editor.commands.toggleParagraph()\n */\n setParagraph: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to create paragraphs.\n * @see https://www.tiptap.dev/api/nodes/paragraph\n */\nexport const Paragraph = Node.create({\n name: 'paragraph',\n\n priority: 1000,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block',\n\n content: 'inline*',\n\n parseHTML() {\n return [\n { tag: 'p' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['p', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setParagraph: () => ({ commands }) => {\n return commands.setNode(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Alt-0': () => this.editor.commands.setParagraph(),\n }\n },\n})\n","import { Editor, Extension, isNodeEmpty } from '@tiptap/core'\nimport { Node as ProsemirrorNode } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport { Decoration, DecorationSet } from '@tiptap/pm/view'\n\nexport interface PlaceholderOptions {\n /**\n * **The class name for the empty editor**\n * @default 'is-editor-empty'\n */\n emptyEditorClass: string\n\n /**\n * **The class name for empty nodes**\n * @default 'is-empty'\n */\n emptyNodeClass: string\n\n /**\n * **The placeholder content**\n *\n * You can use a function to return a dynamic placeholder or a string.\n * @default 'Write something …'\n */\n placeholder:\n | ((PlaceholderProps: {\n editor: Editor\n node: ProsemirrorNode\n pos: number\n hasAnchor: boolean\n }) => string)\n | string\n\n /**\n * See https://github.com/ueberdosis/tiptap/pull/5278 for more information.\n * @deprecated This option is no longer respected and this type will be removed in the next major version.\n */\n considerAnyAsEmpty?: boolean\n\n /**\n * **Checks if the placeholder should be only shown when the editor is editable.**\n *\n * If true, the placeholder will only be shown when the editor is editable.\n * If false, the placeholder will always be shown.\n * @default true\n */\n showOnlyWhenEditable: boolean\n\n /**\n * **Checks if the placeholder should be only shown when the current node is empty.**\n *\n * If true, the placeholder will only be shown when the current node is empty.\n * If false, the placeholder will be shown when any node is empty.\n * @default true\n */\n showOnlyCurrent: boolean\n\n /**\n * **Controls if the placeholder should be shown for all descendents.**\n *\n * If true, the placeholder will be shown for all descendents.\n * If false, the placeholder will only be shown for the current node.\n * @default false\n */\n includeChildren: boolean\n}\n\n/**\n * This extension allows you to add a placeholder to your editor.\n * A placeholder is a text that appears when the editor or a node is empty.\n * @see https://www.tiptap.dev/api/extensions/placeholder\n */\nexport const Placeholder = Extension.create({\n name: 'placeholder',\n\n addOptions() {\n return {\n emptyEditorClass: 'is-editor-empty',\n emptyNodeClass: 'is-empty',\n placeholder: 'Write something …',\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n includeChildren: false,\n }\n },\n\n addProseMirrorPlugins() {\n return [\n new Plugin({\n key: new PluginKey('placeholder'),\n props: {\n decorations: ({ doc, selection }) => {\n const active = this.editor.isEditable || !this.options.showOnlyWhenEditable\n const { anchor } = selection\n const decorations: Decoration[] = []\n\n if (!active) {\n return null\n }\n\n const isEmptyDoc = this.editor.isEmpty\n\n doc.descendants((node, pos) => {\n const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize\n const isEmpty = !node.isLeaf && isNodeEmpty(node)\n\n if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {\n const classes = [this.options.emptyNodeClass]\n\n if (isEmptyDoc) {\n classes.push(this.options.emptyEditorClass)\n }\n\n const decoration = Decoration.node(pos, pos + node.nodeSize, {\n class: classes.join(' '),\n 'data-placeholder':\n typeof this.options.placeholder === 'function'\n ? this.options.placeholder({\n editor: this.editor,\n node,\n pos,\n hasAnchor,\n })\n : this.options.placeholder,\n })\n\n decorations.push(decoration)\n }\n\n return this.options.includeChildren\n })\n\n return DecorationSet.create(doc, decorations)\n },\n },\n }),\n ]\n },\n})\n","import {\n Mark,\n markInputRule,\n markPasteRule,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface StrikeOptions {\n /**\n * HTML attributes to add to the strike element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n strike: {\n /**\n * Set a strike mark\n * @example editor.commands.setStrike()\n */\n setStrike: () => ReturnType,\n /**\n * Toggle a strike mark\n * @example editor.commands.toggleStrike()\n */\n toggleStrike: () => ReturnType,\n /**\n * Unset a strike mark\n * @example editor.commands.unsetStrike()\n */\n unsetStrike: () => ReturnType,\n }\n }\n}\n\n/**\n * Matches a strike to a ~~strike~~ on input.\n */\nexport const inputRegex = /(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/\n\n/**\n * Matches a strike to a ~~strike~~ on paste.\n */\nexport const pasteRegex = /(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g\n\n/**\n * This extension allows you to create strike text.\n * @see https://www.tiptap.dev/api/marks/strike\n */\nexport const Strike = Mark.create({\n name: 'strike',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 's',\n },\n {\n tag: 'del',\n },\n {\n tag: 'strike',\n },\n {\n style: 'text-decoration',\n consuming: false,\n getAttrs: style => ((style as string).includes('line-through') ? {} : false),\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['s', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setStrike: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleStrike: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetStrike: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-s': () => this.editor.commands.toggleStrike(),\n }\n },\n\n addInputRules() {\n return [\n markInputRule({\n find: inputRegex,\n type: this.type,\n }),\n ]\n },\n\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n","import {\n KeyboardShortcutCommand, mergeAttributes, Node, wrappingInputRule,\n} from '@tiptap/core'\nimport { Node as ProseMirrorNode } from '@tiptap/pm/model'\n\nexport interface TaskItemOptions {\n /**\n * A callback function that is called when the checkbox is clicked while the editor is in readonly mode.\n * @param node The prosemirror node of the task item\n * @param checked The new checked state\n * @returns boolean\n */\n onReadOnlyChecked?: (node: ProseMirrorNode, checked: boolean) => boolean\n\n /**\n * Controls whether the task items can be nested or not.\n * @default false\n * @example true\n */\n nested: boolean\n\n /**\n * HTML attributes to add to the task item element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record\n\n /**\n * The node type for taskList nodes\n * @default 'taskList'\n * @example 'myCustomTaskList'\n */\n taskListTypeName: string\n}\n\n/**\n * Matches a task item to a - [ ] on input.\n */\nexport const inputRegex = /^\\s*(\\[([( |x])?\\])\\s$/\n\n/**\n * This extension allows you to create task items.\n * @see https://www.tiptap.dev/api/nodes/task-item\n */\nexport const TaskItem = Node.create({\n name: 'taskItem',\n\n addOptions() {\n return {\n nested: false,\n HTMLAttributes: {},\n taskListTypeName: 'taskList',\n }\n },\n\n content() {\n return this.options.nested ? 'paragraph block*' : 'paragraph+'\n },\n\n defining: true,\n\n addAttributes() {\n return {\n checked: {\n default: false,\n keepOnSplit: false,\n parseHTML: element => {\n const dataChecked = element.getAttribute('data-checked')\n\n return dataChecked === '' || dataChecked === 'true'\n },\n renderHTML: attributes => ({\n 'data-checked': attributes.checked,\n }),\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: `li[data-type=\"${this.name}\"]`,\n priority: 51,\n },\n ]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n return [\n 'li',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n 'data-type': this.name,\n }),\n [\n 'label',\n [\n 'input',\n {\n type: 'checkbox',\n checked: node.attrs.checked ? 'checked' : null,\n },\n ],\n ['span'],\n ],\n ['div', 0],\n ]\n },\n\n addKeyboardShortcuts() {\n const shortcuts: {\n [key: string]: KeyboardShortcutCommand\n } = {\n Enter: () => this.editor.commands.splitListItem(this.name),\n 'Shift-Tab': () => this.editor.commands.liftListItem(this.name),\n }\n\n if (!this.options.nested) {\n return shortcuts\n }\n\n return {\n ...shortcuts,\n Tab: () => this.editor.commands.sinkListItem(this.name),\n }\n },\n\n addNodeView() {\n return ({\n node, HTMLAttributes, getPos, editor,\n }) => {\n const listItem = document.createElement('li')\n const checkboxWrapper = document.createElement('label')\n const checkboxStyler = document.createElement('span')\n const checkbox = document.createElement('input')\n const content = document.createElement('div')\n\n checkboxWrapper.contentEditable = 'false'\n checkbox.type = 'checkbox'\n checkbox.addEventListener('mousedown', event => event.preventDefault())\n checkbox.addEventListener('change', event => {\n // if the editor isn’t editable and we don't have a handler for\n // readonly checks we have to undo the latest change\n if (!editor.isEditable && !this.options.onReadOnlyChecked) {\n checkbox.checked = !checkbox.checked\n\n return\n }\n\n const { checked } = event.target as any\n\n if (editor.isEditable && typeof getPos === 'function') {\n editor\n .chain()\n .focus(undefined, { scrollIntoView: false })\n .command(({ tr }) => {\n const position = getPos()\n\n if (typeof position !== 'number') {\n return false\n }\n const currentNode = tr.doc.nodeAt(position)\n\n tr.setNodeMarkup(position, undefined, {\n ...currentNode?.attrs,\n checked,\n })\n\n return true\n })\n .run()\n }\n if (!editor.isEditable && this.options.onReadOnlyChecked) {\n // Reset state if onReadOnlyChecked returns false\n if (!this.options.onReadOnlyChecked(node, checked)) {\n checkbox.checked = !checkbox.checked\n }\n }\n })\n\n Object.entries(this.options.HTMLAttributes).forEach(([key, value]) => {\n listItem.setAttribute(key, value)\n })\n\n listItem.dataset.checked = node.attrs.checked\n checkbox.checked = node.attrs.checked\n\n checkboxWrapper.append(checkbox, checkboxStyler)\n listItem.append(checkboxWrapper, content)\n\n Object.entries(HTMLAttributes).forEach(([key, value]) => {\n listItem.setAttribute(key, value)\n })\n\n return {\n dom: listItem,\n contentDOM: content,\n update: updatedNode => {\n if (updatedNode.type !== this.type) {\n return false\n }\n\n listItem.dataset.checked = updatedNode.attrs.checked\n checkbox.checked = updatedNode.attrs.checked\n\n return true\n },\n }\n }\n },\n\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => ({\n checked: match[match.length - 1] === 'x',\n }),\n }),\n ]\n },\n})\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n /**\n * The node type name for a task item.\n * @default 'taskItem'\n * @example 'myCustomTaskItem'\n */\n itemTypeName: string,\n\n /**\n * The HTML attributes for a task list node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n taskList: {\n /**\n * Toggle a task list\n * @example editor.commands.toggleTaskList()\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to create task lists.\n * @see https://www.tiptap.dev/api/nodes/task-list\n */\nexport const TaskList = Node.create({\n name: 'taskList',\n\n addOptions() {\n return {\n itemTypeName: 'taskItem',\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content() {\n return `${this.options.itemTypeName}+`\n },\n\n parseHTML() {\n return [\n {\n tag: `ul[data-type=\"${this.name}\"]`,\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList(this.name, this.options.itemTypeName)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n","import { Extension } from '@tiptap/core'\n\nexport interface TextAlignOptions {\n /**\n * The types where the text align attribute can be applied.\n * @default []\n * @example ['heading', 'paragraph']\n */\n types: string[],\n\n /**\n * The alignments which are allowed.\n * @default ['left', 'center', 'right', 'justify']\n * @example ['left', 'right']\n */\n alignments: string[],\n\n /**\n * The default alignment.\n * @default null\n * @example 'center'\n */\n defaultAlignment: string | null,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n textAlign: {\n /**\n * Set the text align attribute\n * @param alignment The alignment\n * @example editor.commands.setTextAlign('left')\n */\n setTextAlign: (alignment: string) => ReturnType,\n /**\n * Unset the text align attribute\n * @example editor.commands.unsetTextAlign()\n */\n unsetTextAlign: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to align text.\n * @see https://www.tiptap.dev/api/extensions/text-align\n */\nexport const TextAlign = Extension.create({\n name: 'textAlign',\n\n addOptions() {\n return {\n types: [],\n alignments: ['left', 'center', 'right', 'justify'],\n defaultAlignment: null,\n }\n },\n\n addGlobalAttributes() {\n return [\n {\n types: this.options.types,\n attributes: {\n textAlign: {\n default: this.options.defaultAlignment,\n parseHTML: element => {\n const alignment = element.style.textAlign\n\n return this.options.alignments.includes(alignment) ? alignment : this.options.defaultAlignment\n },\n renderHTML: attributes => {\n if (!attributes.textAlign) {\n return {}\n }\n\n return { style: `text-align: ${attributes.textAlign}` }\n },\n },\n },\n },\n ]\n },\n\n addCommands() {\n return {\n setTextAlign: (alignment: string) => ({ commands }) => {\n if (!this.options.alignments.includes(alignment)) {\n return false\n }\n\n return this.options.types\n .map(type => commands.updateAttributes(type, { textAlign: alignment }))\n .every(response => response)\n },\n\n unsetTextAlign: () => ({ commands }) => {\n return this.options.types\n .map(type => commands.resetAttributes(type, 'textAlign'))\n .every(response => response)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-l': () => this.editor.commands.setTextAlign('left'),\n 'Mod-Shift-e': () => this.editor.commands.setTextAlign('center'),\n 'Mod-Shift-r': () => this.editor.commands.setTextAlign('right'),\n 'Mod-Shift-j': () => this.editor.commands.setTextAlign('justify'),\n }\n },\n})\n","import {\n Mark,\n mergeAttributes,\n} from '@tiptap/core'\n\nexport interface TextStyleOptions {\n /**\n * HTML attributes to add to the span element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n /**\n * When enabled, merges the styles of nested spans into the child span during HTML parsing.\n * This prioritizes the style of the child span.\n * Used when parsing content created in other editors.\n * (Fix for ProseMirror's default behavior.)\n * @default false\n */\n mergeNestedSpanStyles: boolean,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n textStyle: {\n /**\n * Remove spans without inline style attributes.\n * @example editor.commands.removeEmptyTextStyle()\n */\n removeEmptyTextStyle: () => ReturnType,\n }\n }\n}\n\nconst mergeNestedSpanStyles = (element: HTMLElement) => {\n if (!element.children.length) { return }\n const childSpans = element.querySelectorAll('span')\n\n if (!childSpans) { return }\n\n childSpans.forEach(childSpan => {\n const childStyle = childSpan.getAttribute('style')\n const closestParentSpanStyleOfChild = childSpan.parentElement?.closest('span')?.getAttribute('style')\n\n childSpan.setAttribute('style', `${closestParentSpanStyleOfChild};${childStyle}`)\n\n })\n}\n\n/**\n * This extension allows you to create text styles. It is required by default\n * for the `textColor` and `backgroundColor` extensions.\n * @see https://www.tiptap.dev/api/marks/text-style\n */\nexport const TextStyle = Mark.create({\n name: 'textStyle',\n\n priority: 101,\n\n addOptions() {\n return {\n HTMLAttributes: {},\n mergeNestedSpanStyles: false,\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'span',\n getAttrs: element => {\n const hasStyles = (element as HTMLElement).hasAttribute('style')\n\n if (!hasStyles) {\n return false\n }\n if (this.options.mergeNestedSpanStyles) { mergeNestedSpanStyles(element) }\n\n return {}\n },\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['span', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n removeEmptyTextStyle: () => ({ tr }) => {\n\n const { selection } = tr\n\n // Gather all of the nodes within the selection range.\n // We would need to go through each node individually\n // to check if it has any inline style attributes.\n // Otherwise, calling commands.unsetMark(this.name)\n // removes everything from all the nodes\n // within the selection range.\n tr.doc.nodesBetween(selection.from, selection.to, (node, pos) => {\n\n // Check if it's a paragraph element, if so, skip this node as we apply\n // the text style to inline text nodes only (span).\n if (node.isTextblock) {\n return true\n }\n\n // Check if the node has no inline style attributes.\n // Filter out non-`textStyle` marks.\n if (\n !node.marks.filter(mark => mark.type === this.type).some(mark => Object.values(mark.attrs).some(value => !!value))) {\n // Proceed with the removal of the `textStyle` mark for this node only\n tr.removeMark(pos, pos + node.nodeSize, this.type)\n }\n })\n\n return true\n },\n }\n },\n\n})\n","import { Node } from '@tiptap/core'\n\n/**\n * This extension allows you to create text nodes.\n * @see https://www.tiptap.dev/api/nodes/text\n */\nexport const Text = Node.create({\n name: 'text',\n group: 'inline',\n})\n","import { Mark, mergeAttributes } from '@tiptap/core'\n\nexport interface UnderlineOptions {\n /**\n * HTML attributes to add to the underline element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n underline: {\n /**\n * Set an underline mark\n * @example editor.commands.setUnderline()\n */\n setUnderline: () => ReturnType,\n /**\n * Toggle an underline mark\n * @example editor.commands.toggleUnderline()\n */\n toggleUnderline: () => ReturnType,\n /**\n * Unset an underline mark\n * @example editor.commands.unsetUnderline()\n */\n unsetUnderline: () => ReturnType,\n }\n }\n}\n\n/**\n * This extension allows you to create underline text.\n * @see https://www.tiptap.dev/api/marks/underline\n */\nexport const Underline = Mark.create({\n name: 'underline',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'u',\n },\n {\n style: 'text-decoration',\n consuming: false,\n getAttrs: style => ((style as string).includes('underline') ? {} : false),\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['u', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n setUnderline: () => ({ commands }) => {\n return commands.setMark(this.name)\n },\n toggleUnderline: () => ({ commands }) => {\n return commands.toggleMark(this.name)\n },\n unsetUnderline: () => ({ commands }) => {\n return commands.unsetMark(this.name)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-u': () => this.editor.commands.toggleUnderline(),\n 'Mod-U': () => this.editor.commands.toggleUnderline(),\n }\n },\n})\n"],"names":["inputRegex","Blockquote","Node","create","name","addOptions","HTMLAttributes","content","group","defining","parseHTML","tag","renderHTML","_ref","mergeAttributes","this","options","addCommands","setBlockquote","_ref2","commands","wrapIn","toggleBlockquote","_ref3","toggleWrap","unsetBlockquote","_ref4","lift","addKeyboardShortcuts","Mod-Shift-b","editor","addInputRules","wrappingInputRule","find","type","starInputRegex","starPasteRegex","underscoreInputRegex","underscorePasteRegex","Bold","Mark","getAttrs","node","style","fontWeight","clearMark","mark","value","test","setBold","setMark","toggleBold","toggleMark","unsetBold","unsetMark","Mod-b","Mod-B","markInputRule","addPasteRules","markPasteRule","BubbleMenuView","constructor","element","view","tippyOptions","updateDelay","shouldShow","preventHide","state","from","to","doc","selection","empty","isEmptyTextBlock","textBetween","length","isTextSelection","isChildOfMenu","contains","document","activeElement","hasFocus","isEditable","mousedownHandler","dragstartHandler","hide","focusHandler","setTimeout","update","blurHandler","event","relatedTarget","_a","parentNode","dom","tippyBlurHandler","handleDebouncedUpdate","oldState","selectionChanged","eq","docChanged","updateDebounceTimer","clearTimeout","window","updateHandler","composing","createTooltip","ranges","Math","min","map","range","$from","pos","max","$to","call","_b","tippy","setProps","getReferenceClientRect","_c","isNodeSelection","nodeDOM","nodeViewWrapper","dataset","querySelector","firstChild","getBoundingClientRect","posToDOMRect","show","addEventListener","capture","on","remove","visibility","editorElement","editorIsAttached","parentElement","_objectSpread","duration","interactive","trigger","placement","hideOnClick","popper","hasValidSelection","destroy","removeEventListener","off","Extension","pluginKey","undefined","addProseMirrorPlugins","Plugin","key","PluginKey","TextStyleName","BulletList","itemTypeName","keepMarks","keepAttributes","concat","toggleBulletList","chain","toggleList","updateAttributes","getAttributes","run","Mod-Shift-8","inputRule","backtickInputRegex","tildeInputRegex","CodeBlock","languageClassPrefix","exitOnTripleEnter","exitOnArrowDown","defaultLanguage","marks","code","addAttributes","language","default","firstElementChild","classList","filter","className","startsWith","replace","rendered","preserveWhitespace","class","attrs","setCodeBlock","attributes","setNode","toggleCodeBlock","toggleNode","Mod-Alt-c","Backspace","$anchor","isAtStart","parent","textContent","clearNodes","Enter","isAtEnd","parentOffset","nodeSize","endsWithDoubleNewline","endsWith","command","_ref5","tr","delete","exitCode","ArrowDown","_ref6","after","nodeAt","_ref7","setSelection","Selection","near","resolve","textblockTypeInputRule","match","props","handlePaste","clipboardData","isActive","text","getData","vscode","vscodeData","JSON","parse","mode","schema","textNode","replaceSelectionWith","TextSelection","setMeta","dispatch","pasteRegex","Code","excludes","exitable","setCode","toggleCode","unsetCode","Mod-e","Color","types","addGlobalAttributes","color","setColor","unsetColor","removeEmptyTextStyle","Document","topNode","Dropcursor","width","dropCursor","FloatingMenuView","getTextContent","getText","textSerializers","getTextSerializersFromSchema","isRootDepth","depth","isTextblock","spec","childCount","FontFamily","fontFamily","setFontFamily","unsetFontFamily","Gapcursor","gapCursor","extendNodeSchema","extension","context","storage","allowGapCursor","callOrReturn","getExtensionField","HardBreak","inline","selectable","linebreakReplacement","renderText","setHardBreak","first","storedMarks","isolating","splittableMarks","extensionManager","insertContent","filteredMarks","includes","ensureMarks","Mod-Enter","Shift-Enter","Heading","levels","level","setHeading","toggleHeading","reduce","items","RegExp","Highlight","multicolor","getAttribute","backgroundColor","setHighlight","toggleHighlight","unsetHighlight","Mod-Shift-h","History","newGroupDelay","undo","redo","history","Mod-z","Shift-Mod-z","Mod-y","Mod-я","Shift-Mod-я","HorizontalRule","setHorizontalRule","$originFrom","$originTo","currentChain","insertContentAt","posAfter","end","nodeAfter","isBlock","NodeSelection","contentMatch","defaultType","insert","scrollIntoView","nodeInputRule","Italic","fontStyle","setItalic","toggleItalic","unsetItalic","Mod-i","Mod-I","ATTR_WHITESPACE","isAllowedUri","uri","protocols","allowedProtocols","forEach","protocol","nextProtocol","scheme","push","join","Link","priority","keepOnSplit","onCreate","validate","shouldAutoLink","registerCustomProtocol","optionalSlashes","onDestroy","reset","inclusive","autolink","openOnClick","linkOnPaste","defaultProtocol","target","rel","url","ctx","href","defaultValidate","setLink","toggleLink","extendEmptyMarkRange","unsetLink","foundLinks","links","item","isLink","link","data","index","start","plugins","appendTransaction","transactions","newState","docChanges","some","transaction","preventAutolink","getMeta","transform","combineTransactionSteps","getChangedRanges","newRange","nodesInChangedRanges","findChildrenInRange","textBlock","textBeforeWhitespace","wordsBeforeWhitespace","split","s","lastWordBeforeSpace","lastWordAndBlockOffset","lastIndexOf","linksBeforeSpace","tokenize","t","toObject","tokens","rangeHasMark","getMarksBetween","addMark","steps","handleClick","button","editable","a","els","nodeName","open","clickHandler","slice","pasteHandler","ListItem","bulletListTypeName","orderedListTypeName","splitListItem","Tab","sinkListItem","Shift-Tab","liftListItem","MentionPluginKey","Mention","suggestion","char","label","id","deleteTriggerWithBackspace","focus","ownerDocument","defaultView","getSelection","collapseToEnd","allow","nodes","matchType","atom","renderLabel","mergedOptions","html","isMention","anchor","nodesBetween","insertText","Suggestion","OrderedList","hasAttribute","parseInt","attributesWithoutStart","_objectWithoutProperties","_excluded","toggleOrderedList","Mod-Shift-7","joinPredicate","Paragraph","setParagraph","Mod-Alt-0","Placeholder","emptyEditorClass","emptyNodeClass","placeholder","showOnlyWhenEditable","showOnlyCurrent","includeChildren","decorations","active","isEmptyDoc","isEmpty","descendants","hasAnchor","isLeaf","isNodeEmpty","classes","decoration","Decoration","DecorationSet","Strike","consuming","setStrike","toggleStrike","unsetStrike","Mod-Shift-s","TaskItem","nested","taskListTypeName","checked","dataChecked","shortcuts","addNodeView","getPos","listItem","createElement","checkboxWrapper","checkboxStyler","checkbox","contentEditable","preventDefault","onReadOnlyChecked","position","currentNode","setNodeMarkup","Object","entries","setAttribute","append","contentDOM","updatedNode","TaskList","toggleTaskList","Mod-Shift-9","TextAlign","alignments","defaultAlignment","textAlign","alignment","setTextAlign","every","response","unsetTextAlign","resetAttributes","Mod-Shift-l","Mod-Shift-e","Mod-Shift-r","Mod-Shift-j","TextStyle","mergeNestedSpanStyles","children","childSpans","querySelectorAll","childSpan","childStyle","closestParentSpanStyleOfChild","closest","values","removeMark","Text","Underline","setUnderline","toggleUnderline","unsetUnderline","Mod-u","Mod-U"],"sourceRoot":""}