@dialpad/dialtone 9.139.0 → 9.140.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 +59091 -59091
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +26 -18
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +6 -3
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.cjs +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.js +2 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +13 -4
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +356 -225
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.js +19 -14
- package/dist/vue2/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue2/localization/ja-JP.cjs +2 -0
- package/dist/vue2/localization/ja-JP.cjs.map +1 -1
- package/dist/vue2/localization/ja-JP.js +2 -0
- package/dist/vue2/localization/ja-JP.js.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/mentions/mention.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +21 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue2/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +2 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +5 -4
- package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
- 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 +37 -28
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination/pagination.js +37 -32
- package/dist/vue3/lib/pagination/pagination.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.cjs +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.js +2 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +15 -6
- 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 +421 -278
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js +1 -1
- package/dist/vue3/lib/tooltip/tooltip.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 +19 -14
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/ja-JP.cjs +2 -0
- package/dist/vue3/localization/ja-JP.cjs.map +1 -1
- package/dist/vue3/localization/ja-JP.js +2 -0
- package/dist/vue3/localization/ja-JP.js.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +1 -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/mention.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +22 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/types/directives/tooltip_directive/tooltip.d.ts.map +1 -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/message_input/message_input.vue.d.ts +3 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +3 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.cjs","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-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\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-2';\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 @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 :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 :paste-rich-text=\"richText\"\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 :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\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 v-on=\"$listeners\"\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 direction=\"row\"\n gap=\"200\"\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\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\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 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/vue2';\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 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 value: {\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`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\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:value\n * @type {String|JSON}\n */\n 'update:value',\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 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.value, // 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 Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\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 value (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.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\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 // eslint-disable-next-line complexity\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\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 = this.$refs.richTextEditor.$el.querySelector('.tiptap').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('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\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:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","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","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":"m2BA2CAA,EAAA,CACA,KAAA,cAEA,WAAA,CACA,gBAAAC,EAAAA,gBACA,aAAAC,EAAAA,QACA,YAAAC,EAAAA,YACA,SAAAC,EAAAA,QACA,YAAAC,EAAAA,WACA,EAEA,MAAAC,EAAAA,cAEA,MAAA,CAAA,oBAAA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,kBAAA,CACA,OAAA,KAAA,KAAA,GAAA,uBAAA,CACA,CACA,EAEA,QAAA,CACA,MAAAC,EAAA,WAEA,MAAAC,GAAAC,GAAAC,GAAAC,EAAA,KAAA,SAAA,YAAAA,EAAA,UAAA,YAAAD,EAAA,cAAA,YAAAD,EAAA,QAEAD,GAAA,OAAAA,GAAA,YACAA,EAAAD,CAAA,CAEA,CACA,CACA,60BC5EAK,EAAeC,EAAAA,KAAK,OAAO,CACzB,KAAM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,eAAA,KAAA,MAAA,wBAAA,MAAA,MAAA,KAAA,CACA,EAEA,mBAAA,CACA,KAAA,kBAAA,CAAA,KAAA,iBACA,EAEA,QAAA,CACA,KAAA,gBAGA,KAAA,MAAA,SAAA,KAAA,kBAAA,CACA,EAEA,UAAA,CACA,KAAA,MAAA,QAAA,CACA,EAEA,QAAAd,EAAA,CACA,KAAA,MAAA,eAAAA,CAAA,CACA,EAEA,YAAAA,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,aAAAA,CAAA,CACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"message-input.cjs","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-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\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-2';\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 @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 :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 :paste-rich-text=\"richText\"\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 :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$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 v-on=\"$listeners\"\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 direction=\"row\"\n gap=\"200\"\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\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\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 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/vue2';\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 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 value: {\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:value\n * @type {String|JSON}\n */\n 'update:value',\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.value, // 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 Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\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 value (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.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\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 isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\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 = this.$refs.richTextEditor.$el.querySelector('.tiptap').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('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\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:value', 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","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","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":"m2BA2CAA,EAAA,CACA,KAAA,cAEA,WAAA,CACA,gBAAAC,EAAAA,gBACA,aAAAC,EAAAA,QACA,YAAAC,EAAAA,YACA,SAAAC,EAAAA,QACA,YAAAC,EAAAA,WACA,EAEA,MAAAC,EAAAA,cAEA,MAAA,CAAA,oBAAA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,kBAAA,CACA,OAAA,KAAA,KAAA,GAAA,uBAAA,CACA,CACA,EAEA,QAAA,CACA,MAAAC,EAAA,WAEA,MAAAC,GAAAC,GAAAC,GAAAC,EAAA,KAAA,SAAA,YAAAA,EAAA,UAAA,YAAAD,EAAA,cAAA,YAAAD,EAAA,QAEAD,GAAA,OAAAA,GAAA,YACAA,EAAAD,CAAA,CAEA,CACA,CACA,60BC5EAK,EAAeC,EAAAA,KAAK,OAAO,CACzB,KAAM,cAEN,KAAM,GACN,MAAO,SACP,OAAQ,GAER,YAAc,CACZ,MAAO,CACL,QAAS,IAAM,CAAC,CACtB,CACE,EAEA,YAAc,CACZ,MAAO,C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CACA,KAAA,gBAGA,KAAA,MAAA,SAAA,KAAA,kBAAA,CACA,EAEA,UAAA,CACA,KAAA,MAAA,QAAA,CACA,EAEA,QAAAd,EAAA,CACA,KAAA,MAAA,eAAAA,CAAA,CACA,EAEA,YAAAA,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,aAAAA,CAAA,CACA,EAEA,gBAAAA,EAAA,CACA,KAAA,MAAA,iBAAAA,CAAA,CACA,CACA,CACA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import l from "./last-active-nodes.js";
|
|
2
2
|
import { Node as c, mergeAttributes as u } from "@tiptap/core";
|
|
3
3
|
import { nodeViewProps as d, NodeViewWrapper as p, VueNodeViewRenderer as m } from "../../node_modules/@tiptap/vue-2.js";
|
|
4
|
-
import { DtIconVideo as h, DtIconClose as f, DtIconSend as g, DtIconSatisfied as b, DtIconVerySatisfied as
|
|
4
|
+
import { DtIconVideo as h, DtIconClose as f, DtIconSend as g, DtIconSatisfied as b, DtIconVerySatisfied as k, DtIconImage as _ } from "@dialpad/dialtone-icons/vue2";
|
|
5
5
|
import { DialtoneLocalization as s } from "../../localization/index.js";
|
|
6
6
|
import { n as a } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
7
7
|
import r from "../button/button.js";
|
|
@@ -10,12 +10,12 @@ import v from "./message-input-topbar.js";
|
|
|
10
10
|
import L from "./message-input-link.js";
|
|
11
11
|
import { EDITOR_SUPPORTED_LINK_PROTOCOLS as S, EDITOR_DEFAULT_LINK_PREFIX as x } from "../editor/editor-constants.js";
|
|
12
12
|
import y from "../stack/stack.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import I from "../tooltip/tooltip.js";
|
|
14
|
+
import O from "../rich-text-editor/rich-text-editor.js";
|
|
15
15
|
import B from "../popover/popover.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { RICH_TEXT_EDITOR_OUTPUT_FORMATS as
|
|
16
|
+
import w from "../input/input.js";
|
|
17
|
+
import C from "../emoji-picker/emoji-picker.js";
|
|
18
|
+
import { RICH_TEXT_EDITOR_OUTPUT_FORMATS as P, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as E } from "../rich-text-editor/rich-text-editor-constants.js";
|
|
19
19
|
const j = {
|
|
20
20
|
name: "MeetingPill",
|
|
21
21
|
components: {
|
|
@@ -102,16 +102,16 @@ const M = A.exports, N = c.create({
|
|
|
102
102
|
name: "DtRecipeMessageInput",
|
|
103
103
|
components: {
|
|
104
104
|
DtButton: r,
|
|
105
|
-
DtEmojiPicker:
|
|
106
|
-
DtInput:
|
|
105
|
+
DtEmojiPicker: C,
|
|
106
|
+
DtInput: w,
|
|
107
107
|
DtPopover: B,
|
|
108
108
|
DtRecipeMessageInputTopbar: v,
|
|
109
109
|
DtRecipeMessageInputLink: L,
|
|
110
|
-
DtRichTextEditor:
|
|
111
|
-
DtTooltip:
|
|
110
|
+
DtRichTextEditor: O,
|
|
111
|
+
DtTooltip: I,
|
|
112
112
|
DtStack: y,
|
|
113
|
-
DtIconImage:
|
|
114
|
-
DtIconVerySatisfied:
|
|
113
|
+
DtIconImage: _,
|
|
114
|
+
DtIconVerySatisfied: k,
|
|
115
115
|
DtIconSatisfied: b,
|
|
116
116
|
DtIconSend: g
|
|
117
117
|
},
|
|
@@ -183,20 +183,20 @@ const M = A.exports, N = c.create({
|
|
|
183
183
|
type: [Boolean, String, Number],
|
|
184
184
|
default: !1,
|
|
185
185
|
validator(t) {
|
|
186
|
-
return typeof t == "string" ?
|
|
186
|
+
return typeof t == "string" ? E.includes(t) : !0;
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
/**
|
|
190
190
|
* The output format that the editor uses when emitting the "@input" event.
|
|
191
|
-
* One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for
|
|
191
|
+
* One of `text`, `json`, `html`, `markdown`. See https://tiptap.dev/guide/output for
|
|
192
192
|
* examples.
|
|
193
|
-
* @values text, json, html
|
|
193
|
+
* @values text, json, html, markdown
|
|
194
194
|
*/
|
|
195
195
|
outputFormat: {
|
|
196
196
|
type: String,
|
|
197
197
|
default: "json",
|
|
198
198
|
validator(t) {
|
|
199
|
-
return
|
|
199
|
+
return P.includes(t);
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
/**
|
|
@@ -499,6 +499,12 @@ const M = A.exports, N = c.create({
|
|
|
499
499
|
* @type {String}
|
|
500
500
|
*/
|
|
501
501
|
"text-input",
|
|
502
|
+
/**
|
|
503
|
+
* Emitted when input changes, returns markdown content only
|
|
504
|
+
* @event markdown-input
|
|
505
|
+
* @type {String}
|
|
506
|
+
*/
|
|
507
|
+
"markdown-input",
|
|
502
508
|
/**
|
|
503
509
|
* Emitted when the 'Add emoji' button is clicked
|
|
504
510
|
* @event add-emoji
|
|
@@ -606,7 +612,6 @@ const M = A.exports, N = c.create({
|
|
|
606
612
|
e && i[t] && i[t]();
|
|
607
613
|
},
|
|
608
614
|
// Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold
|
|
609
|
-
// eslint-disable-next-line complexity
|
|
610
615
|
isSelectionActive(t) {
|
|
611
616
|
var e, i, n, o;
|
|
612
617
|
return ["bulletList", "orderedList"].includes(t) ? this.lastActiveNodes((i = (e = this.$refs.richTextEditor) == null ? void 0 : e.editor) == null ? void 0 : i.state, [{ type: "bulletList" }, { type: "orderedList" }]).includes(t) && this.isFocused : ((o = (n = this.$refs.richTextEditor) == null ? void 0 : n.editor) == null ? void 0 : o.isActive(t)) && this.isFocused;
|
|
@@ -676,6 +681,9 @@ const M = A.exports, N = c.create({
|
|
|
676
681
|
},
|
|
677
682
|
onTextInput(t) {
|
|
678
683
|
this.text = t, this.$emit("text-input", t);
|
|
684
|
+
},
|
|
685
|
+
onMarkdownInput(t) {
|
|
686
|
+
this.$emit("markdown-input", t);
|
|
679
687
|
}
|
|
680
688
|
}
|
|
681
689
|
};
|
|
@@ -687,7 +695,7 @@ var R = function() {
|
|
|
687
695
|
return n.preventDefault(), e.onDrop.apply(null, arguments);
|
|
688
696
|
}, paste: e.onPaste, mousedown: e.onMousedown } }, [e._t("top"), e.richText ? i("dt-recipe-message-input-topbar", { key: e.selectedText, attrs: { "bold-button-options": e.boldButtonOptions, "italic-button-options": e.italicButtonOptions, "strike-button-options": e.strikeButtonOptions, "bullet-list-button-options": e.bulletListButtonOptions, "ordered-list-button-options": e.orderedListButtonOptions, "block-quote-button-options": e.blockQuoteButtonOptions, "code-button-options": e.codeButtonOptions, "code-block-button-options": e.codeBlockButtonOptions, "is-selection-active": e.isSelectionActive }, on: { click: e.handleTopbarClick }, scopedSlots: e._u([{ key: "link", fn: function() {
|
|
689
697
|
return [i("dt-recipe-message-input-link", { ref: "link", attrs: { open: e.linkDialogOpen, "link-button-options": e.linkButtonOptions, "is-selection-active": e.isSelectionActive }, on: { opened: e.linkDialogOpened, "set-link": e.setLink, "remove-link": e.removeLink } })];
|
|
690
|
-
}, proxy: !0 }], null, !1, 1527282285) }) : e._e(), i("div", { directives: [{ name: "dt-scrollbar", rawName: "v-dt-scrollbar" }], staticClass: "d-recipe-message-input__editor-wrapper", style: { "max-height": e.maxHeight } }, [i("dt-rich-text-editor", e._g(e._b({ ref: "richTextEditor", attrs: { editable: e.editable, "input-aria-label": e.inputAriaLabel, "input-class": e.inputClass, "output-format": e.outputFormat, "auto-focus": e.autoFocus, link: e.richText, placeholder: e.placeholder, "prevent-typing": e.preventTyping, "mention-suggestion": e.mentionSuggestion, "channel-suggestion": e.channelSuggestion, "slash-command-suggestion": e.slashCommandSuggestion, "paste-rich-text": e.richText, "allow-blockquote": e.richText, "allow-bold": e.richText, "allow-bullet-list": e.richText, "allow-code": e.richText, "allow-codeblock": e.richText, "allow-italic": e.richText, "allow-strike": e.richText, "allow-underline": e.richText, "additional-extensions": e.additionalExtensions, "hide-link-bubble-menu": e.hideLinkBubbleMenu }, on: { input: e.onInput, "text-input": e.onTextInput, enter: e.onSend, selected: function(n) {
|
|
698
|
+
}, proxy: !0 }], null, !1, 1527282285) }) : e._e(), i("div", { directives: [{ name: "dt-scrollbar", rawName: "v-dt-scrollbar" }], staticClass: "d-recipe-message-input__editor-wrapper", style: { "max-height": e.maxHeight } }, [i("dt-rich-text-editor", e._g(e._b({ ref: "richTextEditor", attrs: { editable: e.editable, "input-aria-label": e.inputAriaLabel, "input-class": e.inputClass, "output-format": e.outputFormat, "auto-focus": e.autoFocus, link: e.richText, placeholder: e.placeholder, "prevent-typing": e.preventTyping, "mention-suggestion": e.mentionSuggestion, "channel-suggestion": e.channelSuggestion, "slash-command-suggestion": e.slashCommandSuggestion, "paste-rich-text": e.richText, "allow-blockquote": e.richText, "allow-bold": e.richText, "allow-bullet-list": e.richText, "allow-code": e.richText, "allow-codeblock": e.richText, "allow-italic": e.richText, "allow-strike": e.richText, "allow-underline": e.richText, "additional-extensions": e.additionalExtensions, "hide-link-bubble-menu": e.hideLinkBubbleMenu }, on: { input: e.onInput, "text-input": e.onTextInput, "markdown-input": e.onMarkdownInput, enter: e.onSend, selected: function(n) {
|
|
691
699
|
e.selectedText = n;
|
|
692
700
|
}, "selected-command": function(n) {
|
|
693
701
|
return e.$emit("selected-command", n);
|
|
@@ -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-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\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-2';\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 @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 :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 :paste-rich-text=\"richText\"\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 :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\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 v-on=\"$listeners\"\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 direction=\"row\"\n gap=\"200\"\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\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\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 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/vue2';\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 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 value: {\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`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\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:value\n * @type {String|JSON}\n */\n 'update:value',\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 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.value, // 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 Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\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 value (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.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\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 // eslint-disable-next-line complexity\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\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 = this.$refs.richTextEditor.$el.querySelector('.tiptap').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('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\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:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","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","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,EACA;AAAA,EAEA,OAAAC;AAAA,EAEA,OAAA,CAAA,oBAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA,IAAAC,EAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA,KAAA,KAAA,GAAA,uBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SA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AAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAAd,GAAA;AACA,WAAA,MAAA,gBAAAA,CAAA;AAAA,IACA;AAAA,IAEA,YAAAA,GAAA;AACA,WAAA,OAAAA,GACA,KAAA,MAAA,cAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\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-2';\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 @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 :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 :paste-rich-text=\"richText\"\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 :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$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 v-on=\"$listeners\"\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 direction=\"row\"\n gap=\"200\"\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\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\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 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/vue2';\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 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 value: {\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:value\n * @type {String|JSON}\n */\n 'update:value',\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.value, // 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 Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\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 value (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.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\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 isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\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 = this.$refs.richTextEditor.$el.querySelector('.tiptap').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('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\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:value', 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","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","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,EACA;AAAA,EAEA,OAAAC;AAAA,EAEA,OAAA,CAAA,oBAAA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA,IAAAC,EAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA,KAAA,KAAA,GAAA,uBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,MAAAC,GAAA;;AAEA,YAAAC,KAAAC,KAAAC,KAAAC,IAAA,KAAA,WAAA,gBAAAA,EAAA,YAAA,gBAAAD,EAAA,gBAAA,gBAAAD,EAAA;AAEA,MAAAD,KAAA,OAAAA,KAAA,cACAA,EAAAD,CAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;qBC5EAK,IAAeC,EAAK,OAAO;AAAA,EACzB,MAAM;AAAA,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AAA,MAAA,kBAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@dialpad/dialtone-icons/vue2"),u=require("../../localization/index.cjs"),l=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),g=require("../button/button.cjs"),h={name:"DtPagination",components:{DtButton:g.default,DtIconChevronLeft:o.DtIconChevronLeft,DtIconChevronRight:o.DtIconChevronRight,DtIconMoreHorizontal:o.DtIconMoreHorizontal},props:{ariaLabel:{type:String,required:!0},totalPages:{type:Number,required:!0},activePage:{type:Number,default:1},maxVisible:{type:Number,default:5},hideEdges:{type:Boolean,default:!1}},emits:["change"],data(){return{currentPage:this.activePage,i18n:new u.DialtoneLocalization}},computed:{isFirstPage(){return this.currentPage===1},isLastPage(){return this.currentPage===this.totalPages},pages(){if(this.maxVisible===0)return[];if(this.totalPages<=this.maxVisible)return this.range(1,this.totalPages);let e=this.maxVisible-1,t=this.totalPages-e+1;if(this.hideEdges&&(e=e+1,t=t-1),this.currentPage<e){const n=[...this.range(1,e),"..."];return this.hideEdges||n.push(this.totalPages),n}if(this.currentPage>t){const n=["...",...this.range(t,this.totalPages)];return this.hideEdges||n.unshift(1),n}const i=this.maxVisible-(3-this.maxVisible%2),a=Math.floor(i/2);let r=this.currentPage-a,s=this.currentPage+a;this.hideEdges&&(r=r-1,s=s+1);const c=["...",...this.range(r,s),"..."];return this.hideEdges?c:[1,...c,this.totalPages]},prevAriaLabel(){return this.isFirstPage?this.i18n.$t("DIALTONE_PAGINATION_FIRST_PAGE"):this.i18n.$t("DIALTONE_PAGINATION_PREVIOUS_PAGE")},nextAriaLabel(){return this.isLastPage?this.i18n.$t("DIALTONE_PAGINATION_LAST_PAGE"):this.i18n.$t("DIALTONE_PAGINATION_NEXT_PAGE")},pageNumberAriaLabel(){return e=>e===this.totalPages?`${this.i18n.$t("DIALTONE_PAGINATION_LAST_PAGE")} ${e}`:`${this.i18n.$t("DIALTONE_PAGINATION_PAGE_NUMBER",{page:e})}`}},watch:{activePage(){this.currentPage=this.activePage}},methods:{range(e,t){const i=[];e=e>0?e:1;for(let a=e;a<=t;a++)i.push(a);return i},changePage(e){this.currentPage=e,this.$emit("change",this.currentPage)}}};var d=function(){var t=this,i=t._self._c;return i("nav",{staticClass:"d-pagination",attrs:{"aria-label":t.ariaLabel}},[i("dt-button",{staticClass:"d-pagination__button",attrs:{"data-qa":"dt-pagination-prev","aria-label":t.prevAriaLabel,kind:"muted",importance:"clear",disabled:t.isFirstPage},on:{click:function(a){return t.changePage(t.currentPage-1)}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("dt-icon-chevron-left",{attrs:{size:"300"}})]},proxy:!0}])}),t._l(t.pages,function(a,r){return i("div",{key:`page-${a}-${r}`,class:{"d-pagination__separator":isNaN(Number(a))}},[isNaN(Number(a))?i("div",{staticClass:"d-pagination__separator-icon",attrs:{"data-qa":"dt-pagination-separator"}},[i("dt-icon-more-horizontal",{attrs:{size:"300"}})],1):i("dt-button",{attrs:{"aria-label":t.pageNumberAriaLabel(a),kind:t.currentPage===a?"default":"muted",importance:t.currentPage===a?"primary":"clear","label-class":""},on:{click:function(s){return t.changePage(a)}}},[t._v(" "+t._s(a)+" ")])],1)}),i("dt-button",{staticClass:"d-pagination__button",attrs:{"data-qa":"dt-pagination-next","aria-label":t.nextAriaLabel,disabled:t.isLastPage,kind:"muted",importance:"clear"},on:{click:function(a){return t.changePage(t.currentPage+1)}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("dt-icon-chevron-right",{attrs:{size:"300"}})]},proxy:!0}])})],2)},P=[],_=l.n(h,d,P);const b=_.exports;exports.default=b;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@dialpad/dialtone-icons/vue2"),u=require("../../localization/index.cjs"),l=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),g=require("../button/button.cjs"),h={name:"DtPagination",components:{DtButton:g.default,DtIconChevronLeft:o.DtIconChevronLeft,DtIconChevronRight:o.DtIconChevronRight,DtIconMoreHorizontal:o.DtIconMoreHorizontal},props:{ariaLabel:{type:String,required:!0},totalPages:{type:Number,required:!0},activePage:{type:Number,default:1},maxVisible:{type:Number,default:5},hideEdges:{type:Boolean,default:!1}},emits:["change"],data(){return{currentPage:this.activePage,i18n:new u.DialtoneLocalization}},computed:{isFirstPage(){return this.currentPage===1},isLastPage(){return this.currentPage===this.totalPages},pages(){if(this.maxVisible===0)return[];if(this.totalPages<=this.maxVisible)return this.range(1,this.totalPages);let e=this.maxVisible-1,t=this.totalPages-e+1;if(this.hideEdges&&(e=e+1,t=t-1),this.currentPage<e){const n=[...this.range(1,e),"..."];return this.hideEdges||n.push(this.totalPages),n}if(this.currentPage>t){const n=["...",...this.range(t,this.totalPages)];return this.hideEdges||n.unshift(1),n}const i=this.maxVisible-(3-this.maxVisible%2),a=Math.floor(i/2);let r=this.currentPage-a,s=this.currentPage+a;this.hideEdges&&(r=r-1,s=s+1);const c=["...",...this.range(r,s),"..."];return this.hideEdges?c:[1,...c,this.totalPages]},prevAriaLabel(){return this.isFirstPage?this.i18n.$t("DIALTONE_PAGINATION_FIRST_PAGE"):this.i18n.$t("DIALTONE_PAGINATION_PREVIOUS_PAGE")},nextAriaLabel(){return this.isLastPage?this.i18n.$t("DIALTONE_PAGINATION_LAST_PAGE"):this.i18n.$t("DIALTONE_PAGINATION_NEXT_PAGE")},pageNumberAriaLabel(){return e=>e===this.totalPages?`${this.i18n.$t("DIALTONE_PAGINATION_LAST_PAGE")} ${e}`:`${this.i18n.$t("DIALTONE_PAGINATION_PAGE_NUMBER",{page:e})}`}},watch:{activePage(){this.currentPage=this.activePage},totalPages(e){(this.currentPage>e||this.currentPage<=0)&&(this.currentPage=e)}},methods:{range(e,t){const i=[];e=e>0?e:1;for(let a=e;a<=t;a++)i.push(a);return i},changePage(e){this.currentPage=e,this.$emit("change",this.currentPage)}}};var d=function(){var t=this,i=t._self._c;return i("nav",{directives:[{name:"show",rawName:"v-show",value:t.totalPages>0,expression:"totalPages > 0"}],staticClass:"d-pagination",attrs:{"aria-label":t.ariaLabel}},[i("dt-button",{staticClass:"d-pagination__button",attrs:{"data-qa":"dt-pagination-prev","aria-label":t.prevAriaLabel,kind:"muted",importance:"clear",disabled:t.isFirstPage},on:{click:function(a){return t.changePage(t.currentPage-1)}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("dt-icon-chevron-left",{attrs:{size:"300"}})]},proxy:!0}])}),t._l(t.pages,function(a,r){return i("div",{key:`page-${a}-${r}`,class:{"d-pagination__separator":isNaN(Number(a))}},[isNaN(Number(a))?i("div",{staticClass:"d-pagination__separator-icon",attrs:{"data-qa":"dt-pagination-separator"}},[i("dt-icon-more-horizontal",{attrs:{size:"300"}})],1):i("dt-button",{attrs:{"aria-label":t.pageNumberAriaLabel(a),kind:t.currentPage===a?"default":"muted",importance:t.currentPage===a?"primary":"clear","label-class":""},on:{click:function(s){return t.changePage(a)}}},[t._v(" "+t._s(a)+" ")])],1)}),i("dt-button",{staticClass:"d-pagination__button",attrs:{"data-qa":"dt-pagination-next","aria-label":t.nextAriaLabel,disabled:t.isLastPage,kind:"muted",importance:"clear"},on:{click:function(a){return t.changePage(t.currentPage+1)}},scopedSlots:t._u([{key:"icon",fn:function(){return[i("dt-icon-chevron-right",{attrs:{size:"300"}})]},proxy:!0}])})],2)},P=[],_=l.n(h,d,P);const b=_.exports;exports.default=b;
|
|
2
2
|
//# sourceMappingURL=pagination.cjs.map
|