@dialpad/dialtone 9.8.0 → 9.10.1

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.
Files changed (79) hide show
  1. package/dist/css/dialtone.css +2 -2
  2. package/dist/icons/icons.json +1 -1
  3. package/dist/icons/keywords.json +1 -1
  4. package/dist/icons/svg/bullet.svg +1 -0
  5. package/dist/icons/svg/{0365-calendar.svg → o365-calendar.svg} +1 -1
  6. package/dist/tokens/android/java/tokens-dark.kt +1 -1
  7. package/dist/tokens/android/java/tokens-light.kt +1 -1
  8. package/dist/tokens/android/res/values/colors-dark.xml +1 -1
  9. package/dist/tokens/android/res/values/colors-light.xml +1 -1
  10. package/dist/tokens/android/res/values/dimens.xml +1 -1
  11. package/dist/tokens/css/variables-dark.css +1 -1
  12. package/dist/tokens/css/variables-light.css +1 -1
  13. package/dist/tokens/ios/tokens-dark.swift +1 -1
  14. package/dist/tokens/ios/tokens-light.swift +1 -1
  15. package/dist/tokens/less/variables-dark.less +1 -1
  16. package/dist/tokens/less/variables-light.less +1 -1
  17. package/dist/vue2/dialtone-vue.cjs +5 -5
  18. package/dist/vue2/dialtone-vue.js +1742 -1298
  19. package/dist/vue2/emoji.cjs +1 -1
  20. package/dist/vue2/emoji.js +3 -3
  21. package/dist/vue2/emoji_picker-3cVhhlbr.js +782 -0
  22. package/dist/vue2/emoji_picker-50hU6Bus.cjs +1 -0
  23. package/dist/vue2/{emoji_text_wrapper-KB-Ko_in.js → emoji_text_wrapper-45075bUQ.js} +1 -1
  24. package/dist/vue2/{emoji_text_wrapper-APKs6ucq.cjs → emoji_text_wrapper-dc6a_C0K.cjs} +1 -1
  25. package/dist/vue2/index-8ytmeBCH.cjs +1 -0
  26. package/dist/vue2/index-NG2T0qK1.js +139501 -0
  27. package/dist/vue2/message_input.cjs +1 -92
  28. package/dist/vue2/message_input.js +86 -13208
  29. package/dist/vue2/rich_text_editor-E7mcsC-J.cjs +97 -0
  30. package/dist/vue2/rich_text_editor-sxTdV897.js +16483 -0
  31. package/dist/vue2/style.css +1 -1
  32. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +16 -1
  33. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  34. package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts +2 -0
  35. package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
  36. package/dist/vue2/types/index.d.ts +1 -0
  37. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +518 -0
  38. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -0
  39. package/dist/vue2/types/recipes/conversation_view/editor/editor_constants.d.ts +8 -0
  40. package/dist/vue2/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -0
  41. package/dist/vue2/types/recipes/conversation_view/editor/index.d.ts +2 -0
  42. package/dist/vue2/types/recipes/conversation_view/editor/index.d.ts.map +1 -0
  43. package/dist/vue3/dialtone-vue.cjs +5 -5
  44. package/dist/vue3/dialtone-vue.js +2857 -2264
  45. package/dist/vue3/emoji-3sZLmJtM.cjs +1 -0
  46. package/dist/vue3/{emoji-yICdaFwX.js → emoji-RvO57rkW.js} +5601 -5579
  47. package/dist/vue3/emoji.cjs +1 -1
  48. package/dist/vue3/emoji.js +3 -3
  49. package/dist/vue3/{emoji_picker-aN3p56tE.cjs → emoji_picker-EYanEJrn.cjs} +1 -1
  50. package/dist/vue3/{emoji_picker-M2cPySPi.js → emoji_picker-ZDMH1VIY.js} +1 -1
  51. package/dist/vue3/{emoji_text_wrapper-S5n_b0Ll.cjs → emoji_text_wrapper-p2pyEE4j.cjs} +1 -1
  52. package/dist/vue3/{emoji_text_wrapper-1Grq_Nfn.js → emoji_text_wrapper-zvhbHADN.js} +1 -1
  53. package/dist/vue3/message_input.cjs +1 -92
  54. package/dist/vue3/message_input.js +156 -13406
  55. package/dist/vue3/rich_text_editor-VFx2M8I2.cjs +97 -0
  56. package/dist/vue3/rich_text_editor-o1bRsprW.js +16664 -0
  57. package/dist/vue3/style.css +1 -1
  58. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +16 -1
  59. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  60. package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts +2 -0
  61. package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
  62. package/dist/vue3/types/index.d.ts +1 -0
  63. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +522 -0
  64. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -0
  65. package/dist/vue3/types/recipes/conversation_view/editor/editor_constants.d.ts +8 -0
  66. package/dist/vue3/types/recipes/conversation_view/editor/editor_constants.d.ts.map +1 -0
  67. package/dist/vue3/types/recipes/conversation_view/editor/index.d.ts +2 -0
  68. package/dist/vue3/types/recipes/conversation_view/editor/index.d.ts.map +1 -0
  69. package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
  70. package/package.json +34 -4
  71. package/dist/vue2/emoji-2nPGIAeb.js +0 -56666
  72. package/dist/vue2/emoji-8DJWVPgD.cjs +0 -1
  73. package/dist/vue2/emoji_picker-KXqP7T9b.cjs +0 -1
  74. package/dist/vue2/emoji_picker-WxqkveyL.js +0 -83604
  75. package/dist/vue2/stack-XgHklgWB.cjs +0 -2
  76. package/dist/vue2/stack-buVgg-xL.js +0 -1852
  77. package/dist/vue3/emoji-KiKurHwi.cjs +0 -1
  78. package/dist/vue3/stack-bGMrxsbK.js +0 -1905
  79. package/dist/vue3/stack-fV5ujJ1F.cjs +0 -2
