@dialpad/dialtone 9.177.1 → 9.178.0

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 (140) hide show
  1. package/dist/css/dialtone-default-theme.css +75 -0
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone.css +75 -0
  4. package/dist/css/dialtone.min.css +1 -1
  5. package/dist/css/tokens-docs.json +1 -1
  6. package/dist/tokens/doc.json +116900 -116900
  7. package/dist/vue3/{attachment_carousel-DMKCJe7S.cjs → attachment_carousel-BHxR7A76.cjs} +1 -1
  8. package/dist/vue3/{attachment_carousel-DMKCJe7S.cjs.map → attachment_carousel-BHxR7A76.cjs.map} +1 -1
  9. package/dist/vue3/{attachment_carousel-gV6IHYgP.js → attachment_carousel-CouFqFMw.js} +1 -1
  10. package/dist/vue3/{attachment_carousel-gV6IHYgP.js.map → attachment_carousel-CouFqFMw.js.map} +1 -1
  11. package/dist/vue3/component-documentation.json +1 -1
  12. package/dist/vue3/components/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -0
  13. package/dist/vue3/components/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
  14. package/dist/vue3/components/resizable/composables/computeLayout.d.ts +35 -0
  15. package/dist/vue3/components/resizable/composables/computeLayout.d.ts.map +1 -0
  16. package/dist/vue3/components/resizable/composables/constraintResolver.d.ts +22 -0
  17. package/dist/vue3/components/resizable/composables/constraintResolver.d.ts.map +1 -0
  18. package/dist/vue3/components/resizable/composables/index.d.ts +16 -0
  19. package/dist/vue3/components/resizable/composables/index.d.ts.map +1 -0
  20. package/dist/vue3/components/resizable/composables/useResizableAnnouncements.d.ts +6 -0
  21. package/dist/vue3/components/resizable/composables/useResizableAnnouncements.d.ts.map +1 -0
  22. package/dist/vue3/components/resizable/composables/useResizableCalculations.d.ts +14 -0
  23. package/dist/vue3/components/resizable/composables/useResizableCalculations.d.ts.map +1 -0
  24. package/dist/vue3/components/resizable/composables/useResizableDrag.d.ts +42 -0
  25. package/dist/vue3/components/resizable/composables/useResizableDrag.d.ts.map +1 -0
  26. package/dist/vue3/components/resizable/composables/useResizableGroup.d.ts +25 -0
  27. package/dist/vue3/components/resizable/composables/useResizableGroup.d.ts.map +1 -0
  28. package/dist/vue3/components/resizable/composables/useResizableKeyboard.d.ts +41 -0
  29. package/dist/vue3/components/resizable/composables/useResizableKeyboard.d.ts.map +1 -0
  30. package/dist/vue3/components/resizable/composables/useResizableOffset.d.ts +15 -0
  31. package/dist/vue3/components/resizable/composables/useResizableOffset.d.ts.map +1 -0
  32. package/dist/vue3/components/resizable/composables/useResizablePanelControls.d.ts +46 -0
  33. package/dist/vue3/components/resizable/composables/useResizablePanelControls.d.ts.map +1 -0
  34. package/dist/vue3/components/resizable/composables/useResizablePanelState.d.ts +9 -0
  35. package/dist/vue3/components/resizable/composables/useResizablePanelState.d.ts.map +1 -0
  36. package/dist/vue3/components/resizable/composables/useResizableStorage.d.ts +12 -0
  37. package/dist/vue3/components/resizable/composables/useResizableStorage.d.ts.map +1 -0
  38. package/dist/vue3/components/resizable/index.d.ts +6 -0
  39. package/dist/vue3/components/resizable/index.d.ts.map +1 -0
  40. package/dist/vue3/components/resizable/resizable.vue.d.ts +69 -0
  41. package/dist/vue3/components/resizable/resizable.vue.d.ts.map +1 -0
  42. package/dist/vue3/components/resizable/resizable_constants.d.ts +103 -0
  43. package/dist/vue3/components/resizable/resizable_constants.d.ts.map +1 -0
  44. package/dist/vue3/components/resizable/resizable_handle.vue.d.ts +22 -0
  45. package/dist/vue3/components/resizable/resizable_handle.vue.d.ts.map +1 -0
  46. package/dist/vue3/components/resizable/resizable_panel.vue.d.ts +44 -0
  47. package/dist/vue3/components/resizable/resizable_panel.vue.d.ts.map +1 -0
  48. package/dist/vue3/components/resizable/resizable_utils.d.ts +15 -0
  49. package/dist/vue3/components/resizable/resizable_utils.d.ts.map +1 -0
  50. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.d.ts +2 -0
  51. package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  52. package/dist/vue3/components/scroller/scroller.vue.d.ts +6 -8
  53. package/dist/vue3/components/scroller/scroller.vue.d.ts.map +1 -1
  54. package/dist/vue3/components/split_button/split_button.vue.d.ts +4 -4
  55. package/dist/vue3/dialtone-vue.cjs +1 -1
  56. package/dist/vue3/dialtone-vue.js +56 -51
  57. package/dist/vue3/index.d.ts +1 -0
  58. package/dist/vue3/lib/attachment-carousel/attachment-carousel.cjs +1 -1
  59. package/dist/vue3/lib/attachment-carousel/attachment-carousel.js +1 -1
  60. package/dist/vue3/lib/attachment-carousel/index.cjs +1 -1
  61. package/dist/vue3/lib/attachment-carousel/index.js +1 -1
  62. package/dist/vue3/lib/editor/editor.cjs +1 -1
  63. package/dist/vue3/lib/editor/editor.js +1 -1
  64. package/dist/vue3/lib/message-input/index.cjs +1 -1
  65. package/dist/vue3/lib/message-input/index.js +1 -1
  66. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  67. package/dist/vue3/lib/message-input/message-input.js +1 -1
  68. package/dist/vue3/lib/resizable/index.cjs +1 -0
  69. package/dist/vue3/lib/resizable/index.js +5 -0
  70. package/dist/vue3/lib/resizable/resizable-handle.cjs +1 -0
  71. package/dist/vue3/lib/resizable/resizable-handle.js +2 -0
  72. package/dist/vue3/lib/resizable/resizable-panel.cjs +2 -0
  73. package/dist/vue3/lib/resizable/resizable-panel.cjs.map +1 -0
  74. package/dist/vue3/lib/resizable/resizable-panel.js +132 -0
  75. package/dist/vue3/lib/resizable/resizable-panel.js.map +1 -0
  76. package/dist/vue3/lib/resizable/resizable.cjs +1 -0
  77. package/dist/vue3/lib/resizable/resizable.js +2 -0
  78. package/dist/vue3/lib/rich-text-editor/index.cjs +1 -1
  79. package/dist/vue3/lib/rich-text-editor/index.js +1 -1
  80. package/dist/vue3/lib/rich-text-editor/markdownRenderer.cjs +1 -7
  81. package/dist/vue3/lib/rich-text-editor/markdownRenderer.js +2 -62
  82. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +1 -1
  83. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +1 -1
  84. package/dist/vue3/lib/scroller/index.cjs +1 -1
  85. package/dist/vue3/lib/scroller/index.js +1 -1
  86. package/dist/vue3/lib/scroller/scroller.cjs +1 -1
  87. package/dist/vue3/lib/scroller/scroller.js +1 -1
  88. package/dist/vue3/lib/toast/index.cjs +1 -1
  89. package/dist/vue3/lib/toast/index.js +1 -1
  90. package/dist/vue3/lib/toast/toast.cjs +1 -1
  91. package/dist/vue3/lib/toast/toast.js +1 -1
  92. package/dist/vue3/markdownRenderer-DCgGQseq.cjs +31 -0
  93. package/dist/vue3/markdownRenderer-DCgGQseq.cjs.map +1 -0
  94. package/dist/vue3/markdownRenderer-D_P94RyM.js +322 -0
  95. package/dist/vue3/markdownRenderer-D_P94RyM.js.map +1 -0
  96. package/dist/vue3/{message_input-VmltTreF.cjs → message_input-AWgvtwMV.cjs} +2 -2
  97. package/dist/vue3/{message_input-VmltTreF.cjs.map → message_input-AWgvtwMV.cjs.map} +1 -1
  98. package/dist/vue3/{message_input-tVB6JYJm.js → message_input-CHlTsBGK.js} +2 -2
  99. package/dist/vue3/{message_input-tVB6JYJm.js.map → message_input-CHlTsBGK.js.map} +1 -1
  100. package/dist/vue3/node_modules/@tiptap/vue-3.cjs.map +1 -1
  101. package/dist/vue3/node_modules/@tiptap/vue-3.js +1 -1
  102. package/dist/vue3/node_modules/@tiptap/vue-3.js.map +1 -1
  103. package/dist/vue3/recipes/conversation_view/editor/editor.vue.d.ts +2 -0
  104. package/dist/vue3/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  105. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.d.ts +2 -0
  106. package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  107. package/dist/vue3/resizable-D4-peBOl.js +960 -0
  108. package/dist/vue3/resizable-D4-peBOl.js.map +1 -0
  109. package/dist/vue3/resizable-aOVGO_Os.cjs +2 -0
  110. package/dist/vue3/resizable-aOVGO_Os.cjs.map +1 -0
  111. package/dist/vue3/resizable_handle-BlKBiWnx.js +307 -0
  112. package/dist/vue3/resizable_handle-BlKBiWnx.js.map +1 -0
  113. package/dist/vue3/resizable_handle-RIKS8frB.cjs +2 -0
  114. package/dist/vue3/resizable_handle-RIKS8frB.cjs.map +1 -0
  115. package/dist/vue3/resizable_utils-BComtrMV.js +131 -0
  116. package/dist/vue3/resizable_utils-BComtrMV.js.map +1 -0
  117. package/dist/vue3/resizable_utils-DhuzXRdP.cjs +2 -0
  118. package/dist/vue3/resizable_utils-DhuzXRdP.cjs.map +1 -0
  119. package/dist/vue3/{rich_text_editor-CtCGNkSD.js → rich_text_editor-Ba67C4Uk.js} +421 -454
  120. package/dist/vue3/rich_text_editor-Ba67C4Uk.js.map +1 -0
  121. package/dist/vue3/rich_text_editor-DMP5eTlf.cjs +10 -0
  122. package/dist/vue3/rich_text_editor-DMP5eTlf.cjs.map +1 -0
  123. package/dist/vue3/{scroller-Ckquh-PU.js → scroller-BGVDh3sq.js} +1 -1
  124. package/dist/vue3/{scroller-Ckquh-PU.js.map → scroller-BGVDh3sq.js.map} +1 -1
  125. package/dist/vue3/{scroller-06ayn-64.cjs → scroller-CjAsgjl9.cjs} +1 -1
  126. package/dist/vue3/{scroller-06ayn-64.cjs.map → scroller-CjAsgjl9.cjs.map} +1 -1
  127. package/dist/vue3/{toast-B1zeUPtg.js → toast-DvPN-bCi.js} +1 -1
  128. package/dist/vue3/{toast-B1zeUPtg.js.map → toast-DvPN-bCi.js.map} +1 -1
  129. package/dist/vue3/{toast-0QfP90_3.cjs → toast-d8_zmgkL.cjs} +1 -1
  130. package/dist/vue3/{toast-0QfP90_3.cjs.map → toast-d8_zmgkL.cjs.map} +1 -1
  131. package/dist/vue3/useResizableCalculations-BDITle3Q.cjs +2 -0
  132. package/dist/vue3/useResizableCalculations-BDITle3Q.cjs.map +1 -0
  133. package/dist/vue3/useResizableCalculations-DAajatT4.js +80 -0
  134. package/dist/vue3/useResizableCalculations-DAajatT4.js.map +1 -0
  135. package/package.json +1 -1
  136. package/dist/vue3/lib/rich-text-editor/markdownRenderer.cjs.map +0 -1
  137. package/dist/vue3/lib/rich-text-editor/markdownRenderer.js.map +0 -1
  138. package/dist/vue3/rich_text_editor-CEwKDuzw.cjs +0 -10
  139. package/dist/vue3/rich_text_editor-CEwKDuzw.cjs.map +0 -1
  140. package/dist/vue3/rich_text_editor-CtCGNkSD.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownRenderer-DCgGQseq.cjs","names":["Node"],"sources":["../../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_react_4n7lapq7bmfej5hsrzhdkukr6e/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js","../components/rich_text_editor/markdownRenderer.js"],"sourcesContent":["// src/pm/extensionRenderer.ts\nimport {\n getAttributesFromExtensions,\n getExtensionField,\n getSchemaByResolvedExtensions,\n resolveExtensions,\n splitExtensions\n} from \"@tiptap/core\";\nimport { Node } from \"@tiptap/pm/model\";\n\n// src/helpers.ts\nimport { mergeAttributes } from \"@tiptap/core\";\nfunction getAttributes(nodeOrMark, extensionAttributes, onlyRenderedAttributes) {\n const nodeOrMarkAttributes = nodeOrMark.attrs;\n if (!nodeOrMarkAttributes) {\n return {};\n }\n return extensionAttributes.filter((item) => {\n if (item.type !== (typeof nodeOrMark.type === \"string\" ? nodeOrMark.type : nodeOrMark.type.name)) {\n return false;\n }\n if (onlyRenderedAttributes) {\n return item.attribute.rendered;\n }\n return true;\n }).map((item) => {\n if (!item.attribute.renderHTML) {\n return {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }\n return item.attribute.renderHTML(nodeOrMarkAttributes) || {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});\n}\nfunction getHTMLAttributes(nodeOrMark, extensionAttributes) {\n return getAttributes(nodeOrMark, extensionAttributes, true);\n}\n\n// src/pm/extensionRenderer.ts\nfunction mapNodeExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledNode) {\n return [extension.name, options.unhandledNode];\n }\n return [\n extension.name,\n () => {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method, please implement it or override the corresponding \"nodeMapping\" method to have a custom rendering`\n );\n }\n ];\n }\n return [\n extension.name,\n ({ node, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n node,\n HTMLAttributes: getHTMLAttributes(node, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction mapMarkExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledMark) {\n return [extension.name, options.unhandledMark];\n }\n return [\n extension.name,\n () => {\n throw new Error(`Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method`);\n }\n ];\n }\n return [\n extension.name,\n ({ mark, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n mark,\n HTMLAttributes: getHTMLAttributes(mark, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Mark ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction renderToElement({\n renderer,\n domOutputSpecToElement,\n mapDefinedTypes,\n content,\n extensions,\n options\n}) {\n extensions = resolveExtensions(extensions);\n const extensionAttributes = getAttributesFromExtensions(extensions);\n const { nodeExtensions, markExtensions } = splitExtensions(extensions);\n if (!(content instanceof Node)) {\n content = Node.fromJSON(getSchemaByResolvedExtensions(extensions), content);\n }\n return renderer({\n ...options,\n nodeMapping: {\n ...Object.fromEntries(\n nodeExtensions.filter((e) => {\n if (e.name in mapDefinedTypes) {\n return false;\n }\n if (options == null ? void 0 : options.nodeMapping) {\n return !(e.name in options.nodeMapping);\n }\n return true;\n }).map(\n (nodeExtension) => mapNodeExtensionToReactNode(domOutputSpecToElement, nodeExtension, extensionAttributes, options)\n )\n ),\n ...mapDefinedTypes,\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n ...Object.fromEntries(\n markExtensions.filter((e) => {\n if (options == null ? void 0 : options.markMapping) {\n return !(e.name in options.markMapping);\n }\n return true;\n }).map((mark) => mapMarkExtensionToReactNode(domOutputSpecToElement, mark, extensionAttributes, options))\n ),\n ...options == null ? void 0 : options.markMapping\n }\n })({ content });\n}\n\n// src/json/renderer.ts\nfunction TiptapStaticRenderer(renderComponent, {\n nodeMapping,\n markMapping,\n unhandledNode,\n unhandledMark\n}) {\n return function renderContent({\n content,\n parent\n }) {\n var _a;\n const nodeType = typeof content.type === \"string\" ? content.type : content.type.name;\n const NodeHandler = (_a = nodeMapping[nodeType]) != null ? _a : unhandledNode;\n if (!NodeHandler) {\n throw new Error(`missing handler for node type ${nodeType}`);\n }\n const nodeContent = renderComponent({\n component: NodeHandler,\n props: {\n node: content,\n parent,\n renderElement: renderContent,\n // Lazily compute the children to avoid unnecessary recursion\n get children() {\n const children = [];\n if (content.content) {\n content.content.forEach((child) => {\n children.push(\n renderContent({\n content: child,\n parent: content\n })\n );\n });\n }\n return children;\n }\n }\n });\n const markedContent = content.marks ? content.marks.reduce((acc, mark) => {\n var _a2;\n const markType = typeof mark.type === \"string\" ? mark.type : mark.type.name;\n const MarkHandler = (_a2 = markMapping[markType]) != null ? _a2 : unhandledMark;\n if (!MarkHandler) {\n throw new Error(`missing handler for mark type ${markType}`);\n }\n return renderComponent({\n component: MarkHandler,\n props: {\n mark,\n parent,\n node: content,\n children: acc\n }\n });\n }, nodeContent) : nodeContent;\n return markedContent;\n };\n}\n\n// src/json/html-string/string.ts\nfunction renderJSONContentToString(options) {\n return TiptapStaticRenderer((ctx) => {\n return ctx.component(ctx.props);\n }, options);\n}\nfunction serializeAttrsToHTMLString(attrs) {\n const output = Object.entries(attrs || {}).map(([key, value]) => `${key.split(\" \").at(-1)}=${JSON.stringify(value)}`).join(\" \");\n return output ? ` ${output}` : \"\";\n}\nfunction serializeChildrenToHTMLString(children) {\n return [].concat(children || \"\").filter(Boolean).join(\"\");\n}\n\n// src/pm/html-string/html-string.ts\nvar NON_SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([\"iframe\", \"script\", \"style\", \"title\", \"textarea\", \"div\", \"span\", \"a\", \"button\"]);\nfunction domOutputSpecToHTMLString(content) {\n if (typeof content === \"string\") {\n return () => content;\n }\n if (typeof content === \"object\" && \"length\" in content) {\n const [_tag, attrs, children, ...rest] = content;\n let tag = _tag;\n const parts = tag.split(\" \");\n if (parts.length > 1) {\n tag = `${parts[1]} xmlns=\"${parts[0]}\"`;\n }\n if (attrs === void 0) {\n return () => `<${tag}/>`;\n }\n if (attrs === 0) {\n return (child) => `<${tag}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n if (typeof attrs === \"object\") {\n if (Array.isArray(attrs)) {\n if (children === void 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n if (children === 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child))}</${tag}>`;\n }\n if (children === void 0) {\n if (NON_SELF_CLOSING_TAGS.has(tag)) {\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}></${tag}>`;\n }\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}/>`;\n }\n if (children === 0) {\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child)).join(\"\")}</${tag}>`;\n }\n }\n throw new Error(\n \"[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping\",\n {\n cause: content\n }\n );\n}\nfunction renderToHTMLString({\n content,\n extensions,\n options\n}) {\n return renderToElement({\n renderer: renderJSONContentToString,\n domOutputSpecToElement: domOutputSpecToHTMLString,\n mapDefinedTypes: {\n // Map a doc node to concatenated children\n doc: ({ children }) => serializeChildrenToHTMLString(children),\n // Map a text node to its text content\n text: ({ node }) => {\n var _a;\n return (_a = node.text) != null ? _a : \"\";\n }\n },\n content,\n extensions,\n options\n });\n}\n\n// src/pm/markdown/markdown.ts\nfunction renderToMarkdown({\n content,\n extensions,\n options\n}) {\n return renderToHTMLString({\n content,\n extensions,\n options: {\n ...options,\n nodeMapping: {\n bulletList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n orderedList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n listItem({ node, children, parent }) {\n if ((parent == null ? void 0 : parent.type.name) === \"bulletList\") {\n return `- ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n if ((parent == null ? void 0 : parent.type.name) === \"orderedList\") {\n let number = parent.attrs.start || 1;\n parent.forEach((parentChild, _offset, index) => {\n if (node === parentChild) {\n number = index + 1;\n }\n });\n return `${number}. ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n return serializeChildrenToHTMLString(children);\n },\n paragraph({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n },\n heading({ node, children }) {\n const level = node.attrs.level;\n return `${new Array(level).fill(\"#\").join(\"\")} ${children}\n`;\n },\n codeBlock({ node, children }) {\n return `\n\\`\\`\\`${node.attrs.language}\n${serializeChildrenToHTMLString(children)}\n\\`\\`\\`\n`;\n },\n blockquote({ children }) {\n return `\n${serializeChildrenToHTMLString(children).trim().split(\"\\n\").map((a) => `> ${a}`).join(\"\\n\")}`;\n },\n image({ node }) {\n return `![${node.attrs.alt}](${node.attrs.src})`;\n },\n hardBreak() {\n return \"\\n\";\n },\n horizontalRule() {\n return \"\\n---\\n\";\n },\n table({ children, node }) {\n if (!Array.isArray(children)) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n }\n const columnCount = node.children[0].childCount;\n return `\n${serializeChildrenToHTMLString(children[0])}| ${new Array(columnCount).fill(\"---\").join(\" | \")} |\n${serializeChildrenToHTMLString(children.slice(1))}\n`;\n },\n tableRow({ children }) {\n if (Array.isArray(children)) {\n return `| ${children.join(\" | \")} |\n`;\n }\n return `${serializeChildrenToHTMLString(children)}\n`;\n },\n tableHeader({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n tableCell({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n bold({ children }) {\n return `**${serializeChildrenToHTMLString(children)}**`;\n },\n italic({ children, node }) {\n let isBoldToo = false;\n if (node == null ? void 0 : node.marks.some((m) => m.type.name === \"bold\")) {\n isBoldToo = true;\n }\n if (isBoldToo) {\n return `*${serializeChildrenToHTMLString(children)}*`;\n }\n return `_${serializeChildrenToHTMLString(children)}_`;\n },\n code({ children }) {\n return `\\`${serializeChildrenToHTMLString(children)}\\``;\n },\n strike({ children }) {\n return `~~${serializeChildrenToHTMLString(children)}~~`;\n },\n underline({ children }) {\n return `<u>${serializeChildrenToHTMLString(children)}</u>`;\n },\n subscript({ children }) {\n return `<sub>${serializeChildrenToHTMLString(children)}</sub>`;\n },\n superscript({ children }) {\n return `<sup>${serializeChildrenToHTMLString(children)}</sup>`;\n },\n link({ mark, children }) {\n return `[${serializeChildrenToHTMLString(children)}](${mark.attrs.href})`;\n },\n highlight({ children }) {\n return `==${serializeChildrenToHTMLString(children)}==`;\n },\n ...options == null ? void 0 : options.markMapping\n }\n }\n });\n}\nexport {\n mapMarkExtensionToReactNode,\n mapNodeExtensionToReactNode,\n renderToElement,\n renderToMarkdown\n};\n//# sourceMappingURL=index.js.map","import { renderToMarkdown } from '@tiptap/static-renderer/pm/markdown';\n\n// The pm/markdown renderer passes children as string[] (one entry per child node),\n// not as a pre-joined string. Normalize to a string before processing.\nconst joinChildren = (children) => Array.isArray(children) ? children.join('') : (children || '');\n\n// Move leading/trailing spaces outside mark delimiters so parsers like CommonMark\n// don't reject them (e.g. \"** bold **\" → \" **bold** \").\nconst wrapMark = (text, open, close) => {\n const trimmed = text.trim();\n if (!trimmed) return text;\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}${open}${trimmed}${close}${trailing}`;\n};\n\n/**\n * Renders a TipTap/ProseMirror JSON document to a markdown string.\n *\n * Uses @tiptap/static-renderer with custom mappings to preserve the output\n * format of the legacy jsonToMarkdownConverter, including Dialtone-specific\n * node types (mention, channel, emoji, variable, slash-commands).\n *\n * @param {import('@tiptap/core').JSONContent} jsonContent - TipTap JSON document\n * @param {import('@tiptap/core').Extensions} extensions - Active editor extensions\n * @returns {string}\n */\nexport function renderEditorToMarkdown (jsonContent, extensions) {\n const output = renderToMarkdown({\n extensions,\n content: jsonContent,\n options: {\n nodeMapping: {\n // Override blockquote: built-in omits trailing newline (causes lazy continuation).\n // Since we replace the built-in entirely, we must add the '> ' prefix ourselves.\n blockquote ({ children }) {\n const text = joinChildren(children).trim();\n const quoted = text\n .split('\\n')\n .map(line => line ? `> ${line}` : '>')\n .join('\\n');\n return quoted + '\\n';\n },\n\n // Override codeBlock: built-in passes null language through literally\n codeBlock ({ node, children }) {\n const lang = node.attrs?.language || '';\n return `\\`\\`\\`${lang}\\n${joinChildren(children)}\\n\\`\\`\\`\\n`;\n },\n\n // Custom Dialtone node types\n mention ({ node }) {\n const id = node.attrs?.id || '';\n const contactKey = node.attrs?.contactKey || '';\n const name = node.attrs?.name || '';\n return `<!-- @mention: {\"id\": \"${id}\", \"contactKey\": \"${contactKey}\", \"name\": \"${name}\"} -->`;\n },\n\n channel ({ node }) {\n const id = node.attrs?.id || '';\n const channelKey = node.attrs?.channelKey || '';\n const name = node.attrs?.name || '';\n const locked = String(node.attrs?.locked ?? '');\n return `<!-- @channel: {\"id\": \"${id}\", \"channelKey\": \"${channelKey}\", \"name\": \"${name}\", \"locked\": \"${locked}\"} -->`;\n },\n\n 'slash-commands' ({ node }) {\n return `/${node.attrs?.command || ''}`;\n },\n\n emoji ({ node }) {\n return node.attrs?.code || '';\n },\n\n variable ({ node }) {\n const id = node.attrs?.id || '';\n const altText = node.attrs?.altText || '';\n return `{{${id}=${altText}}}`;\n },\n },\n\n markMapping: {\n bold ({ children }) {\n return wrapMark(joinChildren(children), '**', '**');\n },\n\n // Override italic: use * instead of built-in _ and fix boundary spaces\n italic ({ children }) {\n return wrapMark(joinChildren(children), '*', '*');\n },\n\n strike ({ children }) {\n return wrapMark(joinChildren(children), '~~', '~~');\n },\n\n code ({ children }) {\n return wrapMark(joinChildren(children), '`', '`');\n },\n\n link ({ mark, children }) {\n const text = joinChildren(children);\n const href = mark.attrs?.href || '';\n const trimmed = text.trim();\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}[${trimmed}](${href})${trailing}`;\n },\n\n // Override underline: pass-through (no markdown equivalent, matches legacy no-op)\n underline ({ children }) {\n return joinChildren(children);\n },\n },\n },\n });\n // Collapse 3+ consecutive newlines to 2 (CommonMark ignores extra blank\n // lines between blocks), and strip the leading newline that the built-in\n // paragraph renderer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EqD,gBADvE,OAAO,EAAK,OAAO,QAAU,GAAG,CAC8D,SAG/G,iBAAkB,CAAE,QAAQ,CAC1B,MAAO,IAAI,EAAK,OAAO,SAAW,MAGpC,MAAO,CAAE,QAAQ,CACf,OAAO,EAAK,OAAO,MAAQ,IAG7B,SAAU,CAAE,QAAQ,CAGlB,MAAO,KAFI,EAAK,OAAO,IAAM,GAEd,GADC,EAAK,OAAO,SAAW,GACb,KAE7B,CAED,YAAa,CACX,KAAM,CAAE,YAAY,CAClB,OAAO,EAAS,EAAa,EAAS,CAAE,KAAM,KAAK,EAIrD,OAAQ,CAAE,YAAY,CACpB,OAAO,EAAS,EAAa,EAAS,CAAE,IAAK,IAAI,EAGnD,OAAQ,CAAE,YAAY,CACpB,OAAO,EAAS,EAAa,EAAS,CAAE,KAAM,KAAK,EAGrD,KAAM,CAAE,YAAY,CAClB,OAAO,EAAS,EAAa,EAAS,CAAE,IAAK,IAAI,EAGnD,KAAM,CAAE,OAAM,YAAY,CACxB,IAAM,EAAO,EAAa,EAAS,CAC7B,EAAO,EAAK,OAAO,MAAQ,GAC3B,EAAU,EAAK,MAAM,CAG3B,MAAO,GAFS,EAAK,MAAM,EAAG,EAAK,OAAS,EAAK,WAAW,CAAC,OAAO,CAElD,GAAG,EAAQ,IAAI,EAAK,GADrB,EAAK,MAAM,EAAK,SAAS,CAAC,OAAO,IAKpD,UAAW,CAAE,YAAY,CACvB,OAAO,EAAa,EAAS,EAEhC,CACF,CACF,CAAC,CAIY,QAAQ,UAAW;;EAAO,CAAC,QAAQ,aAAc,GAAG"}
