@dialpad/dialtone 9.102.2 → 9.104.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/css/dialtone-default-theme.css +41 -0
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +41 -0
- package/dist/css/dialtone.min.css +1 -1
- package/dist/tokens/doc.json +9832 -9832
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs +8 -0
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js +8 -0
- package/dist/vue2/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue2/dialtone-vue.cjs +2 -0
- package/dist/vue2/dialtone-vue.cjs.map +1 -1
- package/dist/vue2/dialtone-vue.js +42 -40
- package/dist/vue2/dialtone-vue.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown.cjs +5 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.cjs.map +1 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.js +5 -0
- package/dist/vue2/lib/callbar-button-with-dropdown.js.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs +9 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js +9 -1
- package/dist/vue2/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +258 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +258 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -0
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +9 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +9 -1
- package/dist/vue2/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js +1 -1
- package/dist/vue2/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/index.d.ts +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +9 -0
- package/dist/vue2/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +167 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts +2 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts.map +1 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +9 -0
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/common/utils.cjs +1 -1
- package/dist/vue3/common/utils.cjs.map +1 -1
- package/dist/vue3/common/utils.js +1 -1
- package/dist/vue3/common/utils.js.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs +8 -0
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.cjs.map +1 -1
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js +8 -0
- package/dist/vue3/components/rich_text_editor/rich_text_editor.vue.js.map +1 -1
- package/dist/vue3/dialtone-vue.cjs +2 -0
- package/dist/vue3/dialtone-vue.cjs.map +1 -1
- package/dist/vue3/dialtone-vue.js +42 -40
- package/dist/vue3/dialtone-vue.js.map +1 -1
- package/dist/vue3/lib/callbar-button-with-dropdown.cjs +5 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.cjs.map +1 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.js +5 -0
- package/dist/vue3/lib/callbar-button-with-dropdown.js.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs +10 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js +10 -1
- package/dist/vue3/recipes/buttons/callbar_button/callbar_button.vue.js.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs +321 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js +321 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js.map +1 -0
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs +10 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs.map +1 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js +10 -1
- package/dist/vue3/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs +2 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.cjs.map +1 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js +2 -1
- package/dist/vue3/recipes/conversation_view/message_input/message_input.vue.js.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/index.d.ts +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +9 -0
- package/dist/vue3/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +180 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts +2 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/index.d.ts.map +1 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +9 -0
- package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -544,6 +544,14 @@ ${node.textContent}
|
|
|
544
544
|
...this.inputAttrs,
|
|
545
545
|
class: this.inputClass
|
|
546
546
|
},
|
|
547
|
+
handlePaste: (_, event) => {
|
|
548
|
+
if (!this.link && !this.customLink) {
|
|
549
|
+
const pastedContent = event.clipboardData.getData("text");
|
|
550
|
+
this.editor.chain().focus().insertContent(pastedContent).run();
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
return false;
|
|
554
|
+
},
|
|
547
555
|
// Moves the <br /> tags inside the previous closing tag to avoid
|
|
548
556
|
// Prosemirror wrapping them within another </p> tag.
|
|
549
557
|
transformPastedHTML(html) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text_editor.vue.cjs","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<!-- eslint-disable vue/no-bare-strings-in-template -->\n<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <!-- why the hell is this visibility: hidden by default??? -->\n <bubble-menu\n v-if=\"editor && link && !hideLinkBubbleMenu\"\n :editor=\"editor\"\n :should-show=\"bubbleMenuShouldShow\"\n :tippy-options=\"tippyOptions\"\n style=\"visibility: visible;\"\n >\n <div class=\"d-popover__dialog\">\n <dt-stack\n direction=\"row\"\n class=\"d-rich-text-editor-bubble-menu__button-stack\"\n gap=\"0\"\n >\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"editLink\"\n >\n Edit\n </dt-button>\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"openLink\"\n >\n Open link\n </dt-button>\n <dt-button\n kind=\"danger\"\n importance=\"clear\"\n @click=\"removeLink\"\n >\n Remove\n </dt-button>\n </dt-stack>\n </div>\n </bubble-menu>\n <editor-content\n ref=\"editor\"\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport { DtButton } from '../button';\nimport { DtStack } from '../stack';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Code from '@tiptap/extension-code';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n BubbleMenu,\n DtButton,\n DtStack,\n },\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 inline code (wrapped in backticks).\n */\n allowCode: {\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.\n * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You\n * are showing a custom link editor popup.\n */\n hideLinkBubbleMenu: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Input event always in JSON format.\n * @event input\n * @type {JSON}\n */\n 'json-input',\n\n /**\n * Input event always in HTML format.\n * @event input\n * @type {HTML}\n */\n 'html-input',\n\n /**\n * Input event always in text format.\n * @event input\n * @type {String}\n */\n 'text-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 * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n\n /**\n * \"Edit link\" button was clicked. Fires an event for the consuming component to handle the editing of the link.\n * event contains the link object with two properties href and text.\n * @event edit-link\n * @type {Object}\n */\n 'edit-link',\n\n /**\n * \"Selected\" event is fired when the user selects text in the editor. returns the currently selected text.\n * If the selected text is partially a link, the full link text is returned.\n * @event selected\n * @type {String}\n */\n 'selected',\n ],\n\n data () {\n return {\n editor: null,\n tippyOptions: {\n appendTo: () => this.$refs.editor.$el.getRootNode()?.querySelector('body'),\n placement: 'top-start',\n },\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem.extend({\n renderText ({ node }) {\n return node.textContent;\n },\n }));\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n openOnClick: false,\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCode) {\n extensions.push(Code);\n }\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.extend({\n renderText ({ node }) {\n return `\\`\\`\\`\\n${node.textContent}\\n\\`\\`\\``;\n },\n }).configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n bubbleMenuShouldShow ({ editor, view, state, oldState, from, to }) {\n return editor.isActive('link');\n },\n\n /**\n * If the selection contains a link, return the existing link text.\n * Otherwise, use just the selected text.\n * @param editor the editor instance.\n */\n getSelectedLinkText (editor) {\n const { view, state } = editor;\n const { from, to } = view.state.selection;\n const text = state.doc.textBetween(from, to, '');\n const linkNode = this.editor.state.doc.nodeAt(from);\n if (linkNode && linkNode.marks?.at(0)?.type?.name === 'link') {\n return linkNode.textContent;\n } else {\n return text;\n }\n },\n\n editLink () {\n const linkText = this.getSelectedLinkText(this.editor);\n\n const link = {\n href: this.editor.getAttributes('link').href,\n text: linkText,\n };\n this.$emit('edit-link', link);\n },\n\n removeLink () {\n this.editor?.chain()?.focus()?.unsetLink()?.run();\n },\n\n openLink () {\n this.editor?.chain()?.focus();\n const link = this.editor.getAttributes('link').href;\n window.open(link, '_blank');\n },\n\n // eslint-disable-next-line complexity\n setLink (linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n defaultPrefix) {\n if (!linkInput) {\n // If link text is set to empty string,\n // remove any existing links.\n this.removeLink();\n return;\n }\n\n // Check if input matches any of the supported link formats\n const prefix = linkProtocols.find(prefixRegex => prefixRegex.test(linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n linkInput = `${defaultPrefix}${linkInput}`;\n }\n\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .run();\n\n const selection = this.editor?.view?.state?.selection;\n\n this.editor\n .chain()\n .focus()\n .insertContent(linkText)\n .setTextSelection({ from: selection.from, to: selection.from + linkText.length })\n .setLink({ href: linkInput, class: linkOptions.class })\n .run();\n },\n\n // eslint-disable-next-line complexity\n processValue (newValue, returnIfEqual = true) {\n const currentValue = this.getOutput();\n\n if (returnIfEqual && deepEqual(newValue, currentValue)) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n // If the text contains emoji characters convert them to emoji component tags\n if (typeof newValue === 'string' && this.outputFormat === 'text') {\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n newValue = newValue?.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n }\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n triggerInputChangeEvents () {\n const value = this.getOutput();\n this.$emit('input', value);\n this.$emit('update:value', value);\n\n // Always output JSON in a separate event\n const jsonValue = this.editor.getJSON();\n this.$emit('json-input', jsonValue);\n\n // Always output HTML in a separate event\n const htmlValue = this.editor.getHTML();\n this.$emit('html-input', htmlValue);\n\n // Always output HTML in a separate event\n const textValue = this.editor.getText({ blockSeparator: '\\n' });\n this.$emit('text-input', textValue);\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n this.editor.on('create', () => {\n this.triggerInputChangeEvents();\n });\n // The content has changed.\n this.editor.on('update', () => {\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.triggerInputChangeEvents();\n });\n\n this.editor.on('selectionUpdate', ({ editor }) => {\n this.$emit('selected', this.getSelectedLinkText(editor));\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":["EditorContent","BubbleMenu","DtButton","DtStack","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","Extension","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","ConfigurableImage","warnIfUnmounted","Editor","emojiPattern"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAA,KAAA;AAAA,IACA,YAAAC,KAAA;AAAA,IACA,UAAAC,OAAA;AAAA,IACA,SAAAC,MAAA;AAAA,EACA;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,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA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WAAA,OAAA,GAAA,QAAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,cAAA,KAAA,cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA,QAAA,EAAA,gBAAA,KAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA;AAAA,QACA,aAAA;AAAA,UACA,YAAA;AAAA,YACA,GAAA,KAAA;AAAA,YACA,OAAA,KAAA;AAAA,YACA,GAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich_text_editor.vue.cjs","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<!-- eslint-disable vue/no-bare-strings-in-template -->\n<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <!-- why the hell is this visibility: hidden by default??? -->\n <bubble-menu\n v-if=\"editor && link && !hideLinkBubbleMenu\"\n :editor=\"editor\"\n :should-show=\"bubbleMenuShouldShow\"\n :tippy-options=\"tippyOptions\"\n style=\"visibility: visible;\"\n >\n <div class=\"d-popover__dialog\">\n <dt-stack\n direction=\"row\"\n class=\"d-rich-text-editor-bubble-menu__button-stack\"\n gap=\"0\"\n >\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"editLink\"\n >\n Edit\n </dt-button>\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"openLink\"\n >\n Open link\n </dt-button>\n <dt-button\n kind=\"danger\"\n importance=\"clear\"\n @click=\"removeLink\"\n >\n Remove\n </dt-button>\n </dt-stack>\n </div>\n </bubble-menu>\n <editor-content\n ref=\"editor\"\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport { DtButton } from '../button';\nimport { DtStack } from '../stack';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Code from '@tiptap/extension-code';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n BubbleMenu,\n DtButton,\n DtStack,\n },\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 inline code (wrapped in backticks).\n */\n allowCode: {\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.\n * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You\n * are showing a custom link editor popup.\n */\n hideLinkBubbleMenu: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Input event always in JSON format.\n * @event input\n * @type {JSON}\n */\n 'json-input',\n\n /**\n * Input event always in HTML format.\n * @event input\n * @type {HTML}\n */\n 'html-input',\n\n /**\n * Input event always in text format.\n * @event input\n * @type {String}\n */\n 'text-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 * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n\n /**\n * \"Edit link\" button was clicked. Fires an event for the consuming component to handle the editing of the link.\n * event contains the link object with two properties href and text.\n * @event edit-link\n * @type {Object}\n */\n 'edit-link',\n\n /**\n * \"Selected\" event is fired when the user selects text in the editor. returns the currently selected text.\n * If the selected text is partially a link, the full link text is returned.\n * @event selected\n * @type {String}\n */\n 'selected',\n ],\n\n data () {\n return {\n editor: null,\n tippyOptions: {\n appendTo: () => this.$refs.editor.$el.getRootNode()?.querySelector('body'),\n placement: 'top-start',\n },\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem.extend({\n renderText ({ node }) {\n return node.textContent;\n },\n }));\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n openOnClick: false,\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCode) {\n extensions.push(Code);\n }\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.extend({\n renderText ({ node }) {\n return `\\`\\`\\`\\n${node.textContent}\\n\\`\\`\\``;\n },\n }).configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n handlePaste: (_, event) => {\n // When having link and customLink props we should maintain default paste behavior\n if (!this.link && !this.customLink) {\n const pastedContent = event.clipboardData.getData('text');\n this.editor.chain().focus().insertContent(pastedContent).run();\n return true; // Prevent the default paste behavior\n }\n\n return false; // Allow the default paste behavior\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n bubbleMenuShouldShow ({ editor, view, state, oldState, from, to }) {\n return editor.isActive('link');\n },\n\n /**\n * If the selection contains a link, return the existing link text.\n * Otherwise, use just the selected text.\n * @param editor the editor instance.\n */\n getSelectedLinkText (editor) {\n const { view, state } = editor;\n const { from, to } = view.state.selection;\n const text = state.doc.textBetween(from, to, '');\n const linkNode = this.editor.state.doc.nodeAt(from);\n if (linkNode && linkNode.marks?.at(0)?.type?.name === 'link') {\n return linkNode.textContent;\n } else {\n return text;\n }\n },\n\n editLink () {\n const linkText = this.getSelectedLinkText(this.editor);\n\n const link = {\n href: this.editor.getAttributes('link').href,\n text: linkText,\n };\n this.$emit('edit-link', link);\n },\n\n removeLink () {\n this.editor?.chain()?.focus()?.unsetLink()?.run();\n },\n\n openLink () {\n this.editor?.chain()?.focus();\n const link = this.editor.getAttributes('link').href;\n window.open(link, '_blank');\n },\n\n // eslint-disable-next-line complexity\n setLink (linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n defaultPrefix) {\n if (!linkInput) {\n // If link text is set to empty string,\n // remove any existing links.\n this.removeLink();\n return;\n }\n\n // Check if input matches any of the supported link formats\n const prefix = linkProtocols.find(prefixRegex => prefixRegex.test(linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n linkInput = `${defaultPrefix}${linkInput}`;\n }\n\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .run();\n\n const selection = this.editor?.view?.state?.selection;\n\n this.editor\n .chain()\n .focus()\n .insertContent(linkText)\n .setTextSelection({ from: selection.from, to: selection.from + linkText.length })\n .setLink({ href: linkInput, class: linkOptions.class })\n .run();\n },\n\n // eslint-disable-next-line complexity\n processValue (newValue, returnIfEqual = true) {\n const currentValue = this.getOutput();\n\n if (returnIfEqual && deepEqual(newValue, currentValue)) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n // If the text contains emoji characters convert them to emoji component tags\n if (typeof newValue === 'string' && this.outputFormat === 'text') {\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n newValue = newValue?.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n }\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n triggerInputChangeEvents () {\n const value = this.getOutput();\n this.$emit('input', value);\n this.$emit('update:value', value);\n\n // Always output JSON in a separate event\n const jsonValue = this.editor.getJSON();\n this.$emit('json-input', jsonValue);\n\n // Always output HTML in a separate event\n const htmlValue = this.editor.getHTML();\n this.$emit('html-input', htmlValue);\n\n // Always output HTML in a separate event\n const textValue = this.editor.getText({ blockSeparator: '\\n' });\n this.$emit('text-input', textValue);\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n this.editor.on('create', () => {\n this.triggerInputChangeEvents();\n });\n // The content has changed.\n this.editor.on('update', () => {\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.triggerInputChangeEvents();\n });\n\n this.editor.on('selectionUpdate', ({ editor }) => {\n this.$emit('selected', this.getSelectedLinkText(editor));\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":["EditorContent","BubbleMenu","DtButton","DtStack","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","RICH_TEXT_EDITOR_OUTPUT_FORMATS","Extension","RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS","CustomLink","mentionSuggestion","MentionPlugin","channelSuggestion","ChannelPlugin","slashCommandSuggestion","SlashCommandPlugin","Emoji","ConfigurableImage","warnIfUnmounted","Editor","emojiPattern"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,eAAAA,KAAA;AAAA,IACA,YAAAC,KAAA;AAAA,IACA,UAAAC,OAAA;AAAA,IACA,SAAAC,MAAA;AAAA,EACA;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,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;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,cAAA,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cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA,QAAA,EAAA,gBAAA,KAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA;AAAA,QACA,aAAA;AAAA,UACA,YAAA;AAAA,YACA,GAAA,KAAA;AAAA,YACA,OAAA,KAAA;AAAA,YACA,GAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;;"}
|
|
@@ -542,6 +542,14 @@ ${node.textContent}
|
|
|
542
542
|
...this.inputAttrs,
|
|
543
543
|
class: this.inputClass
|
|
544
544
|
},
|
|
545
|
+
handlePaste: (_, event) => {
|
|
546
|
+
if (!this.link && !this.customLink) {
|
|
547
|
+
const pastedContent = event.clipboardData.getData("text");
|
|
548
|
+
this.editor.chain().focus().insertContent(pastedContent).run();
|
|
549
|
+
return true;
|
|
550
|
+
}
|
|
551
|
+
return false;
|
|
552
|
+
},
|
|
545
553
|
// Moves the <br /> tags inside the previous closing tag to avoid
|
|
546
554
|
// Prosemirror wrapping them within another </p> tag.
|
|
547
555
|
transformPastedHTML(html) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<!-- eslint-disable vue/no-bare-strings-in-template -->\n<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <!-- why the hell is this visibility: hidden by default??? -->\n <bubble-menu\n v-if=\"editor && link && !hideLinkBubbleMenu\"\n :editor=\"editor\"\n :should-show=\"bubbleMenuShouldShow\"\n :tippy-options=\"tippyOptions\"\n style=\"visibility: visible;\"\n >\n <div class=\"d-popover__dialog\">\n <dt-stack\n direction=\"row\"\n class=\"d-rich-text-editor-bubble-menu__button-stack\"\n gap=\"0\"\n >\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"editLink\"\n >\n Edit\n </dt-button>\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"openLink\"\n >\n Open link\n </dt-button>\n <dt-button\n kind=\"danger\"\n importance=\"clear\"\n @click=\"removeLink\"\n >\n Remove\n </dt-button>\n </dt-stack>\n </div>\n </bubble-menu>\n <editor-content\n ref=\"editor\"\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport { DtButton } from '../button';\nimport { DtStack } from '../stack';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Code from '@tiptap/extension-code';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n BubbleMenu,\n DtButton,\n DtStack,\n },\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 inline code (wrapped in backticks).\n */\n allowCode: {\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.\n * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You\n * are showing a custom link editor popup.\n */\n hideLinkBubbleMenu: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Input event always in JSON format.\n * @event input\n * @type {JSON}\n */\n 'json-input',\n\n /**\n * Input event always in HTML format.\n * @event input\n * @type {HTML}\n */\n 'html-input',\n\n /**\n * Input event always in text format.\n * @event input\n * @type {String}\n */\n 'text-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 * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n\n /**\n * \"Edit link\" button was clicked. Fires an event for the consuming component to handle the editing of the link.\n * event contains the link object with two properties href and text.\n * @event edit-link\n * @type {Object}\n */\n 'edit-link',\n\n /**\n * \"Selected\" event is fired when the user selects text in the editor. returns the currently selected text.\n * If the selected text is partially a link, the full link text is returned.\n * @event selected\n * @type {String}\n */\n 'selected',\n ],\n\n data () {\n return {\n editor: null,\n tippyOptions: {\n appendTo: () => this.$refs.editor.$el.getRootNode()?.querySelector('body'),\n placement: 'top-start',\n },\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem.extend({\n renderText ({ node }) {\n return node.textContent;\n },\n }));\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n openOnClick: false,\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCode) {\n extensions.push(Code);\n }\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.extend({\n renderText ({ node }) {\n return `\\`\\`\\`\\n${node.textContent}\\n\\`\\`\\``;\n },\n }).configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n bubbleMenuShouldShow ({ editor, view, state, oldState, from, to }) {\n return editor.isActive('link');\n },\n\n /**\n * If the selection contains a link, return the existing link text.\n * Otherwise, use just the selected text.\n * @param editor the editor instance.\n */\n getSelectedLinkText (editor) {\n const { view, state } = editor;\n const { from, to } = view.state.selection;\n const text = state.doc.textBetween(from, to, '');\n const linkNode = this.editor.state.doc.nodeAt(from);\n if (linkNode && linkNode.marks?.at(0)?.type?.name === 'link') {\n return linkNode.textContent;\n } else {\n return text;\n }\n },\n\n editLink () {\n const linkText = this.getSelectedLinkText(this.editor);\n\n const link = {\n href: this.editor.getAttributes('link').href,\n text: linkText,\n };\n this.$emit('edit-link', link);\n },\n\n removeLink () {\n this.editor?.chain()?.focus()?.unsetLink()?.run();\n },\n\n openLink () {\n this.editor?.chain()?.focus();\n const link = this.editor.getAttributes('link').href;\n window.open(link, '_blank');\n },\n\n // eslint-disable-next-line complexity\n setLink (linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n defaultPrefix) {\n if (!linkInput) {\n // If link text is set to empty string,\n // remove any existing links.\n this.removeLink();\n return;\n }\n\n // Check if input matches any of the supported link formats\n const prefix = linkProtocols.find(prefixRegex => prefixRegex.test(linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n linkInput = `${defaultPrefix}${linkInput}`;\n }\n\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .run();\n\n const selection = this.editor?.view?.state?.selection;\n\n this.editor\n .chain()\n .focus()\n .insertContent(linkText)\n .setTextSelection({ from: selection.from, to: selection.from + linkText.length })\n .setLink({ href: linkInput, class: linkOptions.class })\n .run();\n },\n\n // eslint-disable-next-line complexity\n processValue (newValue, returnIfEqual = true) {\n const currentValue = this.getOutput();\n\n if (returnIfEqual && deepEqual(newValue, currentValue)) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n // If the text contains emoji characters convert them to emoji component tags\n if (typeof newValue === 'string' && this.outputFormat === 'text') {\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n newValue = newValue?.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n }\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n triggerInputChangeEvents () {\n const value = this.getOutput();\n this.$emit('input', value);\n this.$emit('update:value', value);\n\n // Always output JSON in a separate event\n const jsonValue = this.editor.getJSON();\n this.$emit('json-input', jsonValue);\n\n // Always output HTML in a separate event\n const htmlValue = this.editor.getHTML();\n this.$emit('html-input', htmlValue);\n\n // Always output HTML in a separate event\n const textValue = this.editor.getText({ blockSeparator: '\\n' });\n this.$emit('text-input', textValue);\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n this.editor.on('create', () => {\n this.triggerInputChangeEvents();\n });\n // The content has changed.\n this.editor.on('update', () => {\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.triggerInputChangeEvents();\n });\n\n this.editor.on('selectionUpdate', ({ editor }) => {\n this.$emit('selected', this.getSelectedLinkText(editor));\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;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,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;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,cAAA,UAAA;AACA,iBAAA,iCAAA,SAAA,SAAA;AAAA,QACA;AACA,eAAA;AAAA,MACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA,cAAA;AACA,eAAA,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A;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rich_text_editor.vue.js","sources":["../../../components/rich_text_editor/rich_text_editor.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<!-- eslint-disable vue/no-bare-strings-in-template -->\n<!-- eslint-disable vue/no-restricted-class -->\n<template>\n <div>\n <!-- why the hell is this visibility: hidden by default??? -->\n <bubble-menu\n v-if=\"editor && link && !hideLinkBubbleMenu\"\n :editor=\"editor\"\n :should-show=\"bubbleMenuShouldShow\"\n :tippy-options=\"tippyOptions\"\n style=\"visibility: visible;\"\n >\n <div class=\"d-popover__dialog\">\n <dt-stack\n direction=\"row\"\n class=\"d-rich-text-editor-bubble-menu__button-stack\"\n gap=\"0\"\n >\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"editLink\"\n >\n Edit\n </dt-button>\n <dt-button\n kind=\"muted\"\n importance=\"clear\"\n @click=\"openLink\"\n >\n Open link\n </dt-button>\n <dt-button\n kind=\"danger\"\n importance=\"clear\"\n @click=\"removeLink\"\n >\n Remove\n </dt-button>\n </dt-stack>\n </div>\n </bubble-menu>\n <editor-content\n ref=\"editor\"\n :editor=\"editor\"\n class=\"d-rich-text-editor\"\n data-qa=\"dt-rich-text-editor\"\n v-on=\"editorListeners\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-2';\nimport { Extension } from '@tiptap/core';\nimport { DtButton } from '../button';\nimport { DtStack } from '../stack';\nimport Blockquote from '@tiptap/extension-blockquote';\nimport CodeBlock from '@tiptap/extension-code-block';\nimport Code from '@tiptap/extension-code';\nimport Document from '@tiptap/extension-document';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Bold from '@tiptap/extension-bold';\nimport BulletList from '@tiptap/extension-bullet-list';\nimport Italic from '@tiptap/extension-italic';\nimport TipTapLink from '@tiptap/extension-link';\nimport ListItem from '@tiptap/extension-list-item';\nimport OrderedList from '@tiptap/extension-ordered-list';\nimport Strike from '@tiptap/extension-strike';\nimport Underline from '@tiptap/extension-underline';\nimport Text from '@tiptap/extension-text';\nimport TextAlign from '@tiptap/extension-text-align';\nimport History from '@tiptap/extension-history';\nimport Emoji from './extensions/emoji';\nimport CustomLink from './extensions/custom_link';\nimport ConfigurableImage from './extensions/image';\nimport { MentionPlugin } from './extensions/mentions/mention';\nimport { ChannelPlugin } from './extensions/channels/channel';\nimport { SlashCommandPlugin } from './extensions/slash_command/slash_command';\nimport {\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n} from './rich_text_editor_constants';\nimport { emojiPattern } from 'regex-combined-emojis';\n\nimport mentionSuggestion from './extensions/mentions/suggestion';\nimport channelSuggestion from './extensions/channels/suggestion';\nimport slashCommandSuggestion from './extensions/slash_command/suggestion';\nimport { warnIfUnmounted } from '@/common/utils';\nimport deepEqual from 'deep-equal';\n\nexport default {\n name: 'DtRichTextEditor',\n\n components: {\n EditorContent,\n BubbleMenu,\n DtButton,\n DtStack,\n },\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 * 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 * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,\n * line breaks can still be entered by pressing shift+enter.\n */\n allowLineBreaks: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\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: 'html',\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 * Enables the TipTap Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the custom link extension at the same time.\n */\n link: {\n type: [Boolean, Object],\n default: false,\n },\n\n /**\n * Enables the Custom Link extension and optionally passes configurations to it\n *\n * It is not recommended to use this and the built in TipTap link extension at the same time.\n *\n * The custom link does some additional things on top of the built in TipTap link\n * extension such as styling phone numbers and IP adresses as links, and allows you\n * to linkify text without having to type a space after the link. Currently it is missing some\n * functionality such as editing links and will likely require more work to be fully usable,\n * so it is recommended to use the built in TipTap link for now.\n */\n customLink: {\n type: [Boolean, Object],\n default: false,\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 * Note that slash commands only work when they are the first word in the input.\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 inline code (wrapped in backticks).\n */\n allowCode: {\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 * Whether the input allows inline images to be rendered.\n */\n allowInlineImages: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional TipTap extensions to be added to the editor.\n */\n additionalExtensions: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Manually hide the link bubble menu. The link bubble menu is shown when a link is selected via the cursor.\n * There are some cases when you may want the link to remain selected but hide the bubble menu such as when You\n * are showing a custom link editor popup.\n */\n hideLinkBubbleMenu: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Editor input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Input event always in JSON format.\n * @event input\n * @type {JSON}\n */\n 'json-input',\n\n /**\n * Input event always in HTML format.\n * @event input\n * @type {HTML}\n */\n 'html-input',\n\n /**\n * Input event always in text format.\n * @event input\n * @type {String}\n */\n 'text-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 * Editor blur event\n * @event blur\n * @type {FocusEvent}\n */\n 'blur',\n\n /**\n * Editor focus event\n * @event focus\n * @type {FocusEvent}\n */\n 'focus',\n\n /**\n * Enter was pressed. Note that shift enter must be pressed to line break the input.\n * @event enter\n * @type {String}\n */\n 'enter',\n\n /**\n * \"Edit link\" button was clicked. Fires an event for the consuming component to handle the editing of the link.\n * event contains the link object with two properties href and text.\n * @event edit-link\n * @type {Object}\n */\n 'edit-link',\n\n /**\n * \"Selected\" event is fired when the user selects text in the editor. returns the currently selected text.\n * If the selected text is partially a link, the full link text is returned.\n * @event selected\n * @type {String}\n */\n 'selected',\n ],\n\n data () {\n return {\n editor: null,\n tippyOptions: {\n appendTo: () => this.$refs.editor.$el.getRootNode()?.querySelector('body'),\n placement: 'top-start',\n },\n };\n },\n\n computed: {\n editorListeners () {\n return {\n ...this.$listeners,\n input: () => {},\n focus: () => {},\n blur: () => {},\n };\n },\n\n // eslint-disable-next-line complexity\n extensions () {\n // These are the default extensions needed just for plain text.\n const extensions = [Document, Paragraph, Text, History, HardBreak];\n\n if (this.allowBlockquote) {\n extensions.push(Blockquote);\n }\n if (this.allowBold) {\n extensions.push(Bold);\n }\n if (this.allowBulletList) {\n extensions.push(BulletList);\n extensions.push(ListItem.extend({\n renderText ({ node }) {\n return node.textContent;\n },\n }));\n extensions.push(OrderedList);\n }\n if (this.allowItalic) {\n extensions.push(Italic);\n }\n if (this.allowStrike) {\n extensions.push(Strike);\n }\n if (this.allowUnderline) {\n extensions.push(Underline);\n }\n\n // Enable placeholderText\n if (this.placeholder) {\n extensions.push(\n Placeholder.configure({ placeholder: this.placeholder }),\n );\n }\n\n const self = this;\n const ShiftEnter = Extension.create({\n addKeyboardShortcuts () {\n return {\n 'Shift-Enter': ({ editor }) => {\n if (self.allowLineBreaks) {\n return false;\n }\n editor.commands.first(({ commands }) => [\n () => commands.newlineInCode(),\n () => self.allowBulletList && commands.splitListItem('listItem'),\n () => commands.createParagraphNear(),\n () => commands.liftEmptyBlock(),\n () => commands.splitBlock(),\n ]);\n return true;\n },\n Enter: () => {\n if (self.allowLineBreaks) {\n return false;\n }\n self.$emit('enter');\n return true;\n },\n };\n },\n });\n extensions.push(ShiftEnter);\n\n if (this.link) {\n extensions.push(TipTapLink.extend({ inclusive: false }).configure({\n HTMLAttributes: {\n class: 'd-link d-wb-break-all',\n },\n openOnClick: false,\n autolink: true,\n protocols: RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n }));\n }\n if (this.customLink) {\n extensions.push(this.getExtension(CustomLink, this.customLink));\n }\n\n if (this.mentionSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.mentionSuggestion, ...mentionSuggestion };\n extensions.push(MentionPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.channelSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.channelSuggestion, ...channelSuggestion };\n extensions.push(ChannelPlugin.configure({ suggestion: suggestionObject }));\n }\n\n if (this.slashCommandSuggestion) {\n // Add both the suggestion plugin as well as means for user to add suggestion items to the plugin\n const suggestionObject = { ...this.slashCommandSuggestion, ...slashCommandSuggestion };\n extensions.push(SlashCommandPlugin.configure({ suggestion: suggestionObject }));\n }\n\n // Emoji has some interactions with Enter key\n // hence this should be done last otherwise the enter wont add a emoji.\n extensions.push(Emoji);\n\n extensions.push(TextAlign.configure({\n types: ['paragraph'],\n defaultAlignment: 'left',\n }));\n\n if (this.allowCode) {\n extensions.push(Code);\n }\n\n if (this.allowCodeblock) {\n extensions.push(CodeBlock.extend({\n renderText ({ node }) {\n return `\\`\\`\\`\\n${node.textContent}\\n\\`\\`\\``;\n },\n }).configure({\n HTMLAttributes: {\n class: 'd-rich-text-editor__code-block',\n },\n }));\n }\n\n if (this.allowInlineImages) {\n extensions.push(ConfigurableImage);\n }\n\n if (this.additionalExtensions.length) {\n extensions.push(...this.additionalExtensions);\n }\n\n return extensions;\n },\n\n inputAttrs () {\n const attrs = {\n 'aria-label': this.inputAriaLabel,\n 'aria-multiline': true,\n role: 'textbox',\n };\n if (!this.editable) {\n attrs['aria-readonly'] = true;\n }\n return attrs;\n },\n },\n\n /**\n * Because the Editor instance is initialized when mounted it does not get\n * updated props automatically, so the ones that can change after mount have\n * to be hooked up to the Editor's own API.\n */\n watch: {\n editable (isEditable) {\n this.editor.setEditable(isEditable);\n this.updateEditorAttributes({ 'aria-readonly': !isEditable });\n },\n\n inputClass (newClass) {\n this.updateEditorAttributes({ class: newClass });\n },\n\n inputAriaLabel (newLabel) {\n this.updateEditorAttributes({ 'aria-label': newLabel });\n },\n\n extensions () {\n // Extensions can't be registered on the fly, so just recreate the editor.\n // https://github.com/ueberdosis/tiptap/issues/1044\n this.destroyEditor();\n this.createEditor();\n },\n\n value (newValue) {\n this.processValue(newValue);\n },\n },\n\n created () {\n this.createEditor();\n },\n\n beforeUnmount () {\n this.destroyEditor();\n },\n\n mounted () {\n warnIfUnmounted(this.$el, this.$options.name);\n this.processValue(this.value, false);\n },\n\n methods: {\n createEditor () {\n // For all available options, see https://tiptap.dev/api/editor#settings\n this.editor = new Editor({\n autofocus: this.autoFocus,\n content: this.value,\n editable: this.editable,\n extensions: this.extensions,\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n },\n\n handlePaste: (_, event) => {\n // When having link and customLink props we should maintain default paste behavior\n if (!this.link && !this.customLink) {\n const pastedContent = event.clipboardData.getData('text');\n this.editor.chain().focus().insertContent(pastedContent).run();\n return true; // Prevent the default paste behavior\n }\n\n return false; // Allow the default paste behavior\n },\n\n // Moves the <br /> tags inside the previous closing tag to avoid\n // Prosemirror wrapping them within another </p> tag.\n transformPastedHTML (html) {\n return html.replace(/(<\\/\\w+>)((<br \\/>)+)/g, '$2$3$1');\n },\n },\n });\n this.addEditorListeners();\n },\n\n bubbleMenuShouldShow ({ editor, view, state, oldState, from, to }) {\n return editor.isActive('link');\n },\n\n /**\n * If the selection contains a link, return the existing link text.\n * Otherwise, use just the selected text.\n * @param editor the editor instance.\n */\n getSelectedLinkText (editor) {\n const { view, state } = editor;\n const { from, to } = view.state.selection;\n const text = state.doc.textBetween(from, to, '');\n const linkNode = this.editor.state.doc.nodeAt(from);\n if (linkNode && linkNode.marks?.at(0)?.type?.name === 'link') {\n return linkNode.textContent;\n } else {\n return text;\n }\n },\n\n editLink () {\n const linkText = this.getSelectedLinkText(this.editor);\n\n const link = {\n href: this.editor.getAttributes('link').href,\n text: linkText,\n };\n this.$emit('edit-link', link);\n },\n\n removeLink () {\n this.editor?.chain()?.focus()?.unsetLink()?.run();\n },\n\n openLink () {\n this.editor?.chain()?.focus();\n const link = this.editor.getAttributes('link').href;\n window.open(link, '_blank');\n },\n\n // eslint-disable-next-line complexity\n setLink (linkInput, linkText, linkOptions, linkProtocols = RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,\n defaultPrefix) {\n if (!linkInput) {\n // If link text is set to empty string,\n // remove any existing links.\n this.removeLink();\n return;\n }\n\n // Check if input matches any of the supported link formats\n const prefix = linkProtocols.find(prefixRegex => prefixRegex.test(linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n linkInput = `${defaultPrefix}${linkInput}`;\n }\n\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .run();\n\n const selection = this.editor?.view?.state?.selection;\n\n this.editor\n .chain()\n .focus()\n .insertContent(linkText)\n .setTextSelection({ from: selection.from, to: selection.from + linkText.length })\n .setLink({ href: linkInput, class: linkOptions.class })\n .run();\n },\n\n // eslint-disable-next-line complexity\n processValue (newValue, returnIfEqual = true) {\n const currentValue = this.getOutput();\n\n if (returnIfEqual && deepEqual(newValue, currentValue)) {\n // The new value came from this component and was passed back down\n // through the parent, so don't do anything here.\n return;\n }\n\n // If the text contains emoji characters convert them to emoji component tags\n if (typeof newValue === 'string' && this.outputFormat === 'text') {\n const inputUnicodeRegex = new RegExp(`(${emojiPattern})`, 'g');\n newValue = newValue?.replace(inputUnicodeRegex, '<emoji-component code=\"$1\"></emoji-component>');\n }\n\n // Otherwise replace the content (resets the cursor position).\n this.editor.commands.setContent(newValue, false);\n },\n\n destroyEditor () {\n this.editor.destroy();\n },\n\n triggerInputChangeEvents () {\n const value = this.getOutput();\n this.$emit('input', value);\n this.$emit('update:value', value);\n\n // Always output JSON in a separate event\n const jsonValue = this.editor.getJSON();\n this.$emit('json-input', jsonValue);\n\n // Always output HTML in a separate event\n const htmlValue = this.editor.getHTML();\n this.$emit('html-input', htmlValue);\n\n // Always output HTML in a separate event\n const textValue = this.editor.getText({ blockSeparator: '\\n' });\n this.$emit('text-input', textValue);\n },\n\n /**\n * The Editor exposes event hooks that we have to map our emits into. See\n * https://tiptap.dev/api/events for all events.\n */\n addEditorListeners () {\n this.editor.on('create', () => {\n this.triggerInputChangeEvents();\n });\n // The content has changed.\n this.editor.on('update', () => {\n // When preventTyping is true and user wants to type, we revert to last value\n // If Backspace (keyCode = 8) is pressed, we allow updating the text\n if (this.preventTyping && this.editor.view?.input?.lastKeyCode !== 8) {\n this.editor.commands.setContent(this.value, false);\n return;\n }\n this.triggerInputChangeEvents();\n });\n\n this.editor.on('selectionUpdate', ({ editor }) => {\n this.$emit('selected', this.getSelectedLinkText(editor));\n });\n\n // The editor is focused.\n this.editor.on('focus', ({ event }) => {\n this.$emit('focus', event);\n });\n\n // The editor isn’t focused anymore.\n this.editor.on('blur', ({ event }) => {\n this.$emit('blur', event);\n });\n },\n\n getOutput () {\n switch (this.outputFormat) {\n case 'json':\n return this.editor.getJSON();\n case 'html':\n return this.editor.getHTML();\n case 'text':\n default:\n return this.editor.getText({ blockSeparator: '\\n' });\n }\n },\n\n getExtension (extension, options) {\n if (typeof options === 'boolean') {\n return extension;\n }\n return extension.configure?.(options);\n },\n\n updateEditorAttributes (attributes) {\n this.editor.setOptions({\n editorProps: {\n attributes: {\n ...this.inputAttrs,\n class: this.inputClass,\n ...attributes,\n },\n },\n });\n },\n\n focusEditor () {\n this.editor.commands.focus();\n },\n },\n};\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;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,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,iBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAA;AA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AAA,CAAA,EAAA,MAAA,MAAA;AACA,aAAA,MAAA,QAAA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,cAAA,KAAA,cAAA;AAAA,QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AACA,iBAAA,KAAA,OAAA;QACA,KAAA;AAAA,QACA;AACA,iBAAA,KAAA,OAAA,QAAA,EAAA,gBAAA,KAAA,CAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,aAAA,WAAA,SAAA;;AACA,UAAA,OAAA,YAAA,WAAA;AACA,eAAA;AAAA,MACA;AACA,cAAA,eAAA,cAAA,mCAAA;AAAA,IACA;AAAA,IAEA,uBAAA,YAAA;AACA,WAAA,OAAA,WAAA;AAAA,QACA,aAAA;AAAA,UACA,YAAA;AAAA,YACA,GAAA,KAAA;AAAA,YACA,OAAA,KAAA;AAAA,YACA,GAAA;AAAA,UACA;AAAA,QACA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,cAAA;AACA,WAAA,OAAA,SAAA;IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
@@ -107,6 +107,7 @@ const scrollbar = require("./directives/scrollbar/scrollbar.cjs");
|
|
|
107
107
|
const callbar_button = require("./recipes/buttons/callbar_button/callbar_button.vue.cjs");
|
|
108
108
|
const callbar_button_constants = require("./recipes/buttons/callbar_button/callbar_button_constants.cjs");
|
|
109
109
|
const callbar_button_with_popover = require("./recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs");
|
|
110
|
+
const callbar_button_with_dropdown = require("./recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs");
|
|
110
111
|
const ivr_node = require("./recipes/cards/ivr_node/ivr_node.vue.cjs");
|
|
111
112
|
const ivr_node_constants = require("./recipes/cards/ivr_node/ivr_node_constants.cjs");
|
|
112
113
|
const grouped_chip = require("./recipes/chips/grouped_chip/grouped_chip.vue.cjs");
|
|
@@ -351,6 +352,7 @@ exports.DtScrollbarDirective = scrollbar.default;
|
|
|
351
352
|
exports.DtRecipeCallbarButton = callbar_button.default;
|
|
352
353
|
exports.CALLBAR_BUTTON_VALID_WIDTH_SIZE = callbar_button_constants.CALLBAR_BUTTON_VALID_WIDTH_SIZE;
|
|
353
354
|
exports.DtRecipeCallbarButtonWithPopover = callbar_button_with_popover.default;
|
|
355
|
+
exports.DtRecipeCallbarButtonWithDropdown = callbar_button_with_dropdown.default;
|
|
354
356
|
exports.DtRecipeIvrNode = ivr_node.default;
|
|
355
357
|
exports.IVR_NODE_ASSIGN = ivr_node_constants.IVR_NODE_ASSIGN;
|
|
356
358
|
exports.IVR_NODE_BRANCH = ivr_node_constants.IVR_NODE_BRANCH;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialtone-vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialtone-vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -105,34 +105,35 @@ import { default as default65 } from "./directives/scrollbar/scrollbar.js";
|
|
|
105
105
|
import { default as default66 } from "./recipes/buttons/callbar_button/callbar_button.vue.js";
|
|
106
106
|
import { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from "./recipes/buttons/callbar_button/callbar_button_constants.js";
|
|
107
107
|
import { default as default67 } from "./recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js";
|
|
108
|
-
import { default as default68 } from "./recipes/
|
|
108
|
+
import { default as default68 } from "./recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js";
|
|
109
|
+
import { default as default69 } from "./recipes/cards/ivr_node/ivr_node.vue.js";
|
|
109
110
|
import { IVR_NODE_ASSIGN, IVR_NODE_BRANCH, IVR_NODE_CUSTOMER_DATA, IVR_NODE_EXPERT, IVR_NODE_GO_TO, IVR_NODE_HANGUP, IVR_NODE_ICON_TYPES, IVR_NODE_LABELS, IVR_NODE_PROMPT_COLLECT, IVR_NODE_PROMPT_MENU, IVR_NODE_PROMPT_PLAY, IVR_NODE_TRANSFER } from "./recipes/cards/ivr_node/ivr_node_constants.js";
|
|
110
|
-
import { default as
|
|
111
|
-
import { default as
|
|
111
|
+
import { default as default70 } from "./recipes/chips/grouped_chip/grouped_chip.vue.js";
|
|
112
|
+
import { default as default71 } from "./recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js";
|
|
112
113
|
import { CHIP_SIZES, CHIP_TOP_POSITION, MULTI_SELECT_SIZES } from "./recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.js";
|
|
113
|
-
import { default as
|
|
114
|
-
import { default as
|
|
115
|
-
import { default as
|
|
116
|
-
import { default as
|
|
114
|
+
import { default as default72 } from "./recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js";
|
|
115
|
+
import { default as default73 } from "./recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js";
|
|
116
|
+
import { default as default74 } from "./recipes/conversation_view/editor/editor.vue.js";
|
|
117
|
+
import { default as default75 } from "./recipes/conversation_view/emoji_row/emoji_row.vue.js";
|
|
117
118
|
import { REACTIONS_ATTRIBUTES } from "./recipes/conversation_view/emoji_row/emoji_row_constants.js";
|
|
118
|
-
import { default as
|
|
119
|
+
import { default as default76 } from "./recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js";
|
|
119
120
|
import { FEED_ITEM_PILL_BORDER_COLORS } from "./recipes/conversation_view/feed_item_pill/feed_item_pill_constants.js";
|
|
120
|
-
import { default as
|
|
121
|
+
import { default as default77 } from "./recipes/conversation_view/feed_item_row/feed_item_row.vue.js";
|
|
121
122
|
import { DEFAULT_FEED_ROW_STATE, FEED_ROW_STATE_BACKGROUND_COLOR } from "./recipes/conversation_view/feed_item_row/feed_item_row_constants.js";
|
|
122
|
-
import { default as
|
|
123
|
-
import { default as
|
|
124
|
-
import { default as
|
|
125
|
-
import { default as
|
|
126
|
-
import { default as
|
|
123
|
+
import { default as default78 } from "./recipes/conversation_view/message_input/message_input.vue.js";
|
|
124
|
+
import { default as default79 } from "./recipes/conversation_view/time_pill/time_pill.vue.js";
|
|
125
|
+
import { default as default80 } from "./recipes/header/settings_menu_button/settings_menu_button.vue.js";
|
|
126
|
+
import { default as default81 } from "./recipes/item_layout/contact_info/contact_info.vue.js";
|
|
127
|
+
import { default as default82 } from "./recipes/leftbar/callbox/callbox.vue.js";
|
|
127
128
|
import { CALLBOX_BADGE_COLORS, CALLBOX_BORDER_COLORS } from "./recipes/leftbar/callbox/callbox_constants.js";
|
|
128
|
-
import { default as
|
|
129
|
-
import { default as
|
|
130
|
-
import { default as
|
|
129
|
+
import { default as default83 } from "./recipes/leftbar/contact_centers_row/contact_centers_row.vue.js";
|
|
130
|
+
import { default as default84 } from "./recipes/leftbar/contact_row/contact_row.vue.js";
|
|
131
|
+
import { default as default85 } from "./recipes/leftbar/general_row/general_row.vue.js";
|
|
131
132
|
import { LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR, LEFTBAR_GENERAL_ROW_ICON_SIZES, LEFTBAR_GENERAL_ROW_TYPES } from "./recipes/leftbar/general_row/general_row_constants.js";
|
|
132
|
-
import { default as
|
|
133
|
-
import { default as
|
|
133
|
+
import { default as default86 } from "./recipes/leftbar/group_row/group_row.vue.js";
|
|
134
|
+
import { default as default87 } from "./recipes/leftbar/unread_pill/unread_pill.vue.js";
|
|
134
135
|
import { UNREAD_PILL_DIRECTIONS, UNREAD_PILL_KINDS } from "./recipes/leftbar/unread_pill/unread_pill_constants.js";
|
|
135
|
-
import { default as
|
|
136
|
+
import { default as default88 } from "./recipes/notices/top_banner_info/top_banner_info.vue.js";
|
|
136
137
|
import { COLOR_CODES } from "./recipes/notices/top_banner_info/top_banner_info_constants.js";
|
|
137
138
|
export {
|
|
138
139
|
AVATAR_COLORS,
|
|
@@ -221,28 +222,29 @@ export {
|
|
|
221
222
|
default44 as DtPresence,
|
|
222
223
|
default45 as DtRadio,
|
|
223
224
|
default46 as DtRadioGroup,
|
|
224
|
-
|
|
225
|
+
default73 as DtRecipeAttachmentCarousel,
|
|
225
226
|
default66 as DtRecipeCallbarButton,
|
|
227
|
+
default68 as DtRecipeCallbarButtonWithDropdown,
|
|
226
228
|
default67 as DtRecipeCallbarButtonWithPopover,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
229
|
+
default82 as DtRecipeCallbox,
|
|
230
|
+
default71 as DtRecipeComboboxMultiSelect,
|
|
231
|
+
default72 as DtRecipeComboboxWithPopover,
|
|
232
|
+
default83 as DtRecipeContactCentersRow,
|
|
233
|
+
default81 as DtRecipeContactInfo,
|
|
234
|
+
default84 as DtRecipeContactRow,
|
|
235
|
+
default74 as DtRecipeEditor,
|
|
236
|
+
default75 as DtRecipeEmojiRow,
|
|
237
|
+
default76 as DtRecipeFeedItemPill,
|
|
238
|
+
default77 as DtRecipeFeedItemRow,
|
|
239
|
+
default85 as DtRecipeGeneralRow,
|
|
240
|
+
default86 as DtRecipeGroupRow,
|
|
241
|
+
default70 as DtRecipeGroupedChip,
|
|
242
|
+
default69 as DtRecipeIvrNode,
|
|
243
|
+
default78 as DtRecipeMessageInput,
|
|
244
|
+
default80 as DtRecipeSettingsMenuButton,
|
|
245
|
+
default79 as DtRecipeTimePill,
|
|
246
|
+
default88 as DtRecipeTopBannerInfo,
|
|
247
|
+
default87 as DtRecipeUnreadPill,
|
|
246
248
|
default47 as DtRichTextEditor,
|
|
247
249
|
default48 as DtRootLayout,
|
|
248
250
|
default65 as DtScrollbarDirective,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialtone-vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialtone-vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const callbar_button_with_dropdown = require("../recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs");
|
|
4
|
+
exports.DtRecipeCallbarButtonWithDropdown = callbar_button_with_dropdown.default;
|
|
5
|
+
//# sourceMappingURL=callbar-button-with-dropdown.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbar-button-with-dropdown.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbar-button-with-dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -120,6 +120,14 @@ const _sfc_main = {
|
|
|
120
120
|
tooltipText: {
|
|
121
121
|
type: String,
|
|
122
122
|
default: void 0
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Whether there is a delay before the tooltip shows on hover/focus.
|
|
126
|
+
* @values true, false
|
|
127
|
+
*/
|
|
128
|
+
tooltipDelay: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: void 0
|
|
123
131
|
}
|
|
124
132
|
},
|
|
125
133
|
emits: [
|
|
@@ -176,7 +184,7 @@ const _sfc_main = {
|
|
|
176
184
|
};
|
|
177
185
|
var _sfc_render = function render() {
|
|
178
186
|
var _vm = this, _c = _vm._self._c;
|
|
179
|
-
return _c("dt-tooltip", { attrs: { "id": _vm.id, "inverted": _vm.invertedTooltip, "show": _vm.showTooltip, "offset": [0, 24] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
187
|
+
return _c("dt-tooltip", { attrs: { "id": _vm.id, "inverted": _vm.invertedTooltip, "delay": _vm.tooltipDelay, "show": _vm.showTooltip, "offset": [0, 24] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
|
|
180
188
|
return [_c("span", { class: { "d-recipe-callbar-button--disabled": _vm.disabled } }, [_c("dt-button", _vm._g(_vm._b({ class: _vm.callbarButtonClass, attrs: { "importance": _vm.buttonImportance, "kind": "muted", "icon-position": "top", "aria-disabled": _vm.disabled, "aria-label": _vm.ariaLabel, "label-class": _vm.callbarButtonTextClass, "width": _vm.buttonWidth }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
|
|
181
189
|
return [_vm._t("icon")];
|
|
182
190
|
}, proxy: true }], null, true) }, "dt-button", _vm.$attrs, false), _vm.callbarButtonListeners), [_vm._t("default")], 2)], 1)];
|