@dialpad/dialtone 9.133.0 → 9.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dialtone-default-theme.css +92 -54
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone.css +92 -54
- package/dist/css/dialtone.min.css +1 -1
- package/dist/css/tokens-docs.json +1 -1
- package/dist/tokens/doc.json +42748 -42748
- package/dist/vue2/common/emoji/index.cjs +1 -1
- package/dist/vue2/common/emoji/index.cjs.map +1 -1
- package/dist/vue2/common/emoji/index.js +46 -39
- package/dist/vue2/common/emoji/index.js.map +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -1
- package/dist/vue2/dialtone-vue.js +360 -359
- package/dist/vue2/lib/avatar/utils.cjs +1 -1
- package/dist/vue2/lib/avatar/utils.cjs.map +1 -1
- package/dist/vue2/lib/avatar/utils.js +6 -5
- package/dist/vue2/lib/avatar/utils.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +34 -32
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +4 -4
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +1 -1
- package/dist/vue2/lib/modal/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal/modal.js +25 -25
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.js +59 -29
- package/dist/vue2/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue2/localization/en-US.cjs +14 -1
- package/dist/vue2/localization/en-US.cjs.map +1 -1
- package/dist/vue2/localization/en-US.js +14 -1
- package/dist/vue2/localization/en-US.js.map +1 -1
- package/dist/vue2/localization/es-LA.cjs +8 -1
- package/dist/vue2/localization/es-LA.cjs.map +1 -1
- package/dist/vue2/localization/es-LA.js +8 -1
- package/dist/vue2/localization/es-LA.js.map +1 -1
- package/dist/vue2/types/common/emoji/index.d.ts +1 -0
- package/dist/vue2/types/common/emoji/index.d.ts.map +1 -1
- package/dist/vue2/types/components/avatar/utils.d.ts +1 -1
- package/dist/vue2/types/components/avatar/utils.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/common/emoji/index.cjs +1 -1
- package/dist/vue3/common/emoji/index.cjs.map +1 -1
- package/dist/vue3/common/emoji/index.js +46 -39
- package/dist/vue3/common/emoji/index.js.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/dialtone-vue.cjs +1 -1
- package/dist/vue3/dialtone-vue.js +363 -362
- package/dist/vue3/lib/avatar/utils.cjs +1 -1
- package/dist/vue3/lib/avatar/utils.cjs.map +1 -1
- package/dist/vue3/lib/avatar/utils.js +6 -5
- package/dist/vue3/lib/avatar/utils.js.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +50 -39
- package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.js +1 -0
- package/dist/vue3/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input.js +31 -28
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/modal/modal.cjs +1 -1
- package/dist/vue3/lib/modal/modal.cjs.map +1 -1
- package/dist/vue3/lib/modal/modal.js +39 -39
- package/dist/vue3/lib/modal/modal.js.map +1 -1
- package/dist/vue3/lib/toast/toast.cjs +1 -1
- package/dist/vue3/lib/toast/toast.cjs.map +1 -1
- package/dist/vue3/lib/toast/toast.js +96 -88
- package/dist/vue3/lib/toast/toast.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js +66 -36
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/en-US.cjs +14 -1
- package/dist/vue3/localization/en-US.cjs.map +1 -1
- package/dist/vue3/localization/en-US.js +14 -1
- package/dist/vue3/localization/en-US.js.map +1 -1
- package/dist/vue3/localization/es-LA.cjs +8 -1
- package/dist/vue3/localization/es-LA.cjs.map +1 -1
- package/dist/vue3/localization/es-LA.js +8 -1
- package/dist/vue3/localization/es-LA.js.map +1 -1
- package/dist/vue3/types/common/emoji/index.d.ts +1 -0
- package/dist/vue3/types/common/emoji/index.d.ts.map +1 -1
- package/dist/vue3/types/components/avatar/utils.d.ts +1 -1
- package/dist/vue3/types/components/avatar/utils.d.ts.map +1 -1
- package/dist/vue3/types/components/emoji_text_wrapper/emoji_text_wrapper.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +3 -0
- package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts +3 -0
- package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/toast/toast.vue.d.ts +6 -0
- package/dist/vue3/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=t=>{if(typeof t!="string"||!t.trim())return"";t=t.replace(/[^\p{L}\p{N}\s]/gu,"");const r=t.trim().split(/\s+/g);return r.length===1?r.join("").substring(0,2):r.filter((e,i)=>i===0||i===r.length-1).map(e=>e.slice(0,1).toUpperCase()).join("")};exports.extractInitialsFromName=s;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../components/avatar/utils.js"],"sourcesContent":["export const extractInitialsFromName = (fullName) => {\n if (typeof fullName !== 'string' || !fullName.trim()) return '';\n\n const names = fullName.trim().split(/\\s+/g);\n\n return names.length === 1\n ? names.join('').substring(0, 2)\n : names.filter((_, index) => (index === 0 || index === names.length - 1))\n .map(name => name.slice(0, 1).toUpperCase())\n .join('');\n};\n"],"names":["extractInitialsFromName","fullName","names","_","index","name"],"mappings":"gFAAY,MAACA,EAA2BC,GAAa,CACnD,GAAI,OAAOA,GAAa,UAAY,CAACA,EAAS,KAAI,EAAI,MAAO,
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../components/avatar/utils.js"],"sourcesContent":["export const extractInitialsFromName = (fullName) => {\n if (typeof fullName !== 'string' || !fullName.trim()) return '';\n\n // sanitize fullName by leaving only letters, numbers and spaces\n fullName = fullName.replace(/[^\\p{L}\\p{N}\\s]/gu, '');\n\n const names = fullName.trim().split(/\\s+/g);\n\n return names.length === 1\n ? names.join('').substring(0, 2)\n : names.filter((_, index) => (index === 0 || index === names.length - 1))\n .map(name => name.slice(0, 1).toUpperCase())\n .join('');\n};\n"],"names":["extractInitialsFromName","fullName","names","_","index","name"],"mappings":"gFAAY,MAACA,EAA2BC,GAAa,CACnD,GAAI,OAAOA,GAAa,UAAY,CAACA,EAAS,KAAI,EAAI,MAAO,GAG7DA,EAAWA,EAAS,QAAQ,oBAAqB,EAAE,EAEnD,MAAMC,EAAQD,EAAS,KAAI,EAAG,MAAM,MAAM,EAE1C,OAAOC,EAAM,SAAW,EACpBA,EAAM,KAAK,EAAE,EAAE,UAAU,EAAG,CAAC,EAC7BA,EAAM,OAAO,CAACC,EAAGC,IAAWA,IAAU,GAAKA,IAAUF,EAAM,OAAS,CAAE,EACrE,IAAIG,GAAQA,EAAK,MAAM,EAAG,CAAC,EAAE,YAAW,CAAE,EAC1C,KAAK,EAAE,CACd"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (typeof
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const n = (t) => {
|
|
2
|
+
if (typeof t != "string" || !t.trim()) return "";
|
|
3
|
+
t = t.replace(/[^\p{L}\p{N}\s]/gu, "");
|
|
4
|
+
const r = t.trim().split(/\s+/g);
|
|
5
|
+
return r.length === 1 ? r.join("").substring(0, 2) : r.filter((s, i) => i === 0 || i === r.length - 1).map((s) => s.slice(0, 1).toUpperCase()).join("");
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
n as extractInitialsFromName
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../components/avatar/utils.js"],"sourcesContent":["export const extractInitialsFromName = (fullName) => {\n if (typeof fullName !== 'string' || !fullName.trim()) return '';\n\n const names = fullName.trim().split(/\\s+/g);\n\n return names.length === 1\n ? names.join('').substring(0, 2)\n : names.filter((_, index) => (index === 0 || index === names.length - 1))\n .map(name => name.slice(0, 1).toUpperCase())\n .join('');\n};\n"],"names":["extractInitialsFromName","fullName","names","_","index","name"],"mappings":"AAAY,MAACA,IAA0B,CAACC,MAAa;AACnD,MAAI,OAAOA,KAAa,YAAY,CAACA,EAAS,KAAI,EAAI,QAAO;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../components/avatar/utils.js"],"sourcesContent":["export const extractInitialsFromName = (fullName) => {\n if (typeof fullName !== 'string' || !fullName.trim()) return '';\n\n // sanitize fullName by leaving only letters, numbers and spaces\n fullName = fullName.replace(/[^\\p{L}\\p{N}\\s]/gu, '');\n\n const names = fullName.trim().split(/\\s+/g);\n\n return names.length === 1\n ? names.join('').substring(0, 2)\n : names.filter((_, index) => (index === 0 || index === names.length - 1))\n .map(name => name.slice(0, 1).toUpperCase())\n .join('');\n};\n"],"names":["extractInitialsFromName","fullName","names","_","index","name"],"mappings":"AAAY,MAACA,IAA0B,CAACC,MAAa;AACnD,MAAI,OAAOA,KAAa,YAAY,CAACA,EAAS,KAAI,EAAI,QAAO;AAG7D,EAAAA,IAAWA,EAAS,QAAQ,qBAAqB,EAAE;AAEnD,QAAMC,IAAQD,EAAS,KAAI,EAAG,MAAM,MAAM;AAE1C,SAAOC,EAAM,WAAW,IACpBA,EAAM,KAAK,EAAE,EAAE,UAAU,GAAG,CAAC,IAC7BA,EAAM,OAAO,CAACC,GAAGC,MAAWA,MAAU,KAAKA,MAAUF,EAAM,SAAS,CAAE,EACrE,IAAI,CAAAG,MAAQA,EAAK,MAAM,GAAG,CAAC,EAAE,YAAW,CAAE,EAC1C,KAAK,EAAE;AACd;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./emoji-row-constants.cjs"),p=require("../../localization/index.cjs"),e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./emoji-row-constants.cjs"),p=require("../../localization/index.cjs"),u=require("../../common/emoji/index.cjs"),e=require("vue"),j=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),h=require("../emoji-text-wrapper/emoji-text-wrapper.cjs"),w=require("../emoji/emoji.cjs"),b=require("../button/button.cjs"),f=require("../tooltip/tooltip.cjs"),C={compatConfig:{MODE:3},name:"DtRecipeEmojiRow",components:{DtTooltip:f.default,DtButton:b.default,DtEmoji:w.default,DtEmojiTextWrapper:h.default},props:{reactions:{type:Array,default:()=>[],validator:o=>{for(const i of o)if(!_.REACTIONS_ATTRIBUTES.every(a=>i[a]!==void 0))return!1;return!0}}},emits:["emoji-clicked","emoji-hovered"],data(){return{i18n:new p.DialtoneLocalization}},methods:{emojiClicked(o){this.$emit("emoji-clicked",o.emojiUnicodeOrShortname)},emojiHovered(o,i){this.$emit("emoji-hovered",{reaction:o.emojiUnicodeOrShortname,state:i})},reactionLabel(o){return this.i18n.$t("DIALTONE_EMOJI_ROW_REACTION_LABEL",{reaction:u.getEmojiShortCode(o.emojiUnicodeOrShortname),personCount:o.num,youIncluded:o.isSelected})}}},E={class:"d-recipe-emoji-row"},S={"aria-hidden":"true"},k={class:"d-recipe-emoji-row__tooltip-emoji"},v={class:"d-recipe-emoji-row__tooltip-names"},x=["textContent"],N={class:"d-recipe-emoji-row__emoji"},O={class:"d-recipe-emoji-row__reaction-number"};function g(o,i,c,a,T,n){const l=e.resolveComponent("dt-emoji-text-wrapper"),s=e.resolveComponent("dt-emoji"),m=e.resolveComponent("dt-button"),d=e.resolveComponent("dt-tooltip");return e.openBlock(),e.createElementBlock("span",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.reactions,t=>(e.openBlock(),e.createElementBlock("span",{key:t.unicodeOutput},[e.createVNode(d,{class:"d-recipe-emoji-row__tooltip","content-class":"d-recipe-emoji-row__tooltip-content","fallback-placements":["top","bottom"],sticky:"popper",onShown:r=>n.emojiHovered(t,r)},{anchor:e.withCtx(({attrs:r})=>[e.createVNode(m,{importance:"clear",size:"sm","data-qa":"feed-item-reaction-button",class:e.normalizeClass(["d-recipe-emoji-row__reaction",t.isSelected?"d-recipe-emoji-row__reaction--selected":""]),"aria-label":n.reactionLabel(t),attrs:r,onClick:V=>n.emojiClicked(t)},{default:e.withCtx(()=>[e.createElementVNode("span",N,[e.createVNode(s,{class:"d-recipe-emoji-row__emoji","img-class":"d-recipe-emoji-row__emoji-img",code:t.emojiUnicodeOrShortname},null,8,["code"])]),e.createElementVNode("span",O,e.toDisplayString(t.num),1)]),_:2},1032,["class","aria-label","attrs","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("span",S,[e.createVNode(l,{size:"800"},{default:e.withCtx(()=>[e.createElementVNode("p",k,e.toDisplayString(t.emojiUnicodeOrShortname),1),e.createElementVNode("p",v,[e.createTextVNode(e.toDisplayString(t.names)+" ",1),e.createElementVNode("span",{class:"d-recipe-emoji-row__tooltip-label",textContent:e.toDisplayString(n.reactionLabel(t))},null,8,x)])]),_:2},1024)])]),_:2},1032,["onShown"])]))),128)),e.renderSlot(o.$slots,"picker")])}const D=j._(C,[["render",g]]);exports.default=D;
|
|
2
2
|
//# sourceMappingURL=emoji-row.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-row.cjs","sources":["../../../recipes/conversation_view/emoji_row/emoji_row.vue"],"sourcesContent":["<template>\n <span class=\"d-recipe-emoji-row\">\n <span\n v-for=\"reaction in reactions\"\n :key=\"reaction.unicodeOutput\"\n >\n <dt-tooltip\n class=\"d-recipe-emoji-row__tooltip\"\n content-class=\"d-recipe-emoji-row__tooltip-content\"\n sticky=\"popper\"\n @shown=\"(shown) => emojiHovered(reaction, shown)\"\n >\n <span aria-hidden=\"true\">\n <dt-emoji-text-wrapper size=\"
|
|
1
|
+
{"version":3,"file":"emoji-row.cjs","sources":["../../../recipes/conversation_view/emoji_row/emoji_row.vue"],"sourcesContent":["<template>\n <span class=\"d-recipe-emoji-row\">\n <span\n v-for=\"reaction in reactions\"\n :key=\"reaction.unicodeOutput\"\n >\n <dt-tooltip\n class=\"d-recipe-emoji-row__tooltip\"\n content-class=\"d-recipe-emoji-row__tooltip-content\"\n :fallback-placements=\"['top', 'bottom']\"\n sticky=\"popper\"\n @shown=\"(shown) => emojiHovered(reaction, shown)\"\n >\n <span aria-hidden=\"true\">\n <dt-emoji-text-wrapper size=\"800\">\n <p class=\"d-recipe-emoji-row__tooltip-emoji\">\n {{ reaction.emojiUnicodeOrShortname }}\n </p>\n <p class=\"d-recipe-emoji-row__tooltip-names\">\n {{ reaction.names }}\n <span\n class=\"d-recipe-emoji-row__tooltip-label\"\n v-text=\"reactionLabel(reaction)\"\n />\n </p>\n </dt-emoji-text-wrapper>\n </span>\n <template #anchor=\"{ attrs }\">\n <dt-button\n importance=\"clear\"\n size=\"sm\"\n data-qa=\"feed-item-reaction-button\"\n :class=\"[\n 'd-recipe-emoji-row__reaction',\n reaction.isSelected ? 'd-recipe-emoji-row__reaction--selected' : '',\n ]\"\n :aria-label=\"reactionLabel(reaction)\"\n :attrs=\"attrs\"\n @click=\"emojiClicked(reaction)\"\n >\n <span class=\"d-recipe-emoji-row__emoji\">\n <dt-emoji\n class=\"d-recipe-emoji-row__emoji\"\n img-class=\"d-recipe-emoji-row__emoji-img\"\n :code=\"reaction.emojiUnicodeOrShortname\"\n />\n </span>\n <span class=\"d-recipe-emoji-row__reaction-number\">\n {{ reaction.num }}\n </span>\n </dt-button>\n </template>\n </dt-tooltip>\n </span>\n <!-- TODO: Replace picker slot with a button with localized text and emit any event needed -->\n <!-- @slot Slot for emoji picker component, including the anchor. -->\n <slot name=\"picker\" />\n </span>\n</template>\n\n<script>\nimport { REACTIONS_ATTRIBUTES } from './emoji_row_constants.js';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmoji } from '@/components/emoji';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport { DialtoneLocalization } from '@/localization';\nimport { getEmojiShortCode } from '@/common/emoji';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeEmojiRow',\n\n components: { DtTooltip, DtButton, DtEmoji, DtEmojiTextWrapper },\n\n props: {\n /**\n * Provide an array of reaction objects to be shown.\n */\n reactions: {\n type: Array,\n default: () => [],\n validator: (reactions) => {\n for (const reaction of reactions) {\n const validInput = REACTIONS_ATTRIBUTES.every((attribute) => reaction[attribute] !== undefined);\n if (!validInput) return false;\n }\n return true;\n },\n },\n },\n\n emits: [\n 'emoji-clicked',\n 'emoji-hovered',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n methods: {\n emojiClicked (reaction) {\n this.$emit('emoji-clicked', reaction.emojiUnicodeOrShortname);\n },\n\n emojiHovered (reaction, state) {\n this.$emit('emoji-hovered', {\n reaction: reaction.emojiUnicodeOrShortname,\n state,\n });\n },\n\n reactionLabel (reaction) {\n return this.i18n.$t('DIALTONE_EMOJI_ROW_REACTION_LABEL', {\n reaction: getEmojiShortCode(reaction.emojiUnicodeOrShortname),\n personCount: reaction.num,\n youIncluded: reaction.isSelected,\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtTooltip","DtButton","DtEmoji","DtEmojiTextWrapper","reactions","reaction","REACTIONS_ATTRIBUTES","attribute","DialtoneLocalization","state","getEmojiShortCode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createVNode","_component_dt_tooltip","shown","$options","_withCtx","attrs","_component_dt_button","_normalizeClass","$event","_createElementVNode","_component_dt_emoji","_toDisplayString","_component_dt_emoji_text_wrapper","_createTextVNode","_renderSlot","_ctx"],"mappings":"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"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { REACTIONS_ATTRIBUTES as w } from "./emoji-row-constants.js";
|
|
2
|
-
import { DialtoneLocalization as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DialtoneLocalization as C } from "../../localization/index.js";
|
|
3
|
+
import { getEmojiShortCode as S } from "../../common/emoji/index.js";
|
|
4
|
+
import { resolveComponent as n, createElementBlock as d, openBlock as l, renderSlot as E, Fragment as b, renderList as k, createVNode as m, withCtx as c, createElementVNode as t, toDisplayString as s, createTextVNode as O, normalizeClass as v } from "vue";
|
|
5
|
+
import { _ as x } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
6
|
import D from "../emoji-text-wrapper/emoji-text-wrapper.js";
|
|
6
7
|
import T from "../emoji/emoji.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import I from "../button/button.js";
|
|
9
|
+
import L from "../tooltip/tooltip.js";
|
|
10
|
+
const y = {
|
|
10
11
|
compatConfig: { MODE: 3 },
|
|
11
12
|
name: "DtRecipeEmojiRow",
|
|
12
|
-
components: { DtTooltip:
|
|
13
|
+
components: { DtTooltip: L, DtButton: I, DtEmoji: T, DtEmojiTextWrapper: D },
|
|
13
14
|
props: {
|
|
14
15
|
/**
|
|
15
16
|
* Provide an array of reaction objects to be shown.
|
|
@@ -18,8 +19,8 @@ const I = {
|
|
|
18
19
|
type: Array,
|
|
19
20
|
default: () => [],
|
|
20
21
|
validator: (e) => {
|
|
21
|
-
for (const
|
|
22
|
-
if (!w.every((
|
|
22
|
+
for (const i of e)
|
|
23
|
+
if (!w.every((p) => i[p] !== void 0)) return !1;
|
|
23
24
|
return !0;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -30,69 +31,79 @@ const I = {
|
|
|
30
31
|
],
|
|
31
32
|
data() {
|
|
32
33
|
return {
|
|
33
|
-
i18n: new
|
|
34
|
+
i18n: new C()
|
|
34
35
|
};
|
|
35
36
|
},
|
|
36
37
|
methods: {
|
|
37
38
|
emojiClicked(e) {
|
|
38
39
|
this.$emit("emoji-clicked", e.emojiUnicodeOrShortname);
|
|
39
40
|
},
|
|
40
|
-
emojiHovered(e,
|
|
41
|
+
emojiHovered(e, i) {
|
|
41
42
|
this.$emit("emoji-hovered", {
|
|
42
43
|
reaction: e.emojiUnicodeOrShortname,
|
|
43
|
-
state:
|
|
44
|
+
state: i
|
|
44
45
|
});
|
|
45
46
|
},
|
|
46
47
|
reactionLabel(e) {
|
|
47
48
|
return this.i18n.$t("DIALTONE_EMOJI_ROW_REACTION_LABEL", {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
reaction: S(e.emojiUnicodeOrShortname),
|
|
50
|
+
personCount: e.num,
|
|
51
|
+
youIncluded: e.isSelected
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
},
|
|
54
|
-
function z(e,
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
(
|
|
55
|
+
}, g = { class: "d-recipe-emoji-row" }, A = { "aria-hidden": "true" }, N = { class: "d-recipe-emoji-row__tooltip-emoji" }, R = { class: "d-recipe-emoji-row__tooltip-names" }, U = ["textContent"], B = { class: "d-recipe-emoji-row__emoji" }, $ = { class: "d-recipe-emoji-row__reaction-number" };
|
|
56
|
+
function z(e, i, _, p, V, r) {
|
|
57
|
+
const j = n("dt-emoji-text-wrapper"), u = n("dt-emoji"), f = n("dt-button"), h = n("dt-tooltip");
|
|
58
|
+
return l(), d("span", g, [
|
|
59
|
+
(l(!0), d(b, null, k(_.reactions, (o) => (l(), d("span", {
|
|
58
60
|
key: o.unicodeOutput
|
|
59
61
|
}, [
|
|
60
|
-
|
|
62
|
+
m(h, {
|
|
61
63
|
class: "d-recipe-emoji-row__tooltip",
|
|
62
64
|
"content-class": "d-recipe-emoji-row__tooltip-content",
|
|
65
|
+
"fallback-placements": ["top", "bottom"],
|
|
63
66
|
sticky: "popper",
|
|
64
|
-
onShown: (
|
|
67
|
+
onShown: (a) => r.emojiHovered(o, a)
|
|
65
68
|
}, {
|
|
66
|
-
anchor:
|
|
67
|
-
|
|
69
|
+
anchor: c(({ attrs: a }) => [
|
|
70
|
+
m(f, {
|
|
68
71
|
importance: "clear",
|
|
69
72
|
size: "sm",
|
|
70
73
|
"data-qa": "feed-item-reaction-button",
|
|
71
|
-
class:
|
|
74
|
+
class: v([
|
|
72
75
|
"d-recipe-emoji-row__reaction",
|
|
73
76
|
o.isSelected ? "d-recipe-emoji-row__reaction--selected" : ""
|
|
74
77
|
]),
|
|
75
78
|
"aria-label": r.reactionLabel(o),
|
|
76
|
-
attrs:
|
|
77
|
-
onClick: (
|
|
79
|
+
attrs: a,
|
|
80
|
+
onClick: (H) => r.emojiClicked(o)
|
|
78
81
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
default: c(() => [
|
|
83
|
+
t("span", B, [
|
|
84
|
+
m(u, {
|
|
85
|
+
class: "d-recipe-emoji-row__emoji",
|
|
86
|
+
"img-class": "d-recipe-emoji-row__emoji-img",
|
|
83
87
|
code: o.emojiUnicodeOrShortname
|
|
84
88
|
}, null, 8, ["code"])
|
|
85
89
|
]),
|
|
86
|
-
|
|
90
|
+
t("span", $, s(o.num), 1)
|
|
87
91
|
]),
|
|
88
92
|
_: 2
|
|
89
93
|
}, 1032, ["class", "aria-label", "attrs", "onClick"])
|
|
90
94
|
]),
|
|
91
|
-
default:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
default:
|
|
95
|
-
|
|
95
|
+
default: c(() => [
|
|
96
|
+
t("span", A, [
|
|
97
|
+
m(j, { size: "800" }, {
|
|
98
|
+
default: c(() => [
|
|
99
|
+
t("p", N, s(o.emojiUnicodeOrShortname), 1),
|
|
100
|
+
t("p", R, [
|
|
101
|
+
O(s(o.names) + " ", 1),
|
|
102
|
+
t("span", {
|
|
103
|
+
class: "d-recipe-emoji-row__tooltip-label",
|
|
104
|
+
textContent: s(r.reactionLabel(o))
|
|
105
|
+
}, null, 8, U)
|
|
106
|
+
])
|
|
96
107
|
]),
|
|
97
108
|
_: 2
|
|
98
109
|
}, 1024)
|
|
@@ -101,11 +112,11 @@ function z(e, t, l, _, B, r) {
|
|
|
101
112
|
_: 2
|
|
102
113
|
}, 1032, ["onShown"])
|
|
103
114
|
]))), 128)),
|
|
104
|
-
|
|
115
|
+
E(e.$slots, "picker")
|
|
105
116
|
]);
|
|
106
117
|
}
|
|
107
|
-
const
|
|
118
|
+
const X = /* @__PURE__ */ x(y, [["render", z]]);
|
|
108
119
|
export {
|
|
109
|
-
|
|
120
|
+
X as default
|
|
110
121
|
};
|
|
111
122
|
//# sourceMappingURL=emoji-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-row.js","sources":["../../../recipes/conversation_view/emoji_row/emoji_row.vue"],"sourcesContent":["<template>\n <span class=\"d-recipe-emoji-row\">\n <span\n v-for=\"reaction in reactions\"\n :key=\"reaction.unicodeOutput\"\n >\n <dt-tooltip\n class=\"d-recipe-emoji-row__tooltip\"\n content-class=\"d-recipe-emoji-row__tooltip-content\"\n sticky=\"popper\"\n @shown=\"(shown) => emojiHovered(reaction, shown)\"\n >\n <span aria-hidden=\"true\">\n <dt-emoji-text-wrapper size=\"
|
|
1
|
+
{"version":3,"file":"emoji-row.js","sources":["../../../recipes/conversation_view/emoji_row/emoji_row.vue"],"sourcesContent":["<template>\n <span class=\"d-recipe-emoji-row\">\n <span\n v-for=\"reaction in reactions\"\n :key=\"reaction.unicodeOutput\"\n >\n <dt-tooltip\n class=\"d-recipe-emoji-row__tooltip\"\n content-class=\"d-recipe-emoji-row__tooltip-content\"\n :fallback-placements=\"['top', 'bottom']\"\n sticky=\"popper\"\n @shown=\"(shown) => emojiHovered(reaction, shown)\"\n >\n <span aria-hidden=\"true\">\n <dt-emoji-text-wrapper size=\"800\">\n <p class=\"d-recipe-emoji-row__tooltip-emoji\">\n {{ reaction.emojiUnicodeOrShortname }}\n </p>\n <p class=\"d-recipe-emoji-row__tooltip-names\">\n {{ reaction.names }}\n <span\n class=\"d-recipe-emoji-row__tooltip-label\"\n v-text=\"reactionLabel(reaction)\"\n />\n </p>\n </dt-emoji-text-wrapper>\n </span>\n <template #anchor=\"{ attrs }\">\n <dt-button\n importance=\"clear\"\n size=\"sm\"\n data-qa=\"feed-item-reaction-button\"\n :class=\"[\n 'd-recipe-emoji-row__reaction',\n reaction.isSelected ? 'd-recipe-emoji-row__reaction--selected' : '',\n ]\"\n :aria-label=\"reactionLabel(reaction)\"\n :attrs=\"attrs\"\n @click=\"emojiClicked(reaction)\"\n >\n <span class=\"d-recipe-emoji-row__emoji\">\n <dt-emoji\n class=\"d-recipe-emoji-row__emoji\"\n img-class=\"d-recipe-emoji-row__emoji-img\"\n :code=\"reaction.emojiUnicodeOrShortname\"\n />\n </span>\n <span class=\"d-recipe-emoji-row__reaction-number\">\n {{ reaction.num }}\n </span>\n </dt-button>\n </template>\n </dt-tooltip>\n </span>\n <!-- TODO: Replace picker slot with a button with localized text and emit any event needed -->\n <!-- @slot Slot for emoji picker component, including the anchor. -->\n <slot name=\"picker\" />\n </span>\n</template>\n\n<script>\nimport { REACTIONS_ATTRIBUTES } from './emoji_row_constants.js';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmoji } from '@/components/emoji';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport { DialtoneLocalization } from '@/localization';\nimport { getEmojiShortCode } from '@/common/emoji';\n\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtRecipeEmojiRow',\n\n components: { DtTooltip, DtButton, DtEmoji, DtEmojiTextWrapper },\n\n props: {\n /**\n * Provide an array of reaction objects to be shown.\n */\n reactions: {\n type: Array,\n default: () => [],\n validator: (reactions) => {\n for (const reaction of reactions) {\n const validInput = REACTIONS_ATTRIBUTES.every((attribute) => reaction[attribute] !== undefined);\n if (!validInput) return false;\n }\n return true;\n },\n },\n },\n\n emits: [\n 'emoji-clicked',\n 'emoji-hovered',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n methods: {\n emojiClicked (reaction) {\n this.$emit('emoji-clicked', reaction.emojiUnicodeOrShortname);\n },\n\n emojiHovered (reaction, state) {\n this.$emit('emoji-hovered', {\n reaction: reaction.emojiUnicodeOrShortname,\n state,\n });\n },\n\n reactionLabel (reaction) {\n return this.i18n.$t('DIALTONE_EMOJI_ROW_REACTION_LABEL', {\n reaction: getEmojiShortCode(reaction.emojiUnicodeOrShortname),\n personCount: reaction.num,\n youIncluded: reaction.isSelected,\n });\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtTooltip","DtButton","DtEmoji","DtEmojiTextWrapper","reactions","reaction","REACTIONS_ATTRIBUTES","attribute","DialtoneLocalization","state","getEmojiShortCode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_openBlock","_createElementBlock","_Fragment","_renderList","$props","_createVNode","_component_dt_tooltip","shown","$options","_withCtx","attrs","_component_dt_button","_normalizeClass","$event","_createElementVNode","_component_dt_emoji","_toDisplayString","_component_dt_emoji_text_wrapper","_createTextVNode","_renderSlot","_ctx"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../common/emoji/index.cjs"),n=require("vue"),c=require("../icon/icon-constants.cjs"),a=require("../emoji/emoji.cjs"),l=n.h(n.resolveDynamicComponent(null)).type,p={compatConfig:{MODE:3},name:"DtEmojiTextWrapper",components:{DtEmoji:a.default},props:{elementType:{type:String,default:"div"},size:{type:String,default:"500",validator:e=>Object.keys(c.ICON_SIZE_MODIFIERS).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){if(!e.length)return t;const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../common/emoji/index.cjs"),n=require("vue"),c=require("../icon/icon-constants.cjs"),a=require("../emoji/emoji.cjs"),l=n.h(n.resolveDynamicComponent(null)).type,p={compatConfig:{MODE:3},name:"DtEmojiTextWrapper",components:{DtEmoji:a.default},props:{elementType:{type:String,default:"div"},size:{type:String,default:"500",validator:e=>Object.keys(c.ICON_SIZE_MODIFIERS).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){if(!e.length)return t;const s=e.map(r=>r.replace(/\*/g,"\\*")),i=new RegExp(`(${s.join("|")})`,"g");return t.split(i).filter(r=>r.trim()!=="").map(r=>e.includes(r)?n.h(a.default,{code:r,size:this.size}):n.h("span",{class:"d-emoji-text-wrapper__text"},r))},searchVNodes(e){var s;if(!e)return;if(typeof e=="string")return this.searchCodes(e);if(e.type===l)return e;if(typeof e.type=="symbol")return this.searchCodes(e.children);if((s=e.props)!=null&&s.innerHTML)return this.searchVNodes(e.props.innerHTML);const t=Array.isArray(e.children)?e.children:[e.children];return n.h(e.type,e.props,t.map(i=>this.searchVNodes(i)))},replaceVueComponentVNodeContent(){},searchCodes(e){const t=o.findShortCodes(e),s=o.findEmojis(e),i=[...t,...s];return i.length===0?e:this.replaceDtEmojis(i,e)}},render(){const e=this.$slots.default?this.$slots.default():[];return n.h(this.elementType,{"data-qa":"emoji-text-wrapper",class:"d-emoji-text-wrapper"},this.loadingEmojiJson?e:e.map(t=>this.searchVNodes(t)))}};exports.default=p;
|
|
2
2
|
//# sourceMappingURL=emoji-text-wrapper.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-text-wrapper.cjs","sources":["../../../components/emoji_text_wrapper/emoji_text_wrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon/icon_constants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at: 100 to 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"names":["COMMENT_TYPE","h","resolveDynamicComponent","_sfc_main","DtEmoji","t","ICON_SIZE_MODIFIERS","replaceList","textContent","escapedReplaceList","item","regexp","VNode","_a","children","VNodeChild","shortcodes","findShortCodes","emojis","findEmojis","defaultSlotContent"],"mappings":"qPAMMA,EAAeC,EAAAA,EAAEC,EAAAA,wBAAwB,IAAI,CAAC,EAAE,KAMjDC,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,qBAEN,WAAY,CACV,QAAAC,EAAAA,SAGF,MAAO,CAIL,YAAa,CACX,KAAM,OACN,QAAS,OAMX,KAAM,CACJ,KAAM,OACN,QAAS,MACT,UAAYC,GAAM,OAAO,KAAKC,qBAAmB,EAAE,SAASD,CAAC,IAIjE,MAAQ,CACN,MAAO,CACL,iBAAkB,GAEtB,EAEA,MAAM,SAAW,CACf,KAAK,iBAAmB,EAC1B,EAEA,QAAS,CAKP,gBAAiBE,EAAaC,EAAa,CACzC,GAAI,CAACD,EAAY,OAAQ,OAAOC,EAEhC,MAAMC,EAAqBF,EAAY,IAAIG,GACzCA,EAAK,QAAQ,MAAO,KAAK,GAGrBC,EAAS,IAAI,OAAO,IAAIF,EAAmB,KAAK,GAAG,CAAC,IAAK,GAAG,EAGlE,OAFcD,EAAY,MAAMG,CAAM,EAGnC,OAAOD,GAAQA,EAAK,KAAI,IAAO,EAAE,EACjC,IAAKA,GACAH,EAAY,SAASG,CAAI,EACpBT,EAAAA,EAAEG,EAAAA,QAAS,CAAE,KAAMM,EAAM,KAAM,KAAK,KAAM,EAE5CT,EAAAA,EAAE,OAAQ,CAAE,MAAO,4BAA2B,EAAKS,CAAI,CAC/D,CACL,EAOA,aAAcE,EAAO,OACnB,GAAI,OAAOA,GAAU,SAAU,OAAO,KAAK,YAAYA,CAAK,EAC5D,GAAIA,EAAM,OAASZ,EAAc,OAAOY,EACxC,GAAI,OAAOA,EAAM,MAAS,SAAU,OAAO,KAAK,YAAYA,EAAM,QAAQ,EAC1E,IAAIC,EAAAD,EAAM,QAAN,MAAAC,EAAa,UAAW,OAAO,KAAK,aAAaD,EAAM,MAAM,SAAS,EAE1E,MAAME,EAAW,MAAM,QAAQF,EAAM,QAAQ,EAAIA,EAAM,SAAW,CAACA,EAAM,QAAQ,EACjF,OAAOX,EAAAA,EAAEW,EAAM,KAAMA,EAAM,MAAOE,EAAS,IAAIC,GAAc,KAAK,aAAaA,CAAU,CAAC,CAAC,CAC7F,EAGA,iCAAmC,CAEnC,EAOA,YAAaP,EAAa,CACxB,MAAMQ,EAAaC,EAAAA,eAAeT,CAAW,EACvCU,EAASC,EAAAA,WAAWX,CAAW,EAE/BD,EAAc,CAAC,GAAGS,EAAY,GAAGE,CAAM,EAC7C,OAAIX,EAAY,SAAW,EAAUC,EAC9B,KAAK,gBAAgBD,EAAaC,CAAW,CACtD,GAGF,QAAU,CACR,MAAMY,EAAqB,KAAK,OAAO,QAAU,KAAK,OAAO,QAAO,EAAK,CAAA,EACzE,OAAOnB,EAAAA,EACL,KAAK,YACL,CACE,UAAW,qBACX,MAAO,wBAET,KAAK,iBACDmB,EACAA,EAAmB,IAAIR,GAAS,KAAK,aAAaA,CAAK,CAAC,EAEhE,CACF"}
|
|
1
|
+
{"version":3,"file":"emoji-text-wrapper.cjs","sources":["../../../components/emoji_text_wrapper/emoji_text_wrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon/icon_constants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at: 100 to 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"names":["COMMENT_TYPE","h","resolveDynamicComponent","_sfc_main","DtEmoji","t","ICON_SIZE_MODIFIERS","replaceList","textContent","escapedReplaceList","item","regexp","VNode","_a","children","VNodeChild","shortcodes","findShortCodes","emojis","findEmojis","defaultSlotContent"],"mappings":"qPAMMA,EAAeC,EAAAA,EAAEC,EAAAA,wBAAwB,IAAI,CAAC,EAAE,KAMjDC,EAAU,CACb,aAAc,CAAE,KAAM,GACtB,KAAM,qBAEN,WAAY,CACV,QAAAC,EAAAA,SAGF,MAAO,CAIL,YAAa,CACX,KAAM,OACN,QAAS,OAMX,KAAM,CACJ,KAAM,OACN,QAAS,MACT,UAAYC,GAAM,OAAO,KAAKC,qBAAmB,EAAE,SAASD,CAAC,IAIjE,MAAQ,CACN,MAAO,CACL,iBAAkB,GAEtB,EAEA,MAAM,SAAW,CACf,KAAK,iBAAmB,EAC1B,EAEA,QAAS,CAKP,gBAAiBE,EAAaC,EAAa,CACzC,GAAI,CAACD,EAAY,OAAQ,OAAOC,EAEhC,MAAMC,EAAqBF,EAAY,IAAIG,GACzCA,EAAK,QAAQ,MAAO,KAAK,GAGrBC,EAAS,IAAI,OAAO,IAAIF,EAAmB,KAAK,GAAG,CAAC,IAAK,GAAG,EAGlE,OAFcD,EAAY,MAAMG,CAAM,EAGnC,OAAOD,GAAQA,EAAK,KAAI,IAAO,EAAE,EACjC,IAAKA,GACAH,EAAY,SAASG,CAAI,EACpBT,EAAAA,EAAEG,EAAAA,QAAS,CAAE,KAAMM,EAAM,KAAM,KAAK,KAAM,EAE5CT,EAAAA,EAAE,OAAQ,CAAE,MAAO,4BAA2B,EAAKS,CAAI,CAC/D,CACL,EAOA,aAAcE,EAAO,OACnB,GAAI,CAACA,EAAO,OACZ,GAAI,OAAOA,GAAU,SAAU,OAAO,KAAK,YAAYA,CAAK,EAC5D,GAAIA,EAAM,OAASZ,EAAc,OAAOY,EACxC,GAAI,OAAOA,EAAM,MAAS,SAAU,OAAO,KAAK,YAAYA,EAAM,QAAQ,EAC1E,IAAIC,EAAAD,EAAM,QAAN,MAAAC,EAAa,UAAW,OAAO,KAAK,aAAaD,EAAM,MAAM,SAAS,EAE1E,MAAME,EAAW,MAAM,QAAQF,EAAM,QAAQ,EAAIA,EAAM,SAAW,CAACA,EAAM,QAAQ,EACjF,OAAOX,EAAAA,EAAEW,EAAM,KAAMA,EAAM,MAAOE,EAAS,IAAIC,GAAc,KAAK,aAAaA,CAAU,CAAC,CAAC,CAC7F,EAGA,iCAAmC,CAEnC,EAOA,YAAaP,EAAa,CACxB,MAAMQ,EAAaC,EAAAA,eAAeT,CAAW,EACvCU,EAASC,EAAAA,WAAWX,CAAW,EAE/BD,EAAc,CAAC,GAAGS,EAAY,GAAGE,CAAM,EAC7C,OAAIX,EAAY,SAAW,EAAUC,EAC9B,KAAK,gBAAgBD,EAAaC,CAAW,CACtD,GAGF,QAAU,CACR,MAAMY,EAAqB,KAAK,OAAO,QAAU,KAAK,OAAO,QAAO,EAAK,CAAA,EACzE,OAAOnB,EAAAA,EACL,KAAK,YACL,CACE,UAAW,qBACX,MAAO,wBAET,KAAK,iBACDmB,EACAA,EAAmB,IAAIR,GAAS,KAAK,aAAaA,CAAK,CAAC,EAEhE,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-text-wrapper.js","sources":["../../../components/emoji_text_wrapper/emoji_text_wrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon/icon_constants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at: 100 to 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"names":["COMMENT_TYPE","h","resolveDynamicComponent","_sfc_main","DtEmoji","t","ICON_SIZE_MODIFIERS","replaceList","textContent","escapedReplaceList","item","regexp","VNode","_a","children","VNodeChild","shortcodes","findShortCodes","emojis","findEmojis","defaultSlotContent"],"mappings":";;;;AAMA,MAAMA,IAAeC,EAAEC,EAAwB,IAAI,CAAC,EAAE,MAMjDC,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,SAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAM,OAAO,KAAKC,CAAmB,EAAE,SAASD,CAAC;AAAA;;EAIjE,OAAQ;AACN,WAAO;AAAA,MACL,kBAAkB;AAAA;EAEtB;AAAA,EAEA,MAAM,UAAW;AACf,SAAK,mBAAmB;AAAA,EAC1B;AAAA,EAEA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,IAKP,gBAAiBE,GAAaC,GAAa;AACzC,UAAI,CAACD,EAAY,OAAQ,QAAOC;AAEhC,YAAMC,IAAqBF,EAAY;AAAA,QAAI,CAAAG,MACzCA,EAAK,QAAQ,OAAO,KAAK;AAAA,SAGrBC,IAAS,IAAI,OAAO,IAAIF,EAAmB,KAAK,GAAG,CAAC,KAAK,GAAG;AAGlE,aAFcD,EAAY,MAAMG,CAAM,EAGnC,OAAO,CAAAD,MAAQA,EAAK,KAAI,MAAO,EAAE,EACjC,IAAI,CAACA,MACAH,EAAY,SAASG,CAAI,IACpBT,EAAEG,GAAS,EAAE,MAAMM,GAAM,MAAM,KAAK,MAAM,IAE5CT,EAAE,QAAQ,EAAE,OAAO,6BAA2B,GAAKS,CAAI,CAC/D;AAAA,IACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAcE,GAAO;;AACnB,UAAI,OAAOA,KAAU,SAAU,QAAO,KAAK,YAAYA,CAAK;AAC5D,UAAIA,EAAM,SAASZ,EAAc,QAAOY;AACxC,UAAI,OAAOA,EAAM,QAAS,SAAU,QAAO,KAAK,YAAYA,EAAM,QAAQ;AAC1E,WAAIC,IAAAD,EAAM,UAAN,QAAAC,EAAa,UAAW,QAAO,KAAK,aAAaD,EAAM,MAAM,SAAS;AAE1E,YAAME,IAAW,MAAM,QAAQF,EAAM,QAAQ,IAAIA,EAAM,WAAW,CAACA,EAAM,QAAQ;AACjF,aAAOX,EAAEW,EAAM,MAAMA,EAAM,OAAOE,EAAS,IAAI,CAAAC,MAAc,KAAK,aAAaA,CAAU,CAAC,CAAC;AAAA,IAC7F;AAAA;AAAA,IAGA,kCAAmC;AAAA,IAEnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAaP,GAAa;AACxB,YAAMQ,IAAaC,EAAeT,CAAW,GACvCU,IAASC,EAAWX,CAAW,GAE/BD,IAAc,CAAC,GAAGS,GAAY,GAAGE,CAAM;AAC7C,aAAIX,EAAY,WAAW,IAAUC,IAC9B,KAAK,gBAAgBD,GAAaC,CAAW;AAAA,IACtD;AAAA;EAGF,SAAU;AACR,UAAMY,IAAqB,KAAK,OAAO,UAAU,KAAK,OAAO,QAAO,IAAK,CAAA;AACzE,WAAOnB;AAAA,MACL,KAAK;AAAA,MACL;AAAA,QACE,WAAW;AAAA,QACX,OAAO;AAAA;MAET,KAAK,mBACDmB,IACAA,EAAmB,IAAI,CAAAR,MAAS,KAAK,aAAaA,CAAK,CAAC;AAAA;EAEhE;AACF;"}
|
|
1
|
+
{"version":3,"file":"emoji-text-wrapper.js","sources":["../../../components/emoji_text_wrapper/emoji_text_wrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/icon/icon_constants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at: 100 to 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"names":["COMMENT_TYPE","h","resolveDynamicComponent","_sfc_main","DtEmoji","t","ICON_SIZE_MODIFIERS","replaceList","textContent","escapedReplaceList","item","regexp","VNode","_a","children","VNodeChild","shortcodes","findShortCodes","emojis","findEmojis","defaultSlotContent"],"mappings":";;;;AAMA,MAAMA,IAAeC,EAAEC,EAAwB,IAAI,CAAC,EAAE,MAMjDC,IAAU;AAAA,EACb,cAAc,EAAE,MAAM;EACtB,MAAM;AAAA,EAEN,YAAY;AAAA,IACV,SAAAC;AAAA;EAGF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;;;;IAMX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MAAM,OAAO,KAAKC,CAAmB,EAAE,SAASD,CAAC;AAAA;;EAIjE,OAAQ;AACN,WAAO;AAAA,MACL,kBAAkB;AAAA;EAEtB;AAAA,EAEA,MAAM,UAAW;AACf,SAAK,mBAAmB;AAAA,EAC1B;AAAA,EAEA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,IAKP,gBAAiBE,GAAaC,GAAa;AACzC,UAAI,CAACD,EAAY,OAAQ,QAAOC;AAEhC,YAAMC,IAAqBF,EAAY;AAAA,QAAI,CAAAG,MACzCA,EAAK,QAAQ,OAAO,KAAK;AAAA,SAGrBC,IAAS,IAAI,OAAO,IAAIF,EAAmB,KAAK,GAAG,CAAC,KAAK,GAAG;AAGlE,aAFcD,EAAY,MAAMG,CAAM,EAGnC,OAAO,CAAAD,MAAQA,EAAK,KAAI,MAAO,EAAE,EACjC,IAAI,CAACA,MACAH,EAAY,SAASG,CAAI,IACpBT,EAAEG,GAAS,EAAE,MAAMM,GAAM,MAAM,KAAK,MAAM,IAE5CT,EAAE,QAAQ,EAAE,OAAO,6BAA2B,GAAKS,CAAI,CAC/D;AAAA,IACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,aAAcE,GAAO;;AACnB,UAAI,CAACA,EAAO;AACZ,UAAI,OAAOA,KAAU,SAAU,QAAO,KAAK,YAAYA,CAAK;AAC5D,UAAIA,EAAM,SAASZ,EAAc,QAAOY;AACxC,UAAI,OAAOA,EAAM,QAAS,SAAU,QAAO,KAAK,YAAYA,EAAM,QAAQ;AAC1E,WAAIC,IAAAD,EAAM,UAAN,QAAAC,EAAa,UAAW,QAAO,KAAK,aAAaD,EAAM,MAAM,SAAS;AAE1E,YAAME,IAAW,MAAM,QAAQF,EAAM,QAAQ,IAAIA,EAAM,WAAW,CAACA,EAAM,QAAQ;AACjF,aAAOX,EAAEW,EAAM,MAAMA,EAAM,OAAOE,EAAS,IAAI,CAAAC,MAAc,KAAK,aAAaA,CAAU,CAAC,CAAC;AAAA,IAC7F;AAAA;AAAA,IAGA,kCAAmC;AAAA,IAEnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAaP,GAAa;AACxB,YAAMQ,IAAaC,EAAeT,CAAW,GACvCU,IAASC,EAAWX,CAAW,GAE/BD,IAAc,CAAC,GAAGS,GAAY,GAAGE,CAAM;AAC7C,aAAIX,EAAY,WAAW,IAAUC,IAC9B,KAAK,gBAAgBD,GAAaC,CAAW;AAAA,IACtD;AAAA;EAGF,SAAU;AACR,UAAMY,IAAqB,KAAK,OAAO,UAAU,KAAK,OAAO,QAAO,IAAK,CAAA;AACzE,WAAOnB;AAAA,MACL,KAAK;AAAA,MACL;AAAA,QACE,WAAW;AAAA,QACX,OAAO;AAAA;MAET,KAAK,mBACDmB,IACAA,EAAmB,IAAI,CAAAR,MAAS,KAAK,aAAaA,CAAK,CAAC;AAAA;EAEhE;AACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("./last-active-nodes.cjs"),k=require("../../common/utils/index.cjs"),f=require("@tiptap/core"),b=require("../../node_modules/@tiptap/vue-3.cjs"),d=require("@dialpad/dialtone-icons/vue3"),T=require("../../localization/index.cjs"),e=require("vue"),B=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),v=require("../button/button.cjs"),j=require("../item-layout/item-layout.cjs"),V=require("./message-input-topbar.cjs"),N=require("./message-input-link.cjs"),S=require("../editor/editor-constants.cjs"),A=require("../stack/stack.cjs"),M=require("../tooltip/tooltip.cjs"),q=require("../rich-text-editor/rich-text-editor.cjs"),F=require("../popover/popover.cjs"),R=require("../input/input.cjs"),z=require("../emoji-picker/emoji-picker.cjs"),C=require("../rich-text-editor/rich-text-editor-constants.cjs"),U={name:"MeetingPill",components:{NodeViewWrapper:b.NodeViewWrapper,DtItemLayout:j.default,DtIconClose:d.DtIconClose,DtButton:v.default,DtIconVideo:d.DtIconVideo},props:b.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new T.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(i){var o,r,l;const t=(l=(r=(o=this.editor)==null?void 0:o.storage)==null?void 0:r.meetingPill)==null?void 0:l.onClose;t&&typeof t=="function"&&t(i)}}},H={class:"d-recipe-message-input-meeting-pill__icon"},G={class:"d-recipe-message-input-meeting-pill__close"};function W(i,t,o,r,l,n){const m=e.resolveComponent("dt-icon-video"),p=e.resolveComponent("dt-icon-close"),h=e.resolveComponent("dt-button"),g=e.resolveComponent("dt-item-layout"),c=e.resolveComponent("node-view-wrapper");return e.openBlock(),e.createBlock(c,{class:"d-recipe-message-input-meeting-pill"},{default:e.withCtx(()=>[e.createVNode(g,{class:"d-recipe-message-input-meeting-pill__layout",unstyled:""},{left:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(m,{size:"400"})])]),right:e.withCtx(()=>[e.createElementVNode("div",G,[e.createVNode(h,{circle:"",importance:"clear",size:"xs","aria-label":n.closeButtonTitle,title:n.closeButtonTitle,onClick:n.close},{icon:e.withCtx(()=>[e.createVNode(p,{size:"300"})]),_:1},8,["aria-label","title","onClick"])])]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(i.node.attrs.text)+" ",1)]),_:1})]),_:1})}const K=B._(U,[["render",W]]),X=f.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return b.VueNodeViewRenderer(K)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText(){return"/dpm"},renderHTML({HTMLAttributes:i}){return["meeting-pill",f.mergeAttributes(i)]}}),Q={compatConfig:{MODE:3},name:"DtRecipeMessageInput",components:{DtButton:v.default,DtEmojiPicker:z.default,DtInput:R.default,DtPopover:F.default,DtRecipeMessageInputTopbar:V.default,DtRecipeMessageInputLink:N.default,DtRichTextEditor:q.default,DtTooltip:M.default,DtStack:A.default,DtIconImage:d.DtIconImage,DtIconVerySatisfied:d.DtIconVerySatisfied,DtIconSatisfied:d.DtIconSatisfied,DtIconSend:d.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(i){return typeof i=="string"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(i):!0}},outputFormat:{type:String,default:"json",validator(i){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(i)}},placeholder:{type:String,default:""},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:"unset"},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:""})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + B"})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + I"})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + S"})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + K",linkPlaceholder:"e.g. https://www.dialpad.com"})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 8"})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 7"})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + B"})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + E"})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Alt + C"})}},emits:["submit","select-media","add-media","paste-media","cancel","skin-tone","selected-emoji","selected-command","meeting-pill-close","update:modelValue","text-input","add-emoji","emoji-scroll-bottom-reached"],data(){return{lastActiveNodes:P.default,additionalExtensions:[X.configure({onClose:i=>{this.$emit("meeting-pill-close",i)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:"d-link d-c-text d-d-inline-block"},linkDialogOpen:!1,selectedText:"",text:"",hideLinkBubbleMenu:!1,i18n:new T.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return"300"},sendButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL")},imagePickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL")},emojiPickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL")},cancelButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL")}},watch:{modelValue(i){this.internalInputValue=i},emojiPickerOpened(i){var t;i||(t=this.$refs.richTextEditor)==null||t.focusEditor()}},created(){this.modelValue&&this.outputFormat==="text"?this.internalInputValue=this.modelValue.replace(/\n/g,"<br>"):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:k.removeClassStyleAttrs,addClassStyleAttrs:k.addClassStyleAttrs,linkDialogOpened(i){var t;this.linkDialogOpen=i,i===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(t=this.$refs.richTextEditor)==null||t.focusEditor())},handleTopbarClick(i){var r;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor,o={bold:()=>t==null?void 0:t.chain().focus().toggleBold().run(),italic:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),strike:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),bulletList:()=>t==null?void 0:t.chain().focus().toggleBulletList().run(),orderedList:()=>t==null?void 0:t.chain().focus().toggleOrderedList().run(),blockquote:()=>t==null?void 0:t.chain().focus().toggleBlockquote().run(),code:()=>t==null?void 0:t.chain().focus().toggleCode().run(),codeBlock:()=>t==null?void 0:t.chain().focus().toggleCodeBlock().run()};t&&o[i]&&o[i]()},isSelectionActive(i){var t,o,r,l;return["bulletList","orderedList"].includes(i)?this.lastActiveNodes((o=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:o.state,[{type:"bulletList"},{type:"orderedList"}]).includes(i)&&this.isFocused:((l=(r=this.$refs.richTextEditor)==null?void 0:r.editor)==null?void 0:l.isActive(i))&&this.isFocused},initLinkDialog(){var i,t,o;this.$refs.link.setInitialValues(this.selectedText,(o=(t=(i=this.$refs.richTextEditor)==null?void 0:i.editor)==null?void 0:t.getAttributes("link"))==null?void 0:o.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var i;(i=this.$refs.richTextEditor)==null||i.removeLink(),this.linkDialogOpen=!1},setLink(i,t){this.$refs.richTextEditor.setLink(t,i,this.linkOptions,S.EDITOR_SUPPORTED_LINK_PROTOCOLS,S.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(i){k.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(".tiptap").contains(i.target)||(i.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(i){const t=i.dataTransfer,o=Array.from(t.files);this.$emit("add-media",o)},onPaste(i){if(i.clipboardData.files.length){i.stopPropagation(),i.preventDefault();const t=[...i.clipboardData.files];this.$emit("paste-media",t)}},onSkinTone(i){this.$emit("skin-tone",i)},onSelectEmoji(i,t){i&&(i.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:i.shortname,image:i.image,name:i.name}}),this.$emit("selected-emoji",i))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit("select-media",this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onInput(i){this.$emit("update:modelValue",i)},onTextInput(i){this.text=i,this.$emit("text-input",i)}}},J={class:"d-recipe-message-input__bottom-section"},Y={class:"d-recipe-message-input__bottom-section-left"},Z={class:"d-recipe-message-input__bottom-section-right"},$={class:"d-recipe-message-input__sms-count"},ee={key:0};function te(i,t,o,r,l,n){const m=e.resolveComponent("dt-recipe-message-input-link"),p=e.resolveComponent("dt-recipe-message-input-topbar"),h=e.resolveComponent("dt-rich-text-editor"),g=e.resolveComponent("dt-icon-image"),c=e.resolveComponent("dt-button"),L=e.resolveComponent("dt-input"),I=e.resolveComponent("dt-icon-very-satisfied"),w=e.resolveComponent("dt-icon-satisfied"),y=e.resolveComponent("dt-emoji-picker"),E=e.resolveComponent("dt-popover"),_=e.resolveComponent("dt-stack"),O=e.resolveComponent("dt-tooltip"),x=e.resolveComponent("dt-icon-send"),D=e.resolveDirective("dt-scrollbar"),u=e.resolveDirective("dt-tooltip");return e.openBlock(),e.createElementBlock("div",e.mergeProps({"data-qa":"dt-recipe-message-input",role:"presentation",class:"d-recipe-message-input"},n.addClassStyleAttrs(i.$attrs),{onDragover:t[15]||(t[15]=e.withModifiers(()=>{},["prevent"])),onDrop:t[16]||(t[16]=e.withModifiers((...s)=>n.onDrop&&n.onDrop(...s),["prevent"])),onPaste:t[17]||(t[17]=(...s)=>n.onPaste&&n.onPaste(...s)),onMousedown:t[18]||(t[18]=(...s)=>n.onMousedown&&n.onMousedown(...s))}),[e.renderSlot(i.$slots,"top"),o.richText?(e.openBlock(),e.createBlock(p,{key:l.selectedText,"bold-button-options":o.boldButtonOptions,"italic-button-options":o.italicButtonOptions,"strike-button-options":o.strikeButtonOptions,"bullet-list-button-options":o.bulletListButtonOptions,"ordered-list-button-options":o.orderedListButtonOptions,"block-quote-button-options":o.blockQuoteButtonOptions,"code-button-options":o.codeButtonOptions,"code-block-button-options":o.codeBlockButtonOptions,"is-selection-active":n.isSelectionActive,onClick:n.handleTopbarClick},{link:e.withCtx(()=>[e.createVNode(m,{ref:"link",open:l.linkDialogOpen,"link-button-options":o.linkButtonOptions,"is-selection-active":n.isSelectionActive,onOpened:n.linkDialogOpened,onSetLink:n.setLink,onRemoveLink:n.removeLink},null,8,["open","link-button-options","is-selection-active","onOpened","onSetLink","onRemoveLink"])]),_:1},8,["bold-button-options","italic-button-options","strike-button-options","bullet-list-button-options","ordered-list-button-options","block-quote-button-options","code-button-options","code-block-button-options","is-selection-active","onClick"])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"d-recipe-message-input__editor-wrapper",style:e.normalizeStyle({"max-height":o.maxHeight})},[e.createVNode(h,e.mergeProps({ref:"richTextEditor",modelValue:l.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=s=>l.internalInputValue=s),"allow-blockquote":o.richText,"allow-bold":o.richText,"allow-bullet-list":o.richText,"allow-code":o.richText,"allow-codeblock":o.richText,"allow-italic":o.richText,"allow-strike":o.richText,"allow-underline":o.richText,"paste-rich-text":o.richText,editable:o.editable,"input-aria-label":o.inputAriaLabel,"input-class":o.inputClass,"output-format":o.outputFormat,"auto-focus":o.autoFocus,link:o.richText,placeholder:o.placeholder,"prevent-typing":o.preventTyping,"mention-suggestion":o.mentionSuggestion,"channel-suggestion":o.channelSuggestion,"slash-command-suggestion":o.slashCommandSuggestion,"additional-extensions":l.additionalExtensions,"hide-link-bubble-menu":l.hideLinkBubbleMenu},n.removeClassStyleAttrs(i.$attrs),{onInput:n.onInput,onTextInput:n.onTextInput,onEnter:n.onSend,onSelected:t[1]||(t[1]=s=>l.selectedText=s),onSelectedCommand:t[2]||(t[2]=s=>i.$emit("selected-command",s)),onEditLink:n.initLinkDialog,onFocus:t[3]||(t[3]=s=>l.isFocused=!0),onBlur:t[4]||(t[4]=s=>l.isFocused=!1)}),null,16,["modelValue","allow-blockquote","allow-bold","allow-bullet-list","allow-code","allow-codeblock","allow-italic","allow-strike","allow-underline","paste-rich-text","editable","input-aria-label","input-class","output-format","auto-focus","link","placeholder","prevent-typing","mention-suggestion","channel-suggestion","slash-command-suggestion","additional-extensions","hide-link-bubble-menu","onInput","onTextInput","onEnter","onEditLink"])],4)),[[D]]),e.renderSlot(i.$slots,"middle"),e.createElementVNode("section",J,[e.createElementVNode("div",Y,[e.createVNode(_,{gap:"200",direction:"row"},{default:e.withCtx(()=>[o.showImagePicker?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-image-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.imagePickerButtonLabel,onClick:n.onSelectImage,onMouseenter:t[5]||(t[5]=s=>l.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=s=>l.imagePickerFocus=!1),onFocus:t[7]||(t[7]=s=>l.imagePickerFocus=!0),onBlur:t[8]||(t[8]=s=>l.imagePickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(g,{size:"300"})]),_:1},8,["aria-label","onClick"])),[[u,n.imagePickerButtonLabel,"top-start"]]):e.createCommentVNode("",!0),e.createVNode(L,{ref:"messageInputImageUpload","data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",class:"d-recipe-message-input__image-input",multiple:"",hidden:"",onInput:n.onImageUpload},null,8,["onInput"]),o.showEmojiPicker?(e.openBlock(),e.createBlock(E,{key:1,"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},{anchor:e.withCtx(({attrs:s})=>[e.withDirectives((e.openBlock(),e.createBlock(c,e.mergeProps(s,{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.emojiPickerButtonLabel,onClick:n.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=a=>l.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=a=>l.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=a=>l.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=a=>l.emojiPickerFocus=!1)}),{icon:e.withCtx(()=>[n.emojiPickerHovered?(e.openBlock(),e.createBlock(I,{key:0,size:"300"})):(e.openBlock(),e.createBlock(w,{key:1,size:"300"}))]),_:2},1040,["aria-label","onClick"])),[[u,n.emojiPickerButtonLabel]])]),content:e.withCtx(({close:s})=>[e.createVNode(y,e.mergeProps(o.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=a=>i.$emit("add-emoji")),onSkinTone:n.onSkinTone,onSelectedEmoji:a=>n.onSelectEmoji(a,s),onScrollBottomReached:t[14]||(t[14]=a=>i.$emit("emoji-scroll-bottom-reached"))}),null,16,["onSkinTone","onSelectedEmoji"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"emojiGiphyPicker"),e.renderSlot(i.$slots,"customActionIcons")]),_:3})]),e.createElementVNode("div",Z,[e.createVNode(_,{direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createElementVNode("div",$,[e.renderSlot(i.$slots,"smsCount")]),o.showCharacterLimit?(e.openBlock(),e.createBlock(O,{key:0,class:"d-recipe-message-input__remaining-char-tooltip",placement:"top-end",enabled:n.characterLimitTooltipEnabled,message:o.showCharacterLimit.message,offset:[10,8]},{anchor:e.withCtx(()=>[e.withDirectives(e.createElementVNode("p",{class:"d-recipe-message-input__remaining-char","data-qa":"dt-recipe-message-input-character-limit"},e.toDisplayString(o.showCharacterLimit.count-n.inputLength),513),[[e.vShow,n.displayCharacterLimitWarning]])]),_:1},8,["enabled","message"])):e.createCommentVNode("",!0),o.showCancel?e.withDirectives((e.openBlock(),e.createBlock(c,{key:1,"data-qa":"dt-recipe-message-input-cancel-button",class:"d-recipe-message-input__button d-recipe-message-input__cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":n.cancelButtonLabel,onClick:n.onCancel},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(n.cancelButtonLabel),1)]),_:1},8,["aria-label","onClick"])),[[u,n.cancelButtonLabel]]):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"sendButton",{},()=>[o.showSend?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary",class:e.normalizeClass(["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":n.isSendDisabled,"d-btn--icon-only":n.showSendIcon}]),"aria-label":n.sendButtonLabel,"aria-disabled":n.isSendDisabled,onClick:n.onSend},e.createSlots({default:e.withCtx(()=>[o.showSend.text?(e.openBlock(),e.createElementBlock("p",ee,e.toDisplayString(o.showSend.text),1)):e.createCommentVNode("",!0)]),_:2},[n.showSendIcon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"sendIcon",{iconSize:n.sendIconSize},()=>[e.createVNode(x,{size:n.sendIconSize},null,8,["size"])])]),key:"0"}:void 0]),1032,["class","aria-label","aria-disabled","onClick"])),[[u,n.sendButtonLabel,"top-end"]]):e.createCommentVNode("",!0)])]),_:3})])])],16)}const ie=B._(Q,[["render",te]]);exports.default=ie;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("./last-active-nodes.cjs"),k=require("../../common/utils/index.cjs"),f=require("@tiptap/core"),b=require("../../node_modules/@tiptap/vue-3.cjs"),d=require("@dialpad/dialtone-icons/vue3"),T=require("../../localization/index.cjs"),e=require("vue"),v=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),B=require("../button/button.cjs"),V=require("../item-layout/item-layout.cjs"),j=require("./message-input-topbar.cjs"),N=require("./message-input-link.cjs"),S=require("../editor/editor-constants.cjs"),A=require("../stack/stack.cjs"),M=require("../tooltip/tooltip.cjs"),q=require("../rich-text-editor/rich-text-editor.cjs"),F=require("../popover/popover.cjs"),R=require("../input/input.cjs"),z=require("../emoji-picker/emoji-picker.cjs"),C=require("../rich-text-editor/rich-text-editor-constants.cjs"),U={name:"MeetingPill",components:{NodeViewWrapper:b.NodeViewWrapper,DtItemLayout:V.default,DtIconClose:d.DtIconClose,DtButton:B.default,DtIconVideo:d.DtIconVideo},props:b.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new T.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(i){var o,r,l;const t=(l=(r=(o=this.editor)==null?void 0:o.storage)==null?void 0:r.meetingPill)==null?void 0:l.onClose;t&&typeof t=="function"&&t(i)}}},H={class:"d-recipe-message-input-meeting-pill__icon"},G={class:"d-recipe-message-input-meeting-pill__close"};function W(i,t,o,r,l,n){const m=e.resolveComponent("dt-icon-video"),p=e.resolveComponent("dt-icon-close"),h=e.resolveComponent("dt-button"),g=e.resolveComponent("dt-item-layout"),c=e.resolveComponent("node-view-wrapper");return e.openBlock(),e.createBlock(c,{class:"d-recipe-message-input-meeting-pill"},{default:e.withCtx(()=>[e.createVNode(g,{class:"d-recipe-message-input-meeting-pill__layout",unstyled:""},{left:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(m,{size:"400"})])]),right:e.withCtx(()=>[e.createElementVNode("div",G,[e.createVNode(h,{circle:"",importance:"clear",size:"xs","aria-label":n.closeButtonTitle,title:n.closeButtonTitle,onClick:n.close},{icon:e.withCtx(()=>[e.createVNode(p,{size:"300"})]),_:1},8,["aria-label","title","onClick"])])]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(i.node.attrs.text)+" ",1)]),_:1})]),_:1})}const K=v._(U,[["render",W]]),X=f.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return b.VueNodeViewRenderer(K)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText(){return"/dpm"},renderHTML({HTMLAttributes:i}){return["meeting-pill",f.mergeAttributes(i)]}}),Q={compatConfig:{MODE:3},name:"DtRecipeMessageInput",components:{DtButton:B.default,DtEmojiPicker:z.default,DtInput:R.default,DtPopover:F.default,DtRecipeMessageInputTopbar:j.default,DtRecipeMessageInputLink:N.default,DtRichTextEditor:q.default,DtTooltip:M.default,DtStack:A.default,DtIconImage:d.DtIconImage,DtIconVerySatisfied:d.DtIconVerySatisfied,DtIconSatisfied:d.DtIconSatisfied,DtIconSend:d.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:""},preventTyping:{type:Boolean,default:!1},inputClass:{type:String,default:""},autoFocus:{type:[Boolean,String,Number],default:!1,validator(i){return typeof i=="string"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(i):!0}},outputFormat:{type:String,default:"json",validator(i){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(i)}},placeholder:{type:String,default:""},disableSend:{type:Boolean,default:!1},maxHeight:{type:String,default:"unset"},showEmojiPicker:{type:Boolean,default:!0},emojiPickerProps:{type:Object,default:()=>({})},showCharacterLimit:{type:[Boolean,Object],default:()=>({count:1500,warning:500,message:""})},showImagePicker:{type:[Boolean,Object],default:()=>({})},showSend:{type:[Boolean,Object],default:()=>({})},showCancel:{type:[Boolean,Object],default:()=>({})},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},boldButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + B"})},italicButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + I"})},strikeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + S"})},linkButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + K",linkPlaceholder:"e.g. https://www.dialpad.com"})},bulletListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 8"})},orderedListButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + 7"})},blockQuoteButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Shift + B"})},codeButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + E"})},codeBlockButtonOptions:{type:Object,default:()=>({keyboardShortcutText:"Mod + Alt + C"})}},emits:["submit","select-media","add-media","paste-media","cancel","skin-tone","selected-emoji","selected-command","meeting-pill-close","update:modelValue","text-input","add-emoji","emoji-scroll-bottom-reached"],data(){return{lastActiveNodes:P.default,additionalExtensions:[X.configure({onClose:i=>{this.$emit("meeting-pill-close",i)}})],internalInputValue:this.modelValue,imagePickerFocus:!1,emojiPickerFocus:!1,emojiPickerOpened:!1,isFocused:!1,linkOptions:{class:"d-link d-c-text d-d-inline-block"},linkDialogOpen:!1,selectedText:"",text:"",hideLinkBubbleMenu:!1,i18n:new T.DialtoneLocalization}},computed:{showSendIcon(){return!this.showSend.text},inputLength(){return this.text.length},displayCharacterLimitWarning(){return!!this.showCharacterLimit&&this.showCharacterLimit.count-this.inputLength<=this.showCharacterLimit.warning},characterLimitTooltipEnabled(){return this.showCharacterLimit.message&&this.showCharacterLimit.count-this.inputLength<0},isSendDisabled(){return this.disableSend||this.showCharacterLimit&&this.inputLength>this.showCharacterLimit.count},emojiPickerHovered(){return this.emojiPickerFocus||this.emojiPickerOpened},sendIconSize(){return"300"},sendButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL")},imagePickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL")},emojiPickerButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL")},cancelButtonLabel(){return this.i18n.$t("DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL")}},watch:{modelValue(i){this.internalInputValue=i},emojiPickerOpened(i){var t;i||(t=this.$refs.richTextEditor)==null||t.focusEditor()}},created(){this.modelValue&&this.outputFormat==="text"?this.internalInputValue=this.modelValue.replace(/\n/g,"<br>"):this.internalInputValue=this.modelValue},methods:{removeClassStyleAttrs:k.removeClassStyleAttrs,addClassStyleAttrs:k.addClassStyleAttrs,linkDialogOpened(i){var t;this.linkDialogOpen=i,i===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(t=this.$refs.richTextEditor)==null||t.focusEditor())},handleTopbarClick(i){var r;const t=(r=this.$refs.richTextEditor)==null?void 0:r.editor,o={bold:()=>t==null?void 0:t.chain().focus().toggleBold().run(),italic:()=>t==null?void 0:t.chain().focus().toggleItalic().run(),strike:()=>t==null?void 0:t.chain().focus().toggleStrike().run(),bulletList:()=>t==null?void 0:t.chain().focus().toggleBulletList().run(),orderedList:()=>t==null?void 0:t.chain().focus().toggleOrderedList().run(),blockquote:()=>t==null?void 0:t.chain().focus().toggleBlockquote().run(),code:()=>t==null?void 0:t.chain().focus().toggleCode().run(),codeBlock:()=>t==null?void 0:t.chain().focus().toggleCodeBlock().run()};t&&o[i]&&o[i]()},isSelectionActive(i){var t,o,r,l;return["bulletList","orderedList"].includes(i)?this.lastActiveNodes((o=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:o.state,[{type:"bulletList"},{type:"orderedList"}]).includes(i)&&this.isFocused:((l=(r=this.$refs.richTextEditor)==null?void 0:r.editor)==null?void 0:l.isActive(i))&&this.isFocused},initLinkDialog(){var i,t,o;this.$refs.link.setInitialValues(this.selectedText,(o=(t=(i=this.$refs.richTextEditor)==null?void 0:i.editor)==null?void 0:t.getAttributes("link"))==null?void 0:o.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var i;(i=this.$refs.richTextEditor)==null||i.removeLink(),this.linkDialogOpen=!1},setLink(i,t){this.$refs.richTextEditor.setLink(t,i,this.linkOptions,S.EDITOR_SUPPORTED_LINK_PROTOCOLS,S.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(i){k.returnFirstEl(this.$refs.richTextEditor.$el).querySelector(".tiptap").contains(i.target)||(i.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(i){const t=i.dataTransfer,o=Array.from(t.files);this.$emit("add-media",o)},onPaste(i){if(i.clipboardData.files.length){i.stopPropagation(),i.preventDefault();const t=[...i.clipboardData.files];this.$emit("paste-media",t)}},onSkinTone(i){this.$emit("skin-tone",i)},onSelectEmoji(i,t){i&&(i.shift_key||t(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:i.shortname,image:i.image,name:i.name}}),this.$emit("selected-emoji",i))},onSelectImage(){this.$refs.messageInputImageUpload.$refs.input.click()},onImageUpload(){this.$emit("select-media",this.$refs.messageInputImageUpload.$refs.input.files)},toggleEmojiPicker(){this.emojiPickerOpened=!this.emojiPickerOpened},onSend(){this.isSendDisabled||this.$emit("submit",this.internalInputValue)},onCancel(){this.$emit("cancel")},onInput(i){this.$emit("update:modelValue",i)},onTextInput(i){this.text=i,this.$emit("text-input",i)}}},J={class:"d-recipe-message-input__bottom-section"},Y={class:"d-recipe-message-input__bottom-section-left"},Z={class:"d-recipe-message-input__bottom-section-right"},$={class:"d-recipe-message-input__schedule-message"},ee={class:"d-recipe-message-input__sms-count"},te={key:0};function ie(i,t,o,r,l,n){const m=e.resolveComponent("dt-recipe-message-input-link"),p=e.resolveComponent("dt-recipe-message-input-topbar"),h=e.resolveComponent("dt-rich-text-editor"),g=e.resolveComponent("dt-icon-image"),c=e.resolveComponent("dt-button"),L=e.resolveComponent("dt-input"),I=e.resolveComponent("dt-icon-very-satisfied"),w=e.resolveComponent("dt-icon-satisfied"),y=e.resolveComponent("dt-emoji-picker"),E=e.resolveComponent("dt-popover"),_=e.resolveComponent("dt-stack"),O=e.resolveComponent("dt-tooltip"),x=e.resolveComponent("dt-icon-send"),D=e.resolveDirective("dt-scrollbar"),u=e.resolveDirective("dt-tooltip");return e.openBlock(),e.createElementBlock("div",e.mergeProps({"data-qa":"dt-recipe-message-input",role:"presentation",class:"d-recipe-message-input"},n.addClassStyleAttrs(i.$attrs),{onDragover:t[15]||(t[15]=e.withModifiers(()=>{},["prevent"])),onDrop:t[16]||(t[16]=e.withModifiers((...s)=>n.onDrop&&n.onDrop(...s),["prevent"])),onPaste:t[17]||(t[17]=(...s)=>n.onPaste&&n.onPaste(...s)),onMousedown:t[18]||(t[18]=(...s)=>n.onMousedown&&n.onMousedown(...s))}),[e.renderSlot(i.$slots,"top"),o.richText?(e.openBlock(),e.createBlock(p,{key:l.selectedText,"bold-button-options":o.boldButtonOptions,"italic-button-options":o.italicButtonOptions,"strike-button-options":o.strikeButtonOptions,"bullet-list-button-options":o.bulletListButtonOptions,"ordered-list-button-options":o.orderedListButtonOptions,"block-quote-button-options":o.blockQuoteButtonOptions,"code-button-options":o.codeButtonOptions,"code-block-button-options":o.codeBlockButtonOptions,"is-selection-active":n.isSelectionActive,onClick:n.handleTopbarClick},{link:e.withCtx(()=>[e.createVNode(m,{ref:"link",open:l.linkDialogOpen,"link-button-options":o.linkButtonOptions,"is-selection-active":n.isSelectionActive,onOpened:n.linkDialogOpened,onSetLink:n.setLink,onRemoveLink:n.removeLink},null,8,["open","link-button-options","is-selection-active","onOpened","onSetLink","onRemoveLink"])]),_:1},8,["bold-button-options","italic-button-options","strike-button-options","bullet-list-button-options","ordered-list-button-options","block-quote-button-options","code-button-options","code-block-button-options","is-selection-active","onClick"])):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"d-recipe-message-input__editor-wrapper",style:e.normalizeStyle({"max-height":o.maxHeight})},[e.createVNode(h,e.mergeProps({ref:"richTextEditor",modelValue:l.internalInputValue,"onUpdate:modelValue":t[0]||(t[0]=s=>l.internalInputValue=s),"allow-blockquote":o.richText,"allow-bold":o.richText,"allow-bullet-list":o.richText,"allow-code":o.richText,"allow-codeblock":o.richText,"allow-italic":o.richText,"allow-strike":o.richText,"allow-underline":o.richText,"paste-rich-text":o.richText,editable:o.editable,"input-aria-label":o.inputAriaLabel,"input-class":o.inputClass,"output-format":o.outputFormat,"auto-focus":o.autoFocus,link:o.richText,placeholder:o.placeholder,"prevent-typing":o.preventTyping,"mention-suggestion":o.mentionSuggestion,"channel-suggestion":o.channelSuggestion,"slash-command-suggestion":o.slashCommandSuggestion,"additional-extensions":l.additionalExtensions,"hide-link-bubble-menu":l.hideLinkBubbleMenu},n.removeClassStyleAttrs(i.$attrs),{onInput:n.onInput,onTextInput:n.onTextInput,onEnter:n.onSend,onSelected:t[1]||(t[1]=s=>l.selectedText=s),onSelectedCommand:t[2]||(t[2]=s=>i.$emit("selected-command",s)),onEditLink:n.initLinkDialog,onFocus:t[3]||(t[3]=s=>l.isFocused=!0),onBlur:t[4]||(t[4]=s=>l.isFocused=!1)}),null,16,["modelValue","allow-blockquote","allow-bold","allow-bullet-list","allow-code","allow-codeblock","allow-italic","allow-strike","allow-underline","paste-rich-text","editable","input-aria-label","input-class","output-format","auto-focus","link","placeholder","prevent-typing","mention-suggestion","channel-suggestion","slash-command-suggestion","additional-extensions","hide-link-bubble-menu","onInput","onTextInput","onEnter","onEditLink"])],4)),[[D]]),e.renderSlot(i.$slots,"middle"),e.createElementVNode("section",J,[e.createElementVNode("div",Y,[e.createVNode(_,{gap:"200",direction:"row"},{default:e.withCtx(()=>[o.showImagePicker?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-image-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.imagePickerButtonLabel,onClick:n.onSelectImage,onMouseenter:t[5]||(t[5]=s=>l.imagePickerFocus=!0),onMouseleave:t[6]||(t[6]=s=>l.imagePickerFocus=!1),onFocus:t[7]||(t[7]=s=>l.imagePickerFocus=!0),onBlur:t[8]||(t[8]=s=>l.imagePickerFocus=!1)},{icon:e.withCtx(()=>[e.createVNode(g,{size:"300"})]),_:1},8,["aria-label","onClick"])),[[u,n.imagePickerButtonLabel,"top-start"]]):e.createCommentVNode("",!0),e.createVNode(L,{ref:"messageInputImageUpload","data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",class:"d-recipe-message-input__image-input",multiple:"",hidden:"",onInput:n.onImageUpload},null,8,["onInput"]),o.showEmojiPicker?(e.openBlock(),e.createBlock(E,{key:1,"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},{anchor:e.withCtx(({attrs:s})=>[e.withDirectives((e.openBlock(),e.createBlock(c,e.mergeProps(s,{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",class:"d-recipe-message-input__button",kind:"muted",importance:"clear","aria-label":n.emojiPickerButtonLabel,onClick:n.toggleEmojiPicker,onMouseenter:t[9]||(t[9]=a=>l.emojiPickerFocus=!0),onMouseleave:t[10]||(t[10]=a=>l.emojiPickerFocus=!1),onFocus:t[11]||(t[11]=a=>l.emojiPickerFocus=!0),onBlur:t[12]||(t[12]=a=>l.emojiPickerFocus=!1)}),{icon:e.withCtx(()=>[n.emojiPickerHovered?(e.openBlock(),e.createBlock(I,{key:0,size:"300"})):(e.openBlock(),e.createBlock(w,{key:1,size:"300"}))]),_:2},1040,["aria-label","onClick"])),[[u,n.emojiPickerButtonLabel]])]),content:e.withCtx(({close:s})=>[e.createVNode(y,e.mergeProps(o.emojiPickerProps,{onAddEmoji:t[13]||(t[13]=a=>i.$emit("add-emoji")),onSkinTone:n.onSkinTone,onSelectedEmoji:a=>n.onSelectEmoji(a,s),onScrollBottomReached:t[14]||(t[14]=a=>i.$emit("emoji-scroll-bottom-reached"))}),null,16,["onSkinTone","onSelectedEmoji"])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"emojiGiphyPicker"),e.renderSlot(i.$slots,"customActionIcons")]),_:3})]),e.createElementVNode("div",Z,[e.createVNode(_,{direction:"row",gap:"300"},{default:e.withCtx(()=>[e.createElementVNode("div",$,[e.renderSlot(i.$slots,"scheduleMessage")]),e.createElementVNode("div",ee,[e.renderSlot(i.$slots,"smsCount")]),o.showCharacterLimit?(e.openBlock(),e.createBlock(O,{key:0,class:"d-recipe-message-input__remaining-char-tooltip",placement:"top-end",enabled:n.characterLimitTooltipEnabled,message:o.showCharacterLimit.message,offset:[10,8]},{anchor:e.withCtx(()=>[e.withDirectives(e.createElementVNode("p",{class:"d-recipe-message-input__remaining-char","data-qa":"dt-recipe-message-input-character-limit"},e.toDisplayString(o.showCharacterLimit.count-n.inputLength),513),[[e.vShow,n.displayCharacterLimitWarning]])]),_:1},8,["enabled","message"])):e.createCommentVNode("",!0),o.showCancel?e.withDirectives((e.openBlock(),e.createBlock(c,{key:1,"data-qa":"dt-recipe-message-input-cancel-button",class:"d-recipe-message-input__button d-recipe-message-input__cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":n.cancelButtonLabel,onClick:n.onCancel},{default:e.withCtx(()=>[e.createElementVNode("p",null,e.toDisplayString(n.cancelButtonLabel),1)]),_:1},8,["aria-label","onClick"])),[[u,n.cancelButtonLabel]]):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"sendButton",{},()=>[o.showSend?e.withDirectives((e.openBlock(),e.createBlock(c,{key:0,"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary",class:e.normalizeClass(["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":n.isSendDisabled,"d-btn--icon-only":n.showSendIcon}]),"aria-label":n.sendButtonLabel,"aria-disabled":n.isSendDisabled,onClick:n.onSend},e.createSlots({default:e.withCtx(()=>[o.showSend.text?(e.openBlock(),e.createElementBlock("p",te,e.toDisplayString(o.showSend.text),1)):e.createCommentVNode("",!0)]),_:2},[n.showSendIcon?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"sendIcon",{iconSize:n.sendIconSize},()=>[e.createVNode(x,{size:n.sendIconSize},null,8,["size"])])]),key:"0"}:void 0]),1032,["class","aria-label","aria-disabled","onClick"])),[[u,n.sendButtonLabel,"top-end"]]):e.createCommentVNode("",!0)])]),_:3})])])],16)}const oe=v._(Q,[["render",ie]]);exports.default=oe;
|
|
2
2
|
//# sourceMappingURL=message-input.cjs.map
|