@verbb/plugin-kit-web 2.0.24 → 2.0.25

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/chunks/{pk-tiptap-content-C2qzGQKj.js → pk-tiptap-content-DmS_2EUi.js} +2 -2
  3. package/dist/chunks/{pk-tiptap-content-C2qzGQKj.js.map → pk-tiptap-content-DmS_2EUi.js.map} +1 -1
  4. package/dist/chunks/{pk-tiptap-editor-y_QyNSR-.js → pk-tiptap-editor-DCgHtgoi.js} +2 -2
  5. package/dist/chunks/{pk-tiptap-editor-y_QyNSR-.js.map → pk-tiptap-editor-DCgHtgoi.js.map} +1 -1
  6. package/dist/chunks/{pk-tiptap-input-0Xy6rrot.js → pk-tiptap-input-asrD-8W6.js} +2 -2
  7. package/dist/chunks/{pk-tiptap-input-0Xy6rrot.js.map → pk-tiptap-input-asrD-8W6.js.map} +1 -1
  8. package/dist/chunks/{tiptap.styles-Q4ED1nBw.js → tiptap.styles-Cwb_cj9g.js} +20 -1
  9. package/dist/chunks/{tiptap.styles-Q4ED1nBw.js.map → tiptap.styles-Cwb_cj9g.js.map} +1 -1
  10. package/dist/components/tiptap/pk-tiptap-content.js +1 -1
  11. package/dist/components/tiptap/pk-tiptap-editor.js +1 -1
  12. package/dist/components/tiptap/pk-tiptap-input.js +1 -1
  13. package/dist/components/tiptap/tiptap.styles.d.ts.map +1 -1
  14. package/dist/components/tiptap-content.js +1 -1
  15. package/dist/components/tiptap-editor.js +1 -1
  16. package/dist/components/tiptap-input.js +1 -1
  17. package/dist/index.js +3 -3
  18. package/dist/register.js +3 -3
  19. package/dist-loader/chunks/{tiptap-uppXgD5k.js → tiptap-DYSRDaas.js} +9890 -13905
  20. package/dist-loader/chunks/{tiptap.styles-CyqI_Wrl.js → tiptap.styles-CZUkf2K6.js} +20 -1
  21. package/dist-loader/components/tiptap/tiptap-content.js +2 -2
  22. package/dist-loader/components/tiptap/tiptap-editor.js +3 -3
  23. package/dist-loader/components/tiptap/tiptap-input.js +2 -2
  24. package/package.json +7 -7
@@ -282,6 +282,25 @@ var variableTagStyles = css`
282
282
  appearance: none;
283
283
  }
284
284
 
285
+ /* Keep the configure action's keyboard indicator around the whole chip,
286
+ * while the separate remove action identifies only its own hit area. */
287
+ .pk-variable-tag:has(> .pk-variable-tag__label:focus-visible) {
288
+ /* The transparent outline remains visible in forced-colors mode. */
289
+ outline: 2px solid transparent;
290
+ outline-offset: 2px;
291
+ box-shadow: 0 0 0 3px rgba(123, 140, 232, 0.5);
292
+ }
293
+
294
+ .pk-variable-tag__label:focus-visible {
295
+ outline: none;
296
+ }
297
+
298
+ .pk-variable-tag__remove:focus-visible {
299
+ outline: 2px solid currentColor;
300
+ outline-offset: -3px;
301
+ border-radius: 2px;
302
+ }
303
+
285
304
  .pk-variable-tag__remove svg {
286
305
  display: block;
287
306
  width: 10px;
@@ -461,4 +480,4 @@ var tiptapContentProseMirrorStyles = css`
461
480
  //#endregion
462
481
  export { createVariableTagDomNodeView as i, tiptapInputProseMirrorStyles as n, tiptapProseMirrorStyles as r, tiptapContentProseMirrorStyles as t };
463
482
 
