@dialpad/dialtone 9.126.4 → 9.126.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +26079 -26079
- package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row-constants.js +1 -0
- package/dist/vue2/lib/emoji-row/emoji-row-constants.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +28 -30
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +1 -1
- package/dist/vue2/lib/modal/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal/modal.js +13 -9
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +34 -38
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/localization/en-US.cjs +1 -11
- package/dist/vue2/localization/en-US.cjs.map +1 -1
- package/dist/vue2/localization/en-US.js +1 -11
- package/dist/vue2/localization/en-US.js.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +3 -2
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts.map +1 -1
- package/dist/vue3/lib/modal/modal.cjs +2 -2
- package/dist/vue3/lib/modal/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal/modal.js +55 -48
- package/dist/vue3/lib/modal/modal.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +2 -2
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +18 -22
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/types/components/modal/modal.vue.d.ts +4 -2
- package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { returnFirstEl, getUniqueString, hasSlotContent, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(returnFirstEl(this.$el).getRootNode().host);\n } else {\n enableRootScrolling(returnFirstEl(this.$el).getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","props","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","hasSlotContent","event","isShowing","disableRootScrolling","returnFirstEl","enableRootScrolling","_a","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createBlock","_component_dt_lazy_show","_mergeProps","$props","$data","$options","_toHandlers","_withCtx","_ctx","_createElementBlock","_normalizeClass","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode","_createVNode","_Transition","_createElementVNode","_hoisted_4","_component_dt_button","_component_dt_icon_close","_component_sr_only_close_button"],"mappings":";;;;;;;;;;;;AAyIA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,GAAOC,CAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAACC,MACH,CAAC,CAACA,EAAM;AAAA,IAElB;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,WAAY;AAAE,eAAOC,EAAe;AAAA,MAAK;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MAC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\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && (hasSlotContent($slots.banner) || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"hasSlotContent($slots.header)\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"hasSlotContent($slots.default)\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue3';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { returnFirstEl, getUniqueString, hasSlotContent, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * Native button click event\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n hasSlotContent,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n click: event => {\n // Handle backdrop clicks for closing modal\n if (this.closeOnClick && event.target === event.currentTarget) {\n this.close();\n } else if (this.show && event.target !== event.currentTarget) {\n // Ensure focus stays within modal when clicking inside it\n this.handleModalClick(event);\n }\n\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': async () => {\n this.$emit('update:show', true);\n await this.setFocusAfterTransition();\n },\n\n focusin: event => {\n // Ensure focus stays within modal\n if (this.show && !this.$el.contains(event.target)) {\n event.preventDefault();\n this.focusFirstElement();\n }\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(returnFirstEl(this.$el).getRootNode().host);\n } else {\n enableRootScrolling(returnFirstEl(this.$el).getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n async setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n await this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n await this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n handleModalClick (event) {\n // Ensure focus stays within modal when clicking inside it\n const clickedElement = event.target;\n const focusableElements = this._getFocusableElements();\n\n // If the clicked element is not focusable, ensure focus stays in modal\n if (focusableElements.length && !focusableElements.includes(clickedElement)) {\n // Check if current active element is still within the modal\n if (!focusableElements.includes(document.activeElement)) {\n this.focusFirstElement();\n }\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","props","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","hasSlotContent","event","isShowing","disableRootScrolling","returnFirstEl","enableRootScrolling","_a","clickedElement","focusableElements","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createBlock","_component_dt_lazy_show","_mergeProps","$props","$data","$options","_toHandlers","_withCtx","_ctx","_createElementBlock","_normalizeClass","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode","_createVNode","_Transition","_createElementVNode","_hoisted_4","_component_dt_button","_component_dt_icon_close","_component_sr_only_close_button"],"mappings":";;;;;;;;;;;;AAyIA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,GAAOC,CAAsB;AAAA,EAEtC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,kBAAkB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,CAACC,MACH,CAAC,CAACA,EAAM;AAAA,IAElB;AAAA;AAAA;AAAA;AAAA,IAKD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS,WAAY;AAAE,eAAOC,EAAe;AAAA,MAAK;AAAA,IACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,OAAO;AAAA,MACL,MA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,MAAK,MAAK,CAAA;AAAA;cArGxB,GAAA;AAAA;YA0GgBZ,EAAuB,gCAD/BR,EAIEqB,GAAA;AAAA,cA7GV,KAAA;AAAA,cA2GW,+BAA6Bb,EAAwB;AAAA,cACrD,SAAOH,EAAK;AAAA,uEA5GvBS,EAAA,IAAA,EAAA;AAAA,UAAA,GAAA,IAAAlB,CAAA,GAAA;AAAA,gBAiCgBO,EAAI,IAAA;AAAA;;QAjCpB,GAAA;AAAA;;IAAA,GAAA;AAAA;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../node_modules/@tiptap/vue-3.cjs"),u=require("@tiptap/core"),I=require("@tiptap/extension-blockquote"),q=require("@tiptap/extension-code-block"),$=require("@tiptap/extension-code"),A=require("@tiptap/extension-document"),N=require("@tiptap/extension-hard-break"),P=require("@tiptap/extension-paragraph"),j=require("@tiptap/extension-placeholder"),H=require("@tiptap/extension-bold"),F=require("@tiptap/extension-bullet-list"),K=require("@tiptap/extension-italic"),W=require("@tiptap/extension-link"),U=require("@tiptap/extension-list-item"),z=require("@tiptap/extension-ordered-list"),X=require("@tiptap/extension-strike"),J=require("@tiptap/extension-underline"),Y=require("@tiptap/extension-text"),G=require("@tiptap/extension-text-align"),Q=require("@tiptap/extension-history"),Z=require("@tiptap/extension-text-style"),ee=require("@tiptap/extension-color"),te=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),ne=require("@tiptap/suggestion"),D=require("regex-combined-emojis"),o=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),V=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),oe=require("@dialpad/dialtone-emojis"),re=require("../list-item/list-item.cjs"),x=require("../stack/stack.cjs"),b=require("tippy.js"),k=require("../../common/utils/index.cjs"),ie=require("@tiptap/extension-image"),B=require("@tiptap/extension-mention"),O=require("../link/link.cjs"),C=require("./rich-text-editor-constants.cjs"),se=require("../avatar/avatar.cjs"),ae=require("@dialpad/dialtone-icons/vue3/hash"),ce=require("@dialpad/dialtone-icons/vue3/lock"),le=require("deep-equal"),de=require("../button/button.cjs"),ue={compatConfig:{MODE:3},name:"EmojiComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtEmoji:V.default},props:d.nodeViewProps};function me(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block d-va-bottom d-lh0"},{default:o.withCtx(()=>[o.createVNode(a,{size:"500",code:e.node.attrs.code},null,8,["code"])]),_:1})}const he=h._(ue,[["render",me]]),pe={compatConfig:{MODE:3},name:"SuggestionList",components:{DtListItem:re.default},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:e}){return e.key==="ArrowUp"?(this.upHandler(),!0):e.key==="ArrowDown"?(this.downHandler(),!0):e.key==="Enter"||e.key==="Tab"?(this.selectHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},async scrollActiveElementIntoView(){await this.$nextTick();const e=this.$refs.suggestionList.querySelector(".d-list-item--highlighted");e&&e.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){const t=this.items[e];switch(this.itemType){case"emoji":this.command(t);return;case"mention":this.command({name:t.name,id:t.id,avatarSrc:t.avatarSrc});break;case"channel":this.command({name:t.name,id:t.id});break;case"slash-command":this.command({command:t.command});break}}}},fe={class:"d-popover__dialog d-suggestion-list__container"},ge={ref:"suggestionList",class:"d-suggestion-list"};function _e(e,t,r,n,i,s){const a=o.resolveComponent("dt-list-item");return o.openBlock(),o.createElementBlock("div",fe,[o.withDirectives(o.createElementVNode("ul",ge,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.items,(c,l)=>(o.openBlock(),o.createBlock(a,{key:c.id,class:o.normalizeClass(["d-suggestion-list__item",{"d-list-item--highlighted":l===i.selectedIndex}]),"navigation-type":"arrow-keys",onClick:m=>s.selectItem(l),onKeydown:o.withModifiers(s.onKeyDown,["prevent"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.itemComponent),{item:c},null,8,["item"]))]),_:2},1032,["class","onClick","onKeydown"]))),128))],512),[[o.vShow,r.items.length]])])}const E=h._(pe,[["render",_e]]),ke={compatConfig:{MODE:3},name:"EmojiSuggestion",components:{DtEmoji:V.default,DtStack:x.default},props:{item:{type:Object,required:!0}}};function we(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{size:"200",code:r.item.code},null,8,["code"]),o.createTextVNode(" "+o.toDisplayString(r.item.code),1)]),_:1})}const ye=h._(ke,[["render",we]]),T={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(r){r.keyCode===27&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}},Ce=20,xe={items:({query:e})=>{if(e.length<2)return[];const t=Object.values(oe.emojisIndexed);return e=e.toLowerCase(),t.filter(n=>[n.name,n.shortname.replaceAll(":",""),...n.keywords].some(i=>i.startsWith(e))).splice(0,Ce).map(n=>({code:n.shortname}))},command:({editor:e,range:t,props:r})=>{var s,a;const n=e.view.state.selection.$to.nodeAfter;((s=n==null?void 0:n.text)==null?void 0:s.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:"emoji",attrs:r}]).run(),(a=window.getSelection())==null||a.collapseToEnd()},render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(ye),itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),t==null||t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},be=/(:\w+:)$/,Ee=new RegExp(D.emojiPattern+"$"),Te=e=>{if(e&&f.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},Se=e=>[...e.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),ve=u.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return d.VueNodeViewRenderer(he)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:e}){return f.stringToUnicode(f.codeToEmojiData(e.attrs.code).unicode_output)},renderHTML({HTMLAttributes:e}){return["emoji-component",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){return[new u.InputRule({find:e=>{const t=e.match(be)||e.match(Ee);if(t)return Te(t)},handler:({state:e,range:t,match:r,commands:n,chain:i,can:s})=>{const{tr:a}=e,c=t.from,l=t.to;a.replaceWith(c,l,this.type.create({code:r[0]}))}})]},addPasteRules(){return[u.nodePasteRule({find:Se,type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodePasteRule({find:f.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[ne({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...xe})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:i,anchor:s}=n;return i?(t.doc.nodesBetween(s-1,s,(a,c)=>{if(a.type.name===this.name)return r=!0,e.insertText("",c,c+a.nodeSize),!1}),r):!1})}}});function Be(e,t,r=()=>!0){const n=[];t.lastIndex=0;let i;for(;i=t.exec(e);)r(e,i)&&n.push(i);return n}function Re(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function Le(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function Pe(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const i=e.slice(r);return{text:i,from:r,to:r+i.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function v(e,t,r,n){const i=Pe(e,t);if(n.lastIndex=0,!n.test(i.text))return i;const s=r==="left"?i.from-1:i.to+1;return s<=0||s>=e.length||s===t?i:v(e,s,r,n)}function De(e,t,r,n){const i=Math.max(e.from-1,0),s=Math.min(e.to+1,t.content.size),a=u.getMarksBetween(i,s,t);for(const c of a)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const R=k.getPhoneNumberRegex(1,15);function L(e,t,r,n,i,s){if(!e)return;let a=r-t-1;a=a<0?0:a;const c=n-t,l=v(e,a,"left",R),m=v(e,c,"right",R),p=e.slice(l.from,m.to);Be(p,k.linkRegex,Re).forEach(S=>{const _=Le(S[0]),y=t+l.from+S.index+1,M=y+_.length;i.addMark(y,M,s.create())})}function Ve(e){let t=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const s=r.some(p=>p.docChanged)&&!n.doc.eq(i.doc);if(t&&!s)return;const{tr:a}=i,{textContent:c}=i.doc;t||L(c,0,0,c.length,a,e.type),t=!0;const l=u.combineTransactionSteps(n.doc,[...r]);return u.getChangedRanges(l).forEach(({oldRange:p,newRange:w})=>{De(w,i.doc,a,e.type),u.findChildrenInRange(i.doc,w,_=>_.isTextblock).forEach(({node:_,pos:y})=>{L(_.textContent,y,p.from,w.to,a,e.type)})}),a}})}const Oe={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Me=u.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,Oe)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ve({type:this.type})]}}),Ie=ie.extend({name:"ConfigurableImage",addAttributes(){return{src:{default:""},alt:{default:void 0},title:{default:void 0},width:{default:void 0},height:{default:void 0},style:{default:void 0}}}}).configure({inline:!0,allowBase64:!0}),qe=P.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),$e={compatConfig:{MODE:3},name:"MentionComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:O.default},props:d.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};function Ae(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const Ne=h._($e,[["render",Ae]]),je=B.extend({addNodeView(){return d.VueNodeViewRenderer(Ne)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["mention-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"@",pluginKey:new g.PluginKey("mentionSuggestion")}}),He={compatConfig:{MODE:3},name:"ChannelComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:O.default},props:d.nodeViewProps,computed:{text(){return"#"+this.$props.node.attrs.name}}};function Fe(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const Ke=h._(He,[["render",Fe]]),We=B.extend({name:"channel",addNodeView(){return d.VueNodeViewRenderer(Ke)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["channel-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"#",pluginKey:new g.PluginKey("channelSuggestion")}}),Ue={compatConfig:{MODE:3},name:"SlashCommandsComponent",components:{NodeViewWrapper:d.NodeViewWrapper},props:{...d.nodeViewProps},emits:["selected-command"],computed:{text(){return"/"+this.$props.node.attrs.command}},created(){var r,n,i;const e=this.$props.node.attrs.command;this.$emit("selected-command",e);const t=(i=(n=(r=this.editor)==null?void 0:r.storage)==null?void 0:n["slash-commands"])==null?void 0:i.onSelectedCommand;t&&typeof t=="function"&&t(e)}};function ze(e,t,r,n,i,s){const a=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(a,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})}const Xe=h._(Ue,[["render",ze]]),Je=(e,t)=>[...e.matchAll(t)].map(n=>{let i=n[2];return i.endsWith(" ")||(i+=" "),{index:n.index,text:i,match:n}}),Ye=B.extend({name:"slash-commands",group:"inline",inline:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onSelectedCommand:null}},addStorage(){return{onSelectedCommand:this.options.onSelectedCommand}},addNodeView(){return d.VueNodeViewRenderer(Xe)},parseHTML(){return[{tag:"command-component"}]},addAttributes(){return{command:{default:""},parametersExample:{default:""},description:{default:""}}},renderText({node:e}){return`/${e.attrs.command}`},renderHTML({HTMLAttributes:e}){return["command-component",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) $`);return[u.nodeInputRule({find:t,type:this.type,getAttributes(n){return{command:n[2]}}})]},addPasteRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) ?$`,"g");return[u.nodePasteRule({find:n=>Je(n,t),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),Ge={compatConfig:{MODE:3},name:"MentionSuggestion",components:{DtAvatar:se.default,DtStack:x.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc},presence(){return this.item.presence},status(){return this.item.status},presenceText(){return this.item.presenceText},presenceFontColorClass(){return{active:"d-recipe-contact-row--active",busy:"d-recipe-contact-row--busy",away:"d-recipe-contact-row--away",offline:"d-recipe-contact-row--busy"}[this.presence]},showDetails(){return this.item.showDetails}}},Qe={class:"d-mention-suggestion__name"},Ze={key:1,class:"d-mention-suggestion__divider"},et={key:2,class:"d-mention-suggestion__status"};function tt(e,t,r,n,i,s){const a=o.resolveComponent("dt-avatar"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",class:"d-mention-suggestion__container",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{"full-name":s.name,"image-src":s.avatarSrc,"image-alt":s.name,"show-presence":s.showDetails,presence:s.presence,size:"sm"},null,8,["full-name","image-src","image-alt","show-presence","presence"]),o.createVNode(c,{class:"d-mention-suggestion__details-container",gap:"100"},{default:o.withCtx(()=>[o.createElementVNode("span",Qe,o.toDisplayString(s.name),1),s.showDetails?(o.openBlock(),o.createBlock(c,{key:0,direction:"row",gap:"300",class:"d-label--sm-plain"},{default:o.withCtx(()=>[s.presenceText?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["d-mention-suggestion__presence",[s.presenceFontColorClass]])},o.toDisplayString(s.presenceText),3)):o.createCommentVNode("",!0),s.status&&s.presenceText?(o.openBlock(),o.createElementBlock("div",Ze," • ")):o.createCommentVNode("",!0),s.status?(o.openBlock(),o.createElementBlock("div",et,o.toDisplayString(s.status),1)):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1})}const nt=h._(Ge,[["render",tt]]),ot={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(nt),itemType:"mention",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},rt={compatConfig:{MODE:3},name:"ChannelSuggestion",components:{DtStack:x.default,DtIconHash:ae,DtIconLock:ce},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function it(e,t,r,n,i,s){const a=o.resolveComponent("dt-icon-hash"),c=o.resolveComponent("dt-icon-lock"),l=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(l,{direction:"row",gap:"400"},{default:o.withCtx(()=>[r.item.locked?(o.openBlock(),o.createBlock(c,{key:1,size:"300"})):(o.openBlock(),o.createBlock(a,{key:0,size:"300"})),o.createElementVNode("span",null,o.toDisplayString(s.name),1)]),_:1})}const st=h._(rt,[["render",it]]),at={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(st),itemType:"channel",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ct={compatConfig:{MODE:3},name:"SlashCommandSuggestion",props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}},lt={class:"d-body--md-compact"},dt={key:0},ut={class:"d-body--sm d-fc-tertiary"};function mt(e,t,r,n,i,s){return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",lt,[o.createElementVNode("span",null,"/"+o.toDisplayString(s.command),1),s.parametersExample?(o.openBlock(),o.createElementBlock("span",dt,o.toDisplayString(s.parametersExample),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",ut,o.toDisplayString(s.description),1)])}const ht=h._(ct,[["render",mt]]),pt={allowSpaces:!0,startOfLine:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{parent:void 0,props:{itemComponent:o.markRaw(ht),itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ft={compatConfig:{MODE:3},name:"DtRichTextEditor",components:{EditorContent:d.EditorContent,BubbleMenu:d.BubbleMenu,DtButton:de.default,DtStack:x.default},props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},preventTyping:{type:Boolean,default:!1},pasteRichText:{type:Boolean,default:!0},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e=="string"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:"html",validator(e){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0},allowCode:{type:Boolean,default:!0},allowCodeblock:{type:Boolean,default:!0},allowInlineImages:{type:Boolean,default:!1},allowFontColor:{type:Boolean,default:!1},allowFontFamily:{type:Boolean,default:!1},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","update:modelValue","blur","focus","enter","edit-link","selected","selected-command"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var e;return(e=k.returnFirstEl(this.$refs.editor.$el).getRootNode())==null?void 0:e.querySelector("body")},placement:"top-start"}}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){const e=[A,Y,Q,N];e.push(this.useDivTags?qe:P),this.allowBlockquote&&e.push(I),this.allowBold&&e.push(H),this.allowBulletList&&(e.push(F),e.push(U.extend({renderText({node:n}){return n.textContent}})),e.push(z)),this.allowItalic&&e.push(K),this.allowStrike&&e.push(X),this.allowUnderline&&e.push(J),this.placeholder&&e.push(j.configure({placeholder:this.placeholder}));const t=this,r=u.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>t.allowLineBreaks?!1:(n.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>t.allowBulletList&&i.splitListItem("listItem"),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit("enter"),!0)}}});if(e.push(r),this.link&&e.push(W.extend({inclusive:!1}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension(Me,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...ot};e.push(je.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,...at};e.push(We.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...pt};e.push(Ye.configure({suggestion:n,onSelectedCommand:i=>{this.$emit("selected-command",i)}}))}return e.push(ve),e.push(G.configure({types:["paragraph"]})),this.allowCode&&e.push($),this.allowCodeblock&&e.push(q.extend({renderText({node:n}){return`\`\`\`
|
|
2
2
|
${n.textContent}
|
|
3
|
-
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(Ie),(this.allowFontFamily||this.allowFontColor)&&(e.push(Z),this.allowFontColor&&e.push(ee),this.allowFontFamily&&e.push(te)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),e},inputAttrs(){const e={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:"textbox"};return this.editable||(e["aria-readonly"]=!0),e}},watch:{editable(e){this.editor.setEditable(e),this.updateEditorAttributes({"aria-readonly":!e})},inputClass(e){this.updateEditorAttributes({class:e})},inputAriaLabel(e){this.updateEditorAttributes({"aria-label":e})},extensions(){this.destroyEditor(),this.createEditor()},modelValue(e){this.processValue(e)}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){k.warnIfUnmounted(k.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new d.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,parseOptions:{preserveWhitespace:"full"},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handlePaste:(e,t,r)=>{const n=t.clipboardData||window.clipboardData,i=n.getData("text/plain"),s=n.getData("text/html");return this.processPasteData(e,i,s)},transformPastedHTML(e){return e.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e,view:t,state:r,oldState:n,from:i,to:s}){return e.isActive("link")},getSelectedLinkText(e){var c,l,m;const{view:t,state:r}=e,{from:n,to:i}=t.state.selection,s=r.doc.textBetween(n,i,""),a=this.editor.state.doc.nodeAt(n);return a&&((m=(l=(c=a.marks)==null?void 0:c.at(0))==null?void 0:l.type)==null?void 0:m.name)==="link"?a.textContent:s},editLink(){const e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes("link").href,text:e};this.$emit("edit-link",t)},removeLink(){var e,t,r,n;(n=(r=(t=(e=this.editor)==null?void 0:e.chain())==null?void 0:t.focus())==null?void 0:r.unsetLink())==null||n.run()},openLink(){var t,r;(r=(t=this.editor)==null?void 0:t.chain())==null||r.focus();const e=this.editor.getAttributes("link").href;window.open(e,"_blank")},setLink(e,t,r,n=C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){var c,l,m;if(!e){this.removeLink();return}n.find(p=>p.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange("link").run();const a=(m=(l=(c=this.editor)==null?void 0:c.view)==null?void 0:l.state)==null?void 0:m.selection;this.editor.chain().focus().insertContent(t).setTextSelection({from:a.from,to:a.from+t.length}).setLink({href:e,class:r.class}).run()},processValue(e,t=!0){const r=this.getOutput();if(!(t&&le(e,r))){if(typeof e=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${D.emojiPattern})`,"g");e=e==null?void 0:e.replace(n,'<emoji-component code="$1"></emoji-component>')}this.editor.commands.setContent(e,!1,{preserveWhitespace:"full"})}},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){const{tr:r}=e.state,{from:n,to:i}=e.state.selection;r.deleteRange(n,i);const s=t.split(/\r?\n/);let a=n;for(let c=0;c<s.length;c++)c>0&&(r.insert(a,e.state.schema.nodes.hardBreak.create()),a++),r.insertText(s[c],a),a+=s[c].length;e.dispatch(r)},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,r){if(this.shouldPreserveLineBreaks(t,r))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(r)){const n=this.extractPreformattedText(r);if(n&&n.includes(`
|
|
3
|
+
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(Ie),(this.allowFontFamily||this.allowFontColor)&&(e.push(Z),this.allowFontColor&&e.push(ee),this.allowFontFamily&&e.push(te)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),e},inputAttrs(){const e={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:"textbox"};return this.editable||(e["aria-readonly"]=!0),e}},watch:{editable(e){this.editor.setEditable(e),this.updateEditorAttributes({"aria-readonly":!e})},inputClass(e){this.updateEditorAttributes({class:e})},inputAriaLabel(e){this.updateEditorAttributes({"aria-label":e})},extensions(){this.destroyEditor(),this.createEditor()},modelValue(e){this.processValue(e)}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){k.warnIfUnmounted(k.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new d.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,parseOptions:{preserveWhitespace:"full"},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handleKeyDown:(e,t)=>!!(this.preventTyping&&t.key!=="Backspace"),handlePaste:(e,t,r)=>{const n=t.clipboardData||window.clipboardData,i=n.getData("text/plain"),s=n.getData("text/html");return this.processPasteData(e,i,s)},transformPastedHTML(e){return e.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e,view:t,state:r,oldState:n,from:i,to:s}){return e.isActive("link")},getSelectedLinkText(e){var c,l,m;const{view:t,state:r}=e,{from:n,to:i}=t.state.selection,s=r.doc.textBetween(n,i,""),a=this.editor.state.doc.nodeAt(n);return a&&((m=(l=(c=a.marks)==null?void 0:c.at(0))==null?void 0:l.type)==null?void 0:m.name)==="link"?a.textContent:s},editLink(){const e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes("link").href,text:e};this.$emit("edit-link",t)},removeLink(){var e,t,r,n;(n=(r=(t=(e=this.editor)==null?void 0:e.chain())==null?void 0:t.focus())==null?void 0:r.unsetLink())==null||n.run()},openLink(){var t,r;(r=(t=this.editor)==null?void 0:t.chain())==null||r.focus();const e=this.editor.getAttributes("link").href;window.open(e,"_blank")},setLink(e,t,r,n=C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){var c,l,m;if(!e){this.removeLink();return}n.find(p=>p.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange("link").run();const a=(m=(l=(c=this.editor)==null?void 0:c.view)==null?void 0:l.state)==null?void 0:m.selection;this.editor.chain().focus().insertContent(t).setTextSelection({from:a.from,to:a.from+t.length}).setLink({href:e,class:r.class}).run()},processValue(e,t=!0){const r=this.getOutput();if(!(t&&le(e,r))){if(typeof e=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${D.emojiPattern})`,"g");e=e==null?void 0:e.replace(n,'<emoji-component code="$1"></emoji-component>')}this.editor.commands.setContent(e,!1,{preserveWhitespace:"full"})}},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){const{tr:r}=e.state,{from:n,to:i}=e.state.selection;r.deleteRange(n,i);const s=t.split(/\r?\n/);let a=n;for(let c=0;c<s.length;c++)c>0&&(r.insert(a,e.state.schema.nodes.hardBreak.create()),a++),r.insertText(s[c],a),a+=s[c].length;e.dispatch(r)},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,r){if(this.shouldPreserveLineBreaks(t,r))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(r)){const n=this.extractPreformattedText(r);if(n&&n.includes(`
|
|
4
4
|
`))return this.insertPlainTextWithHardBreaks(e,n),!0}return!1},shouldHandlePreformattedHTML(e){return this.pasteRichText&&e&&this.containsPreformattedContent(e)},containsPreformattedContent(e){const t=document.createElement("div");t.innerHTML=e;const r=t.querySelectorAll("*");for(const n of r)if(this.hasPreWhitespace(n)&&this.hasLineBreaks(n))return!0;return!1},hasPreWhitespace(e){const t=e.getAttribute("style")||"",r=e.style.whiteSpace||"",n=r==="pre"||r==="pre-wrap",i=t.includes("white-space: pre");return n||i},hasLineBreaks(e){return e.textContent&&e.textContent.includes(`
|
|
5
5
|
`)},hasBlankLines(e){return e.includes(`
|
|
6
6
|
|
|
7
7
|
`)||/\n\s*\n/.test(e)},extractPreformattedText(e){const t=document.createElement("div");return t.innerHTML=e,this.walkAndExtractText(t)},walkAndExtractText(e){let t="";if(e.nodeType===Node.TEXT_NODE)t+=e.textContent;else if(e.nodeType===Node.ELEMENT_NODE)if(this.hasPreWhitespace(e))t+=e.textContent;else for(const r of e.childNodes)t+=this.walkAndExtractText(r);return t},triggerInputChangeEvents(){const e=this.getOutput();this.$emit("input",e),this.$emit("update:modelValue",e);const t=this.editor.getJSON();this.$emit("json-input",t);const r=this.editor.getHTML();this.$emit("html-input",r);const n=this.editor.getText({blockSeparator:`
|
|
8
|
-
`});this.$emit("text-input",n)},addEditorListeners(){this.editor.on("create",()=>{this.triggerInputChangeEvents()}),this.editor.on("update",()=>{
|
|
8
|
+
`});this.$emit("text-input",n)},addEditorListeners(){this.editor.on("create",()=>{this.triggerInputChangeEvents()}),this.editor.on("update",()=>{this.triggerInputChangeEvents()}),this.editor.on("selectionUpdate",({editor:e})=>{this.$emit("selected",this.getSelectedLinkText(e))}),this.editor.on("focus",({event:e})=>{this.$emit("focus",e)}),this.editor.on("blur",({event:e})=>{this.$emit("blur",e)})},getOutput(){switch(this.outputFormat){case"json":return this.editor.getJSON();case"html":return this.editor.getHTML();case"text":default:return this.editor.getText({blockSeparator:`
|
|
9
9
|
`})}},getExtension(e,t){var r;return typeof t=="boolean"?e:(r=e.configure)==null?void 0:r.call(e,t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...e}}})},focusEditor(){this.editor.commands.focus()}}},gt={class:"d-popover__dialog"};function _t(e,t,r,n,i,s){const a=o.resolveComponent("dt-button"),c=o.resolveComponent("dt-stack"),l=o.resolveComponent("bubble-menu"),m=o.resolveComponent("editor-content");return o.openBlock(),o.createElementBlock("div",null,[i.editor&&r.link&&!r.hideLinkBubbleMenu?(o.openBlock(),o.createBlock(l,{key:0,editor:i.editor,"should-show":s.bubbleMenuShouldShow,"tippy-options":i.tippyOptions,style:{visibility:"visible"}},{default:o.withCtx(()=>[o.createElementVNode("div",gt,[o.createVNode(c,{direction:"row",class:"d-rich-text-editor-bubble-menu__button-stack",gap:"0"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.editLink},{default:o.withCtx(()=>[o.createTextVNode(" Edit ")]),_:1},8,["onClick"]),o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.openLink},{default:o.withCtx(()=>[o.createTextVNode(" Open link ")]),_:1},8,["onClick"]),o.createVNode(a,{kind:"danger",importance:"clear",onClick:s.removeLink},{default:o.withCtx(()=>[o.createTextVNode(" Remove ")]),_:1},8,["onClick"])]),_:1})])]),_:1},8,["editor","should-show","tippy-options"])):o.createCommentVNode("",!0),o.createVNode(m,o.mergeProps({ref:"editor",editor:i.editor,class:"d-rich-text-editor","data-qa":"dt-rich-text-editor"},s.attrs),null,16,["editor"])])}const kt=h._(ft,[["render",_t]]);exports.default=kt;
|
|
10
10
|
//# sourceMappingURL=rich-text-editor.cjs.map
|