@dialpad/dialtone-vue 3.203.0 → 3.204.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/common/test-utils/node-traversal.cjs +2 -0
- package/dist/common/test-utils/node-traversal.cjs.map +1 -0
- package/dist/common/test-utils/node-traversal.js +54 -0
- package/dist/common/test-utils/node-traversal.js.map +1 -0
- package/dist/component-documentation.json +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.cjs.map +1 -1
- package/dist/lib/button/button.js +146 -81
- package/dist/lib/button/button.js.map +1 -1
- package/dist/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.cjs.map +1 -1
- package/dist/lib/editor/editor.js +284 -148
- package/dist/lib/editor/editor.js.map +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.cjs.map +1 -1
- package/dist/lib/link/link.js +58 -18
- package/dist/lib/link/link.js.map +1 -1
- package/dist/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/lib/list-item-group/list-item-group.js +5 -5
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.cjs.map +1 -1
- package/dist/lib/message-input/message-input.js +22 -21
- package/dist/lib/message-input/message-input.js.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +4 -4
- package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +466 -283
- package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +69 -67
- package/dist/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/localization/en-US.cjs +6 -0
- package/dist/localization/en-US.cjs.map +1 -1
- package/dist/localization/en-US.js +6 -0
- package/dist/localization/en-US.js.map +1 -1
- package/dist/types/common/sr_only_close_button.vue.d.ts +68 -1
- package/dist/types/common/test_utils/node_traversal.d.ts +10 -0
- package/dist/types/common/test_utils/node_traversal.d.ts.map +1 -0
- package/dist/types/components/banner/banner.vue.d.ts +136 -2
- package/dist/types/components/banner/banner.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts +39 -1
- package/dist/types/components/breadcrumbs/breadcrumb_item.vue.d.ts.map +1 -1
- package/dist/types/components/breadcrumbs/breadcrumbs.vue.d.ts +39 -1
- package/dist/types/components/button/button.vue.d.ts +68 -1
- package/dist/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/types/components/chip/chip.vue.d.ts +68 -1
- package/dist/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts +68 -1
- package/dist/types/components/collapsible/collapsible.vue.d.ts.map +1 -1
- package/dist/types/components/dropdown/dropdown.vue.d.ts +136 -2
- package/dist/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
- package/dist/types/components/hovercard/hovercard.vue.d.ts +272 -4
- package/dist/types/components/hovercard/hovercard.vue.d.ts.map +1 -1
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts +136 -2
- package/dist/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/types/components/link/link.vue.d.ts +39 -1
- package/dist/types/components/link/link.vue.d.ts.map +1 -1
- package/dist/types/components/modal/modal.vue.d.ts +136 -2
- package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice.vue.d.ts +136 -2
- package/dist/types/components/notice/notice.vue.d.ts.map +1 -1
- package/dist/types/components/notice/notice_action.vue.d.ts +136 -2
- package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/types/components/pagination/pagination.vue.d.ts +68 -1
- package/dist/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover.vue.d.ts +136 -2
- package/dist/types/components/popover/popover.vue.d.ts.map +1 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts +68 -1
- package/dist/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +39 -1
- package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +39 -1
- package/dist/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +1804 -0
- package/dist/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/extensions/variable/index.d.ts +3 -0
- package/dist/types/components/rich_text_editor/extensions/variable/index.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/extensions/variable/variable.d.ts +3 -0
- package/dist/types/components/rich_text_editor/extensions/variable/variable.d.ts.map +1 -0
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts +87 -1
- package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button-alpha.vue.d.ts +68 -1
- package/dist/types/components/split_button/split_button-omega.vue.d.ts +68 -1
- package/dist/types/components/split_button/split_button-omega.vue.d.ts.map +1 -1
- package/dist/types/components/split_button/split_button.vue.d.ts +272 -4
- package/dist/types/components/split_button/split_button.vue.d.ts.map +1 -1
- package/dist/types/components/tab/tab.vue.d.ts +68 -1
- package/dist/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +136 -2
- package/dist/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
- package/dist/types/components/toast/layouts/toast_layout_default.vue.d.ts +136 -2
- package/dist/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
- package/dist/types/components/toast/toast.vue.d.ts +544 -8
- package/dist/types/components/toast/toast.vue.d.ts.map +1 -1
- package/dist/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +68 -1
- package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +272 -4
- package/dist/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +272 -4
- package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +204 -3
- package/dist/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +68 -1
- package/dist/types/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +136 -2
- package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +272 -4
- package/dist/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +204 -3
- package/dist/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts +664 -4
- package/dist/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +631 -9
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +272 -4
- package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +68 -1
- package/dist/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +68 -1
- package/dist/types/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts +68 -1
- package/dist/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./editor-constants.cjs"),f=require("../../common/utils/index.cjs"),n=require("@dialpad/dialtone-icons/vue3"),L=require("../../localization/index.cjs"),e=require("vue"),m=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),A=require("../tooltip/tooltip.cjs"),w=require("../input/input.cjs"),E=require("../stack/stack.cjs"),D=require("../popover/popover.cjs"),x=require("../button/button.cjs"),C=require("../rich-text-editor/rich-text-editor.cjs"),k=require("../rich-text-editor/rich-text-editor-constants.cjs"),O={compatConfig:{MODE:3},name:"DtRecipeEditor",components:{DtRichTextEditor:C.default,DtButton:x.default,DtPopover:D.default,DtStack:E.default,DtInput:w.default,DtTooltip:A.default,DtIconQuickReply:n.DtIconQuickReply,DtIconBold:n.DtIconBold,DtIconItalic:n.DtIconItalic,DtIconUnderline:n.DtIconUnderline,DtIconStrikethrough:n.DtIconStrikethrough,DtIconListBullet:n.DtIconListBullet,DtIconListOrdered:n.DtIconListOrdered,DtIconAlignLeft:n.DtIconAlignLeft,DtIconAlignCenter:n.DtIconAlignCenter,DtIconAlignRight:n.DtIconAlignRight,DtIconAlignJustify:n.DtIconAlignJustify,DtIconQuote:n.DtIconQuote,DtIconCodeBlock:n.DtIconCodeBlock,DtIconLink2:n.DtIconLink2,DtIconImage:n.DtIconImage},mixins:[],inheritAttrs:!1,props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(t){return typeof t=="string"?k.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},placeholder:{type:String,default:""},maxHeight:{type:String,default:"unset"},setLinkPlaceholder:{type:String,default:""},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0})},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1}},emits:["focus","blur","input","update:modelValue","quick-replies-click","inline-image-click","text-input"],data(){return{internalInputValue:this.modelValue,hasFocus:!1,linkOptions:{class:"d-recipe-editor__link"},showLinkInput:!1,linkInput:"",currentButtonRefIndex:0,i18n:new L.DialtoneLocalization}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return k.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){const t=this.buttonGroups.reduce((function(i,r){return r.buttonGroup.forEach(s=>{i.push(this.getButtonRef(r.key,s.selector))},this),i}).bind(this),[]);return t.push(this.getButtonRef("custom","link")),t},buttonGroups(){const t=this.individualButtons.map(i=>({key:i.selector,buttonGroup:[i]}));return[{key:"new",buttonGroup:this.newButtons},{key:"format",buttonGroup:this.textFormatButtons},{key:"alignment",buttonGroup:this.alignmentButtons},{key:"list",buttonGroup:this.listButtons},...t].filter(i=>i.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,label:this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),selector:"quickReplies",icon:n.DtIconQuickReply,dataQA:"dt-recipe-editor-quick-replies-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),onClick:this.onQuickRepliesClick}].filter(t=>t.showBtn)},textFormatButtons(){return[{showBtn:this.showBoldButton,selector:"bold",icon:n.DtIconBold,dataQA:"dt-recipe-editor-bold-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_BOLD_BUTTON_LABEL"),onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,selector:"italic",icon:n.DtIconItalic,dataQA:"dt-recipe-editor-italics-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ITALICS_BUTTON_LABEL"),onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,selector:"underline",icon:n.DtIconUnderline,dataQA:"dt-recipe-editor-underline-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL"),onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,selector:"strike",icon:n.DtIconStrikethrough,dataQA:"dt-recipe-editor-strike-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_STRIKE_BUTTON_LABEL"),onClick:this.onStrikethroughTextToggle}].filter(t=>t.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,selector:{textAlign:"left"},icon:n.DtIconAlignLeft,dataQA:"dt-recipe-editor-align-left-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL"),onClick:()=>this.onTextAlign("left")},{showBtn:this.showAlignCenterButton,selector:{textAlign:"center"},icon:n.DtIconAlignCenter,dataQA:"dt-recipe-editor-align-center-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL"),onClick:()=>this.onTextAlign("center")},{showBtn:this.showAlignRightButton,selector:{textAlign:"right"},icon:n.DtIconAlignRight,dataQA:"dt-recipe-editor-align-right-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL"),onClick:()=>this.onTextAlign("right")},{showBtn:this.showAlignJustifyButton,selector:{textAlign:"justify"},icon:n.DtIconAlignJustify,dataQA:"dt-recipe-editor-align-justify-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL"),onClick:()=>this.onTextAlign("justify")}].filter(t=>t.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,selector:"bulletList",icon:n.DtIconListBullet,dataQA:"dt-recipe-editor-list-items-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL"),onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,selector:"orderedList",icon:n.DtIconListOrdered,dataQA:"dt-recipe-editor-ordered-list-items-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL"),onClick:this.onOrderedListToggle}].filter(t=>t.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,selector:"blockquote",icon:n.DtIconQuote,dataQA:"dt-recipe-editor-blockquote-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_QUOTE_BUTTON_LABEL"),onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,selector:"codeBlock",icon:n.DtIconCodeBlock,dataQA:"dt-recipe-editor-code-block-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_CODE_BUTTON_LABEL"),onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,selector:"image",icon:n.DtIconImage,dataQA:"dt-recipe-editor-inline-image-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_IMAGE_BUTTON_LABEL"),onClick:this.onInsertInlineImageClick}].filter(t=>t.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,selector:"link",icon:n.DtIconLink2,dataQA:"dt-recipe-editor-add-link-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_LINK_BUTTON_LABEL"),onClick:this.openLinkInput}},confirmSetLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON")},cancelSetLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON")},removeLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_REMOVE_LINK_BUTTON")},showAddLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_ADD_LINK_BUTTON")}},watch:{modelValue(t){this.internalInputValue=t}},methods:{removeClassStyleAttrs:f.removeClassStyleAttrs,addClassStyleAttrs:f.addClassStyleAttrs,onInputFocus(t){t==null||t.stopPropagation()},removeLink(){var t,i,r,s,l;(l=(s=(r=(i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:i.chain())==null?void 0:r.focus())==null?void 0:s.unsetLink())==null||l.run(),this.closeLinkInput()},setLink(t){var l,o,a;const i=(l=this.$refs.richTextEditor)==null?void 0:l.editor;if(t==null||t.preventDefault(),t==null||t.stopPropagation(),!this.linkInput){this.removeLink();return}g.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(d=>d.test(this.linkInput))||(this.linkInput=`${g.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);const s=(a=(o=i==null?void 0:i.view)==null?void 0:o.state)==null?void 0:a.selection;s.anchor===s.head?i.chain().focus().insertContentAt(s.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():i.chain().focus().extendMarkRange("link").setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(t){var i,r,s;if(!t)return this.closeLinkInput();this.linkInput=(s=(r=(i=this.$refs.richTextEditor)==null?void 0:i.editor)==null?void 0:r.getAttributes("link"))==null?void 0:s.href},closeLinkInput(){var t;this.showLinkInput=!1,this.linkInput="",(t=this.$refs.richTextEditor.editor)==null||t.chain().focus()},onBoldTextToggle(){var t,i;(i=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null||i.chain().focus().toggleBold().run()},onItalicTextToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleStrike().run()},onTextAlign(t){var i,r,s,l;if((r=(i=this.$refs.richTextEditor)==null?void 0:i.editor)!=null&&r.isActive({textAlign:t}))return(s=this.$refs.richTextEditor)==null?void 0:s.editor.chain().focus().unsetTextAlign().run();(l=this.$refs.richTextEditor)==null||l.editor.chain().focus().setTextAlign(t).run()},onBulletListToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit("quick-replies-click")},onInsertInlineImageClick(){this.$emit("inline-image-click")},insertInlineImage(t){var i;(i=this.$refs.richTextEditor)==null||i.editor.chain().focus().setImage({src:t}).run()},insertInMessageBody(t){var i;(i=this.$refs.richTextEditor)==null||i.editor.chain().focus().insertContent(t).run()},setCursorPosition(t=null){var i;(i=this.$refs.richTextEditor)==null||i.editor.chain().focus(t).run()},onBlockquoteToggle(){var t;(t=this.$refs.richTextEditor)==null||t.editor.chain().focus().toggleBlockquote().run()},onTextInput(t){this.$emit("text-input",t)},onFocus(t){this.hasFocus=!0,this.$emit("focus",t)},onBlur(t){this.hasFocus=!1,this.$emit("blur",t)},onInput(t){this.$emit("input",t),this.$emit("update:modelValue",t)},getButtonKey(t,i){return`${t}-${JSON.stringify(i)}`},getButtonRef(t,i){return`${this.getButtonKey(t,i)}-ref`},canFocus(t){return t===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(t){const i=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],r=Array.isArray(i)?i[0]:i,s=(this.currentButtonRefIndex+t)%this.orderedRefs.length;this.currentButtonRefIndex=s>=0?s:this.orderedRefs.length+s;const l=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],o=Array.isArray(l)?l[0]:l;r.$el.blur(),o.$el.focus()}}},y={class:"d-recipe-editor__popover-content"};function R(t,i,r,s,l,o){const a=e.resolveComponent("dt-button"),d=e.resolveComponent("dt-tooltip"),h=e.resolveComponent("dt-stack"),I=e.resolveComponent("dt-input"),T=e.resolveComponent("dt-popover"),_=e.resolveComponent("dt-rich-text-editor");return e.openBlock(),e.createElementBlock("div",e.mergeProps({class:"d-recipe-editor"},o.addClassStyleAttrs(t.$attrs),{"data-qa":"dt-recipe-editor",role:"presentation",onClick:i[4]||(i[4]=u=>t.$refs.richTextEditor.focusEditor())}),[e.createVNode(h,{class:"d-recipe-editor__top-bar",direction:"row",gap:"450"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.buttonGroups,u=>(e.openBlock(),e.createBlock(h,{key:u.key,direction:"row",gap:"300"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.buttonGroup,c=>(e.openBlock(),e.createBlock(d,{key:o.getButtonKey(u.key,c.selector),message:c.tooltipMessage,placement:"top"},{anchor:e.withCtx(()=>{var B,p;return[e.createVNode(a,{ref_for:!0,ref:o.getButtonRef(u.key,c.selector),active:(p=(B=t.$refs.richTextEditor)==null?void 0:B.editor)==null?void 0:p.isActive(c.selector),"aria-label":c.tooltipMessage,"data-qa":c.dataQA,tabindex:o.canFocus(o.getButtonRef(u.key,c.selector))?0:-1,importance:"clear",kind:"muted",size:"xs",onClick:N=>c.onClick(),onKeydown:[e.withKeys(e.withModifiers(o.shiftActionBarFocusRight,["stop"]),["right"]),e.withKeys(e.withModifiers(o.shiftActionBarFocusLeft,["stop"]),["left"])]},{icon:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.icon),{size:"200"}))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(c==null?void 0:c.label),1)]),_:2},1032,["active","aria-label","data-qa","tabindex","onClick","onKeydown"])]}),_:2},1032,["message"]))),128)),i[5]||(i[5]=e.createElementVNode("div",{class:"d-recipe-editor__button-group-divider"},null,-1))]),_:2},1024))),128)),o.linkButton.showBtn?(e.openBlock(),e.createBlock(h,{key:0,direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createVNode(T,{open:l.showLinkInput,"show-close-button":!1,"data-qa":"dt-recipe-editor-link-input-popover",padding:"none",placement:"bottom-start",onClick:[o.onInputFocus,e.withModifiers(o.onInputFocus,["stop"])],onOpened:o.updateInput},{anchor:e.withCtx(()=>[(e.openBlock(),e.createBlock(d,{key:o.linkButton.key,message:o.linkButton.tooltipMessage,placement:"top"},{anchor:e.withCtx(()=>{var u,c;return[e.createVNode(a,{ref:o.getButtonRef("custom","link"),active:(c=(u=t.$refs.richTextEditor)==null?void 0:u.editor)==null?void 0:c.isActive(o.linkButton.selector),"aria-label":o.linkButton.tooltipMessage,"data-qa":o.linkButton.dataQA,tabindex:o.canFocus(o.getButtonRef("custom","link"))?0:-1,importance:"clear",kind:"muted",size:"xs",onClick:i[0]||(i[0]=B=>o.linkButton.onClick()),onKeydown:[e.withKeys(e.withModifiers(o.shiftActionBarFocusRight,["stop"]),["right"]),e.withKeys(e.withModifiers(o.shiftActionBarFocusLeft,["stop"]),["left"])]},{icon:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.linkButton.icon),{size:"200"}))]),_:1},8,["active","aria-label","data-qa","tabindex","onKeydown"])]}),_:1},8,["message"]))]),content:e.withCtx(()=>[e.createElementVNode("div",y,[e.createElementVNode("span",null,e.toDisplayString(o.showAddLinkButtonLabels.title),1),e.createVNode(I,{modelValue:l.linkInput,"onUpdate:modelValue":i[1]||(i[1]=u=>l.linkInput=u),"input-aria-label":o.showAddLinkButtonLabels["aria-label"],placeholder:r.setLinkPlaceholder,"data-qa":"dt-recipe-editor-link-input","input-wrapper-class":"d-recipe-editor-link__input-wrapper",onClick:[o.onInputFocus,e.withModifiers(o.onInputFocus,["stop"])],onFocus:o.onInputFocus,onKeydown:e.withKeys(o.setLink,["enter"])},null,8,["modelValue","input-aria-label","placeholder","onClick","onFocus","onKeydown"])])]),footerContent:e.withCtx(()=>[e.createVNode(h,{direction:"row",gap:"300",class:"d-recipe-editor__popover-footer"},{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({"data-qa":"dt-recipe-editor-remove-link-btn",importance:"clear",kind:"muted",size:"sm"},o.removeLinkButtonLabels,{onClick:o.removeLink}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.removeLinkButtonLabels.title),1)]),_:1},16,["onClick"]),e.createVNode(a,e.mergeProps({"data-qa":"dt-recipe-editor-set-link-cancel-btn",importance:"clear",kind:"muted",size:"sm"},o.cancelSetLinkButtonLabels,{onClick:o.closeLinkInput}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.cancelSetLinkButtonLabels.title),1)]),_:1},16,["onClick"]),e.createVNode(a,e.mergeProps({"data-qa":"dt-recipe-editor-set-link-confirm-btn",size:"sm"},o.confirmSetLinkButtonLabels,{onClick:o.setLink}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.confirmSetLinkButtonLabels.title),1)]),_:1},16,["onClick"])]),_:1})]),_:1},8,["open","onClick","onOpened"])]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",{style:e.normalizeStyle({"max-height":r.maxHeight}),class:"d-recipe-editor__content"},[e.createVNode(_,e.mergeProps({ref:"richTextEditor",modelValue:l.internalInputValue,"onUpdate:modelValue":i[2]||(i[2]=u=>l.internalInputValue=u),"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"hide-link-bubble-menu":!0,"auto-focus":r.autoFocus,editable:r.editable,"input-aria-label":r.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${r.inputClass}`,link:!0,"output-format":o.htmlOutputFormat,placeholder:r.placeholder,"use-div-tags":r.useDivTags,"allow-tables":r.allowTables,"data-qa":"dt-rich-text-editor"},o.removeClassStyleAttrs(t.$attrs),{onTextInput:o.onTextInput,onBlur:o.onBlur,onFocus:o.onFocus,onInput:i[3]||(i[3]=u=>o.onInput(u))}),null,16,["modelValue","auto-focus","editable","input-aria-label","input-class","output-format","placeholder","use-div-tags","allow-tables","onTextInput","onBlur","onFocus"])],4)],16)}const b=m._(O,[["render",R]]);exports.default=b;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./editor-constants.cjs"),I=require("../../common/utils/index.cjs"),n=require("@dialpad/dialtone-icons/vue3"),C=require("../../localization/index.cjs"),t=require("vue"),D=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),b=require("../tooltip/tooltip.cjs"),x=require("../input/input.cjs"),O=require("../stack/stack.cjs"),y=require("../popover/popover.cjs"),R=require("../button/button.cjs"),N=require("../rich-text-editor/rich-text-editor.cjs"),v=require("../list-item/list-item.cjs"),V=require("../dropdown/dropdown-separator.cjs"),S=require("../list-item-group/list-item-group.cjs"),_=require("../rich-text-editor/rich-text-editor-constants.cjs"),F={compatConfig:{MODE:3},name:"DtRecipeEditor",components:{DtListItemGroup:S.default,DtDropdownSeparator:V.default,DtListItem:v.default,DtRichTextEditor:N.default,DtButton:R.default,DtPopover:y.default,DtStack:O.default,DtInput:x.default,DtTooltip:b.default,DtIconQuickReply:n.DtIconQuickReply,DtIconBold:n.DtIconBold,DtIconItalic:n.DtIconItalic,DtIconUnderline:n.DtIconUnderline,DtIconStrikethrough:n.DtIconStrikethrough,DtIconListBullet:n.DtIconListBullet,DtIconListOrdered:n.DtIconListOrdered,DtIconAlignLeft:n.DtIconAlignLeft,DtIconAlignCenter:n.DtIconAlignCenter,DtIconAlignRight:n.DtIconAlignRight,DtIconAlignJustify:n.DtIconAlignJustify,DtIconQuote:n.DtIconQuote,DtIconCodeBlock:n.DtIconCodeBlock,DtIconLink2:n.DtIconLink2,DtIconImage:n.DtIconImage,DtIconBraces:n.DtIconBraces,DtIconSearch:n.DtIconSearch},mixins:[],inheritAttrs:!1,props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e=="string"?_.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},placeholder:{type:String,default:""},maxHeight:{type:String,default:"unset"},setLinkPlaceholder:{type:String,default:""},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showVariableButton:{type:Boolean,default:!1},variableCategories:{type:Array,default:()=>[]},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0})},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1}},emits:["focus","blur","input","update:modelValue","quick-replies-click","inline-image-click","text-input"],data(){return{internalInputValue:this.modelValue,hasFocus:!1,linkOptions:{class:"d-recipe-editor__link"},showLinkInput:!1,linkInput:"",currentButtonRefIndex:0,variableSearchValue:"",i18n:new C.DialtoneLocalization}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return _.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},flattenedVariableItems(){return this.variableCategories?this.variableCategories.reduce((e,o)=>e.concat(o.items||[]),[]):[]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){const e=this.buttonGroups.reduce((function(o,r){return r.buttonGroup.forEach(a=>{o.push(this.getButtonRef(r.key,a.selector))},this),o}).bind(this),[]);return e.push(this.getButtonRef("custom","link")),e},buttonGroups(){const e=this.individualButtons.map(o=>({key:o.selector,buttonGroup:[o]}));return[{key:"new",buttonGroup:this.newButtons},{key:"format",buttonGroup:this.textFormatButtons},{key:"alignment",buttonGroup:this.alignmentButtons},{key:"list",buttonGroup:this.listButtons},...e].filter(o=>o.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,label:this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),selector:"quickReplies",icon:n.DtIconQuickReply,dataQA:"dt-recipe-editor-quick-replies-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL"),onClick:this.onQuickRepliesClick}].filter(e=>e.showBtn)},textFormatButtons(){return[{showBtn:this.showBoldButton,selector:"bold",icon:n.DtIconBold,dataQA:"dt-recipe-editor-bold-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_BOLD_BUTTON_LABEL"),onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,selector:"italic",icon:n.DtIconItalic,dataQA:"dt-recipe-editor-italics-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ITALICS_BUTTON_LABEL"),onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,selector:"underline",icon:n.DtIconUnderline,dataQA:"dt-recipe-editor-underline-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL"),onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,selector:"strike",icon:n.DtIconStrikethrough,dataQA:"dt-recipe-editor-strike-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_STRIKE_BUTTON_LABEL"),onClick:this.onStrikethroughTextToggle}].filter(e=>e.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,selector:{textAlign:"left"},icon:n.DtIconAlignLeft,dataQA:"dt-recipe-editor-align-left-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL"),onClick:()=>this.onTextAlign("left")},{showBtn:this.showAlignCenterButton,selector:{textAlign:"center"},icon:n.DtIconAlignCenter,dataQA:"dt-recipe-editor-align-center-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL"),onClick:()=>this.onTextAlign("center")},{showBtn:this.showAlignRightButton,selector:{textAlign:"right"},icon:n.DtIconAlignRight,dataQA:"dt-recipe-editor-align-right-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL"),onClick:()=>this.onTextAlign("right")},{showBtn:this.showAlignJustifyButton,selector:{textAlign:"justify"},icon:n.DtIconAlignJustify,dataQA:"dt-recipe-editor-align-justify-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL"),onClick:()=>this.onTextAlign("justify")}].filter(e=>e.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,selector:"bulletList",icon:n.DtIconListBullet,dataQA:"dt-recipe-editor-list-items-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL"),onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,selector:"orderedList",icon:n.DtIconListOrdered,dataQA:"dt-recipe-editor-ordered-list-items-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL"),onClick:this.onOrderedListToggle}].filter(e=>e.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,selector:"blockquote",icon:n.DtIconQuote,dataQA:"dt-recipe-editor-blockquote-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_QUOTE_BUTTON_LABEL"),onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,selector:"codeBlock",icon:n.DtIconCodeBlock,dataQA:"dt-recipe-editor-code-block-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_CODE_BUTTON_LABEL"),onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,selector:"image",icon:n.DtIconImage,dataQA:"dt-recipe-editor-inline-image-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_IMAGE_BUTTON_LABEL"),onClick:this.onInsertInlineImageClick}].filter(e=>e.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,selector:"link",icon:n.DtIconLink2,dataQA:"dt-recipe-editor-add-link-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_LINK_BUTTON_LABEL"),onClick:this.openLinkInput}},variableButton(){return{showBtn:this.showVariableButton,selector:"variable",icon:n.DtIconBraces,dataQA:"dt-recipe-editor-variable-btn",tooltipMessage:this.i18n.$t("DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL")}},confirmSetLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON")},cancelSetLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON")},removeLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_REMOVE_LINK_BUTTON")},showAddLinkButtonLabels(){return this.i18n.$ta("DIALTONE_EDITOR_ADD_LINK_BUTTON")},filteredCategories(){return this.variableCategories.filter(e=>this.getFilteredItemsForCategory(e).length)}},watch:{modelValue(e){this.internalInputValue=e}},methods:{removeClassStyleAttrs:I.removeClassStyleAttrs,addClassStyleAttrs:I.addClassStyleAttrs,onInputFocus(e){e==null||e.stopPropagation()},removeLink(){var e,o,r,a,s;(s=(a=(r=(o=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null?void 0:o.chain())==null?void 0:r.focus())==null?void 0:a.unsetLink())==null||s.run(),this.closeLinkInput()},setLink(e){var s,i,u;const o=(s=this.$refs.richTextEditor)==null?void 0:s.editor;if(e==null||e.preventDefault(),e==null||e.stopPropagation(),!this.linkInput){this.removeLink();return}k.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(h=>h.test(this.linkInput))||(this.linkInput=`${k.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);const a=(u=(i=o==null?void 0:o.view)==null?void 0:i.state)==null?void 0:u.selection;a.anchor===a.head?o.chain().focus().insertContentAt(a.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():o.chain().focus().extendMarkRange("link").setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(e){var o,r,a;if(!e)return this.closeLinkInput();this.linkInput=(a=(r=(o=this.$refs.richTextEditor)==null?void 0:o.editor)==null?void 0:r.getAttributes("link"))==null?void 0:a.href},closeLinkInput(){var e;this.showLinkInput=!1,this.linkInput="",(e=this.$refs.richTextEditor.editor)==null||e.chain().focus()},onBoldTextToggle(){var e,o;(o=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null||o.chain().focus().toggleBold().run()},onItalicTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleStrike().run()},onTextAlign(e){var o,r,a,s;if((r=(o=this.$refs.richTextEditor)==null?void 0:o.editor)!=null&&r.isActive({textAlign:e}))return(a=this.$refs.richTextEditor)==null?void 0:a.editor.chain().focus().unsetTextAlign().run();(s=this.$refs.richTextEditor)==null||s.editor.chain().focus().setTextAlign(e).run()},onBulletListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit("quick-replies-click")},onInsertInlineImageClick(){this.$emit("inline-image-click")},insertVariable(e,o){var r;(r=this.$refs.richTextEditor)==null||r.editor.chain().focus().insertVariable({id:o.id,placeholder:o.placeholder||"",altText:""}).run()},insertInlineImage(e){var o;(o=this.$refs.richTextEditor)==null||o.editor.chain().focus().setImage({src:e}).run()},insertInMessageBody(e){var o;(o=this.$refs.richTextEditor)==null||o.editor.chain().focus().insertContent(e).run()},setCursorPosition(e=null){var o;(o=this.$refs.richTextEditor)==null||o.editor.chain().focus(e).run()},onBlockquoteToggle(){var e;(e=this.$refs.richTextEditor)==null||e.editor.chain().focus().toggleBlockquote().run()},onTextInput(e){this.$emit("text-input",e)},onFocus(e){this.hasFocus=!0,this.$emit("focus",e)},onBlur(e){this.hasFocus=!1,this.$emit("blur",e)},onInput(e){this.$emit("input",e),this.$emit("update:modelValue",e)},getButtonKey(e,o){return`${e}-${JSON.stringify(o)}`},getButtonRef(e,o){return`${this.getButtonKey(e,o)}-ref`},canFocus(e){return e===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(e){const o=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],r=Array.isArray(o)?o[0]:o,a=(this.currentButtonRefIndex+e)%this.orderedRefs.length;this.currentButtonRefIndex=a>=0?a:this.orderedRefs.length+a;const s=this.$refs[this.orderedRefs[this.currentButtonRefIndex]],i=Array.isArray(s)?s[0]:s;r.$el.blur(),i.$el.focus()},getFilteredItemsForCategory(e){const o=this.variableSearchValue.toLowerCase();return e.name.toLowerCase().includes(o)?e.items:e.items.filter(r=>r.name.toLowerCase().includes(o))}}},U={class:"d-recipe-editor__popover-content"};function q(e,o,r,a,s,i){const u=t.resolveComponent("dt-button"),h=t.resolveComponent("dt-tooltip"),p=t.resolveComponent("dt-stack"),m=t.resolveComponent("dt-icon-search"),g=t.resolveComponent("dt-input"),T=t.resolveComponent("dt-list-item"),L=t.resolveComponent("dt-dropdown-separator"),w=t.resolveComponent("dt-list-item-group"),f=t.resolveComponent("dt-popover"),A=t.resolveComponent("dt-rich-text-editor");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:"d-recipe-editor"},i.addClassStyleAttrs(e.$attrs),{"data-qa":"dt-recipe-editor",role:"presentation",onClick:o[5]||(o[5]=c=>e.$refs.richTextEditor.focusEditor())}),[t.createVNode(p,{class:"d-recipe-editor__top-bar",direction:"row",gap:"450"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.buttonGroups,c=>(t.openBlock(),t.createBlock(p,{key:c.key,direction:"row",gap:"300"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.buttonGroup,l=>(t.openBlock(),t.createBlock(h,{key:i.getButtonKey(c.key,l.selector),message:l.tooltipMessage,placement:"top"},{anchor:t.withCtx(()=>{var B,d;return[t.createVNode(u,{ref_for:!0,ref:i.getButtonRef(c.key,l.selector),active:(d=(B=e.$refs.richTextEditor)==null?void 0:B.editor)==null?void 0:d.isActive(l.selector),"aria-label":l.tooltipMessage,"data-qa":l.dataQA,tabindex:i.canFocus(i.getButtonRef(c.key,l.selector))?0:-1,importance:"clear",kind:"muted",size:"xs",onClick:E=>l.onClick(),onKeydown:[t.withKeys(t.withModifiers(i.shiftActionBarFocusRight,["stop"]),["right"]),t.withKeys(t.withModifiers(i.shiftActionBarFocusLeft,["stop"]),["left"])]},{icon:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.icon),{size:"200"}))]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(l==null?void 0:l.label),1)]),_:2},1032,["active","aria-label","data-qa","tabindex","onClick","onKeydown"])]}),_:2},1032,["message"]))),128)),o[6]||(o[6]=t.createElementVNode("div",{class:"d-recipe-editor__button-group-divider"},null,-1))]),_:2},1024))),128)),i.variableButton.showBtn?(t.openBlock(),t.createBlock(p,{key:0,direction:"row",gap:"300"},{default:t.withCtx(()=>[t.createVNode(f,{padding:"small","navigation-type":"arrow-keys",modal:!1,placement:"bottom-start"},{anchor:t.withCtx(({attrs:c})=>[t.createVNode(h,{message:i.variableButton.tooltipMessage,placement:"top"},{anchor:t.withCtx(()=>[t.createVNode(u,t.mergeProps(c,{kind:"muted",size:"xs",importance:"clear","aria-label":i.variableButton.tooltipMessage,"data-qa":i.variableButton.dataQA,"label-class":"d-jc-flex-start"}),{icon:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.variableButton.icon),{size:"200"}))]),_:1},16,["aria-label","data-qa"])]),_:2},1032,["message"])]),content:t.withCtx(({close:c})=>[t.createVNode(g,{modelValue:s.variableSearchValue,"onUpdate:modelValue":o[0]||(o[0]=l=>s.variableSearchValue=l),"root-class":"d-p8 d-pb4 d-w264",type:"search",placeholder:s.i18n.$t("DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER"),size:"md",role:"menuitem"},{leftIcon:t.withCtx(({iconSize:l})=>[t.createVNode(m,{size:l},null,8,["size"])]),_:1},8,["modelValue","placeholder"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.filteredCategories,(l,B)=>(t.openBlock(),t.createBlock(w,{key:l.name,heading:l.name,"heading-class":"d-headline--sm-compact d-p8"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.getFilteredItemsForCategory(l),d=>(t.openBlock(),t.createBlock(T,{key:l.name+d.name,role:"menuitem","navigation-type":"arrow-keys",onClick:E=>{i.insertVariable(l.name,d),c()}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.name),1)]),_:2},1032,["onClick"]))),128)),B<i.filteredCategories.length-1?(t.openBlock(),t.createBlock(L,{key:0})):t.createCommentVNode("",!0)]),_:2},1032,["heading"]))),128))]),_:1}),o[7]||(o[7]=t.createElementVNode("div",{class:"d-recipe-editor__button-group-divider"},null,-1))]),_:1})):t.createCommentVNode("",!0),i.linkButton.showBtn?(t.openBlock(),t.createBlock(p,{key:1,direction:"row",gap:"300"},{default:t.withCtx(()=>[t.createVNode(f,{open:s.showLinkInput,"show-close-button":!1,"data-qa":"dt-recipe-editor-link-input-popover",padding:"none",placement:"bottom-start",onClick:[i.onInputFocus,t.withModifiers(i.onInputFocus,["stop"])],onOpened:i.updateInput},{anchor:t.withCtx(()=>[(t.openBlock(),t.createBlock(h,{key:i.linkButton.key,message:i.linkButton.tooltipMessage,placement:"top"},{anchor:t.withCtx(()=>{var c,l;return[t.createVNode(u,{ref:i.getButtonRef("custom","link"),active:(l=(c=e.$refs.richTextEditor)==null?void 0:c.editor)==null?void 0:l.isActive(i.linkButton.selector),"aria-label":i.linkButton.tooltipMessage,"data-qa":i.linkButton.dataQA,tabindex:i.canFocus(i.getButtonRef("custom","link"))?0:-1,importance:"clear",kind:"muted",size:"xs",onClick:o[1]||(o[1]=B=>i.linkButton.onClick()),onKeydown:[t.withKeys(t.withModifiers(i.shiftActionBarFocusRight,["stop"]),["right"]),t.withKeys(t.withModifiers(i.shiftActionBarFocusLeft,["stop"]),["left"])]},{icon:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.linkButton.icon),{size:"200"}))]),_:1},8,["active","aria-label","data-qa","tabindex","onKeydown"])]}),_:1},8,["message"]))]),content:t.withCtx(()=>[t.createElementVNode("div",U,[t.createElementVNode("span",null,t.toDisplayString(i.showAddLinkButtonLabels.title),1),t.createVNode(g,{modelValue:s.linkInput,"onUpdate:modelValue":o[2]||(o[2]=c=>s.linkInput=c),"input-aria-label":i.showAddLinkButtonLabels["aria-label"],placeholder:r.setLinkPlaceholder,"data-qa":"dt-recipe-editor-link-input","input-wrapper-class":"d-recipe-editor-link__input-wrapper",onClick:[i.onInputFocus,t.withModifiers(i.onInputFocus,["stop"])],onFocus:i.onInputFocus,onKeydown:t.withKeys(i.setLink,["enter"])},null,8,["modelValue","input-aria-label","placeholder","onClick","onFocus","onKeydown"])])]),footerContent:t.withCtx(()=>[t.createVNode(p,{direction:"row",gap:"300",class:"d-recipe-editor__popover-footer"},{default:t.withCtx(()=>[t.createVNode(u,t.mergeProps({"data-qa":"dt-recipe-editor-remove-link-btn",importance:"clear",kind:"muted",size:"sm"},i.removeLinkButtonLabels,{onClick:i.removeLink}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.removeLinkButtonLabels.title),1)]),_:1},16,["onClick"]),t.createVNode(u,t.mergeProps({"data-qa":"dt-recipe-editor-set-link-cancel-btn",importance:"clear",kind:"muted",size:"sm"},i.cancelSetLinkButtonLabels,{onClick:i.closeLinkInput}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.cancelSetLinkButtonLabels.title),1)]),_:1},16,["onClick"]),t.createVNode(u,t.mergeProps({"data-qa":"dt-recipe-editor-set-link-confirm-btn",size:"sm"},i.confirmSetLinkButtonLabels,{onClick:i.setLink}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.confirmSetLinkButtonLabels.title),1)]),_:1},16,["onClick"])]),_:1})]),_:1},8,["open","onClick","onOpened"])]),_:1})):t.createCommentVNode("",!0)]),_:1}),t.createElementVNode("div",{style:t.normalizeStyle({"max-height":r.maxHeight}),class:"d-recipe-editor__content"},[t.createVNode(A,t.mergeProps({ref:"richTextEditor",modelValue:s.internalInputValue,"onUpdate:modelValue":o[3]||(o[3]=c=>s.internalInputValue=c),"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"allow-variable":!0,"variable-items":i.flattenedVariableItems,"hide-link-bubble-menu":!0,"auto-focus":r.autoFocus,editable:r.editable,"input-aria-label":r.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${r.inputClass}`,link:!0,"output-format":i.htmlOutputFormat,placeholder:r.placeholder,"use-div-tags":r.useDivTags,"allow-tables":r.allowTables,"data-qa":"dt-rich-text-editor"},i.removeClassStyleAttrs(e.$attrs),{onTextInput:i.onTextInput,onBlur:i.onBlur,onFocus:i.onFocus,onInput:o[4]||(o[4]=c=>i.onInput(c))}),null,16,["modelValue","variable-items","auto-focus","editable","input-aria-label","input-class","output-format","placeholder","use-div-tags","allow-tables","onTextInput","onBlur","onFocus"])],4)],16)}const M=D._(F,[["render",q]]);exports.default=M;
|
|
2
2
|
//# sourceMappingURL=editor.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.cjs","sources":["../../../recipes/conversation_view/editor/editor.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-editor\"\n v-bind=\"addClassStyleAttrs($attrs)\"\n data-qa=\"dt-recipe-editor\"\n role=\"presentation\"\n @click=\"$refs.richTextEditor.focusEditor()\"\n >\n <!-- Section for the top UI -->\n <dt-stack\n class=\"d-recipe-editor__top-bar\"\n direction=\"row\"\n gap=\"450\"\n >\n <dt-stack\n v-for=\"buttonGroup in buttonGroups\"\n :key=\"buttonGroup.key\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-tooltip\n v-for=\"button in buttonGroup.buttonGroup\"\n :key=\"getButtonKey(buttonGroup.key, button.selector)\"\n :message=\"button.tooltipMessage\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n :ref=\"getButtonRef(buttonGroup.key, button.selector)\"\n :active=\"$refs.richTextEditor?.editor?.isActive(button.selector)\"\n :aria-label=\"button.tooltipMessage\"\n :data-qa=\"button.dataQA\"\n :tabindex=\"canFocus(getButtonRef(buttonGroup.key, button.selector)) ? 0 : -1\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n @click=\"button.onClick()\"\n @keydown.right.stop=\"shiftActionBarFocusRight\"\n @keydown.left.stop=\"shiftActionBarFocusLeft\"\n >\n <template #icon>\n <component\n :is=\"button.icon\"\n size=\"200\"\n />\n </template>\n {{ button?.label }}\n </dt-button>\n </template>\n </dt-tooltip>\n <div class=\"d-recipe-editor__button-group-divider\" />\n </dt-stack>\n <dt-stack\n v-if=\"linkButton.showBtn\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-popover\n :open=\"showLinkInput\"\n :show-close-button=\"false\"\n data-qa=\"dt-recipe-editor-link-input-popover\"\n padding=\"none\"\n placement=\"bottom-start\"\n @click=\"onInputFocus\"\n @opened=\"updateInput\"\n @click.stop=\"onInputFocus\"\n >\n <template #anchor>\n <dt-tooltip\n :key=\"linkButton.key\"\n :message=\"linkButton.tooltipMessage\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n :ref=\"getButtonRef('custom', 'link')\"\n :active=\"$refs.richTextEditor?.editor?.isActive(linkButton.selector)\"\n :aria-label=\"linkButton.tooltipMessage\"\n :data-qa=\"linkButton.dataQA\"\n :tabindex=\"canFocus(getButtonRef('custom', 'link')) ? 0 : -1\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n @click=\"linkButton.onClick()\"\n @keydown.right.stop=\"shiftActionBarFocusRight\"\n @keydown.left.stop=\"shiftActionBarFocusLeft\"\n >\n <template #icon>\n <component\n :is=\"linkButton.icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </template>\n\n <template #content>\n <div class=\"d-recipe-editor__popover-content\">\n <span>\n {{ showAddLinkButtonLabels.title }}\n </span>\n <dt-input\n v-model=\"linkInput\"\n :input-aria-label=\"showAddLinkButtonLabels['aria-label']\"\n :placeholder=\"setLinkPlaceholder\"\n data-qa=\"dt-recipe-editor-link-input\"\n input-wrapper-class=\"d-recipe-editor-link__input-wrapper\"\n @click=\"onInputFocus\"\n @focus=\"onInputFocus\"\n @click.stop=\"onInputFocus\"\n @keydown.enter=\"setLink\"\n />\n </div>\n </template>\n <template #footerContent>\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n class=\"d-recipe-editor__popover-footer\"\n >\n <dt-button\n data-qa=\"dt-recipe-editor-remove-link-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"sm\"\n v-bind=\"removeLinkButtonLabels\"\n @click=\"removeLink\"\n >\n {{ removeLinkButtonLabels.title }}\n </dt-button>\n <dt-button\n data-qa=\"dt-recipe-editor-set-link-cancel-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"sm\"\n v-bind=\"cancelSetLinkButtonLabels\"\n @click=\"closeLinkInput\"\n >\n {{ cancelSetLinkButtonLabels.title }}\n </dt-button>\n <dt-button\n data-qa=\"dt-recipe-editor-set-link-confirm-btn\"\n size=\"sm\"\n v-bind=\"confirmSetLinkButtonLabels\"\n @click=\"setLink\"\n >\n {{ confirmSetLinkButtonLabels.title }}\n </dt-button>\n </dt-stack>\n </template>\n </dt-popover>\n </dt-stack>\n </dt-stack>\n\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n :style=\"{ 'max-height': maxHeight }\"\n class=\"d-recipe-editor__content\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-font-color=\"true\"\n :allow-font-family=\"true\"\n :allow-inline-images=\"true\"\n :allow-line-breaks=\"true\"\n :hide-link-bubble-menu=\"true\"\n :auto-focus=\"autoFocus\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"`d-recipe-editor__content-input ${inputClass}`\"\n :link=\"true\"\n :output-format=\"htmlOutputFormat\"\n :placeholder=\"placeholder\"\n :use-div-tags=\"useDivTags\"\n :allow-tables=\"allowTables\"\n data-qa=\"dt-rich-text-editor\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n @text-input=\"onTextInput\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @input=\"onInput($event)\"\n />\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from './editor_constants.js';\nimport { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtStack } from '@/components/stack';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport {\n DtIconAlignCenter,\n DtIconAlignJustify,\n DtIconAlignLeft,\n DtIconAlignRight,\n DtIconBold,\n DtIconCodeBlock,\n DtIconImage,\n DtIconItalic,\n DtIconQuickReply,\n DtIconLink2,\n DtIconListBullet,\n DtIconListOrdered,\n DtIconQuote,\n DtIconStrikethrough,\n DtIconUnderline,\n} from '@dialpad/dialtone-icons/vue3';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeEditor',\n\n components: {\n DtRichTextEditor,\n DtButton,\n DtPopover,\n DtStack,\n DtInput,\n DtTooltip,\n DtIconQuickReply,\n DtIconBold,\n DtIconItalic,\n DtIconUnderline,\n DtIconStrikethrough,\n DtIconListBullet,\n DtIconListOrdered,\n DtIconAlignLeft,\n DtIconAlignCenter,\n DtIconAlignRight,\n DtIconAlignJustify,\n DtIconQuote,\n DtIconCodeBlock,\n DtIconLink2,\n DtIconImage,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * 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 * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n /**\n * Placeholder text for the set link input field\n */\n setLinkPlaceholder: {\n type: String,\n default: '',\n },\n\n /**\n * Show button to render text as bold\n */\n showBoldButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render text in italics\n */\n showItalicsButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to underline text\n */\n showUnderlineButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to strike text\n */\n showStrikeButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render list items\n */\n showListItemsButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render ordered list items\n */\n showOrderedListButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the left\n */\n showAlignLeftButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the center\n */\n showAlignCenterButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the right\n */\n showAlignRightButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to justify text\n */\n showAlignJustifyButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add quote format to text\n */\n showQuoteButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add code block\n */\n showCodeBlockButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to handle quick replies\n */\n showQuickRepliesButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add an inline image\n */\n showInlineImageButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Show add link default config.\n */\n showAddLink: {\n type: Object,\n default: () => ({\n showAddLinkButton: true,\n }),\n },\n\n /**\n * Use div tags instead of paragraph tags to show text\n */\n useDivTags: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Allow Tables to be used in to the editor\n */\n allowTables: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native focus event\n * @event input\n * @type {String|JSON}\n */\n 'focus',\n\n /**\n * Native blur event\n * @event input\n * @type {String|JSON}\n */\n 'blur',\n\n /**\n * Native input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event fired to sync the modelValue prop with the parent component\n * @event input\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Quick replies button\n * pressed event\n * @event quick-replies-click\n */\n 'quick-replies-click',\n\n /**\n * Emit when inline image button is clicked\n * @event inline-image-click\n */\n 'inline-image-click',\n\n /**\n * Emit when text input is changed\n * @event text-input\n * @type {String}\n */\n 'text-input',\n ],\n\n data () {\n return {\n internalInputValue: this.modelValue, // internal input content\n hasFocus: false,\n\n linkOptions: {\n class: 'd-recipe-editor__link',\n },\n\n showLinkInput: false,\n linkInput: '',\n currentButtonRefIndex: 0,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.length;\n },\n\n htmlOutputFormat () {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS[2];\n },\n\n showingTextFormatButtons () {\n return this.showBoldButton || this.showItalicsButton || this.showStrikeButton || this.showUnderlineButton;\n },\n\n showingAlignmentButtons () {\n return this.showAlignLeftButton || this.showAlignCenterButton ||\n this.showAlignRightButton || this.showAlignJustifyButton;\n },\n\n showingListButtons () {\n return this.showListItemsButton || this.showOrderedListButton;\n },\n\n orderedRefs () {\n const refs = this.buttonGroups.reduce(function (acc, buttonData) {\n buttonData.buttonGroup.forEach(button => {\n acc.push(this.getButtonRef(buttonData.key, button.selector));\n }, this);\n return acc;\n }.bind(this), []);\n refs.push(this.getButtonRef('custom', 'link'));\n return refs;\n },\n\n buttonGroups () {\n const individualButtonStacks = this.individualButtons.map(buttonData => ({\n key: buttonData.selector,\n buttonGroup: [buttonData],\n }));\n return [\n { key: 'new', buttonGroup: this.newButtons },\n { key: 'format', buttonGroup: this.textFormatButtons },\n { key: 'alignment', buttonGroup: this.alignmentButtons },\n { key: 'list', buttonGroup: this.listButtons },\n ...individualButtonStacks,\n ].filter(buttonGroupData => buttonGroupData.buttonGroup.length > 0);\n },\n\n newButtons () {\n return [\n {\n showBtn: this.showQuickRepliesButton,\n label: this.i18n.$t('DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL'),\n selector: 'quickReplies',\n icon: DtIconQuickReply,\n dataQA: 'dt-recipe-editor-quick-replies-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL'),\n onClick: this.onQuickRepliesClick,\n },\n ].filter(button => button.showBtn);\n },\n\n textFormatButtons () {\n return [\n {\n showBtn: this.showBoldButton,\n selector: 'bold',\n icon: DtIconBold,\n dataQA: 'dt-recipe-editor-bold-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_BOLD_BUTTON_LABEL'),\n onClick: this.onBoldTextToggle,\n },\n {\n showBtn: this.showItalicsButton,\n selector: 'italic',\n icon: DtIconItalic,\n dataQA: 'dt-recipe-editor-italics-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ITALICS_BUTTON_LABEL'),\n onClick: this.onItalicTextToggle,\n },\n {\n showBtn: this.showUnderlineButton,\n selector: 'underline',\n icon: DtIconUnderline,\n dataQA: 'dt-recipe-editor-underline-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL'),\n onClick: this.onUnderlineTextToggle,\n },\n {\n showBtn: this.showStrikeButton,\n selector: 'strike',\n icon: DtIconStrikethrough,\n dataQA: 'dt-recipe-editor-strike-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_STRIKE_BUTTON_LABEL'),\n onClick: this.onStrikethroughTextToggle,\n },\n ].filter(button => button.showBtn);\n },\n\n alignmentButtons () {\n return [\n {\n showBtn: this.showAlignLeftButton,\n selector: { textAlign: 'left' },\n icon: DtIconAlignLeft,\n dataQA: 'dt-recipe-editor-align-left-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('left'),\n },\n {\n showBtn: this.showAlignCenterButton,\n selector: { textAlign: 'center' },\n icon: DtIconAlignCenter,\n dataQA: 'dt-recipe-editor-align-center-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('center'),\n },\n {\n showBtn: this.showAlignRightButton,\n selector: { textAlign: 'right' },\n icon: DtIconAlignRight,\n dataQA: 'dt-recipe-editor-align-right-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('right'),\n },\n {\n showBtn: this.showAlignJustifyButton,\n selector: { textAlign: 'justify' },\n icon: DtIconAlignJustify,\n dataQA: 'dt-recipe-editor-align-justify-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('justify'),\n },\n ].filter(button => button.showBtn);\n },\n\n listButtons () {\n return [\n {\n showBtn: this.showListItemsButton,\n selector: 'bulletList',\n icon: DtIconListBullet,\n dataQA: 'dt-recipe-editor-list-items-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL'),\n onClick: this.onBulletListToggle,\n },\n {\n showBtn: this.showOrderedListButton,\n selector: 'orderedList',\n icon: DtIconListOrdered,\n dataQA: 'dt-recipe-editor-ordered-list-items-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL'),\n onClick: this.onOrderedListToggle,\n },\n ].filter(button => button.showBtn);\n },\n\n individualButtons () {\n return [\n {\n showBtn: this.showQuoteButton,\n selector: 'blockquote',\n icon: DtIconQuote,\n dataQA: 'dt-recipe-editor-blockquote-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_QUOTE_BUTTON_LABEL'),\n onClick: this.onBlockquoteToggle,\n },\n {\n showBtn: this.showCodeBlockButton,\n selector: 'codeBlock',\n icon: DtIconCodeBlock,\n dataQA: 'dt-recipe-editor-code-block-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_CODE_BUTTON_LABEL'),\n onClick: this.onCodeBlockToggle,\n },\n {\n showBtn: this.showInlineImageButton,\n selector: 'image',\n icon: DtIconImage,\n dataQA: 'dt-recipe-editor-inline-image-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_IMAGE_BUTTON_LABEL'),\n // Handle getting image\n onClick: this.onInsertInlineImageClick,\n },\n ].filter(button => button.showBtn);\n },\n\n linkButton () {\n return {\n showBtn: this.showAddLink.showAddLinkButton,\n selector: 'link',\n icon: DtIconLink2,\n dataQA: 'dt-recipe-editor-add-link-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_LINK_BUTTON_LABEL'),\n onClick: this.openLinkInput,\n };\n },\n\n confirmSetLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON');\n },\n\n cancelSetLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON');\n },\n\n removeLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_REMOVE_LINK_BUTTON');\n },\n\n showAddLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_ADD_LINK_BUTTON');\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n onInputFocus (event) {\n event?.stopPropagation();\n },\n\n removeLink () {\n this.$refs.richTextEditor?.editor?.chain()?.focus()?.unsetLink()?.run();\n this.closeLinkInput();\n },\n\n setLink (event) {\n const editor = this.$refs.richTextEditor?.editor;\n event?.preventDefault();\n event?.stopPropagation();\n\n if (!this.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 = EDITOR_SUPPORTED_LINK_PROTOCOLS.find(prefixRegex => prefixRegex.test(this.linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n this.linkInput = `${EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`;\n }\n\n const selection = editor?.view?.state?.selection;\n\n if (selection.anchor === selection.head) {\n // If no text has been selected, manually insert the link text.\n // Do not rely on link options set through DtRichTextEditor\n // component, because they clash with these and cause issues.\n editor\n .chain()\n .focus()\n .insertContentAt(\n selection.anchor,\n `<a class=\"${this.linkOptions.class}\" href=${this.linkInput}>${this.linkInput}</a>`,\n )\n .run();\n } else {\n // Set or edit the link\n editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: this.linkInput, class: this.linkOptions.class })\n .run();\n }\n\n this.closeLinkInput();\n },\n\n openLinkInput () {\n this.showLinkInput = true;\n },\n\n updateInput (openedInput) {\n if (!openedInput) {\n return this.closeLinkInput();\n }\n this.linkInput = this.$refs.richTextEditor?.editor?.getAttributes('link')?.href;\n },\n\n closeLinkInput () {\n this.showLinkInput = false;\n this.linkInput = '';\n this.$refs.richTextEditor.editor?.chain().focus();\n },\n\n onBoldTextToggle () {\n this.$refs.richTextEditor?.editor?.chain().focus().toggleBold().run();\n },\n\n onItalicTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleItalic().run();\n },\n\n onUnderlineTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleUnderline().run();\n },\n\n onStrikethroughTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleStrike().run();\n },\n\n onTextAlign (alignment) {\n if (this.$refs.richTextEditor?.editor?.isActive({ textAlign: alignment })) {\n // If this alignment type is already set here, unset it\n return this.$refs.richTextEditor?.editor.chain().focus().unsetTextAlign().run();\n }\n this.$refs.richTextEditor?.editor.chain().focus().setTextAlign(alignment).run();\n },\n\n onBulletListToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleBulletList().run();\n },\n\n onOrderedListToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleOrderedList().run();\n },\n\n onCodeBlockToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleCodeBlock().run();\n },\n\n onQuickRepliesClick () {\n this.$emit('quick-replies-click');\n },\n\n onInsertInlineImageClick () {\n this.$emit('inline-image-click');\n },\n\n insertInlineImage (imageUrl) {\n this.$refs.richTextEditor?.editor.chain().focus().setImage({ src: imageUrl }).run();\n },\n\n insertInMessageBody (messageContent) {\n this.$refs.richTextEditor?.editor.chain().focus().insertContent(messageContent).run();\n },\n\n setCursorPosition (position = null) {\n this.$refs.richTextEditor?.editor.chain().focus(position).run();\n },\n\n onBlockquoteToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleBlockquote().run();\n },\n\n onTextInput (input) {\n this.$emit('text-input', input);\n },\n\n onFocus (event) {\n this.hasFocus = true;\n this.$emit('focus', event);\n },\n\n onBlur (event) {\n this.hasFocus = false;\n this.$emit('blur', event);\n },\n\n onInput (event) {\n this.$emit('input', event);\n this.$emit('update:modelValue', event);\n },\n\n getButtonKey (key, selector) {\n return `${key}-${JSON.stringify(selector)}`;\n },\n\n // Unique Button Ref Key to identify ref\n getButtonRef (key, selector) {\n return `${this.getButtonKey(key, selector)}-ref`;\n },\n\n /**\n * Determines if an element in the action bar button list is focusable with tab key\n * @param {string} refKey - unique identifier for the ref element in DOM\n */\n canFocus (refKey) {\n return refKey === this.orderedRefs[this.currentButtonRefIndex];\n },\n\n shiftActionBarFocusRight () {\n this.shiftButtonRefIndex(1);\n },\n\n shiftActionBarFocusLeft () {\n this.shiftButtonRefIndex(-1);\n },\n\n shiftButtonRefIndex (shiftAmount) {\n const previousRef = this.$refs[this.orderedRefs[this.currentButtonRefIndex]];\n const previousActionBarBtn = Array.isArray(previousRef) ? previousRef[0] : previousRef;\n const index = (this.currentButtonRefIndex + shiftAmount) % this.orderedRefs.length;\n this.currentButtonRefIndex = index >= 0 ? index : this.orderedRefs.length + index;\n const currentRef = this.$refs[this.orderedRefs[this.currentButtonRefIndex]];\n const currentActionBarBtn = Array.isArray(currentRef) ? currentRef[0] : currentRef;\n previousActionBarBtn.$el.blur();\n currentActionBarBtn.$el.focus();\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtRichTextEditor","DtButton","DtPopover","DtStack","DtInput","DtTooltip","DtIconQuickReply","DtIconBold","DtIconItalic","DtIconUnderline","DtIconStrikethrough","DtIconListBullet","DtIconListOrdered","DtIconAlignLeft","DtIconAlignCenter","DtIconAlignRight","DtIconAlignJustify","DtIconQuote","DtIconCodeBlock","DtIconLink2","DtIconImage","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","DialtoneLocalization","RICH_TEXT_EDITOR_OUTPUT_FORMATS","refs","acc","buttonData","button","individualButtonStacks","buttonGroupData","newValue","removeClassStyleAttrs","addClassStyleAttrs","event","_e","_d","_c","_b","_a","editor","EDITOR_SUPPORTED_LINK_PROTOCOLS","prefixRegex","EDITOR_DEFAULT_LINK_PREFIX","selection","openedInput","alignment","imageUrl","messageContent","position","input","key","selector","refKey","shiftAmount","previousRef","previousActionBarBtn","index","currentRef","currentActionBarBtn","_hoisted_1","_createElementBlock","_mergeProps","$options","_ctx","_cache","$event","_createVNode","_component_dt_stack","_Fragment","_renderList","buttonGroup","_createBlock","_openBlock","_component_dt_tooltip","_component_dt_button","_resolveDynamicComponent","_toDisplayString","_createElementVNode","_component_dt_popover","$data","_component_dt_input","$props","_createTextVNode","_component_dt_rich_text_editor"],"mappings":"+nBAiOKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,iBAEN,WAAY,CACV,iBAAAC,EAAAA,QACA,SAAAC,EAAAA,QACA,UAAAC,EAAAA,QACA,QAAAC,EAAAA,QACA,QAAAC,EAAAA,QACA,UAAAC,EAAAA,QACA,iBAAAC,EAAAA,4BACAC,EAAAA,wBACAC,EAAAA,aACA,gBAAAC,EAAAA,gBACA,oBAAAC,EAAAA,oBACA,iBAAAC,EAAAA,iBACA,kBAAAC,EAAAA,kBACA,gBAAAC,EAAAA,gBACA,kBAAAC,EAAAA,kBACA,iBAAAC,EAAAA,iBACA,mBAAAC,EAAAA,+BACAC,EAAAA,YACA,gBAAAC,EAAAA,4BACAC,EAAAA,wBACAC,EAAAA,aAGF,OAAQ,CAAA,EAER,aAAc,GAEd,MAAO,CAKL,WAAY,CACV,KAAM,CAAC,OAAQ,MAAM,EACrB,QAAS,IAMX,SAAU,CACR,KAAM,QACN,QAAS,IAMX,eAAgB,CACd,KAAM,OACN,SAAU,GACV,QAAS,IAQX,WAAY,CACV,KAAM,OACN,QAAS,IAcX,UAAW,CACT,KAAM,CAAC,QAAS,OAAQ,MAAM,EAC9B,QAAS,GACT,UAAWC,EAAW,CACpB,OAAI,OAAOA,GAAc,SAChBC,EAAAA,iCAAiC,SAASD,CAAS,EAErD,EACT,GAMF,YAAa,CACX,KAAM,OACN,QAAS,IAOX,UAAW,CACT,KAAM,OACN,QAAS,SAMX,mBAAoB,CAClB,KAAM,OACN,QAAS,IAMX,eAAgB,CACd,KAAM,QACN,QAAS,IAMX,kBAAmB,CACjB,KAAM,QACN,QAAS,I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AS,CAAA,EACjC,MAAM,6BAENf,EAAAA,YAuBEiB,EAvBFtB,aAuBE,CAtBA,IAAI,4BACKkB,EAAA,wDAAAA,EAAA,mBAAkBd,GAC1B,mBAAkB,GAClB,oBAAmB,GACnB,sBAAqB,GACrB,oBAAmB,GACnB,wBAAuB,GACvB,aAAYgB,EAAA,UACZ,SAAUA,EAAA,SACV,mBAAkBA,EAAA,eAClB,gDAA+CA,EAAA,UAAU,GACzD,KAAM,GACN,gBAAenB,EAAA,iBACf,YAAamB,EAAA,YACb,eAAcA,EAAA,WACd,eAAcA,EAAA,YACf,UAAQ,qBACA,EAAAnB,EAAA,sBAAsBC,EAAA,MAAM,EAAA,CACnC,YAAYD,EAAA,YACZ,OAAMA,EAAA,OACN,QAAOA,EAAA,QACP,QAAKE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEH,EAAA,QAAQG,CAAM"}
|
|
1
|
+
{"version":3,"file":"editor.cjs","sources":["../../../recipes/conversation_view/editor/editor.vue"],"sourcesContent":["<template>\n <div\n class=\"d-recipe-editor\"\n v-bind=\"addClassStyleAttrs($attrs)\"\n data-qa=\"dt-recipe-editor\"\n role=\"presentation\"\n @click=\"$refs.richTextEditor.focusEditor()\"\n >\n <!-- Section for the top UI -->\n <dt-stack\n class=\"d-recipe-editor__top-bar\"\n direction=\"row\"\n gap=\"450\"\n >\n <dt-stack\n v-for=\"buttonGroup in buttonGroups\"\n :key=\"buttonGroup.key\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-tooltip\n v-for=\"button in buttonGroup.buttonGroup\"\n :key=\"getButtonKey(buttonGroup.key, button.selector)\"\n :message=\"button.tooltipMessage\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n :ref=\"getButtonRef(buttonGroup.key, button.selector)\"\n :active=\"$refs.richTextEditor?.editor?.isActive(button.selector)\"\n :aria-label=\"button.tooltipMessage\"\n :data-qa=\"button.dataQA\"\n :tabindex=\"canFocus(getButtonRef(buttonGroup.key, button.selector)) ? 0 : -1\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n @click=\"button.onClick()\"\n @keydown.right.stop=\"shiftActionBarFocusRight\"\n @keydown.left.stop=\"shiftActionBarFocusLeft\"\n >\n <template #icon>\n <component\n :is=\"button.icon\"\n size=\"200\"\n />\n </template>\n {{ button?.label }}\n </dt-button>\n </template>\n </dt-tooltip>\n <div class=\"d-recipe-editor__button-group-divider\" />\n </dt-stack>\n <dt-stack\n v-if=\"variableButton.showBtn\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-popover\n padding=\"small\"\n navigation-type=\"arrow-keys\"\n :modal=\"false\"\n placement=\"bottom-start\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-tooltip\n :message=\"variableButton.tooltipMessage\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n v-bind=\"attrs\"\n kind=\"muted\"\n size=\"xs\"\n importance=\"clear\"\n :aria-label=\"variableButton.tooltipMessage\"\n :data-qa=\"variableButton.dataQA\"\n label-class=\"d-jc-flex-start\"\n >\n <template #icon>\n <component\n :is=\"variableButton.icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </template>\n <template #content=\"{ close }\">\n <dt-input\n v-model=\"variableSearchValue\"\n root-class=\"d-p8 d-pb4 d-w264\"\n type=\"search\"\n :placeholder=\"i18n.$t('DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER')\"\n size=\"md\"\n role=\"menuitem\"\n >\n <template #leftIcon=\"{ iconSize }\">\n <dt-icon-search :size=\"iconSize\" />\n </template>\n </dt-input>\n <dt-list-item-group\n v-for=\"(category, index) in filteredCategories\"\n :key=\"category.name\"\n :heading=\"category.name\"\n heading-class=\"d-headline--sm-compact d-p8\"\n >\n <dt-list-item\n v-for=\"item in getFilteredItemsForCategory(category)\"\n :key=\"category.name + item.name\"\n role=\"menuitem\"\n navigation-type=\"arrow-keys\"\n @click=\"\n insertVariable(category.name, item);\n close();\n \"\n >\n {{ item.name }}\n </dt-list-item>\n <dt-dropdown-separator\n v-if=\"index < filteredCategories.length - 1\"\n />\n </dt-list-item-group>\n </template>\n </dt-popover>\n <div class=\"d-recipe-editor__button-group-divider\" />\n </dt-stack>\n <dt-stack\n v-if=\"linkButton.showBtn\"\n direction=\"row\"\n gap=\"300\"\n >\n <dt-popover\n :open=\"showLinkInput\"\n :show-close-button=\"false\"\n data-qa=\"dt-recipe-editor-link-input-popover\"\n padding=\"none\"\n placement=\"bottom-start\"\n @click=\"onInputFocus\"\n @opened=\"updateInput\"\n @click.stop=\"onInputFocus\"\n >\n <template #anchor>\n <dt-tooltip\n :key=\"linkButton.key\"\n :message=\"linkButton.tooltipMessage\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n :ref=\"getButtonRef('custom', 'link')\"\n :active=\"$refs.richTextEditor?.editor?.isActive(linkButton.selector)\"\n :aria-label=\"linkButton.tooltipMessage\"\n :data-qa=\"linkButton.dataQA\"\n :tabindex=\"canFocus(getButtonRef('custom', 'link')) ? 0 : -1\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"xs\"\n @click=\"linkButton.onClick()\"\n @keydown.right.stop=\"shiftActionBarFocusRight\"\n @keydown.left.stop=\"shiftActionBarFocusLeft\"\n >\n <template #icon>\n <component\n :is=\"linkButton.icon\"\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </template>\n\n <template #content>\n <div class=\"d-recipe-editor__popover-content\">\n <span>\n {{ showAddLinkButtonLabels.title }}\n </span>\n <dt-input\n v-model=\"linkInput\"\n :input-aria-label=\"showAddLinkButtonLabels['aria-label']\"\n :placeholder=\"setLinkPlaceholder\"\n data-qa=\"dt-recipe-editor-link-input\"\n input-wrapper-class=\"d-recipe-editor-link__input-wrapper\"\n @click=\"onInputFocus\"\n @focus=\"onInputFocus\"\n @click.stop=\"onInputFocus\"\n @keydown.enter=\"setLink\"\n />\n </div>\n </template>\n <template #footerContent>\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n class=\"d-recipe-editor__popover-footer\"\n >\n <dt-button\n data-qa=\"dt-recipe-editor-remove-link-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"sm\"\n v-bind=\"removeLinkButtonLabels\"\n @click=\"removeLink\"\n >\n {{ removeLinkButtonLabels.title }}\n </dt-button>\n <dt-button\n data-qa=\"dt-recipe-editor-set-link-cancel-btn\"\n importance=\"clear\"\n kind=\"muted\"\n size=\"sm\"\n v-bind=\"cancelSetLinkButtonLabels\"\n @click=\"closeLinkInput\"\n >\n {{ cancelSetLinkButtonLabels.title }}\n </dt-button>\n <dt-button\n data-qa=\"dt-recipe-editor-set-link-confirm-btn\"\n size=\"sm\"\n v-bind=\"confirmSetLinkButtonLabels\"\n @click=\"setLink\"\n >\n {{ confirmSetLinkButtonLabels.title }}\n </dt-button>\n </dt-stack>\n </template>\n </dt-popover>\n </dt-stack>\n </dt-stack>\n\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n :style=\"{ 'max-height': maxHeight }\"\n class=\"d-recipe-editor__content\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :allow-font-color=\"true\"\n :allow-font-family=\"true\"\n :allow-inline-images=\"true\"\n :allow-line-breaks=\"true\"\n :allow-variable=\"true\"\n :variable-items=\"flattenedVariableItems\"\n :hide-link-bubble-menu=\"true\"\n :auto-focus=\"autoFocus\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"`d-recipe-editor__content-input ${inputClass}`\"\n :link=\"true\"\n :output-format=\"htmlOutputFormat\"\n :placeholder=\"placeholder\"\n :use-div-tags=\"useDivTags\"\n :allow-tables=\"allowTables\"\n data-qa=\"dt-rich-text-editor\"\n v-bind=\"removeClassStyleAttrs($attrs)\"\n @text-input=\"onTextInput\"\n @blur=\"onBlur\"\n @focus=\"onFocus\"\n @input=\"onInput($event)\"\n />\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from './editor_constants.js';\nimport { removeClassStyleAttrs, addClassStyleAttrs } from '@/common/utils';\nimport { DtButton } from '@/components/button';\nimport { DtPopover } from '@/components/popover';\nimport { DtStack } from '@/components/stack';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport {DtListItem} from '@/components/list_item/index.js';\nimport {DtDropdownSeparator} from '@/components/dropdown/index.js';\nimport {DtListItemGroup} from '@/components/list_item_group/index.js';\nimport {\n DtIconAlignCenter,\n DtIconAlignJustify,\n DtIconAlignLeft,\n DtIconAlignRight,\n DtIconBold,\n DtIconCodeBlock,\n DtIconImage,\n DtIconItalic,\n DtIconQuickReply,\n DtIconLink2,\n DtIconListBullet,\n DtIconListOrdered,\n DtIconQuote,\n DtIconStrikethrough,\n DtIconUnderline,\n DtIconBraces,\n DtIconSearch,\n} from '@dialpad/dialtone-icons/vue3';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeEditor',\n\n components: {\n DtListItemGroup,\n DtDropdownSeparator,\n DtListItem,\n DtRichTextEditor,\n DtButton,\n DtPopover,\n DtStack,\n DtInput,\n DtTooltip,\n DtIconQuickReply,\n DtIconBold,\n DtIconItalic,\n DtIconUnderline,\n DtIconStrikethrough,\n DtIconListBullet,\n DtIconListOrdered,\n DtIconAlignLeft,\n DtIconAlignCenter,\n DtIconAlignRight,\n DtIconAlignJustify,\n DtIconQuote,\n DtIconCodeBlock,\n DtIconLink2,\n DtIconImage,\n DtIconBraces,\n DtIconSearch,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n modelValue: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * 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 * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n /**\n * Placeholder text for the set link input field\n */\n setLinkPlaceholder: {\n type: String,\n default: '',\n },\n\n /**\n * Show button to render text as bold\n */\n showBoldButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render text in italics\n */\n showItalicsButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to underline text\n */\n showUnderlineButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to strike text\n */\n showStrikeButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render list items\n */\n showListItemsButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to render ordered list items\n */\n showOrderedListButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the left\n */\n showAlignLeftButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the center\n */\n showAlignCenterButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to align text to the right\n */\n showAlignRightButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to justify text\n */\n showAlignJustifyButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add quote format to text\n */\n showQuoteButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add code block\n */\n showCodeBlockButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to handle quick replies\n */\n showQuickRepliesButton: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Show button to add an inline image\n */\n showInlineImageButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Show button to add a variable\n */\n showVariableButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Variable categories to display when variable button is clicked\n */\n variableCategories: {\n type: Array,\n default: () => [],\n },\n\n /**\n * Show add link default config.\n */\n showAddLink: {\n type: Object,\n default: () => ({\n showAddLinkButton: true,\n }),\n },\n\n /**\n * Use div tags instead of paragraph tags to show text\n */\n useDivTags: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Allow Tables to be used in to the editor\n */\n allowTables: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native focus event\n * @event input\n * @type {String|JSON}\n */\n 'focus',\n\n /**\n * Native blur event\n * @event input\n * @type {String|JSON}\n */\n 'blur',\n\n /**\n * Native input event\n * @event input\n * @type {String|JSON}\n */\n 'input',\n\n /**\n * Event fired to sync the modelValue prop with the parent component\n * @event input\n * @type {String|JSON}\n */\n 'update:modelValue',\n\n /**\n * Quick replies button\n * pressed event\n * @event quick-replies-click\n */\n 'quick-replies-click',\n\n /**\n * Emit when inline image button is clicked\n * @event inline-image-click\n */\n 'inline-image-click',\n\n /**\n * Emit when text input is changed\n * @event text-input\n * @type {String}\n */\n 'text-input',\n ],\n\n data () {\n return {\n internalInputValue: this.modelValue, // internal input content\n hasFocus: false,\n\n linkOptions: {\n class: 'd-recipe-editor__link',\n },\n\n showLinkInput: false,\n linkInput: '',\n currentButtonRefIndex: 0,\n variableSearchValue: '',\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n inputLength () {\n return this.internalInputValue.length;\n },\n\n htmlOutputFormat () {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS[2];\n },\n\n flattenedVariableItems () {\n if (!this.variableCategories) return [];\n return this.variableCategories.reduce((acc, category) => {\n return acc.concat(category.items || []);\n }, []);\n },\n\n showingTextFormatButtons () {\n return this.showBoldButton || this.showItalicsButton || this.showStrikeButton || this.showUnderlineButton;\n },\n\n showingAlignmentButtons () {\n return this.showAlignLeftButton || this.showAlignCenterButton ||\n this.showAlignRightButton || this.showAlignJustifyButton;\n },\n\n showingListButtons () {\n return this.showListItemsButton || this.showOrderedListButton;\n },\n\n orderedRefs () {\n const refs = this.buttonGroups.reduce(function (acc, buttonData) {\n buttonData.buttonGroup.forEach(button => {\n acc.push(this.getButtonRef(buttonData.key, button.selector));\n }, this);\n return acc;\n }.bind(this), []);\n refs.push(this.getButtonRef('custom', 'link'));\n return refs;\n },\n\n buttonGroups () {\n const individualButtonStacks = this.individualButtons.map(buttonData => ({\n key: buttonData.selector,\n buttonGroup: [buttonData],\n }));\n return [\n { key: 'new', buttonGroup: this.newButtons },\n { key: 'format', buttonGroup: this.textFormatButtons },\n { key: 'alignment', buttonGroup: this.alignmentButtons },\n { key: 'list', buttonGroup: this.listButtons },\n ...individualButtonStacks,\n ].filter(buttonGroupData => buttonGroupData.buttonGroup.length > 0);\n },\n\n newButtons () {\n return [\n {\n showBtn: this.showQuickRepliesButton,\n label: this.i18n.$t('DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL'),\n selector: 'quickReplies',\n icon: DtIconQuickReply,\n dataQA: 'dt-recipe-editor-quick-replies-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL'),\n onClick: this.onQuickRepliesClick,\n },\n ].filter(button => button.showBtn);\n },\n\n textFormatButtons () {\n return [\n {\n showBtn: this.showBoldButton,\n selector: 'bold',\n icon: DtIconBold,\n dataQA: 'dt-recipe-editor-bold-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_BOLD_BUTTON_LABEL'),\n onClick: this.onBoldTextToggle,\n },\n {\n showBtn: this.showItalicsButton,\n selector: 'italic',\n icon: DtIconItalic,\n dataQA: 'dt-recipe-editor-italics-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ITALICS_BUTTON_LABEL'),\n onClick: this.onItalicTextToggle,\n },\n {\n showBtn: this.showUnderlineButton,\n selector: 'underline',\n icon: DtIconUnderline,\n dataQA: 'dt-recipe-editor-underline-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL'),\n onClick: this.onUnderlineTextToggle,\n },\n {\n showBtn: this.showStrikeButton,\n selector: 'strike',\n icon: DtIconStrikethrough,\n dataQA: 'dt-recipe-editor-strike-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_STRIKE_BUTTON_LABEL'),\n onClick: this.onStrikethroughTextToggle,\n },\n ].filter(button => button.showBtn);\n },\n\n alignmentButtons () {\n return [\n {\n showBtn: this.showAlignLeftButton,\n selector: { textAlign: 'left' },\n icon: DtIconAlignLeft,\n dataQA: 'dt-recipe-editor-align-left-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('left'),\n },\n {\n showBtn: this.showAlignCenterButton,\n selector: { textAlign: 'center' },\n icon: DtIconAlignCenter,\n dataQA: 'dt-recipe-editor-align-center-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('center'),\n },\n {\n showBtn: this.showAlignRightButton,\n selector: { textAlign: 'right' },\n icon: DtIconAlignRight,\n dataQA: 'dt-recipe-editor-align-right-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('right'),\n },\n {\n showBtn: this.showAlignJustifyButton,\n selector: { textAlign: 'justify' },\n icon: DtIconAlignJustify,\n dataQA: 'dt-recipe-editor-align-justify-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL'),\n onClick: () => this.onTextAlign('justify'),\n },\n ].filter(button => button.showBtn);\n },\n\n listButtons () {\n return [\n {\n showBtn: this.showListItemsButton,\n selector: 'bulletList',\n icon: DtIconListBullet,\n dataQA: 'dt-recipe-editor-list-items-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL'),\n onClick: this.onBulletListToggle,\n },\n {\n showBtn: this.showOrderedListButton,\n selector: 'orderedList',\n icon: DtIconListOrdered,\n dataQA: 'dt-recipe-editor-ordered-list-items-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL'),\n onClick: this.onOrderedListToggle,\n },\n ].filter(button => button.showBtn);\n },\n\n individualButtons () {\n return [\n {\n showBtn: this.showQuoteButton,\n selector: 'blockquote',\n icon: DtIconQuote,\n dataQA: 'dt-recipe-editor-blockquote-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_QUOTE_BUTTON_LABEL'),\n onClick: this.onBlockquoteToggle,\n },\n {\n showBtn: this.showCodeBlockButton,\n selector: 'codeBlock',\n icon: DtIconCodeBlock,\n dataQA: 'dt-recipe-editor-code-block-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_CODE_BUTTON_LABEL'),\n onClick: this.onCodeBlockToggle,\n },\n {\n showBtn: this.showInlineImageButton,\n selector: 'image',\n icon: DtIconImage,\n dataQA: 'dt-recipe-editor-inline-image-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_IMAGE_BUTTON_LABEL'),\n // Handle getting image\n onClick: this.onInsertInlineImageClick,\n },\n ].filter(button => button.showBtn);\n },\n\n linkButton () {\n return {\n showBtn: this.showAddLink.showAddLinkButton,\n selector: 'link',\n icon: DtIconLink2,\n dataQA: 'dt-recipe-editor-add-link-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_LINK_BUTTON_LABEL'),\n onClick: this.openLinkInput,\n };\n },\n\n variableButton() {\n return {\n showBtn: this.showVariableButton,\n selector: 'variable',\n icon: DtIconBraces,\n dataQA: 'dt-recipe-editor-variable-btn',\n tooltipMessage: this.i18n.$t('DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL'),\n }\n },\n\n\n confirmSetLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON');\n },\n\n cancelSetLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON');\n },\n\n removeLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_REMOVE_LINK_BUTTON');\n },\n\n showAddLinkButtonLabels () {\n return this.i18n.$ta('DIALTONE_EDITOR_ADD_LINK_BUTTON');\n },\n\n filteredCategories() {\n return this.variableCategories.filter(\n (category) => this.getFilteredItemsForCategory(category).length,\n );\n },\n },\n\n watch: {\n modelValue (newValue) {\n this.internalInputValue = newValue;\n },\n },\n\n methods: {\n removeClassStyleAttrs,\n addClassStyleAttrs,\n\n onInputFocus (event) {\n event?.stopPropagation();\n },\n\n removeLink () {\n this.$refs.richTextEditor?.editor?.chain()?.focus()?.unsetLink()?.run();\n this.closeLinkInput();\n },\n\n setLink (event) {\n const editor = this.$refs.richTextEditor?.editor;\n event?.preventDefault();\n event?.stopPropagation();\n\n if (!this.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 = EDITOR_SUPPORTED_LINK_PROTOCOLS.find(prefixRegex => prefixRegex.test(this.linkInput));\n\n if (!prefix) {\n // If no matching pattern is found, prepend default prefix\n this.linkInput = `${EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`;\n }\n\n const selection = editor?.view?.state?.selection;\n\n if (selection.anchor === selection.head) {\n // If no text has been selected, manually insert the link text.\n // Do not rely on link options set through DtRichTextEditor\n // component, because they clash with these and cause issues.\n editor\n .chain()\n .focus()\n .insertContentAt(\n selection.anchor,\n `<a class=\"${this.linkOptions.class}\" href=${this.linkInput}>${this.linkInput}</a>`,\n )\n .run();\n } else {\n // Set or edit the link\n editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: this.linkInput, class: this.linkOptions.class })\n .run();\n }\n\n this.closeLinkInput();\n },\n\n openLinkInput () {\n this.showLinkInput = true;\n },\n\n updateInput (openedInput) {\n if (!openedInput) {\n return this.closeLinkInput();\n }\n this.linkInput = this.$refs.richTextEditor?.editor?.getAttributes('link')?.href;\n },\n\n closeLinkInput () {\n this.showLinkInput = false;\n this.linkInput = '';\n this.$refs.richTextEditor.editor?.chain().focus();\n },\n\n onBoldTextToggle () {\n this.$refs.richTextEditor?.editor?.chain().focus().toggleBold().run();\n },\n\n onItalicTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleItalic().run();\n },\n\n onUnderlineTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleUnderline().run();\n },\n\n onStrikethroughTextToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleStrike().run();\n },\n\n onTextAlign (alignment) {\n if (this.$refs.richTextEditor?.editor?.isActive({ textAlign: alignment })) {\n // If this alignment type is already set here, unset it\n return this.$refs.richTextEditor?.editor.chain().focus().unsetTextAlign().run();\n }\n this.$refs.richTextEditor?.editor.chain().focus().setTextAlign(alignment).run();\n },\n\n onBulletListToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleBulletList().run();\n },\n\n onOrderedListToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleOrderedList().run();\n },\n\n onCodeBlockToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleCodeBlock().run();\n },\n\n onQuickRepliesClick () {\n this.$emit('quick-replies-click');\n },\n\n onInsertInlineImageClick () {\n this.$emit('inline-image-click');\n },\n\n insertVariable (categoryName, variableData) {\n // Insert a variable using the custom command from the Variable extension\n this.$refs.richTextEditor?.editor.chain().focus().insertVariable({\n id: variableData.id,\n placeholder: variableData.placeholder || '',\n altText: '',\n }).run();\n },\n\n insertInlineImage (imageUrl) {\n this.$refs.richTextEditor?.editor.chain().focus().setImage({ src: imageUrl }).run();\n },\n\n insertInMessageBody (messageContent) {\n this.$refs.richTextEditor?.editor.chain().focus().insertContent(messageContent).run();\n },\n\n setCursorPosition (position = null) {\n this.$refs.richTextEditor?.editor.chain().focus(position).run();\n },\n\n onBlockquoteToggle () {\n this.$refs.richTextEditor?.editor.chain().focus().toggleBlockquote().run();\n },\n\n onTextInput (input) {\n this.$emit('text-input', input);\n },\n\n onFocus (event) {\n this.hasFocus = true;\n this.$emit('focus', event);\n },\n\n onBlur (event) {\n this.hasFocus = false;\n this.$emit('blur', event);\n },\n\n onInput (event) {\n this.$emit('input', event);\n this.$emit('update:modelValue', event);\n },\n\n getButtonKey (key, selector) {\n return `${key}-${JSON.stringify(selector)}`;\n },\n\n // Unique Button Ref Key to identify ref\n getButtonRef (key, selector) {\n return `${this.getButtonKey(key, selector)}-ref`;\n },\n\n /**\n * Determines if an element in the action bar button list is focusable with tab key\n * @param {string} refKey - unique identifier for the ref element in DOM\n */\n canFocus (refKey) {\n return refKey === this.orderedRefs[this.currentButtonRefIndex];\n },\n\n shiftActionBarFocusRight () {\n this.shiftButtonRefIndex(1);\n },\n\n shiftActionBarFocusLeft () {\n this.shiftButtonRefIndex(-1);\n },\n\n shiftButtonRefIndex (shiftAmount) {\n const previousRef = this.$refs[this.orderedRefs[this.currentButtonRefIndex]];\n const previousActionBarBtn = Array.isArray(previousRef) ? previousRef[0] : previousRef;\n const index = (this.currentButtonRefIndex + shiftAmount) % this.orderedRefs.length;\n this.currentButtonRefIndex = index >= 0 ? index : this.orderedRefs.length + index;\n const currentRef = this.$refs[this.orderedRefs[this.currentButtonRefIndex]];\n const currentActionBarBtn = Array.isArray(currentRef) ? currentRef[0] : currentRef;\n previousActionBarBtn.$el.blur();\n currentActionBarBtn.$el.focus();\n },\n\n getFilteredItemsForCategory(category) {\n const searchValue = this.variableSearchValue.toLowerCase();\n if (category.name.toLowerCase().includes(searchValue)) {\n return category.items;\n }\n return category.items.filter((item) =>\n item.name.toLowerCase().includes(searchValue),\n );\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtListItemGroup","DtDropdownSeparator","DtListItem","DtRichTextEditor","DtButton","DtPopover","DtStack","DtInput","DtTooltip","DtIconQuickReply","DtIconBold","DtIconItalic","DtIconUnderline","DtIconStrikethrough","DtIconListBullet","DtIconListOrdered","DtIconAlignLeft","DtIconAlignCenter","DtIconAlignRight","DtIconAlignJustify","DtIconQuote","DtIconCodeBlock","DtIconLink2","DtIconImage","DtIconBraces","DtIconSearch","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","DialtoneLocalization","RICH_TEXT_EDITOR_OUTPUT_FORMATS","acc","category","refs","buttonData","button","individualButtonStacks","buttonGroupData","newValue","removeClassStyleAttrs","addClassStyleAttrs","event","_e","_d","_c","_b","_a","editor","EDITOR_SUPPORTED_LINK_PROTOCOLS","prefixRegex","EDITOR_DEFAULT_LINK_PREFIX","selection","openedInput","alignment","categoryName","variableData","imageUrl","messageContent","position","input","key","selector","refKey","shiftAmount","previousRef","previousActionBarBtn","index","currentRef","currentActionBarBtn","searchValue","item","_hoisted_1","_createElementBlock","_mergeProps","$options","_ctx","_cache","$event","_createVNode","_component_dt_stack","_Fragment","_renderList","buttonGroup","_createBlock","_openBlock","_component_dt_tooltip","_component_dt_button","_resolveDynamicComponent","_toDisplayString","_createElementVNode","_component_dt_popover","_withCtx","attrs","close","_component_dt_input","$data","iconSize","_component_dt_icon_search","_component_dt_list_item_group","_component_dt_list_item","_createTextVNode","_component_dt_dropdown_separator","$props","_component_dt_rich_text_editor"],"mappings":"2wBAmTKA,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,iBAEN,WAAY,CACV,gBAAAC,EAAAA,QACA,oBAAAC,EAAAA,mBACAC,EAAAA,QACA,iBAAAC,EAAAA,QACA,SAAAC,EAAAA,QACA,UAAAC,EAAAA,QACA,QAAAC,EAAAA,QACA,QAAAC,EAAAA,QACA,UAAAC,EAAAA,QACA,iBAAAC,EAAAA,4BACAC,EAAAA,wBACAC,EAAAA,aACA,gBAAAC,EAAAA,gBACA,oBAAAC,EAAAA,oBACA,iBAAAC,EAAAA,iBACA,kBAAAC,EAAAA,kBACA,gBAAAC,EAAAA,gBACA,kBAAAC,EAAAA,kBACA,iBAAAC,EAAAA,iBACA,mBAAAC,EAAAA,+BACAC,EAAAA,YACA,gBAAAC,EAAAA,4BACAC,EAAAA,wBACAC,EAAAA,yBACAC,EAAAA,0BACAC,EAAAA,cAGF,OAAQ,CAAA,EAER,aAAc,GAEd,MAAO,CAKL,WAAY,CACV,KAAM,CAAC,OAAQ,MAAM,EACrB,QAAS,IAMX,SAAU,CACR,KAAM,QACN,QAAS,IAMX,eAAgB,CACd,KAAM,OACN,SAAU,GACV,QAAS,IAQX,WAAY,CACV,KAAM,OACN,QAAS,IAcX,UAAW,CACT,KAAM,CAAC,QAAS,OAAQ,MAAM,EAC9B,QAAS,GACT,UAAWC,EAAW,CACpB,OAAI,OAAOA,GAAc,SAChBC,EAAAA,iCAAiC,SAASD,CAAS,EAErD,EACT,GAMF,YAAa,CACX,KAAM,OACN,QAAS,IAOX,UAAW,CACT,KAAM,OACN,QAAS,SAMX,mBAAoB,CAClB,KAAM,OACN,QAAS,IAMX,eAAgB,CACd,KAAM,QACN,QAAS,IAMX,kBAAmB,CACjB,KAAM,QACN,QAAS,IAMX,oBAAqB,CACnB,KA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