464
- //# sourceMappingURL=tiptap.styles-Q4ED1nBw.js.map
483
+ //# sourceMappingURL=tiptap.styles-Cwb_cj9g.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tiptap.styles-Q4ED1nBw.js","names":[],"sources":["../../src/components/tiptap/variable-tag-node-view.ts","../../src/components/tiptap/tiptap.styles.ts"],"sourcesContent":["import type { Editor, NodeViewRenderer, NodeViewRendererProps } from '@tiptap/core';\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model';\nimport { uniqueId } from '../../a11y/focus.js';\n\n/** Match kit v1 VariableTagView chip chrome (indigo + remove). */\nconst REMOVE_ICON = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M2.1 1.4 5 4.3l2.9-2.9.7.7L5.7 5l2.9 2.9-.7.7L5 5.7l-2.9 2.9-.7-.7L4.3 5 1.4 2.1z\"/>\n</svg>\n`.trim();\n\nexport const PK_VARIABLE_TAG_CONFIGURE_EVENT = 'pk-variable-tag-configure';\n\nexport type PkVariableTagConfigureDetail = {\n editor: Editor;\n anchor: HTMLElement;\n attrs: Record<string, unknown>;\n getPos: () => number | undefined;\n updateAttributes: (attributes: Record<string, unknown>) => void;\n deleteNode: () => void;\n};\n\nconst findTiptapHost = (viewDom: HTMLElement): HTMLElement | null => {\n let node: Node | null = viewDom;\n while (node) {\n if (node instanceof HTMLElement && node.localName.startsWith('pk-tiptap')) {\n return node;\n }\n\n node = node.parentNode instanceof ShadowRoot\n ? node.parentNode.host\n : node.parentNode;\n }\n\n return null;\n};\n\nconst emitConfigure = (\n editor: Editor,\n detail: PkVariableTagConfigureDetail,\n) => {\n const viewDom = editor.view.dom;\n const host = findTiptapHost(viewDom);\n\n // Preferred bridge for React/Formie: property callback on <pk-tiptap-*>.\n const configure = host && 'variableTagConfigure' in host\n ? (host as HTMLElement & {\n variableTagConfigure?: ((detail: PkVariableTagConfigureDetail) => void) | null;\n }).variableTagConfigure\n : null;\n\n if (typeof configure === 'function') {\n configure(detail);\n }\n\n // Composed event is the reliable Formie path (document capture listener).\n const target = host ?? viewDom;\n target.dispatchEvent(new CustomEvent(PK_VARIABLE_TAG_CONFIGURE_EVENT, {\n bubbles: true,\n composed: true,\n detail,\n }));\n};\n\n/**\n * DOM NodeViewRendererProps do NOT include React's `deleteNode` / `updateAttributes`\n * (those live on NodeViewProps for ReactNodeViewRenderer only). Build them from\n * editor + getPos — same operations ReactNodeViewRenderer wires for VariableTagView.\n */\nfunction createNodeViewCommands(\n editor: Editor,\n getPos: NodeViewRendererProps['getPos'],\n) {\n const resolvePos = (): number | undefined => {\n const pos = typeof getPos === 'function' ? getPos() : getPos;\n return typeof pos === 'number' ? pos : undefined;\n };\n\n const deleteNode = () => {\n const pos = resolvePos();\n if (typeof pos !== 'number') {\n return;\n }\n\n const live = editor.state.doc.nodeAt(pos);\n if (!live || live.type.name !== 'variableTag') {\n return;\n }\n\n editor\n .chain()\n .focus()\n .deleteRange({ from: pos, to: pos + live.nodeSize })\n .run();\n };\n\n const updateAttributes = (attributes: Record<string, unknown>) => {\n const pos = resolvePos();\n if (typeof pos !== 'number') {\n return;\n }\n\n const live = editor.state.doc.nodeAt(pos);\n if (!live || live.type.name !== 'variableTag') {\n return;\n }\n\n editor\n .chain()\n .command(({ tr, dispatch }) => {\n if (dispatch) {\n tr.setNodeMarkup(pos, undefined, {\n ...live.attrs,\n ...attributes,\n });\n }\n return true;\n })\n .run();\n };\n\n return { deleteNode, updateAttributes, resolvePos };\n}\n\n/**\n * DOM node view for variable tags in vanilla editors.\n * Chip + remove match kit v1; configure UI is opened via `pk-variable-tag-configure`\n * (Formie mounts the edit overlay beside the WC editor).\n */\nexport function createVariableTagDomNodeView(): NodeViewRenderer {\n return (props) => {\n const { editor, getPos } = props;\n const { deleteNode, updateAttributes, resolvePos } = createNodeViewCommands(editor, getPos);\n\n let currentNode: ProseMirrorNode = props.node;\n\n const syncUnresolvedPresentation = (attrs: Record<string, unknown>) => {\n const unresolved = Boolean(attrs.unresolved);\n const token = String(attrs.value ?? '');\n const chipLabel = String(attrs.label || attrs.value || '');\n\n dom.classList.toggle('pk-variable-tag--unresolved', unresolved);\n if (unresolved) {\n dom.dataset.unresolved = 'true';\n // Extra context for AT — not HTML title (avoids native hover tooltip).\n const description = token\n ? `Unknown or missing reference — ${token}`\n : 'Unknown or missing reference';\n dom.setAttribute('aria-description', description);\n label.setAttribute('aria-invalid', 'true');\n } else {\n delete dom.dataset.unresolved;\n dom.removeAttribute('aria-description');\n label.removeAttribute('aria-invalid');\n }\n\n label.textContent = chipLabel;\n };\n\n const dom = document.createElement('span');\n dom.className = 'pk-variable-tag';\n dom.id = uniqueId('pk-variable-tag');\n dom.setAttribute('contenteditable', 'false');\n // Do NOT set draggable=true permanently — HTML5-draggable hosts suppress click,\n // which kills configure. ProseMirror sets draggable temporarily on mousedown drag.\n // TipTap React node views use data-drag-handle on a TipTap NodeView class; keep the\n // attr for parity, but drag itself is PM's selectable+draggable atom behavior.\n dom.setAttribute('data-drag-handle', '');\n dom.dataset.label = String(currentNode.attrs.label ?? '');\n dom.dataset.variableValue = String(currentNode.attrs.value ?? '');\n\n // Match kit v1 VariableTagView: real button for activate.\n const label = document.createElement('button');\n label.type = 'button';\n label.className = 'pk-variable-tag__label';\n label.draggable = false;\n dom.append(label);\n syncUnresolvedPresentation(currentNode.attrs);\n\n let removeButton: HTMLButtonElement | null = null;\n let openOnInsertHandled = false;\n let openedAt = 0;\n\n const readLiveAttrs = () => {\n const pos = resolvePos();\n if (typeof pos === 'number') {\n const live = editor.state.doc.nodeAt(pos);\n if (live?.type.name === 'variableTag') {\n return { ...live.attrs };\n }\n }\n\n return { ...currentNode.attrs };\n };\n\n const openConfigure = () => {\n if (!editor.isEditable) {\n return;\n }\n\n // Dedupe repeated emits from nested handlers / openOnInsert.\n const now = Date.now();\n if (now - openedAt < 300) {\n return;\n }\n openedAt = now;\n\n // Strip any HTML5-draggable PM may have armed so configure stays clickable\n // after this interaction (draggable hosts suppress subsequent clicks).\n dom.removeAttribute('draggable');\n\n emitConfigure(editor, {\n editor,\n anchor: dom,\n attrs: readLiveAttrs(),\n getPos: resolvePos,\n updateAttributes,\n deleteNode,\n });\n };\n\n // Open on pointerdown — before ProseMirror can arm HTML5 drag on the atom.\n label.addEventListener('pointerdown', (event) => {\n if (event.button !== 0) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n openConfigure();\n });\n label.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n openConfigure();\n });\n\n const syncRemoveButton = (editable: boolean) => {\n if (editable) {\n if (removeButton) {\n return;\n }\n\n removeButton = document.createElement('button');\n removeButton.type = 'button';\n removeButton.className = 'pk-variable-tag__remove';\n removeButton.setAttribute('aria-label', 'Remove');\n removeButton.draggable = false;\n removeButton.innerHTML = REMOVE_ICON;\n removeButton.addEventListener('pointerdown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n });\n removeButton.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n deleteNode();\n });\n dom.append(removeButton);\n return;\n }\n\n removeButton?.remove();\n removeButton = null;\n };\n\n syncRemoveButton(editor.isEditable);\n\n if (currentNode.attrs.openOnInsert && editor.isEditable && !openOnInsertHandled) {\n openOnInsertHandled = true;\n queueMicrotask(() => {\n updateAttributes({ openOnInsert: false });\n openConfigure();\n });\n }\n\n return {\n dom,\n // TipTap React node views stop PM from handling events inside the chip —\n // that prevents `draggable=true` arming, which otherwise kills configure.\n // Drag still works via outer NodeSelection + data-drag-handle when the\n // pointer starts on the chip chrome (not the label/remove controls).\n stopEvent: (event) => {\n const target = event.target as Node | null;\n if (!(target instanceof Element)) {\n return false;\n }\n\n return Boolean(\n target.closest('.pk-variable-tag__label')\n || target.closest('.pk-variable-tag__remove'),\n );\n },\n selectNode: () => {\n dom.classList.add('ProseMirror-selectednode');\n // Never keep HTML5-draggable while selected — it suppresses clicks.\n dom.removeAttribute('draggable');\n },\n deselectNode: () => {\n dom.classList.remove('ProseMirror-selectednode');\n dom.removeAttribute('draggable');\n },\n update(updatedNode) {\n if (updatedNode.type.name !== 'variableTag') {\n return false;\n }\n\n currentNode = updatedNode;\n dom.dataset.label = String(updatedNode.attrs.label ?? '');\n dom.dataset.variableValue = String(updatedNode.attrs.value ?? '');\n syncUnresolvedPresentation(updatedNode.attrs);\n syncRemoveButton(editor.isEditable);\n return true;\n },\n };\n };\n}\n","import { css } from 'lit';\n\n/**\n * Indigo chip matching kit v1 VariableTagView (`bg-[#5C6BC0] text-white rounded-[2px]`).\n * Shared by rich editor + single-line input ProseMirror hosts.\n */\nconst variableTagStyles = css`\n .pk-variable-tag {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n max-width: 100%;\n margin-inline: 1px;\n margin-block-start: -3px;\n padding: 0;\n border-radius: 2px;\n background: #5c6bc0;\n color: #fff;\n font-size: 11px;\n font-weight: 400;\n line-height: 1;\n white-space: nowrap;\n vertical-align: middle;\n overflow: hidden;\n cursor: default;\n box-sizing: border-box;\n }\n\n /* Unresolved / missing reference — muted grey (not alarm yellow). */\n .pk-variable-tag--unresolved {\n background: var(--pk-color-gray-100, #f3f4f6);\n color: var(--pk-color-gray-600, #4b5563);\n box-shadow: inset 0 0 0 1px var(--pk-color-gray-300, #d1d5db);\n }\n\n .pk-variable-tag--unresolved.ProseMirror-selectednode {\n box-shadow:\n inset 0 0 0 1px var(--pk-color-gray-400, #9ca3af),\n 0 0 0 2px rgba(156, 163, 175, 0.45);\n }\n\n .pk-variable-tag.ProseMirror-selectednode {\n outline: none;\n box-shadow: 0 0 0 2px rgba(123, 140, 232, 0.5);\n }\n\n .pk-variable-tag__label {\n display: inline-flex;\n align-items: center;\n max-width: 220px;\n margin: 0;\n padding: 4px 5px;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n user-select: none;\n }\n\n .pk-variable-tag__remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n margin: 0;\n padding: 4px 5px 4px 4px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n line-height: 0;\n appearance: none;\n }\n\n .pk-variable-tag__remove svg {\n display: block;\n width: 10px;\n height: 10px;\n pointer-events: none;\n }\n`;\n\nexport const tiptapProseMirrorStyles = css`\n @layer pk-component {\n .ProseMirror {\n outline: none;\n min-height: 2rem;\n padding: 1rem;\n background: rgb(251, 252, 254);\n /* Craft CP body text (~gray-700), not gray-900. */\n color: var(--pk-color-gray-700);\n font-family: var(--pk-font-family);\n /* Match pk-input / body (14px). sm (13px) matched field instructions and looked undersized vs v1. */\n font-size: var(--pk-font-size-base);\n line-height: 1.5;\n white-space: pre-wrap;\n box-sizing: border-box;\n }\n\n .ProseMirror p {\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror p:last-child {\n margin-bottom: 0;\n }\n\n .ProseMirror h1 {\n font-size: 1.25rem;\n font-weight: 700;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror h2 {\n font-size: 1.125rem;\n font-weight: 600;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror h3,\n .ProseMirror h4,\n .ProseMirror h5,\n .ProseMirror h6 {\n font-weight: 600;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror a {\n color: var(--pk-color-blue-600);\n text-decoration: underline;\n cursor: pointer;\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n margin: 0 0 0.5rem;\n padding-left: 1.25rem;\n }\n\n .ProseMirror blockquote {\n margin: 0 0 0.5rem;\n padding-left: 0.75rem;\n border-left: 3px solid var(--pk-color-gray-300);\n color: var(--pk-color-gray-600);\n }\n\n .ProseMirror code {\n font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);\n font-size: var(--pk-font-size-mono, 0.9em);\n line-height: var(--pk-line-height-mono, 1.5);\n background: var(--pk-color-gray-100);\n border-radius: 0.2rem;\n padding: 0.1rem 0.25rem;\n }\n\n .ProseMirror pre {\n margin: 0 0 0.5rem;\n padding: 0.75rem;\n background: var(--pk-color-gray-900);\n color: var(--pk-color-gray-50);\n border-radius: var(--pk-radius-md);\n overflow-x: auto;\n font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);\n font-size: var(--pk-font-size-mono, 0.9em);\n line-height: var(--pk-line-height-mono, 1.5);\n }\n\n ${variableTagStyles}\n }\n`;\n\n/**\n * Single-line TipTap field — same box metrics as `pk-input` .input\n * (14px / line-height 1.4 / padding 6px 8px).\n *\n * ProseMirror always injects `br.ProseMirror-trailingBreak` for the caret.\n * Never `display: none` it — that freezes one-liner docs after the first character.\n * Clip to one line height instead so the break cannot inflate the control.\n */\nexport const tiptapInputProseMirrorStyles = css`\n @layer pk-component {\n .ProseMirror {\n outline: none;\n margin: 0;\n /* Match stock pk-input padding by default. Hosts can override density via\n * --pk-tiptap-input-* (light DOM cannot style .ProseMirror in the shadow tree).\n */\n padding-block: var(--pk-tiptap-input-padding-block, 6px);\n padding-inline-start: var(--pk-tiptap-input-padding-inline-start, 8px);\n padding-inline-end: var(--pk-tiptap-input-padding-inline-end, 8px);\n /* One-liner clip: padding + control line-height (v1 text-sm), not a fixed shell token. */\n height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));\n max-height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));\n background: var(--pk-input-bg);\n /* Craft CP body / field value text. */\n color: var(--pk-color-gray-700);\n font-family: var(--pk-font-family);\n font-size: var(--pk-tiptap-input-font-size, var(--pk-font-size-base));\n line-height: var(--pk-tiptap-input-line-height, var(--pk-input-control-line-height, 1.25rem));\n white-space: nowrap;\n overflow-x: auto;\n overflow-y: hidden;\n box-sizing: border-box;\n scrollbar-width: none;\n }\n\n .ProseMirror::-webkit-scrollbar {\n display: none;\n }\n\n /* OneLinerDocument is inline-only; keep p inline if a schema ever wraps text. */\n .ProseMirror p {\n margin: 0;\n display: inline;\n line-height: inherit;\n }\n\n /* Read-only display: no input padding/height box (v1 skipped chrome when readOnly).\n * Inherit color/weight so list name links (text-blue-600 font-bold) show through. */\n :host([readonly]) .ProseMirror {\n padding-block: 0;\n padding-inline: 0;\n height: auto;\n max-height: none;\n background: transparent;\n overflow: visible;\n white-space: normal;\n color: inherit;\n font-weight: inherit;\n font-size: inherit;\n }\n\n ${variableTagStyles}\n }\n`;\n\nexport const tiptapContentProseMirrorStyles = css`\n @layer pk-component {\n /* Inherit host color/size so light-DOM wrappers (warning banners, badges)\n can restyle read-only TipTap without piercing the shadow tree. */\n .ProseMirror {\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;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AqDrC,kBAAkB;;;AAI5B,IAAa,iCAAiC,GAAG"}
1
+ {"version":3,"file":"tiptap.styles-Cwb_cj9g.js","names":[],"sources":["../../src/components/tiptap/variable-tag-node-view.ts","../../src/components/tiptap/tiptap.styles.ts"],"sourcesContent":["import type { Editor, NodeViewRenderer, NodeViewRendererProps } from '@tiptap/core';\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model';\nimport { uniqueId } from '../../a11y/focus.js';\n\n/** Match kit v1 VariableTagView chip chrome (indigo + remove). */\nconst REMOVE_ICON = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" aria-hidden=\"true\" focusable=\"false\">\n <path fill=\"currentColor\" d=\"M2.1 1.4 5 4.3l2.9-2.9.7.7L5.7 5l2.9 2.9-.7.7L5 5.7l-2.9 2.9-.7-.7L4.3 5 1.4 2.1z\"/>\n</svg>\n`.trim();\n\nexport const PK_VARIABLE_TAG_CONFIGURE_EVENT = 'pk-variable-tag-configure';\n\nexport type PkVariableTagConfigureDetail = {\n editor: Editor;\n anchor: HTMLElement;\n attrs: Record<string, unknown>;\n getPos: () => number | undefined;\n updateAttributes: (attributes: Record<string, unknown>) => void;\n deleteNode: () => void;\n};\n\nconst findTiptapHost = (viewDom: HTMLElement): HTMLElement | null => {\n let node: Node | null = viewDom;\n while (node) {\n if (node instanceof HTMLElement && node.localName.startsWith('pk-tiptap')) {\n return node;\n }\n\n node = node.parentNode instanceof ShadowRoot\n ? node.parentNode.host\n : node.parentNode;\n }\n\n return null;\n};\n\nconst emitConfigure = (\n editor: Editor,\n detail: PkVariableTagConfigureDetail,\n) => {\n const viewDom = editor.view.dom;\n const host = findTiptapHost(viewDom);\n\n // Preferred bridge for React/Formie: property callback on <pk-tiptap-*>.\n const configure = host && 'variableTagConfigure' in host\n ? (host as HTMLElement & {\n variableTagConfigure?: ((detail: PkVariableTagConfigureDetail) => void) | null;\n }).variableTagConfigure\n : null;\n\n if (typeof configure === 'function') {\n configure(detail);\n }\n\n // Composed event is the reliable Formie path (document capture listener).\n const target = host ?? viewDom;\n target.dispatchEvent(new CustomEvent(PK_VARIABLE_TAG_CONFIGURE_EVENT, {\n bubbles: true,\n composed: true,\n detail,\n }));\n};\n\n/**\n * DOM NodeViewRendererProps do NOT include React's `deleteNode` / `updateAttributes`\n * (those live on NodeViewProps for ReactNodeViewRenderer only). Build them from\n * editor + getPos — same operations ReactNodeViewRenderer wires for VariableTagView.\n */\nfunction createNodeViewCommands(\n editor: Editor,\n getPos: NodeViewRendererProps['getPos'],\n) {\n const resolvePos = (): number | undefined => {\n const pos = typeof getPos === 'function' ? getPos() : getPos;\n return typeof pos === 'number' ? pos : undefined;\n };\n\n const deleteNode = () => {\n const pos = resolvePos();\n if (typeof pos !== 'number') {\n return;\n }\n\n const live = editor.state.doc.nodeAt(pos);\n if (!live || live.type.name !== 'variableTag') {\n return;\n }\n\n editor\n .chain()\n .focus()\n .deleteRange({ from: pos, to: pos + live.nodeSize })\n .run();\n };\n\n const updateAttributes = (attributes: Record<string, unknown>) => {\n const pos = resolvePos();\n if (typeof pos !== 'number') {\n return;\n }\n\n const live = editor.state.doc.nodeAt(pos);\n if (!live || live.type.name !== 'variableTag') {\n return;\n }\n\n editor\n .chain()\n .command(({ tr, dispatch }) => {\n if (dispatch) {\n tr.setNodeMarkup(pos, undefined, {\n ...live.attrs,\n ...attributes,\n });\n }\n return true;\n })\n .run();\n };\n\n return { deleteNode, updateAttributes, resolvePos };\n}\n\n/**\n * DOM node view for variable tags in vanilla editors.\n * Chip + remove match kit v1; configure UI is opened via `pk-variable-tag-configure`\n * (Formie mounts the edit overlay beside the WC editor).\n */\nexport function createVariableTagDomNodeView(): NodeViewRenderer {\n return (props) => {\n const { editor, getPos } = props;\n const { deleteNode, updateAttributes, resolvePos } = createNodeViewCommands(editor, getPos);\n\n let currentNode: ProseMirrorNode = props.node;\n\n const syncUnresolvedPresentation = (attrs: Record<string, unknown>) => {\n const unresolved = Boolean(attrs.unresolved);\n const token = String(attrs.value ?? '');\n const chipLabel = String(attrs.label || attrs.value || '');\n\n dom.classList.toggle('pk-variable-tag--unresolved', unresolved);\n if (unresolved) {\n dom.dataset.unresolved = 'true';\n // Extra context for AT — not HTML title (avoids native hover tooltip).\n const description = token\n ? `Unknown or missing reference — ${token}`\n : 'Unknown or missing reference';\n dom.setAttribute('aria-description', description);\n label.setAttribute('aria-invalid', 'true');\n } else {\n delete dom.dataset.unresolved;\n dom.removeAttribute('aria-description');\n label.removeAttribute('aria-invalid');\n }\n\n label.textContent = chipLabel;\n };\n\n const dom = document.createElement('span');\n dom.className = 'pk-variable-tag';\n dom.id = uniqueId('pk-variable-tag');\n dom.setAttribute('contenteditable', 'false');\n // Do NOT set draggable=true permanently — HTML5-draggable hosts suppress click,\n // which kills configure. ProseMirror sets draggable temporarily on mousedown drag.\n // TipTap React node views use data-drag-handle on a TipTap NodeView class; keep the\n // attr for parity, but drag itself is PM's selectable+draggable atom behavior.\n dom.setAttribute('data-drag-handle', '');\n dom.dataset.label = String(currentNode.attrs.label ?? '');\n dom.dataset.variableValue = String(currentNode.attrs.value ?? '');\n\n // Match kit v1 VariableTagView: real button for activate.\n const label = document.createElement('button');\n label.type = 'button';\n label.className = 'pk-variable-tag__label';\n label.draggable = false;\n dom.append(label);\n syncUnresolvedPresentation(currentNode.attrs);\n\n let removeButton: HTMLButtonElement | null = null;\n let openOnInsertHandled = false;\n let openedAt = 0;\n\n const readLiveAttrs = () => {\n const pos = resolvePos();\n if (typeof pos === 'number') {\n const live = editor.state.doc.nodeAt(pos);\n if (live?.type.name === 'variableTag') {\n return { ...live.attrs };\n }\n }\n\n return { ...currentNode.attrs };\n };\n\n const openConfigure = () => {\n if (!editor.isEditable) {\n return;\n }\n\n // Dedupe repeated emits from nested handlers / openOnInsert.\n const now = Date.now();\n if (now - openedAt < 300) {\n return;\n }\n openedAt = now;\n\n // Strip any HTML5-draggable PM may have armed so configure stays clickable\n // after this interaction (draggable hosts suppress subsequent clicks).\n dom.removeAttribute('draggable');\n\n emitConfigure(editor, {\n editor,\n anchor: dom,\n attrs: readLiveAttrs(),\n getPos: resolvePos,\n updateAttributes,\n deleteNode,\n });\n };\n\n // Open on pointerdown — before ProseMirror can arm HTML5 drag on the atom.\n label.addEventListener('pointerdown', (event) => {\n if (event.button !== 0) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n openConfigure();\n });\n label.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n openConfigure();\n });\n\n const syncRemoveButton = (editable: boolean) => {\n if (editable) {\n if (removeButton) {\n return;\n }\n\n removeButton = document.createElement('button');\n removeButton.type = 'button';\n removeButton.className = 'pk-variable-tag__remove';\n removeButton.setAttribute('aria-label', 'Remove');\n removeButton.draggable = false;\n removeButton.innerHTML = REMOVE_ICON;\n removeButton.addEventListener('pointerdown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n });\n removeButton.addEventListener('click', (event) => {\n event.preventDefault();\n event.stopPropagation();\n deleteNode();\n });\n dom.append(removeButton);\n return;\n }\n\n removeButton?.remove();\n removeButton = null;\n };\n\n syncRemoveButton(editor.isEditable);\n\n if (currentNode.attrs.openOnInsert && editor.isEditable && !openOnInsertHandled) {\n openOnInsertHandled = true;\n queueMicrotask(() => {\n updateAttributes({ openOnInsert: false });\n openConfigure();\n });\n }\n\n return {\n dom,\n // TipTap React node views stop PM from handling events inside the chip —\n // that prevents `draggable=true` arming, which otherwise kills configure.\n // Drag still works via outer NodeSelection + data-drag-handle when the\n // pointer starts on the chip chrome (not the label/remove controls).\n stopEvent: (event) => {\n const target = event.target as Node | null;\n if (!(target instanceof Element)) {\n return false;\n }\n\n return Boolean(\n target.closest('.pk-variable-tag__label')\n || target.closest('.pk-variable-tag__remove'),\n );\n },\n selectNode: () => {\n dom.classList.add('ProseMirror-selectednode');\n // Never keep HTML5-draggable while selected — it suppresses clicks.\n dom.removeAttribute('draggable');\n },\n deselectNode: () => {\n dom.classList.remove('ProseMirror-selectednode');\n dom.removeAttribute('draggable');\n },\n update(updatedNode) {\n if (updatedNode.type.name !== 'variableTag') {\n return false;\n }\n\n currentNode = updatedNode;\n dom.dataset.label = String(updatedNode.attrs.label ?? '');\n dom.dataset.variableValue = String(updatedNode.attrs.value ?? '');\n syncUnresolvedPresentation(updatedNode.attrs);\n syncRemoveButton(editor.isEditable);\n return true;\n },\n };\n };\n}\n","import { css } from 'lit';\n\n/**\n * Indigo chip matching kit v1 VariableTagView (`bg-[#5C6BC0] text-white rounded-[2px]`).\n * Shared by rich editor + single-line input ProseMirror hosts.\n */\nconst variableTagStyles = css`\n .pk-variable-tag {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n max-width: 100%;\n margin-inline: 1px;\n margin-block-start: -3px;\n padding: 0;\n border-radius: 2px;\n background: #5c6bc0;\n color: #fff;\n font-size: 11px;\n font-weight: 400;\n line-height: 1;\n white-space: nowrap;\n vertical-align: middle;\n overflow: hidden;\n cursor: default;\n box-sizing: border-box;\n }\n\n /* Unresolved / missing reference — muted grey (not alarm yellow). */\n .pk-variable-tag--unresolved {\n background: var(--pk-color-gray-100, #f3f4f6);\n color: var(--pk-color-gray-600, #4b5563);\n box-shadow: inset 0 0 0 1px var(--pk-color-gray-300, #d1d5db);\n }\n\n .pk-variable-tag--unresolved.ProseMirror-selectednode {\n box-shadow:\n inset 0 0 0 1px var(--pk-color-gray-400, #9ca3af),\n 0 0 0 2px rgba(156, 163, 175, 0.45);\n }\n\n .pk-variable-tag.ProseMirror-selectednode {\n outline: none;\n box-shadow: 0 0 0 2px rgba(123, 140, 232, 0.5);\n }\n\n .pk-variable-tag__label {\n display: inline-flex;\n align-items: center;\n max-width: 220px;\n margin: 0;\n padding: 4px 5px;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: inherit;\n line-height: inherit;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n user-select: none;\n }\n\n .pk-variable-tag__remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n margin: 0;\n padding: 4px 5px 4px 4px;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n line-height: 0;\n appearance: none;\n }\n\n /* Keep the configure action's keyboard indicator around the whole chip,\n * while the separate remove action identifies only its own hit area. */\n .pk-variable-tag:has(> .pk-variable-tag__label:focus-visible) {\n /* The transparent outline remains visible in forced-colors mode. */\n outline: 2px solid transparent;\n outline-offset: 2px;\n box-shadow: 0 0 0 3px rgba(123, 140, 232, 0.5);\n }\n\n .pk-variable-tag__label:focus-visible {\n outline: none;\n }\n\n .pk-variable-tag__remove:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: -3px;\n border-radius: 2px;\n }\n\n .pk-variable-tag__remove svg {\n display: block;\n width: 10px;\n height: 10px;\n pointer-events: none;\n }\n`;\n\nexport const tiptapProseMirrorStyles = css`\n @layer pk-component {\n .ProseMirror {\n outline: none;\n min-height: 2rem;\n padding: 1rem;\n background: rgb(251, 252, 254);\n /* Craft CP body text (~gray-700), not gray-900. */\n color: var(--pk-color-gray-700);\n font-family: var(--pk-font-family);\n /* Match pk-input / body (14px). sm (13px) matched field instructions and looked undersized vs v1. */\n font-size: var(--pk-font-size-base);\n line-height: 1.5;\n white-space: pre-wrap;\n box-sizing: border-box;\n }\n\n .ProseMirror p {\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror p:last-child {\n margin-bottom: 0;\n }\n\n .ProseMirror h1 {\n font-size: 1.25rem;\n font-weight: 700;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror h2 {\n font-size: 1.125rem;\n font-weight: 600;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror h3,\n .ProseMirror h4,\n .ProseMirror h5,\n .ProseMirror h6 {\n font-weight: 600;\n margin: 0 0 0.5rem;\n }\n\n .ProseMirror a {\n color: var(--pk-color-blue-600);\n text-decoration: underline;\n cursor: pointer;\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n margin: 0 0 0.5rem;\n padding-left: 1.25rem;\n }\n\n .ProseMirror blockquote {\n margin: 0 0 0.5rem;\n padding-left: 0.75rem;\n border-left: 3px solid var(--pk-color-gray-300);\n color: var(--pk-color-gray-600);\n }\n\n .ProseMirror code {\n font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);\n font-size: var(--pk-font-size-mono, 0.9em);\n line-height: var(--pk-line-height-mono, 1.5);\n background: var(--pk-color-gray-100);\n border-radius: 0.2rem;\n padding: 0.1rem 0.25rem;\n }\n\n .ProseMirror pre {\n margin: 0 0 0.5rem;\n padding: 0.75rem;\n background: var(--pk-color-gray-900);\n color: var(--pk-color-gray-50);\n border-radius: var(--pk-radius-md);\n overflow-x: auto;\n font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);\n font-size: var(--pk-font-size-mono, 0.9em);\n line-height: var(--pk-line-height-mono, 1.5);\n }\n\n ${variableTagStyles}\n }\n`;\n\n/**\n * Single-line TipTap field — same box metrics as `pk-input` .input\n * (14px / line-height 1.4 / padding 6px 8px).\n *\n * ProseMirror always injects `br.ProseMirror-trailingBreak` for the caret.\n * Never `display: none` it — that freezes one-liner docs after the first character.\n * Clip to one line height instead so the break cannot inflate the control.\n */\nexport const tiptapInputProseMirrorStyles = css`\n @layer pk-component {\n .ProseMirror {\n outline: none;\n margin: 0;\n /* Match stock pk-input padding by default. Hosts can override density via\n * --pk-tiptap-input-* (light DOM cannot style .ProseMirror in the shadow tree).\n */\n padding-block: var(--pk-tiptap-input-padding-block, 6px);\n padding-inline-start: var(--pk-tiptap-input-padding-inline-start, 8px);\n padding-inline-end: var(--pk-tiptap-input-padding-inline-end, 8px);\n /* One-liner clip: padding + control line-height (v1 text-sm), not a fixed shell token. */\n height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));\n max-height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));\n background: var(--pk-input-bg);\n /* Craft CP body / field value text. */\n color: var(--pk-color-gray-700);\n font-family: var(--pk-font-family);\n font-size: var(--pk-tiptap-input-font-size, var(--pk-font-size-base));\n line-height: var(--pk-tiptap-input-line-height, var(--pk-input-control-line-height, 1.25rem));\n white-space: nowrap;\n overflow-x: auto;\n overflow-y: hidden;\n box-sizing: border-box;\n scrollbar-width: none;\n }\n\n .ProseMirror::-webkit-scrollbar {\n display: none;\n }\n\n /* OneLinerDocument is inline-only; keep p inline if a schema ever wraps text. */\n .ProseMirror p {\n margin: 0;\n display: inline;\n line-height: inherit;\n }\n\n /* Read-only display: no input padding/height box (v1 skipped chrome when readOnly).\n * Inherit color/weight so list name links (text-blue-600 font-bold) show through. */\n :host([readonly]) .ProseMirror {\n padding-block: 0;\n padding-inline: 0;\n height: auto;\n max-height: none;\n background: transparent;\n overflow: visible;\n white-space: normal;\n color: inherit;\n font-weight: inherit;\n font-size: inherit;\n }\n\n ${variableTagStyles}\n }\n`;\n\nexport const tiptapContentProseMirrorStyles = css`\n @layer pk-component {\n /* Inherit host color/size so light-DOM wrappers (warning banners, badges)\n can restyle read-only TipTap without piercing the shadow tree. */\n .ProseMirror {\n outline: none;\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n }\n\n .ProseMirror p {\n margin: 0;\n }\n }\n`;\n"],"mappings":";;;;AAKA,IAAM,cAAc;;;;EAIlB,KAAK;AAEP,IAAa,kCAAkC;AAW/C,IAAM,kBAAkB,YAA6C;CACjE,IAAI,OAAoB;CACxB,OAAO,MAAM;EACT,IAAI,gBAAgB,eAAe,KAAK,UAAU,WAAW,WAAW,GACpE,OAAO;EAGX,OAAO,KAAK,sBAAsB,aAC5B,KAAK,WAAW,OAChB,KAAK;CACf;CAEA,OAAO;AACX;AAEA,IAAM,iBACF,QACA,WACC;CACD,MAAM,UAAU,OAAO,KAAK;CAC5B,MAAM,OAAO,eAAe,OAAO;CAGnC,MAAM,YAAY,QAAQ,0BAA0B,OAC7C,KAEA,uBACD;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AI,gBAAgB,WAAW;GACnC;GACA,oBAAoB;IAChB,IAAI,UAAU,OAAO,0BAA0B;IAC/C,IAAI,gBAAgB,WAAW;GACnC;GACA,OAAO,aAAa;IAChB,IAAI,YAAY,KAAK,SAAS,eAC1B,OAAO;IAGX,cAAc;IACd,IAAI,QAAQ,QAAQ,OAAO,YAAY,MAAM,SAAS,EAAE;IACxD,IAAI,QAAQ,gBAAgB,OAAO,YAAY,MAAM,SAAS,EAAE;IAChE,2BAA2B,YAAY,KAAK;IAC5C,iBAAiB,OAAO,UAAU;IAClC,OAAO;GACX;EACJ;CACJ;AACJ;;;;;;;ACtTA,IAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqG7B,IAAa,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqFhC,kBAAkB;;;;;;;;;;;AAY5B,IAAa,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqDrC,kBAAkB;;;AAI5B,IAAa,iCAAiC,GAAG"}
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapContent } from "../../chunks/pk-tiptap-content-C2qzGQKj.js";
1
+ import { t as PkTiptapContent } from "../../chunks/pk-tiptap-content-DmS_2EUi.js";
2
2
  export { PkTiptapContent };
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapEditor } from "../../chunks/pk-tiptap-editor-y_QyNSR-.js";
1
+ import { t as PkTiptapEditor } from "../../chunks/pk-tiptap-editor-DCgHtgoi.js";
2
2
  export { PkTiptapEditor };
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapInput } from "../../chunks/pk-tiptap-input-0Xy6rrot.js";
1
+ import { t as PkTiptapInput } from "../../chunks/pk-tiptap-input-asrD-8W6.js";
2
2
  export { PkTiptapInput };
