@qxs-bns/components-wc 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/editor/blocksuite-editor.mjs +442 -43
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/entry-subject.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/subject/blank-fill.mjs +19 -13
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/draft.mjs +2 -0
- package/es/subject/draft.mjs.map +1 -0
- package/es/subject/page-end.mjs +3 -3
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/pagination.mjs +2 -0
- package/es/subject/pagination.mjs.map +1 -0
- package/es/subject/runtime.mjs +2 -0
- package/es/subject/runtime.mjs.map +1 -0
- package/es/subject/scale.mjs +58 -34
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +72 -42
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sort-controller.mjs +2 -0
- package/es/subject/sort-controller.mjs.map +1 -0
- package/es/subject/sortable.mjs +30 -0
- package/es/subject/sortable.mjs.map +1 -0
- package/es/subject/sorting-card.mjs +52 -0
- package/es/subject/sorting-card.mjs.map +1 -0
- package/es/subject/text-fill.mjs +43 -37
- package/es/subject/text-fill.mjs.map +1 -1
- package/es/subject/types.mjs +1 -1
- package/es/subject/types.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +434 -35
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/entry-subject.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/subject/blank-fill.cjs +19 -13
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/draft.cjs +2 -0
- package/lib/subject/draft.cjs.map +1 -0
- package/lib/subject/page-end.cjs +3 -3
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/pagination.cjs +2 -0
- package/lib/subject/pagination.cjs.map +1 -0
- package/lib/subject/runtime.cjs +2 -0
- package/lib/subject/runtime.cjs.map +1 -0
- package/lib/subject/scale.cjs +53 -29
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +72 -42
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sort-controller.cjs +2 -0
- package/lib/subject/sort-controller.cjs.map +1 -0
- package/lib/subject/sortable.cjs +30 -0
- package/lib/subject/sortable.cjs.map +1 -0
- package/lib/subject/sorting-card.cjs +52 -0
- package/lib/subject/sorting-card.cjs.map +1 -0
- package/lib/subject/text-fill.cjs +18 -12
- package/lib/subject/text-fill.cjs.map +1 -1
- package/lib/subject/types.cjs +1 -1
- package/lib/subject/types.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocksuite-editor.mjs","sources":["../../../../packages/components-wc/src/editor/blocksuite-editor.ts"],"sourcesContent":["import { Editor, Extension } from '@tiptap/core'\nimport Blockquote from '@tiptap/extension-blockquote'\nimport Bold from '@tiptap/extension-bold'\nimport BulletList from '@tiptap/extension-bullet-list'\nimport Code from '@tiptap/extension-code'\nimport Document from '@tiptap/extension-document'\nimport Heading from '@tiptap/extension-heading'\nimport History from '@tiptap/extension-history'\nimport HorizontalRule from '@tiptap/extension-horizontal-rule'\nimport Image from '@tiptap/extension-image'\nimport Italic from '@tiptap/extension-italic'\nimport Link from '@tiptap/extension-link'\nimport ListItem from '@tiptap/extension-list-item'\nimport OrderedList from '@tiptap/extension-ordered-list'\nimport Paragraph from '@tiptap/extension-paragraph'\nimport Placeholder from '@tiptap/extension-placeholder'\nimport Strike from '@tiptap/extension-strike'\nimport { Table } from '@tiptap/extension-table'\nimport { TableCell } from '@tiptap/extension-table-cell'\nimport { TableHeader } from '@tiptap/extension-table-header'\nimport { TableRow } from '@tiptap/extension-table-row'\nimport Text from '@tiptap/extension-text'\nimport TextAlign from '@tiptap/extension-text-align'\nimport Underline from '@tiptap/extension-underline'\nimport { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\n@safeCustomElement('qxs-blocksuite-editor')\nexport class QxsBlocksuiteEditor extends LitElement {\n static styles = css`\n :host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;\n }\n\n .editor-wrapper {\n border: 1px solid #e3e3e3;\n border-radius: 12px;\n background: #fff;\n overflow: visible;\n position: relative;\n min-height: 80px;\n }\n\n .editor-wrapper:focus-within {\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .editor-wrapper.preview {\n border: none;\n border-radius: 0;\n background: transparent;\n }\n\n .editor-wrapper.preview .editor-content {\n padding: 8px 12px;\n min-height: unset;\n }\n\n .editor-content {\n padding: 12px 16px;\n min-height: 80px;\n cursor: text;\n }\n\n .editor-content:empty::before {\n content: '输入 / 唤出快捷命令';\n color: #c0c0c0;\n pointer-events: none;\n display: block;\n padding-top: 28px;\n text-align: center;\n }\n\n .editor-content .ProseMirror:empty {\n min-height: 80px;\n }\n\n .ProseMirror p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: #c0c0c0;\n pointer-events: none;\n float: left;\n height: 0;\n }\n\n .ProseMirror p.is-empty:only-child::before,\n .ProseMirror p.is-empty:only-child > br:first-child + *::before {\n content: attr(data-placeholder);\n color: #c0c0c0;\n pointer-events: none;\n float: left;\n height: 0;\n }\n\n .editor-wrapper.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n background: #fafafa;\n }\n\n .loading-placeholder {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n color: #909399;\n font-size: 14px;\n }\n\n .loading-spinner {\n width: 24px;\n height: 24px;\n border: 2px solid #e3e3e3;\n border-top-color: var(--qxs-color-primary, #3D61E3);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .ProseMirror {\n outline: none;\n line-height: 1.7;\n color: #37352f;\n font-size: 15px;\n }\n\n .ProseMirror > * + * {\n margin-top: 0.5em;\n }\n\n .ProseMirror > *:first-child {\n margin-top: 0 !important;\n }\n\n .ProseMirror p {\n margin: 0;\n }\n\n .ProseMirror h1 {\n font-size: 1.875em;\n font-weight: 700;\n margin: 0 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror > h1:first-child {\n margin-top: 0 !important;\n line-height: 1.15;\n }\n\n .ProseMirror > p:first-child {\n margin-top: 0 !important;\n }\n\n .ProseMirror h2 {\n font-size: 1.5em;\n font-weight: 600;\n margin: 0.5em 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror h3 {\n font-size: 1.25em;\n font-weight: 600;\n margin: 0.5em 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n padding-left: 1.5em;\n margin: 0;\n }\n\n .ProseMirror li {\n margin: 0.1em 0;\n }\n\n .ProseMirror li::marker {\n color: #37352f;\n }\n\n .ProseMirror strong {\n font-weight: 700;\n }\n\n .ProseMirror em {\n font-style: italic;\n font-synthesis: none;\n transform: skewX(-12deg);\n display: inline-block;\n }\n\n .ProseMirror u {\n text-decoration: underline;\n }\n\n .ProseMirror s {\n text-decoration: line-through;\n color: #787774;\n }\n\n .ProseMirror code {\n background: rgba(135, 131, 120, 0.14);\n color: #eb5757;\n padding: 2px 4px;\n border-radius: 4px;\n font-family: 'SFMono-Regular', Menlo, Consolas, monospace;\n font-size: 85%;\n }\n\n .ProseMirror pre {\n background: #f6f6f7;\n border-radius: 8px;\n padding: 12px 16px;\n overflow-x: auto;\n }\n\n .ProseMirror pre code {\n background: none;\n padding: 0;\n color: #37352f;\n }\n\n .ProseMirror blockquote {\n border-left: 3px solid #e3e3e3;\n padding-left: 1em;\n margin: 0.75em 0;\n color: #787774;\n }\n\n .ProseMirror hr {\n border: none;\n border-top: 1px solid #e3e3e3;\n margin: 1.5em 0;\n }\n\n .ProseMirror img {\n max-width: 100%;\n height: auto;\n border-radius: 8px;\n }\n\n .ProseMirror a {\n color: var(--qxs-color-primary, #3D61E3);\n text-decoration: underline;\n cursor: pointer;\n }\n\n .ProseMirror img.ProseMirror-selectednode {\n outline: 2px solid var(--qxs-color-primary, #3D61E3);\n }\n\n /* Table styles */\n .ProseMirror table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n border: 1px solid #e3e3e3;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .ProseMirror th,\n .ProseMirror td {\n border: 1px solid #e3e3e3;\n padding: 8px 12px;\n text-align: left;\n vertical-align: top;\n }\n\n .ProseMirror th {\n background: #fafafa;\n font-weight: 600;\n }\n\n .ProseMirror .selectedCell {\n background: rgba(30, 150, 252, 0.1);\n }\n\n /* Table Cell Toolbar */\n .table-cell-toolbar {\n position: absolute;\n z-index: 50;\n display: flex;\n gap: 2px;\n padding: 4px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n }\n\n .table-cell-toolbar-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n color: #606266;\n transition: all 0.15s;\n }\n\n .table-cell-toolbar-btn:hover {\n background: #ecf5ff;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .table-cell-toolbar-btn.danger:hover {\n background: #fef0f0;\n color: #f56c6c;\n }\n\n /* Bubble Menu */\n .bubble-menu {\n position: absolute;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 4px 6px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n z-index: 100;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.15s, visibility 0.15s, transform 0.15s;\n transform: translateY(4px);\n max-width: calc(100vw - 40px);\n }\n\n .bubble-menu.is-visible {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .bubble-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n transition: all 0.15s;\n position: relative;\n }\n\n .bubble-btn:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-btn.is-active {\n background: var(--qxs-color-primary, #3D61E3);\n color: #fff;\n }\n\n .bubble-btn svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .bubble-divider {\n width: 1px;\n height: 16px;\n background: #e3e3e3;\n margin: 0 3px;\n }\n\n /* Dropdown */\n .bubble-dropdown {\n position: relative;\n }\n\n .bubble-dropdown-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 0 6px;\n height: 28px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n font-weight: 500;\n font-family: inherit;\n transition: all 0.15s;\n white-space: nowrap;\n }\n\n .bubble-dropdown-btn:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-dropdown-btn svg {\n width: 12px;\n height: 12px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .bubble-dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n min-width: 120px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n padding: 4px;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-4px);\n transition: all 0.15s;\n z-index: 101;\n }\n\n .bubble-dropdown:hover .bubble-dropdown-menu,\n .bubble-dropdown.is-open .bubble-dropdown-menu {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .bubble-dropdown-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 8px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n font-weight: 500;\n font-family: inherit;\n text-align: left;\n transition: all 0.15s;\n }\n\n .bubble-dropdown-item:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-dropdown-item.is-active {\n background: var(--qxs-color-primary, #3D61E3);\n color: #fff;\n }\n\n .bubble-dropdown-item svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .image-input {\n display: none;\n }\n\n .table-grid-preview {\n display: grid;\n grid-template-columns: repeat(10, 18px);\n gap: 2px;\n padding: 8px;\n }\n\n .table-grid-preview .table-cell {\n width: 18px;\n height: 18px;\n border: 1px solid #e3e3e3;\n border-radius: 2px;\n background: #fff;\n cursor: pointer;\n transition: all 0.1s;\n }\n\n .table-grid-preview .table-cell:hover {\n background: rgba(30, 150, 252, 0.3);\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .table-grid-preview .table-cell.selected {\n background: rgba(30, 150, 252, 0.15);\n border-color: rgba(30, 150, 252, 0.5);\n }\n\n .table-size-hint {\n text-align: center;\n padding: 4px 8px 6px;\n font-size: 10px;\n color: #8c8c8c;\n }\n\n /* Image Toolbar */\n .image-toolbar {\n position: absolute;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 4px 6px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n z-index: 100;\n transform: translateX(-50%);\n }\n\n .image-toolbar-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n color: #595959;\n transition: all 0.15s;\n }\n\n .image-toolbar-btn:hover {\n background: #f5f5f5;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .image-toolbar-btn.danger:hover {\n background: #fff1f0;\n color: #ff4d4f;\n }\n\n .image-toolbar-btn svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .image-toolbar-divider {\n width: 1px;\n height: 20px;\n background: #e3e3e3;\n margin: 0 4px;\n }\n\n /* Image More Menu */\n .image-more-menu {\n position: absolute;\n top: 100%;\n right: 0;\n margin-top: 4px;\n padding: 4px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n z-index: 101;\n min-width: 120px;\n }\n\n .image-more-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border: none;\n background: transparent;\n width: 100%;\n text-align: left;\n font-size: 13px;\n color: #595959;\n border-radius: 4px;\n cursor: pointer;\n transition: all 0.15s;\n }\n\n .image-more-menu-item:hover {\n background: #f5f5f5;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .image-more-menu-item svg {\n width: 14px;\n height: 14px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n /* Selected Image */\n .ProseMirror img.selected {\n outline: 2px solid var(--qxs-color-primary, #3D61E3);\n outline-offset: 2px;\n }\n `\n\n @property({ type: String, attribute: 'content' })\n content = ''\n\n @property({ type: String, attribute: 'model-value' })\n 'model-value' = ''\n\n @property({ type: String, attribute: 'placeholder' })\n placeholder = '输入 / 唤出快捷命令'\n\n @property({ type: String, attribute: 'use-model' })\n 'use-model' = 'false'\n\n @property({ type: String, attribute: 'readonly' })\n readonly = 'false'\n\n @property({ type: String, attribute: 'preview' })\n preview = 'false'\n\n @property({ type: String, attribute: 'custom-styles' })\n 'custom-styles' = ''\n\n private _injectedStyleEl: HTMLStyleElement | null = null\n\n private _injectCustomStyles() {\n const shadow = this.shadowRoot\n if (!shadow) { return }\n\n if (this._injectedStyleEl) {\n this._injectedStyleEl.remove()\n this._injectedStyleEl = null\n }\n\n if (!this['custom-styles']) { return }\n\n const styleEl = document.createElement('style')\n styleEl.textContent = this['custom-styles']\n shadow.appendChild(styleEl)\n this._injectedStyleEl = styleEl\n }\n\n private get _useModelValue(): boolean {\n return this['use-model'] === true || this['use-model'] === 'true' || this['use-model'] === '' || this.hasAttribute('use-model')\n }\n\n private get _readonlyValue(): boolean {\n return this.readonly !== false && this.readonly !== 'false'\n }\n\n private get _previewValue(): boolean {\n return this.preview !== false && this.preview !== 'false'\n }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @state() private _editor: Editor | null = null\n @state() private _pendingContent: string | null = null\n private _tableRows = 3\n private _tableCols = 3\n @state() private _hoverRow = 0\n @state() private _hoverCol = 0\n @state() private _tableDropdownOpen = false\n @state() private _tableCellToolbar: { x: number, y: number, visible: boolean, cellRow: number, cellCol: number } = { x: 0, y: 0, visible: false, cellRow: 0, cellCol: 0 }\n @state() private _imageToolbar: { x: number, y: number, visible: boolean } = { x: 0, y: 0, visible: false }\n @state() private _imageMoreMenuVisible = false\n private _hasSlashCommand = false\n private _isUpdating = false\n\n private _initEditor() {\n if (this._editor) { return }\n\n const el = this.shadowRoot?.querySelector<HTMLElement>('.editor-content')\n if (!el) {\n requestAnimationFrame(() => this._initEditor())\n return\n }\n\n while (el.firstChild) {\n el.removeChild(el.firstChild)\n }\n\n const useModel = this._useModelValue\n const modelValue = this.getAttribute('model-value') ?? this['model-value']\n const contentValue = this.content\n\n const initialContent = useModel\n ? (this._pendingContent ?? modelValue) || '<p></p>'\n : (this._pendingContent ?? contentValue) || '<p></p>'\n\n const extensions: any[] = [\n Document,\n Paragraph,\n Text,\n Bold,\n Italic,\n Underline,\n Strike,\n Code,\n Heading.configure({ levels: [1, 2, 3] }),\n BulletList,\n OrderedList,\n ListItem,\n Blockquote,\n HorizontalRule,\n History,\n Image.configure({\n inline: false,\n allowBase64: true,\n }),\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n rel: 'noopener noreferrer',\n },\n }),\n TextAlign.configure({\n types: ['heading', 'paragraph'],\n }),\n Table.configure({\n resizable: true,\n }),\n TableRow,\n TableCell,\n TableHeader,\n Placeholder.configure({\n placeholder: this.placeholder,\n }),\n Extension.create({\n name: 'clearMarksOnEnter',\n addKeyboardShortcuts() {\n return {\n Enter: () => {\n this.editor.chain().focus().unsetAllMarks().clearNodes().run()\n return false\n },\n }\n },\n }),\n ]\n\n this._editor = new Editor({\n element: el,\n extensions,\n editable: !this._readonlyValue,\n content: initialContent,\n })\n\n this._pendingContent = null\n\n this._editor.on('selectionUpdate', () => {\n this._updateBubbleMenuPosition()\n if (this._editor?.isActive('table')) {\n this._showTableCellToolbar()\n }\n else {\n this._hideTableCellToolbar()\n }\n // Image selection detection\n const editor = this._editor\n if (editor) {\n const { selection } = editor.state\n const { $from } = selection\n const node = $from.node($from.depth)\n if (node.type.name === 'image') {\n const coords = editor.view.coordsAtPos($from.start())\n const wrapperRect = this.shadowRoot?.querySelector('.editor-wrapper')?.getBoundingClientRect()\n if (wrapperRect) {\n const x = coords.left - wrapperRect.left + (coords.right - coords.left) / 2\n const y = coords.top - wrapperRect.top - 40\n this._showImageToolbar({ x, y })\n }\n }\n else {\n this._hideImageToolbar()\n }\n }\n })\n\n this._editor.on('transaction', () => {\n if (this._editor?.isActive('table')) {\n this._showTableCellToolbar()\n }\n else {\n this._hideTableCellToolbar()\n }\n this._checkSlashCommand()\n this._setupTableEdgeDetection()\n })\n\n this._editor.on('update', () => {\n this._emitContentChange()\n })\n }\n\n private _tableEdgeDetectionSetup = false\n\n private _emitContentChange() {\n if (!this._editor) { return }\n const html = this._editor.getHTML()\n\n this.dispatchEvent(new CustomEvent('content-change', {\n detail: html,\n bubbles: true,\n composed: true,\n }))\n }\n\n private _setupTableEdgeDetection() {\n const editorContent = this.shadowRoot?.querySelector('.editor-content')\n const editorWrapper = this.shadowRoot?.querySelector('.editor-wrapper')\n if (!editorContent || this._tableEdgeDetectionSetup) { return }\n\n this._tableEdgeDetectionSetup = true\n\n const handleEditorClick = () => {\n this._editor?.chain().focus().run()\n }\n\n editorContent.addEventListener('click', handleEditorClick)\n editorWrapper?.addEventListener('click', handleEditorClick)\n }\n\n private _checkSlashCommand() {\n if (!this._editor) { return }\n const { selection } = this._editor.state\n const textBefore = this._editor.state.doc.textBetween(\n Math.max(0, selection.from - 10),\n selection.from,\n ' ',\n )\n this._hasSlashCommand = textBefore.endsWith('/')\n }\n\n firstUpdated() {\n this._injectCustomStyles()\n this._initEditor()\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('custom-styles')) {\n this._injectCustomStyles()\n }\n\n if (this._editor) {\n if (changed.has('content') || (changed.has('model-value') && this._useModelValue)) {\n const newContent = this._useModelValue ? this['model-value'] : this.content\n if (newContent !== this._editor.getHTML()) {\n this._editor.commands.setContent(newContent || '<p></p>')\n }\n }\n if (changed.has('readonly')) {\n this._editor.setEditable(!this._readonlyValue)\n }\n return\n }\n\n // 编辑器未初始化时,只保存待处理内容,不重复初始化\n if (changed.has('content')) {\n this._pendingContent = this.content\n }\n\n if (changed.has('model-value') && this._useModelValue) {\n this._pendingContent = this['model-value']\n }\n\n // 只有在 firstUpdated 时才会初始化编辑器\n // 这里不再重复调用 _initEditor()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._editor?.destroy()\n this._editor = null\n }\n\n getContent(): string {\n return this._editor?.getHTML() ?? ''\n }\n\n forceUpdate(): void {\n this.requestUpdate()\n if (this._editor) {\n const newContent = this._useModelValue ? this['model-value'] : this.content\n if (newContent !== this._editor.getHTML()) {\n this._editor.commands.setContent(newContent || '<p></p>')\n }\n }\n }\n\n private _applyFormat(command: () => void) {\n if (this._hasSlashCommand && this._editor) {\n const { selection } = this._editor.state\n this._editor.chain().focus().deleteRange({ from: selection.from - 1, to: selection.from }).run()\n this._hasSlashCommand = false\n }\n command()\n }\n\n private _toggleBold() {\n this._applyFormat(() => this._editor?.chain().focus().toggleBold().run())\n }\n\n private _toggleItalic() {\n this._applyFormat(() => this._editor?.chain().focus().toggleItalic().run())\n }\n\n private _toggleUnderline() {\n this._applyFormat(() => this._editor?.chain().focus().toggleUnderline().run())\n }\n\n private _toggleStrike() {\n this._applyFormat(() => this._editor?.chain().focus().toggleStrike().run())\n }\n\n private _toggleCode() {\n this._applyFormat(() => this._editor?.chain().focus().toggleCode().run())\n }\n\n private _setHeading(level: number) {\n this._applyFormat(() => this._editor?.chain().focus().toggleHeading({ level: level as 1 | 2 | 3 | 4 | 5 | 6 }).run())\n }\n\n private _setParagraph() {\n this._applyFormat(() => this._editor?.chain().focus().setParagraph().run())\n }\n\n private _toggleBulletList() {\n this._applyFormat(() => this._editor?.chain().focus().toggleBulletList().run())\n }\n\n private _toggleOrderedList() {\n this._applyFormat(() => this._editor?.chain().focus().toggleOrderedList().run())\n }\n\n private _toggleBlockquote() {\n this._applyFormat(() => this._editor?.chain().focus().toggleBlockquote().run())\n }\n\n private _setTextAlign(align: string) {\n this._applyFormat(() => this._editor?.chain().focus().setTextAlign(align as any).run())\n }\n\n private _setLink() {\n // eslint-disable-next-line no-alert\n const url = window.prompt('请输入链接地址:')\n if (url) {\n this._applyFormat(() => this._editor?.chain().focus().setLink({ href: url }).run())\n }\n }\n\n private _insertTable(rows?: number, cols?: number) {\n this._editor?.chain().focus().insertTable({ rows: rows ?? this._tableRows, cols: cols ?? this._tableCols, withHeaderRow: true }).run()\n }\n\n private async _handleImageUpload(e: Event) {\n const input = e.target as HTMLInputElement\n const file = input.files?.[0]\n if (file) {\n try {\n const src = await this['upload-image'](file)\n this._editor?.chain().focus().setImage({ src }).run()\n }\n catch (err) {\n console.error('图片上传失败:', err)\n }\n }\n input.value = ''\n }\n\n private _triggerImageUpload() {\n const input = this.shadowRoot?.querySelector<HTMLInputElement>('.image-input')\n input?.click()\n }\n\n private _insertTableByClick(rows: number, cols: number) {\n if (this._hasSlashCommand && this._editor) {\n const { selection } = this._editor.state\n this._editor.chain().focus().deleteRange({ from: selection.from - 1, to: selection.from }).run()\n this._hasSlashCommand = false\n }\n this._tableRows = rows\n this._tableCols = cols\n this._insertTable(rows, cols)\n }\n\n private _showTableCellToolbar() {\n if (!this._editor?.isActive('table')) { return }\n const { state } = this._editor\n const { selection } = state\n const coords = this._editor.view.coordsAtPos(selection.from)\n const editorWrapper = this.shadowRoot?.querySelector<HTMLElement>('.editor-wrapper')\n if (!editorWrapper) { return }\n const wrapperRect = editorWrapper.getBoundingClientRect()\n\n const cellRow = this._getTableCellRow()\n const cellCol = this._getTableCellCol()\n const isTopRow = cellRow === 0\n const isLeftCol = cellCol === 0\n\n // Only show toolbar on top row or left column\n if (!isTopRow && !isLeftCol) { return }\n\n requestAnimationFrame(() => {\n this._tableCellToolbar = {\n x: coords.left - wrapperRect.left,\n y: coords.bottom - wrapperRect.top + 8,\n visible: true,\n cellRow,\n cellCol,\n }\n })\n }\n\n private _getTableCellRow(): number {\n if (!this._editor) { return 0 }\n const { selection } = this._editor.state\n const $pos = this._editor.state.doc.resolve(selection.from)\n for (let d = $pos.depth; d > 0; d--) {\n const node = $pos.node(d)\n if (node.type.name === 'tableCell') {\n return $pos.index(d - 1)\n }\n }\n return 0\n }\n\n private _getTableCellCol(): number {\n if (!this._editor) { return 0 }\n const { selection } = this._editor.state\n const $pos = this._editor.state.doc.resolve(selection.from)\n for (let d = $pos.depth; d > 0; d--) {\n const node = $pos.node(d)\n if (node.type.name === 'tableCell') {\n return $pos.index(d)\n }\n }\n return 0\n }\n\n private _hideTableCellToolbar() {\n requestAnimationFrame(() => {\n this._tableCellToolbar = { ...this._tableCellToolbar, visible: false }\n })\n }\n\n private _addTableRowAbove() {\n this._editor?.chain().focus().addRowBefore().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableRowBelow() {\n this._editor?.chain().focus().addRowAfter().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableColumnLeft() {\n this._editor?.chain().focus().addColumnBefore().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableColumnRight() {\n this._editor?.chain().focus().addColumnAfter().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTableRow() {\n this._editor?.chain().focus().deleteRow().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTableColumn() {\n this._editor?.chain().focus().deleteColumn().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTable() {\n this._editor?.chain().focus().deleteTable().run()\n this._hideTableCellToolbar()\n }\n\n // Image Toolbar Methods\n private _showImageToolbar(pos: { x: number, y: number }) {\n requestAnimationFrame(() => {\n this._imageToolbar = { x: pos.x, y: pos.y, visible: true }\n this._imageMoreMenuVisible = false\n })\n }\n\n private _hideImageToolbar() {\n requestAnimationFrame(() => {\n this._imageToolbar = { ...this._imageToolbar, visible: false }\n this._imageMoreMenuVisible = false\n })\n }\n\n private _toggleImageMoreMenu() {\n this._imageMoreMenuVisible = !this._imageMoreMenuVisible\n }\n\n private _deleteImage() {\n this._editor?.chain().focus().deleteNode('image').run()\n this._hideImageToolbar()\n }\n\n private _insertImageAfter() {\n this._triggerImageUpload()\n this._imageMoreMenuVisible = false\n }\n\n private _setImageAlignLeft() {\n const editor = this._editor\n if (editor) {\n const { selection } = editor.state\n const pos = selection.from\n editor.chain().focus().setNodeSelection(pos).run()\n const img = this.shadowRoot?.querySelector('.ProseMirror img.ProseMirror-selectednode') as HTMLElement\n if (img) {\n img.style.display = 'block'\n img.style.margin = '0 auto 0 0'\n }\n }\n this._imageMoreMenuVisible = false\n }\n\n private _setImageAlignCenter() {\n const editor = this._editor\n if (editor) {\n const { selection } = editor.state\n const pos = selection.from\n editor.chain().focus().setNodeSelection(pos).run()\n const img = this.shadowRoot?.querySelector('.ProseMirror img.ProseMirror-selectednode') as HTMLElement\n if (img) {\n img.style.display = 'block'\n img.style.margin = '0 auto'\n }\n }\n this._imageMoreMenuVisible = false\n }\n\n private _setImageAlignRight() {\n const editor = this._editor\n if (editor) {\n const { selection } = editor.state\n const pos = selection.from\n editor.chain().focus().setNodeSelection(pos).run()\n const img = this.shadowRoot?.querySelector('.ProseMirror img.ProseMirror-selectednode') as HTMLElement\n if (img) {\n img.style.display = 'block'\n img.style.margin = '0 0 0 auto'\n }\n }\n this._imageMoreMenuVisible = false\n }\n\n private _getTextLabel(): string {\n const editor = this._editor\n if (!editor) { return '正文' }\n if (editor.isActive('heading', { level: 1 })) { return '标题 1' }\n if (editor.isActive('heading', { level: 2 })) { return '标题 2' }\n if (editor.isActive('heading', { level: 3 })) { return '标题 3' }\n return '正文'\n }\n\n private _getAlignLabel(): string {\n const editor = this._editor\n if (!editor) { return '对齐' }\n if (editor.isActive({ textAlign: 'center' })) { return '居中' }\n if (editor.isActive({ textAlign: 'right' })) { return '右对齐' }\n return '左对齐'\n }\n\n private _updateBubbleMenuPosition() {\n requestAnimationFrame(() => {\n const bubbleMenu = this.shadowRoot?.querySelector<HTMLElement>('.bubble-menu')\n const proseMirror = this.shadowRoot?.querySelector<HTMLElement>('.ProseMirror')\n const editorWrapper = this.shadowRoot?.querySelector<HTMLElement>('.editor-wrapper')\n if (!bubbleMenu || !proseMirror || !editorWrapper) { return }\n\n const editor = this._editor\n const isInTable = editor?.isActive('table') ?? false\n const { selection } = editor?.state ?? { selection: null }\n\n // 如果选中了表格节点(而不只是单元格内的文字),隐藏菜单\n if (isInTable && selection && !selection.empty && editor) {\n const { from, to } = selection\n const $from = editor.state.doc.resolve(from)\n const $to = editor.state.doc.resolve(to)\n // 检查选区起点和终点之间是否有表格节点\n let hasTableInSelection = false\n for (let d = $from.depth; d >= 0; d--) {\n if ($from.node(d).type.name === 'table') {\n hasTableInSelection = true\n break\n }\n }\n // 如果选区起点在表格外但终点在表格内,或者选区跨越了表格\n const fromAncestor = $from.node($from.depth)\n const toAncestor = $to.node($to.depth)\n if (fromAncestor.type.name === 'table' || toAncestor.type.name === 'table') {\n hasTableInSelection = true\n }\n if (hasTableInSelection) {\n bubbleMenu.style.opacity = '0'\n bubbleMenu.style.visibility = 'hidden'\n return\n }\n }\n\n // 如果有选中文字,显示菜单\n if (selection && !selection.empty) {\n // continue to show menu\n }\n else if (!selection || (selection.empty && !this._hasSlashCommand)) {\n bubbleMenu.style.opacity = '0'\n bubbleMenu.style.visibility = 'hidden'\n return\n }\n\n const wrapperRect = editorWrapper.getBoundingClientRect()\n const menuRect = bubbleMenu.getBoundingClientRect()\n\n const { from } = selection!\n const coords = this._editor?.view.coordsAtPos(from)\n if (!coords) { return }\n\n let left = coords.left - wrapperRect.left\n let top = coords.top - wrapperRect.top - 40\n\n if (left + menuRect.width > wrapperRect.width) {\n left = wrapperRect.width - menuRect.width - 8\n }\n if (left < 0) {\n left = 8\n }\n\n if (top < 0) {\n top = coords.bottom - wrapperRect.top + 8\n }\n\n bubbleMenu.style.left = `${left}px`\n bubbleMenu.style.top = `${top}px`\n bubbleMenu.style.opacity = '1'\n bubbleMenu.style.visibility = 'visible'\n })\n }\n\n render() {\n const editor = this._editor\n\n return html`\n <div class=\"editor-wrapper ${!editor ? 'loading' : ''} ${this._previewValue ? 'preview' : ''}\">\n ${!editor\n ? html`\n <div class=\"loading-placeholder\">\n <div class=\"loading-spinner\"></div>\n <span>编辑器加载中...</span>\n </div>\n `\n : ''}\n <input\n type=\"file\"\n accept=\"image/*\"\n class=\"image-input\"\n @change=${this._handleImageUpload}\n />\n\n <!-- Bubble Menu (悬浮操作栏) -->\n ${!this._previewValue\n ? html`\n <div class=\"bubble-menu\">\n <!-- 文本格式 -->\n <button\n class=\"bubble-btn ${editor?.isActive('bold') ? 'is-active' : ''}\"\n @click=${this._toggleBold}\n title=\"加粗\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/><path d=\"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('italic') ? 'is-active' : ''}\"\n @click=${this._toggleItalic}\n title=\"斜体\"\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\"/><line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\"/><line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('underline') ? 'is-active' : ''}\"\n @click=${this._toggleUnderline}\n title=\"下划线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3\"/><line x1=\"4\" y1=\"21\" x2=\"20\" y2=\"21\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('strike') ? 'is-active' : ''}\"\n @click=${this._toggleStrike}\n title=\"删除线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 5.3 3.9h.2m8.2 3.2c.3.4.4.8.4 1.3 0 2.9-2.7 3.6-6.2 3.6-2.3 0-4.4-.3-6.2-.9M4 12h16\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 文本类型下拉 -->\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getTextLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button\n class=\"bubble-dropdown-item ${!editor?.isActive('heading') ? 'is-active' : ''}\"\n @click=${this._setParagraph}\n >\n 正文\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 1 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(1)}\n >\n 标题 1\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 2 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(2)}\n >\n 标题 2\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 3 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(3)}\n >\n 标题 3\n </button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 对齐下拉 -->\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getAlignLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'left' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('left')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"18\" y2=\"18\"/></svg>\n 左对齐\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'center' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('center')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>\n 居中\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'right' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('right')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"6\" y1=\"18\" x2=\"21\" y2=\"18\"/></svg>\n 右对齐\n </button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 行内代码 -->\n <button\n class=\"bubble-btn ${editor?.isActive('code') ? 'is-active' : ''}\"\n @click=${this._toggleCode}\n title=\"行内代码\"\n >\n <svg viewBox=\"0 0 24 24\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>\n </button>\n\n <!-- 链接 -->\n <button\n class=\"bubble-btn ${editor?.isActive('link') ? 'is-active' : ''}\"\n @click=${this._setLink}\n title=\"链接\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/></svg>\n </button>\n\n <!-- 图片 -->\n <button\n class=\"bubble-btn\"\n @click=${this._triggerImageUpload}\n title=\"图片\"\n >\n <svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/><polyline points=\"21 15 16 10 5 21\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 列表 -->\n <button\n class=\"bubble-btn ${editor?.isActive('bulletList') ? 'is-active' : ''}\"\n @click=${this._toggleBulletList}\n title=\"无序列表\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"9\" y1=\"6\" x2=\"20\" y2=\"6\"/>\n <line x1=\"9\" y1=\"12\" x2=\"20\" y2=\"12\"/>\n <line x1=\"9\" y1=\"18\" x2=\"20\" y2=\"18\"/>\n <circle cx=\"4\" cy=\"6\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"12\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"18\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n </svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('orderedList') ? 'is-active' : ''}\"\n @click=${this._toggleOrderedList}\n title=\"有序列表\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\"/>\n <line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\"/>\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\"/>\n <path d=\"M4 6h1v4\"/>\n <path d=\"M4 10h2\"/>\n <path d=\"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1.5\"/>\n </svg>\n </button>\n\n <!-- 引用 -->\n <button\n class=\"bubble-btn ${editor?.isActive('blockquote') ? 'is-active' : ''}\"\n @click=${this._toggleBlockquote}\n title=\"引用\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z\"/><path d=\"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 表格下拉 -->\n <div\n class=\"bubble-dropdown ${this._tableDropdownOpen ? 'is-open' : ''}\"\n @mouseenter=${() => {\n this._tableDropdownOpen = true\n this._hoverRow = 0\n this._hoverCol = 0\n }}\n @mouseleave=${() => this._tableDropdownOpen = false}\n >\n <button class=\"bubble-dropdown-btn\" title=\"表格\">\n <svg viewBox=\"0 0 24 24\" style=\"width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\"/><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\"/><line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\"/><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <div class=\"table-grid-preview\">\n ${this._renderTableGrid()}\n </div>\n <div class=\"table-size-hint\">\n <span>${this._hoverRow > 0 ? `${this._hoverRow} × ${this._hoverCol}` : `${this._tableRows} × ${this._tableCols}`}</span>\n </div>\n </div>\n </div>\n </div>\n `\n : ''}\n\n <div class=\"editor-content\"></div>\n\n <!-- Table Cell Toolbar -->\n ${this._tableCellToolbar.visible && editor?.isActive('table')\n ? html`\n <div\n class=\"table-cell-toolbar\"\n style=\"left: ${this._tableCellToolbar.x}px; top: ${this._tableCellToolbar.y}px;\"\n @mousedown=${(e: Event) => e.preventDefault()}\n >\n ${this._tableCellToolbar.cellRow === 0\n ? html`\n <button class=\"table-cell-toolbar-btn\" title=\"上方添加行\" @click=${this._addTableRowAbove}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"7\"/><line x1=\"10\" y1=\"5\" x2=\"14\" y2=\"5\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn\" title=\"下方添加行\" @click=${this._addTableRowBelow}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"17\"/><line x1=\"10\" y1=\"19\" x2=\"14\" y2=\"19\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除行\" @click=${this._deleteTableRow}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"9\" y1=\"10\" x2=\"9\" y2=\"14\"/><line x1=\"15\" y1=\"10\" x2=\"15\" y2=\"14\"/></svg>\n </button>\n `\n : ''}\n ${this._tableCellToolbar.cellCol === 0\n ? html`\n ${this._tableCellToolbar.cellRow !== 0 ? html`<div style=\"width:1px;height:20px;background:#e3e3e3;margin:0 4px;\"></div>` : ''}\n <button class=\"table-cell-toolbar-btn\" title=\"左侧添加列\" @click=${this._addTableColumnLeft}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"3\" y1=\"12\" x2=\"7\" y2=\"12\"/><line x1=\"5\" y1=\"10\" x2=\"5\" y2=\"14\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn\" title=\"右侧添加列\" @click=${this._addTableColumnRight}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"21\" y1=\"12\" x2=\"17\" y2=\"12\"/><line x1=\"19\" y1=\"10\" x2=\"19\" y2=\"14\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除列\" @click=${this._deleteTableColumn}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"10\" y1=\"9\" x2=\"14\" y2=\"9\"/><line x1=\"10\" y1=\"15\" x2=\"14\" y2=\"15\"/></svg>\n </button>\n `\n : ''}\n ${this._tableCellToolbar.cellRow === 0 && this._tableCellToolbar.cellCol === 0\n ? html`\n <div style=\"width:1px;height:20px;background:#e3e3e3;margin:0 4px;\"></div>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除表格\" @click=${this._deleteTable}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/></svg>\n </button>\n `\n : ''}\n </div>\n `\n : ''}\n\n <!-- Image Toolbar -->\n ${this._imageToolbar.visible\n ? html`\n <div\n class=\"image-toolbar\"\n style=\"left: ${this._imageToolbar.x}px; top: ${this._imageToolbar.y}px;\"\n @mousedown=${(e: Event) => e.preventDefault()}\n >\n <button class=\"image-toolbar-btn danger\" title=\"删除图片\" @click=${this._deleteImage}>\n <svg viewBox=\"0 0 24 24\"><polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/></svg>\n </button>\n <button class=\"image-toolbar-btn\" title=\"添加图片\" @click=${this._insertImageAfter}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>\n </button>\n <div class=\"image-toolbar-divider\"></div>\n <div style=\"position: relative;\">\n <button class=\"image-toolbar-btn\" title=\"更多\" @click=${this._toggleImageMoreMenu}>\n <svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"1\"/><circle cx=\"19\" cy=\"12\" r=\"1\"/><circle cx=\"5\" cy=\"12\" r=\"1\"/></svg>\n </button>\n ${this._imageMoreMenuVisible\n ? html`\n <div class=\"image-more-menu\">\n <button class=\"image-more-menu-item\" @click=${this._setImageAlignLeft}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"18\" y2=\"18\"/></svg>\n 左对齐\n </button>\n <button class=\"image-more-menu-item\" @click=${this._setImageAlignCenter}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>\n 居中\n </button>\n <button class=\"image-more-menu-item\" @click=${this._setImageAlignRight}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"6\" y1=\"18\" x2=\"21\" y2=\"18\"/></svg>\n 右对齐\n </button>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n </div>\n `\n }\n\n private _renderTableGrid() {\n const cells = []\n for (let i = 0; i < 100; i++) {\n const row = Math.floor(i / 10) + 1\n const col = (i % 10) + 1\n const isHighlight = this._hoverRow > 0 && row <= this._hoverRow && col <= this._hoverCol\n cells.push(html`\n <div\n class=\"table-cell ${isHighlight ? 'selected' : ''}\"\n @click=${() => {\n this._insertTableByClick(row, col)\n this._tableDropdownOpen = false\n }}\n @mouseenter=${() => {\n this._hoverRow = row\n this._hoverCol = col\n }}\n @mouseleave=${() => {\n this._hoverRow = 0\n this._hoverCol = 0\n }}\n ></div>\n `)\n }\n return cells\n }\n}\n\nexport function register() {}\n"],"names":["QxsBlocksuiteEditor","LitElement","constructor","super","arguments","this","content","placeholder","readonly","preview","_injectedStyleEl","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_editor","_pendingContent","_tableRows","_tableCols","_hoverRow","_hoverCol","_tableDropdownOpen","_tableCellToolbar","x","y","visible","cellRow","cellCol","_imageToolbar","_imageMoreMenuVisible","_hasSlashCommand","_isUpdating","_tableEdgeDetectionSetup","_injectCustomStyles","shadow","shadowRoot","remove","styleEl","document","createElement","textContent","appendChild","_useModelValue","hasAttribute","_readonlyValue","_previewValue","_initEditor","el","querySelector","requestAnimationFrame","firstChild","removeChild","useModel","modelValue","getAttribute","contentValue","initialContent","extensions","Document","Paragraph","Text","Bold","Italic","Underline","Strike","Code","Heading","configure","levels","BulletList","OrderedList","ListItem","Blockquote","HorizontalRule","History","Image","inline","allowBase64","Link","openOnClick","HTMLAttributes","rel","TextAlign","types","Table","resizable","TableRow","TableCell","TableHeader","Placeholder","Extension","create","name","addKeyboardShortcuts","Enter","editor","chain","focus","unsetAllMarks","clearNodes","run","Editor","element","editable","on","_updateBubbleMenuPosition","isActive","_showTableCellToolbar","_hideTableCellToolbar","selection","state","$from","node","depth","type","coords","view","coordsAtPos","start","wrapperRect","getBoundingClientRect","left","right","top","_showImageToolbar","_hideImageToolbar","_checkSlashCommand","_setupTableEdgeDetection","_emitContentChange","html","getHTML","dispatchEvent","CustomEvent","detail","bubbles","composed","editorContent","editorWrapper","handleEditorClick","addEventListener","textBefore","doc","textBetween","Math","max","from","endsWith","firstUpdated","updated","changed","has","newContent","commands","setContent","setEditable","disconnectedCallback","destroy","getContent","forceUpdate","requestUpdate","_applyFormat","command","deleteRange","to","_toggleBold","toggleBold","_toggleItalic","toggleItalic","_toggleUnderline","toggleUnderline","_toggleStrike","toggleStrike","_toggleCode","toggleCode","_setHeading","level","toggleHeading","_setParagraph","setParagraph","_toggleBulletList","toggleBulletList","_toggleOrderedList","toggleOrderedList","_toggleBlockquote","toggleBlockquote","_setTextAlign","align","setTextAlign","_setLink","url","window","prompt","setLink","href","_insertTable","rows","cols","insertTable","withHeaderRow","_handleImageUpload","input","files","src","setImage","err","value","_triggerImageUpload","click","_insertTableByClick","_getTableCellRow","_getTableCellCol","bottom","$pos","d","index","_addTableRowAbove","addRowBefore","_addTableRowBelow","addRowAfter","_addTableColumnLeft","addColumnBefore","_addTableColumnRight","addColumnAfter","_deleteTableRow","deleteRow","_deleteTableColumn","deleteColumn","_deleteTable","deleteTable","pos","_toggleImageMoreMenu","_deleteImage","deleteNode","_insertImageAfter","_setImageAlignLeft","setNodeSelection","img","style","display","margin","_setImageAlignCenter","_setImageAlignRight","_getTextLabel","_getAlignLabel","textAlign","bubbleMenu","proseMirror","isInTable","empty","$to","hasTableInSelection","fromAncestor","toAncestor","opacity","visibility","menuRect","width","render","_renderTableGrid","preventDefault","cells","i","row","floor","col","isHighlight","push","styles","css","__decorateClass","property","String","attribute","prototype","Object","safeCustomElement"],"mappings":"k5CA6BO,IAAMA,EAAN,cAAkCC,EAAlCC,WAAAA,GAAAC,SAAAC,WAslBLC,KAAAC,QAAU,GAGVD,KAAA,eAAgB,GAGhBA,KAAAE,YAAc,cAGdF,KAAA,aAAc,QAGdA,KAAAG,SAAW,QAGXH,KAAAI,QAAU,QAGVJ,KAAA,iBAAkB,GAElBA,KAAQK,iBAA4C,KAgCpDL,KAAA,gBAAkDM,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAIhBlB,KAAQmB,QAAyB,KACjCnB,KAAQoB,gBAAiC,KAClDpB,KAAQqB,WAAa,EACrBrB,KAAQsB,WAAa,EACZtB,KAAQuB,UAAY,EACpBvB,KAAQwB,UAAY,EACpBxB,KAAQyB,oBAAqB,EAC7BzB,KAAQ0B,kBAAkG,CAAEC,EAAG,EAAGC,EAAG,EAAGC,SAAS,EAAOC,QAAS,EAAGC,QAAS,GAC7J/B,KAAQgC,cAA4D,CAAEL,EAAG,EAAGC,EAAG,EAAGC,SAAS,GAC3F7B,KAAQiC,uBAAwB,EACzCjC,KAAQkC,kBAAmB,EAC3BlC,KAAQmC,aAAc,EAgItBnC,KAAQoC,0BAA2B,CAAA,CAlL3BC,mBAAAA,GACN,MAAMC,EAAStC,KAAKuC,WACpB,IAAKD,EAAU,OAOf,GALItC,KAAKK,mBACPL,KAAKK,iBAAiBmC,SACtBxC,KAAKK,iBAAmB,OAGrBL,KAAK,iBAAoB,OAE9B,MA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AAS,CAAE5J,KAAM6J,OAAQC,UAAW,aApmB1BzR,EAqmBX0R,UAAA,UAAA,GAGAJ,EAAA,CADCC,EAAS,CAAE5J,KAAM6J,OAAQC,UAAW,mBAvmB1BzR,EAwmBX0R,UAAA,gBAAA,GAkCAJ,EAAA,CADCC,EAAS,CAAE5J,KAAMgK,OAAQF,UAAW,kBAzoB1BzR,EA0oBX0R,UAAA,eAAA,GASiBJ,EAAA,CAAhB/J,KAnpBUvH,EAmpBM0R,UAAA,UAAA,GACAJ,EAAA,CAAhB/J,KAppBUvH,EAopBM0R,UAAA,kBAAA,GAGAJ,EAAA,CAAhB/J,KAvpBUvH,EAupBM0R,UAAA,YAAA,GACAJ,EAAA,CAAhB/J,KAxpBUvH,EAwpBM0R,UAAA,YAAA,GACAJ,EAAA,CAAhB/J,KAzpBUvH,EAypBM0R,UAAA,qBAAA,GACAJ,EAAA,CAAhB/J,KA1pBUvH,EA0pBM0R,UAAA,oBAAA,GACAJ,EAAA,CAAhB/J,KA3pBUvH,EA2pBM0R,UAAA,gBAAA,GACAJ,EAAA,CAAhB/J,KA5pBUvH,EA4pBM0R,UAAA,wBAAA,GA5pBN1R,EAANsR,EAAA,CADNM,EAAkB,0BACN5R"}
|
|
1
|
+
{"version":3,"file":"blocksuite-editor.mjs","sources":["../../../../packages/components-wc/src/editor/blocksuite-editor.ts"],"sourcesContent":["import { Editor, Extension, mergeAttributes, Node as TiptapNode } from '@tiptap/core'\nimport Blockquote from '@tiptap/extension-blockquote'\nimport Bold from '@tiptap/extension-bold'\nimport BulletList from '@tiptap/extension-bullet-list'\nimport Code from '@tiptap/extension-code'\nimport Document from '@tiptap/extension-document'\nimport Heading from '@tiptap/extension-heading'\nimport History from '@tiptap/extension-history'\nimport HorizontalRule from '@tiptap/extension-horizontal-rule'\nimport Image from '@tiptap/extension-image'\nimport Italic from '@tiptap/extension-italic'\nimport Link from '@tiptap/extension-link'\nimport ListItem from '@tiptap/extension-list-item'\nimport OrderedList from '@tiptap/extension-ordered-list'\nimport Paragraph from '@tiptap/extension-paragraph'\nimport Placeholder from '@tiptap/extension-placeholder'\nimport Strike from '@tiptap/extension-strike'\nimport { Table } from '@tiptap/extension-table'\nimport { TableCell } from '@tiptap/extension-table-cell'\nimport { TableHeader } from '@tiptap/extension-table-header'\nimport { TableRow } from '@tiptap/extension-table-row'\nimport Text from '@tiptap/extension-text'\nimport TextAlign from '@tiptap/extension-text-align'\nimport Underline from '@tiptap/extension-underline'\nimport { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\ntype ToolbarMode = 'slash' | 'header'\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n toggleTaskList: () => ReturnType\n }\n }\n}\n\nconst DEFAULT_IMAGE_WIDTH = 560\nconst MIN_IMAGE_WIDTH = 24\nconst DEFAULT_HEADER_PLACEHOLDER = '输入内容'\nconst DEFAULT_SLASH_PLACEHOLDER = '输入 / 唤出快捷命令'\n\nconst TaskList = TiptapNode.create({\n name: 'taskList',\n group: 'block list',\n content: 'taskItem+',\n defining: true,\n\n parseHTML() {\n return [{ tag: 'ul[data-type=\"taskList\"]' }]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => commands.toggleList(this.name, 'taskItem'),\n }\n },\n})\n\nconst TaskItem = TiptapNode.create({\n name: 'taskItem',\n defining: true,\n content: 'paragraph block*',\n\n addAttributes() {\n return {\n checked: {\n default: false,\n parseHTML: element => element.getAttribute('data-checked') === 'true',\n renderHTML: attributes => ({ 'data-checked': String(Boolean(attributes.checked)) }),\n },\n }\n },\n\n parseHTML() {\n return [{ tag: 'li[data-type=\"taskItem\"]' }]\n },\n\n renderHTML({ HTMLAttributes }) {\n const checked = Boolean(HTMLAttributes.checked)\n\n return [\n 'li',\n mergeAttributes(HTMLAttributes, { 'data-type': 'taskItem' }),\n [\n 'label',\n { contenteditable: 'false' },\n ['input', { type: 'checkbox', checked: checked ? 'checked' : null }],\n ['span'],\n ],\n ['div', 0],\n ]\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\nconst ExtendedImage = Image.extend({\n addAttributes() {\n return {\n ...this.parent?.(),\n width: {\n default: null,\n parseHTML: (element) => {\n const attr = element.getAttribute('width')\n const value = Number(attr)\n return Number.isFinite(value) && value > 0 ? value : null\n },\n renderHTML: attributes => attributes.width ? { width: String(attributes.width) } : {},\n },\n align: {\n default: 'center',\n parseHTML: element => element.getAttribute('data-align') || 'center',\n renderHTML: attributes => attributes.align ? { 'data-align': String(attributes.align) } : {},\n },\n }\n },\n\n renderHTML({ HTMLAttributes }) {\n const width = Number(HTMLAttributes.width)\n\n const style = [\n 'max-width:100%',\n 'height:auto',\n Number.isFinite(width) && width > 0 ? `width:${width}px` : '',\n HTMLAttributes.style || '',\n ]\n .filter(Boolean)\n .join(';')\n\n return ['img', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { style })]\n },\n})\n\n@safeCustomElement('qxs-blocksuite-editor')\nexport class QxsBlocksuiteEditor extends LitElement {\n static styles = css`\n :host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;\n }\n\n .editor-wrapper {\n border: 1px solid #e3e3e3;\n border-radius: 12px;\n background: #fff;\n overflow: visible;\n position: relative;\n min-height: 80px;\n }\n\n .editor-wrapper:focus-within {\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .editor-wrapper.preview {\n border: none;\n border-radius: 0;\n background: transparent;\n }\n\n .editor-wrapper.preview .editor-content {\n padding: 8px 12px;\n min-height: unset;\n }\n\n .editor-header {\n max-height: 0;\n opacity: 0;\n overflow: hidden;\n padding: 0 16px;\n border-bottom: 1px solid transparent;\n transition:\n max-height 0.24s ease,\n opacity 0.18s ease,\n padding 0.24s ease,\n border-color 0.24s ease;\n }\n\n .editor-header.is-visible {\n max-height: 132px;\n opacity: 1;\n overflow: visible;\n padding: 10px 12px;\n border-bottom-color: #eef1f5;\n }\n\n .editor-header__inner {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n overflow: visible;\n }\n\n .editor-content {\n padding: 12px 16px;\n min-height: 80px;\n cursor: text;\n }\n\n .editor-content:empty::before {\n content: attr(data-empty-hint);\n color: #c0c0c0;\n pointer-events: none;\n display: block;\n padding-top: 28px;\n text-align: center;\n }\n\n .editor-content .ProseMirror:empty {\n min-height: 80px;\n }\n\n .ProseMirror p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: #c0c0c0;\n pointer-events: none;\n float: left;\n height: 0;\n }\n\n .ProseMirror p.is-empty:only-child::before,\n .ProseMirror p.is-empty:only-child > br:first-child + *::before {\n content: attr(data-placeholder);\n color: #c0c0c0;\n pointer-events: none;\n float: left;\n height: 0;\n }\n\n .editor-wrapper.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n background: #fafafa;\n }\n\n .loading-placeholder {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n color: #909399;\n font-size: 14px;\n }\n\n .loading-spinner {\n width: 24px;\n height: 24px;\n border: 2px solid #e3e3e3;\n border-top-color: var(--qxs-color-primary, #3D61E3);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .ProseMirror {\n outline: none;\n line-height: 1.7;\n color: #37352f;\n font-size: 15px;\n }\n\n .ProseMirror > * + * {\n margin-top: 0.5em;\n }\n\n .ProseMirror > *:first-child {\n margin-top: 0 !important;\n }\n\n .ProseMirror p {\n margin: 0;\n }\n\n .ProseMirror h1 {\n font-size: 1.875em;\n font-weight: 700;\n margin: 0 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror > h1:first-child {\n margin-top: 0 !important;\n line-height: 1.15;\n }\n\n .ProseMirror > p:first-child {\n margin-top: 0 !important;\n }\n\n .ProseMirror h2 {\n font-size: 1.5em;\n font-weight: 600;\n margin: 0.5em 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror h3 {\n font-size: 1.25em;\n font-weight: 600;\n margin: 0.5em 0 0.25em;\n line-height: 1.3;\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n padding-left: 1.5em;\n margin: 0;\n }\n\n .ProseMirror ul[data-type=\"taskList\"] {\n padding-left: 0;\n list-style: none;\n }\n\n .ProseMirror li[data-type=\"taskItem\"] {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n list-style: none;\n margin: 0.2em 0;\n }\n\n .ProseMirror li[data-type=\"taskItem\"] > label {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 28px;\n flex: 0 0 18px;\n cursor: pointer;\n user-select: none;\n }\n\n .ProseMirror li[data-type=\"taskItem\"] > label > input {\n width: 14px;\n height: 14px;\n margin: 0;\n cursor: pointer;\n }\n\n .ProseMirror li[data-type=\"taskItem\"] > label > span {\n display: none;\n }\n\n .ProseMirror li[data-type=\"taskItem\"] > div {\n flex: 1;\n min-width: 0;\n }\n\n .ProseMirror li[data-type=\"taskItem\"][data-checked=\"true\"] > div p {\n color: #8a8f98;\n text-decoration: line-through;\n }\n\n .ProseMirror li {\n margin: 0.1em 0;\n }\n\n .ProseMirror li::marker {\n color: #37352f;\n }\n\n .ProseMirror strong {\n font-weight: 700;\n }\n\n .ProseMirror em {\n font-style: italic;\n font-synthesis: none;\n transform: skewX(-12deg);\n display: inline-block;\n }\n\n .ProseMirror u {\n text-decoration: underline;\n }\n\n .ProseMirror s {\n text-decoration: line-through;\n color: #787774;\n }\n\n .ProseMirror code {\n background: rgba(135, 131, 120, 0.14);\n color: #eb5757;\n padding: 2px 4px;\n border-radius: 4px;\n font-family: 'SFMono-Regular', Menlo, Consolas, monospace;\n font-size: 85%;\n }\n\n .ProseMirror pre {\n background: #f6f6f7;\n border-radius: 8px;\n padding: 12px 16px;\n overflow-x: auto;\n }\n\n .ProseMirror pre code {\n background: none;\n padding: 0;\n color: #37352f;\n }\n\n .ProseMirror blockquote {\n border-left: 3px solid #e3e3e3;\n padding-left: 1em;\n margin: 0.75em 0;\n color: #787774;\n }\n\n .ProseMirror hr {\n border: none;\n border-top: 1px solid #e3e3e3;\n margin: 1.5em 0;\n }\n\n .ProseMirror img {\n max-width: 100%;\n height: auto;\n border-radius: 8px;\n }\n\n .ProseMirror img[data-align=\"left\"] {\n display: block !important;\n margin: 0 auto 0 0 !important;\n }\n\n .ProseMirror img[data-align=\"center\"] {\n display: block !important;\n margin: 0 auto !important;\n }\n\n .ProseMirror img[data-align=\"right\"] {\n display: block !important;\n margin: 0 0 0 auto !important;\n }\n\n .ProseMirror a {\n color: var(--qxs-color-primary, #3D61E3);\n text-decoration: underline;\n cursor: pointer;\n }\n\n .ProseMirror img.ProseMirror-selectednode {\n outline: 2px solid var(--qxs-color-primary, #3D61E3);\n }\n\n /* Table styles */\n .ProseMirror table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n border: 1px solid #e3e3e3;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .ProseMirror th,\n .ProseMirror td {\n border: 1px solid #e3e3e3;\n padding: 8px 12px;\n text-align: left;\n vertical-align: top;\n }\n\n .ProseMirror th {\n background: #fafafa;\n font-weight: 600;\n }\n\n .ProseMirror .selectedCell {\n background: rgba(30, 150, 252, 0.1);\n }\n\n /* Table Cell Toolbar */\n .table-cell-toolbar {\n position: absolute;\n z-index: 50;\n display: flex;\n gap: 2px;\n padding: 4px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n }\n\n .table-cell-toolbar-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n color: #606266;\n transition: all 0.15s;\n }\n\n .table-cell-toolbar-btn:hover {\n background: #ecf5ff;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .table-cell-toolbar-btn.danger:hover {\n background: #fef0f0;\n color: #f56c6c;\n }\n\n /* Bubble Menu */\n .bubble-menu {\n position: absolute;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 4px 6px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n z-index: 100;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.15s, visibility 0.15s, transform 0.15s;\n transform: translateY(4px);\n max-width: calc(100vw - 40px);\n }\n\n .bubble-menu.is-visible {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .bubble-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n transition: all 0.15s;\n position: relative;\n }\n\n .bubble-btn:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-btn.is-active {\n background: var(--qxs-color-primary, #3D61E3);\n color: #fff;\n }\n\n .bubble-btn.danger:hover {\n background: #fef0f0;\n color: #f56c6c;\n }\n\n .bubble-btn svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .bubble-divider {\n width: 1px;\n height: 16px;\n background: #e3e3e3;\n margin: 0 3px;\n }\n\n /* Dropdown */\n .bubble-dropdown {\n position: relative;\n }\n\n .bubble-dropdown-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 0 6px;\n height: 28px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n font-weight: 500;\n font-family: inherit;\n transition: all 0.15s;\n white-space: nowrap;\n }\n\n .bubble-dropdown-btn:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-dropdown-btn svg {\n width: 12px;\n height: 12px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .bubble-dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 4px;\n min-width: 120px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n padding: 4px;\n opacity: 0;\n visibility: hidden;\n transform: translateY(-4px);\n transition: all 0.15s;\n z-index: 101;\n }\n\n .bubble-dropdown:hover .bubble-dropdown-menu,\n .bubble-dropdown.is-open .bubble-dropdown-menu {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .bubble-dropdown-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 8px;\n border: none;\n background: transparent;\n color: #37352f;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n font-weight: 500;\n font-family: inherit;\n text-align: left;\n transition: all 0.15s;\n }\n\n .bubble-dropdown-item:hover {\n background: rgba(55, 53, 47, 0.08);\n }\n\n .bubble-dropdown-item.is-active {\n background: var(--qxs-color-primary, #3D61E3);\n color: #fff;\n }\n\n .bubble-dropdown-item svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .image-input {\n display: none;\n }\n\n .table-grid-preview {\n display: grid;\n grid-template-columns: repeat(10, 18px);\n gap: 2px;\n padding: 8px;\n }\n\n .table-grid-preview .table-cell {\n width: 18px;\n height: 18px;\n border: 1px solid #e3e3e3;\n border-radius: 2px;\n background: #fff;\n cursor: pointer;\n transition: all 0.1s;\n }\n\n .table-grid-preview .table-cell:hover {\n background: rgba(30, 150, 252, 0.3);\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .table-grid-preview .table-cell.selected {\n background: rgba(30, 150, 252, 0.15);\n border-color: rgba(30, 150, 252, 0.5);\n }\n\n .table-size-hint {\n text-align: center;\n padding: 4px 8px 6px;\n font-size: 10px;\n color: #8c8c8c;\n }\n\n .image-size-control {\n display: flex;\n align-items: center;\n gap: 6px;\n padding-left: 8px;\n margin-left: 2px;\n border-left: 1px solid #e3e3e3;\n white-space: nowrap;\n }\n\n .image-size-label {\n font-size: 12px;\n color: #7a7f88;\n }\n\n .image-size-range {\n width: 72px;\n height: 26px;\n padding: 0 8px;\n border: 1px solid #d8dde6;\n border-radius: 6px;\n font-size: 12px;\n color: #37352f;\n background: #fff;\n outline: none;\n }\n\n .image-size-range:focus {\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .link-editor {\n position: absolute;\n z-index: 120;\n display: grid;\n gap: 8px;\n min-width: 320px;\n padding: 10px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 10px;\n box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);\n }\n\n .link-editor__field {\n display: grid;\n gap: 4px;\n }\n\n .link-editor__label {\n font-size: 12px;\n color: #6b7280;\n line-height: 1;\n }\n\n .link-editor__input {\n min-width: 0;\n height: 32px;\n padding: 0 10px;\n border: 1px solid #d8dde6;\n border-radius: 8px;\n outline: none;\n font-size: 13px;\n color: #37352f;\n background: #fff;\n }\n\n .link-editor__input:focus {\n border-color: var(--qxs-color-primary, #3D61E3);\n }\n\n .link-editor__actions {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .link-editor__action {\n height: 32px;\n padding: 0 12px;\n border: 1px solid #d8dde6;\n border-radius: 8px;\n background: #fff;\n color: #4b5563;\n font-size: 12px;\n font-family: inherit;\n cursor: pointer;\n transition: all 0.15s ease;\n white-space: nowrap;\n }\n\n .link-editor__action:hover {\n border-color: #c3cad5;\n background: #f8fafc;\n }\n\n .link-editor__action.primary {\n border-color: var(--qxs-color-primary, #3D61E3);\n background: var(--qxs-color-primary, #3D61E3);\n color: #fff;\n }\n\n .link-editor__action.danger {\n color: #f56c6c;\n }\n\n /* Image Toolbar */\n .image-toolbar {\n position: absolute;\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 4px 6px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n z-index: 100;\n transform: translateX(-50%);\n }\n\n .image-toolbar-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n background: transparent;\n border-radius: 4px;\n cursor: pointer;\n color: #595959;\n transition: all 0.15s;\n }\n\n .image-toolbar-btn:hover {\n background: #f5f5f5;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .image-toolbar-btn.danger:hover {\n background: #fff1f0;\n color: #ff4d4f;\n }\n\n .image-toolbar-btn svg {\n width: 16px;\n height: 16px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n .image-toolbar-divider {\n width: 1px;\n height: 20px;\n background: #e3e3e3;\n margin: 0 4px;\n }\n\n /* Image More Menu */\n .image-more-menu {\n position: absolute;\n top: 100%;\n right: 0;\n margin-top: 4px;\n padding: 4px;\n background: #fff;\n border: 1px solid #e3e3e3;\n border-radius: 6px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n z-index: 101;\n min-width: 120px;\n }\n\n .image-more-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border: none;\n background: transparent;\n width: 100%;\n text-align: left;\n font-size: 13px;\n color: #595959;\n border-radius: 4px;\n cursor: pointer;\n transition: all 0.15s;\n }\n\n .image-more-menu-item:hover {\n background: #f5f5f5;\n color: var(--qxs-color-primary, #3D61E3);\n }\n\n .image-more-menu-item svg {\n width: 14px;\n height: 14px;\n stroke: currentColor;\n stroke-width: 2;\n fill: none;\n }\n\n /* Selected Image */\n .ProseMirror img.selected {\n outline: 2px solid var(--qxs-color-primary, #3D61E3);\n outline-offset: 2px;\n }\n `\n\n @property({ type: String, attribute: 'content' })\n content = ''\n\n @property({ type: String, attribute: 'model-value' })\n 'model-value' = ''\n\n @property({ type: String, attribute: 'placeholder' })\n placeholder = DEFAULT_HEADER_PLACEHOLDER\n\n @property({ type: String, attribute: 'toolbar-mode' })\n 'toolbar-mode': ToolbarMode = 'header'\n\n @property({ type: String, attribute: 'header-always-visible' })\n 'header-always-visible' = 'false'\n\n @property({ type: String, attribute: 'use-model' })\n 'use-model' = 'false'\n\n @property({ type: String, attribute: 'readonly' })\n readonly = 'false'\n\n @property({ type: String, attribute: 'preview' })\n preview = 'false'\n\n @property({ type: String, attribute: 'custom-styles' })\n 'custom-styles' = ''\n\n private _injectedStyleEl: HTMLStyleElement | null = null\n\n private _injectCustomStyles() {\n const shadow = this.shadowRoot\n if (!shadow) { return }\n\n if (this._injectedStyleEl) {\n this._injectedStyleEl.remove()\n this._injectedStyleEl = null\n }\n\n if (!this['custom-styles']) { return }\n\n const styleEl = document.createElement('style')\n styleEl.textContent = this['custom-styles']\n shadow.appendChild(styleEl)\n this._injectedStyleEl = styleEl\n }\n\n private get _useModelValue(): boolean {\n return this['use-model'] === true || this['use-model'] === 'true' || this['use-model'] === '' || this.hasAttribute('use-model')\n }\n\n private get _readonlyValue(): boolean {\n return this.readonly !== false && this.readonly !== 'false'\n }\n\n private get _previewValue(): boolean {\n return this.preview !== false && this.preview !== 'false'\n }\n\n private get _isEditable(): boolean {\n return !this._readonlyValue && !this._previewValue\n }\n\n private get _toolbarModeValue(): ToolbarMode {\n return this['toolbar-mode'] === 'header' ? 'header' : 'slash'\n }\n\n private get _headerAlwaysVisibleValue(): boolean {\n return this['header-always-visible'] === true\n || this['header-always-visible'] === 'true'\n || this['header-always-visible'] === ''\n || this.hasAttribute('header-always-visible')\n }\n\n private get _resolvedPlaceholder(): string {\n if (\n this.placeholder\n && this.placeholder !== DEFAULT_HEADER_PLACEHOLDER\n && this.placeholder !== DEFAULT_SLASH_PLACEHOLDER\n ) {\n return this.placeholder\n }\n return this._toolbarModeValue === 'header'\n ? DEFAULT_HEADER_PLACEHOLDER\n : DEFAULT_SLASH_PLACEHOLDER\n }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @state() private _editor: Editor | null = null\n @state() private _pendingContent: string | null = null\n private _tableRows = 3\n private _tableCols = 3\n @state() private _hoverRow = 0\n @state() private _hoverCol = 0\n @state() private _tableDropdownOpen = false\n @state() private _tableCellToolbar: { x: number, y: number, visible: boolean, cellRow: number, cellCol: number } = { x: 0, y: 0, visible: false, cellRow: 0, cellCol: 0 }\n @state() private _imageToolbar: { x: number, y: number, visible: boolean } = { x: 0, y: 0, visible: false }\n @state() private _linkEditor = { x: 0, y: 0, visible: false, url: '', label: '' }\n @state() private _isEditorFocused = false\n @state() private _selectedImage: { pos: number, width: number, align: string } | null = null\n private _hasSlashCommand = false\n private _slashCommandRange: { from: number, to: number } | null = null\n private _isUpdating = false\n private _pendingImageInsertPos: number | null = null\n private _linkSelection: { from: number, to: number } | null = null\n private _preserveFocusOnInternalClick = false\n\n private _initEditor() {\n if (this._editor) { return }\n\n const el = this.shadowRoot?.querySelector<HTMLElement>('.editor-content')\n if (!el) {\n requestAnimationFrame(() => this._initEditor())\n return\n }\n\n while (el.firstChild) {\n el.removeChild(el.firstChild)\n }\n\n const useModel = this._useModelValue\n const modelValue = this.getAttribute('model-value') ?? this['model-value']\n const contentValue = this.content\n\n const initialContent = useModel\n ? (this._pendingContent ?? modelValue) || '<p></p>'\n : (this._pendingContent ?? contentValue) || '<p></p>'\n\n const extensions: any[] = [\n Document,\n Paragraph,\n Text,\n Bold,\n Italic,\n Underline,\n Strike,\n Code,\n Heading.configure({ levels: [1, 2, 3] }),\n BulletList,\n OrderedList,\n TaskList,\n TaskItem,\n ListItem,\n Blockquote,\n HorizontalRule,\n History,\n ExtendedImage.configure({\n inline: false,\n allowBase64: true,\n }),\n Link.extend({\n inclusive: false,\n }).configure({\n openOnClick: false,\n HTMLAttributes: {\n rel: 'noopener noreferrer',\n },\n }),\n TextAlign.configure({\n types: ['heading', 'paragraph'],\n }),\n Table.configure({\n resizable: true,\n }),\n TableRow,\n TableCell,\n TableHeader,\n Placeholder.configure({\n placeholder: this._resolvedPlaceholder,\n }),\n ]\n\n this._editor = new Editor({\n element: el,\n extensions,\n editable: this._isEditable,\n content: initialContent,\n })\n\n this._pendingContent = null\n\n this._editor.on('selectionUpdate', () => {\n if (this._toolbarModeValue === 'slash') {\n this._updateBubbleMenuPosition()\n }\n if (this._editor?.isActive('table')) {\n this._showTableCellToolbar()\n }\n else {\n this._hideTableCellToolbar()\n }\n this._syncImageSelectionState()\n })\n\n this._editor.on('transaction', () => {\n if (this._editor?.isActive('table')) {\n this._showTableCellToolbar()\n }\n else {\n this._hideTableCellToolbar()\n }\n this._checkSlashCommand()\n this._setupTableEdgeDetection()\n this._syncImageSelectionState()\n })\n\n this._editor.on('update', () => {\n this._emitContentChange()\n })\n }\n\n private _tableEdgeDetectionSetup = false\n\n private _toggleTaskItemChecked(event: MouseEvent) {\n const target = event.target\n const editor = this._editor\n if (!(target instanceof HTMLInputElement) || target.type !== 'checkbox' || !editor) {\n return\n }\n\n const taskItem = target.closest('li[data-type=\"taskItem\"]')\n if (!taskItem) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n const basePos = editor.view.posAtDOM(taskItem, 0)\n const searchFrom = Math.max(0, basePos - 2)\n const searchTo = Math.min(editor.state.doc.content.size, basePos + 2)\n\n let taskItemPos: number | null = null\n editor.state.doc.nodesBetween(searchFrom, searchTo, (node, pos) => {\n if (node.type.name === 'taskItem') {\n taskItemPos = pos\n return false\n }\n return undefined\n })\n\n if (taskItemPos === null) {\n return\n }\n\n const node = editor.state.doc.nodeAt(taskItemPos)\n if (!node || node.type.name !== 'taskItem') {\n return\n }\n\n editor.view.dispatch(editor.state.tr.setNodeMarkup(taskItemPos, undefined, {\n ...node.attrs,\n checked: !node.attrs.checked,\n }))\n }\n\n private _emitContentChange() {\n if (!this._editor) { return }\n const html = this._editor.getHTML()\n\n this.dispatchEvent(new CustomEvent('content-change', {\n detail: html,\n bubbles: true,\n composed: true,\n }))\n }\n\n private _setupTableEdgeDetection() {\n const editorContent = this.shadowRoot?.querySelector('.editor-content')\n const editorWrapper = this.shadowRoot?.querySelector('.editor-wrapper')\n if (!editorContent || this._tableEdgeDetectionSetup) { return }\n\n this._tableEdgeDetectionSetup = true\n\n const handleEditorClick = (event: MouseEvent) => {\n this._toggleTaskItemChecked(event)\n\n const target = event.target\n if (\n target instanceof Element\n && target.closest('.editor-header, .bubble-menu, .table-cell-toolbar, .image-toolbar, .link-editor')\n ) {\n return\n }\n if (!this._isEditable) {\n return\n }\n this._editor?.chain().focus().run()\n }\n\n editorContent.addEventListener('click', handleEditorClick)\n editorWrapper?.addEventListener('click', handleEditorClick)\n }\n\n private _handleWrapperFocusIn() {\n this._preserveFocusOnInternalClick = false\n this._isEditorFocused = true\n }\n\n private _handleWrapperMouseDown(event: MouseEvent) {\n const target = event.target\n if (\n !this._isEditable\n || !(target instanceof Element)\n || target.closest('.editor-header, .bubble-menu, .table-cell-toolbar, .image-toolbar, .link-editor')\n ) {\n return\n }\n\n this._preserveFocusOnInternalClick = true\n requestAnimationFrame(() => {\n this._preserveFocusOnInternalClick = false\n })\n }\n\n private _handleWrapperFocusOut(event: FocusEvent) {\n const nextTarget = event.relatedTarget as Node | null\n const wrapper = this.shadowRoot?.querySelector('.editor-wrapper')\n if (this._preserveFocusOnInternalClick) {\n return\n }\n if (nextTarget && wrapper?.contains(nextTarget)) {\n return\n }\n this._isEditorFocused = false\n this._tableDropdownOpen = false\n this._closeLinkEditor()\n }\n\n private _isHeaderVisible(): boolean {\n return this._toolbarModeValue === 'header'\n && !this._previewValue\n && (\n this._headerAlwaysVisibleValue\n || this._isEditorFocused\n || this._tableDropdownOpen\n || Boolean(this._selectedImage)\n )\n }\n\n private _getImageSelection() {\n const editor = this._editor\n const selection: any = editor?.state.selection\n if (!editor || !selection?.node || selection.node.type?.name !== 'image') {\n return null\n }\n\n return {\n pos: selection.from,\n attrs: selection.node.attrs ?? {},\n }\n }\n\n private _getImageMaxWidth() {\n const editorContent = this.shadowRoot?.querySelector<HTMLElement>('.editor-content')\n const availableWidth = (editorContent?.clientWidth ?? DEFAULT_IMAGE_WIDTH) - 32\n return Math.max(MIN_IMAGE_WIDTH, Math.min(DEFAULT_IMAGE_WIDTH, availableWidth))\n }\n\n private async _getImageNaturalWidth(file: File) {\n return await new Promise<number | null>((resolve) => {\n const objectUrl = URL.createObjectURL(file)\n const image = new window.Image()\n\n image.onload = () => {\n const naturalWidth = image.naturalWidth\n URL.revokeObjectURL(objectUrl)\n resolve(Number.isFinite(naturalWidth) && naturalWidth > 0 ? naturalWidth : null)\n }\n\n image.onerror = () => {\n URL.revokeObjectURL(objectUrl)\n resolve(null)\n }\n\n image.src = objectUrl\n })\n }\n\n private _syncImageSelectionState() {\n const selection = this._getImageSelection()\n if (!selection) {\n this._selectedImage = null\n if (this._toolbarModeValue === 'slash') {\n this._hideImageToolbar()\n }\n return\n }\n\n const width = Number(selection.attrs.width)\n const align = String(selection.attrs.align || 'center')\n this._selectedImage = {\n pos: selection.pos,\n width: Number.isFinite(width) && width > 0 ? width : this._getImageMaxWidth(),\n align,\n }\n\n if (this._toolbarModeValue !== 'slash') {\n this._hideImageToolbar()\n return\n }\n\n const editor = this._editor\n const wrapperRect = this.shadowRoot?.querySelector('.editor-wrapper')?.getBoundingClientRect()\n if (!editor || !wrapperRect) { return }\n const coords = editor.view.coordsAtPos(selection.pos)\n const x = coords.left - wrapperRect.left + (coords.right - coords.left) / 2\n const y = coords.top - wrapperRect.top - 40\n this._showImageToolbar({ x, y })\n }\n\n private _clearSlashCommandText() {\n if (!this._editor || !this._slashCommandRange) { return }\n const { from, to } = this._slashCommandRange\n this._editor.chain().focus().deleteRange({ from, to }).run()\n this._hasSlashCommand = false\n this._slashCommandRange = null\n }\n\n private _checkSlashCommand() {\n if (!this._editor) { return }\n const { selection } = this._editor.state\n if (!selection.empty) {\n this._hasSlashCommand = false\n this._slashCommandRange = null\n return\n }\n\n const { $from } = selection as any\n const textBefore = $from.parent.textBetween(0, $from.parentOffset, ' ', ' ')\n const matched = /(?:^|\\s)(\\/\\S*)$/.exec(textBefore)\n\n if (!matched) {\n this._hasSlashCommand = false\n this._slashCommandRange = null\n return\n }\n\n const slashText = matched[1]\n this._hasSlashCommand = true\n this._slashCommandRange = {\n from: selection.from - slashText.length,\n to: selection.from,\n }\n }\n\n firstUpdated() {\n this._injectCustomStyles()\n this._initEditor()\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('custom-styles')) {\n this._injectCustomStyles()\n }\n\n if (this._editor) {\n if (changed.has('content') || (changed.has('model-value') && this._useModelValue)) {\n const newContent = this._useModelValue ? this['model-value'] : this.content\n if (newContent !== this._editor.getHTML()) {\n this._editor.commands.setContent(newContent || '<p></p>')\n }\n }\n if (changed.has('readonly') || changed.has('preview')) {\n this._editor.setEditable(this._isEditable)\n }\n return\n }\n\n // 编辑器未初始化时,只保存待处理内容,不重复初始化\n if (changed.has('content')) {\n this._pendingContent = this.content\n }\n\n if (changed.has('model-value') && this._useModelValue) {\n this._pendingContent = this['model-value']\n }\n\n // 只有在 firstUpdated 时才会初始化编辑器\n // 这里不再重复调用 _initEditor()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._editor?.destroy()\n this._editor = null\n }\n\n getContent(): string {\n return this._editor?.getHTML() ?? ''\n }\n\n forceUpdate(): void {\n this.requestUpdate()\n if (this._editor) {\n const newContent = this._useModelValue ? this['model-value'] : this.content\n if (newContent !== this._editor.getHTML()) {\n this._editor.commands.setContent(newContent || '<p></p>')\n }\n }\n }\n\n private _applyFormat(command: () => void) {\n this._clearSlashCommandText()\n command()\n }\n\n private _getSlashCommandContext() {\n const editor = this._editor\n const range = this._slashCommandRange\n if (!editor || !range) { return null }\n\n const $from = editor.state.doc.resolve(range.from)\n return {\n lineFrom: $from.start(),\n lineTo: range.from,\n }\n }\n\n private _applySlashLineMark(\n applyMark: (chain: ReturnType<Editor['chain']>) => ReturnType<Editor['chain']>,\n clearMark: (chain: ReturnType<Editor['chain']>) => ReturnType<Editor['chain']>,\n ) {\n const editor = this._editor\n const context = this._getSlashCommandContext()\n if (!editor || !context) { return false }\n\n this._clearSlashCommandText()\n\n if (context.lineFrom < context.lineTo) {\n applyMark(\n editor.chain().focus().setTextSelection({ from: context.lineFrom, to: context.lineTo }),\n ).run()\n }\n\n clearMark(\n editor.chain().focus().setTextSelection({ from: context.lineTo, to: context.lineTo }),\n ).run()\n return true\n }\n\n private _applyToolbarLineMark(\n applyMark: (chain: ReturnType<Editor['chain']>) => ReturnType<Editor['chain']>,\n clearMark: (chain: ReturnType<Editor['chain']>) => ReturnType<Editor['chain']>,\n ) {\n const editor = this._editor\n if (!editor) { return false }\n\n const { selection } = editor.state\n const range = selection.empty\n ? (() => {\n const $from = editor.state.doc.resolve(selection.from)\n return { from: $from.start(), to: $from.end() }\n })()\n : { from: selection.from, to: selection.to }\n\n if (range.from >= range.to) {\n return false\n }\n\n applyMark(\n editor.chain().focus().setTextSelection(range),\n ).run()\n\n clearMark(\n editor.chain().focus().setTextSelection({ from: range.to, to: range.to }),\n ).run()\n\n return true\n }\n\n private _applySlashLineBlock(\n applyBlock: (chain: ReturnType<Editor['chain']>) => ReturnType<Editor['chain']>,\n ) {\n const editor = this._editor\n const context = this._getSlashCommandContext()\n if (!editor || !context) { return false }\n\n this._clearSlashCommandText()\n applyBlock(\n editor.chain().focus().setTextSelection({ from: context.lineFrom, to: context.lineTo }),\n ).run()\n return true\n }\n\n private _toggleBold() {\n if (this._applySlashLineMark(chain => chain.setBold(), chain => chain.unsetBold())) {\n return\n }\n this._applyToolbarLineMark(chain => chain.toggleBold(), chain => chain.unsetBold())\n }\n\n private _toggleItalic() {\n if (this._applySlashLineMark(chain => chain.setItalic(), chain => chain.unsetItalic())) {\n return\n }\n this._applyToolbarLineMark(chain => chain.toggleItalic(), chain => chain.unsetItalic())\n }\n\n private _toggleUnderline() {\n if (this._applySlashLineMark(chain => chain.setUnderline(), chain => chain.unsetUnderline())) {\n return\n }\n this._applyToolbarLineMark(chain => chain.toggleUnderline(), chain => chain.unsetUnderline())\n }\n\n private _toggleStrike() {\n if (this._applySlashLineMark(chain => chain.setStrike(), chain => chain.unsetStrike())) {\n return\n }\n this._applyToolbarLineMark(chain => chain.toggleStrike(), chain => chain.unsetStrike())\n }\n\n private _toggleCode() {\n if (this._applySlashLineMark(chain => chain.setCode(), chain => chain.unsetCode())) {\n return\n }\n this._applyToolbarLineMark(chain => chain.toggleCode(), chain => chain.unsetCode())\n }\n\n private _setHeading(level: number) {\n if (this._applySlashLineBlock(chain => chain.setHeading({ level: level as 1 | 2 | 3 | 4 | 5 | 6 }))) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().toggleHeading({ level: level as 1 | 2 | 3 | 4 | 5 | 6 }).run())\n }\n\n private _setParagraph() {\n if (this._applySlashLineBlock(chain => chain.setParagraph())) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().setParagraph().run())\n }\n\n private _toggleBulletList() {\n if (this._applySlashLineBlock(chain => chain.toggleBulletList())) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().toggleBulletList().run())\n }\n\n private _toggleOrderedList() {\n if (this._applySlashLineBlock(chain => chain.toggleOrderedList())) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().toggleOrderedList().run())\n }\n\n private _toggleTaskList() {\n if (this._applySlashLineBlock(chain => chain.toggleTaskList())) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().toggleTaskList().run())\n }\n\n private _toggleBlockquote() {\n if (this._applySlashLineBlock(chain => chain.toggleBlockquote())) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().toggleBlockquote().run())\n }\n\n private _setTextAlign(align: string) {\n if (this._applySlashLineBlock(chain => chain.setTextAlign(align as any))) {\n return\n }\n this._applyFormat(() => this._editor?.chain().focus().setTextAlign(align as any).run())\n }\n\n private _normalizeLinkUrl(url: string) {\n const trimmed = url.trim()\n if (!trimmed) { return '' }\n if (/^(https?:\\/\\/|mailto:|tel:|#|\\/)/i.test(trimmed)) {\n return trimmed\n }\n return `https://${trimmed}`\n }\n\n private _getLinkLabelFromRange(range: { from: number, to: number } | null) {\n const editor = this._editor\n if (!editor || !range || range.from >= range.to) {\n return ''\n }\n return editor.state.doc.textBetween(range.from, range.to, '')\n }\n\n private _getLinkTargetRange() {\n const editor = this._editor\n if (!editor) { return null }\n\n const { selection } = editor.state\n if (!selection.empty) {\n return { from: selection.from, to: selection.to }\n }\n\n if (editor.isActive('link')) {\n editor.chain().focus().extendMarkRange('link').run()\n return {\n from: editor.state.selection.from,\n to: editor.state.selection.to,\n }\n }\n\n const $from = editor.state.doc.resolve(selection.from)\n return {\n from: $from.start(),\n to: $from.end(),\n }\n }\n\n private _setLink(event: MouseEvent) {\n const editor = this._editor\n const wrapper = this.shadowRoot?.querySelector<HTMLElement>('.editor-wrapper')\n const trigger = event.currentTarget instanceof HTMLElement ? event.currentTarget : null\n if (!editor || !wrapper || !trigger) { return }\n\n const linkRange = this._getLinkTargetRange()\n this._linkSelection = linkRange\n\n const wrapperRect = wrapper.getBoundingClientRect()\n const triggerRect = trigger.getBoundingClientRect()\n const maxLeft = Math.max(12, wrapperRect.width - 332)\n const left = Math.min(Math.max(12, triggerRect.left - wrapperRect.left), maxLeft)\n const top = triggerRect.bottom - wrapperRect.top + 8\n const currentHref = String(editor.getAttributes('link').href || '')\n const currentLabel = this._getLinkLabelFromRange(linkRange)\n\n this._linkEditor = {\n x: left,\n y: top,\n visible: true,\n url: currentHref,\n label: currentLabel,\n }\n\n this.updateComplete.then(() => {\n const input = this.shadowRoot?.querySelector<HTMLInputElement>('.link-editor__input[data-field=\"url\"]')\n input?.focus()\n input?.select()\n })\n }\n\n private _closeLinkEditor() {\n this._linkEditor = { ...this._linkEditor, visible: false }\n }\n\n private _handleLinkEditorInput(event: Event) {\n const target = event.target as HTMLInputElement\n const field = target.dataset.field === 'label' ? 'label' : 'url'\n this._linkEditor = {\n ...this._linkEditor,\n [field]: target.value,\n }\n }\n\n private _applyLink() {\n const editor = this._editor\n const href = this._normalizeLinkUrl(this._linkEditor.url)\n const label = this._linkEditor.label.trim() || href\n if (!editor || !href) { return }\n\n this._clearSlashCommandText()\n\n const selection = this._linkSelection ?? this._getLinkTargetRange() ?? editor.state.selection\n const insertTo = selection.from + label.length\n\n editor\n .chain()\n .focus()\n .insertContentAt(\n { from: selection.from, to: selection.to },\n {\n type: 'text',\n text: label,\n marks: [{ type: 'link', attrs: { href } }],\n },\n )\n .setTextSelection({ from: insertTo, to: insertTo })\n .run()\n\n this._closeLinkEditor()\n }\n\n private _removeLink() {\n const editor = this._editor\n if (!editor) { return }\n\n const selection = this._linkSelection ?? editor.state.selection\n let chain = editor.chain().focus()\n if (selection.from !== selection.to) {\n chain = chain.setTextSelection(selection)\n }\n chain.extendMarkRange('link').unsetLink().run()\n this._closeLinkEditor()\n }\n\n private _handleLinkEditorKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter') {\n event.preventDefault()\n this._applyLink()\n return\n }\n if (event.key === 'Escape') {\n event.preventDefault()\n this._closeLinkEditor()\n }\n }\n\n private _insertTable(rows?: number, cols?: number) {\n this._editor?.chain().focus().insertTable({ rows: rows ?? this._tableRows, cols: cols ?? this._tableCols, withHeaderRow: true }).run()\n }\n\n private async _handleImageUpload(e: Event) {\n const input = e.target as HTMLInputElement\n const file = input.files?.[0]\n if (file) {\n try {\n const naturalWidth = await this._getImageNaturalWidth(file)\n const src = await this['upload-image'](file)\n const initialWidth = naturalWidth\n ? Math.min(naturalWidth, this._getImageMaxWidth())\n : this._getImageMaxWidth()\n\n this._clearSlashCommandText()\n const pendingInsertPos = this._pendingImageInsertPos\n this._pendingImageInsertPos = null\n\n if (pendingInsertPos !== null) {\n this._insertImageAt(pendingInsertPos, {\n src,\n width: initialWidth,\n align: 'center',\n })\n }\n else {\n this._editor?.chain().focus().setImage({\n src,\n width: initialWidth,\n align: 'center',\n }).run()\n }\n }\n catch (err) {\n console.error('图片上传失败:', err)\n }\n }\n input.value = ''\n }\n\n private _triggerImageUpload() {\n this._clearSlashCommandText()\n const input = this.shadowRoot?.querySelector<HTMLInputElement>('.image-input')\n input?.click()\n }\n\n private _insertTableByClick(rows: number, cols: number) {\n this._clearSlashCommandText()\n this._tableRows = rows\n this._tableCols = cols\n this._insertTable(rows, cols)\n }\n\n private _showTableCellToolbar() {\n if (!this._editor?.isActive('table')) { return }\n const { state } = this._editor\n const { selection } = state\n const coords = this._editor.view.coordsAtPos(selection.from)\n const editorWrapper = this.shadowRoot?.querySelector<HTMLElement>('.editor-wrapper')\n if (!editorWrapper) { return }\n const wrapperRect = editorWrapper.getBoundingClientRect()\n\n const cellRow = this._getTableCellRow()\n const cellCol = this._getTableCellCol()\n const isTopRow = cellRow === 0\n const isLeftCol = cellCol === 0\n\n // Only show toolbar on top row or left column\n if (!isTopRow && !isLeftCol) { return }\n\n requestAnimationFrame(() => {\n this._tableCellToolbar = {\n x: coords.left - wrapperRect.left,\n y: coords.bottom - wrapperRect.top + 8,\n visible: true,\n cellRow,\n cellCol,\n }\n })\n }\n\n private _getTableCellRow(): number {\n if (!this._editor) { return 0 }\n const { selection } = this._editor.state\n const $pos = this._editor.state.doc.resolve(selection.from)\n for (let d = $pos.depth; d > 0; d--) {\n const node = $pos.node(d)\n if (node.type.name === 'tableCell') {\n return $pos.index(d - 1)\n }\n }\n return 0\n }\n\n private _getTableCellCol(): number {\n if (!this._editor) { return 0 }\n const { selection } = this._editor.state\n const $pos = this._editor.state.doc.resolve(selection.from)\n for (let d = $pos.depth; d > 0; d--) {\n const node = $pos.node(d)\n if (node.type.name === 'tableCell') {\n return $pos.index(d)\n }\n }\n return 0\n }\n\n private _hideTableCellToolbar() {\n requestAnimationFrame(() => {\n this._tableCellToolbar = { ...this._tableCellToolbar, visible: false }\n })\n }\n\n private _addTableRowAbove() {\n this._editor?.chain().focus().addRowBefore().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableRowBelow() {\n this._editor?.chain().focus().addRowAfter().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableColumnLeft() {\n this._editor?.chain().focus().addColumnBefore().run()\n this._hideTableCellToolbar()\n }\n\n private _addTableColumnRight() {\n this._editor?.chain().focus().addColumnAfter().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTableRow() {\n this._editor?.chain().focus().deleteRow().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTableColumn() {\n this._editor?.chain().focus().deleteColumn().run()\n this._hideTableCellToolbar()\n }\n\n private _deleteTable() {\n this._editor?.chain().focus().deleteTable().run()\n this._hideTableCellToolbar()\n }\n\n // Image Toolbar Methods\n private _showImageToolbar(pos: { x: number, y: number }) {\n requestAnimationFrame(() => {\n this._imageToolbar = { x: pos.x, y: pos.y, visible: true }\n })\n }\n\n private _hideImageToolbar() {\n requestAnimationFrame(() => {\n this._imageToolbar = { ...this._imageToolbar, visible: false }\n })\n }\n\n private _deleteImage() {\n const selectedImage = this._getSelectedImageNode()\n if (!selectedImage) { return }\n\n const { editor, pos, node } = selectedImage\n editor.view.dispatch(editor.state.tr.delete(pos, pos + node.nodeSize))\n this._selectedImage = null\n this._pendingImageInsertPos = null\n this._hideImageToolbar()\n }\n\n private _insertImageAfter() {\n const selectedImage = this._getSelectedImageNode()\n if (!selectedImage) {\n this._triggerImageUpload()\n return\n }\n\n this._pendingImageInsertPos = selectedImage.pos + selectedImage.node.nodeSize\n this._triggerImageUpload()\n }\n\n private _getSelectedImageNode() {\n const editor = this._editor\n const pos = this._selectedImage?.pos\n if (!editor || pos === undefined) { return null }\n\n const node = editor.state.doc.nodeAt(pos)\n if (!node || node.type.name !== 'image') { return null }\n\n return { editor, pos, node }\n }\n\n private _insertImageAt(pos: number, attrs: Record<string, unknown>) {\n const editor = this._editor\n if (!editor) { return }\n\n const insertPos = Math.max(0, Math.min(pos, editor.state.doc.content.size))\n editor\n .chain()\n .insertContentAt(insertPos, { type: 'image', attrs })\n .setNodeSelection(insertPos)\n .run()\n }\n\n private _updateSelectedImageAttributes(attrs: Record<string, unknown>) {\n const selectedImage = this._getSelectedImageNode()\n if (!selectedImage) { return }\n\n const { editor, pos, node } = selectedImage\n editor.view.dispatch(editor.state.tr.setNodeMarkup(pos, undefined, {\n ...node.attrs,\n ...attrs,\n }))\n }\n\n private _setImageWidth(width: number) {\n const nextWidth = Math.max(MIN_IMAGE_WIDTH, Math.min(this._getImageMaxWidth(), Math.round(width)))\n this._updateSelectedImageAttributes({ width: nextWidth })\n }\n\n private _handleImageWidthInput(e: Event) {\n const rawValue = (e.target as HTMLInputElement).value.trim()\n if (!rawValue) { return }\n\n const value = Number(rawValue)\n if (!Number.isFinite(value)) { return }\n this._setImageWidth(value)\n }\n\n private _setImageAlignLeft() {\n this._updateSelectedImageAttributes({ align: 'left' })\n }\n\n private _setImageAlignCenter() {\n this._updateSelectedImageAttributes({ align: 'center' })\n }\n\n private _setImageAlignRight() {\n this._updateSelectedImageAttributes({ align: 'right' })\n }\n\n private _getTextLabel(): string {\n const editor = this._editor\n if (!editor) { return '正文' }\n if (editor.isActive('heading', { level: 1 })) { return '标题 1' }\n if (editor.isActive('heading', { level: 2 })) { return '标题 2' }\n if (editor.isActive('heading', { level: 3 })) { return '标题 3' }\n return '正文'\n }\n\n private _getAlignLabel(): string {\n const editor = this._editor\n if (!editor) { return '对齐' }\n if (editor.isActive({ textAlign: 'center' })) { return '居中' }\n if (editor.isActive({ textAlign: 'right' })) { return '右对齐' }\n return '左对齐'\n }\n\n private _renderImageControls() {\n const selectedImage = this._selectedImage\n if (!selectedImage) { return '' }\n\n return html`\n <button class=\"bubble-btn danger\" title=\"删除图片\" @click=${this._deleteImage}>\n <svg viewBox=\"0 0 24 24\"><polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/></svg>\n </button>\n <button class=\"bubble-btn\" title=\"添加图片\" @click=${this._insertImageAfter}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>\n </button>\n <div class=\"bubble-divider\"></div>\n <button class=\"bubble-btn ${selectedImage.align === 'left' ? 'is-active' : ''}\" title=\"左对齐\" @click=${this._setImageAlignLeft}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"18\" y2=\"18\"/></svg>\n </button>\n <button class=\"bubble-btn ${selectedImage.align === 'center' ? 'is-active' : ''}\" title=\"居中\" @click=${this._setImageAlignCenter}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>\n </button>\n <button class=\"bubble-btn ${selectedImage.align === 'right' ? 'is-active' : ''}\" title=\"右对齐\" @click=${this._setImageAlignRight}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"6\" y1=\"18\" x2=\"21\" y2=\"18\"/></svg>\n </button>\n <div class=\"image-size-control\">\n <span class=\"image-size-label\">宽度</span>\n <input\n class=\"image-size-range\"\n type=\"number\"\n min=\"${MIN_IMAGE_WIDTH}\"\n max=\"${this._getImageMaxWidth()}\"\n .value=${String(selectedImage.width)}\n @input=${this._handleImageWidthInput}\n />\n </div>\n `\n }\n\n private _updateBubbleMenuPosition() {\n if (this._toolbarModeValue !== 'slash') { return }\n requestAnimationFrame(() => {\n const bubbleMenu = this.shadowRoot?.querySelector<HTMLElement>('.bubble-menu')\n const proseMirror = this.shadowRoot?.querySelector<HTMLElement>('.ProseMirror')\n const editorWrapper = this.shadowRoot?.querySelector<HTMLElement>('.editor-wrapper')\n if (!bubbleMenu || !proseMirror || !editorWrapper) { return }\n\n const editor = this._editor\n const isInTable = editor?.isActive('table') ?? false\n const { selection } = editor?.state ?? { selection: null }\n\n // 如果选中了表格节点(而不只是单元格内的文字),隐藏菜单\n if (isInTable && selection && !selection.empty && editor) {\n const { from, to } = selection\n const $from = editor.state.doc.resolve(from)\n const $to = editor.state.doc.resolve(to)\n // 检查选区起点和终点之间是否有表格节点\n let hasTableInSelection = false\n for (let d = $from.depth; d >= 0; d--) {\n if ($from.node(d).type.name === 'table') {\n hasTableInSelection = true\n break\n }\n }\n // 如果选区起点在表格外但终点在表格内,或者选区跨越了表格\n const fromAncestor = $from.node($from.depth)\n const toAncestor = $to.node($to.depth)\n if (fromAncestor.type.name === 'table' || toAncestor.type.name === 'table') {\n hasTableInSelection = true\n }\n if (hasTableInSelection) {\n bubbleMenu.style.opacity = '0'\n bubbleMenu.style.visibility = 'hidden'\n return\n }\n }\n\n // 如果有选中文字,显示菜单\n if (selection && !selection.empty) {\n // continue to show menu\n }\n else if (!selection || (selection.empty && !this._hasSlashCommand)) {\n bubbleMenu.style.opacity = '0'\n bubbleMenu.style.visibility = 'hidden'\n return\n }\n\n const wrapperRect = editorWrapper.getBoundingClientRect()\n const menuRect = bubbleMenu.getBoundingClientRect()\n\n const { from } = selection!\n const coords = this._editor?.view.coordsAtPos(from)\n if (!coords) { return }\n\n let left = coords.left - wrapperRect.left\n let top = coords.top - wrapperRect.top - 40\n\n if (left + menuRect.width > wrapperRect.width) {\n left = wrapperRect.width - menuRect.width - 8\n }\n if (left < 0) {\n left = 8\n }\n\n if (top < 0) {\n top = coords.bottom - wrapperRect.top + 8\n }\n\n bubbleMenu.style.left = `${left}px`\n bubbleMenu.style.top = `${top}px`\n bubbleMenu.style.opacity = '1'\n bubbleMenu.style.visibility = 'visible'\n })\n }\n\n render() {\n const editor = this._editor\n\n return html`\n <div\n class=\"editor-wrapper ${!editor ? 'loading' : ''} ${this._previewValue ? 'preview' : ''}\"\n @mousedown=${this._handleWrapperMouseDown}\n @focusin=${this._handleWrapperFocusIn}\n @focusout=${this._handleWrapperFocusOut}\n >\n ${!editor\n ? html`\n <div class=\"loading-placeholder\">\n <div class=\"loading-spinner\"></div>\n <span>编辑器加载中...</span>\n </div>\n `\n : ''}\n <input\n type=\"file\"\n accept=\"image/*\"\n class=\"image-input\"\n @change=${this._handleImageUpload}\n />\n\n ${!this._previewValue && this._toolbarModeValue === 'header'\n ? html`\n <div class=\"editor-header ${this._isHeaderVisible() ? 'is-visible' : ''}\">\n <div class=\"editor-header__inner\">\n ${this._selectedImage\n ? this._renderImageControls()\n : html`\n <button\n class=\"bubble-btn ${editor?.isActive('bold') ? 'is-active' : ''}\"\n @click=${this._toggleBold}\n title=\"加粗\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/><path d=\"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('italic') ? 'is-active' : ''}\"\n @click=${this._toggleItalic}\n title=\"斜体\"\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\"/><line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\"/><line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('underline') ? 'is-active' : ''}\"\n @click=${this._toggleUnderline}\n title=\"下划线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3\"/><line x1=\"4\" y1=\"21\" x2=\"20\" y2=\"21\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('strike') ? 'is-active' : ''}\"\n @click=${this._toggleStrike}\n title=\"删除线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 5.3 3.9h.2m8.2 3.2c.3.4.4.8.4 1.3 0 2.9-2.7 3.6-6.2 3.6-2.3 0-4.4-.3-6.2-.9M4 12h16\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getTextLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button class=\"bubble-dropdown-item ${!editor?.isActive('heading') ? 'is-active' : ''}\" @click=${this._setParagraph}>正文</button>\n <button class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 1 }) ? 'is-active' : ''}\" @click=${() => this._setHeading(1)}>标题 1</button>\n <button class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 2 }) ? 'is-active' : ''}\" @click=${() => this._setHeading(2)}>标题 2</button>\n <button class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 3 }) ? 'is-active' : ''}\" @click=${() => this._setHeading(3)}>标题 3</button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getAlignLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'left' }) ? 'is-active' : ''}\" @click=${() => this._setTextAlign('left')}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"18\" y2=\"18\"/></svg>\n 左对齐\n </button>\n <button class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'center' }) ? 'is-active' : ''}\" @click=${() => this._setTextAlign('center')}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>\n 居中\n </button>\n <button class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'right' }) ? 'is-active' : ''}\" @click=${() => this._setTextAlign('right')}>\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"6\" y1=\"18\" x2=\"21\" y2=\"18\"/></svg>\n 右对齐\n </button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <button class=\"bubble-btn ${editor?.isActive('code') ? 'is-active' : ''}\" @click=${this._toggleCode} title=\"行内代码\">\n <svg viewBox=\"0 0 24 24\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>\n </button>\n <button class=\"bubble-btn ${editor?.isActive('link') ? 'is-active' : ''}\" @click=${this._setLink} title=\"链接\">\n <svg viewBox=\"0 0 24 24\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/></svg>\n </button>\n <button class=\"bubble-btn\" @click=${this._triggerImageUpload} title=\"图片\">\n <svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/><polyline points=\"21 15 16 10 5 21\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <button class=\"bubble-btn ${editor?.isActive('bulletList') ? 'is-active' : ''}\" @click=${this._toggleBulletList} title=\"无序列表\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"9\" y1=\"6\" x2=\"20\" y2=\"6\"/>\n <line x1=\"9\" y1=\"12\" x2=\"20\" y2=\"12\"/>\n <line x1=\"9\" y1=\"18\" x2=\"20\" y2=\"18\"/>\n <circle cx=\"4\" cy=\"6\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"12\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"18\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n </svg>\n </button>\n <button class=\"bubble-btn ${editor?.isActive('orderedList') ? 'is-active' : ''}\" @click=${this._toggleOrderedList} title=\"有序列表\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\"/>\n <line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\"/>\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\"/>\n <path d=\"M4 6h1v4\"/>\n <path d=\"M4 10h2\"/>\n <path d=\"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1.5\"/>\n </svg>\n </button>\n <button class=\"bubble-btn ${editor?.isActive('taskList') ? 'is-active' : ''}\" @click=${this._toggleTaskList} title=\"待办列表\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"5\" width=\"4\" height=\"4\" rx=\"1\"/>\n <polyline points=\"4 7 5 8 6.5 6.5\"/>\n <line x1=\"10\" y1=\"7\" x2=\"21\" y2=\"7\"/>\n <rect x=\"3\" y=\"15\" width=\"4\" height=\"4\" rx=\"1\"/>\n <line x1=\"10\" y1=\"17\" x2=\"21\" y2=\"17\"/>\n </svg>\n </button>\n <button class=\"bubble-btn ${editor?.isActive('blockquote') ? 'is-active' : ''}\" @click=${this._toggleBlockquote} title=\"引用\">\n <svg viewBox=\"0 0 24 24\"><path d=\"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z\"/><path d=\"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <div\n class=\"bubble-dropdown ${this._tableDropdownOpen ? 'is-open' : ''}\"\n @mouseenter=${() => {\n this._tableDropdownOpen = true\n this._hoverRow = 0\n this._hoverCol = 0\n }}\n @mouseleave=${() => this._tableDropdownOpen = false}\n >\n <button class=\"bubble-dropdown-btn\" title=\"表格\">\n <svg viewBox=\"0 0 24 24\" style=\"width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\"/><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\"/><line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\"/><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <div class=\"table-grid-preview\">\n ${this._renderTableGrid()}\n </div>\n <div class=\"table-size-hint\">\n <span>${this._hoverRow > 0 ? `${this._hoverRow} × ${this._hoverCol}` : `${this._tableRows} × ${this._tableCols}`}</span>\n </div>\n </div>\n </div>\n `}\n </div>\n </div>\n `\n : ''}\n\n <!-- Bubble Menu (悬浮操作栏) -->\n ${!this._previewValue && this._toolbarModeValue === 'slash'\n ? html`\n <div class=\"bubble-menu\">\n <!-- 文本格式 -->\n <button\n class=\"bubble-btn ${editor?.isActive('bold') ? 'is-active' : ''}\"\n @click=${this._toggleBold}\n title=\"加粗\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/><path d=\"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('italic') ? 'is-active' : ''}\"\n @click=${this._toggleItalic}\n title=\"斜体\"\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"19\" y1=\"4\" x2=\"10\" y2=\"4\"/><line x1=\"14\" y1=\"20\" x2=\"5\" y2=\"20\"/><line x1=\"15\" y1=\"4\" x2=\"9\" y2=\"20\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('underline') ? 'is-active' : ''}\"\n @click=${this._toggleUnderline}\n title=\"下划线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3\"/><line x1=\"4\" y1=\"21\" x2=\"20\" y2=\"21\"/></svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('strike') ? 'is-active' : ''}\"\n @click=${this._toggleStrike}\n title=\"删除线\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 5.3 3.9h.2m8.2 3.2c.3.4.4.8.4 1.3 0 2.9-2.7 3.6-6.2 3.6-2.3 0-4.4-.3-6.2-.9M4 12h16\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 文本类型下拉 -->\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getTextLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button\n class=\"bubble-dropdown-item ${!editor?.isActive('heading') ? 'is-active' : ''}\"\n @click=${this._setParagraph}\n >\n 正文\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 1 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(1)}\n >\n 标题 1\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 2 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(2)}\n >\n 标题 2\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive('heading', { level: 3 }) ? 'is-active' : ''}\"\n @click=${() => this._setHeading(3)}\n >\n 标题 3\n </button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 对齐下拉 -->\n <div class=\"bubble-dropdown\">\n <button class=\"bubble-dropdown-btn\">\n ${this._getAlignLabel()}\n <svg viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'left' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('left')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"3\" y1=\"12\" x2=\"15\" y2=\"12\"/><line x1=\"3\" y1=\"18\" x2=\"18\" y2=\"18\"/></svg>\n 左对齐\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'center' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('center')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"18\" x2=\"20\" y2=\"18\"/></svg>\n 居中\n </button>\n <button\n class=\"bubble-dropdown-item ${editor?.isActive({ textAlign: 'right' }) ? 'is-active' : ''}\"\n @click=${() => this._setTextAlign('right')}\n >\n <svg viewBox=\"0 0 24 24\"><line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\"/><line x1=\"9\" y1=\"12\" x2=\"21\" y2=\"12\"/><line x1=\"6\" y1=\"18\" x2=\"21\" y2=\"18\"/></svg>\n 右对齐\n </button>\n </div>\n </div>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 行内代码 -->\n <button\n class=\"bubble-btn ${editor?.isActive('code') ? 'is-active' : ''}\"\n @click=${this._toggleCode}\n title=\"行内代码\"\n >\n <svg viewBox=\"0 0 24 24\"><polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/></svg>\n </button>\n\n <!-- 链接 -->\n <button\n class=\"bubble-btn ${editor?.isActive('link') ? 'is-active' : ''}\"\n @click=${this._setLink}\n title=\"链接\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/></svg>\n </button>\n\n <!-- 图片 -->\n <button\n class=\"bubble-btn\"\n @click=${this._triggerImageUpload}\n title=\"图片\"\n >\n <svg viewBox=\"0 0 24 24\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\"/><polyline points=\"21 15 16 10 5 21\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 列表 -->\n <button\n class=\"bubble-btn ${editor?.isActive('bulletList') ? 'is-active' : ''}\"\n @click=${this._toggleBulletList}\n title=\"无序列表\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"9\" y1=\"6\" x2=\"20\" y2=\"6\"/>\n <line x1=\"9\" y1=\"12\" x2=\"20\" y2=\"12\"/>\n <line x1=\"9\" y1=\"18\" x2=\"20\" y2=\"18\"/>\n <circle cx=\"4\" cy=\"6\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"12\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n <circle cx=\"4\" cy=\"18\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/>\n </svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('orderedList') ? 'is-active' : ''}\"\n @click=${this._toggleOrderedList}\n title=\"有序列表\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"10\" y1=\"6\" x2=\"21\" y2=\"6\"/>\n <line x1=\"10\" y1=\"12\" x2=\"21\" y2=\"12\"/>\n <line x1=\"10\" y1=\"18\" x2=\"21\" y2=\"18\"/>\n <path d=\"M4 6h1v4\"/>\n <path d=\"M4 10h2\"/>\n <path d=\"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1.5\"/>\n </svg>\n </button>\n <button\n class=\"bubble-btn ${editor?.isActive('taskList') ? 'is-active' : ''}\"\n @click=${this._toggleTaskList}\n title=\"待办列表\"\n >\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"3\" y=\"5\" width=\"4\" height=\"4\" rx=\"1\"/>\n <polyline points=\"4 7 5 8 6.5 6.5\"/>\n <line x1=\"10\" y1=\"7\" x2=\"21\" y2=\"7\"/>\n <rect x=\"3\" y=\"15\" width=\"4\" height=\"4\" rx=\"1\"/>\n <line x1=\"10\" y1=\"17\" x2=\"21\" y2=\"17\"/>\n </svg>\n </button>\n\n <!-- 引用 -->\n <button\n class=\"bubble-btn ${editor?.isActive('blockquote') ? 'is-active' : ''}\"\n @click=${this._toggleBlockquote}\n title=\"引用\"\n >\n <svg viewBox=\"0 0 24 24\"><path d=\"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z\"/><path d=\"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z\"/></svg>\n </button>\n\n <div class=\"bubble-divider\"></div>\n\n <!-- 表格下拉 -->\n <div\n class=\"bubble-dropdown ${this._tableDropdownOpen ? 'is-open' : ''}\"\n @mouseenter=${() => {\n this._tableDropdownOpen = true\n this._hoverRow = 0\n this._hoverCol = 0\n }}\n @mouseleave=${() => this._tableDropdownOpen = false}\n >\n <button class=\"bubble-dropdown-btn\" title=\"表格\">\n <svg viewBox=\"0 0 24 24\" style=\"width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"/><line x1=\"3\" y1=\"9\" x2=\"21\" y2=\"9\"/><line x1=\"3\" y1=\"15\" x2=\"21\" y2=\"15\"/><line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"21\"/><line x1=\"15\" y1=\"3\" x2=\"15\" y2=\"21\"/></svg>\n </button>\n <div class=\"bubble-dropdown-menu\">\n <div class=\"table-grid-preview\">\n ${this._renderTableGrid()}\n </div>\n <div class=\"table-size-hint\">\n <span>${this._hoverRow > 0 ? `${this._hoverRow} × ${this._hoverCol}` : `${this._tableRows} × ${this._tableCols}`}</span>\n </div>\n </div>\n </div>\n </div>\n `\n : ''}\n\n <div class=\"editor-content\" data-empty-hint=${this._resolvedPlaceholder}></div>\n\n ${this._linkEditor.visible\n ? html`\n <div\n class=\"link-editor\"\n style=\"left: ${this._linkEditor.x}px; top: ${this._linkEditor.y}px;\"\n @mousedown=${(event: MouseEvent) => event.stopPropagation()}\n @click=${(event: MouseEvent) => event.stopPropagation()}\n >\n <div class=\"link-editor__field\">\n <span class=\"link-editor__label\">链接地址</span>\n <input\n class=\"link-editor__input\"\n data-field=\"url\"\n type=\"text\"\n placeholder=\"输入或粘贴链接\"\n .value=${this._linkEditor.url}\n @input=${this._handleLinkEditorInput}\n @keydown=${this._handleLinkEditorKeydown}\n />\n </div>\n <div class=\"link-editor__field\">\n <span class=\"link-editor__label\">链接名字</span>\n <input\n class=\"link-editor__input\"\n data-field=\"label\"\n type=\"text\"\n placeholder=\"输入展示名称\"\n .value=${this._linkEditor.label}\n @input=${this._handleLinkEditorInput}\n @keydown=${this._handleLinkEditorKeydown}\n />\n </div>\n <div class=\"link-editor__actions\">\n <button class=\"link-editor__action primary\" title=\"应用链接\" @click=${this._applyLink}>应用</button>\n <button class=\"link-editor__action\" title=\"取消链接编辑\" @click=${this._closeLinkEditor}>取消</button>\n ${(editor?.isActive('link') || this._linkEditor.url)\n ? html`<button class=\"link-editor__action danger\" title=\"移除链接\" @click=${this._removeLink}>移除</button>`\n : ''}\n </div>\n </div>\n `\n : ''}\n\n <!-- Table Cell Toolbar -->\n ${this._tableCellToolbar.visible && editor?.isActive('table')\n ? html`\n <div\n class=\"table-cell-toolbar\"\n style=\"left: ${this._tableCellToolbar.x}px; top: ${this._tableCellToolbar.y}px;\"\n @mousedown=${(e: Event) => e.preventDefault()}\n >\n ${this._tableCellToolbar.cellRow === 0\n ? html`\n <button class=\"table-cell-toolbar-btn\" title=\"上方添加行\" @click=${this._addTableRowAbove}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"7\"/><line x1=\"10\" y1=\"5\" x2=\"14\" y2=\"5\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn\" title=\"下方添加行\" @click=${this._addTableRowBelow}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"17\"/><line x1=\"10\" y1=\"19\" x2=\"14\" y2=\"19\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除行\" @click=${this._deleteTableRow}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"4\" y=\"8\" width=\"16\" height=\"8\" rx=\"1\"/><line x1=\"9\" y1=\"10\" x2=\"9\" y2=\"14\"/><line x1=\"15\" y1=\"10\" x2=\"15\" y2=\"14\"/></svg>\n </button>\n `\n : ''}\n ${this._tableCellToolbar.cellCol === 0\n ? html`\n ${this._tableCellToolbar.cellRow !== 0 ? html`<div style=\"width:1px;height:20px;background:#e3e3e3;margin:0 4px;\"></div>` : ''}\n <button class=\"table-cell-toolbar-btn\" title=\"左侧添加列\" @click=${this._addTableColumnLeft}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"3\" y1=\"12\" x2=\"7\" y2=\"12\"/><line x1=\"5\" y1=\"10\" x2=\"5\" y2=\"14\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn\" title=\"右侧添加列\" @click=${this._addTableColumnRight}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"21\" y1=\"12\" x2=\"17\" y2=\"12\"/><line x1=\"19\" y1=\"10\" x2=\"19\" y2=\"14\"/></svg>\n </button>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除列\" @click=${this._deleteTableColumn}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><rect x=\"8\" y=\"4\" width=\"8\" height=\"16\" rx=\"1\"/><line x1=\"10\" y1=\"9\" x2=\"14\" y2=\"9\"/><line x1=\"10\" y1=\"15\" x2=\"14\" y2=\"15\"/></svg>\n </button>\n `\n : ''}\n ${this._tableCellToolbar.cellRow === 0 && this._tableCellToolbar.cellCol === 0\n ? html`\n <div style=\"width:1px;height:20px;background:#e3e3e3;margin:0 4px;\"></div>\n <button class=\"table-cell-toolbar-btn danger\" title=\"删除表格\" @click=${this._deleteTable}>\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" stroke=\"currentColor\" stroke-width=\"2\" fill=\"none\"><polyline points=\"3 6 5 6 21 6\"/><path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"/></svg>\n </button>\n `\n : ''}\n </div>\n `\n : ''}\n\n <!-- Image Toolbar -->\n ${this._toolbarModeValue === 'slash' && this._imageToolbar.visible\n ? html`\n <div\n class=\"image-toolbar\"\n style=\"left: ${this._imageToolbar.x}px; top: ${this._imageToolbar.y}px;\"\n @mousedown=${(e: Event) => e.preventDefault()}\n >\n ${this._renderImageControls()}\n </div>\n `\n : ''}\n </div>\n `\n }\n\n private _renderTableGrid() {\n const cells = []\n for (let i = 0; i < 100; i++) {\n const row = Math.floor(i / 10) + 1\n const col = (i % 10) + 1\n const isHighlight = this._hoverRow > 0 && row <= this._hoverRow && col <= this._hoverCol\n cells.push(html`\n <div\n class=\"table-cell ${isHighlight ? 'selected' : ''}\"\n @click=${() => {\n this._insertTableByClick(row, col)\n this._tableDropdownOpen = false\n }}\n @mouseenter=${() => {\n this._hoverRow = row\n this._hoverCol = col\n }}\n @mouseleave=${() => {\n this._hoverRow = 0\n this._hoverCol = 0\n }}\n ></div>\n `)\n }\n return cells\n }\n}\n\nexport function register() {}\n"],"names":["DEFAULT_HEADER_PLACEHOLDER","DEFAULT_SLASH_PLACEHOLDER","TaskList","TiptapNode","create","name","group","content","defining","parseHTML","tag","renderHTML","_ref","HTMLAttributes","mergeAttributes","addCommands","toggleTaskList","_ref2","commands","toggleList","this","TaskItem","addAttributes","checked","default","element","getAttribute","String","Boolean","attributes","_ref3","contenteditable","type","addKeyboardShortcuts","Enter","editor","splitListItem","Tab","sinkListItem","Shift-Tab","liftListItem","ExtendedImage","Image","extend","parent","width","attr","value","Number","isFinite","align","_ref4","style","filter","join","options","QxsBlocksuiteEditor","LitElement","constructor","super","arguments","placeholder","readonly","preview","_injectedStyleEl","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_editor","_pendingContent","_tableRows","_tableCols","_hoverRow","_hoverCol","_tableDropdownOpen","_tableCellToolbar","x","y","visible","cellRow","cellCol","_imageToolbar","_linkEditor","url","label","_isEditorFocused","_selectedImage","_hasSlashCommand","_slashCommandRange","_isUpdating","_pendingImageInsertPos","_linkSelection","_preserveFocusOnInternalClick","_tableEdgeDetectionSetup","_injectCustomStyles","shadow","shadowRoot","remove","styleEl","document","createElement","textContent","appendChild","_useModelValue","hasAttribute","_readonlyValue","_previewValue","_isEditable","_toolbarModeValue","_headerAlwaysVisibleValue","_resolvedPlaceholder","_initEditor","el","querySelector","requestAnimationFrame","firstChild","removeChild","useModel","modelValue","contentValue","initialContent","extensions","Document","Paragraph","Text","Bold","Italic","Underline","Strike","Code","Heading","configure","levels","BulletList","OrderedList","ListItem","Blockquote","HorizontalRule","History","inline","allowBase64","Link","inclusive","openOnClick","rel","TextAlign","types","Table","resizable","TableRow","TableCell","TableHeader","Placeholder","Editor","editable","on","_updateBubbleMenuPosition","isActive","_showTableCellToolbar","_hideTableCellToolbar","_syncImageSelectionState","_checkSlashCommand","_setupTableEdgeDetection","_emitContentChange","_toggleTaskItemChecked","event","HTMLInputElement","taskItem","closest","preventDefault","stopPropagation","basePos","view","posAtDOM","searchFrom","Math","max","searchTo","min","state","doc","size","taskItemPos","nodesBetween","node","pos","nodeAt","dispatch","tr","setNodeMarkup","attrs","html","getHTML","dispatchEvent","CustomEvent","detail","bubbles","composed","editorContent","editorWrapper","handleEditorClick","Element","chain","focus","run","addEventListener","_handleWrapperFocusIn","_handleWrapperMouseDown","_handleWrapperFocusOut","nextTarget","relatedTarget","wrapper","contains","_closeLinkEditor","_isHeaderVisible","_getImageSelection","selection","from","_getImageMaxWidth","availableWidth","clientWidth","_getImageNaturalWidth","objectUrl","URL","createObjectURL","image","window","naturalWidth","revokeObjectURL","src","_hideImageToolbar","wrapperRect","getBoundingClientRect","coords","coordsAtPos","left","right","top","_showImageToolbar","_clearSlashCommandText","to","deleteRange","empty","$from","textBefore","textBetween","parentOffset","matched","exec","slashText","length","firstUpdated","updated","changed","has","newContent","setContent","setEditable","disconnectedCallback","destroy","getContent","forceUpdate","requestUpdate","_applyFormat","command","_getSlashCommandContext","range","lineFrom","start","lineTo","_applySlashLineMark","applyMark","clearMark","context","setTextSelection","_applyToolbarLineMark","end","_applySlashLineBlock","applyBlock","_toggleBold","setBold","unsetBold","toggleBold","_toggleItalic","setItalic","unsetItalic","toggleItalic","_toggleUnderline","setUnderline","unsetUnderline","toggleUnderline","_toggleStrike","setStrike","unsetStrike","toggleStrike","_toggleCode","setCode","unsetCode","toggleCode","_setHeading","level","setHeading","toggleHeading","_setParagraph","setParagraph","_toggleBulletList","toggleBulletList","_toggleOrderedList","toggleOrderedList","_toggleTaskList","_toggleBlockquote","toggleBlockquote","_setTextAlign","setTextAlign","_normalizeLinkUrl","trimmed","trim","test","_getLinkLabelFromRange","_getLinkTargetRange","extendMarkRange","_setLink","trigger","currentTarget","HTMLElement","linkRange","triggerRect","maxLeft","bottom","currentHref","getAttributes","href","currentLabel","updateComplete","then","input","select","_handleLinkEditorInput","field","dataset","_applyLink","insertTo","insertContentAt","text","marks","_removeLink","unsetLink","_handleLinkEditorKeydown","key","_insertTable","rows","cols","insertTable","withHeaderRow","_handleImageUpload","files","initialWidth","pendingInsertPos","_insertImageAt","setImage","err","_triggerImageUpload","click","_insertTableByClick","_getTableCellRow","_getTableCellCol","$pos","d","depth","index","_addTableRowAbove","addRowBefore","_addTableRowBelow","addRowAfter","_addTableColumnLeft","addColumnBefore","_addTableColumnRight","addColumnAfter","_deleteTableRow","deleteRow","_deleteTableColumn","deleteColumn","_deleteTable","deleteTable","_deleteImage","selectedImage","_getSelectedImageNode","delete","nodeSize","_insertImageAfter","insertPos","setNodeSelection","_updateSelectedImageAttributes","_setImageWidth","nextWidth","round","_handleImageWidthInput","rawValue","_setImageAlignLeft","_setImageAlignCenter","_setImageAlignRight","_getTextLabel","_getAlignLabel","textAlign","_renderImageControls","bubbleMenu","proseMirror","isInTable","$to","hasTableInSelection","fromAncestor","toAncestor","opacity","visibility","menuRect","render","_renderTableGrid","cells","i","row","floor","col","isHighlight","push","styles","css","__decorateClass","property","attribute","prototype","Object","safeCustomElement"],"mappings":"k6CAsCA,MAEMA,EAA6B,OAC7BC,EAA4B,cAE5BC,EAAWC,EAAWC,OAAO,CACjCC,KAAM,WACNC,MAAO,aACPC,QAAS,YACTC,UAAU,EAEVC,UAAAA,IACS,CAAC,CAAEC,IAAK,6BAGjBC,UAAAA,CAAAC,GAA+B,IAApBC,eAAEA,GAAeD,EAC1B,MAAO,CAAC,KAAME,EAAgBD,EAAgB,CAAE,YAAa,aAAe,EAC9E,EAEAE,WAAAA,GACE,MAAO,CACLC,eAAgBA,IAAMC,IAAA,IAACC,SAAEA,YAAeA,EAASC,WAAWC,KAAKf,KAAM,aAE3E,IAGIgB,EAAWlB,EAAWC,OAAO,CACjCC,KAAM,WACNG,UAAU,EACVD,QA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OAAQ2Z,UAAW,mBApzB1B9X,EAqzBX+X,UAAA,gBAAA,GA8DAH,EAAA,CADCC,EAAS,CAAErZ,KAAMwZ,OAAQF,UAAW,kBAl3B1B9X,EAm3BX+X,UAAA,eAAA,GASiBH,EAAA,CAAhBvP,KA53BUrI,EA43BM+X,UAAA,UAAA,GACAH,EAAA,CAAhBvP,KA73BUrI,EA63BM+X,UAAA,kBAAA,GAGAH,EAAA,CAAhBvP,KAh4BUrI,EAg4BM+X,UAAA,YAAA,GACAH,EAAA,CAAhBvP,KAj4BUrI,EAi4BM+X,UAAA,YAAA,GACAH,EAAA,CAAhBvP,KAl4BUrI,EAk4BM+X,UAAA,qBAAA,GACAH,EAAA,CAAhBvP,KAn4BUrI,EAm4BM+X,UAAA,oBAAA,GACAH,EAAA,CAAhBvP,KAp4BUrI,EAo4BM+X,UAAA,gBAAA,GACAH,EAAA,CAAhBvP,KAr4BUrI,EAq4BM+X,UAAA,cAAA,GACAH,EAAA,CAAhBvP,KAt4BUrI,EAs4BM+X,UAAA,mBAAA,GACAH,EAAA,CAAhBvP,KAv4BUrI,EAu4BM+X,UAAA,iBAAA,GAv4BN/X,EAAN4X,EAAA,CADNK,EAAkB,0BACNjY"}
|
package/es/entry-subject.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{QxsSubjectAction}from"./subject/action.mjs";export{QxsBlankFill}from"./subject/blank-fill.mjs";export{
|
|
1
|
+
export{QxsSubjectAction}from"./subject/action.mjs";export{QxsBlankFill}from"./subject/blank-fill.mjs";export{createSubjectDraft}from"./subject/draft.mjs";export{QxsSubjectLayout}from"./subject/layout.mjs";export{QxsPageEnd}from"./subject/page-end.mjs";export{getPaginationMeta,insertPageBreak,rebuildPageBreaksFromPageIndex,removePageBreak,serializeSubjectsWithPageIndex}from"./subject/pagination.mjs";export{collectSubjectElements,serializeSubjectElements,validateSubjectElements}from"./subject/runtime.mjs";export{QxsScale}from"./subject/scale.mjs";export{QxsSubjectSingle}from"./subject/single.mjs";export{moveSubjectItem,reorderSubjects}from"./subject/sort-controller.mjs";export{QxsSubjectSortable}from"./subject/sortable.mjs";export{QxsTextFill}from"./subject/text-fill.mjs";
|
|
2
2
|
//# sourceMappingURL=entry-subject.mjs.map
|
package/es/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{QxsBlocksuiteEditor}from"./editor/blocksuite-editor.mjs";export{register}from"./editor/index.mjs";export{QxsBlankFill}from"./subject/blank-fill.mjs";export{QxsPageEnd}from"./subject/page-end.mjs";export{QxsScale}from"./subject/scale.mjs";export{QxsSubjectAction}from"./subject/action.mjs";export{QxsSubjectLayout}from"./subject/layout.mjs";export{
|
|
1
|
+
export{QxsBlocksuiteEditor}from"./editor/blocksuite-editor.mjs";export{register}from"./editor/index.mjs";export{collectSubjectElements,serializeSubjectElements,validateSubjectElements}from"./subject/runtime.mjs";export{createSubjectDraft}from"./subject/draft.mjs";export{getPaginationMeta,insertPageBreak,rebuildPageBreaksFromPageIndex,removePageBreak,serializeSubjectsWithPageIndex}from"./subject/pagination.mjs";export{moveSubjectItem,reorderSubjects}from"./subject/sort-controller.mjs";export{QxsBlankFill}from"./subject/blank-fill.mjs";export{QxsPageEnd}from"./subject/page-end.mjs";export{QxsScale}from"./subject/scale.mjs";export{QxsSubjectAction}from"./subject/action.mjs";export{QxsSubjectLayout}from"./subject/layout.mjs";export{QxsSubjectSingle}from"./subject/single.mjs";export{QxsSubjectSortable}from"./subject/sortable.mjs";export{QxsTextFill}from"./subject/text-fill.mjs";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|