@@ -0,0 +1,322 @@
1
+ import { getAttributesFromExtensions as e, getExtensionField as t, getSchemaByResolvedExtensions as n, mergeAttributes as r, resolveExtensions as i, splitExtensions as a } from "@tiptap/core";
2
+ import { Node as o } from "@tiptap/pm/model";
3
+ //#region ../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_react_4n7lapq7bmfej5hsrzhdkukr6e/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js
4
+ function s(e, t, n) {
5
+ let i = e.attrs;
6
+ return i ? t.filter((t) => t.type === (typeof e.type == "string" ? e.type : e.type.name) ? n ? t.attribute.rendered : !0 : !1).map((e) => e.attribute.renderHTML && e.attribute.renderHTML(i) || { [e.name]: e.name in i ? i[e.name] : e.attribute.default }).reduce((e, t) => r(e, t), {}) : {};
7
+ }
8
+ function c(e, t) {
9
+ return s(e, t, !0);
10
+ }
11
+ function l(e, n, r, i) {
12
+ let a = t(n, "renderHTML", {
13
+ name: n.name,
14
+ options: n.options,
15
+ storage: n.storage,
16
+ parent: n.parent
17
+ });
18
+ return a ? [n.name, ({ node: t, children: i }) => {
19
+ try {
20
+ return e(a({
21
+ node: t,
22
+ HTMLAttributes: c(t, r)
23
+ }))(i);
24
+ } catch (e) {
25
+ throw Error(`[tiptap error]: Node ${n.name} cannot be rendered, it's "renderToHTML" method threw an error: ${e.message}`, { cause: e });
26
+ }
27
+ }] : i?.unhandledNode ? [n.name, i.unhandledNode] : [n.name, () => {
28
+ throw Error(`[tiptap error]: Node ${n.name} cannot be rendered, it is missing a "renderToHTML" method, please implement it or override the corresponding "nodeMapping" method to have a custom rendering`);
29
+ }];
30
+ }
31
+ function u(e, n, r, i) {
32
+ let a = t(n, "renderHTML", {
33
+ name: n.name,
34
+ options: n.options,
35
+ storage: n.storage,
36
+ parent: n.parent
37
+ });
38
+ return a ? [n.name, ({ mark: t, children: i }) => {
39
+ try {
40
+ return e(a({
41
+ mark: t,
42
+ HTMLAttributes: c(t, r)
43
+ }))(i);
44
+ } catch (e) {
45
+ throw Error(`[tiptap error]: Mark ${n.name} cannot be rendered, it's "renderToHTML" method threw an error: ${e.message}`, { cause: e });
46
+ }
47
+ }] : i?.unhandledMark ? [n.name, i.unhandledMark] : [n.name, () => {
48
+ throw Error(`Node ${n.name} cannot be rendered, it is missing a "renderToHTML" method`);
49
+ }];
50
+ }
51
+ function d({ renderer: t, domOutputSpecToElement: r, mapDefinedTypes: s, content: c, extensions: d, options: f }) {
52
+ d = i(d);
53
+ let p = e(d), { nodeExtensions: m, markExtensions: h } = a(d);
54
+ return c instanceof o || (c = o.fromJSON(n(d), c)), t({
55
+ ...f,
56
+ nodeMapping: {
57
+ ...Object.fromEntries(m.filter((e) => e.name in s ? !1 : f?.nodeMapping ? !(e.name in f.nodeMapping) : !0).map((e) => l(r, e, p, f))),
58
+ ...s,
59
+ ...f?.nodeMapping
60
+ },
61
+ markMapping: {
62
+ ...Object.fromEntries(h.filter((e) => f?.markMapping ? !(e.name in f.markMapping) : !0).map((e) => u(r, e, p, f))),
63
+ ...f?.markMapping
64
+ }
65
+ })({ content: c });
66
+ }
67
+ function f(e, { nodeMapping: t, markMapping: n, unhandledNode: r, unhandledMark: i }) {
68
+ return function a({ content: o, parent: s }) {
69
+ let c = typeof o.type == "string" ? o.type : o.type.name, l = t[c] ?? r;
70
+ if (!l) throw Error(`missing handler for node type ${c}`);
71
+ let u = e({
72
+ component: l,
73
+ props: {
74
+ node: o,
75
+ parent: s,
76
+ renderElement: a,
77
+ get children() {
78
+ let e = [];
79
+ return o.content && o.content.forEach((t) => {
80
+ e.push(a({
81
+ content: t,
82
+ parent: o
83
+ }));
84
+ }), e;
85
+ }
86
+ }
87
+ });
88
+ return o.marks ? o.marks.reduce((t, r) => {
89
+ let a = typeof r.type == "string" ? r.type : r.type.name, c = n[a] ?? i;
90
+ if (!c) throw Error(`missing handler for mark type ${a}`);
91
+ return e({
92
+ component: c,
93
+ props: {
94
+ mark: r,
95
+ parent: s,
96
+ node: o,
97
+ children: t
98
+ }
99
+ });
100
+ }, u) : u;
101
+ };
102
+ }
103
+ function p(e) {
104
+ return f((e) => e.component(e.props), e);
105
+ }
106
+ function m(e) {
107
+ let t = Object.entries(e || {}).map(([e, t]) => `${e.split(" ").at(-1)}=${JSON.stringify(t)}`).join(" ");
108
+ return t ? ` ${t}` : "";
109
+ }
110
+ function h(e) {
111
+ return [].concat(e || "").filter(Boolean).join("");
112
+ }
113
+ var g = /* @__PURE__ */ new Set([
114
+ "iframe",
115
+ "script",
116
+ "style",
117
+ "title",
118
+ "textarea",
119
+ "div",
120
+ "span",
121
+ "a",
122
+ "button"
123
+ ]);
124
+ function _(e) {
125
+ if (typeof e == "string") return () => e;
126
+ if (typeof e == "object" && "length" in e) {
127
+ let [t, n, r, ...i] = e, a = t, o = a.split(" ");
128
+ if (o.length > 1 && (a = `${o[1]} xmlns="${o[0]}"`), n === void 0) return () => `<${a}/>`;
129
+ if (n === 0) return (e) => `<${a}>${h(e)}</${a}>`;
130
+ if (typeof n == "object") return Array.isArray(n) ? r === void 0 || r === 0 ? (e) => `<${a}>${_(n)(e)}</${a}>` : (e) => `<${a}>${_(n)(e)}${[r].concat(i).map((t) => _(t)(e))}</${a}>` : r === void 0 ? g.has(a) ? () => `<${a}${m(n)}></${a}>` : () => `<${a}${m(n)}/>` : r === 0 ? (e) => `<${a}${m(n)}>${h(e)}</${a}>` : (e) => `<${a}${m(n)}>${[r].concat(i).map((t) => _(t)(e)).join("")}</${a}>`;
131
+ }
132
+ throw Error("[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping", { cause: e });
133
+ }
134
+ function v({ content: e, extensions: t, options: n }) {
135
+ return d({
136
+ renderer: p,
137
+ domOutputSpecToElement: _,
138
+ mapDefinedTypes: {
139
+ doc: ({ children: e }) => h(e),
140
+ text: ({ node: e }) => e.text ?? ""
141
+ },
142
+ content: e,
143
+ extensions: t,
144
+ options: n
145
+ });
146
+ }
147
+ function y({ content: e, extensions: t, options: n }) {
148
+ return v({
149
+ content: e,
150
+ extensions: t,
151
+ options: {
152
+ ...n,
153
+ nodeMapping: {
154
+ bulletList({ children: e }) {
155
+ return `
156
+ ${h(e)}`;
157
+ },
158
+ orderedList({ children: e }) {
159
+ return `
160
+ ${h(e)}`;
161
+ },
162
+ listItem({ node: e, children: t, parent: n }) {
163
+ if (n?.type.name === "bulletList") return `- ${h(t).trim()}
164
+ `;
165
+ if (n?.type.name === "orderedList") {
166
+ let r = n.attrs.start || 1;
167
+ return n.forEach((t, n, i) => {
168
+ e === t && (r = i + 1);
169
+ }), `${r}. ${h(t).trim()}
170
+ `;
171
+ }
172
+ return h(t);
173
+ },
174
+ paragraph({ children: e }) {
175
+ return `
176
+ ${h(e)}
177
+ `;
178
+ },
179
+ heading({ node: e, children: t }) {
180
+ let n = e.attrs.level;
181
+ return `${Array(n).fill("#").join("")} ${t}
182
+ `;
183
+ },
184
+ codeBlock({ node: e, children: t }) {
185
+ return `
186
+ \`\`\`${e.attrs.language}
187
+ ${h(t)}
188
+ \`\`\`
189
+ `;
190
+ },
191
+ blockquote({ children: e }) {
192
+ return `
193
+ ${h(e).trim().split("\n").map((e) => `> ${e}`).join("\n")}`;
194
+ },
195
+ image({ node: e }) {
196
+ return `![${e.attrs.alt}](${e.attrs.src})`;
197
+ },
198
+ hardBreak() {
199
+ return "\n";
200
+ },
201
+ horizontalRule() {
202
+ return "\n---\n";
203
+ },
204
+ table({ children: e, node: t }) {
205
+ if (!Array.isArray(e)) return `
206
+ ${h(e)}
207
+ `;
208
+ let n = t.children[0].childCount;
209
+ return `
210
+ ${h(e[0])}| ${Array(n).fill("---").join(" | ")} |
211
+ ${h(e.slice(1))}
212
+ `;
213
+ },
214
+ tableRow({ children: e }) {
215
+ return Array.isArray(e) ? `| ${e.join(" | ")} |
216
+ ` : `${h(e)}
217
+ `;
218
+ },
219
+ tableHeader({ children: e }) {
220
+ return h(e).trim();
221
+ },
222
+ tableCell({ children: e }) {
223
+ return h(e).trim();
224
+ },
225
+ ...n?.nodeMapping
226
+ },
227
+ markMapping: {
228
+ bold({ children: e }) {
229
+ return `**${h(e)}**`;
230
+ },
231
+ italic({ children: e, node: t }) {
232
+ let n = !1;
233
+ return t?.marks.some((e) => e.type.name === "bold") && (n = !0), n ? `*${h(e)}*` : `_${h(e)}_`;
234
+ },
235
+ code({ children: e }) {
236
+ return `\`${h(e)}\``;
237
+ },
238
+ strike({ children: e }) {
239
+ return `~~${h(e)}~~`;
240
+ },
241
+ underline({ children: e }) {
242
+ return `<u>${h(e)}</u>`;
243
+ },
244
+ subscript({ children: e }) {
245
+ return `<sub>${h(e)}</sub>`;
246
+ },
247
+ superscript({ children: e }) {
248
+ return `<sup>${h(e)}</sup>`;
249
+ },
250
+ link({ mark: e, children: t }) {
251
+ return `[${h(t)}](${e.attrs.href})`;
252
+ },
253
+ highlight({ children: e }) {
254
+ return `==${h(e)}==`;
255
+ },
256
+ ...n?.markMapping
257
+ }
258
+ }
259
+ });
260
+ }
261
+ //#endregion
262
+ //#region components/rich_text_editor/markdownRenderer.js
263
+ var b = (e) => Array.isArray(e) ? e.join("") : e || "", x = (e, t, n) => {
264
+ let r = e.trim();
265
+ return r ? `${e.slice(0, e.length - e.trimStart().length)}${t}${r}${n}${e.slice(e.trimEnd().length)}` : e;
266
+ };
267
+ function S(e, t) {
268
+ return y({
269
+ extensions: t,
270
+ content: e,
271
+ options: {
272
+ nodeMapping: {
273
+ blockquote({ children: e }) {
274
+ return b(e).trim().split("\n").map((e) => e ? `> ${e}` : ">").join("\n") + "\n";
275
+ },
276
+ codeBlock({ node: e, children: t }) {
277
+ return `\`\`\`${e.attrs?.language || ""}\n${b(t)}\n\`\`\`\n`;
278
+ },
279
+ mention({ node: e }) {
280
+ return `<!-- @mention: {"id": "${e.attrs?.id || ""}", "contactKey": "${e.attrs?.contactKey || ""}", "name": "${e.attrs?.name || ""}"} -->`;
281
+ },
282
+ channel({ node: e }) {
283
+ return `<!-- @channel: {"id": "${e.attrs?.id || ""}", "channelKey": "${e.attrs?.channelKey || ""}", "name": "${e.attrs?.name || ""}", "locked": "${String(e.attrs?.locked ?? "")}"} -->`;
284
+ },
285
+ "slash-commands"({ node: e }) {
286
+ return `/${e.attrs?.command || ""}`;
287
+ },
288
+ emoji({ node: e }) {
289
+ return e.attrs?.code || "";
290
+ },
291
+ variable({ node: e }) {
292
+ return `{{${e.attrs?.id || ""}=${e.attrs?.altText || ""}}}`;
293
+ }
294
+ },
295
+ markMapping: {
296
+ bold({ children: e }) {
297
+ return x(b(e), "**", "**");
298
+ },
299
+ italic({ children: e }) {
300
+ return x(b(e), "*", "*");
301
+ },
302
+ strike({ children: e }) {
303
+ return x(b(e), "~~", "~~");
304
+ },
305
+ code({ children: e }) {
306
+ return x(b(e), "`", "`");
307
+ },
308
+ link({ mark: e, children: t }) {
309
+ let n = b(t), r = e.attrs?.href || "", i = n.trim();
310
+ return `${n.slice(0, n.length - n.trimStart().length)}[${i}](${r})${n.slice(n.trimEnd().length)}`;
311
+ },
312
+ underline({ children: e }) {
313
+ return b(e);
314
+ }
315
+ }
316
+ }
317
+ }).replace(/\n{3,}/g, "\n\n").replace(/^\n+|\n+$/g, "");
318
+ }
319
+ //#endregion
320
+ export { S as t };
321
+
322
+ //# sourceMappingURL=markdownRenderer-D_P94RyM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownRenderer-D_P94RyM.js","names":["Node"],"sources":["../../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_react_4n7lapq7bmfej5hsrzhdkukr6e/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js","../components/rich_text_editor/markdownRenderer.js"],"sourcesContent":["// src/pm/extensionRenderer.ts\nimport {\n getAttributesFromExtensions,\n getExtensionField,\n getSchemaByResolvedExtensions,\n resolveExtensions,\n splitExtensions\n} from \"@tiptap/core\";\nimport { Node } from \"@tiptap/pm/model\";\n\n// src/helpers.ts\nimport { mergeAttributes } from \"@tiptap/core\";\nfunction getAttributes(nodeOrMark, extensionAttributes, onlyRenderedAttributes) {\n const nodeOrMarkAttributes = nodeOrMark.attrs;\n if (!nodeOrMarkAttributes) {\n return {};\n }\n return extensionAttributes.filter((item) => {\n if (item.type !== (typeof nodeOrMark.type === \"string\" ? nodeOrMark.type : nodeOrMark.type.name)) {\n return false;\n }\n if (onlyRenderedAttributes) {\n return item.attribute.rendered;\n }\n return true;\n }).map((item) => {\n if (!item.attribute.renderHTML) {\n return {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }\n return item.attribute.renderHTML(nodeOrMarkAttributes) || {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});\n}\nfunction getHTMLAttributes(nodeOrMark, extensionAttributes) {\n return getAttributes(nodeOrMark, extensionAttributes, true);\n}\n\n// src/pm/extensionRenderer.ts\nfunction mapNodeExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledNode) {\n return [extension.name, options.unhandledNode];\n }\n return [\n extension.name,\n () => {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method, please implement it or override the corresponding \"nodeMapping\" method to have a custom rendering`\n );\n }\n ];\n }\n return [\n extension.name,\n ({ node, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n node,\n HTMLAttributes: getHTMLAttributes(node, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction mapMarkExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledMark) {\n return [extension.name, options.unhandledMark];\n }\n return [\n extension.name,\n () => {\n throw new Error(`Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method`);\n }\n ];\n }\n return [\n extension.name,\n ({ mark, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n mark,\n HTMLAttributes: getHTMLAttributes(mark, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Mark ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction renderToElement({\n renderer,\n domOutputSpecToElement,\n mapDefinedTypes,\n content,\n extensions,\n options\n}) {\n extensions = resolveExtensions(extensions);\n const extensionAttributes = getAttributesFromExtensions(extensions);\n const { nodeExtensions, markExtensions } = splitExtensions(extensions);\n if (!(content instanceof Node)) {\n content = Node.fromJSON(getSchemaByResolvedExtensions(extensions), content);\n }\n return renderer({\n ...options,\n nodeMapping: {\n ...Object.fromEntries(\n nodeExtensions.filter((e) => {\n if (e.name in mapDefinedTypes) {\n return false;\n }\n if (options == null ? void 0 : options.nodeMapping) {\n return !(e.name in options.nodeMapping);\n }\n return true;\n }).map(\n (nodeExtension) => mapNodeExtensionToReactNode(domOutputSpecToElement, nodeExtension, extensionAttributes, options)\n )\n ),\n ...mapDefinedTypes,\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n ...Object.fromEntries(\n markExtensions.filter((e) => {\n if (options == null ? void 0 : options.markMapping) {\n return !(e.name in options.markMapping);\n }\n return true;\n }).map((mark) => mapMarkExtensionToReactNode(domOutputSpecToElement, mark, extensionAttributes, options))\n ),\n ...options == null ? void 0 : options.markMapping\n }\n })({ content });\n}\n\n// src/json/renderer.ts\nfunction TiptapStaticRenderer(renderComponent, {\n nodeMapping,\n markMapping,\n unhandledNode,\n unhandledMark\n}) {\n return function renderContent({\n content,\n parent\n }) {\n var _a;\n const nodeType = typeof content.type === \"string\" ? content.type : content.type.name;\n const NodeHandler = (_a = nodeMapping[nodeType]) != null ? _a : unhandledNode;\n if (!NodeHandler) {\n throw new Error(`missing handler for node type ${nodeType}`);\n }\n const nodeContent = renderComponent({\n component: NodeHandler,\n props: {\n node: content,\n parent,\n renderElement: renderContent,\n // Lazily compute the children to avoid unnecessary recursion\n get children() {\n const children = [];\n if (content.content) {\n content.content.forEach((child) => {\n children.push(\n renderContent({\n content: child,\n parent: content\n })\n );\n });\n }\n return children;\n }\n }\n });\n const markedContent = content.marks ? content.marks.reduce((acc, mark) => {\n var _a2;\n const markType = typeof mark.type === \"string\" ? mark.type : mark.type.name;\n const MarkHandler = (_a2 = markMapping[markType]) != null ? _a2 : unhandledMark;\n if (!MarkHandler) {\n throw new Error(`missing handler for mark type ${markType}`);\n }\n return renderComponent({\n component: MarkHandler,\n props: {\n mark,\n parent,\n node: content,\n children: acc\n }\n });\n }, nodeContent) : nodeContent;\n return markedContent;\n };\n}\n\n// src/json/html-string/string.ts\nfunction renderJSONContentToString(options) {\n return TiptapStaticRenderer((ctx) => {\n return ctx.component(ctx.props);\n }, options);\n}\nfunction serializeAttrsToHTMLString(attrs) {\n const output = Object.entries(attrs || {}).map(([key, value]) => `${key.split(\" \").at(-1)}=${JSON.stringify(value)}`).join(\" \");\n return output ? ` ${output}` : \"\";\n}\nfunction serializeChildrenToHTMLString(children) {\n return [].concat(children || \"\").filter(Boolean).join(\"\");\n}\n\n// src/pm/html-string/html-string.ts\nvar NON_SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([\"iframe\", \"script\", \"style\", \"title\", \"textarea\", \"div\", \"span\", \"a\", \"button\"]);\nfunction domOutputSpecToHTMLString(content) {\n if (typeof content === \"string\") {\n return () => content;\n }\n if (typeof content === \"object\" && \"length\" in content) {\n const [_tag, attrs, children, ...rest] = content;\n let tag = _tag;\n const parts = tag.split(\" \");\n if (parts.length > 1) {\n tag = `${parts[1]} xmlns=\"${parts[0]}\"`;\n }\n if (attrs === void 0) {\n return () => `<${tag}/>`;\n }\n if (attrs === 0) {\n return (child) => `<${tag}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n if (typeof attrs === \"object\") {\n if (Array.isArray(attrs)) {\n if (children === void 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n if (children === 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child))}</${tag}>`;\n }\n if (children === void 0) {\n if (NON_SELF_CLOSING_TAGS.has(tag)) {\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}></${tag}>`;\n }\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}/>`;\n }\n if (children === 0) {\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child)).join(\"\")}</${tag}>`;\n }\n }\n throw new Error(\n \"[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping\",\n {\n cause: content\n }\n );\n}\nfunction renderToHTMLString({\n content,\n extensions,\n options\n}) {\n return renderToElement({\n renderer: renderJSONContentToString,\n domOutputSpecToElement: domOutputSpecToHTMLString,\n mapDefinedTypes: {\n // Map a doc node to concatenated children\n doc: ({ children }) => serializeChildrenToHTMLString(children),\n // Map a text node to its text content\n text: ({ node }) => {\n var _a;\n return (_a = node.text) != null ? _a : \"\";\n }\n },\n content,\n extensions,\n options\n });\n}\n\n// src/pm/markdown/markdown.ts\nfunction renderToMarkdown({\n content,\n extensions,\n options\n}) {\n return renderToHTMLString({\n content,\n extensions,\n options: {\n ...options,\n nodeMapping: {\n bulletList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n orderedList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n listItem({ node, children, parent }) {\n if ((parent == null ? void 0 : parent.type.name) === \"bulletList\") {\n return `- ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n if ((parent == null ? void 0 : parent.type.name) === \"orderedList\") {\n let number = parent.attrs.start || 1;\n parent.forEach((parentChild, _offset, index) => {\n if (node === parentChild) {\n number = index + 1;\n }\n });\n return `${number}. ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n return serializeChildrenToHTMLString(children);\n },\n paragraph({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n },\n heading({ node, children }) {\n const level = node.attrs.level;\n return `${new Array(level).fill(\"#\").join(\"\")} ${children}\n`;\n },\n codeBlock({ node, children }) {\n return `\n\\`\\`\\`${node.attrs.language}\n${serializeChildrenToHTMLString(children)}\n\\`\\`\\`\n`;\n },\n blockquote({ children }) {\n return `\n${serializeChildrenToHTMLString(children).trim().split(\"\\n\").map((a) => `> ${a}`).join(\"\\n\")}`;\n },\n image({ node }) {\n return `![${node.attrs.alt}](${node.attrs.src})`;\n },\n hardBreak() {\n return \"\\n\";\n },\n horizontalRule() {\n return \"\\n---\\n\";\n },\n table({ children, node }) {\n if (!Array.isArray(children)) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n }\n const columnCount = node.children[0].childCount;\n return `\n${serializeChildrenToHTMLString(children[0])}| ${new Array(columnCount).fill(\"---\").join(\" | \")} |\n${serializeChildrenToHTMLString(children.slice(1))}\n`;\n },\n tableRow({ children }) {\n if (Array.isArray(children)) {\n return `| ${children.join(\" | \")} |\n`;\n }\n return `${serializeChildrenToHTMLString(children)}\n`;\n },\n tableHeader({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n tableCell({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n bold({ children }) {\n return `**${serializeChildrenToHTMLString(children)}**`;\n },\n italic({ children, node }) {\n let isBoldToo = false;\n if (node == null ? void 0 : node.marks.some((m) => m.type.name === \"bold\")) {\n isBoldToo = true;\n }\n if (isBoldToo) {\n return `*${serializeChildrenToHTMLString(children)}*`;\n }\n return `_${serializeChildrenToHTMLString(children)}_`;\n },\n code({ children }) {\n return `\\`${serializeChildrenToHTMLString(children)}\\``;\n },\n strike({ children }) {\n return `~~${serializeChildrenToHTMLString(children)}~~`;\n },\n underline({ children }) {\n return `<u>${serializeChildrenToHTMLString(children)}</u>`;\n },\n subscript({ children }) {\n return `<sub>${serializeChildrenToHTMLString(children)}</sub>`;\n },\n superscript({ children }) {\n return `<sup>${serializeChildrenToHTMLString(children)}</sup>`;\n },\n link({ mark, children }) {\n return `[${serializeChildrenToHTMLString(children)}](${mark.attrs.href})`;\n },\n highlight({ children }) {\n return `==${serializeChildrenToHTMLString(children)}==`;\n },\n ...options == null ? void 0 : options.markMapping\n }\n }\n });\n}\nexport {\n mapMarkExtensionToReactNode,\n mapNodeExtensionToReactNode,\n renderToElement,\n renderToMarkdown\n};\n//# sourceMappingURL=index.js.map","import { renderToMarkdown } from '@tiptap/static-renderer/pm/markdown';\n\n// The pm/markdown renderer passes children as string[] (one entry per child node),\n// not as a pre-joined string. Normalize to a string before processing.\nconst joinChildren = (children) => Array.isArray(children) ? children.join('') : (children || '');\n\n// Move leading/trailing spaces outside mark delimiters so parsers like CommonMark\n// don't reject them (e.g. \"** bold **\" → \" **bold** \").\nconst wrapMark = (text, open, close) => {\n const trimmed = text.trim();\n if (!trimmed) return text;\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}${open}${trimmed}${close}${trailing}`;\n};\n\n/**\n * Renders a TipTap/ProseMirror JSON document to a markdown string.\n *\n * Uses @tiptap/static-renderer with custom mappings to preserve the output\n * format of the legacy jsonToMarkdownConverter, including Dialtone-specific\n * node types (mention, channel, emoji, variable, slash-commands).\n *\n * @param {import('@tiptap/core').JSONContent} jsonContent - TipTap JSON document\n * @param {import('@tiptap/core').Extensions} extensions - Active editor extensions\n * @returns {string}\n */\nexport function renderEditorToMarkdown (jsonContent, extensions) {\n const output = renderToMarkdown({\n extensions,\n content: jsonContent,\n options: {\n nodeMapping: {\n // Override blockquote: built-in omits trailing newline (causes lazy continuation).\n // Since we replace the built-in entirely, we must add the '> ' prefix ourselves.\n blockquote ({ children }) {\n const text = joinChildren(children).trim();\n const quoted = text\n .split('\\n')\n .map(line => line ? `> ${line}` : '>')\n .join('\\n');\n return quoted + '\\n';\n },\n\n // Override codeBlock: built-in passes null language through literally\n codeBlock ({ node, children }) {\n const lang = node.attrs?.language || '';\n return `\\`\\`\\`${lang}\\n${joinChildren(children)}\\n\\`\\`\\`\\n`;\n },\n\n // Custom Dialtone node types\n mention ({ node }) {\n const id = node.attrs?.id || '';\n const contactKey = node.attrs?.contactKey || '';\n const name = node.attrs?.name || '';\n return `<!-- @mention: {\"id\": \"${id}\", \"contactKey\": \"${contactKey}\", \"name\": \"${name}\"} -->`;\n },\n\n channel ({ node }) {\n const id = node.attrs?.id || '';\n const channelKey = node.attrs?.channelKey || '';\n const name = node.attrs?.name || '';\n const locked = String(node.attrs?.locked ?? '');\n return `<!-- @channel: {\"id\": \"${id}\", \"channelKey\": \"${channelKey}\", \"name\": \"${name}\", \"locked\": \"${locked}\"} -->`;\n },\n\n 'slash-commands' ({ node }) {\n return `/${node.attrs?.command || ''}`;\n },\n\n emoji ({ node }) {\n return node.attrs?.code || '';\n },\n\n variable ({ node }) {\n const id = node.attrs?.id || '';\n const altText = node.attrs?.altText || '';\n return `{{${id}=${altText}}}`;\n },\n },\n\n markMapping: {\n bold ({ children }) {\n return wrapMark(joinChildren(children), '**', '**');\n },\n\n // Override italic: use * instead of built-in _ and fix boundary spaces\n italic ({ children }) {\n return wrapMark(joinChildren(children), '*', '*');\n },\n\n strike ({ children }) {\n return wrapMark(joinChildren(children), '~~', '~~');\n },\n\n code ({ children }) {\n return wrapMark(joinChildren(children), '`', '`');\n },\n\n link ({ mark, children }) {\n const text = joinChildren(children);\n const href = mark.attrs?.href || '';\n const trimmed = text.trim();\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}[${trimmed}](${href})${trailing}`;\n },\n\n // Override underline: pass-through (no markdown equivalent, matches legacy no-op)\n underline ({ children }) {\n return joinChildren(children);\n },\n },\n },\n });\n // Collapse 3+ consecutive newlines to 2 (CommonMark ignores extra blank\n // lines between blocks), and strip the leading newline that the built-in\n // paragraph renderer always prepends to the first node.\n return output.replace(/\\n{3,}/g, '\\n\\n').replace(/^\\n+|\\n+$/g, '');\n}\n"],"x_google_ignoreList":[0],"mappings":";;;AAYA,SAAS,EAAc,GAAY,GAAqB,GAAwB;CAC9E,IAAM,IAAuB,EAAW;AAIxC,QAHK,IAGE,EAAoB,QAAQ,MAC7B,EAAK,UAAU,OAAO,EAAW,QAAS,WAAW,EAAW,OAAO,EAAW,KAAK,QAGvF,IACK,EAAK,UAAU,WAEjB,KALE,GAMT,CAAC,KAAK,MACD,EAAK,UAAU,cAKb,EAAK,UAAU,WAAW,EAAqB,IAJ7C,GACJ,EAAK,OAAO,EAAK,QAAQ,IAAuB,EAAqB,EAAK,QAAQ,EAAK,UAAU,SACnG,CAKH,CAAC,QAAQ,GAAY,MAAc,EAAgB,GAAY,EAAU,EAAE,EAAE,CAAC,GAnBvE,EAAE;;AAqBb,SAAS,EAAkB,GAAY,GAAqB;AAC1D,QAAO,EAAc,GAAY,GAAqB,GAAK;;AAI7D,SAAS,EAA4B,GAAwB,GAAW,GAAqB,GAAS;CAOpG,IAAM,IAAe,EAAkB,GAAW,cANlC;EACd,MAAM,EAAU;EAChB,SAAS,EAAU;EACnB,SAAS,EAAU;EACnB,QAAQ,EAAU;EACnB,CACuE;AAcxE,QAbK,IAaE,CACL,EAAU,OACT,EAAE,SAAM,kBAAe;AACtB,MAAI;AACF,UAAO,EACL,EAAa;IACX;IACA,gBAAgB,EAAkB,GAAM,EAAoB;IAC7D,CAAC,CACH,CAAC,EAAS;WACJ,GAAG;AACV,SAAU,MACR,wBAAwB,EAAU,KAAK,kEA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chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`./localization/index.cjs`),r=require(`./lib/button/button.cjs`),i=require(`./lib/item-layout/item-layout.cjs`),a=require(`./lib/stack/stack.cjs`),o=require(`./lib/tooltip/tooltip.cjs`),s=require(`./lib/popover/popover.cjs`),c=require(`./lib/input/input.cjs`),l=require(`./emoji_picker-Cl-T4BXK.cjs`),u=require(`./node_modules/@tiptap/vue-3.cjs`),d=require(`./rich_text_editor-CEwKDuzw.cjs`),f=require(`./lib/rich-text-editor/rich-text-editor-constants.cjs`),p=require(`./lib/editor/editor-constants.cjs`),m=require(`./lib/message-input/last-active-nodes.cjs`),h=require(`./lib/message-input/message-input-topbar.cjs`),g=require(`./lib/message-input/message-input-link.cjs`);let _=require(`vue`),v=require(`@dialpad/dialtone-icons/vue3`),y=require(`@tiptap/core`);var b={name:`MeetingPill`,components:{NodeViewWrapper:u.NodeViewWrapper,DtItemLayout:i.default,DtIconClose:v.DtIconClose,DtButton:r.default,DtIconVideo:v.DtIconVideo},props:u.nodeViewProps,emits:[`meeting-pill-close`],data(){return{i18n:new n.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},methods:{close(e){let t=this.editor?.storage?.meetingPill?.onClose;t&&typeof t==`function`&&t(e)}}},x={class:`d-recipe-message-input-meeting-pill__icon`},S={class:`d-recipe-message-input-meeting-pill__close`};function C(e,t,n,r,i,a){let o=(0,_.resolveComponent)(`dt-icon-video`),s=(0,_.resolveComponent)(`dt-icon-close`),c=(0,_.resolveComponent)(`dt-button`),l=(0,_.resolveComponent)(`dt-item-layout`),u=(0,_.resolveComponent)(`node-view-wrapper`);return(0,_.openBlock)(),(0,_.createBlock)(u,{class:`d-recipe-message-input-meeting-pill`},{default:(0,_.withCtx)(()=>[(0,_.createVNode)(l,{class:`d-recipe-message-input-meeting-pill__layout`,unstyled:``},{left:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,x,[(0,_.createVNode)(o,{size:`400`})])]),right:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,S,[(0,_.createVNode)(c,{circle:``,importance:`clear`,size:`xs`,"aria-label":a.closeButtonTitle,title:a.closeButtonTitle,onClick:a.close},{icon:(0,_.withCtx)(()=>[(0,_.createVNode)(s,{size:`300`})]),_:1},8,[`aria-label`,`title`,`onClick`])])]),default:(0,_.withCtx)(()=>[(0,_.createTextVNode)(` `+(0,_.toDisplayString)(e.node.attrs.text)+` `,1)]),_:1})]),_:1})}var w=t.t(b,[[`render`,C]]),T=y.Node.create({name:`meetingPill`,atom:!0,group:`inline`,inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return u.VueNodeViewRenderer(w)},addAttributes(){return{text:{default:`Please pass in "text" attribute`}}},parseHTML(){return[{tag:`meeting-pill`}]},renderText(){return`/dpm`},renderHTML({HTMLAttributes:e}){return[`meeting-pill`,(0,y.mergeAttributes)(e)]}}),E={compatConfig:{MODE:3},name:`DtRecipeMessageInput`,components:{DtButton:r.default,DtEmojiPicker:l.t,DtInput:c.default,DtPopover:s.default,DtRecipeMessageInputTopbar:h.default,DtRecipeMessageInputLink:g.default,DtRichTextEditor:d.t,DtTooltip:o.default,DtStack:a.default,DtIconImage:v.DtIconImage,DtIconVerySatisfied:v.DtIconVerySatisfied,DtIconSatisfied:v.DtIconSatisfied,DtIconSend:v.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:``},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?f.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:`json`,validator(e){return f.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:``},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:`unset`},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:``})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + B`})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + I`})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + S`})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + K`,linkPlaceholder:`e.g. https://www.dialpad.com`})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + 8`})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + 7`})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + B`})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + E`})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Alt + C`})}},emits:[`submit`,`select-media`,`add-media`,`paste-media`,`cancel`,`skin-tone`,`selected-emoji`,`selected-command`,`meeting-pill-close`,`update:modelValue`,`text-input`,`markdown-input`,`add-emoji`,`emoji-scroll-bottom-reached`],data(){return{lastActiveNodes:m.default,additionalExtensions:[T.configure({onClose:e=>{this.$emit(`meeting-pill-close`,e)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:`d-link d-c-text d-d-inline-block`},linkDialogOpen:!1,selectedText:``,text:``,hideLinkBubbleMenu:!1,i18n:new n.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSelectionActive(){return this.selectedText,e=>[`bulletList`,`orderedList`].includes(e)?this.richText?this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state,[{type:`bulletList`},{type:`orderedList`}]).includes(e)&&this.isFocused:!1:this.$refs.richTextEditor?.editor?.isActive(e)&&this.isFocused},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return`300`},sendButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL`)},imagePickerButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL`)},emojiPickerButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL`)},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL`)}},watch:{modelValue(e){this.internalInputValue=e},emojiPickerOpened(e){e||this.$refs.richTextEditor?.focusEditor()}},created(){this.modelValue&&this.outputFormat===`text`?this.internalInputValue=this.modelValue.replace(/\n/g,`<br>`):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:e.removeClassStyleAttrs,addClassStyleAttrs:e.addClassStyleAttrs,linkDialogOpened(e){this.linkDialogOpen=e,e===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,this.$refs.richTextEditor?.focusEditor())},handleTopbarClick(e){let t=this.$refs.richTextEditor?.editor,n={bold:()=>t?.chain().focus().toggleBold().run(),italic:()=>t?.chain().focus().toggleItalic().run(),strike:()=>t?.chain().focus().toggleStrike().run(),bulletList:()=>t?.chain().focus().toggleBulletList().run(),orderedList:()=>t?.chain().focus().toggleOrderedList().run(),blockquote:()=>t?.chain().focus().toggleBlockquote().run(),code:()=>t?.chain().focus().toggleCode().run(),codeBlock:()=>t?.chain().focus().toggleCodeBlock().run()};t&&n[e]&&n[e]()},initLinkDialog(){this.$refs.link.setInitialValues(this.selectedText,this.$refs.richTextEditor?.editor?.getAttributes(`link`)?.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){this.$refs.richTextEditor?.removeLink(),this.linkDialogOpen=!1},setLink(e,t){this.$refs.richTextEditor.setLink(t,e,this.linkOptions,p.EDITOR_SUPPORTED_LINK_PROTOCOLS,p.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(t){e.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(`.tiptap`).contains(t.target)||(t.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(e){let t=e.dataTransfer,n=Array.from(t.files);this.$emit(`add-media`,n)},onPaste(e){if(e.clipboardData.files.length){e.stopPropagation(),e.preventDefault();let t=[...e.clipboardData.files];this.$emit(`paste-media`,t)}},onSkinTone(e){this.$emit(`skin-tone`,e)},onSelectEmoji(e,t){e&&(e.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:`emoji`,attrs:{code:e.shortname,image:e.image,name:e.name}}),this.$emit(`selected-emoji`,e))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit(`select-media`,this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit(`submit`,this.internalInputValue)},onCancel(){this.$emit(`cancel`)},onInput(e){this.$emit(`update:modelValue`,e)},onTextInput(e){this.text=e,this.$emit(`text-input`,e)},onMarkdownInput(e){this.$emit(`markdown-input`,e)}}},D={class:`d-recipe-message-input__bottom-section`},O={class:`d-recipe-message-input__bottom-section-left`},k={class:`d-recipe-message-input__bottom-section-right`},A={class:`d-recipe-message-input__schedule-message`},j={class:`d-recipe-message-input__sms-count`},M={key:0};function N(e,t,n,r,i,a){let o=(0,_.resolveComponent)(`dt-recipe-message-input-link`),s=(0,_.resolveComponent)(`dt-recipe-message-input-topbar`),c=(0,_.resolveComponent)(`dt-rich-text-editor`),l=(0,_.resolveComponent)(`dt-icon-image`),u=(0,_.resolveComponent)(`dt-button`),d=(0,_.resolveComponent)(`dt-input`),f=(0,_.resolveComponent)(`dt-icon-very-satisfied`),p=(0,_.resolveComponent)(`dt-icon-satisfied`),m=(0,_.resolveComponent)(`dt-emoji-picker`),h=(0,_.resolveComponent)(`dt-popover`),g=(0,_.resolveComponent)(`dt-stack`),v=(0,_.resolveComponent)(`dt-tooltip`),y=(0,_.resolveComponent)(`dt-icon-send`),b=(0,_.resolveDirective)(`dt-scrollbar`),x=(0,_.resolveDirective)(`dt-tooltip`);return(0,_.openBlock)(),(0,_.createElementBlock)(`div`,(0,_.mergeProps)({"data-qa":`dt-recipe-message-input`,role:`presentation`,class:`d-recipe-message-input`},a.addClassStyleAttrs(e.$attrs),{onDragover:t[16]||(t[16]=(0,_.withModifiers)(()=>{},[`prevent`])),onDrop:t[17]||(t[17]=(0,_.withModifiers)((...e)=>a.onDrop&&a.onDrop(...e),[`prevent`])),onPaste:t[18]||(t[18]=(...e)=>a.onPaste&&a.onPaste(...e)),onMousedown:t[19]||(t[19]=(...e)=>a.onMousedown&&a.onMousedown(...e))}),[(0,_.renderSlot)(e.$slots,`top`),n.richText?((0,_.openBlock)(),(0,_.createBlock)(s,{key:0,"bold-button-options":n.boldButtonOptions,"italic-button-options":n.italicButtonOptions,"strike-button-options":n.strikeButtonOptions,"bullet-list-button-options":n.bulletListButtonOptions,"ordered-list-button-options":n.orderedListButtonOptions,"block-quote-button-options":n.blockQuoteButtonOptions,"code-button-options":n.codeButtonOptions,"code-block-button-options":n.codeBlockButtonOptions,"is-selection-active":a.isSelectionActive,onClick:a.handleTopbarClick},{link:(0,_.withCtx)(()=>[(0,_.createVNode)(o,{ref:`link`,open:i.linkDialogOpen,"link-button-options":n.linkButtonOptions,"is-selection-active":a.isSelectionActive,onOpened:a.linkDialogOpened,onSetLink:a.setLink,onRemoveLink:a.removeLink},null,8,[`open`,`link-button-options`,`is-selection-active`,`onOpened`,`onSetLink`,`onRemoveLink`])]),_:1},8,[`bold-button-options`,`italic-button-options`,`strike-button-options`,`bullet-list-button-options`,`ordered-list-button-options`,`block-quote-button-options`,`code-button-options`,`code-block-button-options`,`is-selection-active`,`onClick`])):(0,_.createCommentVNode)(``,!0),(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createElementBlock)(`div`,{class:`d-recipe-message-input__editor-wrapper`,style:(0,_.normalizeStyle)({"max-height":n.maxHeight})},[(0,_.createVNode)(c,(0,_.mergeProps)({ref:`richTextEditor`,modelValue:i.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>i.internalInputValue=e),"allow-blockquote":n.richText,"allow-bold":n.richText,"allow-bullet-list":n.richText,"allow-code":n.richText,"allow-codeblock":n.richText,"allow-italic":n.richText,"allow-strike":n.richText,"allow-underline":n.richText,"paste-rich-text":n.richText,editable:n.editable,"input-aria-label":n.inputAriaLabel,"input-class":n.inputClass,"output-format":n.outputFormat,"auto-focus":n.autoFocus,link:n.richText,placeholder:n.placeholder,"prevent-typing":n.preventTyping,"mention-suggestion":n.mentionSuggestion,"channel-suggestion":n.channelSuggestion,"slash-command-suggestion":n.slashCommandSuggestion,"additional-extensions":i.additionalExtensions,"hide-link-bubble-menu":i.hideLinkBubbleMenu},a.removeClassStyleAttrs(e.$attrs),{onInput:a.onInput,onTextInput:a.onTextInput,onMarkdownInput:a.onMarkdownInput,onEnter:a.onSend,onSelected:t[1]||(t[1]=e=>i.selectedText=e),onSelectedCommand:t[2]||(t[2]=t=>e.$emit(`selected-command`,t)),onEditLink:a.initLinkDialog,onFocus:t[3]||(t[3]=e=>i.isFocused=!0),onBlur:t[4]||(t[4]=e=>i.isFocused=!1)}),null,16,`modelValue.allow-blockquote.allow-bold.allow-bullet-list.allow-code.allow-codeblock.allow-italic.allow-strike.allow-underline.paste-rich-text.editable.input-aria-label.input-class.output-format.auto-focus.link.placeholder.prevent-typing.mention-suggestion.channel-suggestion.slash-command-suggestion.additional-extensions.hide-link-bubble-menu.onInput.onTextInput.onMarkdownInput.onEnter.onEditLink`.split(`.`))],4)),[[b]]),(0,_.renderSlot)(e.$slots,`middle`),(0,_.createElementVNode)(`section`,D,[(0,_.createElementVNode)(`div`,O,[(0,_.createVNode)(g,{gap:`200`,direction:`row`,class:`d-recipe-message-input__bottom-section-left-stack`},{default:(0,_.withCtx)(()=>[n.showImagePicker?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:0,"data-qa":`dt-recipe-message-input-image-btn`,size:`sm`,class:`d-recipe-message-input__button`,kind:`muted`,importance:`clear`,"aria-label":a.imagePickerButtonLabel,onClick:a.onSelectImage,onMouseenter:t[5]||(t[5]=e=>i.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=e=>i.imagePickerFocus=!1),onFocus:t[7]||(t[7]=e=>i.imagePickerFocus=!0),onBlur:t[8]||(t[8]=e=>i.imagePickerFocus=!1)},{icon:(0,_.withCtx)(()=>[(0,_.createVNode)(l,{size:`300`})]),_:1},8,[`aria-label`,`onClick`])),[[x,a.imagePickerButtonLabel,`top-start`]]):(0,_.createCommentVNode)(``,!0),(0,_.createVNode)(d,{ref:`messageInputImageUpload`,"data-qa":`dt-recipe-message-input-image-input`,accept:`image/*, video/*`,type:`file`,class:`d-recipe-message-input__image-input`,multiple:``,hidden:``,onInput:a.onImageUpload},null,8,[`onInput`]),n.showEmojiPicker?((0,_.openBlock)(),(0,_.createBlock)(h,{key:1,open:i.emojiPickerOpened,"onUpdate:open":t[15]||(t[15]=e=>i.emojiPickerOpened=e),"data-qa":`dt-recipe-message-input-emoji-picker-popover`,"initial-focus-element":`#searchInput`,padding:`none`},{anchor:(0,_.withCtx)(({attrs:e})=>[(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,(0,_.mergeProps)(e,{"data-qa":`dt-recipe-message-input-emoji-picker-btn`,size:`sm`,class:`d-recipe-message-input__button`,kind:`muted`,importance:`clear`,"aria-label":a.emojiPickerButtonLabel,onClick:a.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=e=>i.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=e=>i.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=e=>i.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=e=>i.emojiPickerFocus=!1)}),{icon:(0,_.withCtx)(()=>[a.emojiPickerHovered?((0,_.openBlock)(),(0,_.createBlock)(f,{key:0,size:`300`})):((0,_.openBlock)(),(0,_.createBlock)(p,{key:1,size:`300`}))]),_:1},16,[`aria-label`,`onClick`])),[[x,a.emojiPickerButtonLabel]])]),content:(0,_.withCtx)(({close:r})=>[(0,_.createVNode)(m,(0,_.mergeProps)(n.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=t=>e.$emit(`add-emoji`)),onSkinTone:a.onSkinTone,onSelectedEmoji:e=>a.onSelectEmoji(e,r),onScrollBottomReached:t[14]||(t[14]=t=>e.$emit(`emoji-scroll-bottom-reached`))}),null,16,[`onSkinTone`,`onSelectedEmoji`])]),_:1},8,[`open`])):(0,_.createCommentVNode)(``,!0),(0,_.renderSlot)(e.$slots,`emojiGiphyPicker`),(0,_.renderSlot)(e.$slots,`customActionIcons`),(0,_.renderSlot)(e.$slots,`messagePolish`)]),_:3})]),(0,_.createElementVNode)(`div`,k,[(0,_.createVNode)(g,{direction:`row`,gap:`300`},{default:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,A,[(0,_.renderSlot)(e.$slots,`scheduleMessage`)]),(0,_.createElementVNode)(`div`,j,[(0,_.renderSlot)(e.$slots,`smsCount`)]),n.showCharacterLimit?((0,_.openBlock)(),(0,_.createBlock)(v,{key:0,class:`d-recipe-message-input__remaining-char-tooltip`,placement:`top-end`,enabled:a.characterLimitTooltipEnabled,message:n.showCharacterLimit.message,offset:[10,8]},{anchor:(0,_.withCtx)(()=>[(0,_.withDirectives)((0,_.createElementVNode)(`p`,{class:`d-recipe-message-input__remaining-char`,"data-qa":`dt-recipe-message-input-character-limit`},(0,_.toDisplayString)(n.showCharacterLimit.count-a.inputLength),513),[[_.vShow,a.displayCharacterLimitWarning]])]),_:1},8,[`enabled`,`message`])):(0,_.createCommentVNode)(``,!0),n.showCancel?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:1,"data-qa":`dt-recipe-message-input-cancel-button`,class:`d-recipe-message-input__button d-recipe-message-input__cancel-button`,size:`sm`,kind:`muted`,importance:`clear`,"aria-label":a.cancelButtonLabel,onClick:a.onCancel},{default:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`p`,null,(0,_.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`aria-label`,`onClick`])),[[x,a.cancelButtonLabel]]):(0,_.createCommentVNode)(``,!0),(0,_.renderSlot)(e.$slots,`sendButton`,{},()=>[n.showSend?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:0,"data-qa":`dt-recipe-message-input-send-btn`,size:`sm`,kind:`default`,importance:`primary`,class:(0,_.normalizeClass)([`d-recipe-message-input__button d-recipe-message-input__send-button`,{"d-recipe-message-input__send-button--disabled":a.isSendDisabled,"d-btn--icon-only":a.showSendIcon}]),"aria-label":a.sendButtonLabel,"aria-disabled":a.isSendDisabled,onClick:a.onSend},(0,_.createSlots)({default:(0,_.withCtx)(()=>[n.showSend.text?((0,_.openBlock)(),(0,_.createElementBlock)(`p`,M,(0,_.toDisplayString)(n.showSend.text),1)):(0,_.createCommentVNode)(``,!0)]),_:2},[a.showSendIcon?{name:`icon`,fn:(0,_.withCtx)(()=>[(0,_.renderSlot)(e.$slots,`sendIcon`,{iconSize:a.sendIconSize},()=>[(0,_.createVNode)(y,{size:a.sendIconSize},null,8,[`size`])])]),key:`0`}:void 0]),1032,[`class`,`aria-label`,`aria-disabled`,`onClick`])),[[x,a.sendButtonLabel,`top-end`]]):(0,_.createCommentVNode)(``,!0)])]),_:3})])])],16)}var P=t.t(E,[[`render`,N]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
2
- //# sourceMappingURL=message_input-VmltTreF.cjs.map
1
+ require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`./localization/index.cjs`),r=require(`./lib/button/button.cjs`),i=require(`./lib/item-layout/item-layout.cjs`),a=require(`./lib/stack/stack.cjs`),o=require(`./lib/tooltip/tooltip.cjs`),s=require(`./lib/popover/popover.cjs`),c=require(`./lib/input/input.cjs`),l=require(`./emoji_picker-Cl-T4BXK.cjs`),u=require(`./node_modules/@tiptap/vue-3.cjs`),d=require(`./rich_text_editor-DMP5eTlf.cjs`),f=require(`./lib/rich-text-editor/rich-text-editor-constants.cjs`),p=require(`./lib/editor/editor-constants.cjs`),m=require(`./lib/message-input/last-active-nodes.cjs`),h=require(`./lib/message-input/message-input-topbar.cjs`),g=require(`./lib/message-input/message-input-link.cjs`);let _=require(`vue`),v=require(`@dialpad/dialtone-icons/vue3`),y=require(`@tiptap/core`);var b={name:`MeetingPill`,components:{NodeViewWrapper:u.NodeViewWrapper,DtItemLayout:i.default,DtIconClose:v.DtIconClose,DtButton:r.default,DtIconVideo:v.DtIconVideo},props:u.nodeViewProps,emits:[`meeting-pill-close`],data(){return{i18n:new n.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t(`DIALTONE_CLOSE_BUTTON`)}},methods:{close(e){let t=this.editor?.storage?.meetingPill?.onClose;t&&typeof t==`function`&&t(e)}}},x={class:`d-recipe-message-input-meeting-pill__icon`},S={class:`d-recipe-message-input-meeting-pill__close`};function C(e,t,n,r,i,a){let o=(0,_.resolveComponent)(`dt-icon-video`),s=(0,_.resolveComponent)(`dt-icon-close`),c=(0,_.resolveComponent)(`dt-button`),l=(0,_.resolveComponent)(`dt-item-layout`),u=(0,_.resolveComponent)(`node-view-wrapper`);return(0,_.openBlock)(),(0,_.createBlock)(u,{class:`d-recipe-message-input-meeting-pill`},{default:(0,_.withCtx)(()=>[(0,_.createVNode)(l,{class:`d-recipe-message-input-meeting-pill__layout`,unstyled:``},{left:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,x,[(0,_.createVNode)(o,{size:`400`})])]),right:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,S,[(0,_.createVNode)(c,{circle:``,importance:`clear`,size:`xs`,"aria-label":a.closeButtonTitle,title:a.closeButtonTitle,onClick:a.close},{icon:(0,_.withCtx)(()=>[(0,_.createVNode)(s,{size:`300`})]),_:1},8,[`aria-label`,`title`,`onClick`])])]),default:(0,_.withCtx)(()=>[(0,_.createTextVNode)(` `+(0,_.toDisplayString)(e.node.attrs.text)+` `,1)]),_:1})]),_:1})}var w=t.t(b,[[`render`,C]]),T=y.Node.create({name:`meetingPill`,atom:!0,group:`inline`,inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return u.VueNodeViewRenderer(w)},addAttributes(){return{text:{default:`Please pass in "text" attribute`}}},parseHTML(){return[{tag:`meeting-pill`}]},renderText(){return`/dpm`},renderHTML({HTMLAttributes:e}){return[`meeting-pill`,(0,y.mergeAttributes)(e)]}}),E={compatConfig:{MODE:3},name:`DtRecipeMessageInput`,components:{DtButton:r.default,DtEmojiPicker:l.t,DtInput:c.default,DtPopover:s.default,DtRecipeMessageInputTopbar:h.default,DtRecipeMessageInputLink:g.default,DtRichTextEditor:d.t,DtTooltip:o.default,DtStack:a.default,DtIconImage:v.DtIconImage,DtIconVerySatisfied:v.DtIconVerySatisfied,DtIconSatisfied:v.DtIconSatisfied,DtIconSend:v.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:``},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?f.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:`json`,validator(e){return f.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:``},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:`unset`},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:``})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + B`})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + I`})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + S`})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + K`,linkPlaceholder:`e.g. https://www.dialpad.com`})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + 8`})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + 7`})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Shift + B`})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + E`})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:`Mod + Alt + C`})}},emits:[`submit`,`select-media`,`add-media`,`paste-media`,`cancel`,`skin-tone`,`selected-emoji`,`selected-command`,`meeting-pill-close`,`update:modelValue`,`text-input`,`markdown-input`,`add-emoji`,`emoji-scroll-bottom-reached`],data(){return{lastActiveNodes:m.default,additionalExtensions:[T.configure({onClose:e=>{this.$emit(`meeting-pill-close`,e)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:`d-link d-c-text d-d-inline-block`},linkDialogOpen:!1,selectedText:``,text:``,hideLinkBubbleMenu:!1,i18n:new n.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSelectionActive(){return this.selectedText,e=>[`bulletList`,`orderedList`].includes(e)?this.richText?this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state,[{type:`bulletList`},{type:`orderedList`}]).includes(e)&&this.isFocused:!1:this.$refs.richTextEditor?.editor?.isActive(e)&&this.isFocused},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return`300`},sendButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL`)},imagePickerButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL`)},emojiPickerButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL`)},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL`)}},watch:{modelValue(e){this.internalInputValue=e},emojiPickerOpened(e){e||this.$refs.richTextEditor?.focusEditor()}},created(){this.modelValue&&this.outputFormat===`text`?this.internalInputValue=this.modelValue.replace(/\n/g,`<br>`):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:e.removeClassStyleAttrs,addClassStyleAttrs:e.addClassStyleAttrs,linkDialogOpened(e){this.linkDialogOpen=e,e===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,this.$refs.richTextEditor?.focusEditor())},handleTopbarClick(e){let t=this.$refs.richTextEditor?.editor,n={bold:()=>t?.chain().focus().toggleBold().run(),italic:()=>t?.chain().focus().toggleItalic().run(),strike:()=>t?.chain().focus().toggleStrike().run(),bulletList:()=>t?.chain().focus().toggleBulletList().run(),orderedList:()=>t?.chain().focus().toggleOrderedList().run(),blockquote:()=>t?.chain().focus().toggleBlockquote().run(),code:()=>t?.chain().focus().toggleCode().run(),codeBlock:()=>t?.chain().focus().toggleCodeBlock().run()};t&&n[e]&&n[e]()},initLinkDialog(){this.$refs.link.setInitialValues(this.selectedText,this.$refs.richTextEditor?.editor?.getAttributes(`link`)?.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){this.$refs.richTextEditor?.removeLink(),this.linkDialogOpen=!1},setLink(e,t){this.$refs.richTextEditor.setLink(t,e,this.linkOptions,p.EDITOR_SUPPORTED_LINK_PROTOCOLS,p.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(t){e.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(`.tiptap`).contains(t.target)||(t.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(e){let t=e.dataTransfer,n=Array.from(t.files);this.$emit(`add-media`,n)},onPaste(e){if(e.clipboardData.files.length){e.stopPropagation(),e.preventDefault();let t=[...e.clipboardData.files];this.$emit(`paste-media`,t)}},onSkinTone(e){this.$emit(`skin-tone`,e)},onSelectEmoji(e,t){e&&(e.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:`emoji`,attrs:{code:e.shortname,image:e.image,name:e.name}}),this.$emit(`selected-emoji`,e))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit(`select-media`,this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit(`submit`,this.internalInputValue)},onCancel(){this.$emit(`cancel`)},onInput(e){this.$emit(`update:modelValue`,e)},onTextInput(e){this.text=e,this.$emit(`text-input`,e)},onMarkdownInput(e){this.$emit(`markdown-input`,e)}}},D={class:`d-recipe-message-input__bottom-section`},O={class:`d-recipe-message-input__bottom-section-left`},k={class:`d-recipe-message-input__bottom-section-right`},A={class:`d-recipe-message-input__schedule-message`},j={class:`d-recipe-message-input__sms-count`},M={key:0};function N(e,t,n,r,i,a){let o=(0,_.resolveComponent)(`dt-recipe-message-input-link`),s=(0,_.resolveComponent)(`dt-recipe-message-input-topbar`),c=(0,_.resolveComponent)(`dt-rich-text-editor`),l=(0,_.resolveComponent)(`dt-icon-image`),u=(0,_.resolveComponent)(`dt-button`),d=(0,_.resolveComponent)(`dt-input`),f=(0,_.resolveComponent)(`dt-icon-very-satisfied`),p=(0,_.resolveComponent)(`dt-icon-satisfied`),m=(0,_.resolveComponent)(`dt-emoji-picker`),h=(0,_.resolveComponent)(`dt-popover`),g=(0,_.resolveComponent)(`dt-stack`),v=(0,_.resolveComponent)(`dt-tooltip`),y=(0,_.resolveComponent)(`dt-icon-send`),b=(0,_.resolveDirective)(`dt-scrollbar`),x=(0,_.resolveDirective)(`dt-tooltip`);return(0,_.openBlock)(),(0,_.createElementBlock)(`div`,(0,_.mergeProps)({"data-qa":`dt-recipe-message-input`,role:`presentation`,class:`d-recipe-message-input`},a.addClassStyleAttrs(e.$attrs),{onDragover:t[16]||(t[16]=(0,_.withModifiers)(()=>{},[`prevent`])),onDrop:t[17]||(t[17]=(0,_.withModifiers)((...e)=>a.onDrop&&a.onDrop(...e),[`prevent`])),onPaste:t[18]||(t[18]=(...e)=>a.onPaste&&a.onPaste(...e)),onMousedown:t[19]||(t[19]=(...e)=>a.onMousedown&&a.onMousedown(...e))}),[(0,_.renderSlot)(e.$slots,`top`),n.richText?((0,_.openBlock)(),(0,_.createBlock)(s,{key:0,"bold-button-options":n.boldButtonOptions,"italic-button-options":n.italicButtonOptions,"strike-button-options":n.strikeButtonOptions,"bullet-list-button-options":n.bulletListButtonOptions,"ordered-list-button-options":n.orderedListButtonOptions,"block-quote-button-options":n.blockQuoteButtonOptions,"code-button-options":n.codeButtonOptions,"code-block-button-options":n.codeBlockButtonOptions,"is-selection-active":a.isSelectionActive,onClick:a.handleTopbarClick},{link:(0,_.withCtx)(()=>[(0,_.createVNode)(o,{ref:`link`,open:i.linkDialogOpen,"link-button-options":n.linkButtonOptions,"is-selection-active":a.isSelectionActive,onOpened:a.linkDialogOpened,onSetLink:a.setLink,onRemoveLink:a.removeLink},null,8,[`open`,`link-button-options`,`is-selection-active`,`onOpened`,`onSetLink`,`onRemoveLink`])]),_:1},8,[`bold-button-options`,`italic-button-options`,`strike-button-options`,`bullet-list-button-options`,`ordered-list-button-options`,`block-quote-button-options`,`code-button-options`,`code-block-button-options`,`is-selection-active`,`onClick`])):(0,_.createCommentVNode)(``,!0),(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createElementBlock)(`div`,{class:`d-recipe-message-input__editor-wrapper`,style:(0,_.normalizeStyle)({"max-height":n.maxHeight})},[(0,_.createVNode)(c,(0,_.mergeProps)({ref:`richTextEditor`,modelValue:i.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>i.internalInputValue=e),"allow-blockquote":n.richText,"allow-bold":n.richText,"allow-bullet-list":n.richText,"allow-code":n.richText,"allow-codeblock":n.richText,"allow-italic":n.richText,"allow-strike":n.richText,"allow-underline":n.richText,"paste-rich-text":n.richText,editable:n.editable,"input-aria-label":n.inputAriaLabel,"input-class":n.inputClass,"output-format":n.outputFormat,"auto-focus":n.autoFocus,link:n.richText,placeholder:n.placeholder,"prevent-typing":n.preventTyping,"mention-suggestion":n.mentionSuggestion,"channel-suggestion":n.channelSuggestion,"slash-command-suggestion":n.slashCommandSuggestion,"additional-extensions":i.additionalExtensions,"hide-link-bubble-menu":i.hideLinkBubbleMenu},a.removeClassStyleAttrs(e.$attrs),{onInput:a.onInput,onTextInput:a.onTextInput,onMarkdownInput:a.onMarkdownInput,onEnter:a.onSend,onSelected:t[1]||(t[1]=e=>i.selectedText=e),onSelectedCommand:t[2]||(t[2]=t=>e.$emit(`selected-command`,t)),onEditLink:a.initLinkDialog,onFocus:t[3]||(t[3]=e=>i.isFocused=!0),onBlur:t[4]||(t[4]=e=>i.isFocused=!1)}),null,16,`modelValue.allow-blockquote.allow-bold.allow-bullet-list.allow-code.allow-codeblock.allow-italic.allow-strike.allow-underline.paste-rich-text.editable.input-aria-label.input-class.output-format.auto-focus.link.placeholder.prevent-typing.mention-suggestion.channel-suggestion.slash-command-suggestion.additional-extensions.hide-link-bubble-menu.onInput.onTextInput.onMarkdownInput.onEnter.onEditLink`.split(`.`))],4)),[[b]]),(0,_.renderSlot)(e.$slots,`middle`),(0,_.createElementVNode)(`section`,D,[(0,_.createElementVNode)(`div`,O,[(0,_.createVNode)(g,{gap:`200`,direction:`row`,class:`d-recipe-message-input__bottom-section-left-stack`},{default:(0,_.withCtx)(()=>[n.showImagePicker?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:0,"data-qa":`dt-recipe-message-input-image-btn`,size:`sm`,class:`d-recipe-message-input__button`,kind:`muted`,importance:`clear`,"aria-label":a.imagePickerButtonLabel,onClick:a.onSelectImage,onMouseenter:t[5]||(t[5]=e=>i.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=e=>i.imagePickerFocus=!1),onFocus:t[7]||(t[7]=e=>i.imagePickerFocus=!0),onBlur:t[8]||(t[8]=e=>i.imagePickerFocus=!1)},{icon:(0,_.withCtx)(()=>[(0,_.createVNode)(l,{size:`300`})]),_:1},8,[`aria-label`,`onClick`])),[[x,a.imagePickerButtonLabel,`top-start`]]):(0,_.createCommentVNode)(``,!0),(0,_.createVNode)(d,{ref:`messageInputImageUpload`,"data-qa":`dt-recipe-message-input-image-input`,accept:`image/*, video/*`,type:`file`,class:`d-recipe-message-input__image-input`,multiple:``,hidden:``,onInput:a.onImageUpload},null,8,[`onInput`]),n.showEmojiPicker?((0,_.openBlock)(),(0,_.createBlock)(h,{key:1,open:i.emojiPickerOpened,"onUpdate:open":t[15]||(t[15]=e=>i.emojiPickerOpened=e),"data-qa":`dt-recipe-message-input-emoji-picker-popover`,"initial-focus-element":`#searchInput`,padding:`none`},{anchor:(0,_.withCtx)(({attrs:e})=>[(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,(0,_.mergeProps)(e,{"data-qa":`dt-recipe-message-input-emoji-picker-btn`,size:`sm`,class:`d-recipe-message-input__button`,kind:`muted`,importance:`clear`,"aria-label":a.emojiPickerButtonLabel,onClick:a.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=e=>i.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=e=>i.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=e=>i.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=e=>i.emojiPickerFocus=!1)}),{icon:(0,_.withCtx)(()=>[a.emojiPickerHovered?((0,_.openBlock)(),(0,_.createBlock)(f,{key:0,size:`300`})):((0,_.openBlock)(),(0,_.createBlock)(p,{key:1,size:`300`}))]),_:1},16,[`aria-label`,`onClick`])),[[x,a.emojiPickerButtonLabel]])]),content:(0,_.withCtx)(({close:r})=>[(0,_.createVNode)(m,(0,_.mergeProps)(n.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=t=>e.$emit(`add-emoji`)),onSkinTone:a.onSkinTone,onSelectedEmoji:e=>a.onSelectEmoji(e,r),onScrollBottomReached:t[14]||(t[14]=t=>e.$emit(`emoji-scroll-bottom-reached`))}),null,16,[`onSkinTone`,`onSelectedEmoji`])]),_:1},8,[`open`])):(0,_.createCommentVNode)(``,!0),(0,_.renderSlot)(e.$slots,`emojiGiphyPicker`),(0,_.renderSlot)(e.$slots,`customActionIcons`),(0,_.renderSlot)(e.$slots,`messagePolish`)]),_:3})]),(0,_.createElementVNode)(`div`,k,[(0,_.createVNode)(g,{direction:`row`,gap:`300`},{default:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`div`,A,[(0,_.renderSlot)(e.$slots,`scheduleMessage`)]),(0,_.createElementVNode)(`div`,j,[(0,_.renderSlot)(e.$slots,`smsCount`)]),n.showCharacterLimit?((0,_.openBlock)(),(0,_.createBlock)(v,{key:0,class:`d-recipe-message-input__remaining-char-tooltip`,placement:`top-end`,enabled:a.characterLimitTooltipEnabled,message:n.showCharacterLimit.message,offset:[10,8]},{anchor:(0,_.withCtx)(()=>[(0,_.withDirectives)((0,_.createElementVNode)(`p`,{class:`d-recipe-message-input__remaining-char`,"data-qa":`dt-recipe-message-input-character-limit`},(0,_.toDisplayString)(n.showCharacterLimit.count-a.inputLength),513),[[_.vShow,a.displayCharacterLimitWarning]])]),_:1},8,[`enabled`,`message`])):(0,_.createCommentVNode)(``,!0),n.showCancel?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:1,"data-qa":`dt-recipe-message-input-cancel-button`,class:`d-recipe-message-input__button d-recipe-message-input__cancel-button`,size:`sm`,kind:`muted`,importance:`clear`,"aria-label":a.cancelButtonLabel,onClick:a.onCancel},{default:(0,_.withCtx)(()=>[(0,_.createElementVNode)(`p`,null,(0,_.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`aria-label`,`onClick`])),[[x,a.cancelButtonLabel]]):(0,_.createCommentVNode)(``,!0),(0,_.renderSlot)(e.$slots,`sendButton`,{},()=>[n.showSend?(0,_.withDirectives)(((0,_.openBlock)(),(0,_.createBlock)(u,{key:0,"data-qa":`dt-recipe-message-input-send-btn`,size:`sm`,kind:`default`,importance:`primary`,class:(0,_.normalizeClass)([`d-recipe-message-input__button d-recipe-message-input__send-button`,{"d-recipe-message-input__send-button--disabled":a.isSendDisabled,"d-btn--icon-only":a.showSendIcon}]),"aria-label":a.sendButtonLabel,"aria-disabled":a.isSendDisabled,onClick:a.onSend},(0,_.createSlots)({default:(0,_.withCtx)(()=>[n.showSend.text?((0,_.openBlock)(),(0,_.createElementBlock)(`p`,M,(0,_.toDisplayString)(n.showSend.text),1)):(0,_.createCommentVNode)(``,!0)]),_:2},[a.showSendIcon?{name:`icon`,fn:(0,_.withCtx)(()=>[(0,_.renderSlot)(e.$slots,`sendIcon`,{iconSize:a.sendIconSize},()=>[(0,_.createVNode)(y,{size:a.sendIconSize},null,8,[`size`])])]),key:`0`}:void 0]),1032,[`class`,`aria-label`,`aria-disabled`,`onClick`])),[[x,a.sendButtonLabel,`top-end`]]):(0,_.createCommentVNode)(``,!0)])]),_:3})])])],16)}var P=t.t(E,[[`render`,N]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
2
+ //# sourceMappingURL=message_input-AWgvtwMV.cjs.map