@dialpad/dialtone 9.39.0 → 9.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/README.md +19 -1
  2. package/dist/css/dialtone.css +2 -2
  3. package/dist/tokens/css/variables-dark.css +1 -1
  4. package/dist/tokens/css/variables-expressive-dark.css +1 -1
  5. package/dist/tokens/css/variables-expressive-light.css +1 -1
  6. package/dist/tokens/css/variables-expressive-sm-dark.css +1 -1
  7. package/dist/tokens/css/variables-expressive-sm-light.css +1 -1
  8. package/dist/tokens/css/variables-light.css +1 -1
  9. package/dist/tokens/css/variables-tmo-dark.css +1 -1
  10. package/dist/tokens/css/variables-tmo-light.css +1 -1
  11. package/dist/tokens/less/variables-dark.less +1 -1
  12. package/dist/tokens/less/variables-expressive-dark.less +1 -1
  13. package/dist/tokens/less/variables-expressive-light.less +1 -1
  14. package/dist/tokens/less/variables-expressive-sm-dark.less +1 -1
  15. package/dist/tokens/less/variables-expressive-sm-light.less +1 -1
  16. package/dist/tokens/less/variables-light.less +1 -1
  17. package/dist/tokens/less/variables-tmo-dark.less +1 -1
  18. package/dist/tokens/less/variables-tmo-light.less +1 -1
  19. package/dist/vue2/chunks/index-ODod4Oj_.js +175 -0
  20. package/dist/vue2/chunks/index-ODod4Oj_.js.map +1 -0
  21. package/dist/vue2/chunks/index-anN_sx1F.js +169 -0
  22. package/dist/vue2/chunks/index-anN_sx1F.js.map +1 -0
  23. package/dist/vue2/common/emoji.cjs +40 -163
  24. package/dist/vue2/common/emoji.cjs.map +1 -1
  25. package/dist/vue2/common/emoji.js +3 -146
  26. package/dist/vue2/common/emoji.js.map +1 -1
  27. package/dist/vue2/dialtone-vue.cjs +2 -2
  28. package/dist/vue2/dialtone-vue.js +2 -2
  29. package/dist/vue2/dialtone-vue.js.map +1 -1
  30. package/dist/vue2/lib/contact-centers-row.cjs +1 -2
  31. package/dist/vue2/lib/contact-centers-row.cjs.map +1 -1
  32. package/dist/vue2/lib/contact-centers-row.js +1 -2
  33. package/dist/vue2/lib/contact-centers-row.js.map +1 -1
  34. package/dist/vue2/lib/contact-row.cjs +1 -2
  35. package/dist/vue2/lib/contact-row.cjs.map +1 -1
  36. package/dist/vue2/lib/contact-row.js +1 -2
  37. package/dist/vue2/lib/contact-row.js.map +1 -1
  38. package/dist/vue2/lib/editor.cjs +1 -2
  39. package/dist/vue2/lib/editor.cjs.map +1 -1
  40. package/dist/vue2/lib/editor.js +1 -2
  41. package/dist/vue2/lib/editor.js.map +1 -1
  42. package/dist/vue2/lib/emoji-row.cjs +1 -2
  43. package/dist/vue2/lib/emoji-row.cjs.map +1 -1
  44. package/dist/vue2/lib/emoji-row.js +1 -2
  45. package/dist/vue2/lib/emoji-row.js.map +1 -1
  46. package/dist/vue2/lib/emoji-text-wrapper.cjs +1 -2
  47. package/dist/vue2/lib/emoji-text-wrapper.cjs.map +1 -1
  48. package/dist/vue2/lib/emoji-text-wrapper.js +1 -2
  49. package/dist/vue2/lib/emoji-text-wrapper.js.map +1 -1
  50. package/dist/vue2/lib/emoji.cjs +1 -2
  51. package/dist/vue2/lib/emoji.cjs.map +1 -1
  52. package/dist/vue2/lib/emoji.js +1 -2
  53. package/dist/vue2/lib/emoji.js.map +1 -1
  54. package/dist/vue2/lib/general-row.cjs +3 -4
  55. package/dist/vue2/lib/general-row.cjs.map +1 -1
  56. package/dist/vue2/lib/general-row.js +3 -4
  57. package/dist/vue2/lib/general-row.js.map +1 -1
  58. package/dist/vue2/lib/group-row.cjs +1 -2
  59. package/dist/vue2/lib/group-row.cjs.map +1 -1
  60. package/dist/vue2/lib/group-row.js +1 -2
  61. package/dist/vue2/lib/group-row.js.map +1 -1
  62. package/dist/vue2/lib/message-input.cjs +1 -2
  63. package/dist/vue2/lib/message-input.cjs.map +1 -1
  64. package/dist/vue2/lib/message-input.js +1 -2
  65. package/dist/vue2/lib/message-input.js.map +1 -1
  66. package/dist/vue2/lib/rich-text-editor.cjs +11 -180
  67. package/dist/vue2/lib/rich-text-editor.cjs.map +1 -1
  68. package/dist/vue2/lib/rich-text-editor.js +11 -180
  69. package/dist/vue2/lib/rich-text-editor.js.map +1 -1
  70. package/dist/vue2/lib/tooltip.cjs +8 -7
  71. package/dist/vue2/lib/tooltip.cjs.map +1 -1
  72. package/dist/vue2/lib/tooltip.js +8 -7
  73. package/dist/vue2/lib/tooltip.js.map +1 -1
  74. package/dist/vue2/types/common/emoji/index.d.ts +3 -10
  75. package/dist/vue2/types/common/emoji/index.d.ts.map +1 -1
  76. package/dist/vue2/types/components/rich_text_editor/extensions/channels/channel.d.ts +0 -1
  77. package/dist/vue2/types/components/rich_text_editor/extensions/channels/channel.d.ts.map +1 -1
  78. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/emoji.d.ts.map +1 -1
  79. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts +0 -1
  80. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts.map +1 -1
  81. package/dist/vue2/types/components/rich_text_editor/extensions/mentions/mention.d.ts +0 -1
  82. package/dist/vue2/types/components/rich_text_editor/extensions/mentions/mention.d.ts.map +1 -1
  83. package/dist/vue2/types/components/rich_text_editor/mention_suggestion.d.ts +2 -2
  84. package/dist/vue2/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
  85. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +0 -10
  86. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  87. package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts +4 -2
  88. package/dist/vue2/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
  89. package/dist/vue2/types/recipes/leftbar/general_row/general_row_constants.d.ts +1 -1
  90. package/dist/vue3/chunks/index-GVD15GIB.js +175 -0
  91. package/dist/vue3/chunks/index-GVD15GIB.js.map +1 -0
  92. package/dist/vue3/chunks/index-lu2o2f4r.js +169 -0
  93. package/dist/vue3/chunks/index-lu2o2f4r.js.map +1 -0
  94. package/dist/vue3/common/emoji.cjs +40 -163
  95. package/dist/vue3/common/emoji.cjs.map +1 -1
  96. package/dist/vue3/common/emoji.js +3 -146
  97. package/dist/vue3/common/emoji.js.map +1 -1
  98. package/dist/vue3/dialtone-vue.cjs +2 -2
  99. package/dist/vue3/dialtone-vue.js +2 -2
  100. package/dist/vue3/dialtone-vue.js.map +1 -1
  101. package/dist/vue3/lib/contact-centers-row.cjs +1 -2
  102. package/dist/vue3/lib/contact-centers-row.cjs.map +1 -1
  103. package/dist/vue3/lib/contact-centers-row.js +1 -2
  104. package/dist/vue3/lib/contact-centers-row.js.map +1 -1
  105. package/dist/vue3/lib/contact-row.cjs +1 -2
  106. package/dist/vue3/lib/contact-row.cjs.map +1 -1
  107. package/dist/vue3/lib/contact-row.js +1 -2
  108. package/dist/vue3/lib/contact-row.js.map +1 -1
  109. package/dist/vue3/lib/editor.cjs +1 -2
  110. package/dist/vue3/lib/editor.cjs.map +1 -1
  111. package/dist/vue3/lib/editor.js +1 -2
  112. package/dist/vue3/lib/editor.js.map +1 -1
  113. package/dist/vue3/lib/emoji-row.cjs +1 -2
  114. package/dist/vue3/lib/emoji-row.cjs.map +1 -1
  115. package/dist/vue3/lib/emoji-row.js +1 -2
  116. package/dist/vue3/lib/emoji-row.js.map +1 -1
  117. package/dist/vue3/lib/emoji-text-wrapper.cjs +1 -2
  118. package/dist/vue3/lib/emoji-text-wrapper.cjs.map +1 -1
  119. package/dist/vue3/lib/emoji-text-wrapper.js +1 -2
  120. package/dist/vue3/lib/emoji-text-wrapper.js.map +1 -1
  121. package/dist/vue3/lib/emoji.cjs +1 -2
  122. package/dist/vue3/lib/emoji.cjs.map +1 -1
  123. package/dist/vue3/lib/emoji.js +1 -2
  124. package/dist/vue3/lib/emoji.js.map +1 -1
  125. package/dist/vue3/lib/general-row.cjs +3 -4
  126. package/dist/vue3/lib/general-row.cjs.map +1 -1
  127. package/dist/vue3/lib/general-row.js +3 -4
  128. package/dist/vue3/lib/general-row.js.map +1 -1
  129. package/dist/vue3/lib/group-row.cjs +1 -2
  130. package/dist/vue3/lib/group-row.cjs.map +1 -1
  131. package/dist/vue3/lib/group-row.js +1 -2
  132. package/dist/vue3/lib/group-row.js.map +1 -1
  133. package/dist/vue3/lib/message-input.cjs +1 -2
  134. package/dist/vue3/lib/message-input.cjs.map +1 -1
  135. package/dist/vue3/lib/message-input.js +1 -2
  136. package/dist/vue3/lib/message-input.js.map +1 -1
  137. package/dist/vue3/lib/rich-text-editor.cjs +11 -177
  138. package/dist/vue3/lib/rich-text-editor.cjs.map +1 -1
  139. package/dist/vue3/lib/rich-text-editor.js +11 -177
  140. package/dist/vue3/lib/rich-text-editor.js.map +1 -1
  141. package/dist/vue3/lib/tooltip.cjs +12 -15
  142. package/dist/vue3/lib/tooltip.cjs.map +1 -1
  143. package/dist/vue3/lib/tooltip.js +13 -16
  144. package/dist/vue3/lib/tooltip.js.map +1 -1
  145. package/dist/vue3/types/common/emoji/index.d.ts +1 -0
  146. package/dist/vue3/types/common/emoji/index.d.ts.map +1 -1
  147. package/dist/vue3/types/components/rich_text_editor/extensions/channels/channel.d.ts +0 -1
  148. package/dist/vue3/types/components/rich_text_editor/extensions/channels/channel.d.ts.map +1 -1
  149. package/dist/vue3/types/components/rich_text_editor/extensions/emoji/emoji.d.ts.map +1 -1
  150. package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts +0 -1
  151. package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts.map +1 -1
  152. package/dist/vue3/types/components/rich_text_editor/extensions/mentions/mention.d.ts +0 -1
  153. package/dist/vue3/types/components/rich_text_editor/extensions/mentions/mention.d.ts.map +1 -1
  154. package/dist/vue3/types/components/rich_text_editor/mention_suggestion.d.ts +2 -2
  155. package/dist/vue3/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
  156. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +0 -10
  157. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  158. package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts +3 -4
  159. package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
  160. package/dist/vue3/types/recipes/leftbar/general_row/general_row_constants.d.ts +1 -1
  161. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"message-input.js","sources":["../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div\n data-qa=\"dt-message-input\"\n role=\"presentation\"\n :class=\"['d-d-flex', 'd-fd-column', 'd-bar8', 'd-baw1', 'd-ba', 'd-c-text',\n { 'd-bc-bold d-bs-sm': hasFocus, 'd-bc-default': !hasFocus }]\"\n @click=\"$refs.richTextEditor?.focusEditor()\"\n @drag-enter=\"onDrag\"\n @drag-over=\"onDrag\"\n @drop=\"onDrop\"\n @keydown.enter.exact=\"onSend\"\n @paste=\"onPaste\"\n >\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n class=\"d-of-auto d-mx16 d-mt8 d-mb4\"\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=\"link\"\n :placeholder=\"placeholder\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :allow-blockquote=\"allowBlockquote\"\n :allow-bold=\"allowBold\"\n :allow-bullet-list=\"allowBulletList\"\n :allow-codeblock=\"allowCodeblock\"\n :allow-italic=\"allowItalic\"\n :allow-strike=\"allowStrike\"\n :allow-underline=\"allowUnderline\"\n v-bind=\"$attrs\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @input=\"onInput($event)\"\n @selected-command=\"onSelectedCommand\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-d-flex d-jc-space-between d-mx8 d-my4\">\n <!-- Left content -->\n <div class=\"d-d-flex\">\n <dt-tooltip\n v-if=\"showImagePicker\"\n placement=\"top-start\"\n :message=\"showImagePicker.tooltipLabel\"\n :offset=\"[-4, 12]\"\n >\n <template #anchor>\n <dt-button\n data-qa=\"dt-message-input-image-btn\"\n size=\"sm\"\n circle\n :kind=\"imagePickerFocus ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\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\n name=\"image\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-ps-absolute\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n </template>\n </dt-tooltip>\n <dt-popover\n v-if=\"showEmojiPicker\"\n data-qa=\"dt-message-input-emoji-picker-popover\"\n :open.sync=\"emojiPickerOpened\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-message-input-emoji-picker-btn\"\n size=\"sm\"\n circle\n :kind=\"emojiPickerHovered ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\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\n :name=\"!emojiPickerHovered ? 'satisfied' : 'very-satisfied'\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template\n #content=\"{ close }\"\n >\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => { close(); onSelectEmoji(emoji); }\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </div>\n <!-- Right content -->\n <div class=\"d-d-flex\">\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"dt-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-fc-error d-mr16 dt-message-input--remaining-char\"\n data-qa=\"dt-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 data-qa=\"dt-message-input-cancel-button\"\n class=\"dt-message-input--cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- Send button -->\n <dt-tooltip\n v-if=\"showSend\"\n placement=\"top-end\"\n :enabled=\"!showSend\"\n :message=\"showSend.tooltipLabel\"\n :show=\"!isSendDisabled && sendButtonFocus\"\n :offset=\"[6, 8]\"\n >\n <template #anchor>\n <!-- Right positioned UI - send button -->\n <dt-button\n data-qa=\"dt-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n {\n 'message-input-button__disabled d-fc-muted': isSendDisabled,\n 'd-btn--circle': showSend.icon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n @mouseenter=\"sendButtonFocus = true\"\n @mouseleave=\"sendButtonFocus = false\"\n @focus=\"sendButtonFocus = true\"\n @blur=\"sendButtonFocus = false\"\n >\n <template\n v-if=\"showSend.icon\"\n #icon\n >\n <dt-icon\n :name=\"showSend.icon\"\n size=\"300\"\n />\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\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 { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtIcon,\n DtInput,\n DtPopover,\n DtRichTextEditor,\n DtTooltip,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\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 * 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: 'text',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Enables the Link extension and optionally passes configurations to it\n */\n link: {\n type: [Boolean, Object],\n default: true,\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 validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\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: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({ icon: 'send' }),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\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 * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\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 * Native focus event\n * @event input\n * @type {String|JSON}\n */\n 'focus',\n\n /**\n * Native blur event\n * @event input\n * @type {String|JSON}\n */\n 'blur',\n\n /**\n * Native input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\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 data () {\n return {\n internalInputValue: this.value, // internal input content\n hasFocus: false,\n imagePickerFocus: false,\n emojiPickerFocus: false,\n sendButtonFocus: false,\n emojiPickerOpened: false,\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.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 computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\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 methods: {\n onDrag (e) {\n e.stopPropagation();\n e.preventDefault();\n },\n\n onDrop (e) {\n e.stopPropagation();\n e.preventDefault();\n\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) {\n if (!emoji) {\n return;\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 },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectedCommand (command) {\n this.$emit('selected-command', command);\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 onFocus (event) {\n this.hasFocus = true;\n this.$refs.richTextEditor?.focusEditor();\n this.$emit('focus', event);\n },\n\n onBlur (event) {\n this.hasFocus = false;\n this.$emit('blur', event);\n },\n\n onInput (event) {\n this.$emit('input', event);\n this.$emit('update:value', event);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input--remaining-char-tooltip {\n margin-top: auto;\n margin-bottom: auto;\n}\n.dt-message-input--remaining-char {\n font-size: 1.2rem;\n}\n\n.message-input-button__disabled {\n background-color: unset;\n color: var(--theme-sidebar-icon-color);\n cursor: default;\n}\n\n.dt-message-input--cancel-button {\n margin-right: var(--dt-space-300);\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6OA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA,WAAA;AAAA,MACA,MAAA,CAAA,SAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,WAAA;AACA,YAAA,OAAA,cAA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AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,UAAA,KAAA,gBAAA;AACA;AAAA,MACA;AACA,WAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;;AACA,WAAA,WAAA;AACA,iBAAA,MAAA,mBAAA,mBAAA;AACA,WAAA,MAAA,SAAA,KAAA;AAAA,IACA;AAAA,IAEA,OAAA,OAAA;AACA,WAAA,WAAA;AACA,WAAA,MAAA,QAAA,KAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;AACA,WAAA,MAAA,SAAA,KAAA;AACA,WAAA,MAAA,gBAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"message-input.js","sources":["../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div\n data-qa=\"dt-message-input\"\n role=\"presentation\"\n :class=\"['d-d-flex', 'd-fd-column', 'd-bar8', 'd-baw1', 'd-ba', 'd-c-text',\n { 'd-bc-bold d-bs-sm': hasFocus, 'd-bc-default': !hasFocus }]\"\n @click=\"$refs.richTextEditor?.focusEditor()\"\n @drag-enter=\"onDrag\"\n @drag-over=\"onDrag\"\n @drop=\"onDrop\"\n @keydown.enter.exact=\"onSend\"\n @paste=\"onPaste\"\n >\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n class=\"d-of-auto d-mx16 d-mt8 d-mb4\"\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=\"link\"\n :placeholder=\"placeholder\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :allow-blockquote=\"allowBlockquote\"\n :allow-bold=\"allowBold\"\n :allow-bullet-list=\"allowBulletList\"\n :allow-codeblock=\"allowCodeblock\"\n :allow-italic=\"allowItalic\"\n :allow-strike=\"allowStrike\"\n :allow-underline=\"allowUnderline\"\n v-bind=\"$attrs\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @input=\"onInput($event)\"\n @selected-command=\"onSelectedCommand\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-d-flex d-jc-space-between d-mx8 d-my4\">\n <!-- Left content -->\n <div class=\"d-d-flex\">\n <dt-tooltip\n v-if=\"showImagePicker\"\n placement=\"top-start\"\n :message=\"showImagePicker.tooltipLabel\"\n :offset=\"[-4, 12]\"\n >\n <template #anchor>\n <dt-button\n data-qa=\"dt-message-input-image-btn\"\n size=\"sm\"\n circle\n :kind=\"imagePickerFocus ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\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\n name=\"image\"\n size=\"300\"\n />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-ps-absolute\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n </template>\n </dt-tooltip>\n <dt-popover\n v-if=\"showEmojiPicker\"\n data-qa=\"dt-message-input-emoji-picker-popover\"\n :open.sync=\"emojiPickerOpened\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-message-input-emoji-picker-btn\"\n size=\"sm\"\n circle\n :kind=\"emojiPickerHovered ? 'default' : 'muted'\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\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\n :name=\"!emojiPickerHovered ? 'satisfied' : 'very-satisfied'\"\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template\n #content=\"{ close }\"\n >\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => { close(); onSelectEmoji(emoji); }\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n </div>\n <!-- Right content -->\n <div class=\"d-d-flex\">\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"dt-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-fc-error d-mr16 dt-message-input--remaining-char\"\n data-qa=\"dt-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 data-qa=\"dt-message-input-cancel-button\"\n class=\"dt-message-input--cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- Send button -->\n <dt-tooltip\n v-if=\"showSend\"\n placement=\"top-end\"\n :enabled=\"!showSend\"\n :message=\"showSend.tooltipLabel\"\n :show=\"!isSendDisabled && sendButtonFocus\"\n :offset=\"[6, 8]\"\n >\n <template #anchor>\n <!-- Right positioned UI - send button -->\n <dt-button\n data-qa=\"dt-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n {\n 'message-input-button__disabled d-fc-muted': isSendDisabled,\n 'd-btn--circle': showSend.icon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n @mouseenter=\"sendButtonFocus = true\"\n @mouseleave=\"sendButtonFocus = false\"\n @focus=\"sendButtonFocus = true\"\n @blur=\"sendButtonFocus = false\"\n >\n <template\n v-if=\"showSend.icon\"\n #icon\n >\n <dt-icon\n :name=\"showSend.icon\"\n size=\"300\"\n />\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\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 { DtButton } from '@/components/button';\nimport { DtIcon } from '@/components/icon';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtIcon,\n DtInput,\n DtPopover,\n DtRichTextEditor,\n DtTooltip,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\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 * 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: 'text',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Enables the Link extension and optionally passes configurations to it\n */\n link: {\n type: [Boolean, Object],\n default: true,\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 validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\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: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({ icon: 'send' }),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\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 * Whether the input allows for block quote.\n */\n allowBlockquote: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bold to be introduced in the text.\n */\n allowBold: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for bullet list to be introduced in the text.\n */\n allowBulletList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for italic to be introduced in the text.\n */\n allowItalic: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for strike to be introduced in the text.\n */\n allowStrike: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows for underline to be introduced in the text.\n */\n allowUnderline: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Whether the input allows codeblock to be introduced in the text.\n */\n allowCodeblock: {\n type: Boolean,\n default: true,\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 * Native focus event\n * @event input\n * @type {String|JSON}\n */\n 'focus',\n\n /**\n * Native blur event\n * @event input\n * @type {String|JSON}\n */\n 'blur',\n\n /**\n * Native input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\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 data () {\n return {\n internalInputValue: this.value, // internal input content\n hasFocus: false,\n imagePickerFocus: false,\n emojiPickerFocus: false,\n sendButtonFocus: false,\n emojiPickerOpened: false,\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.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 computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\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 methods: {\n onDrag (e) {\n e.stopPropagation();\n e.preventDefault();\n },\n\n onDrop (e) {\n e.stopPropagation();\n e.preventDefault();\n\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) {\n if (!emoji) {\n return;\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 },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectedCommand (command) {\n this.$emit('selected-command', command);\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 onFocus (event) {\n this.hasFocus = true;\n this.$refs.richTextEditor?.focusEditor();\n this.$emit('focus', event);\n },\n\n onBlur (event) {\n this.hasFocus = false;\n this.$emit('blur', event);\n },\n\n onInput (event) {\n this.$emit('input', event);\n this.$emit('update:value', event);\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-message-input--remaining-char-tooltip {\n margin-top: auto;\n margin-bottom: auto;\n}\n.dt-message-input--remaining-char {\n font-size: 1.2rem;\n}\n\n.message-input-button__disabled {\n background-color: unset;\n color: var(--theme-sidebar-icon-color);\n cursor: default;\n}\n\n.dt-message-input--cancel-button {\n margin-right: var(--dt-space-300);\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6OA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,QAAA,CAAA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA,CAAA,QAAA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MAC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AAA,OAAA;AACA;AAAA,MACA;AAGA,WAAA,MAAA,eAAA,OAAA,SAAA,cAAA;AAAA,QACA,MAAA;AAAA,QACA,OAAA;AAAA,UACA,MAAA,MAAA;AAAA,QACA;AAAA,MACA,CAAA;AACA,WAAA,MAAA,kBAAA,KAAA;AAAA,IACA;AAAA,IAEA,kBAAA,SAAA;AACA,WAAA,MAAA,oBAAA,OAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,MAAA,wBAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,MAAA,gBAAA,KAAA,MAAA,wBAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,UAAA,KAAA,gBAAA;AACA;AAAA,MACA;AACA,WAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;;AACA,WAAA,WAAA;AACA,iBAAA,MAAA,mBAAA,mBAAA;AACA,WAAA,MAAA,SAAA,KAAA;AAAA,IACA;AAAA,IAEA,OAAA,OAAA;AACA,WAAA,WAAA;AACA,WAAA,MAAA,QAAA,KAAA;AAAA,IACA;AAAA,IAEA,QAAA,OAAA;AACA,WAAA,MAAA,SAAA,KAAA;AACA,WAAA,MAAA,gBAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -20,7 +20,7 @@ const TextAlign = require("@tiptap/extension-text-align");
20
20
  const core = require("@tiptap/core");
21
21
  const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
22
22
  const lib_emoji = require("./emoji.cjs");
23
- const common_emoji = require("../common/emoji.cjs");
23
+ const common_emoji = require("../chunks/index-anN_sx1F.js");
24
24
  const state = require("@tiptap/pm/state");
25
25
  const Suggestion = require("@tiptap/suggestion");
26
26
  const dialtoneEmojis = require("@dialpad/dialtone-emojis");
@@ -33,7 +33,6 @@ const lib_link = require("./link.cjs");
33
33
  const lib_avatar = require("./avatar.cjs");
34
34
  const DtIconHash = require("@dialpad/dialtone-icons/vue2/hash");
35
35
  const DtIconLock = require("@dialpad/dialtone-icons/vue2/lock");
36
- const emojiRegex = require("emoji-regex");
37
36
  require("./skeleton.cjs");
38
37
  require("../chunks/icon_constants-QYpmdE0R.js");
39
38
  require("@dialpad/dialtone-icons/icons.json");
@@ -230,7 +229,7 @@ const suggestionOptions = {
230
229
  return false;
231
230
  });
