@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
|
@@ -546,6 +546,14 @@ ${node.textContent}
|
|
|
546
546
|
...this.inputAttrs,
|
|
547
547
|
class: this.inputClass
|
|
548
548
|
},
|
|
549
|
+
handlePaste: (_, event) => {
|
|
550
|
+
if (!this.link && !this.customLink) {
|
|
551
|
+
const pastedContent = event.clipboardData.getData("text");
|
|
552
|
+
this.editor.chain().focus().insertContent(pastedContent).run();
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
return false;
|
|
556
|
+
},
|
|
549
557
|
// Moves the <br /> tags inside the previous closing tag to avoid
|
|
550
558
|
// Prosemirror wrapping them within another </p> tag.
|
|
551
559
|
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-bind=\"attrs\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3';\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 HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\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 compatConfig: { MODE: 3 },\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 modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * 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:modelValue',\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 attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\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 modelValue (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.modelValue, 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.modelValue,\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:modelValue', 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","_createElementBlock","_createBlock","_withCtx","_createElementVNode","_createVNode","_createTextVNode","_createCommentVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAK,YAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,mBACVA,KAAa;AAAA,gBACbC,KAAU;AAAA,IACV,UAAAC,OAAQ;AAAA,IACR,SAAAC,MAAO;AAAA,EACR;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA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,CAAA;AAAA;;;;"}
|
|
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-bind=\"attrs\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3';\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 HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\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 compatConfig: { MODE: 3 },\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 modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * 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:modelValue',\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 attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\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 modelValue (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.modelValue, 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.modelValue,\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:modelValue', 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","_createElementBlock","_createBlock","_withCtx","_createElementVNode","_createVNode","_createTextVNode","_createCommentVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAK,YAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,mBACVA,KAAa;AAAA,gBACbC,KAAU;AAAA,IACV,UAAAC,OAAQ;AAAA,IACR,SAAAC,MAAO;AAAA,EACR;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAK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,sBAAA;AAAA,gBALV,MAAK;AAAA,gBACL,YAAW;AAAA,gBACV,SAAO,SAAU;AAAA;gBApC9B,SAAAF,IAAA,QAqCW,MAED;AAAA,kBAvCVG,IAAAA,gBAqCW,UAED;AAAA;gBAvCV,GAAA;AAAA;;YAAA,GAAA;AAAA;;;MAAA,GAAA;AAAA,yDAAAC,IAAA,mBAAA,IAAA,IAAA;AAAA,IA2CIF,IAAA,YAME,2BANFG,eAME;AAAA,MALA,KAAI;AAAA,MACH,QAAQ,MAAM;AAAA,MACf,OAAM;AAAA,MACN,WAAQ;AAAA,OACA,SAAK,KAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA;AAAA;;;;"}
|
|
@@ -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.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-bind=\"attrs\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3';\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 HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\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 compatConfig: { MODE: 3 },\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 modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * 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:modelValue',\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 attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\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 modelValue (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.modelValue, 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.modelValue,\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:modelValue', 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":["_createElementBlock","_createBlock","_withCtx","_createElementVNode","_createVNode","_createTextVNode","_createCommentVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAK,YAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,gBAAgB;AAAA,MACd,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaD,WAAW;AAAA,MACT,MAAM,CAAC,SAAS,QAAQ,MAAM;AAAA,MAC9B,SAAS;AAAA,MACT,UAAW,WAAW;AACpB,YAAI,OAAO,cAAc,UAAU;AACjC,iBAAO,iCAAiC,SAAS,SAAS;AAAA,QAC5D;AACA,eAAO;AAAA,MACR;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQD,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UA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,SAAU;AAAA;gBApC9B,SAAAF,QAqCW,MAED;AAAA,kBAvCVG,gBAqCW,UAED;AAAA;gBAvCV,GAAA;AAAA;;YAAA,GAAA;AAAA;;;MAAA,GAAA;AAAA,yDAAAC,mBAAA,IAAA,IAAA;AAAA,IA2CIF,YAME,2BANFG,WAME;AAAA,MALA,KAAI;AAAA,MACH,QAAQ,MAAM;AAAA,MACf,OAAM;AAAA,MACN,WAAQ;AAAA,OACA,SAAK,KAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA;AAAA;;;"}
|
|
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-bind=\"attrs\"\n />\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { Editor, EditorContent, BubbleMenu } from '@tiptap/vue-3';\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 HardBreak from '@tiptap/extension-hard-break';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Placeholder from '@tiptap/extension-placeholder';\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 compatConfig: { MODE: 3 },\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 modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * 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:modelValue',\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 attrs () {\n return {\n ...this.$attrs,\n onInput: () => {},\n onFocus: () => {},\n onBlur: () => {},\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 modelValue (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.modelValue, 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.modelValue,\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:modelValue', 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":["_createElementBlock","_createBlock","_withCtx","_createElementVNode","_createVNode","_createTextVNode","_createCommentVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAK,YAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EAED,OAAO;AAAA;AAAA;AAAA;AAAA;A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AA;AAAA;;;MAAA,GAAA;AAAA,yDAAAC,mBAAA,IAAA,IAAA;AAAA,IA2CIF,YAME,2BANFG,WAME;AAAA,MALA,KAAI;AAAA,MACH,QAAQ,MAAM;AAAA,MACf,OAAM;AAAA,MACN,WAAQ;AAAA,OACA,SAAK,KAAA,GAAA,MAAA,IAAA,CAAA,QAAA,CAAA;AAAA;;;"}
|
|
@@ -108,6 +108,7 @@ const scrollbar = require("./directives/scrollbar/scrollbar.cjs");
|
|
|
108
108
|
const callbar_button = require("./recipes/buttons/callbar_button/callbar_button.vue.cjs");
|
|
109
109
|
const callbar_button_constants = require("./recipes/buttons/callbar_button/callbar_button_constants.cjs");
|
|
110
110
|
const callbar_button_with_popover = require("./recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.cjs");
|
|
111
|
+
const callbar_button_with_dropdown = require("./recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.cjs");
|
|
111
112
|
const ivr_node = require("./recipes/cards/ivr_node/ivr_node.vue.cjs");
|
|
112
113
|
const ivr_node_constants = require("./recipes/cards/ivr_node/ivr_node_constants.cjs");
|
|
113
114
|
const grouped_chip = require("./recipes/chips/grouped_chip/grouped_chip.vue.cjs");
|
|
@@ -354,6 +355,7 @@ exports.DtScrollbarDirective = scrollbar.default;
|
|
|
354
355
|
exports.DtRecipeCallbarButton = callbar_button.default;
|
|
355
356
|
exports.CALLBAR_BUTTON_VALID_WIDTH_SIZE = callbar_button_constants.CALLBAR_BUTTON_VALID_WIDTH_SIZE;
|
|
356
357
|
exports.DtRecipeCallbarButtonWithPopover = callbar_button_with_popover.default;
|
|
358
|
+
exports.DtRecipeCallbarButtonWithDropdown = callbar_button_with_dropdown.default;
|
|
357
359
|
exports.DtRecipeIvrNode = ivr_node.default;
|
|
358
360
|
exports.IVR_NODE_ASSIGN = ivr_node_constants.IVR_NODE_ASSIGN;
|
|
359
361
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -106,34 +106,35 @@ import { default as default66 } from "./directives/scrollbar/scrollbar.js";
|
|
|
106
106
|
import { default as default67 } from "./recipes/buttons/callbar_button/callbar_button.vue.js";
|
|
107
107
|
import { CALLBAR_BUTTON_VALID_WIDTH_SIZE } from "./recipes/buttons/callbar_button/callbar_button_constants.js";
|
|
108
108
|
import { default as default68 } from "./recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.js";
|
|
109
|
-
import { default as default69 } from "./recipes/
|
|
109
|
+
import { default as default69 } from "./recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.js";
|
|
110
|
+
import { default as default70 } from "./recipes/cards/ivr_node/ivr_node.vue.js";
|
|
110
111
|
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";
|
|
111
|
-
import { default as
|
|
112
|
-
import { default as
|
|
112
|
+
import { default as default71 } from "./recipes/chips/grouped_chip/grouped_chip.vue.js";
|
|
113
|
+
import { default as default72 } from "./recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.js";
|
|
113
114
|
import { CHIP_SIZES, CHIP_TOP_POSITION, MULTI_SELECT_SIZES } from "./recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.js";
|
|
114
|
-
import { default as
|
|
115
|
-
import { default as
|
|
116
|
-
import { default as
|
|
117
|
-
import { default as
|
|
115
|
+
import { default as default73 } from "./recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.js";
|
|
116
|
+
import { default as default74 } from "./recipes/conversation_view/attachment_carousel/attachment_carousel.vue.js";
|
|
117
|
+
import { default as default75 } from "./recipes/conversation_view/editor/editor.vue.js";
|
|
118
|
+
import { default as default76 } from "./recipes/conversation_view/emoji_row/emoji_row.vue.js";
|
|
118
119
|
import { REACTIONS_ATTRIBUTES } from "./recipes/conversation_view/emoji_row/emoji_row_constants.js";
|
|
119
|
-
import { default as
|
|
120
|
+
import { default as default77 } from "./recipes/conversation_view/feed_item_pill/feed_item_pill.vue.js";
|
|
120
121
|
import { FEED_ITEM_PILL_BORDER_COLORS } from "./recipes/conversation_view/feed_item_pill/feed_item_pill_constants.js";
|
|
121
|
-
import { default as
|
|
122
|
+
import { default as default78 } from "./recipes/conversation_view/feed_item_row/feed_item_row.vue.js";
|
|
122
123
|
import { DEFAULT_FEED_ROW_STATE, FEED_ROW_STATE_BACKGROUND_COLOR } from "./recipes/conversation_view/feed_item_row/feed_item_row_constants.js";
|
|
123
|
-
import { default as
|
|
124
|
-
import { default as
|
|
125
|
-
import { default as
|
|
126
|
-
import { default as
|
|
127
|
-
import { default as
|
|
124
|
+
import { default as default79 } from "./recipes/conversation_view/message_input/message_input.vue.js";
|
|
125
|
+
import { default as default80 } from "./recipes/conversation_view/time_pill/time_pill.vue.js";
|
|
126
|
+
import { default as default81 } from "./recipes/header/settings_menu_button/settings_menu_button.vue.js";
|
|
127
|
+
import { default as default82 } from "./recipes/item_layout/contact_info/contact_info.vue.js";
|
|
128
|
+
import { default as default83 } from "./recipes/leftbar/callbox/callbox.vue.js";
|
|
128
129
|
import { CALLBOX_BADGE_COLORS, CALLBOX_BORDER_COLORS } from "./recipes/leftbar/callbox/callbox_constants.js";
|
|
129
|
-
import { default as
|
|
130
|
-
import { default as
|
|
131
|
-
import { default as
|
|
130
|
+
import { default as default84 } from "./recipes/leftbar/contact_centers_row/contact_centers_row.vue.js";
|
|
131
|
+
import { default as default85 } from "./recipes/leftbar/contact_row/contact_row.vue.js";
|
|
132
|
+
import { default as default86 } from "./recipes/leftbar/general_row/general_row.vue.js";
|
|
132
133
|
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";
|
|
133
|
-
import { default as
|
|
134
|
-
import { default as
|
|
134
|
+
import { default as default87 } from "./recipes/leftbar/group_row/group_row.vue.js";
|
|
135
|
+
import { default as default88 } from "./recipes/leftbar/unread_pill/unread_pill.vue.js";
|
|
135
136
|
import { UNREAD_PILL_DIRECTIONS, UNREAD_PILL_KINDS } from "./recipes/leftbar/unread_pill/unread_pill_constants.js";
|
|
136
|
-
import { default as
|
|
137
|
+
import { default as default89 } from "./recipes/notices/top_banner_info/top_banner_info.vue.js";
|
|
137
138
|
import { COLOR_CODES } from "./recipes/notices/top_banner_info/top_banner_info_constants.js";
|
|
138
139
|
export {
|
|
139
140
|
ARROW_KEYS,
|
|
@@ -223,28 +224,29 @@ export {
|
|
|
223
224
|
default44 as DtPresence,
|
|
224
225
|
default45 as DtRadio,
|
|
225
226
|
default46 as DtRadioGroup,
|
|
226
|
-
|
|
227
|
+
default74 as DtRecipeAttachmentCarousel,
|
|
227
228
|
default67 as DtRecipeCallbarButton,
|
|
229
|
+
default69 as DtRecipeCallbarButtonWithDropdown,
|
|
228
230
|
default68 as DtRecipeCallbarButtonWithPopover,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
231
|
+
default83 as DtRecipeCallbox,
|
|
232
|
+
default72 as DtRecipeComboboxMultiSelect,
|
|
233
|
+
default73 as DtRecipeComboboxWithPopover,
|
|
234
|
+
default84 as DtRecipeContactCentersRow,
|
|
235
|
+
default82 as DtRecipeContactInfo,
|
|
236
|
+
default85 as DtRecipeContactRow,
|
|
237
|
+
default76 as DtRecipeEmojiRow,
|
|
238
|
+
default77 as DtRecipeFeedItemPill,
|
|
239
|
+
default78 as DtRecipeFeedItemRow,
|
|
240
|
+
default86 as DtRecipeGeneralRow,
|
|
241
|
+
default87 as DtRecipeGroupRow,
|
|
242
|
+
default71 as DtRecipeGroupedChip,
|
|
243
|
+
default70 as DtRecipeIvrNode,
|
|
244
|
+
default79 as DtRecipeMessageInput,
|
|
245
|
+
default81 as DtRecipeSettingsMenuButton,
|
|
246
|
+
default80 as DtRecipeTimePill,
|
|
247
|
+
default89 as DtRecipeTopBannerInfo,
|
|
248
|
+
default88 as DtRecipeUnreadPill,
|
|
249
|
+
default75 as DtRecipeWysiwygEditor,
|
|
248
250
|
default47 as DtRichTextEditor,
|
|
249
251
|
default48 as DtRootLayout,
|
|
250
252
|
default66 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":";"}
|
|
@@ -122,6 +122,14 @@ const _sfc_main = {
|
|
|
122
122
|
tooltipText: {
|
|
123
123
|
type: String,
|
|
124
124
|
default: void 0
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Whether there is a delay before the tooltip shows on hover/focus.
|
|
128
|
+
* @values true, false
|
|
129
|
+
*/
|
|
130
|
+
tooltipDelay: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: void 0
|
|
125
133
|
}
|
|
126
134
|
},
|
|
127
135
|
emits: [
|
|
@@ -182,6 +190,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
182
190
|
return vue.openBlock(), vue.createBlock(_component_dt_tooltip, {
|
|
183
191
|
id: $props.id,
|
|
184
192
|
inverted: $props.invertedTooltip,
|
|
193
|
+
delay: $props.tooltipDelay,
|
|
185
194
|
show: $props.showTooltip,
|
|
186
195
|
offset: [0, 24]
|
|
187
196
|
}, {
|
|
@@ -215,7 +224,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
215
224
|
])
|
|
216
225
|
]),
|
|
217
226
|
_: 3
|
|
218
|
-
}, 8, ["id", "inverted", "show"]);
|
|
227
|
+
}, 8, ["id", "inverted", "delay", "show"]);
|
|
219
228
|
}
|
|
220
229
|
const DtRecipeCallbarButton = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
|
|
221
230
|
exports.default = DtRecipeCallbarButton;
|