@@ -0,0 +1,782 @@
1
+ import { y as b, z as k, w as p, x as _, A as j } from "./index-NG2T0qK1.js";
2
+ import { n as m, D as g } from "./tooltip-UOWkfPpb.js";
3
+ import "vue";
4
+ const y = {
5
+ name: "EmojiTabset",
6
+ components: {
7
+ DtTabGroup: b,
8
+ DtTab: k,
9
+ DtIcon: p
10
+ },
11
+ props: {
12
+ showRecentlyUsedTab: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ scrollIntoTab: {
17
+ type: Number,
18
+ required: !0
19
+ },
20
+ isScrolling: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ emojiFilter: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ tabSetLabels: {
29
+ type: Array,
30
+ required: !0
31
+ }
32
+ },
33
+ data() {
34
+ return {
35
+ selectedTab: "1",
36
+ tabsetRef: [],
37
+ TABS_DATA: [
38
+ { label: u.MOST_RECENTLY_USED, icon: "clock" },
39
+ { label: u.SMILEYS_AND_PEOPLE, icon: "satisfied" },
40
+ { label: u.NATURE, icon: "living-thing" },
41
+ { label: u.FOOD, icon: "food" },
42
+ { label: u.ACTIVITY, icon: "object" },
43
+ { label: u.TRAVEL, icon: "transportation" },
44
+ { label: u.OBJECTS, icon: "lightbulb" },
45
+ { label: u.SYMBOLS, icon: "heart" },
46
+ { label: u.FLAGS, icon: "flag" }
47
+ ]
48
+ };
49
+ },
50
+ computed: {
51
+ tabs() {
52
+ return (this.showRecentlyUsedTab ? this.TABS_DATA : this.TABS_DATA.slice(1)).map((e, i) => ({
53
+ ...e,
54
+ label: this.tabSetLabels[i],
55
+ id: (i + 1).toString(),
56
+ panelId: (i + 1).toString()
57
+ }));
58
+ },
59
+ isSearching() {
60
+ return this.emojiFilter.length > 0;
61
+ }
62
+ },
63
+ watch: {
64
+ scrollIntoTab: function(t) {
65
+ !this.isScrolling && !this.isSearching && (this.selectedTab = (t + 1).toString());
66
+ },
67
+ isSearching: function(t) {
68
+ t && (this.selectedTab = null);
69
+ }
70
+ },
71
+ mounted() {
72
+ this.$nextTick(() => {
73
+ this.setTabsetRef();
74
+ });
75
+ },
76
+ methods: {
77
+ selectTabset(t) {
78
+ this.isScrolling || (this.selectedTab = t), this.$emit("selected-tabset", t);
79
+ },
80
+ setTabsetRef() {
81
+ this.tabs.forEach((t, e) => {
82
+ const i = `tabsetRef-${e}`;
83
+ this.$refs[i] && this.$set(this.tabsetRef, e, this.$refs[i][0].$el);
84
+ });
85
+ },
86
+ focusTabset() {
87
+ this.tabsetRef[0] && this.tabsetRef[0].focus();
88
+ },
89
+ handleKeyDown(t, e) {
90
+ t.key === "Enter" && (this.selectTabset(e), this.tabsetRef[e - 1] && this.tabsetRef[e - 1].blur()), t.key === "Tab" && (t.preventDefault(), t.shiftKey ? this.$emit("focus-skin-selector") : this.$emit("focus-search-input")), t.key === "ArrowDown" && this.$emit("focus-search-input");
91
+ }
92
+ }
93
+ };
94
+ var R = function() {
95
+ var e = this, i = e._self._c;
96
+ return i("div", { staticClass: "d-emoji-picker__tabset" }, [i("dt-tab-group", { attrs: { "tab-list-class": "d-emoji-picker__tabset-list", selected: e.selectedTab }, scopedSlots: e._u([{ key: "tabs", fn: function() {
97
+ return e._l(e.tabs, function(s, r) {
98
+ return i("dt-tab", { key: s.id, ref: `tabsetRef-${r}`, refInFor: !0, attrs: { id: s.id, "panel-id": s.panelId, label: s.label, "aria-controls": "d-emoji-picker-list", tabindex: r + 1 }, on: { "!click": function(o) {
99
+ return o.stopPropagation(), e.selectTabset(s.id);
100
+ }, keydown: function(o) {
101
+ return e.handleKeyDown(o, s.id);
102
+ } } }, [i("dt-icon", { attrs: { size: "400", name: s.icon } })], 1);
103
+ });
104
+ }, proxy: !0 }]) })], 1);
105
+ }, S = [], E = /* @__PURE__ */ m(
106
+ y,
107
+ R,
108
+ S,
109
+ !1,
110
+ null,
111
+ null,
112
+ null,
113
+ null
114
+ );
115
+ const $ = E.exports, T = {
116
+ name: "EmojiSearch",
117
+ components: {
118
+ DtInput: _,
119
+ DtIcon: p
120
+ },
121
+ props: {
122
+ searchPlaceholderLabel: {
123
+ type: String,
124
+ required: !0
125
+ },
126
+ modelValue: {
127
+ type: String,
128
+ default: ""
129
+ }
130
+ },
131
+ mounted() {
132
+ this.focusSearchInput();
133
+ },
134
+ methods: {
135
+ updateModelValue(t) {
136
+ this.$emit("update:model-value", t);
137
+ },
138
+ focusEmojiSelector() {
139
+ this.$emit("focus-emoji-selector");
140
+ },
141
+ focusTabset() {
142
+ this.$emit("focus-tabset");
143
+ },
144
+ selectFirstEmoji() {
145
+ this.$emit("select-first-emoji");
146
+ },
147
+ clearSearch() {
148
+ this.$emit("update:model-value", ""), this.focusSearchInput();
149
+ },
150
+ focusSearchInput() {
151
+ this.$refs.searchInputRef.focus();
152
+ }
153
+ }
154
+ };
155
+ var v = function() {
156
+ var e = this, i = e._self._c;
157
+ return i("div", { staticClass: "d-emoji-picker__search d-emoji-picker__alignment" }, [i("dt-input", { ref: "searchInputRef", attrs: { id: "searchInput", placeholder: e.searchPlaceholderLabel, value: e.modelValue }, on: { input: e.updateModelValue, keydown: [function(s) {
158
+ return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : e.focusTabset.apply(null, arguments);
159
+ }, function(s) {
160
+ return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.focusEmojiSelector.apply(null, arguments));
161
+ }, function(s) {
162
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.selectFirstEmoji.apply(null, arguments);
163
+ }] }, scopedSlots: e._u([{ key: "leftIcon", fn: function() {
164
+ return [i("dt-icon", { attrs: { name: "search" } })];
165
+ }, proxy: !0 }, e.modelValue.length > 0 ? { key: "rightIcon", fn: function() {
166
+ return [i("button", { staticClass: "d-emoji-picker__search-button", on: { click: e.clearSearch, keydown: function(s) {
167
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.clearSearch.apply(null, arguments);
168
+ } } }, [i("dt-icon", { attrs: { name: "close" } })], 1)];
169
+ }, proxy: !0 } : null], null, !0) })], 1);
170
+ }, L = [], w = /* @__PURE__ */ m(
171
+ T,
172
+ v,
173
+ L,
174
+ !1,
175
+ null,
176
+ null,
177
+ null,
178
+ null
179
+ );
180
+ const A = w.exports, D = {
181
+ name: "EmojiSelector",
182
+ props: {
183
+ emojiFilter: {
184
+ type: String,
185
+ default: ""
186
+ },
187
+ skinTone: {
188
+ type: String,
189
+ required: !0
190
+ },
191
+ tabSetLabels: {
192
+ type: Array,
193
+ required: !0
194
+ },
195
+ selectedTabset: {
196
+ type: Object,
197
+ required: !0
198
+ },
199
+ searchResultsLabel: {
200
+ type: String,
201
+ required: !0
202
+ },
203
+ searchNoResultsLabel: {
204
+ type: String,
205
+ required: !0
206
+ },
207
+ recentlyUsedEmojis: {
208
+ type: Array,
209
+ default: () => []
210
+ }
211
+ },
212
+ data() {
213
+ return {
214
+ emojiRefs: [],
215
+ emojiFilteredRefs: [],
216
+ isFiltering: !1,
217
+ hoverFirstEmoji: !0,
218
+ fixedLabel: "",
219
+ filteredEmojis: [],
220
+ TABS_DATA: ["Recently used", "People", "Nature", "Food", "Activity", "Travel", "Objects", "Symbols", "Flags"],
221
+ tabLabelObserver: null
222
+ };
223
+ },
224
+ computed: {
225
+ currentEmojis() {
226
+ return [
227
+ ...this.emojis[`People${this.skinTone}`] || [],
228
+ ...this.emojis.Nature || [],
229
+ ...this.emojis.Food || [],
230
+ ...this.emojis[`Activity${this.skinTone}`] || [],
231
+ ...this.emojis.Travel || [],
232
+ ...this.emojis[`Objects${this.skinTone}`] || [],
233
+ ...this.emojis.Symbols || [],
234
+ ...this.emojis.Flags || []
235
+ ];
236
+ },
237
+ emojis() {
238
+ return j;
239
+ },
240
+ CDN_URL() {
241
+ return d;
242
+ },
243
+ tabLabels() {
244
+ return this.recentlyUsedEmojis.length ? this.tabSetLabels.map((t, e) => ({ label: t, ref: this.$refs[`tabLabelRef-${e}`] })) : this.tabSetLabels.slice(1).map((t, e) => ({ label: t, ref: this.$refs[`tabLabelRef-${e}`] }));
245
+ },
246
+ tabs() {
247
+ return this.recentlyUsedEmojis.length ? this.TABS_DATA : this.TABS_DATA.slice(1);
248
+ }
249
+ },
250
+ watch: {
251
+ currentEmojis: {
252
+ handler() {
253
+ this.searchByNameAndKeywords();
254
+ },
255
+ immediate: !0
256
+ },
257
+ recentlyUsedEmojis: {
258
+ handler(t) {
259
+ this.emojis["Recently used"] = t;
260
+ },
261
+ immediate: !0
262
+ },
263
+ emojiFilter: {
264
+ handler(t) {
265
+ this.resetScroll(), t ? this.isFiltering = !0 : (this.isFiltering = !1, this.$emit("highlighted-emoji", null)), this.debouncedSearch();
266
+ }
267
+ },
268
+ selectedTabset: {
269
+ handler(t) {
270
+ this.scrollToTab(t.tabId);
271
+ },
272
+ deep: !0
273
+ }
274
+ },
275
+ created() {
276
+ this.debouncedSearch = this.debounce(this.searchByNameAndKeywords, 300);
277
+ },
278
+ mounted() {
279
+ this.$nextTick(() => {
280
+ this.setupEmojiRefs(), this.setupFilteredRefs(), this.setupTabLabelRefs(), this.setTabLabelObserver();
281
+ });
282
+ },
283
+ beforeDestroy() {
284
+ this.tabLabelObserver && this.tabLabelObserver.disconnect();
285
+ },
286
+ methods: {
287
+ setupTabLabelRefs() {
288
+ var t;
289
+ (t = this.tabSetLabels) == null || t.forEach((e, i) => {
290
+ const s = `tabLabelRef-${i}`;
291
+ this.$refs[s] && this.$set(this.tabLabels, i, { label: e, ref: this.$refs[s] });
292
+ });
293
+ },
294
+ setupFilteredRefs() {
295
+ this.emojiFilteredRefs = [], this.filteredEmojis.forEach((t, e) => {
296
+ const i = `filteredEmoji-${e}`;
297
+ this.$refs[i] && this.setFilteredRef(this.$refs[i], e);
298
+ });
299
+ },
300
+ setupEmojiRefs() {
301
+ for (let t = 0; t < this.tabs.length; t++) {
302
+ const e = `emojiRef-${t}`;
303
+ this.$refs[e] && this.$refs[e].forEach((i, s) => {
304
+ i && this.setEmojiRef(i, t, s);
305
+ });
306
+ }
307
+ },
308
+ searchByNameAndKeywords() {
309
+ const t = this.emojiFilter.toLowerCase();
310
+ this.filteredEmojis = this.currentEmojis.filter(function(e) {
311
+ const i = e.name.toLowerCase().includes(t), s = e.keywords.some(function(r) {
312
+ return r.toLowerCase().includes(t);
313
+ });
314
+ return i || s;
315
+ }), this.$nextTick(function() {
316
+ t && (this.hoverEmoji(this.filteredEmojis[0], !0), this.setupFilteredRefs());
317
+ });
318
+ },
319
+ debounce: function(t, e) {
320
+ e === void 0 && (e = 300);
321
+ let i;
322
+ return function() {
323
+ const s = [];
324
+ let r = arguments.length;
325
+ for (; r--; )
326
+ s[r] = arguments[r];
327
+ clearTimeout(i), i = setTimeout(function() {
328
+ t.apply(void 0, s);
329
+ }, e);
330
+ };
331
+ },
332
+ getImgSrc: function(t) {
333
+ return this.CDN_URL + t + ".png";
334
+ },
335
+ handleImageError: function(t) {
336
+ t.target.parentNode.style.display = "none";
337
+ },
338
+ scrollToTab: function(t, e) {
339
+ const i = this;
340
+ e === void 0 && (e = !0);
341
+ const r = i.tabLabels[t - 1].ref[0];
342
+ i.$nextTick(function() {
343
+ const o = i.$refs.listRef, n = t === "1" ? 0 : r.offsetTop - 20;
344
+ let l = !0, c = o.scrollTop;
345
+ i.$emit("is-scrolling", !0), o.addEventListener("scroll", function() {
346
+ if (l) {
347
+ const f = o.scrollTop;
348
+ (c < f && f >= n || c > f && f <= n) && (l = !1, i.$emit("is-scrolling", !1)), c = f;
349
+ }
350
+ }), o.scrollTop = n, e && i.focusEmoji(t - 1, 0);
351
+ });
352
+ },
353
+ resetScroll: function() {
354
+ const t = this.$refs.listRef;
355
+ t.scrollTop = 0;
356
+ },
357
+ focusEmojiSelector: function() {
358
+ this.focusEmoji(0, 0);
359
+ },
360
+ hoverEmoji(t, e) {
361
+ e === void 0 && (e = !1), this.hoverFirstEmoji = e, this.$emit("highlighted-emoji", t);
362
+ },
363
+ setEmojiRef: function(t, e, i) {
364
+ this.emojiRefs[e] || this.$set(this.emojiRefs, e, []), this.$set(this.emojiRefs[e], i, t);
365
+ },
366
+ setFilteredRef: function(t, e) {
367
+ this.$set(this.emojiFilteredRefs, e, t);
368
+ },
369
+ focusEmoji: function(t, e) {
370
+ var s;
371
+ const i = this.isFiltering ? (s = this.emojiFilteredRefs[e]) == null ? void 0 : s[0] : this.emojiRefs[t] && this.emojiRefs[t][e];
372
+ return i ? (i.focus(), !0) : !1;
373
+ },
374
+ handleKeyDown: function(t, e, i, s) {
375
+ var r, o;
376
+ if (t.preventDefault(), t.key === "ArrowUp") {
377
+ const n = i % a;
378
+ if (e === 0) {
379
+ const l = a - this.emojiRefs[this.emojiRefs.length - 1].length % a, c = this.emojiRefs[this.emojiRefs.length - 1].length + l - (a - n);
380
+ this.focusEmoji(this.emojiRefs.length - 1, c) || this.focusEmoji(this.emojiRefs.length - 1, this.emojiRefs[this.emojiRefs.length - 1].length - 1);
381
+ return;
382
+ }
383
+ if (!this.focusEmoji(e, i - a)) {
384
+ const l = e - 1 < 0 ? 0 : e - 1, c = this.emojiRefs[l].length, f = c - c % a + n;
385
+ this.focusEmoji(l, f) || this.focusEmoji(e - 1, this.emojiRefs[e - 1].length - 1);
386
+ }
387
+ }
388
+ if (t.key === "ArrowDown" && !this.focusEmoji(e, i + a)) {
389
+ const n = i % a;
390
+ (o = (r = this.emojiRefs) == null ? void 0 : r[e]) != null && o[i + (a - n)] ? this.focusEmoji(e, this.emojiRefs[e].length - 1) : this.focusEmoji(e + 1, n) || this.focusEmoji(0, n) || this.focusEmoji(0, this.emojiRefs[0].length - 1);
391
+ }
392
+ t.key === "ArrowLeft" && this.handleHorizontalNavigation("left", e, i), t.key === "ArrowRight" && this.handleHorizontalNavigation("right", e, i), t.key === "Tab" && (this.focusEmoji(e + 1, 0) ? this.scrollToTab(e + 1 + 1, !1) : this.$emit("focus-skin-selector")), t.key === "Tab" && t.shiftKey && (this.focusEmoji(e, 0) && e > 0 ? this.scrollToTab(e, !0) : (this.scrollToTab(1, !1), this.$emit("focus-search-input"))), t.key === "Enter" && this.$emit("selected-emoji", s);
393
+ },
394
+ handleHorizontalNavigation: function(t, e, i) {
395
+ this.isFiltering ? t === "left" ? this.handleArrowLeftFiltered(e, i) : t === "right" && this.handleArrowRightFiltered(e, i) : t === "left" ? this.handleArrowLeft(e, i) : t === "right" && this.handleArrowRight(e, i);
396
+ },
397
+ handleArrowLeftFiltered: function(t, e) {
398
+ this.focusEmoji(0, e - 1) || this.focusEmoji(0, this.emojiFilteredRefs.length - 1);
399
+ },
400
+ handleArrowRightFiltered: function(t, e) {
401
+ this.focusEmoji(0, e + 1) || this.focusEmoji(0, 0);
402
+ },
403
+ handleArrowLeft: function(t, e) {
404
+ this.focusEmoji(t, e - 1) || (this.emojiRefs[t - 1] ? this.focusEmoji(t - 1, this.emojiRefs[t - 1].length - 1) : this.focusEmoji(this.emojiRefs.length - 1, this.emojiRefs[this.emojiRefs.length - 1].length - 1));
405
+ },
406
+ handleArrowRight: function(t, e) {
407
+ this.focusEmoji(t, e + 1) || this.focusEmoji(t + 1, 0) || this.focusEmoji(0, 0);
408
+ },
409
+ handleKeyDownFilteredEmojis(t, e, i) {
410
+ var s;
411
+ if (t.preventDefault(), this.hoverFirstEmoji = !1, t.key === "ArrowUp") {
412
+ const r = e % a;
413
+ if (!this.focusEmoji(0, e - a)) {
414
+ const o = this.emojiFilteredRefs.length - this.emojiFilteredRefs.length % a + r;
415
+ this.focusEmoji(0, o), this.focusEmoji(0, o) || this.focusEmoji(0, this.emojiFilteredRefs.length - 1);
416
+ }
417
+ }
418
+ if (t.key === "ArrowDown" && !this.focusEmoji(0, e + a)) {
419
+ const r = e % a;
420
+ (s = this.emojiFilteredRefs) != null && s[e + (a - r)] ? this.focusEmoji(0, this.emojiFilteredRefs.length - 1) : this.focusEmoji(0, r);
421
+ }
422
+ t.key === "ArrowLeft" && this.handleHorizontalNavigation("left", 0, e), t.key === "ArrowRight" && this.handleHorizontalNavigation("right", 0, e), t.key === "Tab" && this.$emit("focus-skin-selector"), t.key === "Enter" && this.$emit("selected-emoji", i);
423
+ },
424
+ setTabLabelObserver() {
425
+ this.tabLabelObserver = new IntersectionObserver((t) => {
426
+ t.forEach((e) => {
427
+ var r, o, n, l, c, f;
428
+ const { target: i } = e, s = parseInt(i.dataset.index);
429
+ e.isIntersecting && i.offsetTop <= ((r = this.$refs.tabCategoryRef) == null ? void 0 : r.offsetTop) + 50 ? (this.fixedLabel = ((o = this.tabLabels[s - 1]) == null ? void 0 : o.label) ?? ((n = this.tabLabels[0]) == null ? void 0 : n.label), this.$emit("scroll-into-tab", s - 1)) : e.boundingClientRect.bottom <= ((l = this.$refs.tabCategoryRef) == null ? void 0 : l.getBoundingClientRect().bottom) ? (this.$emit("scroll-into-tab", s), this.fixedLabel = (c = this.tabLabels[s]) == null ? void 0 : c.label) : s === 1 && (this.$emit("scroll-into-tab", s), this.fixedLabel = (f = this.tabLabels[0]) == null ? void 0 : f.label);
430
+ });
431
+ }), this.tabLabelObserver.observe(this.$refs.tabCategoryRef), Array.from(this.$refs.listRef.children).forEach((t, e) => {
432
+ this.tabLabelObserver.observe(t), t.dataset.index = e;
433
+ });
434
+ },
435
+ focusLastEmoji() {
436
+ this.focusEmoji(this.tabs.length - 1, 0);
437
+ }
438
+ }
439
+ };
440
+ var I = function() {
441
+ var e = this, i = e._self._c;
442
+ return i("div", { staticClass: "d-emoji-picker__selector" }, [i("div", { ref: "listRef", staticClass: "d-emoji-picker__list", attrs: { id: "d-emoji-picker-list" } }, [e.emojiFilter ? i("p", { staticClass: "d-emoji-picker__search-label d-emoji-picker__alignment" }, [e._v(" " + e._s(e.filteredEmojis.length > 0 ? e.searchResultsLabel : e.searchNoResultsLabel) + " ")]) : i("div", { ref: "tabCategoryRef", staticClass: "d-emoji-picker__category d-emoji-picker__alignment" }, [i("p", [e._v(" " + e._s(e.fixedLabel) + " ")])]), e._l(e.tabLabels, function(s, r) {
443
+ return i("div", { directives: [{ name: "show", rawName: "v-show", value: !e.emojiFilter, expression: "!emojiFilter" }], key: r, ref: `tabLabelRef-${r}`, refInFor: !0, staticClass: "d-emoji-picker__alignment" }, [r ? i("p", [e._v(" " + e._s(s.label) + " ")]) : e._e(), i("div", { staticClass: "d-emoji-picker__tab" }, e._l(e.emojis[e.tabs[r] + e.skinTone] ? e.emojis[e.tabs[r] + e.skinTone] : e.emojis[e.tabs[r]], function(o, n) {
444
+ return i("button", { key: o.shortname, ref: `emojiRef-${r}`, refInFor: !0, attrs: { type: "button", "aria-label": o.name }, on: { click: function(l) {
445
+ return e.$emit("selected-emoji", o);
446
+ }, focusin: function(l) {
447
+ return e.$emit("highlighted-emoji", o);
448
+ }, focusout: function(l) {
449
+ return e.$emit("highlighted-emoji", null);
450
+ }, mouseover: function(l) {
451
+ return e.$emit("highlighted-emoji", o);
452
+ }, mouseleave: function(l) {
453
+ return e.$emit("highlighted-emoji", null);
454
+ }, keydown: (l) => e.handleKeyDown(l, r, n, o) } }, [i("img", { staticClass: "d-icon d-icon--size-500", attrs: { alt: o.name, "aria-label": o.name, title: o.name, src: e.getImgSrc(o.unicode_character) }, on: { error: e.handleImageError } })]);
455
+ }), 0)]);
456
+ }), e.emojiFilter ? i("div", { staticClass: "d-emoji-picker__alignment" }, [i("div", { staticClass: "d-emoji-picker__tab", attrs: { "data-qa": "filtered-emojis" } }, e._l(e.filteredEmojis, function(s, r) {
457
+ return i("button", { key: s.shortname, ref: `filteredEmoji-${r}`, refInFor: !0, class: {
458
+ "hover-emoji": r === 0 && e.hoverFirstEmoji
459
+ }, attrs: { type: "button", "aria-label": s.name }, on: { click: function(o) {
460
+ return e.$emit("selected-emoji", s);
461
+ }, focusin: function(o) {
462
+ return e.$emit("highlighted-emoji", s);
463
+ }, focusout: function(o) {
464
+ return e.$emit("highlighted-emoji", null);
465
+ }, mouseover: function(o) {
466
+ return e.hoverEmoji(s);
467
+ }, mouseleave: function(o) {
468
+ return e.hoverEmoji(null);
469
+ }, keydown: (o) => e.handleKeyDownFilteredEmojis(o, r, s) } }, [i("img", { staticClass: "d-icon d-icon--size-500", attrs: { alt: s.name, "aria-label": s.name, title: s.name, src: `${e.CDN_URL + s.unicode_character}.png` } })]);
470
+ }), 0)]) : e._e()], 2)]);
471
+ }, C = [], F = /* @__PURE__ */ m(
472
+ D,
473
+ I,
474
+ C,
475
+ !1,
476
+ null,
477
+ null,
478
+ null,
479
+ null
480
+ );
481
+ const O = F.exports, d = "https://static.dialpadcdn.com/joypixels/png/unicode/32/", a = 9, h = {
482
+ DEFAULT: "Default",
483
+ LIGHT: "Light",
484
+ MEDIUM_LIGHT: "MediumLight",
485
+ MEDIUM: "Medium",
486
+ MEDIUM_DARK: "MediumDark",
487
+ DARK: "Dark"
488
+ }, u = {
489
+ MOST_RECENTLY_USED: "Most recently used",
490
+ SMILEYS_AND_PEOPLE: "Smileys and people",
491
+ NATURE: "Nature",
492
+ FOOD: "Food",
493
+ ACTIVITY: "Activity",
494
+ TRAVEL: "Travel",
495
+ OBJECTS: "Objects",
496
+ SYMBOLS: "Symbols",
497
+ FLAGS: "Flags"
498
+ }, U = {
499
+ name: "EmojiDescription",
500
+ props: {
501
+ /**
502
+ * Emoji data
503
+ * @type {Object}
504
+ * @default null
505
+ */
506
+ emoji: {
507
+ type: Object,
508
+ default: () => null
509
+ }
510
+ },
511
+ data() {
512
+ return {
513
+ CDN_URL: d
514
+ };
515
+ }
516
+ };
517
+ var N = function() {
518
+ var s;
519
+ var e = this, i = e._self._c;
520
+ return i("div", { staticClass: "d-emoji-picker__data" }, [e.emoji ? i("img", { staticClass: "d-icon d-icon--size-500", attrs: { alt: e.emoji.name, "aria-label": e.emoji.name, title: e.emoji.name, src: `${e.CDN_URL + e.emoji.unicode_character}.png` } }) : e._e(), e._v(" " + e._s((s = e.emoji) == null ? void 0 : s.name) + " ")]);
521
+ }, M = [], K = /* @__PURE__ */ m(
522
+ U,
523
+ N,
524
+ M,
525
+ !1,
526
+ null,
527
+ null,
528
+ null,
529
+ null
530
+ );
531
+ const B = K.exports, P = {
532
+ name: "EmojiSkinSelector",
533
+ components: {
534
+ DtTooltip: g
535
+ },
536
+ props: {
537
+ skinTone: {
538
+ type: String,
539
+ required: !0
540
+ },
541
+ isHovering: {
542
+ type: Boolean,
543
+ default: !1
544
+ },
545
+ skinSelectorButtonTooltipLabel: {
546
+ type: String,
547
+ required: !0
548
+ }
549
+ },
550
+ data() {
551
+ return {
552
+ isOpen: !1,
553
+ skinSelected: null,
554
+ skinsRef: [],
555
+ cdnUrl: d
556
+ };
557
+ },
558
+ computed: {
559
+ skinPassedIn() {
560
+ return this.skinList.find((t) => t.skinTone === this.skinTone);
561
+ },
562
+ skinList() {
563
+ return [
564
+ {
565
+ name: ":wave_tone1:",
566
+ unicode_output: "1f44b-1f3fb",
567
+ skinTone: h.LIGHT,
568
+ skinCode: "_tone1"
569
+ },
570
+ {
571
+ name: ":wave_tone2:",
572
+ unicode_output: "1f44b-1f3fc",
573
+ skinTone: h.MEDIUM_LIGHT,
574
+ skinCode: "_tone2"
575
+ },
576
+ {
577
+ name: ":wave_tone3:",
578
+ unicode_output: "1f44b-1f3fd",
579
+ skinTone: h.MEDIUM,
580
+ skinCode: "_tone3"
581
+ },
582
+ {
583
+ name: ":wave_tone4:",
584
+ unicode_output: "1f44b-1f3fe",
585
+ skinTone: h.MEDIUM_DARK,
586
+ skinCode: "_tone4"
587
+ },
588
+ {
589
+ name: ":wave_tone5:",
590
+ unicode_output: "1f44b-1f3ff",
591
+ skinTone: h.DARK,
592
+ skinCode: "_tone5"
593
+ },
594
+ {
595
+ name: ":wave:",
596
+ unicode_output: "1f44b",
597
+ skinTone: h.DEFAULT,
598
+ skinCode: ""
599
+ }
600
+ ];
601
+ }
602
+ },
603
+ watch: {
604
+ isHovering(t) {
605
+ t && (this.isOpen = !1);
606
+ },
607
+ skinTone(t, e) {
608
+ t !== e && (this.skinSelected = this.skinPassedIn);
609
+ }
610
+ },
611
+ mounted() {
612
+ this.skinSelected = this.skinPassedIn, this.$nextTick(() => {
613
+ this.setupSkinRefs();
614
+ });
615
+ },
616
+ methods: {
617
+ setupSkinRefs() {
618
+ this.skinList.forEach((t, e) => {
619
+ const i = `skinRef-${e}`;
620
+ this.$refs[i] && this.$set(this.skinsRef, e, this.$refs[i][0]);
621
+ });
622
+ },
623
+ focusSkinSelector() {
624
+ this.$refs.skinSelectorRef && this.$refs.skinSelectorRef.focus();
625
+ },
626
+ selectSkin(t) {
627
+ this.skinSelected = t, this.isOpen = !1, this.$emit("skin-tone", t.skinTone), this.$nextTick(() => {
628
+ this.focusSkinSelector();
629
+ });
630
+ },
631
+ handleKeyDown(t, e, i) {
632
+ var s, r, o, n;
633
+ t.preventDefault(), t.key === "ArrowLeft" && (i === 0 && ((s = this.skinsRef[this.skinsRef.length - 1]) == null || s.focus()), (r = this.skinsRef[i - 1]) == null || r.focus()), t.key === "ArrowRight" && (this.skinsRef.length && ((o = this.skinsRef[0]) == null || o.focus()), (n = this.skinsRef[i + 1]) == null || n.focus()), t.key === "Enter" && (e ? this.selectSkin(e) : this.toggleSkinList()), t.key === "Tab" && (t.shiftKey ? this.$emit("focus-last-emoji") : this.$emit("focus-tabset"));
634
+ },
635
+ toggleSkinList() {
636
+ this.isOpen = !this.isOpen, this.$nextTick(() => {
637
+ this.skinsRef[0] && this.skinsRef[0].focus();
638
+ });
639
+ }
640
+ }
641
+ };
642
+ var q = function() {
643
+ var e = this, i = e._self._c;
644
+ return i("div", { attrs: { "data-qa": "skin-selector" } }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isOpen, expression: "isOpen" }], staticClass: "d-emoji-picker__skin-list" }, e._l(e.skinList, function(s, r) {
645
+ var o;
646
+ return i("button", { key: s.name, ref: `skinRef-${r}`, refInFor: !0, class: {
647
+ selected: ((o = e.skinSelected) == null ? void 0 : o.skinCode) === s.skinCode
648
+ }, on: { click: function(n) {
649
+ return e.selectSkin(s);
650
+ }, keydown: (n) => e.handleKeyDown(n, s, r) } }, [i("img", { staticClass: "d-icon d-icon--size-500", attrs: { alt: s.name, "aria-label": s.name, title: s.name, src: `${e.cdnUrl + s.unicode_output}.png` } })]);
651
+ }), 0), i("div", { directives: [{ name: "show", rawName: "v-show", value: !e.isOpen, expression: "!isOpen" }], staticClass: "d-emoji-picker__skin-selected" }, [i("dt-tooltip", { attrs: { placement: "top-end" }, scopedSlots: e._u([{ key: "anchor", fn: function() {
652
+ var s, r, o, n;
653
+ return [i("button", { ref: "skinSelectorRef", attrs: { "aria-label": e.skinSelectorButtonTooltipLabel, tabindex: "-1" }, on: { click: e.toggleSkinList, keydown: (l) => e.handleKeyDown(l) } }, [i("img", { staticClass: "d-icon d-icon--size-500", attrs: { alt: (s = e.skinSelected) == null ? void 0 : s.name, "aria-label": (r = e.skinSelected) == null ? void 0 : r.name, title: (o = e.skinSelected) == null ? void 0 : o.name, src: `${e.cdnUrl + ((n = e.skinSelected) == null ? void 0 : n.unicode_output)}.png` } })])];
654
+ }, proxy: !0 }]) }, [e._v(" " + e._s(e.skinSelectorButtonTooltipLabel) + " ")])], 1)]);
655
+ }, z = [], H = /* @__PURE__ */ m(
656
+ P,
657
+ q,
658
+ z,
659
+ !1,
660
+ null,
661
+ null,
662
+ null,
663
+ null
664
+ );
665
+ const G = H.exports, V = {
666
+ name: "DtEmojiPicker",
667
+ components: {
668
+ EmojiTabset: $,
669
+ EmojiSearch: A,
670
+ EmojiSelector: O,
671
+ EmojiDescription: B,
672
+ EmojiSkinSelector: G
673
+ },
674
+ props: {
675
+ recentlyUsedEmojis: {
676
+ type: Array
677
+ },
678
+ searchPlaceholderLabel: {
679
+ type: String,
680
+ required: !0
681
+ },
682
+ searchResultsLabel: {
683
+ type: String,
684
+ required: !0
685
+ },
686
+ searchNoResultsLabel: {
687
+ type: String,
688
+ required: !0
689
+ },
690
+ tabSetLabels: {
691
+ type: Array,
692
+ required: !0
693
+ },
694
+ skinTone: {
695
+ type: String
696
+ },
697
+ skinSelectorButtonTooltipLabel: {
698
+ type: String,
699
+ required: !0
700
+ }
701
+ },
702
+ data() {
703
+ return {
704
+ searchQuery: "",
705
+ highlightedEmoji: null,
706
+ selectedTabset: {},
707
+ scrollIntoTab: 0,
708
+ isScrolling: !1
709
+ };
710
+ },
711
+ computed: {
712
+ showRecentlyUsedTab() {
713
+ var t;
714
+ return ((t = this.recentlyUsedEmojis) == null ? void 0 : t.length) > 0;
715
+ }
716
+ },
717
+ methods: {
718
+ scrollToSelectedTabset(t) {
719
+ this.searchQuery = "", this.selectedTabset = { ...this.selectedTabset, tabId: t };
720
+ },
721
+ updateScrollIntoTab(t) {
722
+ this.scrollIntoTab = t;
723
+ },
724
+ updateIsScrolling(t) {
725
+ this.isScrolling = t;
726
+ },
727
+ updateHighlightedEmoji(t) {
728
+ this.highlightedEmoji = t;
729
+ }
730
+ }
731
+ };
732
+ var Y = function() {
733
+ var e = this, i = e._self._c;
734
+ return i("div", { staticClass: "d-emoji-picker" }, [i("div", { staticClass: "d-emoji-picker--header" }, [i("emoji-tabset", { ref: "tabsetRef", attrs: { "emoji-filter": e.searchQuery, "show-recently-used-tab": e.showRecentlyUsedTab, "scroll-into-tab": e.scrollIntoTab, "tab-set-labels": e.tabSetLabels, "is-scrolling": e.isScrolling }, on: { "focus-search-input": function(s) {
735
+ return e.$refs.searchInputRef.focusSearchInput();
736
+ }, "focus-skin-selector": function(s) {
737
+ return e.$refs.skinSelectorRef.focusSkinSelector();
738
+ }, "selected-tabset": e.scrollToSelectedTabset }, nativeOn: { keydown: function(s) {
739
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : e.$emit("close");
740
+ } } })], 1), i("div", { staticClass: "d-emoji-picker--body" }, [i("emoji-search", { ref: "searchInputRef", attrs: { "model-value": e.searchQuery, "search-placeholder-label": e.searchPlaceholderLabel }, on: { "update:model-value": (s) => e.searchQuery = s, "select-first-emoji": function(s) {
741
+ return e.$emit("selected-emoji", e.highlightedEmoji);
742
+ }, "focus-tabset": function(s) {
743
+ return e.$refs.tabsetRef.focusTabset();
744
+ }, "focus-emoji-selector": function(s) {
745
+ return e.$refs.emojiSelectorRef.focusEmojiSelector();
746
+ } }, nativeOn: { keydown: function(s) {
747
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : e.$emit("close");
748
+ } } }), i("emoji-selector", { ref: "emojiSelectorRef", attrs: { "emoji-filter": e.searchQuery, "skin-tone": e.skinTone, "tab-set-labels": e.tabSetLabels, "search-results-label": e.searchResultsLabel, "search-no-results-label": e.searchNoResultsLabel, "recently-used-emojis": e.recentlyUsedEmojis, "selected-tabset": e.selectedTabset }, on: { "scroll-into-tab": e.updateScrollIntoTab, "is-scrolling": e.updateIsScrolling, "highlighted-emoji": e.updateHighlightedEmoji, "selected-emoji": function(s) {
749
+ return e.$emit("selected-emoji", s);
750
+ }, "focus-skin-selector": function(s) {
751
+ return e.$refs.skinSelectorRef.focusSkinSelector();
752
+ }, "focus-search-input": function(s) {
753
+ return e.$refs.searchInputRef.focusSearchInput();
754
+ } }, nativeOn: { keydown: function(s) {
755
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : e.$emit("close");
756
+ } } })], 1), i("div", { staticClass: "d-emoji-picker--footer" }, [i("emoji-description", { attrs: { emoji: e.highlightedEmoji } }), i("emoji-skin-selector", { ref: "skinSelectorRef", attrs: { "is-hovering": !!e.highlightedEmoji, "skin-selector-button-tooltip-label": e.skinSelectorButtonTooltipLabel, "skin-tone": e.skinTone }, on: { "skin-tone": function(s) {
757
+ return e.$emit("skin-tone", s);
758
+ }, "focus-tabset": function(s) {
759
+ return e.$refs.tabsetRef.focusTabset();
760
+ }, "focus-last-emoji": function(s) {
761
+ return e.$refs.emojiSelectorRef.focusLastEmoji();
762
+ } }, nativeOn: { keydown: function(s) {
763
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : e.$emit("close");
764
+ } } })], 1)]);
765
+ }, J = [], Q = /* @__PURE__ */ m(
766
+ V,
767
+ Y,
768
+ J,
769
+ !1,
770
+ null,
771
+ null,
772
+ null,
773
+ null
774
+ );
775
+ const x = Q.exports;
776
+ export {
777
+ d as C,
778
+ x as D,
779
+ a as E,
780
+ h as a,
781
+ u as b
782
+ };