@@ -1 +1 @@
1
- {"version":3,"file":"tiptap.styles.d.ts","sourceRoot":"","sources":["../../../src/components/tiptap/tiptap.styles.ts"],"names":[],"mappings":"AAwFA,eAAO,MAAM,uBAAuB,yBAuFnC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,yBAuDxC,CAAC;AAEF,eAAO,MAAM,8BAA8B,yBAgB1C,CAAC"}
1
+ {"version":3,"file":"tiptap.styles.d.ts","sourceRoot":"","sources":["../../../src/components/tiptap/tiptap.styles.ts"],"names":[],"mappings":"AA2GA,eAAO,MAAM,uBAAuB,yBAuFnC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,yBAuDxC,CAAC;AAEF,eAAO,MAAM,8BAA8B,yBAgB1C,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapContent } from "../chunks/pk-tiptap-content-C2qzGQKj.js";
1
+ import { t as PkTiptapContent } from "../chunks/pk-tiptap-content-DmS_2EUi.js";
2
2
  export { PkTiptapContent };
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapEditor } from "../chunks/pk-tiptap-editor-y_QyNSR-.js";
1
+ import { t as PkTiptapEditor } from "../chunks/pk-tiptap-editor-DCgHtgoi.js";
2
2
  export { PkTiptapEditor };
