@acorex/cdk 22.4.44 → 22.4.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-cdk-text-editor.mjs","sources":["../../../../packages/cdk/text-editor/src/lib/text-editor.types.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.class.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.commands.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.extensions.ts","../../../../packages/cdk/text-editor/src/acorex-cdk-text-editor.ts"],"sourcesContent":["import type { Content, Editor, Extensions, JSONContent } from '@tiptap/core';\n\nexport type AXTextEditorTiptapEditor = Editor;\nexport type AXTextEditorTiptapContent = Content;\nexport type AXTextEditorTiptapJSON = JSONContent;\nexport type AXTextEditorTiptapChain = ReturnType<Editor['chain']>;\n\nexport type AXTextEditorHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type AXTextEditorTextAlign = 'left' | 'center' | 'right' | 'justify';\nexport type AXTextEditorTextDirection = 'rtl' | 'ltr';\nexport type AXTextEditorFontSizeToken = 'small' | 'large' | 'huge';\n\nexport const AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES: Record<AXTextEditorFontSizeToken, string> = {\n small: '0.75em',\n large: '1.5em',\n huge: '2.5em',\n};\n\nexport type AXTextEditorCommandAttrs = Record<string, unknown>;\n\nexport const AX_TEXT_EDITOR_ZOOM_PRESETS = [40, 50, 75, 90, 100, 125, 150, 175, 200] as const;\nexport const AX_TEXT_EDITOR_ZOOM_MIN = 40;\nexport const AX_TEXT_EDITOR_ZOOM_MAX = 200;\n\nexport const AX_TEXT_EDITOR_FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72] as const;\nexport type AXTextEditorFontSize = (typeof AX_TEXT_EDITOR_FONT_SIZES)[number];\n\nexport const AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS = [\n '#f59e0b',\n '#eab308',\n '#22c55e',\n '#06b6d4',\n '#3b82f6',\n '#a855f7',\n '#ec4899',\n '#ef4444',\n];\n\nexport const AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS = [\n '#ffffff',\n '#f5e6c8',\n '#fde68a',\n '#f9a8d4',\n '#bbf7d0',\n '#ddd6fe',\n '#fbcfe8',\n '#fdba74',\n];\n\nexport interface AXTextEditorRecentColor {\n color: string;\n kind: 'text' | 'background';\n}\n\nexport type AXTextEditorCommandType =\n | 'undo'\n | 'redo'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'heading'\n | 'paragraph'\n | 'align'\n | 'direction'\n | 'color'\n | 'highlight'\n | 'fontSize'\n | 'bulletList'\n | 'orderedList'\n | 'superscript'\n | 'subscript'\n | 'link'\n | 'unlink'\n | 'blockquote'\n | 'code'\n | 'codeBlock'\n | 'horizontalRule'\n | 'image'\n | 'video'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'toggleHeaderRow'\n | 'deleteTable';\n\nexport interface AXTextEditorFeatures {\n table?: boolean;\n image?: boolean;\n video?: boolean;\n superscript?: boolean;\n subscript?: boolean;\n keepSelection?: boolean;\n placeholder?: boolean;\n}\n\nexport const AX_DEFAULT_TEXT_EDITOR_FEATURES: AXTextEditorFeatures = {\n table: true,\n image: true,\n video: true,\n superscript: true,\n subscript: true,\n keepSelection: true,\n placeholder: true,\n};\n\nexport interface AXTextEditorLoadExtensionsOptions {\n placeholder?: string | (() => string);\n features?: AXTextEditorFeatures;\n headingLevels?: AXTextEditorHeadingLevel[];\n extensions?: Extensions;\n}\n\nexport interface AXTextEditorState {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n code: boolean;\n codeBlock: boolean;\n headingLevel: AXTextEditorHeadingLevel | null;\n bulletList: boolean;\n orderedList: boolean;\n blockquote: boolean;\n superscript: boolean;\n subscript: boolean;\n textAlign: AXTextEditorTextAlign | null;\n textColor: string | null;\n highlightColor: string | null;\n linkHref: string | null;\n fontSize: string | null;\n textDirection: AXTextEditorTextDirection | null;\n table: boolean;\n canUndo: boolean;\n canRedo: boolean;\n isEmpty: boolean;\n isFocused: boolean;\n}\n\nexport const AX_EMPTY_TEXT_EDITOR_STATE: AXTextEditorState = {\n bold: false,\n italic: false,\n underline: false,\n strike: false,\n code: false,\n codeBlock: false,\n headingLevel: null,\n bulletList: false,\n orderedList: false,\n blockquote: false,\n superscript: false,\n subscript: false,\n textAlign: null,\n textColor: null,\n highlightColor: null,\n linkHref: null,\n fontSize: null,\n textDirection: null,\n table: false,\n canUndo: false,\n canRedo: false,\n isEmpty: true,\n isFocused: false,\n};\n\nexport interface AXTextEditorInitOptions {\n content?: AXTextEditorTiptapContent;\n editable?: boolean;\n placeholder?: string | (() => string);\n features?: AXTextEditorFeatures;\n headingLevels?: AXTextEditorHeadingLevel[];\n extensions?: Extensions;\n editorProps?: import('@tiptap/core').EditorOptions['editorProps'];\n /** @deprecated Use `editable: false` instead. */\n readOnly?: boolean;\n onUpdate?: (editor: AXTextEditorTiptapEditor) => void;\n onFocus?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;\n onBlur?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;\n onSelectionUpdate?: (editor: AXTextEditorTiptapEditor) => void;\n onTransaction?: (editor: AXTextEditorTiptapEditor) => void;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n toggleSuperscript: () => ReturnType;\n };\n subscript: {\n toggleSubscript: () => ReturnType;\n };\n axTextEditorFontSize: {\n setFontSize: (size: string | null) => ReturnType;\n };\n axTextEditorVideo: {\n setVideo: (options: { src: string }) => ReturnType;\n };\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID, signal } from '@angular/core';\nimport {\n AX_EMPTY_TEXT_EDITOR_STATE,\n type AXTextEditorCommandAttrs,\n type AXTextEditorCommandType,\n type AXTextEditorHeadingLevel,\n type AXTextEditorInitOptions,\n type AXTextEditorState,\n type AXTextEditorTextAlign,\n type AXTextEditorTextDirection,\n type AXTextEditorTiptapChain,\n type AXTextEditorTiptapContent,\n type AXTextEditorTiptapEditor,\n type AXTextEditorTiptapJSON,\n} from './text-editor.types';\n\n@Injectable()\nexport class AXTextEditor {\n readonly editor = signal<AXTextEditorTiptapEditor | null>(null);\n readonly state = signal<AXTextEditorState>(AX_EMPTY_TEXT_EDITOR_STATE);\n readonly ready = signal(false);\n readonly version = signal(0);\n\n private readonly platformId = inject(PLATFORM_ID);\n private destroyed = false;\n private applyingContent = false;\n\n async init(container: HTMLElement | string, options: AXTextEditorInitOptions = {}): Promise<void> {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const element =\n typeof container === 'string' ? (document.querySelector(container) as HTMLElement | null) : container;\n if (!element) {\n return;\n }\n\n this.destroyed = false;\n const editable = options.readOnly === true ? false : (options.editable ?? true);\n\n const [{ createTextEditorExtensions }, commandsApi, { Editor }] = await Promise.all([\n import('./text-editor.extensions'),\n import('./text-editor.commands'),\n import('@tiptap/core'),\n ]);\n this.commandsApi = commandsApi;\n\n const extensions = await createTextEditorExtensions({\n placeholder: options.placeholder,\n features: options.features,\n headingLevels: options.headingLevels,\n extensions: options.extensions,\n });\n\n if (this.destroyed) {\n return;\n }\n\n const editor = new Editor({\n element,\n extensions,\n content: options.content ?? '',\n editable,\n editorProps: {\n ...options.editorProps,\n attributes: {\n class: 'ax-text-editor-prose',\n ...(typeof options.editorProps?.attributes === 'object' ? options.editorProps.attributes : {}),\n },\n handleDOMEvents: {\n ...options.editorProps?.handleDOMEvents,\n },\n },\n onUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n if (!this.applyingContent) {\n options.onUpdate?.(ed);\n }\n },\n onSelectionUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onSelectionUpdate?.(ed);\n },\n onTransaction: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onTransaction?.(ed);\n },\n onFocus: ({ editor: ed, event }) => {\n this.refreshState(ed);\n options.onFocus?.(ed, event);\n },\n onBlur: ({ editor: ed, event }) => {\n this.refreshState(ed);\n options.onBlur?.(ed, event);\n },\n });\n\n this.editor.set(editor);\n this.ready.set(true);\n this.refreshState(editor);\n }\n\n destroy(): void {\n this.destroyed = true;\n const ed = this.editor();\n ed?.destroy();\n this.editor.set(null);\n this.ready.set(false);\n this.state.set(AX_EMPTY_TEXT_EDITOR_STATE);\n this.version.set(0);\n this.commandsApi = null;\n }\n\n refresh(): void {\n const ed = this.editor();\n if (ed) {\n this.refreshState(ed);\n }\n }\n\n setContent(value: AXTextEditorTiptapContent | null | undefined, emit = false): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n\n const content = value == null || value === '' ? '' : value;\n this.applyingContent = true;\n try {\n ed.commands.setContent(content, { emitUpdate: emit });\n this.refreshState(ed);\n } finally {\n this.applyingContent = false;\n }\n }\n\n getHTML(): string {\n return this.editor()?.getHTML() ?? '';\n }\n\n getJSON(): AXTextEditorTiptapJSON | null {\n return this.editor()?.getJSON() ?? null;\n }\n\n getText(options?: { blockSeparator?: string }): string {\n return this.editor()?.getText(options) ?? '';\n }\n\n isEmpty(): boolean {\n return this.editor()?.isEmpty ?? true;\n }\n\n isFocused(): boolean {\n return this.editor()?.isFocused ?? false;\n }\n\n isEditable(): boolean {\n return this.editor()?.isEditable ?? false;\n }\n\n setEditable(editable: boolean): void {\n const ed = this.editor();\n if (!ed || ed.isEditable === editable) {\n return;\n }\n ed.setEditable(editable, false);\n this.refreshState(ed);\n }\n\n focus(): void {\n this.editor()?.commands.focus();\n }\n\n blur(): void {\n this.editor()?.commands.blur();\n }\n\n chain(): AXTextEditorTiptapChain | null {\n return this.editor()?.chain() ?? null;\n }\n\n get commands(): AXTextEditorTiptapEditor['commands'] | undefined {\n return this.editor()?.commands;\n }\n\n isActive(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n this.version();\n const ed = this.editor();\n if (!ed) {\n return false;\n }\n return this.getCommandsApi().isTextEditorCommandActive(ed, command, attrs);\n }\n\n can(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n this.version();\n const ed = this.editor();\n if (!ed || !ed.isEditable) {\n return false;\n }\n return this.getCommandsApi().canRunTextEditorCommand(ed, command, attrs);\n }\n\n run(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n const ed = this.editor();\n if (!ed || !ed.isEditable) {\n return false;\n }\n const result = this.getCommandsApi().runTextEditorCommand(ed, command, attrs);\n this.refreshState(ed);\n return result;\n }\n\n private commandsApi: typeof import('./text-editor.commands') | null = null;\n\n private getCommandsApi(): typeof import('./text-editor.commands') {\n if (!this.commandsApi) {\n throw new Error('AXTextEditor commands are not loaded. Call init() first.');\n }\n return this.commandsApi;\n }\n\n insertContent(value: AXTextEditorTiptapContent): boolean {\n const result = this.editor()?.chain().focus().insertContent(value).run() ?? false;\n this.refresh();\n return result;\n }\n\n clearContent(): boolean {\n const result = this.editor()?.commands.clearContent() ?? false;\n this.refresh();\n return result;\n }\n\n insertImage(src: string, alt?: string): void {\n this.run('image', { src, alt });\n }\n\n insertVideo(src: string): void {\n this.run('video', { src });\n }\n\n setLink(href: string): void {\n this.run('link', { href });\n }\n\n unsetLink(): void {\n this.run('unlink');\n }\n\n clearFormatting(): void {\n this.editor()?.chain().focus().clearNodes().unsetAllMarks().run();\n this.refresh();\n }\n\n toggleHeading(level: AXTextEditorHeadingLevel): void {\n this.run('heading', { level });\n }\n\n setTextAlign(align: AXTextEditorTextAlign): void {\n this.run('align', { align });\n }\n\n setTextDirection(direction: AXTextEditorTextDirection): void {\n this.run('direction', { direction });\n }\n\n private refreshState(editor: AXTextEditorTiptapEditor): void {\n this.version.update((value) => value + 1);\n\n const textColor = editor.getAttributes('textStyle')['color'] as string | undefined;\n const fontSizeCss = editor.getAttributes('textStyle')['fontSize'] as string | undefined;\n const highlightColor = editor.getAttributes('highlight')['color'] as string | undefined;\n const linkHref = editor.getAttributes('link')['href'] as string | undefined;\n const dir = (editor.getAttributes('paragraph')['dir'] || editor.getAttributes('heading')['dir']) as\n | AXTextEditorTextDirection\n | undefined;\n\n let headingLevel: AXTextEditorHeadingLevel | null = null;\n for (let level = 1; level <= 6; level++) {\n if (editor.isActive('heading', { level })) {\n headingLevel = level as AXTextEditorHeadingLevel;\n break;\n }\n }\n\n let textAlign: AXTextEditorTextAlign | null = null;\n for (const align of ['left', 'center', 'right', 'justify'] as AXTextEditorTextAlign[]) {\n if (editor.isActive({ textAlign: align })) {\n textAlign = align;\n break;\n }\n }\n\n this.state.set({\n bold: editor.isActive('bold'),\n italic: editor.isActive('italic'),\n underline: editor.isActive('underline'),\n strike: editor.isActive('strike'),\n code: editor.isActive('code'),\n codeBlock: editor.isActive('codeBlock'),\n headingLevel,\n bulletList: editor.isActive('bulletList'),\n orderedList: editor.isActive('orderedList'),\n blockquote: editor.isActive('blockquote'),\n superscript: editor.isActive('superscript'),\n subscript: editor.isActive('subscript'),\n textAlign,\n textColor: textColor ?? null,\n highlightColor: highlightColor ?? null,\n linkHref: linkHref ?? null,\n fontSize: fontSizeCss ?? null,\n textDirection: dir ?? null,\n table: editor.isActive('table'),\n canUndo: editor.can().undo(),\n canRedo: editor.can().redo(),\n isEmpty: editor.isEmpty,\n isFocused: editor.isFocused,\n });\n }\n}\n","import {\n AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES,\n type AXTextEditorCommandAttrs,\n type AXTextEditorCommandType,\n type AXTextEditorFontSizeToken,\n type AXTextEditorHeadingLevel,\n type AXTextEditorTiptapEditor,\n} from './text-editor.types';\n\nfunction escapeHtml(value: string): string {\n return value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('\"', '&quot;');\n}\n\nfunction normalizeHref(value: string): string {\n const href = value.trim();\n if (!href) return '';\n if (/^(https?:|mailto:|tel:|#|\\/)/i.test(href)) return href;\n return `https://${href}`;\n}\n\nfunction headingLevel(attrs?: AXTextEditorCommandAttrs): AXTextEditorHeadingLevel | undefined {\n const level = Number(attrs?.['level']);\n if (level >= 1 && level <= 6) {\n return level as AXTextEditorHeadingLevel;\n }\n return undefined;\n}\n\nfunction resolveFontSize(attrs?: AXTextEditorCommandAttrs): string | null {\n const raw = attrs?.['size'];\n if (raw == null || raw === '') {\n return null;\n }\n const size = String(raw);\n if (size === 'small' || size === 'large' || size === 'huge') {\n return AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES[size as AXTextEditorFontSizeToken];\n }\n return size;\n}\n\nexport function isTextEditorCommandActive(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n switch (command) {\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? editor.isActive('heading', { level }) : editor.isActive('heading');\n }\n case 'paragraph':\n return editor.isActive('paragraph');\n case 'align':\n return editor.isActive({ textAlign: attrs?.['align'] });\n case 'direction':\n return editor.isActive({ dir: attrs?.['direction'] });\n case 'link':\n return editor.isActive('link');\n case 'image':\n return editor.isActive('image');\n case 'video':\n return editor.isActive('video');\n case 'fontSize':\n return Boolean(editor.getAttributes('textStyle')?.['fontSize']);\n case 'insertTable':\n return editor.isActive('table');\n case 'unlink':\n case 'color':\n case 'highlight':\n case 'undo':\n case 'redo':\n case 'horizontalRule':\n return false;\n default:\n return editor.isActive(command);\n }\n}\n\nexport function canRunTextEditorCommand(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n switch (command) {\n case 'undo':\n return editor.can().undo();\n case 'redo':\n return editor.can().redo();\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? editor.can().setHeading({ level }) : editor.can().setParagraph();\n }\n case 'paragraph':\n return editor.can().setParagraph();\n case 'align':\n return editor.can().setTextAlign(String(attrs?.['align'] ?? 'left'));\n case 'direction':\n return true;\n case 'color':\n return attrs?.['color'] ? editor.can().setColor(String(attrs['color'])) : editor.can().unsetColor();\n case 'highlight':\n return attrs?.['color']\n ? editor.can().setHighlight({ color: String(attrs['color']) })\n : editor.can().unsetHighlight();\n case 'fontSize':\n return editor.isEditable;\n case 'link':\n return editor.isEditable;\n case 'unlink':\n return editor.isEditable && editor.can().unsetLink();\n case 'image':\n case 'video':\n return editor.isEditable;\n case 'insertTable':\n return editor.can().insertTable({\n rows: Number(attrs?.['rows'] ?? 3),\n cols: Number(attrs?.['cols'] ?? 3),\n withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),\n });\n case 'addColumnBefore':\n return editor.can().addColumnBefore();\n case 'addColumnAfter':\n return editor.can().addColumnAfter();\n case 'deleteColumn':\n return editor.can().deleteColumn();\n case 'addRowBefore':\n return editor.can().addRowBefore();\n case 'addRowAfter':\n return editor.can().addRowAfter();\n case 'deleteRow':\n return editor.can().deleteRow();\n case 'toggleHeaderRow':\n return editor.can().toggleHeaderRow();\n case 'deleteTable':\n return editor.can().deleteTable();\n case 'blockquote':\n return editor.can().toggleBlockquote();\n case 'code':\n return editor.can().toggleCode();\n case 'codeBlock':\n return editor.can().toggleCodeBlock();\n case 'horizontalRule':\n return editor.can().setHorizontalRule();\n case 'bulletList':\n return editor.isEditable && Boolean(editor.schema.nodes['bulletList']);\n case 'orderedList':\n return editor.isEditable && Boolean(editor.schema.nodes['orderedList']);\n case 'superscript':\n return editor.can().toggleSuperscript();\n case 'subscript':\n return editor.can().toggleSubscript();\n case 'bold':\n return editor.can().toggleBold();\n case 'italic':\n return editor.can().toggleItalic();\n case 'underline':\n return editor.can().toggleUnderline();\n case 'strike':\n return editor.can().toggleStrike();\n default:\n return false;\n }\n}\n\nexport function runTextEditorCommand(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n const chain = editor.chain().focus();\n switch (command) {\n case 'undo':\n return chain.undo().run();\n case 'redo':\n return chain.redo().run();\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? chain.setHeading({ level }).run() : chain.setParagraph().run();\n }\n case 'paragraph':\n return chain.setParagraph().run();\n case 'align':\n return chain.setTextAlign(String(attrs?.['align'] ?? 'left')).run();\n case 'direction': {\n const direction = attrs?.['direction'] === 'rtl' ? 'rtl' : 'ltr';\n return chain\n .updateAttributes('paragraph', { dir: direction })\n .updateAttributes('heading', { dir: direction })\n .run();\n }\n case 'color':\n return attrs?.['color'] ? chain.setColor(String(attrs['color'])).run() : chain.unsetColor().run();\n case 'highlight':\n return attrs?.['color']\n ? chain.setHighlight({ color: String(attrs['color']) }).run()\n : chain.unsetHighlight().run();\n case 'fontSize':\n return chain.setFontSize(resolveFontSize(attrs)).run();\n case 'link': {\n const href = normalizeHref(String(attrs?.['href'] ?? ''));\n if (!href) {\n return chain.extendMarkRange('link').unsetLink().run();\n }\n if (editor.state.selection.empty) {\n const safeHref = escapeHtml(href);\n return chain.insertContent(`<a href=\"${safeHref}\">${safeHref}</a>`).run();\n }\n return chain.extendMarkRange('link').setLink({ href }).run();\n }\n case 'unlink':\n return chain.extendMarkRange('link').unsetLink().run();\n case 'image': {\n const src = String(attrs?.['src'] ?? '').trim();\n if (!src) return false;\n return chain.setImage({ src, alt: String(attrs?.['alt'] ?? '') }).run();\n }\n case 'video': {\n const src = String(attrs?.['src'] ?? '').trim();\n if (!src) return false;\n return chain.setVideo({ src }).run();\n }\n case 'insertTable':\n return chain\n .insertTable({\n rows: Number(attrs?.['rows'] ?? 3),\n cols: Number(attrs?.['cols'] ?? 3),\n withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),\n })\n .run();\n case 'addColumnBefore':\n return chain.addColumnBefore().run();\n case 'addColumnAfter':\n return chain.addColumnAfter().run();\n case 'deleteColumn':\n return chain.deleteColumn().run();\n case 'addRowBefore':\n return chain.addRowBefore().run();\n case 'addRowAfter':\n return chain.addRowAfter().run();\n case 'deleteRow':\n return chain.deleteRow().run();\n case 'toggleHeaderRow':\n return chain.toggleHeaderRow().run();\n case 'deleteTable':\n return chain.deleteTable().run();\n case 'blockquote':\n return chain.toggleBlockquote().run();\n case 'code':\n return chain.toggleCode().run();\n case 'codeBlock':\n return chain.toggleCodeBlock().run();\n case 'horizontalRule':\n return chain.setHorizontalRule().run();\n case 'bulletList':\n return chain.toggleBulletList().run();\n case 'orderedList':\n return chain.toggleOrderedList().run();\n case 'superscript':\n return chain.toggleSuperscript().run();\n case 'subscript':\n return chain.toggleSubscript().run();\n case 'bold':\n return chain.toggleBold().run();\n case 'italic':\n return chain.toggleItalic().run();\n case 'underline':\n return chain.toggleUnderline().run();\n case 'strike':\n return chain.toggleStrike().run();\n default:\n return false;\n }\n}\n","import {\n AX_DEFAULT_TEXT_EDITOR_FEATURES,\n type AXTextEditorFeatures,\n type AXTextEditorHeadingLevel,\n type AXTextEditorLoadExtensionsOptions,\n} from './text-editor.types';\n\ntype AXTextEditorCore = typeof import('@tiptap/core');\n\nfunction createSuperscript(core: AXTextEditorCore) {\n return core.Mark.create({\n name: 'superscript',\n excludes: 'subscript',\n parseHTML() {\n return [{ tag: 'sup' }];\n },\n renderHTML({ HTMLAttributes }) {\n return ['sup', core.mergeAttributes(HTMLAttributes), 0];\n },\n addCommands() {\n return {\n toggleSuperscript:\n () =>\n ({ commands }) =>\n commands.toggleMark(this.name),\n };\n },\n });\n}\n\nfunction createSubscript(core: AXTextEditorCore) {\n return core.Mark.create({\n name: 'subscript',\n excludes: 'superscript',\n parseHTML() {\n return [{ tag: 'sub' }];\n },\n renderHTML({ HTMLAttributes }) {\n return ['sub', core.mergeAttributes(HTMLAttributes), 0];\n },\n addCommands() {\n return {\n toggleSubscript:\n () =>\n ({ commands }) =>\n commands.toggleMark(this.name),\n };\n },\n });\n}\n\nfunction createKeepSelection(\n core: AXTextEditorCore,\n pmState: typeof import('@tiptap/pm/state'),\n pmView: typeof import('@tiptap/pm/view'),\n) {\n const keepSelectionKey = new pmState.PluginKey('axKeepSelection');\n return core.Extension.create({\n name: 'keepSelection',\n addProseMirrorPlugins() {\n return [\n new pmState.Plugin({\n key: keepSelectionKey,\n state: {\n init() {\n return pmView.DecorationSet.empty;\n },\n apply(tr, set) {\n const meta = tr.getMeta(keepSelectionKey) as { from: number; to: number } | 'clear' | undefined;\n if (meta === 'clear') return pmView.DecorationSet.empty;\n if (meta && meta.from !== meta.to) {\n return pmView.DecorationSet.create(tr.doc, [\n pmView.Decoration.inline(meta.from, meta.to, { class: 'ax-text-editor-kept-selection' }),\n ]);\n }\n return set.map(tr.mapping, tr.doc);\n },\n },\n props: {\n decorations(state) {\n return keepSelectionKey.getState(state);\n },\n handleDOMEvents: {\n blur(view) {\n const { from, to } = view.state.selection;\n if (from !== to) {\n view.dispatch(view.state.tr.setMeta(keepSelectionKey, { from, to }));\n }\n return false;\n },\n focus(view) {\n const decorations = keepSelectionKey.getState(view.state) as\n | import('@tiptap/pm/view').DecorationSet\n | undefined;\n if (decorations?.find().length) {\n view.dispatch(view.state.tr.setMeta(keepSelectionKey, 'clear'));\n }\n return false;\n },\n },\n },\n }),\n ];\n },\n });\n}\n\nfunction createTextDirection(core: AXTextEditorCore) {\n return core.Extension.create({\n name: 'textDirection',\n addGlobalAttributes() {\n return [\n {\n types: ['paragraph', 'heading'],\n attributes: {\n dir: {\n default: null,\n parseHTML: (element) => element.getAttribute('dir'),\n renderHTML: (attributes) => (attributes['dir'] ? { dir: attributes['dir'] } : {}),\n },\n },\n },\n ];\n },\n });\n}\n\nfunction createFontSize(core: AXTextEditorCore) {\n return core.Extension.create({\n name: 'axTextEditorFontSize',\n addGlobalAttributes() {\n return [\n {\n types: ['textStyle'],\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) => element.style.fontSize?.replace(/['\"]+/g, '') || null,\n renderHTML: (attributes) =>\n attributes['fontSize'] ? { style: `font-size: ${attributes['fontSize']}` } : {},\n },\n },\n },\n ];\n },\n addCommands() {\n return {\n setFontSize:\n (size: string | null) =>\n ({ chain }) => {\n if (!size) {\n return chain().focus().setMark('textStyle', { fontSize: null }).removeEmptyTextStyle().run();\n }\n return chain().focus().setMark('textStyle', { fontSize: size }).run();\n },\n };\n },\n });\n}\n\nfunction createVideo(core: AXTextEditorCore) {\n return core.Node.create({\n name: 'video',\n group: 'block',\n atom: true,\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n addAttributes() {\n return {\n src: {\n default: null,\n },\n };\n },\n parseHTML() {\n return [\n { tag: 'video[src]' },\n { tag: 'div[data-text-editor-video] video' },\n { tag: 'div[data-wysiwyg-video] iframe' },\n { tag: 'iframe[src]' },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n const src = String(HTMLAttributes['src'] ?? '');\n if (isEmbedSrc(src)) {\n return [\n 'div',\n core.mergeAttributes(this.options.HTMLAttributes, { 'data-text-editor-video': '' }),\n [\n 'iframe',\n core.mergeAttributes({\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n }),\n ],\n ];\n }\n return [\n 'video',\n core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n class: 'ax-text-editor-video',\n controls: 'true',\n }),\n ];\n },\n addCommands() {\n return {\n setVideo:\n ({ src }) =>\n ({ commands }) =>\n commands.insertContent({\n type: this.name,\n attrs: { src: toVideoSrc(src) },\n }),\n };\n },\n });\n}\n\nfunction isEmbedSrc(src: string): boolean {\n return /youtube\\.com\\/embed\\/|youtu\\.be\\//i.test(src);\n}\n\nfunction toVideoSrc(src: string): string {\n const trimmed = src.trim();\n if (!trimmed) return trimmed;\n try {\n const url = new URL(trimmed);\n if (url.hostname.includes('youtube.com') && url.searchParams.get('v')) {\n return `https://www.youtube.com/embed/${url.searchParams.get('v')}`;\n }\n if (url.hostname === 'youtu.be') {\n return `https://www.youtube.com/embed/${url.pathname.slice(1)}`;\n }\n } catch {\n return trimmed;\n }\n return trimmed;\n}\n\nconst DEFAULT_HEADING_LEVELS: AXTextEditorHeadingLevel[] = [1, 2, 3];\n\nfunction resolvePlaceholder(placeholder?: string | (() => string)): string {\n if (typeof placeholder === 'function') {\n return placeholder();\n }\n return placeholder ?? '';\n}\n\nexport async function createTextEditorExtensions(\n placeholderOrOptions: string | (() => string) | AXTextEditorLoadExtensionsOptions = '',\n): Promise<import('@tiptap/core').AnyExtension[]> {\n const options: AXTextEditorLoadExtensionsOptions =\n typeof placeholderOrOptions === 'function' || typeof placeholderOrOptions === 'string'\n ? { placeholder: placeholderOrOptions }\n : placeholderOrOptions;\n\n const features: AXTextEditorFeatures = { ...AX_DEFAULT_TEXT_EDITOR_FEATURES, ...options.features };\n const headingLevels = options.headingLevels ?? DEFAULT_HEADING_LEVELS;\n\n const [core, pmState, pmView, starterKitMod, textStyleMod, highlightMod, textAlignMod, extensionsMod, tableMod, imageMod] =\n await Promise.all([\n import('@tiptap/core'),\n import('@tiptap/pm/state'),\n import('@tiptap/pm/view'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extensions'),\n import('@tiptap/extension-table/kit'),\n import('@tiptap/extension-image'),\n ]);\n\n const Image = imageMod.default ?? imageMod.Image;\n const Highlight = highlightMod.default ?? highlightMod.Highlight;\n\n const extensions: import('@tiptap/core').AnyExtension[] = [\n starterKitMod.StarterKit.configure({\n heading: {\n levels: headingLevels,\n HTMLAttributes: {\n class: 'ax-text-editor-heading',\n },\n },\n link: {\n openOnClick: false,\n HTMLAttributes: {\n class: 'ax-text-editor-link',\n },\n },\n code: {\n HTMLAttributes: {\n class: 'ax-text-editor-code',\n },\n },\n codeBlock: {\n HTMLAttributes: {\n class: 'ax-text-editor-code-block',\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: 'ax-text-editor-bullet-list',\n },\n },\n orderedList: {\n HTMLAttributes: {\n class: 'ax-text-editor-ordered-list',\n },\n },\n listItem: {\n HTMLAttributes: {\n class: 'ax-text-editor-list-item',\n },\n },\n }),\n textStyleMod.TextStyle,\n textStyleMod.Color,\n createFontSize(core),\n Highlight.configure({ multicolor: true }),\n textAlignMod.TextAlign.configure({\n types: ['heading', 'paragraph'],\n }),\n createTextDirection(core),\n ];\n\n if (features.superscript) {\n extensions.push(createSuperscript(core));\n }\n if (features.subscript) {\n extensions.push(createSubscript(core));\n }\n if (features.keepSelection) {\n extensions.push(createKeepSelection(core, pmState, pmView));\n }\n if (features.table) {\n extensions.push(\n tableMod.TableKit.configure({\n table: {\n resizable: true,\n lastColumnResizable: true,\n cellMinWidth: 64,\n HTMLAttributes: {\n class: 'ax-text-editor-table',\n },\n },\n }),\n );\n }\n if (features.image) {\n extensions.push(\n Image.configure({\n inline: true,\n allowBase64: true,\n HTMLAttributes: {\n class: 'ax-text-editor-image',\n },\n }),\n );\n }\n if (features.video) {\n extensions.push(createVideo(core));\n }\n if (features.placeholder) {\n extensions.push(\n extensionsMod.Placeholder.configure({\n placeholder: () => resolvePlaceholder(options.placeholder),\n showOnlyCurrent: true,\n }),\n );\n }\n\n if (options.extensions?.length) {\n extensions.push(...options.extensions);\n }\n\n return extensions;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYO,MAAM,qCAAqC,GAA8C;AAC9F,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,IAAI,EAAE,OAAO;;MAKF,2BAA2B,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAC5E,MAAM,uBAAuB,GAAG;AAChC,MAAM,uBAAuB,GAAG;AAEhC,MAAM,yBAAyB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,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WAAW,CAAC,SAAS,CAAC;YAClC,WAAW,EAAE,MAAM,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC;AAC1D,YAAA,eAAe,EAAE,IAAI;AACtB,SAAA,CAAC,CACH;IACH;AAEA,IAAA,IAAI,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE;QAC9B,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IACxC;AAEA,IAAA,OAAO,UAAU;AACnB;;;;;;;AC/XA;;AAEG;;"}
1
+ {"version":3,"file":"acorex-cdk-text-editor.mjs","sources":["../../../../packages/cdk/text-editor/src/lib/text-editor.types.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.mention.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.class.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.commands.ts","../../../../packages/cdk/text-editor/src/lib/text-editor.extensions.ts","../../../../packages/cdk/text-editor/src/acorex-cdk-text-editor.ts"],"sourcesContent":["import type { Content, Editor, Extensions, JSONContent } from '@tiptap/core';\n\nexport type AXTextEditorTiptapEditor = Editor;\nexport type AXTextEditorTiptapContent = Content;\nexport type AXTextEditorTiptapJSON = JSONContent;\nexport type AXTextEditorTiptapChain = ReturnType<Editor['chain']>;\n\nexport type AXTextEditorHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type AXTextEditorTextAlign = 'left' | 'center' | 'right' | 'justify';\nexport type AXTextEditorTextDirection = 'rtl' | 'ltr';\nexport type AXTextEditorFontSizeToken = 'small' | 'large' | 'huge';\n\nexport const AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES: Record<AXTextEditorFontSizeToken, string> = {\n small: '0.75em',\n large: '1.5em',\n huge: '2.5em',\n};\n\nexport type AXTextEditorCommandAttrs = Record<string, unknown>;\n\nexport const AX_TEXT_EDITOR_ZOOM_PRESETS = [40, 50, 75, 90, 100, 125, 150, 175, 200] as const;\nexport const AX_TEXT_EDITOR_ZOOM_MIN = 40;\nexport const AX_TEXT_EDITOR_ZOOM_MAX = 200;\n\nexport const AX_TEXT_EDITOR_FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72] as const;\nexport type AXTextEditorFontSize = (typeof AX_TEXT_EDITOR_FONT_SIZES)[number];\n\nexport const AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS = [\n '#f59e0b',\n '#eab308',\n '#22c55e',\n '#06b6d4',\n '#3b82f6',\n '#a855f7',\n '#ec4899',\n '#ef4444',\n];\n\nexport const AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS = [\n '#ffffff',\n '#f5e6c8',\n '#fde68a',\n '#f9a8d4',\n '#bbf7d0',\n '#ddd6fe',\n '#fbcfe8',\n '#fdba74',\n];\n\nexport interface AXTextEditorRecentColor {\n color: string;\n kind: 'text' | 'background';\n}\n\nexport type AXTextEditorCommandType =\n | 'undo'\n | 'redo'\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'spoiler'\n | 'heading'\n | 'paragraph'\n | 'align'\n | 'direction'\n | 'color'\n | 'highlight'\n | 'fontSize'\n | 'bulletList'\n | 'orderedList'\n | 'superscript'\n | 'subscript'\n | 'link'\n | 'unlink'\n | 'blockquote'\n | 'code'\n | 'codeBlock'\n | 'horizontalRule'\n | 'image'\n | 'video'\n | 'insertTable'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteColumn'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'deleteRow'\n | 'toggleHeaderRow'\n | 'deleteTable';\n\nexport interface AXTextEditorFeatures {\n table?: boolean;\n image?: boolean;\n video?: boolean;\n superscript?: boolean;\n subscript?: boolean;\n keepSelection?: boolean;\n placeholder?: boolean;\n}\n\nexport const AX_DEFAULT_TEXT_EDITOR_FEATURES: AXTextEditorFeatures = {\n table: true,\n image: true,\n video: true,\n superscript: true,\n subscript: true,\n keepSelection: true,\n placeholder: true,\n};\n\n/** A person or record offered by the mention suggestion. */\nexport interface AXTextEditorMentionItem {\n id: string;\n label: string;\n /** HTTP(S), blob, data-image, or root-relative URL. */\n avatar?: string;\n /** Optional icon class used by a custom avatar template. */\n icon?: string;\n}\n\n/** Draws a mention portrait into `host`. Return a function that removes that view. */\nexport type AXTextEditorMentionAvatarRenderer = (\n host: HTMLElement,\n item: AXTextEditorMentionItem,\n) => void | (() => void);\n\nexport interface AXTextEditorMentionRect {\n top: number;\n left: number;\n right: number;\n bottom: number;\n}\n\n/** Active @-query. `null` means the picker is closed. */\nexport interface AXTextEditorMentionSuggestion {\n query: string;\n items: readonly AXTextEditorMentionItem[];\n index: number;\n loading: boolean;\n rect: AXTextEditorMentionRect | null;\n}\n\n/** Runtime source. `items` receives the text typed after the trigger and may resolve later. */\nexport interface AXTextEditorMentionConfig {\n /** Trigger character. Defaults to `@`. */\n char?: string;\n /** Maximum rows shown. Defaults to 8. */\n limit?: number;\n items: (query: string) => readonly AXTextEditorMentionItem[] | Promise<readonly AXTextEditorMentionItem[]>;\n}\n\n/**\n * Value of the `mentions` input.\n * An array is filtered locally by label and id. A function replaces that filter.\n * An options object sets the trigger character and limit.\n */\nexport type AXTextEditorMentionInput =\n | readonly AXTextEditorMentionItem[]\n | AXTextEditorMentionConfig['items']\n | {\n char?: string;\n limit?: number;\n items: readonly AXTextEditorMentionItem[] | AXTextEditorMentionConfig['items'];\n };\n\nexport interface AXTextEditorMentionActions {\n apply(item: AXTextEditorMentionItem): void;\n setIndex(index: number): void;\n refresh(): void;\n dismiss(): void;\n}\n\n/** Bridge between the mention plugin and the editor shell. */\nexport interface AXTextEditorMentionController {\n getSource(): AXTextEditorMentionConfig | null;\n publish(suggestion: AXTextEditorMentionSuggestion | null): void;\n bind(actions: AXTextEditorMentionActions): void;\n renderMentionAvatar?(host: HTMLElement, item: AXTextEditorMentionItem): void | (() => void);\n}\n\nexport interface AXTextEditorLoadExtensionsOptions {\n placeholder?: string | (() => string);\n features?: AXTextEditorFeatures;\n headingLevels?: AXTextEditorHeadingLevel[];\n extensions?: Extensions;\n mentions?: AXTextEditorMentionController;\n}\n\nexport interface AXTextEditorState {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n spoiler: boolean;\n code: boolean;\n codeBlock: boolean;\n headingLevel: AXTextEditorHeadingLevel | null;\n bulletList: boolean;\n orderedList: boolean;\n blockquote: boolean;\n superscript: boolean;\n subscript: boolean;\n textAlign: AXTextEditorTextAlign | null;\n textColor: string | null;\n highlightColor: string | null;\n linkHref: string | null;\n fontSize: string | null;\n textDirection: AXTextEditorTextDirection | null;\n table: boolean;\n canUndo: boolean;\n canRedo: boolean;\n isEmpty: boolean;\n isFocused: boolean;\n}\n\nexport const AX_EMPTY_TEXT_EDITOR_STATE: AXTextEditorState = {\n bold: false,\n italic: false,\n underline: false,\n strike: false,\n spoiler: false,\n code: false,\n codeBlock: false,\n headingLevel: null,\n bulletList: false,\n orderedList: false,\n blockquote: false,\n superscript: false,\n subscript: false,\n textAlign: null,\n textColor: null,\n highlightColor: null,\n linkHref: null,\n fontSize: null,\n textDirection: null,\n table: false,\n canUndo: false,\n canRedo: false,\n isEmpty: true,\n isFocused: false,\n};\n\nexport interface AXTextEditorInitOptions {\n content?: AXTextEditorTiptapContent;\n editable?: boolean;\n placeholder?: string | (() => string);\n features?: AXTextEditorFeatures;\n headingLevels?: AXTextEditorHeadingLevel[];\n extensions?: Extensions;\n /** Enter starts the next block without the inline marks active at the caret. */\n exitMarksOnEnter?: boolean;\n editorProps?: import('@tiptap/core').EditorOptions['editorProps'];\n /** @deprecated Use `editable: false` instead. */\n readOnly?: boolean;\n onUpdate?: (editor: AXTextEditorTiptapEditor) => void;\n onFocus?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;\n onBlur?: (editor: AXTextEditorTiptapEditor, event?: FocusEvent) => void;\n onSelectionUpdate?: (editor: AXTextEditorTiptapEditor) => void;\n onTransaction?: (editor: AXTextEditorTiptapEditor) => void;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n superscript: {\n toggleSuperscript: () => ReturnType;\n };\n subscript: {\n toggleSubscript: () => ReturnType;\n };\n spoiler: {\n toggleSpoiler: () => ReturnType;\n };\n axTextEditorFontSize: {\n setFontSize: (size: string | null) => ReturnType;\n };\n axTextEditorVideo: {\n setVideo: (options: { src: string }) => ReturnType;\n };\n }\n}\n","import type { EditorState } from '@tiptap/pm/state';\nimport type { EditorView } from '@tiptap/pm/view';\nimport type {\n AXTextEditorMentionConfig,\n AXTextEditorMentionController,\n AXTextEditorMentionInput,\n AXTextEditorMentionItem,\n AXTextEditorMentionRect,\n AXTextEditorMentionSuggestion,\n} from './text-editor.types';\n\nconst DEFAULT_MENTION_LIMIT = 8;\n\ntype MentionRuntime = {\n core: typeof import('@tiptap/core');\n pmState: typeof import('@tiptap/pm/state');\n pmView: typeof import('@tiptap/pm/view');\n};\n\ntype MentionPluginState = {\n active: boolean;\n range: { from: number; to: number } | null;\n query: string;\n items: readonly AXTextEditorMentionItem[];\n index: number;\n loading: boolean;\n request: number;\n dismissed: { from: number; query: string } | null;\n decorations: import('@tiptap/pm/view').DecorationSet;\n};\n\ntype MentionMeta =\n | { type: 'items'; request: number; items: readonly AXTextEditorMentionItem[] }\n | { type: 'index'; index: number }\n | { type: 'dismiss' }\n | { type: 'close' }\n | { type: 'refresh' };\n\n/** Text before the caret. `start` is the index of the trigger inside `text`. */\nexport function findTextEditorMentionQuery(\n text: string,\n char = '@',\n): { start: number; query: string } | null {\n const trigger = mentionTrigger(char);\n const escaped = escapeRegExp(trigger);\n const match = new RegExp(\n `(?:^|[\\\\s\\\\u00a0\\\\ufffc])(${escaped}([^\\\\s${escapeCharClass(trigger)}]*))$`,\n 'u',\n ).exec(text);\n if (!match?.[1]) return null;\n return { start: text.length - match[1].length, query: match[2] ?? '' };\n}\n\n/** Local filter used when `mentions` is an array. */\nexport function filterTextEditorMentionItems(\n items: readonly AXTextEditorMentionItem[],\n query: string,\n limit = DEFAULT_MENTION_LIMIT,\n): AXTextEditorMentionItem[] {\n const needle = query.trim().toLocaleLowerCase();\n const matched = needle\n ? items.filter(\n (item) =>\n item.label.toLocaleLowerCase().includes(needle) || item.id.toLocaleLowerCase().includes(needle),\n )\n : [...items];\n return matched.slice(0, Math.max(0, limit));\n}\n\nfunction isMentionOptions(\n source: AXTextEditorMentionInput,\n): source is Exclude<AXTextEditorMentionInput, readonly AXTextEditorMentionItem[] | AXTextEditorMentionConfig['items']> {\n return typeof source === 'object' && source !== null && !Array.isArray(source);\n}\n\n/** Normalizes the `mentions` input into a suggestion source. `null` disables the picker. */\nexport function resolveTextEditorMentions(\n source: AXTextEditorMentionInput | null | undefined,\n): AXTextEditorMentionConfig | null {\n if (source == null) return null;\n if (typeof source === 'function') return { items: source };\n if (Array.isArray(source)) {\n const items = source;\n return { items: (query) => filterTextEditorMentionItems(items, query) };\n }\n if (isMentionOptions(source)) {\n const items = source.items;\n const limit = source.limit ?? DEFAULT_MENTION_LIMIT;\n return {\n char: source.char,\n limit: source.limit,\n items: typeof items === 'function' ? items : (query) => filterTextEditorMentionItems(items, query, limit),\n };\n }\n return null;\n}\n\n/** Keeps only URLs that are safe to put in an `<img src>`. */\nexport function textEditorMentionAvatar(value: string | null | undefined): string | null {\n if (!value) return null;\n const src = value.trim();\n if (!src || /^javascript:/i.test(src)) return null;\n if (/^(https?:|blob:|data:image\\/)|^\\//i.test(src)) return src;\n return null;\n}\n\nexport function mentionSuggestionsEqual(\n left: AXTextEditorMentionSuggestion | null,\n right: AXTextEditorMentionSuggestion | null,\n): boolean {\n if (left === right) return true;\n if (!left || !right) return false;\n if (left.query !== right.query || left.index !== right.index || left.loading !== right.loading) return false;\n if (left.items.length !== right.items.length) return false;\n if (\n left.rect?.top !== right.rect?.top ||\n left.rect?.left !== right.rect?.left ||\n left.rect?.bottom !== right.rect?.bottom\n ) {\n return false;\n }\n return left.items.every(\n (item, index) => item.id === right.items[index]?.id && item.label === right.items[index]?.label,\n );\n}\n\nexport function createTextEditorMentionExtension(\n runtime: MentionRuntime,\n controller: AXTextEditorMentionController,\n): import('@tiptap/core').AnyExtension {\n const { core, pmState, pmView } = runtime;\n const key = new pmState.PluginKey<MentionPluginState>('axTextEditorMention');\n let currentView: EditorView | null = null;\n let alive = false;\n let composing = false;\n let requestSerial = 0;\n\n const emptyDecorations = (state: EditorState) => pmView.DecorationSet.empty;\n\n const inactive = (state: EditorState, dismissed: MentionPluginState['dismissed'] = null): MentionPluginState => ({\n active: false,\n range: null,\n query: '',\n items: [],\n index: 0,\n loading: false,\n request: 0,\n dismissed,\n decorations: emptyDecorations(state),\n });\n\n let plugin!: import('@tiptap/pm/state').Plugin<MentionPluginState>;\n const pendingRequests = new Set<number>();\n\n const finishRequest = (requestId: number, items: readonly AXTextEditorMentionItem[], attempt = 0): void => {\n const view = currentView;\n if (!view || !alive) {\n pendingRequests.delete(requestId);\n return;\n }\n const pluginState = key.getState(view.state);\n if (!pluginState?.active || pluginState.request !== requestId) {\n pendingRequests.delete(requestId);\n return;\n }\n try {\n view.dispatch(view.state.tr.setMeta(key, { type: 'items', request: requestId, items } satisfies MentionMeta));\n pendingRequests.delete(requestId);\n } catch {\n if (attempt < 5) queueMicrotask(() => finishRequest(requestId, items, attempt + 1));\n else pendingRequests.delete(requestId);\n }\n };\n\n const scheduleRequest = (requestId: number, query: string, limit: number): void => {\n if (pendingRequests.has(requestId)) return;\n pendingRequests.add(requestId);\n queueMicrotask(() => {\n const view = currentView;\n if (!view || !alive) {\n pendingRequests.delete(requestId);\n return;\n }\n void Promise.resolve()\n .then(() => controller.getSource()?.items(query) ?? [])\n .then(async (items) => {\n const resolved = await items;\n if (requestId !== requestSerial) {\n pendingRequests.delete(requestId);\n return;\n }\n finishRequest(requestId, (Array.isArray(resolved) ? resolved : []).slice(0, Math.max(0, limit)));\n })\n .catch(() => {\n if (requestId !== requestSerial) {\n pendingRequests.delete(requestId);\n return;\n }\n finishRequest(requestId, []);\n });\n });\n };\n\n const node = core.Node.create({\n name: 'mention',\n group: 'inline',\n inline: true,\n atom: true,\n selectable: false,\n draggable: false,\n addAttributes() {\n return {\n id: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('data-id'),\n renderHTML: (attributes: Record<string, unknown>) =>\n attributes['id'] ? { 'data-id': attributes['id'] } : {},\n },\n label: {\n default: '',\n parseHTML: (element: HTMLElement) =>\n element.getAttribute('data-label') ?? element.textContent?.replace(/^@/u, '') ?? '',\n renderHTML: (attributes: Record<string, unknown>) =>\n attributes['label'] ? { 'data-label': attributes['label'] } : {},\n },\n avatar: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('data-avatar'),\n renderHTML: (attributes: Record<string, unknown>) =>\n attributes['avatar'] ? { 'data-avatar': attributes['avatar'] } : {},\n },\n icon: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('data-icon'),\n renderHTML: (attributes: Record<string, unknown>) =>\n attributes['icon'] ? { 'data-icon': attributes['icon'] } : {},\n },\n };\n },\n parseHTML() {\n return [{ tag: 'span[data-mention]' }];\n },\n renderHTML({ node: mentionNode, HTMLAttributes }) {\n return [\n 'span',\n core.mergeAttributes(HTMLAttributes, {\n 'data-mention': '',\n class: 'ax-text-editor-mention',\n contenteditable: 'false',\n dir: 'auto',\n }),\n `@${String(mentionNode.attrs['label'] ?? '')}`,\n ];\n },\n renderText({ node: mentionNode }) {\n return `@${String(mentionNode.attrs['label'] ?? '')}`;\n },\n addProseMirrorPlugins() {\n return [plugin];\n },\n addNodeView() {\n return ({ node: mentionNode }) => {\n const dom = document.createElement('span');\n let disposeAvatar: (() => void) | undefined;\n const paint = (current: typeof mentionNode) => {\n disposeAvatar?.();\n disposeAvatar = undefined;\n dom.replaceChildren();\n dom.className = 'ax-text-editor-mention';\n dom.setAttribute('data-mention', '');\n dom.setAttribute('data-id', String(current.attrs['id'] ?? ''));\n dom.setAttribute('data-label', String(current.attrs['label'] ?? ''));\n dom.contentEditable = 'false';\n dom.dir = 'auto';\n const item: AXTextEditorMentionItem = {\n id: String(current.attrs['id'] ?? ''),\n label: String(current.attrs['label'] ?? ''),\n avatar: textEditorMentionAvatar(typeof current.attrs['avatar'] === 'string' ? current.attrs['avatar'] : null) ?? undefined,\n icon: typeof current.attrs['icon'] === 'string' ? current.attrs['icon'] : undefined,\n };\n const host = document.createElement('span');\n host.className = 'ax-text-editor-mention-avatar-host';\n dom.append(host);\n const rendered = controller.renderMentionAvatar?.(host, item);\n disposeAvatar = typeof rendered === 'function' ? rendered : undefined;\n if (!disposeAvatar) {\n const avatar = item.avatar ?? null;\n if (avatar) {\n const image = document.createElement('img');\n image.src = avatar;\n image.alt = '';\n image.className = 'ax-text-editor-mention-avatar';\n host.append(image);\n } else {\n const fallback = document.createElement('span');\n fallback.className = 'ax-text-editor-mention-avatar';\n fallback.textContent = mentionInitial(item.label);\n host.append(fallback);\n }\n }\n const label = document.createElement('span');\n label.textContent = `@${item.label}`;\n dom.append(label);\n };\n paint(mentionNode);\n return {\n dom,\n update(updated) {\n if (updated.type.name !== 'mention') return false;\n paint(updated);\n return true;\n },\n destroy() {\n disposeAvatar?.();\n },\n };\n };\n },\n });\n\n const insert = (view: EditorView, item: AXTextEditorMentionItem) => {\n const pluginState = key.getState(view.state);\n const type = view.state.schema.nodes['mention'];\n if (!pluginState?.active || !pluginState.range || !type) return;\n const { from, to } = pluginState.range;\n const mentionNode = type.create({\n id: item.id,\n label: item.label,\n avatar: textEditorMentionAvatar(item.avatar),\n icon: item.icon ?? null,\n });\n let tr = view.state.tr.replaceWith(from, to, mentionNode);\n const after = from + mentionNode.nodeSize;\n const following = tr.doc.textBetween(after, Math.min(tr.doc.content.size, after + 1));\n if (following !== ' ') tr = tr.insertText(' ', after);\n const caret = Math.min(after + 1, tr.doc.content.size);\n tr = tr.setSelection(pmState.TextSelection.create(tr.doc, caret)).setMeta(key, { type: 'close' } satisfies MentionMeta);\n view.dispatch(tr);\n view.focus();\n };\n\n plugin = new pmState.Plugin<MentionPluginState>({\n key,\n state: {\n init: (_config, state) => inactive(state),\n apply(tr, prev, _old, state) {\n const meta = tr.getMeta(key) as MentionMeta | undefined;\n if (meta?.type === 'close') return inactive(state);\n if (meta?.type === 'items') {\n if (!prev.active || meta.request !== prev.request) return prev;\n const items = meta.items;\n return {\n ...prev,\n items,\n index: items.length ? Math.min(prev.index, items.length - 1) : 0,\n loading: false,\n };\n }\n if (meta?.type === 'index') {\n if (!prev.active || meta.index === prev.index) return prev;\n return { ...prev, index: meta.index };\n }\n if (composing) return inactive(state, prev.dismissed);\n\n const source = controller.getSource();\n const trigger = mentionTrigger(source?.char);\n const match = source && currentView?.editable !== false ? matchMention(state, trigger) : null;\n let dismissed = prev.dismissed;\n if (dismissed && tr.docChanged) dismissed = { from: tr.mapping.map(dismissed.from), query: dismissed.query };\n\n if (meta?.type === 'dismiss') {\n return inactive(state, match ? { from: match.from, query: match.query } : dismissed);\n }\n if (!match || !source) {\n if (!prev.active && !prev.dismissed) return prev;\n return inactive(state);\n }\n\n if (dismissed && dismissed.from === match.from && dismissed.query === match.query && meta?.type !== 'refresh') {\n return inactive(state, dismissed);\n }\n\n if (prev.active && prev.query === match.query && (meta?.type !== 'refresh' || prev.loading)) {\n const limit = source.limit ?? DEFAULT_MENTION_LIMIT;\n if (prev.loading) scheduleRequest(prev.request, prev.query, limit);\n return {\n ...prev,\n range: { from: match.from, to: match.to },\n dismissed: null,\n decorations: decorate(pmView, state, match),\n };\n }\n\n const request = ++requestSerial;\n const query = match.query;\n const limit = source.limit ?? DEFAULT_MENTION_LIMIT;\n scheduleRequest(request, query, limit);\n\n return {\n active: true,\n range: { from: match.from, to: match.to },\n query,\n items: [],\n index: 0,\n loading: true,\n request,\n dismissed: null,\n decorations: decorate(pmView, state, match),\n };\n },\n },\n props: {\n decorations(state) {\n return key.getState(state)?.decorations ?? pmView.DecorationSet.empty;\n },\n handleKeyDown(view, event) {\n const pluginState = key.getState(view.state);\n if (!pluginState?.active || !view.editable) return false;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n if (!pluginState.items.length) return pluginState.loading;\n const delta = event.key === 'ArrowDown' ? 1 : -1;\n const index = (pluginState.index + delta + pluginState.items.length) % pluginState.items.length;\n view.dispatch(view.state.tr.setMeta(key, { type: 'index', index } satisfies MentionMeta));\n return true;\n }\n if (event.key === 'Enter' || event.key === 'Tab') {\n const item = pluginState.items[pluginState.index];\n if (!item) return pluginState.loading;\n event.preventDefault();\n insert(view, item);\n return true;\n }\n if (event.key === 'Escape') {\n view.dispatch(view.state.tr.setMeta(key, { type: 'dismiss' } satisfies MentionMeta));\n return true;\n }\n return false;\n },\n handleDOMEvents: {\n compositionstart: () => {\n composing = true;\n return false;\n },\n compositionend: (view) => {\n composing = false;\n queueMicrotask(() => {\n if (!alive || currentView !== view) return;\n view.dispatch(view.state.tr.setMeta(key, { type: 'refresh' } satisfies MentionMeta));\n });\n return false;\n },\n },\n },\n view(editorView) {\n currentView = editorView;\n alive = true;\n controller.bind({\n apply: (item) => {\n if (currentView) insert(currentView, item);\n },\n setIndex: (index) => {\n const view = currentView;\n const pluginState = view ? key.getState(view.state) : null;\n if (!view || !pluginState?.active || index === pluginState.index) return;\n view.dispatch(view.state.tr.setMeta(key, { type: 'index', index } satisfies MentionMeta));\n },\n refresh: () => {\n if (!currentView) return;\n currentView.dispatch(currentView.state.tr.setMeta(key, { type: 'refresh' } satisfies MentionMeta));\n },\n dismiss: () => {\n const view = currentView;\n if (!view || !key.getState(view.state)?.active) return;\n view.dispatch(view.state.tr.setMeta(key, { type: 'dismiss' } satisfies MentionMeta));\n },\n });\n const reposition = () => {\n if (alive && currentView) publish(currentView);\n };\n document.addEventListener('scroll', reposition, true);\n window.addEventListener('resize', reposition);\n publish(editorView);\n return {\n update(view) {\n currentView = view;\n const pluginState = key.getState(view.state);\n const source = controller.getSource();\n if (pluginState?.active && pluginState.loading && source) {\n scheduleRequest(pluginState.request, pluginState.query, source.limit ?? DEFAULT_MENTION_LIMIT);\n }\n publish(view);\n },\n destroy() {\n alive = false;\n currentView = null;\n document.removeEventListener('scroll', reposition, true);\n window.removeEventListener('resize', reposition);\n controller.publish(null);\n controller.bind({\n apply: () => undefined,\n setIndex: () => undefined,\n refresh: () => undefined,\n dismiss: () => undefined,\n });\n },\n };\n },\n });\n\n return node;\n\n function publish(view: EditorView): void {\n const pluginState = key.getState(view.state);\n if (!pluginState?.active || view.editable === false) {\n controller.publish(null);\n return;\n }\n const rect = pluginState.range ? rectAt(view, pluginState.range.to) : null;\n controller.publish({\n query: pluginState.query,\n items: pluginState.items,\n index: pluginState.index,\n loading: pluginState.loading,\n rect,\n });\n }\n}\n\nfunction matchMention(state: EditorState, char: string): { from: number; to: number; query: string } | null {\n const { selection } = state;\n if (!selection.empty) return null;\n const $from = selection.$from;\n if (!$from.parent.isTextblock || $from.parent.type.spec.code) return null;\n if ($from.marks().some((mark) => mark.type.spec.code || mark.type.name === 'code')) return null;\n const text = $from.parent.textBetween(0, $from.parentOffset, '\\n', (leaf) =>\n leaf.type.name === 'hardBreak' ? '\\n' : '\\ufffc',\n );\n const found = findTextEditorMentionQuery(text, char);\n if (!found) return null;\n const from = $from.start() + found.start;\n return { from, to: $from.pos, query: found.query };\n}\n\nfunction decorate(\n pmView: MentionRuntime['pmView'],\n state: EditorState,\n match: { from: number; to: number },\n): import('@tiptap/pm/view').DecorationSet {\n if (match.from >= match.to) return pmView.DecorationSet.empty;\n try {\n return pmView.DecorationSet.create(state.doc, [\n pmView.Decoration.inline(match.from, match.to, { class: 'ax-text-editor-mention-query' }),\n ]);\n } catch {\n return pmView.DecorationSet.empty;\n }\n}\n\nfunction rectAt(view: EditorView, pos: number): AXTextEditorMentionRect | null {\n try {\n const coords = view.coordsAtPos(pos);\n return {\n top: Math.round(coords.top),\n left: Math.round(coords.left),\n right: Math.round(coords.right),\n bottom: Math.round(coords.bottom),\n };\n } catch {\n return null;\n }\n}\n\nfunction mentionTrigger(char: string | undefined): string {\n const trigger = Array.from(char?.trim() || '@')[0];\n return trigger && !/\\s/u.test(trigger) ? trigger : '@';\n}\n\nfunction mentionInitial(label: string): string {\n const char = Array.from(label.trim())[0];\n return char ? char.toLocaleUpperCase() : '@';\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction escapeCharClass(value: string): string {\n return value.replace(/[\\\\\\]\\-^]/g, '\\\\$&');\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, NgZone, PLATFORM_ID, signal } from '@angular/core';\nimport {\n AX_EMPTY_TEXT_EDITOR_STATE,\n type AXTextEditorCommandAttrs,\n type AXTextEditorCommandType,\n type AXTextEditorHeadingLevel,\n type AXTextEditorInitOptions,\n type AXTextEditorState,\n type AXTextEditorTextAlign,\n type AXTextEditorTextDirection,\n type AXTextEditorMentionActions,\n type AXTextEditorMentionAvatarRenderer,\n type AXTextEditorMentionConfig,\n type AXTextEditorMentionController,\n type AXTextEditorMentionItem,\n type AXTextEditorMentionSuggestion,\n type AXTextEditorTiptapChain,\n type AXTextEditorTiptapContent,\n type AXTextEditorTiptapEditor,\n type AXTextEditorTiptapJSON,\n} from './text-editor.types';\nimport { mentionSuggestionsEqual } from './text-editor.mention';\n\n@Injectable()\nexport class AXTextEditor implements AXTextEditorMentionController {\n readonly editor = signal<AXTextEditorTiptapEditor | null>(null);\n readonly state = signal<AXTextEditorState>(AX_EMPTY_TEXT_EDITOR_STATE);\n readonly ready = signal(false);\n readonly version = signal(0);\n readonly mentionSuggestion = signal<AXTextEditorMentionSuggestion | null>(null);\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly zone = inject(NgZone);\n private mentionSource: AXTextEditorMentionConfig | null = null;\n private mentionActions: AXTextEditorMentionActions | null = null;\n private mentionAvatarRenderer: AXTextEditorMentionAvatarRenderer | null = null;\n private destroyed = false;\n private applyingContent = false;\n\n async init(container: HTMLElement | string, options: AXTextEditorInitOptions = {}): Promise<void> {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const element =\n typeof container === 'string' ? (document.querySelector(container) as HTMLElement | null) : container;\n if (!element) {\n return;\n }\n\n this.destroyed = false;\n const editable = options.readOnly === true ? false : (options.editable ?? true);\n\n const [{ createTextEditorExtensions }, commandsApi, { Editor }] = await Promise.all([\n import('./text-editor.extensions'),\n import('./text-editor.commands'),\n import('@tiptap/core'),\n ]);\n this.commandsApi = commandsApi;\n\n const extensions = await createTextEditorExtensions({\n placeholder: options.placeholder,\n features: options.features,\n headingLevels: options.headingLevels,\n extensions: options.extensions,\n mentions: this,\n });\n\n if (this.destroyed) {\n return;\n }\n\n const editor = new Editor({\n element,\n extensions,\n content: options.content ?? '',\n editable,\n editorProps: {\n ...options.editorProps,\n attributes: {\n class: 'ax-text-editor-prose',\n ...(typeof options.editorProps?.attributes === 'object' ? options.editorProps.attributes : {}),\n },\n handleDOMEvents: {\n ...options.editorProps?.handleDOMEvents,\n },\n },\n onUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n if (!this.applyingContent) {\n options.onUpdate?.(ed);\n }\n },\n onSelectionUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onSelectionUpdate?.(ed);\n },\n onTransaction: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onTransaction?.(ed);\n },\n onFocus: ({ editor: ed, event }) => {\n this.refreshState(ed);\n options.onFocus?.(ed, event);\n },\n onBlur: ({ editor: ed, event }) => {\n this.refreshState(ed);\n this.mentionActions?.dismiss();\n options.onBlur?.(ed, event);\n },\n });\n\n if (options.exitMarksOnEnter) editor.extensionManager.splittableMarks.splice(0);\n this.editor.set(editor);\n this.ready.set(true);\n this.refreshState(editor);\n }\n\n destroy(): void {\n this.destroyed = true;\n const ed = this.editor();\n ed?.destroy();\n this.editor.set(null);\n this.ready.set(false);\n this.state.set(AX_EMPTY_TEXT_EDITOR_STATE);\n this.mentionSuggestion.set(null);\n this.mentionActions = null;\n this.version.set(0);\n this.commandsApi = null;\n }\n\n refresh(): void {\n const ed = this.editor();\n if (ed) {\n this.refreshState(ed);\n }\n }\n\n setContent(value: AXTextEditorTiptapContent | null | undefined, emit = false): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n\n const content = value == null || value === '' ? '' : value;\n this.applyingContent = true;\n try {\n ed.commands.setContent(content, { emitUpdate: emit });\n this.refreshState(ed);\n } finally {\n this.applyingContent = false;\n }\n }\n\n getHTML(): string {\n return this.editor()?.getHTML() ?? '';\n }\n\n getJSON(): AXTextEditorTiptapJSON | null {\n return this.editor()?.getJSON() ?? null;\n }\n\n getText(options?: { blockSeparator?: string }): string {\n return this.editor()?.getText(options) ?? '';\n }\n\n isEmpty(): boolean {\n return this.editor()?.isEmpty ?? true;\n }\n\n isFocused(): boolean {\n return this.editor()?.isFocused ?? false;\n }\n\n isEditable(): boolean {\n return this.editor()?.isEditable ?? false;\n }\n\n setEditable(editable: boolean): void {\n const ed = this.editor();\n if (!ed || ed.isEditable === editable) {\n return;\n }\n ed.setEditable(editable, false);\n this.refreshState(ed);\n }\n\n focus(): void {\n this.editor()?.commands.focus();\n }\n\n blur(): void {\n this.editor()?.commands.blur();\n }\n\n chain(): AXTextEditorTiptapChain | null {\n return this.editor()?.chain() ?? null;\n }\n\n get commands(): AXTextEditorTiptapEditor['commands'] | undefined {\n return this.editor()?.commands;\n }\n\n isActive(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n this.version();\n const ed = this.editor();\n if (!ed) {\n return false;\n }\n return this.getCommandsApi().isTextEditorCommandActive(ed, command, attrs);\n }\n\n can(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n this.version();\n const ed = this.editor();\n if (!ed || !ed.isEditable) {\n return false;\n }\n return this.getCommandsApi().canRunTextEditorCommand(ed, command, attrs);\n }\n\n run(command: AXTextEditorCommandType, attrs?: AXTextEditorCommandAttrs): boolean {\n const ed = this.editor();\n if (!ed || !ed.isEditable) {\n return false;\n }\n const result = this.getCommandsApi().runTextEditorCommand(ed, command, attrs);\n this.refreshState(ed);\n return result;\n }\n\n private commandsApi: typeof import('./text-editor.commands') | null = null;\n\n private getCommandsApi(): typeof import('./text-editor.commands') {\n if (!this.commandsApi) {\n throw new Error('AXTextEditor commands are not loaded. Call init() first.');\n }\n return this.commandsApi;\n }\n\n insertContent(value: AXTextEditorTiptapContent): boolean {\n const result = this.editor()?.chain().focus().insertContent(value).run() ?? false;\n this.refresh();\n return result;\n }\n\n /** Inserts a `<br>` and keeps the inline marks that were active at the caret. */\n insertHardBreak(): boolean {\n const result = this.editor()?.chain().focus().setHardBreak().run() ?? false;\n this.refresh();\n return result;\n }\n\n clearContent(): boolean {\n const result = this.editor()?.commands.clearContent() ?? false;\n this.refresh();\n return result;\n }\n\n insertImage(src: string, alt?: string): void {\n this.run('image', { src, alt });\n }\n\n insertVideo(src: string): void {\n this.run('video', { src });\n }\n\n setLink(href: string): void {\n this.run('link', { href });\n }\n\n unsetLink(): void {\n this.run('unlink');\n }\n\n clearFormatting(): void {\n this.editor()?.chain().focus().clearNodes().unsetAllMarks().run();\n this.refresh();\n }\n\n toggleHeading(level: AXTextEditorHeadingLevel): void {\n this.run('heading', { level });\n }\n\n setTextAlign(align: AXTextEditorTextAlign): void {\n this.run('align', { align });\n }\n\n setTextDirection(direction: AXTextEditorTextDirection): void {\n this.run('direction', { direction });\n }\n\n /** Replaces the mention source. Pass `null` to close the picker and ignore `@`. */\n setMentionSource(source: AXTextEditorMentionConfig | null): void {\n const previous = this.mentionSource;\n this.mentionSource = source;\n if (!source) {\n this.mentionSuggestion.set(null);\n return;\n }\n if (previous === source) return;\n queueMicrotask(() => this.mentionActions?.refresh());\n }\n\n selectMention(item: AXTextEditorMentionItem): void {\n this.mentionActions?.apply(item);\n }\n\n setMentionIndex(index: number): void {\n this.mentionActions?.setIndex(index);\n }\n\n dismissMention(): void {\n this.mentionActions?.dismiss();\n }\n\n /** Replaces the portrait drawn inside mention chips. Pass `null` for the built-in image. */\n setMentionAvatarRenderer(renderer: AXTextEditorMentionAvatarRenderer | null): void {\n this.mentionAvatarRenderer = renderer;\n const editor = this.editor();\n if (!editor || editor.isDestroyed) return;\n queueMicrotask(() => {\n if (editor.isDestroyed) return;\n editor.view.dispatch(editor.state.tr.setMeta('axMentionAvatar', true));\n });\n }\n\n renderMentionAvatar(host: HTMLElement, item: AXTextEditorMentionItem): void | (() => void) {\n return this.mentionAvatarRenderer?.(host, item);\n }\n\n getSource(): AXTextEditorMentionConfig | null {\n return this.mentionSource;\n }\n\n publish(suggestion: AXTextEditorMentionSuggestion | null): void {\n if (mentionSuggestionsEqual(this.mentionSuggestion(), suggestion)) return;\n this.zone.run(() => this.mentionSuggestion.set(suggestion));\n }\n\n bind(actions: AXTextEditorMentionActions): void {\n this.mentionActions = actions;\n }\n\n private refreshState(editor: AXTextEditorTiptapEditor): void {\n this.version.update((value) => value + 1);\n\n const textColor = editor.getAttributes('textStyle')['color'] as string | undefined;\n const fontSizeCss = editor.getAttributes('textStyle')['fontSize'] as string | undefined;\n const highlightColor = editor.getAttributes('highlight')['color'] as string | undefined;\n const linkHref = editor.getAttributes('link')['href'] as string | undefined;\n const dir = (editor.getAttributes('paragraph')['dir'] || editor.getAttributes('heading')['dir']) as\n | AXTextEditorTextDirection\n | undefined;\n\n let headingLevel: AXTextEditorHeadingLevel | null = null;\n for (let level = 1; level <= 6; level++) {\n if (editor.isActive('heading', { level })) {\n headingLevel = level as AXTextEditorHeadingLevel;\n break;\n }\n }\n\n let textAlign: AXTextEditorTextAlign | null = null;\n for (const align of ['left', 'center', 'right', 'justify'] as AXTextEditorTextAlign[]) {\n if (editor.isActive({ textAlign: align })) {\n textAlign = align;\n break;\n }\n }\n\n this.state.set({\n bold: editor.isActive('bold'),\n italic: editor.isActive('italic'),\n underline: editor.isActive('underline'),\n strike: editor.isActive('strike'),\n spoiler: Boolean(editor.schema.marks['spoiler']) && editor.isActive('spoiler'),\n code: editor.isActive('code'),\n codeBlock: editor.isActive('codeBlock'),\n headingLevel,\n bulletList: editor.isActive('bulletList'),\n orderedList: editor.isActive('orderedList'),\n blockquote: editor.isActive('blockquote'),\n superscript: editor.isActive('superscript'),\n subscript: editor.isActive('subscript'),\n textAlign,\n textColor: textColor ?? null,\n highlightColor: highlightColor ?? null,\n linkHref: linkHref ?? null,\n fontSize: fontSizeCss ?? null,\n textDirection: dir ?? null,\n table: editor.isActive('table'),\n canUndo: editor.can().undo(),\n canRedo: editor.can().redo(),\n isEmpty: editor.isEmpty,\n isFocused: editor.isFocused,\n });\n }\n}\n","import {\n AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES,\n type AXTextEditorCommandAttrs,\n type AXTextEditorCommandType,\n type AXTextEditorFontSizeToken,\n type AXTextEditorHeadingLevel,\n type AXTextEditorTiptapEditor,\n} from './text-editor.types';\n\nfunction escapeHtml(value: string): string {\n return value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('\"', '&quot;');\n}\n\nfunction normalizeHref(value: string): string {\n const href = value.trim();\n if (!href) return '';\n if (/^(https?:|mailto:|tel:|#|\\/)/i.test(href)) return href;\n return `https://${href}`;\n}\n\nfunction headingLevel(attrs?: AXTextEditorCommandAttrs): AXTextEditorHeadingLevel | undefined {\n const level = Number(attrs?.['level']);\n if (level >= 1 && level <= 6) {\n return level as AXTextEditorHeadingLevel;\n }\n return undefined;\n}\n\nfunction resolveFontSize(attrs?: AXTextEditorCommandAttrs): string | null {\n const raw = attrs?.['size'];\n if (raw == null || raw === '') {\n return null;\n }\n const size = String(raw);\n if (size === 'small' || size === 'large' || size === 'huge') {\n return AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES[size as AXTextEditorFontSizeToken];\n }\n return size;\n}\n\nexport function isTextEditorCommandActive(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n switch (command) {\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? editor.isActive('heading', { level }) : editor.isActive('heading');\n }\n case 'paragraph':\n return editor.isActive('paragraph');\n case 'align':\n return editor.isActive({ textAlign: attrs?.['align'] });\n case 'direction':\n return editor.isActive({ dir: attrs?.['direction'] });\n case 'link':\n return editor.isActive('link');\n case 'image':\n return editor.isActive('image');\n case 'video':\n return editor.isActive('video');\n case 'fontSize':\n return Boolean(editor.getAttributes('textStyle')?.['fontSize']);\n case 'insertTable':\n return editor.isActive('table');\n case 'unlink':\n case 'color':\n case 'highlight':\n case 'undo':\n case 'redo':\n case 'horizontalRule':\n return false;\n case 'spoiler':\n return Boolean(editor.schema.marks['spoiler']) && editor.isActive('spoiler');\n default:\n return editor.isActive(command);\n }\n}\n\nexport function canRunTextEditorCommand(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n switch (command) {\n case 'undo':\n return editor.can().undo();\n case 'redo':\n return editor.can().redo();\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? editor.can().setHeading({ level }) : editor.can().setParagraph();\n }\n case 'paragraph':\n return editor.can().setParagraph();\n case 'align':\n return editor.can().setTextAlign(String(attrs?.['align'] ?? 'left'));\n case 'direction':\n return true;\n case 'color':\n return attrs?.['color'] ? editor.can().setColor(String(attrs['color'])) : editor.can().unsetColor();\n case 'highlight':\n return attrs?.['color']\n ? editor.can().setHighlight({ color: String(attrs['color']) })\n : editor.can().unsetHighlight();\n case 'fontSize':\n return editor.isEditable;\n case 'link':\n return editor.isEditable;\n case 'unlink':\n return editor.isEditable && editor.can().unsetLink();\n case 'image':\n case 'video':\n return editor.isEditable;\n case 'insertTable':\n return editor.can().insertTable({\n rows: Number(attrs?.['rows'] ?? 3),\n cols: Number(attrs?.['cols'] ?? 3),\n withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),\n });\n case 'addColumnBefore':\n return editor.can().addColumnBefore();\n case 'addColumnAfter':\n return editor.can().addColumnAfter();\n case 'deleteColumn':\n return editor.can().deleteColumn();\n case 'addRowBefore':\n return editor.can().addRowBefore();\n case 'addRowAfter':\n return editor.can().addRowAfter();\n case 'deleteRow':\n return editor.can().deleteRow();\n case 'toggleHeaderRow':\n return editor.can().toggleHeaderRow();\n case 'deleteTable':\n return editor.can().deleteTable();\n case 'blockquote':\n return editor.can().toggleBlockquote();\n case 'code':\n return editor.can().toggleCode();\n case 'codeBlock':\n return editor.can().toggleCodeBlock();\n case 'horizontalRule':\n return editor.can().setHorizontalRule();\n case 'bulletList':\n return editor.isEditable && Boolean(editor.schema.nodes['bulletList']);\n case 'orderedList':\n return editor.isEditable && Boolean(editor.schema.nodes['orderedList']);\n case 'superscript':\n return editor.can().toggleSuperscript();\n case 'subscript':\n return editor.can().toggleSubscript();\n case 'bold':\n return editor.can().toggleBold();\n case 'italic':\n return editor.can().toggleItalic();\n case 'underline':\n return editor.can().toggleUnderline();\n case 'strike':\n return editor.can().toggleStrike();\n case 'spoiler':\n return Boolean(editor.schema.marks['spoiler']) && editor.can().toggleSpoiler();\n default:\n return false;\n }\n}\n\nexport function runTextEditorCommand(\n editor: AXTextEditorTiptapEditor,\n command: AXTextEditorCommandType,\n attrs?: AXTextEditorCommandAttrs,\n): boolean {\n const chain = editor.chain().focus();\n switch (command) {\n case 'undo':\n return chain.undo().run();\n case 'redo':\n return chain.redo().run();\n case 'heading': {\n const level = headingLevel(attrs);\n return level ? chain.setHeading({ level }).run() : chain.setParagraph().run();\n }\n case 'paragraph':\n return chain.setParagraph().run();\n case 'align':\n return chain.setTextAlign(String(attrs?.['align'] ?? 'left')).run();\n case 'direction': {\n const direction = attrs?.['direction'] === 'rtl' ? 'rtl' : 'ltr';\n return chain\n .updateAttributes('paragraph', { dir: direction })\n .updateAttributes('heading', { dir: direction })\n .run();\n }\n case 'color':\n return attrs?.['color'] ? chain.setColor(String(attrs['color'])).run() : chain.unsetColor().run();\n case 'highlight':\n return attrs?.['color']\n ? chain.setHighlight({ color: String(attrs['color']) }).run()\n : chain.unsetHighlight().run();\n case 'fontSize':\n return chain.setFontSize(resolveFontSize(attrs)).run();\n case 'link': {\n const href = normalizeHref(String(attrs?.['href'] ?? ''));\n if (!href) {\n return chain.extendMarkRange('link').unsetLink().run();\n }\n if (editor.state.selection.empty) {\n const safeHref = escapeHtml(href);\n return chain.insertContent(`<a href=\"${safeHref}\">${safeHref}</a>`).run();\n }\n return chain.extendMarkRange('link').setLink({ href }).run();\n }\n case 'unlink':\n return chain.extendMarkRange('link').unsetLink().run();\n case 'image': {\n const src = String(attrs?.['src'] ?? '').trim();\n if (!src) return false;\n return chain.setImage({ src, alt: String(attrs?.['alt'] ?? '') }).run();\n }\n case 'video': {\n const src = String(attrs?.['src'] ?? '').trim();\n if (!src) return false;\n return chain.setVideo({ src }).run();\n }\n case 'insertTable':\n return chain\n .insertTable({\n rows: Number(attrs?.['rows'] ?? 3),\n cols: Number(attrs?.['cols'] ?? 3),\n withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),\n })\n .run();\n case 'addColumnBefore':\n return chain.addColumnBefore().run();\n case 'addColumnAfter':\n return chain.addColumnAfter().run();\n case 'deleteColumn':\n return chain.deleteColumn().run();\n case 'addRowBefore':\n return chain.addRowBefore().run();\n case 'addRowAfter':\n return chain.addRowAfter().run();\n case 'deleteRow':\n return chain.deleteRow().run();\n case 'toggleHeaderRow':\n return chain.toggleHeaderRow().run();\n case 'deleteTable':\n return chain.deleteTable().run();\n case 'blockquote':\n return chain.toggleBlockquote().run();\n case 'code':\n return chain.toggleCode().run();\n case 'codeBlock':\n return chain.toggleCodeBlock().run();\n case 'horizontalRule':\n return chain.setHorizontalRule().run();\n case 'bulletList':\n return chain.toggleBulletList().run();\n case 'orderedList':\n return chain.toggleOrderedList().run();\n case 'superscript':\n return chain.toggleSuperscript().run();\n case 'subscript':\n return chain.toggleSubscript().run();\n case 'bold':\n return chain.toggleBold().run();\n case 'italic':\n return chain.toggleItalic().run();\n case 'underline':\n return chain.toggleUnderline().run();\n case 'strike':\n return chain.toggleStrike().run();\n case 'spoiler':\n return chain.toggleSpoiler().run();\n default:\n return false;\n }\n}\n","import { createTextEditorMentionExtension } from './text-editor.mention';\nimport {\n AX_DEFAULT_TEXT_EDITOR_FEATURES,\n type AXTextEditorFeatures,\n type AXTextEditorHeadingLevel,\n type AXTextEditorLoadExtensionsOptions,\n type AXTextEditorMentionController,\n} from './text-editor.types';\n\ntype AXTextEditorCore = typeof import('@tiptap/core');\n\nfunction createSuperscript(core: AXTextEditorCore) {\n return core.Mark.create({\n name: 'superscript',\n excludes: 'subscript',\n parseHTML() {\n return [{ tag: 'sup' }];\n },\n renderHTML({ HTMLAttributes }) {\n return ['sup', core.mergeAttributes(HTMLAttributes), 0];\n },\n addCommands() {\n return {\n toggleSuperscript:\n () =>\n ({ commands }) =>\n commands.toggleMark(this.name),\n };\n },\n });\n}\n\nfunction createSpoiler(core: AXTextEditorCore) {\n return core.Mark.create({\n name: 'spoiler',\n inclusive: false,\n parseHTML() {\n return [{ tag: 'span[data-spoiler]' }];\n },\n renderHTML({ HTMLAttributes }) {\n return ['span', core.mergeAttributes(HTMLAttributes, { 'data-spoiler': '', class: 'ax-text-editor-spoiler' }), 0];\n },\n addCommands() {\n return {\n toggleSpoiler:\n () =>\n ({ commands }) =>\n commands.toggleMark(this.name),\n };\n },\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-p': () => this.editor.commands.toggleSpoiler(),\n };\n },\n });\n}\n\nfunction createSubscript(core: AXTextEditorCore) {\n return core.Mark.create({\n name: 'subscript',\n excludes: 'superscript',\n parseHTML() {\n return [{ tag: 'sub' }];\n },\n renderHTML({ HTMLAttributes }) {\n return ['sub', core.mergeAttributes(HTMLAttributes), 0];\n },\n addCommands() {\n return {\n toggleSubscript:\n () =>\n ({ commands }) =>\n commands.toggleMark(this.name),\n };\n },\n });\n}\n\nfunction createKeepSelection(\n core: AXTextEditorCore,\n pmState: typeof import('@tiptap/pm/state'),\n pmView: typeof import('@tiptap/pm/view'),\n) {\n const keepSelectionKey = new pmState.PluginKey('axKeepSelection');\n return core.Extension.create({\n name: 'keepSelection',\n addProseMirrorPlugins() {\n return [\n new pmState.Plugin({\n key: keepSelectionKey,\n state: {\n init() {\n return pmView.DecorationSet.empty;\n },\n apply(tr, set) {\n const meta = tr.getMeta(keepSelectionKey) as { from: number; to: number } | 'clear' | undefined;\n if (meta === 'clear') return pmView.DecorationSet.empty;\n if (meta && meta.from !== meta.to) {\n return pmView.DecorationSet.create(tr.doc, [\n pmView.Decoration.inline(meta.from, meta.to, { class: 'ax-text-editor-kept-selection' }),\n ]);\n }\n return set.map(tr.mapping, tr.doc);\n },\n },\n props: {\n decorations(state) {\n return keepSelectionKey.getState(state);\n },\n handleDOMEvents: {\n blur(view) {\n const { from, to } = view.state.selection;\n if (from !== to) {\n view.dispatch(view.state.tr.setMeta(keepSelectionKey, { from, to }));\n }\n return false;\n },\n focus(view) {\n const decorations = keepSelectionKey.getState(view.state) as\n | import('@tiptap/pm/view').DecorationSet\n | undefined;\n if (decorations?.find().length) {\n view.dispatch(view.state.tr.setMeta(keepSelectionKey, 'clear'));\n }\n return false;\n },\n },\n },\n }),\n ];\n },\n });\n}\n\nfunction createTextDirection(core: AXTextEditorCore) {\n return core.Extension.create({\n name: 'textDirection',\n addGlobalAttributes() {\n return [\n {\n types: ['paragraph', 'heading'],\n attributes: {\n dir: {\n default: null,\n parseHTML: (element) => element.getAttribute('dir'),\n renderHTML: (attributes) => (attributes['dir'] ? { dir: attributes['dir'] } : {}),\n },\n },\n },\n ];\n },\n });\n}\n\nfunction createFontSize(core: AXTextEditorCore) {\n return core.Extension.create({\n name: 'axTextEditorFontSize',\n addGlobalAttributes() {\n return [\n {\n types: ['textStyle'],\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) => element.style.fontSize?.replace(/['\"]+/g, '') || null,\n renderHTML: (attributes) =>\n attributes['fontSize'] ? { style: `font-size: ${attributes['fontSize']}` } : {},\n },\n },\n },\n ];\n },\n addCommands() {\n return {\n setFontSize:\n (size: string | null) =>\n ({ chain }) => {\n if (!size) {\n return chain().focus().setMark('textStyle', { fontSize: null }).removeEmptyTextStyle().run();\n }\n return chain().focus().setMark('textStyle', { fontSize: size }).run();\n },\n };\n },\n });\n}\n\nfunction createVideo(core: AXTextEditorCore) {\n return core.Node.create({\n name: 'video',\n group: 'block',\n atom: true,\n addOptions() {\n return {\n HTMLAttributes: {},\n };\n },\n addAttributes() {\n return {\n src: {\n default: null,\n },\n };\n },\n parseHTML() {\n return [\n { tag: 'video[src]' },\n { tag: 'div[data-text-editor-video] video' },\n { tag: 'div[data-wysiwyg-video] iframe' },\n { tag: 'iframe[src]' },\n ];\n },\n renderHTML({ HTMLAttributes }) {\n const src = String(HTMLAttributes['src'] ?? '');\n if (isEmbedSrc(src)) {\n return [\n 'div',\n core.mergeAttributes(this.options.HTMLAttributes, { 'data-text-editor-video': '' }),\n [\n 'iframe',\n core.mergeAttributes({\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n }),\n ],\n ];\n }\n return [\n 'video',\n core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n class: 'ax-text-editor-video',\n controls: 'true',\n }),\n ];\n },\n addCommands() {\n return {\n setVideo:\n ({ src }) =>\n ({ commands }) =>\n commands.insertContent({\n type: this.name,\n attrs: { src: toVideoSrc(src) },\n }),\n };\n },\n });\n}\n\nfunction isEmbedSrc(src: string): boolean {\n return /youtube\\.com\\/embed\\/|youtu\\.be\\//i.test(src);\n}\n\nfunction toVideoSrc(src: string): string {\n const trimmed = src.trim();\n if (!trimmed) return trimmed;\n try {\n const url = new URL(trimmed);\n if (url.hostname.includes('youtube.com') && url.searchParams.get('v')) {\n return `https://www.youtube.com/embed/${url.searchParams.get('v')}`;\n }\n if (url.hostname === 'youtu.be') {\n return `https://www.youtube.com/embed/${url.pathname.slice(1)}`;\n }\n } catch {\n return trimmed;\n }\n return trimmed;\n}\n\nconst DEFAULT_HEADING_LEVELS: AXTextEditorHeadingLevel[] = [1, 2, 3];\n\nconst NO_MENTIONS: AXTextEditorMentionController = {\n getSource: () => null,\n publish: () => undefined,\n bind: () => undefined,\n};\n\nfunction resolvePlaceholder(placeholder?: string | (() => string)): string {\n if (typeof placeholder === 'function') {\n return placeholder();\n }\n return placeholder ?? '';\n}\n\nexport async function createTextEditorExtensions(\n placeholderOrOptions: string | (() => string) | AXTextEditorLoadExtensionsOptions = '',\n): Promise<import('@tiptap/core').AnyExtension[]> {\n const options: AXTextEditorLoadExtensionsOptions =\n typeof placeholderOrOptions === 'function' || typeof placeholderOrOptions === 'string'\n ? { placeholder: placeholderOrOptions }\n : placeholderOrOptions;\n\n const features: AXTextEditorFeatures = { ...AX_DEFAULT_TEXT_EDITOR_FEATURES, ...options.features };\n const headingLevels = options.headingLevels ?? DEFAULT_HEADING_LEVELS;\n\n const [core, pmState, pmView, starterKitMod, textStyleMod, highlightMod, textAlignMod, extensionsMod, tableMod, imageMod] =\n await Promise.all([\n import('@tiptap/core'),\n import('@tiptap/pm/state'),\n import('@tiptap/pm/view'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extensions'),\n import('@tiptap/extension-table/kit'),\n import('@tiptap/extension-image'),\n ]);\n\n const Image = imageMod.default ?? imageMod.Image;\n const Highlight = highlightMod.default ?? highlightMod.Highlight;\n\n const extensions: import('@tiptap/core').AnyExtension[] = [\n starterKitMod.StarterKit.configure({\n heading: {\n levels: headingLevels,\n HTMLAttributes: {\n class: 'ax-text-editor-heading',\n },\n },\n link: {\n openOnClick: false,\n HTMLAttributes: {\n class: 'ax-text-editor-link',\n },\n },\n code: {\n HTMLAttributes: {\n class: 'ax-text-editor-code',\n },\n },\n codeBlock: {\n HTMLAttributes: {\n class: 'ax-text-editor-code-block',\n },\n },\n bulletList: {\n HTMLAttributes: {\n class: 'ax-text-editor-bullet-list',\n },\n },\n orderedList: {\n HTMLAttributes: {\n class: 'ax-text-editor-ordered-list',\n },\n },\n listItem: {\n HTMLAttributes: {\n class: 'ax-text-editor-list-item',\n },\n },\n }),\n textStyleMod.TextStyle,\n textStyleMod.Color,\n createFontSize(core),\n Highlight.configure({ multicolor: true }),\n textAlignMod.TextAlign.configure({\n types: ['heading', 'paragraph'],\n }),\n createTextDirection(core),\n createSpoiler(core),\n createTextEditorMentionExtension({ core, pmState, pmView }, options.mentions ?? NO_MENTIONS),\n ];\n\n if (features.superscript) {\n extensions.push(createSuperscript(core));\n }\n if (features.subscript) {\n extensions.push(createSubscript(core));\n }\n if (features.keepSelection) {\n extensions.push(createKeepSelection(core, pmState, pmView));\n }\n if (features.table) {\n extensions.push(\n tableMod.TableKit.configure({\n table: {\n resizable: true,\n lastColumnResizable: true,\n cellMinWidth: 64,\n HTMLAttributes: {\n class: 'ax-text-editor-table',\n },\n },\n }),\n );\n }\n if (features.image) {\n extensions.push(\n Image.configure({\n inline: true,\n allowBase64: true,\n HTMLAttributes: {\n class: 'ax-text-editor-image',\n },\n }),\n );\n }\n if (features.video) {\n extensions.push(createVideo(core));\n }\n if (features.placeholder) {\n extensions.push(\n extensionsMod.Placeholder.configure({\n placeholder: () => resolvePlaceholder(options.placeholder),\n showOnlyCurrent: true,\n }),\n );\n }\n\n if (options.extensions?.length) {\n extensions.push(...options.extensions);\n }\n\n return extensions;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYO,MAAM,qCAAqC,GAA8C;AAC9F,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,IAAI,EAAE,OAAO;;MAKF,2BAA2B,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;AAC5E,MAAM,uBAAuB,GAAG;AAChC,MAAM,uBAAuB,GAAG;AAEhC,MAAM,yBAAyB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE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QAAQ,CAAC,KAAK,EAAE;QAClB,UAAU,CAAC,IAAI,CACb,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC1B,YAAA,KAAK,EAAE;AACL,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,mBAAmB,EAAE,IAAI;AACzB,gBAAA,YAAY,EAAE,EAAE;AAChB,gBAAA,cAAc,EAAE;AACd,oBAAA,KAAK,EAAE,sBAAsB;AAC9B,iBAAA;AACF,aAAA;AACF,SAAA,CAAC,CACH;IACH;AACA,IAAA,IAAI,QAAQ,CAAC,KAAK,EAAE;AAClB,QAAA,UAAU,CAAC,IAAI,CACb,KAAK,CAAC,SAAS,CAAC;AACd,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,cAAc,EAAE;AACd,gBAAA,KAAK,EAAE,sBAAsB;AAC9B,aAAA;AACF,SAAA,CAAC,CACH;IACH;AACA,IAAA,IAAI,QAAQ,CAAC,KAAK,EAAE;QAClB,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpC;AACA,IAAA,IAAI,QAAQ,CAAC,WAAW,EAAE;QACxB,UAAU,CAAC,IAAI,CACb,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC;YAClC,WAAW,EAAE,MAAM,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC;AAC1D,YAAA,eAAe,EAAE,IAAI;AACtB,SAAA,CAAC,CACH;IACH;AAEA,IAAA,IAAI,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE;QAC9B,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IACxC;AAEA,IAAA,OAAO,UAAU;AACnB;;;;;;;ACnaA;;AAEG;;"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@acorex/cdk",
3
- "version": "22.4.44",
3
+ "version": "22.4.47",
4
4
  "peerDependencies": {
5
- "@acorex/core": "22.4.44",
5
+ "@acorex/core": "22.4.47",
6
6
  "@tiptap/core": ">=3.31.4",
7
7
  "@tiptap/extension-color": ">=3.31.4",
8
8
  "@tiptap/extension-highlight": ">=3.31.4",
@@ -72,6 +72,7 @@ declare class AXDragDirective implements OnInit, OnDestroy, AXDragParent {
72
72
  private clonePointerOffset;
73
73
  private clonedElementViewRef;
74
74
  private rafId;
75
+ private appliedTranslate;
75
76
  private pendingPointerEvent;
76
77
  private savedBodyCursor;
77
78
  private holdDelayTimer;