@dialpad/dialtone 9.159.0 → 9.160.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.
- package/dist/tokens/doc.json +91128 -91128
- package/dist/vue3/common/test-utils/node-traversal.cjs +2 -0
- package/dist/vue3/common/test-utils/node-traversal.cjs.map +1 -0
- package/dist/vue3/common/test-utils/node-traversal.js +54 -0
- package/dist/vue3/common/test-utils/node-traversal.js.map +1 -0
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/lib/button/button.cjs +1 -1
- package/dist/vue3/lib/button/button.cjs.map +1 -1
- package/dist/vue3/lib/button/button.js +146 -81
- package/dist/vue3/lib/button/button.js.map +1 -1
- package/dist/vue3/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/vue3/lib/editor/editor.cjs +1 -1
- package/dist/vue3/lib/editor/editor.cjs.map +1 -1
- package/dist/vue3/lib/editor/editor.js +284 -148
- package/dist/vue3/lib/editor/editor.js.map +1 -1
- package/dist/vue3/lib/link/link.cjs +1 -1
- package/dist/vue3/lib/link/link.cjs.map +1 -1
- package/dist/vue3/lib/link/link.js +58 -18
- package/dist/vue3/lib/link/link.js.map +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/vue3/lib/list-item-group/list-item-group.js +5 -5
- package/dist/vue3/lib/message-input/message-input.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input.js +22 -21
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- 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 +466 -283
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js +69 -67
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/en-US.cjs +6 -0
- package/dist/vue3/localization/en-US.cjs.map +1 -1
- package/dist/vue3/localization/en-US.js +6 -0
- package/dist/vue3/localization/en-US.js.map +1 -1
- package/dist/vue3/types/common/sr_only_close_button.vue.d.ts +68 -1
- package/dist/vue3/types/common/test_utils/node_traversal.d.ts +10 -0
- package/dist/vue3/types/common/test_utils/node_traversal.d.ts.map +1 -0
- package/dist/vue3/types/components/banner/banner.vue.d.ts +136 -2
- package/dist/vue3/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/breadcrumbs/breadcrumb_item.vue.d.ts +39 -1
- package/dist/vue3/types/components/breadcrumbs/breadcrumb_item.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/breadcrumbs/breadcrumbs.vue.d.ts +39 -1
- package/dist/vue3/types/components/button/button.vue.d.ts +68 -1
- package/dist/vue3/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts +68 -1
- package/dist/vue3/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts +68 -1
- package/dist/vue3/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/dropdown/dropdown.vue.d.ts +136 -2
- package/dist/vue3/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts +272 -4
- package/dist/vue3/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts +136 -2
- package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/link/link.vue.d.ts +39 -1
- package/dist/vue3/types/components/link/link.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/modal/modal.vue.d.ts +136 -2
- package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice.vue.d.ts +136 -2
- package/dist/vue3/types/components/notice/notice.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts +136 -2
- package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts +68 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover.vue.d.ts +136 -2
- package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts +68 -1
- package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +39 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +39 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +1804 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts.map +1 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/index.d.ts +3 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/index.d.ts.map +1 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/variable.d.ts +3 -0
- package/dist/vue3/types/components/rich_text_editor/extensions/variable/variable.d.ts.map +1 -0
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +87 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button-alpha.vue.d.ts +68 -1
- package/dist/vue3/types/components/split_button/split_button-omega.vue.d.ts +68 -1
- package/dist/vue3/types/components/split_button/split_button-omega.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/split_button/split_button.vue.d.ts +272 -4
- package/dist/vue3/types/components/split_button/split_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/tab/tab.vue.d.ts +68 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +136 -2
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts +136 -2
- package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/toast.vue.d.ts +544 -8
- package/dist/vue3/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/vue3/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +272 -4
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +272 -4
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +204 -3
- package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +136 -2
- package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +272 -4
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +204 -3
- package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +664 -4
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +631 -9
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +272 -4
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts +68 -1
- package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.js","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n importance=\"clear\"\n size=\"xs\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue3';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n close (e) {\n // Get the callback from extension storage\n const onCloseCallback = this.editor?.storage?.meetingPill?.onClose;\n\n if (onCloseCallback && typeof onCloseCallback === 'function') {\n onCloseCallback(e);\n }\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-3';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n name: 'meetingPill',\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addOptions () {\n return {\n onClose: () => {},\n };\n },\n\n addStorage () {\n return {\n onClose: this.options.onClose,\n };\n },\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText () {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n v-bind=\"addClassStyleAttrs($attrs)\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :paste-rich-text=\"richText\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @markdown-input=\"onMarkdownInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @selected-command=\"$emit('selected-command', $event)\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n gap=\"200\"\n direction=\"row\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"imagePickerButtonLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"imagePickerButtonLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiPickerButtonLabel\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiPickerButtonLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n @scroll-bottom-reached=\"$emit('emoji-scroll-bottom-reached')\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for schedule message -->\n <div class=\"d-recipe-message-input__schedule-message\">\n <slot name=\"scheduleMessage\" />\n </div>\n\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n v-dt-tooltip=\"cancelButtonLabel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"cancelButtonLabel\"\n @click=\"onCancel\"\n >\n <p>{{ cancelButtonLabel }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"sendButtonLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"sendButtonLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send :size=\"sendIconSize\" />\n </slot>\n </template>\n <template v-if=\"showSend.text\">\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport { removeClassStyleAttrs, returnFirstEl, addClassStyleAttrs } from '@/common/utils';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue3';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\nimport { DialtoneLocalization } from '@/localization';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`, `markdown`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html, markdown\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Send button defaults.\n * TODO (Dialtone 10):\n * - Change to `showSendButton`, boolean only.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * TODO (Dialtone 10):\n * - Add a prop `iconOnly` default: true to control if localized send button text should be shown\n */\n\n /**\n * Cancel button defaults.\n * TODO (Dialtone 10): Change to `showCancelButton`, boolean only.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:modelValue\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when input changes, returns markdown content only\n * @event markdown-input\n * @type {String}\n */\n 'markdown-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n\n /**\n * Emitted when the emoji picker scroll reaches the bottom\n * @event emoji-scroll-bottom-reached\n */\n 'emoji-scroll-bottom-reached',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [\n MeetingPill.configure({\n onClose: (event) => {\n this.$emit('meeting-pill-close', event);\n },\n }),\n ],\n\n internalInputValue: this.modelValue, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return (\n Boolean(this.showCharacterLimit) &&\n this.showCharacterLimit.count - this.inputLength <=\n this.showCharacterLimit.warning\n );\n },\n\n characterLimitTooltipEnabled () {\n return (\n this.showCharacterLimit.message &&\n this.showCharacterLimit.count - this.inputLength < 0\n );\n },\n\n isSendDisabled () {\n return (\n this.disableSend ||\n (this.showCharacterLimit &&\n this.inputLength > this.showCharacterLimit.count)\n );\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n\n sendButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL');\n },\n\n imagePickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL');\n },\n\n emojiPickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL');\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL');\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.modelValue && this.outputFormat === 'text') {\n this.internalInputValue = this.modelValue.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.modelValue;\n }\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n\n // eslint-disable-next-line complexity\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n // List extensions are only loaded when richText is true\n if (!this.richText) return false;\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = returnFirstEl(this.$refs.richTextEditor.$el)\n .querySelector('.tiptap')\n .contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n image: emoji.image,\n name: emoji.name,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit(\n 'select-media',\n this.$refs.messageInputImageUpload.$refs.input.files,\n );\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:modelValue', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n\n onMarkdownInput (event) {\n this.$emit('markdown-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","_hoisted_1","_hoisted_2","_createBlock","_component_node_view_wrapper","_createVNode","_component_dt_item_layout","_createElementVNode","_component_dt_icon_video","_component_dt_button","$options","_component_dt_icon_close","_createTextVNode","_ctx","MeetingPill","Node","VueNodeViewRenderer","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","event","newValue","removeClassStyleAttrs","addClassStyleAttrs","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","returnFirstEl","dt","files","skinTone","emoji","close","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_mergeProps","args","_renderSlot","$props","_component_dt_recipe_message_input_topbar","$data","_component_dt_recipe_message_input_link","_component_dt_rich_text_editor","$event","_cache","_component_dt_stack","_component_dt_icon_image","_directive_dt_tooltip","_component_dt_input","_component_dt_popover","_withCtx","attrs","_component_dt_icon_very_satisfied","_component_dt_icon_satisfied","_component_dt_emoji_picker","_component_dt_tooltip","_normalizeClass","_hoisted_6","_toDisplayString","_component_dt_icon_send"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,MAAKA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA;EAGF,OAAOC;AAAA,EAEP,OAAO,CAAC,oBAAoB;AAAA,EAE5B,OAAQ;AACN,WAAO;AAAA,MACL,MAAM,IAAIC,EAAoB;AAAA;EAElC;AAAA,EAEA,UAAU;AAAA,IACR,mBAAoB;AAClB,aAAO,KAAK,KAAK,GAAG,uBAAuB;AAAA,IAC7C;AAAA;EAGF,SAAS;AAAA,IACP,MAAOC,GAAG;;AAER,YAAMC,KAAkBC,KAAAC,KAAAC,IAAA,KAAK,WAAL,gBAAAA,EAAa,YAAb,gBAAAD,EAAsB,gBAAtB,gBAAAD,EAAmC;AAE3D,MAAID,KAAmB,OAAOA,KAAoB,cAChDA,EAAgBD,CAAC;AAAA,IAErB;AAAA;AAEJ,GAzEaK,KAAA,EAAA,OAAM,4CAA2C,GAQjDC,KAAA,EAAA,OAAM,6CAA4C;;;cAd7DC,EAgCoBC,GAAA,EAhCD,OAAM,yCAAqC;AAAA,eAC5D,MA8BiB;AAAA,MA9BjBC,EA8BiBC,GAAA;AAAA,QA7Bf,OAAM;AAAA,QACN,UAAA;AAAA;QAEW,QACT,MAIM;AAAA,UAJNC,EAIM,OAJNN,IAIM;AAAA,YAHJI,EAEEG,GAAA,EADA,MAAK,MAAK,CAAA;AAAA;;QAKL,SACT,MAeM;AAAA,UAfND,EAeM,OAfNL,IAeM;AAAA,Y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AA,CAAA;AAAA;;;kBATTA,EAAA,iBAAiB;AAAA;YAajCoD,EAqCOjD,4BArCP,MAqCO;AAAA,cAjCGkD,EAAA,mBADR5D,EAiCYM,GAAA;AAAA;gBA9BV,WAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,OAAKwE,GAAA;AAAA;;qEAA+KvE,EAAA;AAAA,wCAAsDA,EAAA;AAAA;;gBAO1O,cAAYA,EAAA;AAAA,gBACZ,iBAAeA,EAAA;AAAA,gBACf,SAAOA,EAAA;AAAA;2BAcR,MAEW;AAAA,kBAFKqD,EAAA,SAAS,aACvBJ,EAA0B,KAAAuB,IAAAC,EAApBpB,EAAA,SAAS,IAAI,GAAA,CAAA;;;;gBAZbrD,EAAA;wBACL;AAAA,wBAGD,MAKO;AAAA,oBALPoD,EAKOjD,EAAA,QAAA,YAAA,EAHJ,UAAWH,EAAA,aAAY,GAF1B,MAKO;AAAA,sBADLL,EAAqC+E,GAAA,EAAtB,MAAM1E,EAAA,aAAY,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA;;;;;gBAzBf,CAAA8D,GAAA9D,EAAA,iBAAT,SAAO;AAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"message-input.js","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n importance=\"clear\"\n size=\"xs\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue3';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n close (e) {\n // Get the callback from extension storage\n const onCloseCallback = this.editor?.storage?.meetingPill?.onClose;\n\n if (onCloseCallback && typeof onCloseCallback === 'function') {\n onCloseCallback(e);\n }\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-3';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n name: 'meetingPill',\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addOptions () {\n return {\n onClose: () => {},\n };\n },\n\n addStorage () {\n return {\n onClose: this.options.onClose,\n };\n },\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText () {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n v-bind=\"addClassStyleAttrs($attrs)\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :paste-rich-text=\"richText\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @markdown-input=\"onMarkdownInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @selected-command=\"$emit('selected-command', $event)\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n gap=\"200\"\n direction=\"row\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"imagePickerButtonLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"imagePickerButtonLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n v-model:open=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiPickerButtonLabel\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiPickerButtonLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n @scroll-bottom-reached=\"$emit('emoji-scroll-bottom-reached')\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for schedule message -->\n <div class=\"d-recipe-message-input__schedule-message\">\n <slot name=\"scheduleMessage\" />\n </div>\n\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n v-dt-tooltip=\"cancelButtonLabel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"cancelButtonLabel\"\n @click=\"onCancel\"\n >\n <p>{{ cancelButtonLabel }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"sendButtonLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"sendButtonLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send :size=\"sendIconSize\" />\n </slot>\n </template>\n <template v-if=\"showSend.text\">\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport { removeClassStyleAttrs, returnFirstEl, addClassStyleAttrs } from '@/common/utils';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue3';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\nimport { DialtoneLocalization } from '@/localization';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`, `markdown`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html, markdown\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Send button defaults.\n * TODO (Dialtone 10):\n * - Change to `showSendButton`, boolean only.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * TODO (Dialtone 10):\n * - Add a prop `iconOnly` default: true to control if localized send button text should be shown\n */\n\n /**\n * Cancel button defaults.\n * TODO (Dialtone 10): Change to `showCancelButton`, boolean only.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:modelValue\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when input changes, returns markdown content only\n * @event markdown-input\n * @type {String}\n */\n 'markdown-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n\n /**\n * Emitted when the emoji picker scroll reaches the bottom\n * @event emoji-scroll-bottom-reached\n */\n 'emoji-scroll-bottom-reached',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [\n MeetingPill.configure({\n onClose: (event) => {\n this.$emit('meeting-pill-close', event);\n },\n }),\n ],\n\n internalInputValue: this.modelValue, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return (\n Boolean(this.showCharacterLimit) &&\n this.showCharacterLimit.count - this.inputLength <=\n this.showCharacterLimit.warning\n );\n },\n\n characterLimitTooltipEnabled () {\n return (\n this.showCharacterLimit.message &&\n this.showCharacterLimit.count - this.inputLength < 0\n );\n },\n\n isSendDisabled () {\n return (\n this.disableSend ||\n (this.showCharacterLimit &&\n this.inputLength > this.showCharacterLimit.count)\n );\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n\n sendButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL');\n },\n\n imagePickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL');\n },\n\n emojiPickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL');\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL');\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.modelValue && this.outputFormat === 'text') {\n this.internalInputValue = this.modelValue.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.modelValue;\n }\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n\n // eslint-disable-next-line complexity\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n // List extensions are only loaded when richText is true\n if (!this.richText) return false;\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = returnFirstEl(this.$refs.richTextEditor.$el)\n .querySelector('.tiptap')\n .contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n image: emoji.image,\n name: emoji.name,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit(\n 'select-media',\n this.$refs.messageInputImageUpload.$refs.input.files,\n );\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:modelValue', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n\n onMarkdownInput (event) {\n this.$emit('markdown-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","_hoisted_1","_hoisted_2","_createBlock","_component_node_view_wrapper","_createVNode","_component_dt_item_layout","_createElementVNode","_component_dt_icon_video","_component_dt_button","$options","_component_dt_icon_close","_createTextVNode","_ctx","MeetingPill","Node","VueNodeViewRenderer","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","event","newValue","removeClassStyleAttrs","addClassStyleAttrs","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","returnFirstEl","dt","files","skinTone","emoji","close","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_mergeProps","args","_renderSlot","$props","_component_dt_recipe_message_input_topbar","$data","_component_dt_recipe_message_input_link","_component_dt_rich_text_editor","$event","_cache","_component_dt_stack","_component_dt_icon_image","_directive_dt_tooltip","_component_dt_input","_component_dt_popover","_withCtx","attrs","_component_dt_icon_very_satisfied","_component_dt_icon_satisfied","_component_dt_emoji_picker","_component_dt_tooltip","_normalizeClass","_hoisted_6","_toDisplayString","_component_dt_icon_send"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,MAAKA,KAAU;AAAA,EACb,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA;EAGF,OAAOC;AAAA,EAEP,OAAO,CAAC,oBAAoB;AAAA,EAE5B,OAAQ;AACN,WAAO;AAAA,MACL,MAAM,IAAIC,EAAoB;AAAA;EAElC;AAAA,EAEA,UAAU;AAAA,IACR,mBAAoB;AAClB,aAAO,KAAK,KAAK,GAAG,uBAAuB;AAAA,IAC7C;AAAA;EAGF,SAAS;AAAA,IACP,MAAOC,GAAG;;AAER,YAAMC,KAAkBC,KAAAC,KAAAC,IAAA,KAAK,WAAL,gBAAAA,EAAa,YAAb,gBAAAD,EAAsB,gBAAtB,gBAAAD,EAAmC;AAE3D,MAAID,KAAmB,OAAOA,KAAoB,cAChDA,EAAgBD,CAAC;AAAA,IAErB;AAAA;AAEJ,GAzEaK,KAAA,EAAA,OAAM,4CAA2C,GAQjDC,KAAA,EAAA,OAAM,6CAA4C;;;cAd7DC,EAgCoBC,GAAA,EAhCD,OAAM,yCAAqC;AAA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A,GAAA,GAAA;AAAA,uBAJjCA,EAAA,4BAA4B;AAAA;;;;YAWlCqD,EAAA,qBADR5D,EAYYM,GAAA;AAAA;cATV,WAAQ;AAAA,cACR,OAAM;AAAA,cACN,MAAK;AAAA,cACL,MAAK;AAAA,cACL,YAAW;AAAA,cACV,cAAYC,EAAA;AAAA,cACZ,SAAOA,EAAA;AAAA;yBAER,MAA8B;AAAA,gBAA9BH,EAA8B,aAAxBG,EAAA,iBAAiB,GAAA,CAAA;AAAA;;;kBATTA,EAAA,iBAAiB;AAAA;YAajCoD,EAqCOjD,4BArCP,MAqCO;AAAA,cAjCGkD,EAAA,mBADR5D,EAiCYM,GAAA;AAAA;gBA9BV,WAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,OAAKwE,GAAA;AAAA;;qEAA+KvE,EAAA;AAAA,wCAAsDA,EAAA;AAAA;;gBAO1O,cAAYA,EAAA;AAAA,gBACZ,iBAAeA,EAAA;AAAA,gBACf,SAAOA,EAAA;AAAA;2BAcR,MAEW;AAAA,kBAFKqD,EAAA,SAAS,aACvBJ,EAA0B,KAAAuB,IAAAC,EAApBpB,EAAA,SAAS,IAAI,GAAA,CAAA;;;;gBAZbrD,EAAA;wBACL;AAAA,wBAGD,MAKO;AAAA,oBALPoD,EAKOjD,EAAA,QAAA,YAAA,EAHJ,UAAWH,EAAA,aAAY,GAF1B,MAKO;AAAA,sBADLL,EAAqC+E,GAAA,EAAtB,MAAM1E,EAAA,aAAY,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA;AAAA;;;;;gBAzBf,CAAA8D,GAAA9D,EAAA,iBAAT,SAAO;AAAA;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
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"),O=require("@tiptap/extension-blockquote"),P=require("@tiptap/extension-code-block"),q=require("@tiptap/extension-code"),V=require("@tiptap/extension-document"),A=require("@tiptap/extension-gapcursor"),j=require("@tiptap/extension-hard-break"),R=require("@tiptap/extension-paragraph"),H=require("@tiptap/extension-placeholder"),K=require("@tiptap/extension-bold"),W=require("@tiptap/extension-bullet-list"),F=require("@tiptap/extension-italic"),U=require("@tiptap/extension-link"),z=require("@tiptap/extension-list-item"),X=require("@tiptap/extension-ordered-list"),J=require("@tiptap/extension-strike"),G=require("@tiptap/extension-underline"),Y=require("@tiptap/extension-text"),Q=require("@tiptap/extension-text-align"),Z=require("@tiptap/extension-history"),ee=require("@tiptap/extension-table"),te=require("@tiptap/extension-table-cell"),ne=require("@tiptap/extension-table-header"),oe=require("@tiptap/extension-table-row"),re=require("@tiptap/extension-text-style"),se=require("@tiptap/extension-color"),ie=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),ae=require("@tiptap/suggestion"),$=require("regex-combined-emojis"),o=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),D=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),ce=require("../list-item/list-item.cjs"),w=require("../stack/stack.cjs"),x=require("tippy.js"),_=require("../../common/utils/index.cjs"),le=require("@tiptap/extension-image"),v=require("@tiptap/extension-mention"),I=require("../link/link.cjs"),de=require("@dialpad/dialtone-icons/vue3"),b=require("./rich-text-editor-constants.cjs"),ue=require("../avatar/avatar.cjs"),me=require("@dialpad/dialtone-icons/vue3/hash"),he=require("@dialpad/dialtone-icons/vue3/lock"),pe=require("deep-equal"),fe=require("../../localization/index.cjs"),ge=require("../button/button.cjs"),ke={compatConfig:{MODE:3},name:"EmojiComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtEmoji:D.default},props:d.nodeViewProps};function _e(e,t,r,n,s,i){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 we=h._(ke,[["render",_e]]),ye={compatConfig:{MODE:3},name:"SuggestionList",components:{DtListItem:ce.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,contactKey:t.contactKey});break;case"channel":this.command({name:t.name,id:t.id,locked:t.locked,channelKey:t.channelKey});break;case"slash-command":this.command({command:t.command});break}}}},Ce={class:"d-popover__dialog d-suggestion-list__container"},be={ref:"suggestionList",class:"d-suggestion-list"};function xe(e,t,r,n,s,i){const a=o.resolveComponent("dt-list-item");return o.openBlock(),o.createElementBlock("div",Ce,[o.withDirectives(o.createElementVNode("ul",be,[(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===s.selectedIndex}]),"navigation-type":"arrow-keys",onClick:m=>i.selectItem(l),onKeydown:o.withModifiers(i.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 T=h._(ye,[["render",xe]]),Te={compatConfig:{MODE:3},name:"EmojiSuggestion",components:{DtEmoji:D.default,DtStack:w.default},props:{item:{type:Object,required:!0}}};function Ee(e,t,r,n,s,i){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 Se=h._(Te,[["render",Ee]]),E={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)}}}},Be=20,ve=(e,t,r)=>{var c,l;const n=(c=e.shortname)==null?void 0:c.replaceAll(":",""),s=(l=t.shortname)==null?void 0:l.replaceAll(":",""),i=n.startsWith(r),a=s.startsWith(r);return i&&!a?-1:!i&&a?1:n.localeCompare(s)},Ne={items:({query:e})=>{if(e.length<2)return[];const t=Object.values(f.getEmojiData());return e=e.toLowerCase(),t.filter(n=>{var s;return[n.name,(s=n.shortname)==null?void 0:s.replaceAll(":",""),...n.keywords||[]].some(i=>i&&i.startsWith(e))}).splice(0,Be).sort((n,s)=>ve(n,s,e)).map(n=>({code:n.shortname}))},command:({editor:e,range:t,props:r})=>{var i,a;const n=e.view.state.selection.$to.nodeAfter;((i=n==null?void 0:n.text)==null?void 0:i.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(T,{props:{itemComponent:o.markRaw(Se),itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(t=x("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:[E]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},Le=/(:\w+:)$/,Re=new RegExp($.emojiPattern+"$"),$e=e=>{if(e&&f.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},De=e=>[...e.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),Ie=u.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return d.VueNodeViewRenderer(we)},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(Le)||e.match(Re);if(t)return $e(t)},handler:({state:e,range:t,match:r})=>{const{tr:n}=e,s=t.from,i=t.to;n.replaceWith(s,i,this.type.create({code:r[0]}))}})]},addPasteRules(){return[u.nodePasteRule({find:De,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[ae({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...Ne})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:s,anchor:i}=n;return s?(t.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return r=!0,e.insertText("",c,c+a.nodeSize),!1}),r):!1})}}});function Me(e,t,r=()=>!0){const n=[];t.lastIndex=0;let s;for(;s=t.exec(e);)r(e,s)&&n.push(s);return n}function Oe(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function Pe(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function qe(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const s=e.slice(r);return{text:s,from:r,to:r+s.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function B(e,t,r,n){const s=qe(e,t);if(n.lastIndex=0,!n.test(s.text))return s;const i=r==="left"?s.from-1:s.to+1;return i<=0||i>=e.length||i===t?s:B(e,i,r,n)}function Ve(e,t,r,n){const s=Math.max(e.from-1,0),i=Math.min(e.to+1,t.content.size),a=u.getMarksBetween(s,i,t);for(const c of a)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const N=_.getPhoneNumberRegex(1,15);function L(e,t,r,n,s,i){if(!e)return;let a=r-t-1;a=a<0?0:a;const c=n-t,l=B(e,a,"left",N),m=B(e,c,"right",N),p=e.slice(l.from,m.to);Me(p,_.linkRegex,Oe).forEach(S=>{const k=Pe(S[0]),C=t+l.from+S.index+1,M=C+k.length;s.addMark(C,M,i.create())})}function Ae(e){let t=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,s)=>{const i=r.some(p=>p.docChanged)&&!n.doc.eq(s.doc);if(t&&!i)return;const{tr:a}=s,{textContent:c}=s.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:y})=>{Ve(y,s.doc,a,e.type),u.findChildrenInRange(s.doc,y,k=>k.isTextblock).forEach(({node:k,pos:C})=>{L(k.textContent,C,p.from,y.to,a,e.type)})}),a}})}const je={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},He=u.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,je)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ae({type:this.type})]}}),Ke=le.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}),We=R.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Fe={compatConfig:{MODE:3},name:"MentionComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:I.default},props:d.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}},methods:{handleClick(){const e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,avatarSrc:this.$props.node.attrs.avatarSrc,contactKey:this.$props.node.attrs.contactKey};this.$props.editor.emit("mention-click",e)}}};function Ue(e,t,r,n,s,i){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",onClick:o.withModifiers(i.handleClick,["prevent"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.text),1)]),_:1},8,["onClick"])]),_:1})}const ze=h._(Fe,[["render",Ue]]),Xe=v.extend({addNodeView(){return d.VueNodeViewRenderer(ze)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""},contactKey:{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")}}),Je={compatConfig:{MODE:3},name:"ChannelComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:I.default,DtIconLock:de.DtIconLock,DtStack:w.default},props:d.nodeViewProps,computed:{text(){return this.$props.node.attrs.locked?this.$props.node.attrs.name:"#"+this.$props.node.attrs.name}},methods:{handleClick(){const e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,locked:this.$props.node.attrs.locked,channelKey:this.$props.node.attrs.channelKey};this.$props.editor.emit("channel-click",e)}}};function Ge(e,t,r,n,s,i){const a=o.resolveComponent("dt-icon-lock"),c=o.resolveComponent("dt-stack"),l=o.resolveComponent("dt-link"),m=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(m,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(l,{kind:"mention",onClick:o.withModifiers(i.handleClick,["prevent"])},{default:o.withCtx(()=>[o.createVNode(c,{direction:"row",gap:"0"},{default:o.withCtx(()=>[e.$props.node.attrs.locked?(o.openBlock(),o.createBlock(a,{key:0,size:"200"})):o.createCommentVNode("",!0),o.createElementVNode("span",null,o.toDisplayString(i.text),1)]),_:1})]),_:1},8,["onClick"])]),_:1})}const Ye=h._(Je,[["render",Ge]]),Qe=v.extend({name:"channel",addNodeView(){return d.VueNodeViewRenderer(Ye)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1},channelKey:{default:""}}},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")}}),Ze={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,s;const e=this.$props.node.attrs.command;this.$emit("selected-command",e);const t=(s=(n=(r=this.editor)==null?void 0:r.storage)==null?void 0:n["slash-commands"])==null?void 0:s.onSelectedCommand;t&&typeof t=="function"&&t(e)}};function et(e,t,r,n,s,i){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(i.text),1)]),_:1})}const tt=h._(Ze,[["render",et]]),nt=(e,t)=>[...e.matchAll(t)].map(n=>{let s=n[2];return s.endsWith(" ")||(s+=" "),{index:n.index,text:s,match:n}}),ot=v.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(tt)},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=>nt(n,t),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),rt={compatConfig:{MODE:3},name:"MentionSuggestion",components:{DtAvatar:ue.default,DtStack:w.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}}},st={class:"d-mention-suggestion__name"},it={key:1,class:"d-mention-suggestion__divider"},at={key:2,class:"d-mention-suggestion__status"};function ct(e,t,r,n,s,i){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":i.name,"image-src":i.avatarSrc,"image-alt":i.name,"show-presence":i.showDetails,presence:i.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",st,o.toDisplayString(i.name),1),i.showDetails?(o.openBlock(),o.createBlock(c,{key:0,direction:"row",gap:"300",class:"d-label--sm-plain"},{default:o.withCtx(()=>[i.presenceText?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["d-mention-suggestion__presence",[i.presenceFontColorClass]])},o.toDisplayString(i.presenceText),3)):o.createCommentVNode("",!0),i.status&&i.presenceText?(o.openBlock(),o.createElementBlock("div",it," • ")):o.createCommentVNode("",!0),i.status?(o.openBlock(),o.createElementBlock("div",at,o.toDisplayString(i.status),1)):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1})}const lt=h._(rt,[["render",ct]]),dt={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{props:{itemComponent:o.markRaw(lt),itemType:"mention",...n},editor:n.editor}),n.clientRect&&(t=x("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:[E]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ut={compatConfig:{MODE:3},name:"ChannelSuggestion",components:{DtStack:w.default,DtIconHash:me,DtIconLock:he},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function mt(e,t,r,n,s,i){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(i.name),1)]),_:1})}const ht=h._(ut,[["render",mt]]),pt={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{props:{itemComponent:o.markRaw(ht),itemType:"channel",...n},editor:n.editor}),n.clientRect&&(t=x("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:[E]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ft={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}}},gt={class:"d-body--md-compact"},kt={key:0},_t={class:"d-body--sm d-fc-tertiary"};function wt(e,t,r,n,s,i){return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",gt,[o.createElementVNode("span",null,"/"+o.toDisplayString(i.command),1),i.parametersExample?(o.openBlock(),o.createElementBlock("span",kt,o.toDisplayString(i.parametersExample),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",_t,o.toDisplayString(i.description),1)])}const yt=h._(ft,[["render",wt]]),Ct={allowSpaces:!0,startOfLine:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{parent:void 0,props:{itemComponent:o.markRaw(yt),itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(t=x("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:[E]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},bt={compatConfig:{MODE:3},name:"DtRichTextEditor",components:{EditorContent:d.EditorContent,BubbleMenu:d.BubbleMenu,DtButton:ge.default,DtStack:w.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"?b.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:"html",validator(e){return b.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},allowTables:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","markdown-input","update:modelValue","blur","focus","enter","edit-link","selected","selected-command","mention-click","channel-click"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var e;return(e=_.returnFirstEl(this.$refs.editor.$el).getRootNode())==null?void 0:e.querySelector("body")},placement:"top-start"},i18n:new fe.DialtoneLocalization,jsonToMarkdownConverter:{convertToMarkdown(e){return this.processNode(e)},processNodeContent(e){return e.content?e.content.map(t=>this.processNode(t)).join(""):""},processNode(e){if(!e)return"";const r={doc:n=>this.processDocNode(n),paragraph:n=>this.processParagraphNode(n),text:n=>this.processTextNode(n),hardBreak:()=>this.processHardBreakNode(),blockquote:n=>this.processBlockquoteNode(n),bulletList:n=>this.processBulletListNode(n),orderedList:n=>this.processOrderedListNode(n),listItem:n=>this.processListItemNode(n),codeBlock:n=>this.processCodeBlockNode(n),mention:n=>this.processMentionNode(n),channel:n=>this.processChannelNode(n),"slash-commands":n=>this.processSlashCommandsNode(n),emoji:n=>this.processEmojiNode(n)}[e.type];return r?r(e):this.processUnknownNode(e)},processDocNode(e){return this.processNodeContent(e)},processParagraphNode(e){const t=this.processNodeContent(e);return t?t+`
|
|
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"),O=require("@tiptap/extension-blockquote"),P=require("@tiptap/extension-code-block"),q=require("@tiptap/extension-code"),j=require("@tiptap/extension-document"),H=require("@tiptap/extension-gapcursor"),K=require("@tiptap/extension-hard-break"),R=require("@tiptap/extension-paragraph"),W=require("@tiptap/extension-placeholder"),F=require("@tiptap/extension-bold"),U=require("@tiptap/extension-bullet-list"),z=require("@tiptap/extension-italic"),X=require("@tiptap/extension-link"),G=require("@tiptap/extension-list-item"),J=require("@tiptap/extension-ordered-list"),Y=require("@tiptap/extension-strike"),Q=require("@tiptap/extension-underline"),Z=require("@tiptap/extension-text"),ee=require("@tiptap/extension-text-align"),te=require("@tiptap/extension-history"),ne=require("@tiptap/extension-table"),oe=require("@tiptap/extension-table-cell"),re=require("@tiptap/extension-table-header"),se=require("@tiptap/extension-table-row"),ie=require("@tiptap/extension-text-style"),ae=require("@tiptap/extension-color"),ce=require("@tiptap/extension-font-family"),k=require("@tiptap/pm/state"),le=require("@tiptap/suggestion"),I=require("regex-combined-emojis"),o=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),D=require("../emoji/emoji.cjs"),g=require("../../common/emoji/index.cjs"),de=require("../list-item/list-item.cjs"),y=require("../stack/stack.cjs"),T=require("tippy.js"),C=require("../../common/utils/index.cjs"),ue=require("@tiptap/extension-image"),S=require("@tiptap/extension-mention"),$=require("../link/link.cjs"),me=require("@dialpad/dialtone-icons/vue3"),A=require("../../localization/index.cjs"),he=require("../input/input.cjs"),pe=require("../popover/popover.cjs"),V=require("../button/button.cjs"),fe=require("../badge/badge.cjs"),x=require("./rich-text-editor-constants.cjs"),ge=require("../avatar/avatar.cjs"),_e=require("@dialpad/dialtone-icons/vue3/hash"),ke=require("@dialpad/dialtone-icons/vue3/lock"),we=require("deep-equal"),Ce={compatConfig:{MODE:3},name:"EmojiComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtEmoji:D.default},props:d.nodeViewProps};function ye(e,t,r,n,s,i){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 be=h._(Ce,[["render",ye]]),xe={compatConfig:{MODE:3},name:"SuggestionList",components:{DtListItem:de.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,contactKey:t.contactKey});break;case"channel":this.command({name:t.name,id:t.id,locked:t.locked,channelKey:t.channelKey});break;case"slash-command":this.command({command:t.command});break}}}},Te={class:"d-popover__dialog d-suggestion-list__container"},Ee={ref:"suggestionList",class:"d-suggestion-list"};function ve(e,t,r,n,s,i){const a=o.resolveComponent("dt-list-item");return o.openBlock(),o.createElementBlock("div",Te,[o.withDirectives(o.createElementVNode("ul",Ee,[(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===s.selectedIndex}]),"navigation-type":"arrow-keys",onClick:m=>i.selectItem(l),onKeydown:o.withModifiers(i.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._(xe,[["render",ve]]),Le={compatConfig:{MODE:3},name:"EmojiSuggestion",components:{DtEmoji:D.default,DtStack:y.default},props:{item:{type:Object,required:!0}}};function Se(e,t,r,n,s,i){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 Ne=h._(Le,[["render",Se]]),v={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)}}}},Be=20,Re=(e,t,r)=>{var c,l;const n=(c=e.shortname)==null?void 0:c.replaceAll(":",""),s=(l=t.shortname)==null?void 0:l.replaceAll(":",""),i=n.startsWith(r),a=s.startsWith(r);return i&&!a?-1:!i&&a?1:n.localeCompare(s)},Ie={items:({query:e})=>{if(e.length<2)return[];const t=Object.values(g.getEmojiData());return e=e.toLowerCase(),t.filter(n=>{var s;return[n.name,(s=n.shortname)==null?void 0:s.replaceAll(":",""),...n.keywords||[]].some(i=>i&&i.startsWith(e))}).splice(0,Be).sort((n,s)=>Re(n,s,e)).map(n=>({code:n.shortname}))},command:({editor:e,range:t,props:r})=>{var i,a;const n=e.view.state.selection.$to.nodeAfter;((i=n==null?void 0:n.text)==null?void 0:i.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(Ne),itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(t=T("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:[v]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},De=/(:\w+:)$/,$e=new RegExp(I.emojiPattern+"$"),Ae=e=>{if(e&&g.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},Ve=e=>[...e.matchAll(g.emojiShortCodeRegex)].filter(r=>g.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),Me=u.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return d.VueNodeViewRenderer(be)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:e}){return g.stringToUnicode(g.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(De)||e.match($e);if(t)return Ae(t)},handler:({state:e,range:t,match:r})=>{const{tr:n}=e,s=t.from,i=t.to;n.replaceWith(s,i,this.type.create({code:r[0]}))}})]},addPasteRules(){return[u.nodePasteRule({find:Ve,type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodePasteRule({find:g.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[le({char:":",pluginKey:new k.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...Ie})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:s,anchor:i}=n;return s?(t.doc.nodesBetween(i-1,i,(a,c)=>{if(a.type.name===this.name)return r=!0,e.insertText("",c,c+a.nodeSize),!1}),r):!1})}}});function Oe(e,t,r=()=>!0){const n=[];t.lastIndex=0;let s;for(;s=t.exec(e);)r(e,s)&&n.push(s);return n}function Pe(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function qe(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function je(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const s=e.slice(r);return{text:s,from:r,to:r+s.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function L(e,t,r,n){const s=je(e,t);if(n.lastIndex=0,!n.test(s.text))return s;const i=r==="left"?s.from-1:s.to+1;return i<=0||i>=e.length||i===t?s:L(e,i,r,n)}function He(e,t,r,n){const s=Math.max(e.from-1,0),i=Math.min(e.to+1,t.content.size),a=u.getMarksBetween(s,i,t);for(const c of a)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const N=C.getPhoneNumberRegex(1,15);function B(e,t,r,n,s,i){if(!e)return;let a=r-t-1;a=a<0?0:a;const c=n-t,l=L(e,a,"left",N),m=L(e,c,"right",N),p=e.slice(l.from,m.to);Oe(p,C.linkRegex,Pe).forEach(_=>{const w=qe(_[0]),b=t+l.from+_.index+1,M=b+w.length;s.addMark(b,M,i.create())})}function Ke(e){let t=!1;return new k.Plugin({key:new k.PluginKey("autolink"),appendTransaction:(r,n,s)=>{const i=r.some(p=>p.docChanged)&&!n.doc.eq(s.doc);if(t&&!i)return;const{tr:a}=s,{textContent:c}=s.doc;t||B(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:f})=>{He(f,s.doc,a,e.type),u.findChildrenInRange(s.doc,f,w=>w.isTextblock).forEach(({node:w,pos:b})=>{B(w.textContent,b,p.from,f.to,a,e.type)})}),a}})}const We={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Fe=u.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,We)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ke({type:this.type})]}}),Ue=ue.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}),ze=R.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Xe={compatConfig:{MODE:3},name:"MentionComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:$.default},props:d.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}},methods:{handleClick(){const e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,avatarSrc:this.$props.node.attrs.avatarSrc,contactKey:this.$props.node.attrs.contactKey};this.$props.editor.emit("mention-click",e)}}};function Ge(e,t,r,n,s,i){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",onClick:o.withModifiers(i.handleClick,["prevent"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.text),1)]),_:1},8,["onClick"])]),_:1})}const Je=h._(Xe,[["render",Ge]]),Ye=S.extend({addNodeView(){return d.VueNodeViewRenderer(Je)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""},contactKey:{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 k.PluginKey("mentionSuggestion")}}),Qe={compatConfig:{MODE:3},name:"ChannelComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:$.default,DtIconLock:me.DtIconLock,DtStack:y.default},props:d.nodeViewProps,computed:{text(){return this.$props.node.attrs.locked?this.$props.node.attrs.name:"#"+this.$props.node.attrs.name}},methods:{handleClick(){const e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,locked:this.$props.node.attrs.locked,channelKey:this.$props.node.attrs.channelKey};this.$props.editor.emit("channel-click",e)}}};function Ze(e,t,r,n,s,i){const a=o.resolveComponent("dt-icon-lock"),c=o.resolveComponent("dt-stack"),l=o.resolveComponent("dt-link"),m=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(m,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(l,{kind:"mention",onClick:o.withModifiers(i.handleClick,["prevent"])},{default:o.withCtx(()=>[o.createVNode(c,{direction:"row",gap:"0"},{default:o.withCtx(()=>[e.$props.node.attrs.locked?(o.openBlock(),o.createBlock(a,{key:0,size:"200"})):o.createCommentVNode("",!0),o.createElementVNode("span",null,o.toDisplayString(i.text),1)]),_:1})]),_:1},8,["onClick"])]),_:1})}const et=h._(Qe,[["render",Ze]]),tt=S.extend({name:"channel",addNodeView(){return d.VueNodeViewRenderer(et)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1},channelKey:{default:""}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["channel-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"#",pluginKey:new k.PluginKey("channelSuggestion")}}),nt={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,s;const e=this.$props.node.attrs.command;this.$emit("selected-command",e);const t=(s=(n=(r=this.editor)==null?void 0:r.storage)==null?void 0:n["slash-commands"])==null?void 0:s.onSelectedCommand;t&&typeof t=="function"&&t(e)}};function ot(e,t,r,n,s,i){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(i.text),1)]),_:1})}const rt=h._(nt,[["render",ot]]),st=(e,t)=>[...e.matchAll(t)].map(n=>{let s=n[2];return s.endsWith(" ")||(s+=" "),{index:n.index,text:s,match:n}}),it=S.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(rt)},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=>st(n,t),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new k.PluginKey("slashCommandSuggestion")}}),at=100,ct={name:"VariableComponent",components:{DtBadge:fe.default,DtButton:V.default,DtPopover:pe.default,DtInput:he.default,NodeViewWrapper:d.NodeViewWrapper},props:d.nodeViewProps,data(){return{i18n:new A.DialtoneLocalization,MAX_VARIABLE_ALT_LENGTH:at}},computed:{altText:{get(){var e,t;return((t=(e=this.node)==null?void 0:e.attrs)==null?void 0:t.altText)||""},set(e){this.updateAttributes({altText:e})}},variableId(){var e,t;return(t=(e=this.node)==null?void 0:e.attrs)==null?void 0:t.id},placeholder(){var e;return((e=this.variableData)==null?void 0:e.placeholder)||""},variableItems(){var e,t;return((t=(e=this.extension)==null?void 0:e.options)==null?void 0:t.variableItems)||[]},variableData(){return this.variableItems.find(e=>e.id===this.variableId)},badgeLabel(){return`{} ${this.placeholder}`},placeholderText(){return`Replaces ${this.placeholder}`}}};function lt(e,t,r,n,s,i){const a=o.resolveComponent("dt-badge"),c=o.resolveComponent("dt-button"),l=o.resolveComponent("dt-input"),m=o.resolveComponent("dt-popover"),p=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(p,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(m,{padding:"small","navigation-type":"arrow-keys",placement:"top-start",modal:!1},{anchor:o.withCtx(({attrs:f})=>[o.createVNode(c,o.mergeProps(f,{kind:"unstyled"}),{default:o.withCtx(()=>[o.createVNode(a,{text:i.badgeLabel,contenteditable:"false"},null,8,["text"])]),_:1},16)]),content:o.withCtx(({close:f})=>[o.createVNode(l,{modelValue:i.altText,"onUpdate:modelValue":t[0]||(t[0]=_=>i.altText=_),"root-class":"d-p8 d-w332",label:s.i18n.$t("DIALTONE_EDITOR_VARIABLE_LABEL"),placeholder:i.placeholderText,validate:{length:{description:s.i18n.$t("DIALTONE_EDITOR_VARIABLE_VALIDATE_DESCRIPTION"),message:s.i18n.$t("DIALTONE_EDITOR_VARIABLE_VALIDATE_MESSAGE"),max:s.MAX_VARIABLE_ALT_LENGTH,warn:s.MAX_VARIABLE_ALT_LENGTH,limitMaxLength:!0}},onKeyup:o.withKeys(_=>f(),["enter"])},null,8,["modelValue","label","placeholder","validate","onKeyup"])]),_:1})]),_:1})}const dt=h._(ct,[["render",lt]]),ut=u.Node.create({name:"variable",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},variableItems:[]}},addNodeView(){return d.VueNodeViewRenderer(dt)},addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-variable-id"),renderHTML:e=>e.id?{"data-variable-id":e.id}:{}},altText:{default:"",parseHTML:e=>e.getAttribute("data-alt-text"),renderHTML:e=>e.altText?{"data-alt-text":e.altText}:{}}}},parseHTML(){return[{tag:"variable"}]},renderText({node:e}){return e.attrs.altText},renderHTML({node:e,HTMLAttributes:t}){return["variable",u.mergeAttributes(this.options.HTMLAttributes,t,{"data-variable-id":e.attrs.id,"data-alt-text":e.attrs.altText})]},addCommands(){return{insertVariable:(e={})=>({commands:t})=>t.insertContent({type:this.name,attrs:{id:e.id||null,altText:e.altText||""}})}}}),mt={compatConfig:{MODE:3},name:"MentionSuggestion",components:{DtAvatar:ge.default,DtStack:y.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}}},ht={class:"d-mention-suggestion__name"},pt={key:1,class:"d-mention-suggestion__divider"},ft={key:2,class:"d-mention-suggestion__status"};function gt(e,t,r,n,s,i){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":i.name,"image-src":i.avatarSrc,"image-alt":i.name,"show-presence":i.showDetails,presence:i.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",ht,o.toDisplayString(i.name),1),i.showDetails?(o.openBlock(),o.createBlock(c,{key:0,direction:"row",gap:"300",class:"d-label--sm-plain"},{default:o.withCtx(()=>[i.presenceText?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["d-mention-suggestion__presence",[i.presenceFontColorClass]])},o.toDisplayString(i.presenceText),3)):o.createCommentVNode("",!0),i.status&&i.presenceText?(o.openBlock(),o.createElementBlock("div",pt," • ")):o.createCommentVNode("",!0),i.status?(o.openBlock(),o.createElementBlock("div",ft,o.toDisplayString(i.status),1)):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1})}const _t=h._(mt,[["render",gt]]),kt={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(_t),itemType:"mention",...n},editor:n.editor}),n.clientRect&&(t=T("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:[v]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},wt={compatConfig:{MODE:3},name:"ChannelSuggestion",components:{DtStack:y.default,DtIconHash:_e,DtIconLock:ke},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function Ct(e,t,r,n,s,i){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(i.name),1)]),_:1})}const yt=h._(wt,[["render",Ct]]),bt={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(yt),itemType:"channel",...n},editor:n.editor}),n.clientRect&&(t=T("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:[v]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},xt={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}}},Tt={class:"d-body--md-compact"},Et={key:0},vt={class:"d-body--sm d-fc-tertiary"};function Lt(e,t,r,n,s,i){return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",Tt,[o.createElementVNode("span",null,"/"+o.toDisplayString(i.command),1),i.parametersExample?(o.openBlock(),o.createElementBlock("span",Et,o.toDisplayString(i.parametersExample),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",vt,o.toDisplayString(i.description),1)])}const St=h._(xt,[["render",Lt]]),Nt={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(St),itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(t=T("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:[v]}),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 s;if(r)return(s=e==null?void 0:e.ref)==null?void 0:s.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},Bt={compatConfig:{MODE:3},name:"DtRichTextEditor",components:{EditorContent:d.EditorContent,BubbleMenu:d.BubbleMenu,DtButton:V.default,DtStack:y.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"?x.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:"html",validator(e){return x.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},allowVariable:{type:Boolean,default:!1},variableItems:{type:Array,default:()=>[]},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","markdown-input","update:modelValue","blur","focus","enter","edit-link","selected","selected-command","mention-click","channel-click"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var e;return(e=C.returnFirstEl(this.$refs.editor.$el).getRootNode())==null?void 0:e.querySelector("body")},placement:"top-start"},i18n:new A.DialtoneLocalization,jsonToMarkdownConverter:{convertToMarkdown(e){return this.processNode(e)},processNodeContent(e){return e.content?e.content.map(t=>this.processNode(t)).join(""):""},processNode(e){if(!e)return"";const r={doc:n=>this.processDocNode(n),paragraph:n=>this.processParagraphNode(n),text:n=>this.processTextNode(n),hardBreak:()=>this.processHardBreakNode(),blockquote:n=>this.processBlockquoteNode(n),bulletList:n=>this.processBulletListNode(n),orderedList:n=>this.processOrderedListNode(n),listItem:n=>this.processListItemNode(n),codeBlock:n=>this.processCodeBlockNode(n),mention:n=>this.processMentionNode(n),channel:n=>this.processChannelNode(n),"slash-commands":n=>this.processSlashCommandsNode(n),emoji:n=>this.processEmojiNode(n),variable:n=>this.processVariableNode(n)}[e.type];return r?r(e):this.processUnknownNode(e)},processDocNode(e){return this.processNodeContent(e)},processParagraphNode(e){const t=this.processNodeContent(e);return t?t+`
|
|
2
2
|
`:`
|
|
3
3
|
`},processTextNode(e){let t=e.text||"";return e.marks&&(t=this.applyMarks(t,e.marks)),t},processHardBreakNode(){return`
|
|
4
4
|
`},processBlockquoteNode(e){return this.processNodeContent(e).split(`
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
`},processBulletListNode(e){return this.processNodeContent(e)},processOrderedListNode(e){return e.content?e.content.map((t,r)=>this.processNode(t).replace(/^- /,`${r+1}. `)).join(""):""},processListItemNode(e){const t=this.processNodeContent(e);return t?`- ${t.replace(/\n$/,"")}
|
|
8
8
|
`:""},processCodeBlockNode(e){return`\`\`\`
|
|
9
9
|
${this.processNodeContent(e)}
|
|
10
|
-
\`\`\``},processMentionNode(e){var s,i,a;const t=((s=e.attrs)==null?void 0:s.name)||"",r=((i=e.attrs)==null?void 0:i.id)||"",n=((a=e.attrs)==null?void 0:a.contactKey)||"";return`<!-- @mention: {"id": "${r}", "contactKey": "${n}", "name": "${t}"} -->`},processChannelNode(e){var i,a,c,l;const t=((i=e.attrs)==null?void 0:i.name)||"",r=((a=e.attrs)==null?void 0:a.id)||"",n=((c=e.attrs)==null?void 0:c.locked.toString())||"",s=((l=e.attrs)==null?void 0:l.channelKey)||"";return`<!-- @channel: {"id": "${r}", "channelKey": "${s}", "name": "${t}", "locked": "${n}"} -->`},processSlashCommandsNode(e){var n,s;const t=((n=e.attrs)==null?void 0:n.command)||"",r=((s=e.attrs)==null?void 0:s.parameters)||"";return`/${t}${r?` ${r}`:""}`},processEmojiNode(e){var t;return((t=e.attrs)==null?void 0:t.code)||""},processUnknownNode(e){return this.processNodeContent(e)},applyMarks(e,t){let r=e;return[...t].sort((s,i)=>{const a={link:0,bold:1,italic:2,strike:3,code:4};return(a[s.type]||5)-(a[i.type]||5)}).forEach(s=>{var i;switch(s.type){case"bold":r=`**${r}**`;break;case"italic":r=`*${r}*`;break;case"strike":r=`~~${r}~~`;break;case"code":r=`\`${r}\``;break;case"link":{const a=((i=s.attrs)==null?void 0:i.href)||"";r=`[${r}](${a})`;break}}}),r}}}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){const e=[
|
|
10
|
+
\`\`\``},processMentionNode(e){var s,i,a;const t=((s=e.attrs)==null?void 0:s.name)||"",r=((i=e.attrs)==null?void 0:i.id)||"",n=((a=e.attrs)==null?void 0:a.contactKey)||"";return`<!-- @mention: {"id": "${r}", "contactKey": "${n}", "name": "${t}"} -->`},processChannelNode(e){var i,a,c,l;const t=((i=e.attrs)==null?void 0:i.name)||"",r=((a=e.attrs)==null?void 0:a.id)||"",n=((c=e.attrs)==null?void 0:c.locked.toString())||"",s=((l=e.attrs)==null?void 0:l.channelKey)||"";return`<!-- @channel: {"id": "${r}", "channelKey": "${s}", "name": "${t}", "locked": "${n}"} -->`},processSlashCommandsNode(e){var n,s;const t=((n=e.attrs)==null?void 0:n.command)||"",r=((s=e.attrs)==null?void 0:s.parameters)||"";return`/${t}${r?` ${r}`:""}`},processEmojiNode(e){var t;return((t=e.attrs)==null?void 0:t.code)||""},processVariableNode(e){var n,s;const t=((n=e.attrs)==null?void 0:n.id)||"",r=((s=e.attrs)==null?void 0:s.altText)||"";return`{{${t}=${r}}}`},processUnknownNode(e){return this.processNodeContent(e)},applyMarks(e,t){let r=e;return[...t].sort((s,i)=>{const a={link:0,bold:1,italic:2,strike:3,code:4};return(a[s.type]||5)-(a[i.type]||5)}).forEach(s=>{var i;switch(s.type){case"bold":r=`**${r}**`;break;case"italic":r=`*${r}*`;break;case"strike":r=`~~${r}~~`;break;case"code":r=`\`${r}\``;break;case"link":{const a=((i=s.attrs)==null?void 0:i.href)||"";r=`[${r}](${a})`;break}}}),r}}}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){const e=[j,Z,te,K];e.push(this.useDivTags?ze:R),this.allowBold&&e.push(F),this.allowBlockquote&&e.push(O),this.allowBulletList&&(e.push(U),e.push(G.extend({renderText({node:n}){return n.textContent}})),e.push(J)),this.allowItalic&&e.push(z),this.allowStrike&&e.push(Y),this.allowUnderline&&e.push(Q),this.placeholder&&e.push(W.configure({placeholder:this.placeholder}));const t=this,r=u.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>t.allowLineBreaks?!1:(n.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>t.allowBulletList&&s.splitListItem("listItem"),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit("enter"),!0)}}});if(e.push(r),this.link&&e.push(X.extend({inclusive:!1,addKeyboardShortcuts(){return{"Mod-k":()=>(t.$emit("edit-link"),!0)}}}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:x.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension(Fe,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...kt};e.push(Ye.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,...bt};e.push(tt.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...Nt};e.push(it.configure({suggestion:n,onSelectedCommand:s=>{this.$emit("selected-command",s)}}))}return this.allowVariable&&e.push(ut.configure({variableItems:this.variableItems})),e.push(Me),e.push(ee.configure({types:["paragraph"]})),this.allowCode&&e.push(q),this.allowCodeblock&&e.push(P.extend({renderText({node:n}){return`\`\`\`
|
|
11
11
|
${n.textContent}
|
|
12
|
-
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(
|
|
12
|
+
\`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(Ue),(this.allowFontFamily||this.allowFontColor)&&(e.push(ie),this.allowFontColor&&e.push(ae),this.allowFontFamily&&e.push(ce)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),this.allowTables&&e.push(ne.configure({resizable:!0}),se,re,oe,H),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(){C.warnIfUnmounted(C.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)=>{if(!this.preventTyping)return!1;const r=["Backspace"];return!this.allowLineBreaks&&!t.shiftKey&&r.push("Enter"),!r.includes(t.key)},handlePaste:(e,t)=>{const r=t.clipboardData||window.clipboardData,n=r.getData("text/plain"),s=r.getData("text/html");return this.processPasteData(e,n,s)},transformPastedHTML(e){return e.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e}){return e.isActive("link")},getSelectedLinkText(e){var c,l,m;const{view:t,state:r}=e,{from:n,to:s}=t.state.selection,i=r.doc.textBetween(n,s,""),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:i},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=x.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,s){var c,l,m;if(!e){this.removeLink();return}n.find(p=>p.test(e))||(e=`${s}${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&&we(e,r))){if(typeof e=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${I.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 s=(this.pasteRichText?t:t.replace(/\r\n/g,`
|
|
13
13
|
`).replace(/\n\n/g,`
|
|
14
14
|
`)).replace(/[\r\n]+$/,"").split(/\r?\n/),i=[];for(let a=0;a<s.length;a++)a>0&&i.push({type:"hardBreak"}),s[a]&&i.push({type:"text",text:s[a]});this.editor.chain().focus().insertContent(i).run()},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(`
|
|
15
15
|
`))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",s=t.includes("white-space: pre");return n||s},hasLineBreaks(e){return e.textContent&&e.textContent.includes(`
|
|
@@ -17,5 +17,5 @@ ${n.textContent}
|
|
|
17
17
|
|
|
18
18
|
`)||/\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:`
|
|
19
19
|
`});this.$emit("text-input",n);const s=this.jsonToMarkdownConverter.convertToMarkdown(t);this.$emit("markdown-input",s)},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)}),this.editor.on("mention-click",e=>{this.$emit("mention-click",e)}),this.editor.on("channel-click",e=>{this.$emit("channel-click",e)})},getOutput(){switch(this.outputFormat){case"json":return this.editor.getJSON();case"html":return this.editor.getHTML();case"markdown":return this.jsonToMarkdownConverter.convertToMarkdown(this.editor.getJSON());case"text":default:return this.editor.getText({blockSeparator:`
|
|
20
|
-
`})}},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()}}},
|
|
20
|
+
`})}},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()}}},Rt={class:"d-popover__dialog"};function It(e,t,r,n,s,i){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,[s.editor&&r.link&&!r.hideLinkBubbleMenu?(o.openBlock(),o.createBlock(l,{key:0,editor:s.editor,"should-show":i.bubbleMenuShouldShow,"tippy-options":s.tippyOptions,style:{visibility:"visible"}},{default:o.withCtx(()=>[o.createElementVNode("div",Rt,[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:i.editLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")),1)]),_:1},8,["onClick"]),o.createVNode(a,{kind:"muted",importance:"clear",onClick:i.openLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")),1)]),_:1},8,["onClick"]),o.createVNode(a,{kind:"danger",importance:"clear",onClick:i.removeLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")),1)]),_:1},8,["onClick"])]),_:1})])]),_:1},8,["editor","should-show","tippy-options"])):o.createCommentVNode("",!0),o.createVNode(m,o.mergeProps({ref:"editor",editor:s.editor,class:"d-rich-text-editor","data-qa":"dt-rich-text-editor"},i.attrs),null,16,["editor"])])}const Dt=h._(Bt,[["render",It]]);exports.default=Dt;
|
|
21
21
|
//# sourceMappingURL=rich-text-editor.cjs.map
|