@@ -1,2 +1,2 @@
1
- import { t as PkTiptapInput } from "../chunks/pk-tiptap-input-0Xy6rrot.js";
1
+ import { t as PkTiptapInput } from "../chunks/pk-tiptap-input-asrD-8W6.js";
2
2
  export { PkTiptapInput };
package/dist/index.js CHANGED
@@ -97,9 +97,9 @@ import { t as PkOptionGroup } from "./chunks/pk-option-group-D6bHfn0j.js";
97
97
  import "./components/select.js";
98
98
  import "./components/time-picker.js";
99
99
  import "./components/spinner.js";
100
- import { t as PkTiptapContent } from "./chunks/pk-tiptap-content-C2qzGQKj.js";
101
- import { t as PkTiptapEditor } from "./chunks/pk-tiptap-editor-y_QyNSR-.js";
102
- import { t as PkTiptapInput } from "./chunks/pk-tiptap-input-0Xy6rrot.js";
100
+ import { t as PkTiptapContent } from "./chunks/pk-tiptap-content-DmS_2EUi.js";
101
+ import { t as PkTiptapEditor } from "./chunks/pk-tiptap-editor-DCgHtgoi.js";
102
+ import { t as PkTiptapInput } from "./chunks/pk-tiptap-input-asrD-8W6.js";
103
103
  import { _ as setPortalClassName, a as startLoader, c as setBasePath, d as getPortalClassName, f as getPortalContainer, g as resolvePositionMethod, h as getShadowRootSelectors, i as preventTurboFouce, l as allDefined, m as getPortalTargetForAppend, n as FOUCE_TIMEOUT_MS, o as stopLoader, p as getPortalMountElement, r as discover, s as getBasePath, t as DISCOVERY_COMPLETE_EVENT, u as configurePluginKitWeb, v as setPortalContainer, y as setShadowRootSelectors } from "./chunks/autoloader-DcwybeWc.js";