232
231
  return filteredEmoji.map((item) => {
233
- return { id: item.unicode_character, code: item.shortname };
232
+ return { code: item.shortname };
234
233
  });
235
234
  },
236
235
  command: ({ editor, range, props }) => {
@@ -277,7 +276,6 @@ const suggestionOptions = {
277
276
  interactive: true,
278
277
  trigger: "manual",
279
278
  placement: "top-start",
280
- contentElement: null,
281
279
  zIndex: 650
282
280
  });
283
281
  },
@@ -307,8 +305,7 @@ const suggestionOptions = {
307
305
  };
308
306
  const EmojiPluginKey = new state.PluginKey("emoji");
309
307
  const inputShortCodeRegex = new RegExp("(^| |(?<=:))(:\\w+:)$");
310
- const inputUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/;
311
- const pasteUnicodeRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
308
+ const inputUnicodeRegex = new RegExp(common_emoji.emojiPattern + "$");
312
309
  const inputRuleMatch = (match) => {
313
310
  if (match && common_emoji.codeToEmojiData(match[0])) {
314
311
  const text = match[2] || match[0];
@@ -348,9 +345,6 @@ const Emoji = core.Node.create({
348
345
  return {
349
346
  code: {
350
347
  default: null
351
- },
352
- id: {
353
- default: null
354
348
  }
355
349
  };
356
350
  },
@@ -393,11 +387,9 @@ const Emoji = core.Node.create({
393
387
  },
394
388
  type: this.type,
395
389
  getAttributes(attrs) {
396
- const unicode = common_emoji.codeToEmojiData(attrs[0]).unicode_output;
397
- const emoji = String.fromCodePoint(parseInt(unicode, 16));
390
+ const emoji = common_emoji.codeToEmojiData(attrs[0]).shortname;
398
391
  return {
399
- code: emoji,
400
- label: "emoji"
392
+ code: emoji
401
393
  };
402
394
  }
403
395
  })
@@ -415,7 +407,7 @@ const Emoji = core.Node.create({
415
407
  }
416
408
  }),
417
409
  core.nodePasteRule({
418
- find: pasteUnicodeRegex,
410
+ find: common_emoji.emojiRegex,
419
411
  type: this.type,
420
412
  getAttributes(attrs) {
421
413
  return {
@@ -625,34 +617,7 @@ var __component__$6 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
625
617
  null
626
618
  );
627
619
  const MentionComponent = __component__$6.exports;
628
- const mentionRegex = /@([\w.-]+)[^\w.-]?/g;
629
- const mentionPasteMatch = (text, suggestions) => {
630
- const matches = [...text.matchAll(mentionRegex)];
631
- return matches.filter((match) => suggestions.some(({ id }) => id === match[1].trim())).map((match) => {
632
- let mention = match[1];
633
- if (!mention.endsWith(" "))
634
- mention += " ";
635
- return {
636
- index: match.index,
637
- text: mention,
638
- match
639
- };
640
- });
641
- };
642
- const mentionInputMatch = (text, suggestions) => {
643
- const match = text.match(/@([\w.-]+)[^\w.-]$/);
644
- if (!match || !suggestions.some(({ id }) => id === match[1]))
645
- return;
646
- return {
647
- index: match.index,
648
- text: match[0],
649
- match
650
- };
651
- };
652
620
  const MentionPlugin = Mention.extend({
653
- name: "mention",
654
- group: "inline",
655
- inline: true,
656
621
  addNodeView() {
657
622
  return vue2.VueNodeViewRenderer(MentionComponent);
658
623
  },
@@ -680,33 +645,7 @@ const MentionPlugin = Mention.extend({
680
645
  return `@${node.attrs.id}`;
681
646
  },
682
647
  renderHTML({ HTMLAttributes }) {
683
- return ["mention-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
684
- },
685
- addInputRules() {
686
- var _a;
687
- const suggestions = (_a = this.options.suggestion) == null ? void 0 : _a.items({ query: "" });
688
- return [
689
- core.nodeInputRule({
690
- find: (text) => mentionInputMatch(text, suggestions),
691
- type: this.type,
692
- getAttributes(attrs) {
693
- return suggestions.find(({ id }) => id === attrs[0].replace("@", "").trim());
694
- }
695
- })
696
- ];
697
- },
698
- addPasteRules() {
699
- var _a;
700
- const suggestions = (_a = this.options.suggestion) == null ? void 0 : _a.items({ query: "" });
701
- return [
702
- core.nodePasteRule({
703
- find: (text) => mentionPasteMatch(text, suggestions),
704
- type: this.type,
705
- getAttributes(attrs) {
706
- return suggestions.find(({ id }) => id === attrs[0].trim());
707
- }
708
- })
709
- ];
648
+ return ["mention-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
710
649
  }
711
650
  }).configure({
712
651
  suggestion: {
@@ -743,34 +682,8 @@ var __component__$5 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
743
682
  null
744
683
  );
745
684
  const ChannelComponent = __component__$5.exports;
746
- const channelRegex = /#([\w-]+)[^\w-]?/g;
747
- const channelPasteMatch = (text, suggestions) => {
748
- const matches = [...text.matchAll(channelRegex)];
749
- return matches.filter((match) => suggestions.some(({ id }) => id === match[1].trim())).map((match) => {
750
- let channel = match[1];
751
- if (!channel.endsWith(" "))
752
- channel += " ";
753
- return {
754
- index: match.index,
755
- text: channel,
756
- match
757
- };
758
- });
759
- };
760
- const channelInputMatch = (text, suggestions) => {
761
- const match = text.match(/#([\w-]+)[^\w-]$/);
762
- if (!match || !suggestions.some(({ id }) => id === match[1]))
763
- return;
764
- return {
765
- index: match.index,
766
- text: match[0],
767
- match
768
- };
769
- };
770
685
  const ChannelPlugin = Mention.extend({
771
686
  name: "channel",
772
- group: "inline",
773
- inline: true,
774
687
  addNodeView() {
775
688
  return vue2.VueNodeViewRenderer(ChannelComponent);
776
689
  },
@@ -798,33 +711,7 @@ const ChannelPlugin = Mention.extend({
798
711
  return `#${node.attrs.id}`;
799
712
  },
800
713
  renderHTML({ HTMLAttributes }) {
801
- return ["channel-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];
802
- },
803
- addInputRules() {
804
- var _a;
805
- const suggestions = (_a = this.options.suggestion) == null ? void 0 : _a.items({ query: "" });
806
- return [
807
- core.nodeInputRule({
808
- find: (text) => channelInputMatch(text, suggestions),
809
- type: this.type,
810
- getAttributes(attrs) {
811
- return suggestions.find(({ id }) => id === attrs[0].replace("#", "").trim());
812
- }
813
- })
814
- ];
815
- },
816
- addPasteRules() {
817
- var _a;
818
- const suggestions = (_a = this.options.suggestion) == null ? void 0 : _a.items({ query: "" });
819
- return [
820
- core.nodePasteRule({
821
- find: (text) => channelPasteMatch(text, suggestions),
822
- type: this.type,
823
- getAttributes(attrs) {
824
- return suggestions.find(({ id }) => id === attrs[0].trim());
825
- }
826
- })
827
- ];
714
+ return ["channel-component", core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
828
715
  }
829
716
  }).configure({
830
717
  suggestion: {
@@ -1309,7 +1196,7 @@ const _sfc_main = {
1309
1196
  */
1310
1197
  outputFormat: {
1311
1198
  type: String,
1312
- default: "text",
1199
+ default: "html",
1313
1200
  validator(outputFormat) {
1314
1201
  return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);
1315
1202
  }
@@ -1609,8 +1496,7 @@ const _sfc_main = {
1609
1496
  if (newValue === currentValue) {
1610
1497
  return;
1611
1498
  }
1612
- this.internalValue = newValue;
1613
- this.insertContent();
1499
+ this.editor.commands.setContent(newValue, false);
1614
1500
  }
1615
1501
  },
1616
1502
  created() {
@@ -1626,6 +1512,7 @@ const _sfc_main = {
1626
1512
  createEditor() {
1627
1513
  this.editor = new vue2.Editor({
1628
1514
  autofocus: this.autoFocus,
1515
+ content: this.value,
1629
1516
  editable: this.editable,
1630
1517
  extensions: this.extensions,
1631
1518
  editorProps: {
@@ -1635,64 +1522,8 @@ const _sfc_main = {
1635
1522
  }
1636
1523
  }
1637
1524
  });
1638
- this.insertContent();
1639
1525
  this.addEditorListeners();
1640
1526
  },
1641
- /**
1642
- * This function is necessary as tiptap doesn't render the content passed
1643
- * directly through `editor.commands.setContent` the content passed down to it
1644
- * should be already parsed. So We're parsing the elements into it's corresponding
1645
- * HTML version before setting it.
1646
- */
1647
- insertContent() {
1648
- this.parseMentions();
1649
- this.parseChannels();
1650
- this.parseEmojis();
1651
- this.editor.commands.setContent(this.internalValue, true);
1652
- },
1653
- parseEmojis() {
1654
- const matches = new Set(
1655
- [...this.value.matchAll(emojiRegex()), ...this.value.matchAll(common_emoji.emojiShortCodeRegex)].map((match) => match[0].trim())
1656
- );
1657
- if (!matches)
1658
- return;
1659
- matches.forEach((match) => {
1660
- const emoji = common_emoji.codeToEmojiData(match);
1661
- if (!emoji)
1662
- return;
1663
- this.internalValue = this.internalValue.replace(new RegExp(`${match}`, "g"), `<emoji-component code="${emoji.shortname}"></emoji-component>`);
1664
- });
1665
- },
1666
- parseChannels() {
1667
- if (!this.channelSuggestion)
1668
- return;
1669
- const suggestions = this.channelSuggestion.items({ query: "" });
1670
- const matches = [...this.value.matchAll(channelRegex)].filter((match) => suggestions.some(({ id }) => id === match[1]));
1671
- if (!matches)
1672
- return;
1673
- matches.forEach((match) => {
1674
- const channel = suggestions.find(({ id }) => id === match[1]);
1675
- this.internalValue = this.internalValue.replace(
1676
- `#${match[1]}`,
1677
- /** The space at the beginning is important as tiptap removes that while rendering.
1678
- * So if multiple mentions, channels or emojis are next to each other it will fail
1679
- */
1680
- ` <channel-component name="${channel.name}" id="${channel.id}"></channel-component>`
1681
- );
1682
- });
1683
- },
1684
- parseMentions() {
1685
- if (!this.mentionSuggestion)
1686
- return;
1687
- const suggestions = this.mentionSuggestion.items({ query: "" });
1688
- const matches = [...this.value.matchAll(mentionRegex)].filter((match) => suggestions.some(({ id }) => id === match[1]));
1689
- if (!matches)
1690
- return;
1691
- matches.forEach((match) => {
1692
- const mention = suggestions.find(({ id }) => id === match[1]);
1693
- this.internalValue = this.internalValue.replace(`@${match[1]}`, ` <mention-component name="${mention.name}" id="${mention.id}"></mention-component>`);
1694
- });
1695
- },
1696
1527
  destroyEditor() {
1697
1528
  this.editor.destroy();
1698
1529
  },