@dialpad/dialtone-vue 2.195.3 → 2.195.4
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/emoji/index.cjs +1 -1
- package/dist/common/emoji/index.cjs.map +1 -1
- package/dist/common/emoji/index.js +17 -19
- package/dist/common/emoji/index.js.map +1 -1
- 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 +3 -1
- package/dist/lib/message-input/message-input.js.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +7 -7
- package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +412 -381
- package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/types/common/emoji/index.d.ts.map +1 -1
- package/dist/types/components/rich_text_editor/extensions/emoji/emoji.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +0 -45
- package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts.map +0 -1
|
@@ -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 C=require("regex-combined-emojis"),y=require("emoji-toolkit/emoji_strategy.json"),f=new RegExp(C.emojiPattern,"g"),j="8.0",l="https://cdn.jsdelivr.net/joypixels/assets/"+j+"/png/unicode/32/";exports.customEmojiAssetUrl=null;exports.emojiImageUrlSmall=l;exports.emojiFileExtensionSmall=".png";exports.emojiImageUrlLarge=l;exports.emojiFileExtensionLarge=".png";const m=y,d=new RegExp("(^| |(?<=:))(:\\w+:)","g");function g(){return m}function x(e,t=".png"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlSmall=e,exports.emojiFileExtensionSmall=t}function A(e,t=".svg"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlLarge=e,exports.emojiFileExtensionLarge=t}function P(e){exports.customEmojiAssetUrl=e}function T(e){E(e)}function E(e){const t=["extension","custom"],o=["date_added","image","name"],n=(s,i,r)=>{if(s[i]===void 0){if(!t.includes(i))return;s[i]=r}else Array.isArray(s[i])?s[i]=s[i].concat(r):s[i]=r};Object.entries(e).forEach(s=>{const[i,r]=s;if(i in m){const a=m[i];for(const c in r){const U=r[c];n(a,c,U)}}else o.every(c=>r[c]!==void 0)?m[i]=r:console.error("The following custom emoji doesn't contain the required properties:",r)})}function u(e){function t(n,s){if(!(!n||typeof n!="object")){if("shortname"in n&&(n.shortname===e||n.shortname_alternates.includes(e)))return n.key=s,o=n,!0;Object.keys(n).some(function(i){return t(n[i],i)})}}let o;return t(g(),null),o}function h(e){let t="";for(const o of e){const n=o.codePointAt(0).toString(16).padStart(4,"0");["200d","fe0f"].includes(n)||(t!==""&&(t=t+"-"),t=t+n)}return t}function v(e){const t=e.split("-");let o="";return t.forEach(n=>{o=o+String.fromCodePoint(parseInt(n,16))}),o}function p(e){if(e=e==null?void 0:e.trim(),e.startsWith(":")&&e.endsWith(":"))return u(e);{const t=h(e),o=m[t];return o&&(o.key=t),o}}function R(e){const t=(e.match(d)||[]).map(o=>o.trim());return S(t)}function S(e){const t=e?e.filter(o=>u(o)):[];return new Set(t)}function J(e){const t=[...e.matchAll(f)],o=t.length?t.map(n=>n[0]):[];return new Set(o)}exports.codeToEmojiData=p;exports.defaultEmojiAssetUrl=l;exports.emojiJson=m;exports.emojiRegex=f;exports.emojiShortCodeRegex=d;exports.emojiVersion=j;exports.filterValidShortCodes=S;exports.findEmojis=J;exports.findShortCodes=R;exports.getEmojiData=g;exports.setCustomEmojiJson=T;exports.setCustomEmojiUrl=P;exports.setEmojiAssetUrlLarge=A;exports.setEmojiAssetUrlSmall=x;exports.shortcodeToEmojiData=u;exports.stringToUnicode=v;exports.unicodeToString=h;exports.validateCustomEmojiJson=E;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../common/emoji/index.js"],"sourcesContent":["import { emojiPattern } from 'regex-combined-emojis';\nimport emojiJsonLocal from 'emoji-toolkit/emoji_strategy.json' with { type: 'json' };\n\nexport const emojiRegex = new RegExp(emojiPattern, 'g');\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojiJsonLocal;\n\nexport const emojiShortCodeRegex = /(^| |(?<=:))(:\\w+:)/g;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'name',\n 'category',\n 'shortname',\n 'extension',\n 'custom',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n code = code?.trim();\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = (\n textContent.match(emojiShortCodeRegex) || []\n ).map(code => code.trim());\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex)];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":["emojiRegex","emojiPattern","emojiVersion","defaultEmojiAssetUrl","customEmojiAssetUrl","emojiImageUrlSmall","emojiFileExtensionSmall","emojiImageUrlLarge","emojiFileExtensionLarge","emojiJson","emojiJsonLocal","emojiShortCodeRegex","getEmojiData","setEmojiAssetUrlSmall","url","fileExtension","setEmojiAssetUrlLarge","setCustomEmojiUrl","setCustomEmojiJson","json","validateCustomEmojiJson","customEmojiProps","customEmojiRequiredProps","_updateNativeEmojiData","emojiData","propName","propValue","item","customEmojiKey","customEmojiValue","customEmojiPropertyName","customEmojiPropertyValue","val","shortcodeToEmojiData","shortcode","f","o","key","reference","k","unicodeToString","emoji","codePoint","codepoint","stringToUnicode","str","uChars","result","uChar","codeToEmojiData","code","unicodeString","findShortCodes","textContent","shortcodes","filterValidShortCodes","filtered","findEmojis","matches","emojis","match"],"mappings":"wKAGaA,EAAa,IAAI,OAAOC,EAAY,aAAE,GAAG,EACzCC,EAAe,MACfC,EAAuB,6CAA+CD,EAAe,mBACvFE,QAAAA,oBAAsB,KAGtBC,QAAAA,mBAAqBF,EACrBG,QAAAA,wBAA0B,OAG1BC,QAAAA,mBAAqBJ,EACrBK,QAAAA,wBAA0B,OAEzB,MAACC,EAAYC,EAEZC,EAAsB,WAAuB,uBAAA,GAAA,EAEnD,SAASC,GAAgB,CAC9B,OAAOH,CACT,CAEO,SAASI,EAAuBC,EAAKC,EAAgB,OAAQ,CAC7DD,EAAI,SAAS,GAAG,IACnBA,EAAMA,EAAM,KAEdT,QAAAA,mBAAqBS,EACrBR,QAAAA,wBAA0BS,CAC5B,CAEO,SAASC,EAAuBF,EAAKC,EAAgB,OAAQ,CAC7DD,EAAI,SAAS,GAAG,IACnBA,EAAMA,EAAM,KAEdP,QAAAA,mBAAqBO,EACrBN,QAAAA,wBAA0BO,CAC5B,CAEO,SAASE,EAAmBH,EAAK,CACtCV,QAAAA,oBAAsBU,CACxB,CAEO,SAASI,EAAoBC,EAAM,CACxCC,EAAwBD,CAAI,CAC9B,CAKO,SAASC,EAAyBD,EAAM,CAC7C,MAAME,EAAmB,CAAC,YAAa,QAAQ,EACzCC,EAA2B,CAC/B,OACA,WACA,YACA,YACA,QACJ,EAOQC,EAAyB,CAACC,EAAWC,EAAUC,IAAc,CACjE,GAAIF,EAAUC,CAAQ,IAA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AAMA,EAAMA,EAAM,KAC9BA,EAAMA,EAAMM,EACb,CACD,OAAON,CACT,CAGO,SAASO,EAAiBC,EAAK,CACpC,MAAMC,EAASD,EAAI,MAAM,GAAG,EAC5B,IAAIE,EAAS,GACb,OAAAD,EAAO,QAASE,GAAU,CACxBD,EAASA,EAAS,OAAO,cAAc,SAASC,EAAO,EAAE,CAAC,CAC9D,CAAG,EACMD,CACT,CAGO,SAASE,EAAiBC,EAAM,CAErC,GADAA,EAAOA,GAAA,YAAAA,EAAM,OACTA,EAAK,WAAW,GAAG,GAAKA,EAAK,SAAS,GAAG,EAC3C,OAAOjB,EAAqBiB,CAAI,EAC3B,CACL,MAAMC,EAAgBX,EAAgBU,CAAI,EACpCH,EAAStC,EAAU0C,CAAa,EACtC,OAAIJ,IAAQA,EAAO,IAAMI,GAClBJ,CACR,CACH,CAMO,SAASK,EAAgBC,EAAa,CAC3C,MAAMC,GACJD,EAAY,MAAM1C,CAAmB,GAAK,CAAE,GAC5C,IAAIuC,GAAQA,EAAK,KAAM,CAAA,EACzB,OAAOK,EAAsBD,CAAU,CACzC,CAEO,SAASC,EAAuBD,EAAY,CACjD,MAAME,EAAWF,EAAaA,EAAW,OAAOJ,GAAQjB,EAAqBiB,CAAI,CAAC,EAAI,GACtF,OAAO,IAAI,IAAIM,CAAQ,CACzB,CAKO,SAASC,EAAYJ,EAAa,CACvC,MAAMK,EAAU,CAAC,GAAGL,EAAY,SAASrD,CAAU,CAAC,EAC9C2D,EAASD,EAAQ,OAASA,EAAQ,IAAIE,GAASA,EAAM,CAAC,CAAC,EAAI,GACjE,OAAO,IAAI,IAAID,CAAM,CACvB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../common/emoji/index.js"],"sourcesContent":["import { emojiPattern } from 'regex-combined-emojis';\nimport emojiJsonLocal from 'emoji-toolkit/emoji_strategy.json' with { type: 'json' };\n\nexport const emojiRegex = new RegExp(emojiPattern, 'g');\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojiJsonLocal;\n\nexport const emojiShortCodeRegex = /(^| |(?<=:))(:\\w+:)/g;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'date_added',\n 'image',\n 'name',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n code = code?.trim();\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = (\n textContent.match(emojiShortCodeRegex) || []\n ).map(code => code.trim());\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex)];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":["emojiRegex","emojiPattern","emojiVersion","defaultEmojiAssetUrl","customEmojiAssetUrl","emojiImageUrlSmall","emojiFileExtensionSmall","emojiImageUrlLarge","emojiFileExtensionLarge","emojiJson","emojiJsonLocal","emojiShortCodeRegex","getEmojiData","setEmojiAssetUrlSmall","url","fileExtension","setEmojiAssetUrlLarge","setCustomEmojiUrl","setCustomEmojiJson","json","validateCustomEmojiJson","customEmojiProps","customEmojiRequiredProps","_updateNativeEmojiData","emojiData","propName","propValue","item","customEmojiKey","customEmojiValue","customEmojiPropertyName","customEmojiPropertyValue","val","shortcodeToEmojiData","shortcode","f","o","key","reference","k","unicodeToString","emoji","codePoint","codepoint","stringToUnicode","str","uChars","result","uChar","codeToEmojiData","code","unicodeString","findShortCodes","textContent","shortcodes","filterValidShortCodes","filtered","findEmojis","matches","emojis","match"],"mappings":"wKAGa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,SAAS,GAAG,EAC3C,OAAOjB,EAAqBiB,CAAI,EAC3B,CACL,MAAMC,EAAgBX,EAAgBU,CAAI,EACpCH,EAAStC,EAAU0C,CAAa,EACtC,OAAIJ,IAAQA,EAAO,IAAMI,GAClBJ,CACR,CACH,CAMO,SAASK,EAAgBC,EAAa,CAC3C,MAAMC,GACJD,EAAY,MAAM1C,CAAmB,GAAK,CAAE,GAC5C,IAAIuC,GAAQA,EAAK,KAAM,CAAA,EACzB,OAAOK,EAAsBD,CAAU,CACzC,CAEO,SAASC,EAAuBD,EAAY,CACjD,MAAME,EAAWF,EAAaA,EAAW,OAAOJ,GAAQjB,EAAqBiB,CAAI,CAAC,EAAI,GACtF,OAAO,IAAI,IAAIM,CAAQ,CACzB,CAKO,SAASC,EAAYJ,EAAa,CACvC,MAAMK,EAAU,CAAC,GAAGL,EAAY,SAASrD,CAAU,CAAC,EAC9C2D,EAASD,EAAQ,OAASA,EAAQ,IAAIE,GAASA,EAAM,CAAC,CAAC,EAAI,GACjE,OAAO,IAAI,IAAID,CAAM,CACvB"}
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { emojiPattern as d } from "regex-combined-emojis";
|
|
2
2
|
import j from "emoji-toolkit/emoji_strategy.json";
|
|
3
3
|
const g = new RegExp(d, "g"), E = "8.0", f = "https://cdn.jsdelivr.net/joypixels/assets/" + E + "/png/unicode/32/";
|
|
4
|
-
let h = null,
|
|
4
|
+
let h = null, S = f, y = ".png", p = f, P = ".png";
|
|
5
5
|
const c = j, x = new RegExp("(^| |(?<=:))(:\\w+:)", "g");
|
|
6
6
|
function A() {
|
|
7
7
|
return c;
|
|
8
8
|
}
|
|
9
9
|
function T(t, e = ".png") {
|
|
10
|
-
t.endsWith("/") || (t = t + "/"),
|
|
10
|
+
t.endsWith("/") || (t = t + "/"), S = t, y = e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function _(t, e = ".svg") {
|
|
13
13
|
t.endsWith("/") || (t = t + "/"), p = t, P = e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function q(t) {
|
|
16
16
|
h = t;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function J(t) {
|
|
19
19
|
C(t);
|
|
20
20
|
}
|
|
21
21
|
function C(t) {
|
|
22
22
|
const e = ["extension", "custom"], n = [
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"extension",
|
|
27
|
-
"custom"
|
|
23
|
+
"date_added",
|
|
24
|
+
"image",
|
|
25
|
+
"name"
|
|
28
26
|
], o = (s, i, r) => {
|
|
29
27
|
if (s[i] === void 0) {
|
|
30
28
|
if (!e.includes(i))
|
|
@@ -69,14 +67,14 @@ function U(t) {
|
|
|
69
67
|
}
|
|
70
68
|
return e;
|
|
71
69
|
}
|
|
72
|
-
function
|
|
70
|
+
function L(t) {
|
|
73
71
|
const e = t.split("-");
|
|
74
72
|
let n = "";
|
|
75
73
|
return e.forEach((o) => {
|
|
76
74
|
n = n + String.fromCodePoint(parseInt(o, 16));
|
|
77
75
|
}), n;
|
|
78
76
|
}
|
|
79
|
-
function
|
|
77
|
+
function W(t) {
|
|
80
78
|
if (t = t == null ? void 0 : t.trim(), t.startsWith(":") && t.endsWith(":"))
|
|
81
79
|
return l(t);
|
|
82
80
|
{
|
|
@@ -97,13 +95,13 @@ function k(t) {
|
|
|
97
95
|
return new Set(n);
|
|
98
96
|
}
|
|
99
97
|
export {
|
|
100
|
-
|
|
98
|
+
W as codeToEmojiData,
|
|
101
99
|
h as customEmojiAssetUrl,
|
|
102
100
|
f as defaultEmojiAssetUrl,
|
|
103
101
|
P as emojiFileExtensionLarge,
|
|
104
|
-
|
|
102
|
+
y as emojiFileExtensionSmall,
|
|
105
103
|
p as emojiImageUrlLarge,
|
|
106
|
-
|
|
104
|
+
S as emojiImageUrlSmall,
|
|
107
105
|
c as emojiJson,
|
|
108
106
|
g as emojiRegex,
|
|
109
107
|
x as emojiShortCodeRegex,
|
|
@@ -112,12 +110,12 @@ export {
|
|
|
112
110
|
k as findEmojis,
|
|
113
111
|
b as findShortCodes,
|
|
114
112
|
A as getEmojiData,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
J as setCustomEmojiJson,
|
|
114
|
+
q as setCustomEmojiUrl,
|
|
115
|
+
_ as setEmojiAssetUrlLarge,
|
|
118
116
|
T as setEmojiAssetUrlSmall,
|
|
119
117
|
l as shortcodeToEmojiData,
|
|
120
|
-
|
|
118
|
+
L as stringToUnicode,
|
|
121
119
|
U as unicodeToString,
|
|
122
120
|
C as validateCustomEmojiJson
|
|
123
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../common/emoji/index.js"],"sourcesContent":["import { emojiPattern } from 'regex-combined-emojis';\nimport emojiJsonLocal from 'emoji-toolkit/emoji_strategy.json' with { type: 'json' };\n\nexport const emojiRegex = new RegExp(emojiPattern, 'g');\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojiJsonLocal;\n\nexport const emojiShortCodeRegex = /(^| |(?<=:))(:\\w+:)/g;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'name',\n 'category',\n 'shortname',\n 'extension',\n 'custom',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n code = code?.trim();\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = (\n textContent.match(emojiShortCodeRegex) || []\n ).map(code => code.trim());\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex)];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":["emojiRegex","emojiPattern","emojiVersion","defaultEmojiAssetUrl","customEmojiAssetUrl","emojiImageUrlSmall","emojiFileExtensionSmall","emojiImageUrlLarge","emojiFileExtensionLarge","emojiJson","emojiJsonLocal","emojiShortCodeRegex","getEmojiData","setEmojiAssetUrlSmall","url","fileExtension","setEmojiAssetUrlLarge","setCustomEmojiUrl","setCustomEmojiJson","json","validateCustomEmojiJson","customEmojiProps","customEmojiRequiredProps","_updateNativeEmojiData","emojiData","propName","propValue","item","customEmojiKey","customEmojiValue","customEmojiPropertyName","customEmojiPropertyValue","val","shortcodeToEmojiData","shortcode","f","key","reference","k","unicodeToString","emoji","codePoint","codepoint","stringToUnicode","str","uChars","result","uChar","codeToEmojiData","code","unicodeString","findShortCodes","textContent","shortcodes","filterValidShortCodes","filtered","findEmojis","matches","emojis","match"],"mappings":";;AAGY,MAACA,IAAa,IAAI,OAAOC,GAAc,GAAG,GACzCC,IAAe,OACfC,IAAuB,+CAA+CD,IAAe;AACxF,IAACE,IAAsB,MAGtBC,IAAqBF,GACrBG,IAA0B,QAG1BC,IAAqBJ,GACrBK,IAA0B;AAEzB,MAACC,IAAYC,GAEZC,IAAsB,WAAuB,wBAAA,GAAA;AAEnD,SAASC,IAAgB;AAC9B,SAAOH;AACT;AAEO,SAASI,EAAuBC,GAAKC,IAAgB,QAAQ;AAClE,EAAKD,EAAI,SAAS,GAAG,MACnBA,IAAMA,IAAM,MAEdT,IAAqBS,GACrBR,IAA0BS;AAC5B;AAEO,SAASC,EAAuBF,GAAKC,IAAgB,QAAQ;AAClE,EAAKD,EAAI,SAAS,GAAG,MACnBA,IAAMA,IAAM,MAEdP,IAAqBO,GACrBN,IAA0BO;AAC5B;AAEO,SAASE,EAAmBH,GAAK;AACtC,EAAAV,IAAsBU;AACxB;AAEO,SAASI,EAAo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O,SAASC,EAAYJ,GAAa;AACvC,QAAMK,IAAU,CAAC,GAAGL,EAAY,SAASpD,CAAU,CAAC,GAC9C0D,IAASD,EAAQ,SAASA,EAAQ,IAAI,CAAAE,MAASA,EAAM,CAAC,CAAC,IAAI;AACjE,SAAO,IAAI,IAAID,CAAM;AACvB;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../common/emoji/index.js"],"sourcesContent":["import { emojiPattern } from 'regex-combined-emojis';\nimport emojiJsonLocal from 'emoji-toolkit/emoji_strategy.json' with { type: 'json' };\n\nexport const emojiRegex = new RegExp(emojiPattern, 'g');\nexport const emojiVersion = '8.0';\nexport const defaultEmojiAssetUrl = 'https://cdn.jsdelivr.net/joypixels/assets/' + emojiVersion + '/png/unicode/32/';\nexport let customEmojiAssetUrl = null;\n\n// Used for emoji 16px and smaller\nexport let emojiImageUrlSmall = defaultEmojiAssetUrl;\nexport let emojiFileExtensionSmall = '.png';\n\n// Used for emoji larger than 16px\nexport let emojiImageUrlLarge = defaultEmojiAssetUrl;\nexport let emojiFileExtensionLarge = '.png';\n\nexport const emojiJson = emojiJsonLocal;\n\nexport const emojiShortCodeRegex = /(^| |(?<=:))(:\\w+:)/g;\n\nexport function getEmojiData () {\n return emojiJson;\n}\n\nexport function setEmojiAssetUrlSmall (url, fileExtension = '.png') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlSmall = url;\n emojiFileExtensionSmall = fileExtension;\n}\n\nexport function setEmojiAssetUrlLarge (url, fileExtension = '.svg') {\n if (!url.endsWith('/')) {\n url = url + '/';\n }\n emojiImageUrlLarge = url;\n emojiFileExtensionLarge = fileExtension;\n}\n\nexport function setCustomEmojiUrl (url) {\n customEmojiAssetUrl = url;\n}\n\nexport function setCustomEmojiJson (json) {\n validateCustomEmojiJson(json);\n}\n\n/**\n * Validate custom emoji json\n */\nexport function validateCustomEmojiJson (json) {\n const customEmojiProps = ['extension', 'custom'];\n const customEmojiRequiredProps = [\n 'date_added',\n 'image',\n 'name',\n ];\n\n /**\n * Update single emoji properties.\n * If the property exists in emojiData, it'll add the values if the property is an array, otherwise will overwrite.\n * If not exists, will add the property to the emojiData object.\n */\n const _updateNativeEmojiData = (emojiData, propName, propValue) => {\n if (emojiData[propName] === undefined) {\n if (!customEmojiProps.includes(propName)) {\n return;\n }\n\n // new property to add\n emojiData[propName] = propValue;\n } else {\n if (Array.isArray(emojiData[propName])) {\n emojiData[propName] = emojiData[propName].concat(propValue);\n } else {\n emojiData[propName] = propValue;\n }\n }\n };\n\n Object.entries(json).forEach((item) => {\n const [customEmojiKey, customEmojiValue] = item;\n\n if (customEmojiKey in emojiJson) {\n // custom emoji exists in emoji json which means to update some data in the native emoji\n const emojiData = emojiJson[customEmojiKey];\n\n for (const customEmojiPropertyName in customEmojiValue) {\n const customEmojiPropertyValue = customEmojiValue[customEmojiPropertyName];\n\n _updateNativeEmojiData(emojiData, customEmojiPropertyName, customEmojiPropertyValue);\n }\n } else {\n // new custom emoji\n const _validateRequiredProps = () =>\n customEmojiRequiredProps.every((val) => {\n return customEmojiValue[val] !== undefined;\n });\n\n if (_validateRequiredProps()) {\n emojiJson[customEmojiKey] = customEmojiValue;\n } else {\n console.error(\n 'The following custom emoji doesn\\'t contain the required properties:',\n customEmojiValue,\n );\n }\n }\n });\n}\n\n// recursively searches the emoji data object containing data for all emojis\n// and returns the object with the specified shortcode.\nexport function shortcodeToEmojiData (shortcode) {\n // eslint-disable-next-line complexity\n function f (o, key) {\n if (!o || typeof o !== 'object') {\n return;\n }\n if ('shortname' in o) {\n if (o.shortname === shortcode || o.shortname_alternates.includes(shortcode)) {\n o.key = key;\n reference = o;\n return true;\n }\n }\n Object.keys(o).some(function (k) {\n return f(o[k], k);\n });\n }\n\n let reference;\n f(getEmojiData(), null);\n return reference;\n}\n\n// Takes in an emoji unicode character(s) and converts it to an emoji string in the format the emoji data object expects\n// as a key. There can be multiple unicode characters in an emoji to denote the emoji itself, skin tone, gender\n// and such. Note that this function does NOT return variation selectors (fe0f) or zero width joiners (200d), as these\n// are not included as part of the key in the emoji.json.\n//\n// Example:\n// return value for smile emoji (no skin tone): 1f600\n// return value for left facing fist (light skin tone): 1f91b-1f3fb\nexport function unicodeToString (emoji) {\n let key = '';\n for (const codePoint of emoji) {\n const codepoint = codePoint.codePointAt(0).toString(16).padStart(4, '0');\n\n // skip 200d and fe0f as these are not included in emoji_strategy.json keys\n if (['200d', 'fe0f'].includes(codepoint)) continue;\n if (key !== '') { key = key + '-'; }\n key = key + codepoint;\n }\n return key;\n}\n\n// Takes in unicode in string form ex: '1f91b-1f3fb' and converts it to an actual unicode character.\nexport function stringToUnicode (str) {\n const uChars = str.split('-');\n let result = '';\n uChars.forEach((uChar) => {\n result = result + String.fromCodePoint(parseInt(uChar, 16));\n });\n return result;\n}\n\n// Takes in a code (which could be unicode or shortcode) and returns the emoji data for it.\nexport function codeToEmojiData (code) {\n code = code?.trim();\n if (code.startsWith(':') && code.endsWith(':')) {\n return shortcodeToEmojiData(code);\n } else {\n const unicodeString = unicodeToString(code);\n const result = emojiJson[unicodeString];\n if (result) result.key = unicodeString;\n return result;\n }\n}\n\n// Finds every shortcode in slot text\n// filters only the existing codes in emojiJson\n// removes duplicates.\n// @returns {string[]}\nexport function findShortCodes (textContent) {\n const shortcodes = (\n textContent.match(emojiShortCodeRegex) || []\n ).map(code => code.trim());\n return filterValidShortCodes(shortcodes);\n}\n\nexport function filterValidShortCodes (shortcodes) {\n const filtered = shortcodes ? shortcodes.filter(code => shortcodeToEmojiData(code)) : [];\n return new Set(filtered);\n}\n\n// Finds every emoji in slot text\n// removes duplicates\n// @returns {string[]}\nexport function findEmojis (textContent) {\n const matches = [...textContent.matchAll(emojiRegex)];\n const emojis = matches.length ? matches.map(match => match[0]) : [];\n return new Set(emojis);\n}\n"],"names":["emojiRegex","emojiPattern","emojiVersion","defaultEmojiAssetUrl","customEmojiAssetUrl","emojiImageUrlSmall","emojiFileExtensionSmall","emojiImageUrlLarge","emojiFileExtensionLarge","emojiJson","emojiJsonLocal","emojiShortCodeRegex","getEmojiData","setEmojiAssetUrlSmall","url","fileExtension","setEmojiAssetUrlLarge","setCustomEmojiUrl","setCustomEmojiJson","json","validateCustomEmojiJson","customEmojiProps","customEmojiRequiredProps","_updateNativeEmojiData","emojiData","propName","propValue","item","customEmojiKey","customEmojiValue","customEmojiPropertyName","customEmojiPropertyValue","val","shortcodeToEmojiData","shortcode","f","key","reference","k","unicodeToString","emoji","codePoint","codepoint","stringToUnicode","str","uChars","result","uChar","codeToEmojiData","code","unicodeString","findShortCodes","textContent","shortcodes","filterValidShortCodes","filtered","findEmojis","matches","emojis","match"],"mappings":";;AAGY,MAACA,IAAa,IAAI,OAAOC,GAAc,GAAG,GACzCC,IAAe,OACfC,IAAuB,+CAA+CD,IAAe;AACxF,IAACE,IAAsB,MAGtBC,IAAqBF,GACrBG,IAA0B,QAG1BC,IAAqBJ,GACrBK,IAA0B;AAEzB,MAACC,IAAYC,GAEZC,IAAsB,WAAuB,wBAAA,GAAA;AAEnD,SAASC,IAAgB;AAC9B,SAAOH;AACT;AAEO,SAASI,EAAuBC,GAAKC,IAAgB,QAAQ;AAClE,EAAKD,EAAI,SAAS,GAAG,MACnBA,IAAMA,IAAM,MAEdT,IAAqBS,GACrBR,IAA0BS;AAC5B;AAEO,SAASC,EAAuBF,GAAKC,IAAgB,QAAQ;AAClE,EAAKD,EAAI,SAAS,GAAG,MACnBA,IAAMA,IAAM,MAEdP,IAAqBO,GACrBN,IAA0BO;AAC5B;AAEO,SAASE,EAAmBH,GAAK;AACtC,EAAAV,IAAsBU;AACxB;AAEO,SAASI,EAAoBC,GAAM;AACxC,EAAAC,EAAwBD,CAAI;AAC9B;AAKO,SAASC,EAAyBD,GAAM;AAC7C,QAAME,IAAmB,CAAC,aAAa,QAAQ,GACzCC,IAA2B;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACJ,GAOQC,IAAyB,CAACC,GAAWC,GAAUC,MAAc;AACjE,QAAIF,EAA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perties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("./last-active-nodes.cjs"),r=require("@tiptap/core"),a=require("../../node_modules/@tiptap/vue-2.cjs"),s=require("@dialpad/dialtone-icons/vue2"),u=require("../../localization/index.cjs"),d=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),h=require("../item-layout/item-layout.cjs"),p=require("../button/button.cjs"),f=require("./message-input-topbar.cjs"),g=require("./message-input-link.cjs"),l=require("../editor/editor-constants.cjs"),_=require("../emoji-picker/emoji-picker.cjs"),b=require("../input/input.cjs"),k=require("../popover/popover.cjs"),T=require("../rich-text-editor/rich-text-editor.cjs"),v=require("../tooltip/tooltip.cjs"),L=require("../stack/stack.cjs"),c=require("../rich-text-editor/rich-text-editor-constants.cjs"),S={name:"MeetingPill",components:{NodeViewWrapper:a.NodeViewWrapper,DtItemLayout:h.default,DtIconClose:s.DtIconClose,DtButton:p.default,DtIconVideo:s.DtIconVideo},props:a.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new u.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(t){var i,n,o;const e=(o=(n=(i=this.editor)==null?void 0:i.storage)==null?void 0:n.meetingPill)==null?void 0:o.onClose;e&&typeof e=="function"&&e(t)}}};var I=function(){var e=this,i=e._self._c;return i("node-view-wrapper",{staticClass:"d-recipe-message-input-meeting-pill"},[i("dt-item-layout",{staticClass:"d-recipe-message-input-meeting-pill__layout",attrs:{unstyled:""},scopedSlots:e._u([{key:"left",fn:function(){return[i("div",{staticClass:"d-recipe-message-input-meeting-pill__icon"},[i("dt-icon-video",{attrs:{size:"400"}})],1)]},proxy:!0},{key:"right",fn:function(){return[i("div",{staticClass:"d-recipe-message-input-meeting-pill__close"},[i("dt-button",{attrs:{circle:"",importance:"clear",size:"xs","aria-label":e.closeButtonTitle,title:e.closeButtonTitle},on:{click:e.close},scopedSlots:e._u([{key:"icon",fn:function(){return[i("dt-icon-close",{attrs:{size:"300"}})]},proxy:!0}])})],1)]},proxy:!0}])},[e._v(" "+e._s(e.node.attrs.text)+" ")])],1)},x=[],y=d.n(S,I,x);const O=y.exports,B=r.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return a.VueNodeViewRenderer(O)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText({node:t}){return"/dpm"},renderHTML({HTMLAttributes:t}){return["meeting-pill",r.mergeAttributes(t)]}}),C={name:"DtRecipeMessageInput",components:{DtButton:p.default,DtEmojiPicker:_.default,DtInput:b.default,DtPopover:k.default,DtRecipeMessageInputTopbar:f.default,DtRecipeMessageInputLink:g.default,DtRichTextEditor:T.default,DtTooltip:v.default,DtStack:L.default,DtIconImage:s.DtIconImage,DtIconVerySatisfied:s.DtIconVerySatisfied,DtIconSatisfied:s.DtIconSatisfied,DtIconSend:s.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},value:{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(t){return typeof t=="string"?c.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},outputFormat:{type:String,default:"json",validator(t){return c.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(t)}},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:value","text-input","add-emoji"],data(){return{lastActiveNodes:m.default,additionalExtensions:[B.configure({onClose:t=>{this.$emit("meeting-pill-close",t)}})],internalInputValue:this.value,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 u.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:{value(t){this.internalInputValue=t},emojiPickerOpened(t){var e;t||(e=this.$refs.richTextEditor)==null||e.focusEditor()}},created(){this.value&&this.outputFormat==="text"?this.internalInputValue=this.value.replace(/\n/g,"<br>"):this.internalInputValue=this.value},methods:{linkDialogOpened(t){var e;this.linkDialogOpen=t,t===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(e=this.$refs.richTextEditor)==null||e.focusEditor())},handleTopbarClick(t){var n;const e=(n=this.$refs.richTextEditor)==null?void 0:n.editor,i={bold:()=>e==null?void 0:e.chain().focus().toggleBold().run(),italic:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),strike:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),bulletList:()=>e==null?void 0:e.chain().focus().toggleBulletList().run(),orderedList:()=>e==null?void 0:e.chain().focus().toggleOrderedList().run(),blockquote:()=>e==null?void 0:e.chain().focus().toggleBlockquote().run(),code:()=>e==null?void 0:e.chain().focus().toggleCode().run(),codeBlock:()=>e==null?void 0:e.chain().focus().toggleCodeBlock().run()};e&&i[t]&&i[t]()},isSelectionActive(t){var e,i,n,o;return["bulletList","orderedList"].includes(t)?this.lastActiveNodes((i=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null?void 0:i.state,[{type:"bulletList"},{type:"orderedList"}]).includes(t)&&this.isFocused:((o=(n=this.$refs.richTextEditor)==null?void 0:n.editor)==null?void 0:o.isActive(t))&&this.isFocused},initLinkDialog(){var t,e,i;this.$refs.link.setInitialValues(this.selectedText,(i=(e=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:e.getAttributes("link"))==null?void 0:i.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var t;(t=this.$refs.richTextEditor)==null||t.removeLink(),this.linkDialogOpen=!1},setLink(t,e){this.$refs.richTextEditor.setLink(e,t,this.linkOptions,l.EDITOR_SUPPORTED_LINK_PROTOCOLS,l.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(t){this.$refs.richTextEditor.$el.querySelector(".tiptap").contains(t.target)||(t.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(t){const e=t.dataTransfer,i=Array.from(e.files);this.$emit("add-media",i)},onPaste(t){if(t.clipboardData.files.length){t.stopPropagation(),t.preventDefault();const e=[...t.clipboardData.files];this.$emit("paste-media",e)}},onSkinTone(t){this.$emit("skin-tone",t)},onSelectEmoji(t,e){t&&(t.shift_key||e(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:t.shortname}}),this.$emit("selected-emoji",t))},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(t){this.$emit("update:value",t)},onTextInput(t){this.text=t,this.$emit("text-input",t)}}};var E=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-recipe-message-input",attrs:{"data-qa":"dt-recipe-message-input",role:"presentation"},on:{dragover:function(n){n.preventDefault()},drop:function(n){return n.preventDefault(),e.onDrop.apply(null,arguments)},paste:e.onPaste,mousedown:e.onMousedown}},[e._t("top"),e.richText?i("dt-recipe-message-input-topbar",{key:e.selectedText,attrs:{"bold-button-options":e.boldButtonOptions,"italic-button-options":e.italicButtonOptions,"strike-button-options":e.strikeButtonOptions,"bullet-list-button-options":e.bulletListButtonOptions,"ordered-list-button-options":e.orderedListButtonOptions,"block-quote-button-options":e.blockQuoteButtonOptions,"code-button-options":e.codeButtonOptions,"code-block-button-options":e.codeBlockButtonOptions,"is-selection-active":e.isSelectionActive},on:{click:e.handleTopbarClick},scopedSlots:e._u([{key:"link",fn:function(){return[i("dt-recipe-message-input-link",{ref:"link",attrs:{open:e.linkDialogOpen,"link-button-options":e.linkButtonOptions,"is-selection-active":e.isSelectionActive},on:{opened:e.linkDialogOpened,"set-link":e.setLink,"remove-link":e.removeLink}})]},proxy:!0}],null,!1,1527282285)}):e._e(),i("div",{directives:[{name:"dt-scrollbar",rawName:"v-dt-scrollbar"}],staticClass:"d-recipe-message-input__editor-wrapper",style:{"max-height":e.maxHeight}},[i("dt-rich-text-editor",e._g(e._b({ref:"richTextEditor",attrs:{editable:e.editable,"input-aria-label":e.inputAriaLabel,"input-class":e.inputClass,"output-format":e.outputFormat,"auto-focus":e.autoFocus,link:e.richText,placeholder:e.placeholder,"prevent-typing":e.preventTyping,"mention-suggestion":e.mentionSuggestion,"channel-suggestion":e.channelSuggestion,"slash-command-suggestion":e.slashCommandSuggestion,"paste-rich-text":e.richText,"allow-blockquote":e.richText,"allow-bold":e.richText,"allow-bullet-list":e.richText,"allow-code":e.richText,"allow-codeblock":e.richText,"allow-italic":e.richText,"allow-strike":e.richText,"allow-underline":e.richText,"additional-extensions":e.additionalExtensions,"hide-link-bubble-menu":e.hideLinkBubbleMenu},on:{input:e.onInput,"text-input":e.onTextInput,enter:e.onSend,selected:function(n){e.selectedText=n},"selected-command":function(n){return e.$emit("selected-command",n)},"edit-link":e.initLinkDialog,focus:function(n){e.isFocused=!0},blur:function(n){e.isFocused=!1}},model:{value:e.internalInputValue,callback:function(n){e.internalInputValue=n},expression:"internalInputValue"}},"dt-rich-text-editor",e.$attrs,!1),e.$listeners))],1),e._t("middle"),i("section",{staticClass:"d-recipe-message-input__bottom-section"},[i("div",{staticClass:"d-recipe-message-input__bottom-section-left"},[i("dt-stack",{attrs:{direction:"row",gap:"200"}},[e.showImagePicker?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip:top-start",value:e.imagePickerButtonLabel,expression:"imagePickerButtonLabel",arg:"top-start"}],staticClass:"d-recipe-message-input__button",attrs:{"data-qa":"dt-recipe-message-input-image-btn",size:"sm",kind:"muted",importance:"clear","aria-label":e.imagePickerButtonLabel},on:{click:e.onSelectImage,mouseenter:function(n){e.imagePickerFocus=!0},mouseleave:function(n){e.imagePickerFocus=!1},focus:function(n){e.imagePickerFocus=!0},blur:function(n){e.imagePickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[i("dt-icon-image",{attrs:{size:"300"}})]},proxy:!0}],null,!1,4195307205)}):e._e(),i("dt-input",{ref:"messageInputImageUpload",staticClass:"d-recipe-message-input__image-input",attrs:{"data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",multiple:"",hidden:""},on:{input:e.onImageUpload}}),e.showEmojiPicker?i("dt-popover",{attrs:{"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},scopedSlots:e._u([{key:"anchor",fn:function({attrs:n}){return[i("dt-button",e._b({directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:e.emojiPickerButtonLabel,expression:"emojiPickerButtonLabel"}],staticClass:"d-recipe-message-input__button",attrs:{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",kind:"muted",importance:"clear","aria-label":e.emojiPickerButtonLabel},on:{click:e.toggleEmojiPicker,mouseenter:function(o){e.emojiPickerFocus=!0},mouseleave:function(o){e.emojiPickerFocus=!1},focus:function(o){e.emojiPickerFocus=!0},blur:function(o){e.emojiPickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[e.emojiPickerHovered?i("dt-icon-very-satisfied",{attrs:{size:"300"}}):i("dt-icon-satisfied",{attrs:{size:"300"}})]},proxy:!0}],null,!0)},"dt-button",n,!1))]}},{key:"content",fn:function({close:n}){return[i("dt-emoji-picker",e._b({on:{"add-emoji":function(o){return e.$emit("add-emoji")},"skin-tone":e.onSkinTone,"selected-emoji":o=>e.onSelectEmoji(o,n)}},"dt-emoji-picker",e.emojiPickerProps,!1))]}}],null,!1,2292511006)}):e._e(),e._t("emojiGiphyPicker"),e._t("customActionIcons")],2)],1),i("div",{staticClass:"d-recipe-message-input__bottom-section-right"},[i("dt-stack",{attrs:{direction:"row",gap:"300"}},[i("div",{staticClass:"d-recipe-message-input__sms-count"},[e._t("smsCount")],2),e.showCharacterLimit?i("dt-tooltip",{staticClass:"d-recipe-message-input__remaining-char-tooltip",attrs:{placement:"top-end",enabled:e.characterLimitTooltipEnabled,message:e.showCharacterLimit.message,offset:[10,8]},scopedSlots:e._u([{key:"anchor",fn:function(){return[i("p",{directives:[{name:"show",rawName:"v-show",value:e.displayCharacterLimitWarning,expression:"displayCharacterLimitWarning"}],staticClass:"d-recipe-message-input__remaining-char",attrs:{"data-qa":"dt-recipe-message-input-character-limit"}},[e._v(" "+e._s(e.showCharacterLimit.count-e.inputLength)+" ")])]},proxy:!0}],null,!1,1021505058)}):e._e(),e.showCancel?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:e.cancelButtonLabel,expression:"cancelButtonLabel"}],staticClass:"d-recipe-message-input__button d-recipe-message-input__cancel-button",attrs:{"data-qa":"dt-recipe-message-input-cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":e.cancelButtonLabel},on:{click:e.onCancel}},[i("p",[e._v(e._s(e.cancelButtonLabel))])]):e._e(),e._t("sendButton",function(){return[e.showSend?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip:top-end",value:e.sendButtonLabel,expression:"sendButtonLabel",arg:"top-end"}],class:["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":e.isSendDisabled,"d-btn--icon-only":e.showSendIcon}],attrs:{"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary","aria-label":e.sendButtonLabel,"aria-disabled":e.isSendDisabled},on:{click:e.onSend},scopedSlots:e._u([e.showSendIcon?{key:"icon",fn:function(){return[e._t("sendIcon",function(){return[i("dt-icon-send",{attrs:{size:e.sendIconSize}})]},{iconSize:e.sendIconSize})]},proxy:!0}:null],null,!0)},[e.showSend.text?[i("p",[e._v(e._s(e.showSend.text))])]:e._e()],2):e._e()]})],2)],1)])],2)},P=[],w=d.n(C,E,P);const D=w.exports;exports.default=D;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("./last-active-nodes.cjs"),r=require("@tiptap/core"),a=require("../../node_modules/@tiptap/vue-2.cjs"),s=require("@dialpad/dialtone-icons/vue2"),u=require("../../localization/index.cjs"),d=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),h=require("../item-layout/item-layout.cjs"),p=require("../button/button.cjs"),f=require("./message-input-topbar.cjs"),g=require("./message-input-link.cjs"),l=require("../editor/editor-constants.cjs"),_=require("../emoji-picker/emoji-picker.cjs"),b=require("../input/input.cjs"),k=require("../popover/popover.cjs"),T=require("../rich-text-editor/rich-text-editor.cjs"),v=require("../tooltip/tooltip.cjs"),L=require("../stack/stack.cjs"),c=require("../rich-text-editor/rich-text-editor-constants.cjs"),S={name:"MeetingPill",components:{NodeViewWrapper:a.NodeViewWrapper,DtItemLayout:h.default,DtIconClose:s.DtIconClose,DtButton:p.default,DtIconVideo:s.DtIconVideo},props:a.nodeViewProps,emits:["meeting-pill-close"],data(){return{i18n:new u.DialtoneLocalization}},computed:{closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},methods:{close(t){var i,n,o;const e=(o=(n=(i=this.editor)==null?void 0:i.storage)==null?void 0:n.meetingPill)==null?void 0:o.onClose;e&&typeof e=="function"&&e(t)}}};var I=function(){var e=this,i=e._self._c;return i("node-view-wrapper",{staticClass:"d-recipe-message-input-meeting-pill"},[i("dt-item-layout",{staticClass:"d-recipe-message-input-meeting-pill__layout",attrs:{unstyled:""},scopedSlots:e._u([{key:"left",fn:function(){return[i("div",{staticClass:"d-recipe-message-input-meeting-pill__icon"},[i("dt-icon-video",{attrs:{size:"400"}})],1)]},proxy:!0},{key:"right",fn:function(){return[i("div",{staticClass:"d-recipe-message-input-meeting-pill__close"},[i("dt-button",{attrs:{circle:"",importance:"clear",size:"xs","aria-label":e.closeButtonTitle,title:e.closeButtonTitle},on:{click:e.close},scopedSlots:e._u([{key:"icon",fn:function(){return[i("dt-icon-close",{attrs:{size:"300"}})]},proxy:!0}])})],1)]},proxy:!0}])},[e._v(" "+e._s(e.node.attrs.text)+" ")])],1)},x=[],y=d.n(S,I,x);const O=y.exports,B=r.Node.create({name:"meetingPill",atom:!0,group:"inline",inline:!0,addOptions(){return{onClose:()=>{}}},addStorage(){return{onClose:this.options.onClose}},addNodeView(){return a.VueNodeViewRenderer(O)},addAttributes(){return{text:{default:'Please pass in "text" attribute'}}},parseHTML(){return[{tag:"meeting-pill"}]},renderText({node:t}){return"/dpm"},renderHTML({HTMLAttributes:t}){return["meeting-pill",r.mergeAttributes(t)]}}),C={name:"DtRecipeMessageInput",components:{DtButton:p.default,DtEmojiPicker:_.default,DtInput:b.default,DtPopover:k.default,DtRecipeMessageInputTopbar:f.default,DtRecipeMessageInputLink:g.default,DtRichTextEditor:T.default,DtTooltip:v.default,DtStack:L.default,DtIconImage:s.DtIconImage,DtIconVerySatisfied:s.DtIconVerySatisfied,DtIconSatisfied:s.DtIconSatisfied,DtIconSend:s.DtIconSend},inheritAttrs:!1,props:{richText:{type:Boolean,default:!0},value:{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(t){return typeof t=="string"?c.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(t):!0}},outputFormat:{type:String,default:"json",validator(t){return c.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(t)}},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:value","text-input","add-emoji"],data(){return{lastActiveNodes:m.default,additionalExtensions:[B.configure({onClose:t=>{this.$emit("meeting-pill-close",t)}})],internalInputValue:this.value,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 u.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:{value(t){this.internalInputValue=t},emojiPickerOpened(t){var e;t||(e=this.$refs.richTextEditor)==null||e.focusEditor()}},created(){this.value&&this.outputFormat==="text"?this.internalInputValue=this.value.replace(/\n/g,"<br>"):this.internalInputValue=this.value},methods:{linkDialogOpened(t){var e;this.linkDialogOpen=t,t===!0?this.initLinkDialog():(this.hideLinkBubbleMenu=!1,(e=this.$refs.richTextEditor)==null||e.focusEditor())},handleTopbarClick(t){var n;const e=(n=this.$refs.richTextEditor)==null?void 0:n.editor,i={bold:()=>e==null?void 0:e.chain().focus().toggleBold().run(),italic:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),strike:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),bulletList:()=>e==null?void 0:e.chain().focus().toggleBulletList().run(),orderedList:()=>e==null?void 0:e.chain().focus().toggleOrderedList().run(),blockquote:()=>e==null?void 0:e.chain().focus().toggleBlockquote().run(),code:()=>e==null?void 0:e.chain().focus().toggleCode().run(),codeBlock:()=>e==null?void 0:e.chain().focus().toggleCodeBlock().run()};e&&i[t]&&i[t]()},isSelectionActive(t){var e,i,n,o;return["bulletList","orderedList"].includes(t)?this.lastActiveNodes((i=(e=this.$refs.richTextEditor)==null?void 0:e.editor)==null?void 0:i.state,[{type:"bulletList"},{type:"orderedList"}]).includes(t)&&this.isFocused:((o=(n=this.$refs.richTextEditor)==null?void 0:n.editor)==null?void 0:o.isActive(t))&&this.isFocused},initLinkDialog(){var t,e,i;this.$refs.link.setInitialValues(this.selectedText,(i=(e=(t=this.$refs.richTextEditor)==null?void 0:t.editor)==null?void 0:e.getAttributes("link"))==null?void 0:i.href),this.hideLinkBubbleMenu=!0,this.linkDialogOpen=!0},removeLink(){var t;(t=this.$refs.richTextEditor)==null||t.removeLink(),this.linkDialogOpen=!1},setLink(t,e){this.$refs.richTextEditor.setLink(e,t,this.linkOptions,l.EDITOR_SUPPORTED_LINK_PROTOCOLS,l.EDITOR_DEFAULT_LINK_PREFIX),this.linkDialogOpen=!1},onMousedown(t){this.$refs.richTextEditor.$el.querySelector(".tiptap").contains(t.target)||(t.preventDefault(),this.$refs.richTextEditor.focusEditor())},onDrop(t){const e=t.dataTransfer,i=Array.from(e.files);this.$emit("add-media",i)},onPaste(t){if(t.clipboardData.files.length){t.stopPropagation(),t.preventDefault();const e=[...t.clipboardData.files];this.$emit("paste-media",e)}},onSkinTone(t){this.$emit("skin-tone",t)},onSelectEmoji(t,e){t&&(t.shift_key||e(),this.$refs.richTextEditor.editor.commands.insertContent({type:"emoji",attrs:{code:t.shortname,image:t.image,name:t.name}}),this.$emit("selected-emoji",t))},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(t){this.$emit("update:value",t)},onTextInput(t){this.text=t,this.$emit("text-input",t)}}};var E=function(){var e=this,i=e._self._c;return i("div",{staticClass:"d-recipe-message-input",attrs:{"data-qa":"dt-recipe-message-input",role:"presentation"},on:{dragover:function(n){n.preventDefault()},drop:function(n){return n.preventDefault(),e.onDrop.apply(null,arguments)},paste:e.onPaste,mousedown:e.onMousedown}},[e._t("top"),e.richText?i("dt-recipe-message-input-topbar",{key:e.selectedText,attrs:{"bold-button-options":e.boldButtonOptions,"italic-button-options":e.italicButtonOptions,"strike-button-options":e.strikeButtonOptions,"bullet-list-button-options":e.bulletListButtonOptions,"ordered-list-button-options":e.orderedListButtonOptions,"block-quote-button-options":e.blockQuoteButtonOptions,"code-button-options":e.codeButtonOptions,"code-block-button-options":e.codeBlockButtonOptions,"is-selection-active":e.isSelectionActive},on:{click:e.handleTopbarClick},scopedSlots:e._u([{key:"link",fn:function(){return[i("dt-recipe-message-input-link",{ref:"link",attrs:{open:e.linkDialogOpen,"link-button-options":e.linkButtonOptions,"is-selection-active":e.isSelectionActive},on:{opened:e.linkDialogOpened,"set-link":e.setLink,"remove-link":e.removeLink}})]},proxy:!0}],null,!1,1527282285)}):e._e(),i("div",{directives:[{name:"dt-scrollbar",rawName:"v-dt-scrollbar"}],staticClass:"d-recipe-message-input__editor-wrapper",style:{"max-height":e.maxHeight}},[i("dt-rich-text-editor",e._g(e._b({ref:"richTextEditor",attrs:{editable:e.editable,"input-aria-label":e.inputAriaLabel,"input-class":e.inputClass,"output-format":e.outputFormat,"auto-focus":e.autoFocus,link:e.richText,placeholder:e.placeholder,"prevent-typing":e.preventTyping,"mention-suggestion":e.mentionSuggestion,"channel-suggestion":e.channelSuggestion,"slash-command-suggestion":e.slashCommandSuggestion,"paste-rich-text":e.richText,"allow-blockquote":e.richText,"allow-bold":e.richText,"allow-bullet-list":e.richText,"allow-code":e.richText,"allow-codeblock":e.richText,"allow-italic":e.richText,"allow-strike":e.richText,"allow-underline":e.richText,"additional-extensions":e.additionalExtensions,"hide-link-bubble-menu":e.hideLinkBubbleMenu},on:{input:e.onInput,"text-input":e.onTextInput,enter:e.onSend,selected:function(n){e.selectedText=n},"selected-command":function(n){return e.$emit("selected-command",n)},"edit-link":e.initLinkDialog,focus:function(n){e.isFocused=!0},blur:function(n){e.isFocused=!1}},model:{value:e.internalInputValue,callback:function(n){e.internalInputValue=n},expression:"internalInputValue"}},"dt-rich-text-editor",e.$attrs,!1),e.$listeners))],1),e._t("middle"),i("section",{staticClass:"d-recipe-message-input__bottom-section"},[i("div",{staticClass:"d-recipe-message-input__bottom-section-left"},[i("dt-stack",{attrs:{direction:"row",gap:"200"}},[e.showImagePicker?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip:top-start",value:e.imagePickerButtonLabel,expression:"imagePickerButtonLabel",arg:"top-start"}],staticClass:"d-recipe-message-input__button",attrs:{"data-qa":"dt-recipe-message-input-image-btn",size:"sm",kind:"muted",importance:"clear","aria-label":e.imagePickerButtonLabel},on:{click:e.onSelectImage,mouseenter:function(n){e.imagePickerFocus=!0},mouseleave:function(n){e.imagePickerFocus=!1},focus:function(n){e.imagePickerFocus=!0},blur:function(n){e.imagePickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[i("dt-icon-image",{attrs:{size:"300"}})]},proxy:!0}],null,!1,4195307205)}):e._e(),i("dt-input",{ref:"messageInputImageUpload",staticClass:"d-recipe-message-input__image-input",attrs:{"data-qa":"dt-recipe-message-input-image-input",accept:"image/*, video/*",type:"file",multiple:"",hidden:""},on:{input:e.onImageUpload}}),e.showEmojiPicker?i("dt-popover",{attrs:{"open.sync":"emojiPickerOpened","data-qa":"dt-recipe-message-input-emoji-picker-popover","initial-focus-element":"#searchInput",padding:"none"},scopedSlots:e._u([{key:"anchor",fn:function({attrs:n}){return[i("dt-button",e._b({directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:e.emojiPickerButtonLabel,expression:"emojiPickerButtonLabel"}],staticClass:"d-recipe-message-input__button",attrs:{"data-qa":"dt-recipe-message-input-emoji-picker-btn",size:"sm",kind:"muted",importance:"clear","aria-label":e.emojiPickerButtonLabel},on:{click:e.toggleEmojiPicker,mouseenter:function(o){e.emojiPickerFocus=!0},mouseleave:function(o){e.emojiPickerFocus=!1},focus:function(o){e.emojiPickerFocus=!0},blur:function(o){e.emojiPickerFocus=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[e.emojiPickerHovered?i("dt-icon-very-satisfied",{attrs:{size:"300"}}):i("dt-icon-satisfied",{attrs:{size:"300"}})]},proxy:!0}],null,!0)},"dt-button",n,!1))]}},{key:"content",fn:function({close:n}){return[i("dt-emoji-picker",e._b({on:{"add-emoji":function(o){return e.$emit("add-emoji")},"skin-tone":e.onSkinTone,"selected-emoji":o=>e.onSelectEmoji(o,n)}},"dt-emoji-picker",e.emojiPickerProps,!1))]}}],null,!1,2292511006)}):e._e(),e._t("emojiGiphyPicker"),e._t("customActionIcons")],2)],1),i("div",{staticClass:"d-recipe-message-input__bottom-section-right"},[i("dt-stack",{attrs:{direction:"row",gap:"300"}},[i("div",{staticClass:"d-recipe-message-input__sms-count"},[e._t("smsCount")],2),e.showCharacterLimit?i("dt-tooltip",{staticClass:"d-recipe-message-input__remaining-char-tooltip",attrs:{placement:"top-end",enabled:e.characterLimitTooltipEnabled,message:e.showCharacterLimit.message,offset:[10,8]},scopedSlots:e._u([{key:"anchor",fn:function(){return[i("p",{directives:[{name:"show",rawName:"v-show",value:e.displayCharacterLimitWarning,expression:"displayCharacterLimitWarning"}],staticClass:"d-recipe-message-input__remaining-char",attrs:{"data-qa":"dt-recipe-message-input-character-limit"}},[e._v(" "+e._s(e.showCharacterLimit.count-e.inputLength)+" ")])]},proxy:!0}],null,!1,1021505058)}):e._e(),e.showCancel?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:e.cancelButtonLabel,expression:"cancelButtonLabel"}],staticClass:"d-recipe-message-input__button d-recipe-message-input__cancel-button",attrs:{"data-qa":"dt-recipe-message-input-cancel-button",size:"sm",kind:"muted",importance:"clear","aria-label":e.cancelButtonLabel},on:{click:e.onCancel}},[i("p",[e._v(e._s(e.cancelButtonLabel))])]):e._e(),e._t("sendButton",function(){return[e.showSend?i("dt-button",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip:top-end",value:e.sendButtonLabel,expression:"sendButtonLabel",arg:"top-end"}],class:["d-recipe-message-input__button d-recipe-message-input__send-button",{"d-recipe-message-input__send-button--disabled":e.isSendDisabled,"d-btn--icon-only":e.showSendIcon}],attrs:{"data-qa":"dt-recipe-message-input-send-btn",size:"sm",kind:"default",importance:"primary","aria-label":e.sendButtonLabel,"aria-disabled":e.isSendDisabled},on:{click:e.onSend},scopedSlots:e._u([e.showSendIcon?{key:"icon",fn:function(){return[e._t("sendIcon",function(){return[i("dt-icon-send",{attrs:{size:e.sendIconSize}})]},{iconSize:e.sendIconSize})]},proxy:!0}:null],null,!0)},[e.showSend.text?[i("p",[e._v(e._s(e.showSend.text))])]:e._e()],2):e._e()]})],2)],1)])],2)},P=[],w=d.n(C,E,P);const D=w.exports;exports.default=D;
|
|
2
2
|
//# sourceMappingURL=message-input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-input.cjs","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n importance=\"clear\"\n size=\"xs\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n close (e) {\n // Get the callback from extension storage\n const onCloseCallback = this.editor?.storage?.meetingPill?.onClose;\n\n if (onCloseCallback && typeof onCloseCallback === 'function') {\n onCloseCallback(e);\n }\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n name: 'meetingPill',\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addOptions () {\n return {\n onClose: () => {},\n };\n },\n\n addStorage () {\n return {\n onClose: this.options.onClose,\n };\n },\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :paste-rich-text=\"richText\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @selected-command=\"$emit('selected-command', $event)\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"imagePickerButtonLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"imagePickerButtonLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiPickerButtonLabel\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiPickerButtonLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n v-dt-tooltip=\"cancelButtonLabel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"cancelButtonLabel\"\n @click=\"onCancel\"\n >\n <p>{{ cancelButtonLabel }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"sendButtonLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"sendButtonLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue2';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\nimport { DialtoneLocalization } from '@/localization';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Send button defaults.\n * TODO (Dialtone 10):\n * - Change to `showSendButton`, boolean only.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * TODO (Dialtone 10):\n * - Add a prop `iconOnly` default: true to control if localized send button text should be shown\n */\n\n /**\n * Cancel button defaults.\n * TODO (Dialtone 10): Change to `showCancelButton`, boolean only.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [\n MeetingPill.configure({\n onClose: (event) => {\n this.$emit('meeting-pill-close', event);\n },\n }),\n ],\n\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n\n sendButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL');\n },\n\n imagePickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL');\n },\n\n emojiPickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL');\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL');\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n // eslint-disable-next-line complexity\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","Node","VueNodeViewRenderer","MeetingPill","node","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","event","newValue","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":"m2BA2CAA,EAAA,CACA,KAAA,cAEA,WAAA,CACA,gBAAAC,EAAA,gBACA,aAAAC,EAAA,QACA,YAAAC,EAAA,YACA,SAAAC,EAAA,QACA,YAAAC,EAAA,WACA,EAEA,MAAAC,EAAA,cAEA,MAAA,CAAA,oBAAA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,kBAAA,CACA,OAAA,KAAA,KAAA,GAAA,uBAAA,CACA,CACA,EAEA,QAAA,CACA,MAAAC,EAAA,WAEA,MAAAC,GAAAC,GAAAC,GAAAC,EAAA,KAAA,SAAA,YAAAA,EAAA,UAAA,YAAAD,EAAA,cAAA,YAAAD,EAAA,QAEAD,GAAA,OAAAA,GAAA,YACAA,EAAAD,CAAA,CAEA,CACA,CACA,60BC5EeK,EAAAA,EAAAA,KAAK,OAAO,CACzB,KAAM,cAEN,KAAM,GACN,MAAO,SACP,OAAQ,GAER,YAAc,CACZ,MAAO,CACL,QAAS,IAAM,CAAE,CACvB,CACG,EAED,YAAc,CACZ,MAAO,CACL,QAAS,KAAK,QAAQ,OAC5B,CACG,EAED,aAAe,CACb,OAAOC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AAA,CAAA,CACA,EAEA,YAAAA,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,aAAAA,CAAA,CACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"message-input.cjs","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n importance=\"clear\"\n size=\"xs\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n close (e) {\n // Get the callback from extension storage\n const onCloseCallback = this.editor?.storage?.meetingPill?.onClose;\n\n if (onCloseCallback && typeof onCloseCallback === 'function') {\n onCloseCallback(e);\n }\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n name: 'meetingPill',\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addOptions () {\n return {\n onClose: () => {},\n };\n },\n\n addStorage () {\n return {\n onClose: this.options.onClose,\n };\n },\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :paste-rich-text=\"richText\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @selected-command=\"$emit('selected-command', $event)\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"imagePickerButtonLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"imagePickerButtonLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiPickerButtonLabel\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiPickerButtonLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n v-dt-tooltip=\"cancelButtonLabel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"cancelButtonLabel\"\n @click=\"onCancel\"\n >\n <p>{{ cancelButtonLabel }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"sendButtonLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"sendButtonLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue2';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\nimport { DialtoneLocalization } from '@/localization';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Send button defaults.\n * TODO (Dialtone 10):\n * - Change to `showSendButton`, boolean only.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * TODO (Dialtone 10):\n * - Add a prop `iconOnly` default: true to control if localized send button text should be shown\n */\n\n /**\n * Cancel button defaults.\n * TODO (Dialtone 10): Change to `showCancelButton`, boolean only.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [\n MeetingPill.configure({\n onClose: (event) => {\n this.$emit('meeting-pill-close', event);\n },\n }),\n ],\n\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n\n sendButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL');\n },\n\n imagePickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL');\n },\n\n emojiPickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL');\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL');\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n // eslint-disable-next-line complexity\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n image: emoji.image,\n name: emoji.name,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","DialtoneLocalization","e","onCloseCallback","_c","_b","_a","Node","VueNodeViewRenderer","MeetingPill","node","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","event","newValue","value","type","editor","typeToCommandMap","_d","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close"],"mappings":"m2BA2CAA,EAAA,CACA,KAA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A,CACAA,EAAA,gBAAA,EACAA,EAAA,eAAA,EACA,MAAAwC,EAAA,CAAA,GAAAxC,EAAA,cAAA,KAAA,EACA,KAAA,MAAA,cAAAwC,CAAA,CACA,CACA,EAEA,WAAAC,EAAA,CACA,KAAA,MAAA,YAAAA,CAAA,CACA,EAEA,cAAAC,EAAAC,EAAA,CACAD,IAIAA,EAAA,WACAC,IAIA,KAAA,MAAA,eAAA,OAAA,SAAA,cAAA,CACA,KAAA,QACA,MAAA,CACA,KAAAD,EAAA,UACA,MAAAA,EAAA,MACA,KAAAA,EAAA,IACA,CACA,CAAA,EACA,KAAA,MAAA,iBAAAA,CAAA,EACA,EAEA,eAAA,CACA,KAAA,MAAA,wBAAA,MAAA,MAAA,MAAA,CACA,EAEA,eAAA,CACA,KAAA,MAAA,eAAA,KAAA,MAAA,wBAAA,MAAA,MAAA,KAAA,CACA,EAEA,mBAAA,CACA,KAAA,kBAAA,CAAA,KAAA,iBACA,EAEA,QAAA,CACA,KAAA,gBAGA,KAAA,MAAA,SAAA,KAAA,kBAAA,CACA,EAEA,UAAA,CACA,KAAA,MAAA,QAAA,CACA,EAEA,QAAAd,EAAA,CACA,KAAA,MAAA,eAAAA,CAAA,CACA,EAEA,YAAAA,EAAA,CACA,KAAA,KAAAA,EACA,KAAA,MAAA,aAAAA,CAAA,CACA,CACA,CACA"}
|
|
@@ -645,7 +645,9 @@ const M = A.exports, N = c.create({
|
|
|
645
645
|
t && (t.shift_key || e(), this.$refs.richTextEditor.editor.commands.insertContent({
|
|
646
646
|
type: "emoji",
|
|
647
647
|
attrs: {
|
|
648
|
-
code: t.shortname
|
|
648
|
+
code: t.shortname,
|
|
649
|
+
image: t.image,
|
|
650
|
+
name: t.name
|
|
649
651
|
}
|
|
650
652
|
}), this.$emit("selected-emoji", t));
|
|
651
653
|
},
|