104
104
  import { t as BUNDLER_TAG_IMPORT_PATHS } from "./chunks/component-registry-B5pnAZsb.js";
105
105
  import { t as createRegisterComponents } from "./chunks/register-components-CZtpgZe3.js";
package/dist/register.js CHANGED
@@ -83,9 +83,9 @@ import { t as PkOptionGroup } from "./chunks/pk-option-group-D6bHfn0j.js";
83
83
  import "./components/select.js";
84
84
  import "./components/time-picker.js";
85
85
  import "./components/spinner.js";
86
- import { t as PkTiptapContent } from "./chunks/pk-tiptap-content-C2qzGQKj.js";
87
- import { t as PkTiptapEditor } from "./chunks/pk-tiptap-editor-y_QyNSR-.js";
88
- import { t as PkTiptapInput } from "./chunks/pk-tiptap-input-0Xy6rrot.js";
86
+ import { t as PkTiptapContent } from "./chunks/pk-tiptap-content-DmS_2EUi.js";
87
+ import { t as PkTiptapEditor } from "./chunks/pk-tiptap-editor-DCgHtgoi.js";
88
+ import { t as PkTiptapInput } from "./chunks/pk-tiptap-input-asrD-8W6.js";
89
89
  import { t as BUNDLER_TAG_IMPORT_PATHS } from "./chunks/component-registry-B5pnAZsb.js";
90
90
  import { t as createRegisterComponents } from "./chunks/register-components-CZtpgZe3.js";
91
91
  import "@verbb/plugin-kit-icons/all.js";