@dialpad/dialtone-vue 3.206.0 → 3.207.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/lib/input/input.cjs +1 -1
  3. package/dist/lib/input/input.cjs.map +1 -1
  4. package/dist/lib/input/input.js +14 -6
  5. package/dist/lib/input/input.js.map +1 -1
  6. package/dist/lib/rich-text-editor/rich-text-editor.cjs +4 -4
  7. package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  8. package/dist/lib/rich-text-editor/rich-text-editor.js +72 -40
  9. package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  10. package/dist/localization/de-DE.cjs +24 -19
  11. package/dist/localization/de-DE.cjs.map +1 -1
  12. package/dist/localization/de-DE.js +24 -19
  13. package/dist/localization/de-DE.js.map +1 -1
  14. package/dist/localization/es-LA.cjs +12 -7
  15. package/dist/localization/es-LA.cjs.map +1 -1
  16. package/dist/localization/es-LA.js +12 -7
  17. package/dist/localization/es-LA.js.map +1 -1
  18. package/dist/localization/fr-FR.cjs +11 -6
  19. package/dist/localization/fr-FR.cjs.map +1 -1
  20. package/dist/localization/fr-FR.js +11 -6
  21. package/dist/localization/fr-FR.js.map +1 -1
  22. package/dist/localization/it-IT.cjs +17 -12
  23. package/dist/localization/it-IT.cjs.map +1 -1
  24. package/dist/localization/it-IT.js +17 -12
  25. package/dist/localization/it-IT.js.map +1 -1
  26. package/dist/localization/ja-JP.cjs +5 -0
  27. package/dist/localization/ja-JP.cjs.map +1 -1
  28. package/dist/localization/ja-JP.js +5 -0
  29. package/dist/localization/ja-JP.js.map +1 -1
  30. package/dist/localization/nl-NL.cjs +10 -5
  31. package/dist/localization/nl-NL.cjs.map +1 -1
  32. package/dist/localization/nl-NL.js +10 -5
  33. package/dist/localization/nl-NL.js.map +1 -1
  34. package/dist/localization/pt-BR.cjs +21 -16
  35. package/dist/localization/pt-BR.cjs.map +1 -1
  36. package/dist/localization/pt-BR.js +21 -16
  37. package/dist/localization/pt-BR.js.map +1 -1
  38. package/dist/localization/ru-RU.cjs +27 -22
  39. package/dist/localization/ru-RU.cjs.map +1 -1
  40. package/dist/localization/ru-RU.js +27 -22
  41. package/dist/localization/ru-RU.js.map +1 -1
  42. package/dist/localization/zh-CN.cjs +28 -23
  43. package/dist/localization/zh-CN.cjs.map +1 -1
  44. package/dist/localization/zh-CN.js +28 -23
  45. package/dist/localization/zh-CN.js.map +1 -1
  46. package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts +6 -0
  47. package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts +6 -0
  48. package/dist/types/components/emoji_picker/modules/emoji_search.vue.d.ts.map +1 -1
  49. package/dist/types/components/input/input.vue.d.ts +3 -0
  50. package/dist/types/components/input/input.vue.d.ts.map +1 -1
  51. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +8 -0
  52. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts.map +1 -1
  53. package/dist/types/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +3 -0
  54. package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +3 -0
  55. package/dist/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
  56. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { nodeViewProps as ft, NodeViewWrapper as pt, VueRenderer as je, VueNodeViewRenderer as mt, EditorContent as ze, Editor as Fe } from "../../node_modules/@tiptap/vue-3.js";
1
+ import { nodeViewProps as ft, NodeViewWrapper as pt, VueRenderer as je, VueNodeViewRenderer as mt, EditorContent as Fe, Editor as ze } from "../../node_modules/@tiptap/vue-3.js";
2
2
  import { isTextSelection as Ke, posToDOMRect as re, getText as We, getTextSerializersFromSchema as qe, Node as ae, nodePasteRule as Et, InputRule as Xe, mergeAttributes as st, getMarksBetween as Ye, combineTransactionSteps as Ge, getChangedRanges as Je, findChildrenInRange as Ze, Mark as Qe, nodeInputRule as tn, Extension as en } from "@tiptap/core";
3
3
  import { Plugin as It, PluginKey as rt, NodeSelection as nn } from "@tiptap/pm/state";
4
4
  import { CellSelection as on } from "@tiptap/pm/tables";
@@ -27,7 +27,7 @@ import ye from "../emoji/emoji.js";
27
27
  import { getEmojiData as Bn, emojiRegex as Nn, stringToUnicode as Pn, codeToEmojiData as At, emojiShortCodeRegex as Un } from "../../common/emoji/index.js";
28
28
  import Vn from "../list-item/list-item.js";
29
29
  import gt from "../stack/stack.js";
30
- import { linkRegex as jn, getPhoneNumberRegex as zn, warnIfUnmounted as Fn, returnFirstEl as zt } from "../../common/utils/index.js";
30
+ import { linkRegex as jn, getPhoneNumberRegex as Fn, warnIfUnmounted as zn, returnFirstEl as Ft } from "../../common/utils/index.js";
31
31
  import Kn from "@tiptap/extension-image";
32
32
  import Rt from "@tiptap/extension-mention";
33
33
  import we from "../link/link.js";
@@ -37,7 +37,7 @@ import qn from "../input/input.js";
37
37
  import Xn from "../popover/popover.js";
38
38
  import ve from "../button/button.js";
39
39
  import Yn from "../badge/badge.js";
40
- import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as Ft, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Gn, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Jn } from "./rich-text-editor-constants.js";
40
+ import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as zt, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Gn, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Jn } from "./rich-text-editor-constants.js";
41
41
  import Zn from "../avatar/avatar.js";
42
42
  import Qn from "@dialpad/dialtone-icons/vue3/hash";
43
43
  import to from "@dialpad/dialtone-icons/vue3/lock";
@@ -63,7 +63,7 @@ function Z(t, e) {
63
63
  function j(t) {
64
64
  return t.split("-")[0];
65
65
  }
66
- function F(t) {
66
+ function z(t) {
67
67
  return t.split("-")[1];
68
68
  }
69
69
  function Te(t) {
@@ -81,7 +81,7 @@ function Ht(t) {
81
81
  }
82
82
  function _e(t, e, o) {
83
83
  o === void 0 && (o = !1);
84
- const n = F(t), i = Ht(t), s = Mt(i);
84
+ const n = z(t), i = Ht(t), s = Mt(i);
85
85
  let r = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
86
86
  return e.reference[s] > e.floating[s] && (r = vt(r)), [r, vt(r)];
87
87
  }
@@ -106,7 +106,7 @@ function lo(t, e, o) {
106
106
  }
107
107
  }
108
108
  function co(t, e, o, n) {
109
- const i = F(t);
109
+ const i = z(t);
110
110
  let s = lo(j(t), o === "start", n);
111
111
  return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(bt)))), s;
112
112
  }
@@ -186,7 +186,7 @@ function Yt(t, e, o) {
186
186
  y: n.y
187
187
  };
188
188
  }
189
- switch (F(e)) {
189
+ switch (z(e)) {
190
190
  case "start":
191
191
  f[r] -= h * (o && u ? -1 : 1);
192
192
  break;
@@ -329,12 +329,12 @@ const fo = async (t, e, o) => {
329
329
  }, f = Ht(i), p = Mt(f), m = await r.getDimensions(u), g = f === "y", y = g ? "top" : "left", b = g ? "bottom" : "right", v = g ? "clientHeight" : "clientWidth", x = s.reference[p] + s.reference[f] - h[f] - s.floating[p], O = h[f] - s.reference[f], _ = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(u));
330
330
  let L = _ ? _[v] : 0;
331
331
  (!L || !await (r.isElement == null ? void 0 : r.isElement(_))) && (L = a.floating[v] || s.floating[p]);
332
- const U = x / 2 - O / 2, D = L / 2 - m[p] / 2 - 1, w = G(c[y], D), E = G(c[b], D), A = w, H = L - m[p] - E, S = L / 2 - m[p] / 2 + U, z = St(A, S, H), V = !l.arrow && F(i) != null && S !== z && s.reference[p] / 2 - (S < A ? w : E) - m[p] / 2 < 0, B = V ? S < A ? S - A : S - H : 0;
332
+ const U = x / 2 - O / 2, D = L / 2 - m[p] / 2 - 1, w = G(c[y], D), E = G(c[b], D), A = w, H = L - m[p] - E, S = L / 2 - m[p] / 2 + U, F = St(A, S, H), V = !l.arrow && z(i) != null && S !== F && s.reference[p] / 2 - (S < A ? w : E) - m[p] / 2 < 0, B = V ? S < A ? S - A : S - H : 0;
333
333
  return {
334
334
  [f]: h[f] + B,
335
335
  data: {
336
- [f]: z,
337
- centerOffset: S - z - B,
336
+ [f]: F,
337
+ centerOffset: S - F - B,
338
338
  ...V && {
339
339
  alignmentOffset: B
340
340
  }
@@ -344,7 +344,7 @@ const fo = async (t, e, o) => {
344
344
  }
345
345
  });
346
346
  function mo(t, e, o) {
347
- return (t ? [...o.filter((i) => F(i) === t), ...o.filter((i) => F(i) !== t)] : o.filter((i) => j(i) === i)).filter((i) => t ? F(i) === t || (e ? bt(i) !== i : !1) : !0);
347
+ return (t ? [...o.filter((i) => z(i) === t), ...o.filter((i) => z(i) !== t)] : o.filter((i) => j(i) === i)).filter((i) => t ? z(i) === t || (e ? bt(i) !== i : !1) : !0);
348
348
  }
349
349
  const go = function(t) {
350
350
  return t === void 0 && (t = {}), {
@@ -389,7 +389,7 @@ const go = function(t) {
389
389
  }
390
390
  };
391
391
  const L = O.map((w) => {
392
- const E = F(w.placement);
392
+ const E = z(w.placement);
393
393
  return [w.placement, E && d ? (
394
394
  // Check along the mainAxis and main crossAxis side.
395
395
  w.overflows.slice(0, 2).reduce((A, H) => A + H, 0)
@@ -401,7 +401,7 @@ const go = function(t) {
401
401
  0,
402
402
  // Aligned placements should not check their opposite crossAxis
403
403
  // side.
404
- F(w[0]) ? 2 : 3
404
+ z(w[0]) ? 2 : 3
405
405
  ).every((E) => E <= 0))[0]) == null ? void 0 : i[0]) || L[0][0];
406
406
  return D !== a ? {
407
407
  data: {
@@ -451,8 +451,8 @@ const go = function(t) {
451
451
  overflows: D
452
452
  }], !D.every((S) => S <= 0)) {
453
453
  var E, A;
454
- const S = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, z = L[S];
455
- if (z && (!(c === "alignment" ? b !== X(z) : !1) || // We leave the current main axis only if every placement on that axis
454
+ const S = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, F = L[S];
455
+ if (F && (!(c === "alignment" ? b !== X(F) : !1) || // We leave the current main axis only if every placement on that axis
456
456
  // overflows the main axis.
457
457
  w.every((N) => X(N.placement) === b ? N.overflows[0] > 0 : !0)))
458
458
  return {
@@ -461,7 +461,7 @@ const go = function(t) {
461
461
  overflows: w
462
462
  },
463
463
  reset: {
464
- placement: z
464
+ placement: F
465
465
  }
466
466
  };
467
467
  let V = (A = w.filter((B) => B.overflows[0] <= 0).sort((B, N) => B.overflows[1] - N.overflows[1])[0]) == null ? void 0 : A.placement;
@@ -589,15 +589,15 @@ const vo = function(t) {
589
589
  return c.find((g) => l > g.left - f.left && l < g.right + f.right && u > g.top - f.top && u < g.bottom + f.bottom) || h;
590
590
  if (c.length >= 2) {
591
591
  if (X(o) === "y") {
592
- const w = c[0], E = c[c.length - 1], A = j(o) === "top", H = w.top, S = E.bottom, z = A ? w.left : E.left, V = A ? w.right : E.right, B = V - z, N = S - H;
592
+ const w = c[0], E = c[c.length - 1], A = j(o) === "top", H = w.top, S = E.bottom, F = A ? w.left : E.left, V = A ? w.right : E.right, B = V - F, N = S - H;
593
593
  return {
594
594
  top: H,
595
595
  bottom: S,
596
- left: z,
596
+ left: F,
597
597
  right: V,
598
598
  width: B,
599
599
  height: N,
600
- x: z,
600
+ x: F,
601
601
  y: H
602
602
  };
603
603
  }
@@ -635,7 +635,7 @@ async function To(t, e) {
635
635
  placement: o,
636
636
  platform: n,
637
637
  elements: i
638
- } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), a = F(o), l = X(o) === "y", u = xo.has(r) ? -1 : 1, d = s && l ? -1 : 1, c = Z(e, t);
638
+ } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), r = j(o), a = z(o), l = X(o) === "y", u = xo.has(r) ? -1 : 1, d = s && l ? -1 : 1, c = Z(e, t);
639
639
  let {
640
640
  mainAxis: h,
641
641
  crossAxis: f,
@@ -751,7 +751,7 @@ const _o = function(t) {
751
751
  apply: l = () => {
752
752
  },
753
753
  ...u
754
- } = Z(t, e), d = await r.detectOverflow(e, u), c = j(i), h = F(i), f = X(i) === "y", {
754
+ } = Z(t, e), d = await r.detectOverflow(e, u), c = j(i), h = z(i), f = X(i) === "y", {
755
755
  width: p,
756
756
  height: m
757
757
  } = s.floating;
@@ -1054,7 +1054,7 @@ function Ae(t, e) {
1054
1054
  const o = ot(t);
1055
1055
  return o === e || !K(o) || dt(o) ? !1 : W(o).position === "fixed" || Ae(o, e);
1056
1056
  }
1057
- function zo(t, e) {
1057
+ function Fo(t, e) {
1058
1058
  const o = e.get(t);
1059
1059
  if (o)
1060
1060
  return o;
@@ -1067,14 +1067,14 @@ function zo(t, e) {
1067
1067
  }
1068
1068
  return e.set(t, n), n;
1069
1069
  }
1070
- function Fo(t) {
1070
+ function zo(t) {
1071
1071
  let {
1072
1072
  element: e,
1073
1073
  boundary: o,
1074
1074
  rootBoundary: n,
1075
1075
  strategy: i
1076
1076
  } = t;
1077
- const r = [...o === "clippingAncestors" ? Tt(e) ? [] : zo(e, this._c) : [].concat(o), n], a = r[0], l = r.reduce((u, d) => {
1077
+ const r = [...o === "clippingAncestors" ? Tt(e) ? [] : Fo(e, this._c) : [].concat(o), n], a = r[0], l = r.reduce((u, d) => {
1078
1078
  const c = ee(e, d, i);
1079
1079
  return u.top = R(c.top, u.top), u.right = G(c.right, u.right), u.bottom = G(c.bottom, u.bottom), u.left = R(c.left, u.left), u;
1080
1080
  }, ee(e, a, i));
@@ -1166,7 +1166,7 @@ function Xo(t) {
1166
1166
  const Yo = {
1167
1167
  convertOffsetParentRelativeRectToViewportRelativeRect: Bo,
1168
1168
  getDocumentElement: Q,
1169
- getClippingRect: Fo,
1169
+ getClippingRect: zo,
1170
1170
  getOffsetParent: Re,
1171
1171
  getElementRects: qo,
1172
1172
  getClientRects: No,
@@ -2086,7 +2086,7 @@ function Hi(t, e, o, n) {
2086
2086
  for (const a of r)
2087
2087
  a.mark.type === n && o.removeMark(a.from, a.to, n);
2088
2088
  }
2089
- const ie = zn(1, 15);
2089
+ const ie = Fn(1, 15);
2090
2090
  function se(t, e, o, n, i, s) {
2091
2091
  if (!t)
2092
2092
  return;
@@ -2209,14 +2209,22 @@ const Bi = {
2209
2209
  }
2210
2210
  },
2211
2211
  methods: {
2212
- handleClick() {
2213
- const t = {
2212
+ getMentionData() {
2213
+ return {
2214
2214
  name: this.$props.node.attrs.name,
2215
2215
  id: this.$props.node.attrs.id,
2216
2216
  avatarSrc: this.$props.node.attrs.avatarSrc,
2217
2217
  contactKey: this.$props.node.attrs.contactKey
2218
2218
  };
2219
- this.$props.editor.emit("mention-click", t);
2219
+ },
2220
+ handleClick() {
2221
+ this.$props.editor.emit("mention-click", this.getMentionData());
2222
+ },
2223
+ handleMouseEnter(t) {
2224
+ this.$props.editor.emit("mention-hover", { ...this.getMentionData(), event: t });
2225
+ },
2226
+ handleMouseLeave(t) {
2227
+ this.$props.editor.emit("mention-leave", { ...this.getMentionData(), event: t });
2220
2228
  }
2221
2229
  }
2222
2230
  };
@@ -2226,20 +2234,24 @@ function ji(t, e, o, n, i, s) {
2226
2234
  default: C(() => [
2227
2235
  I(r, {
2228
2236
  kind: "mention",
2229
- onClick: Dt(s.handleClick, ["prevent"])
2237
+ onClick: Dt(s.handleClick, ["prevent"]),
2238
+ onMouseenter: s.handleMouseEnter,
2239
+ onMouseleave: s.handleMouseLeave,
2240
+ onFocusin: s.handleMouseEnter,
2241
+ onFocusout: s.handleMouseLeave
2230
2242
  }, {
2231
2243
  default: C(() => [
2232
2244
  at($(s.text), 1)
2233
2245
  ]),
2234
2246
  _: 1
2235
- }, 8, ["onClick"])
2247
+ }, 8, ["onClick", "onMouseenter", "onMouseleave", "onFocusin", "onFocusout"])
2236
2248
  ]),
2237
2249
  _: 1
2238
2250
  });
2239
2251
  }
2240
- const zi = /* @__PURE__ */ q(Vi, [["render", ji]]), Fi = Rt.extend({
2252
+ const Fi = /* @__PURE__ */ q(Vi, [["render", ji]]), zi = Rt.extend({
2241
2253
  addNodeView() {
2242
- return mt(zi);
2254
+ return mt(Fi);
2243
2255
  },
2244
2256
  parseHTML() {
2245
2257
  return [
@@ -2828,7 +2840,7 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
2828
2840
  compatConfig: { MODE: 3 },
2829
2841
  name: "DtRichTextEditor",
2830
2842
  components: {
2831
- EditorContent: ze,
2843
+ EditorContent: Fe,
2832
2844
  BubbleMenu: Qo,
2833
2845
  DtButton: ve,
2834
2846
  DtStack: gt
@@ -3201,6 +3213,22 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
3201
3213
  * @type {Object}
3202
3214
  */
3203
3215
  "mention-click",
3216
+ /**
3217
+ * Event fired when the cursor enters a mention. The payload includes the
3218
+ * mention data (name, id, avatarSrc, contactKey) plus the native MouseEvent
3219
+ * as `event`, which can be used for positioning a hovercard.
3220
+ * @event mention-hover
3221
+ * @type {Object}
3222
+ */
3223
+ "mention-hover",
3224
+ /**
3225
+ * Event fired when the cursor leaves a mention. The payload includes the
3226
+ * mention data (name, id, avatarSrc, contactKey) plus the native MouseEvent
3227
+ * as `event`.
3228
+ * @event mention-leave
3229
+ * @type {Object}
3230
+ */
3231
+ "mention-leave",
3204
3232
  /**
3205
3233
  * Event fired when a channel is clicked
3206
3234
  * @event channel-click
@@ -3213,7 +3241,7 @@ const xs = /* @__PURE__ */ q(gs, [["render", vs]]), Ts = {
3213
3241
  editor: null,
3214
3242
  appendTo: () => {
3215
3243
  var t;
3216
- return (t = zt(this.$refs.editor.$el).getRootNode()) == null ? void 0 : t.querySelector("body");
3244
+ return (t = Ft(this.$refs.editor.$el).getRootNode()) == null ? void 0 : t.querySelector("body");
3217
3245
  },
3218
3246
  floatingOptions: {
3219
3247
  placement: "top-start"
@@ -3393,10 +3421,10 @@ ${this.processNodeContent(t)}
3393
3421
  },
3394
3422
  openOnClick: !1,
3395
3423
  autolink: !0,
3396
- protocols: Ft
3424
+ protocols: zt
3397
3425
  })), this.customLink && t.push(this.getExtension(Ni, this.customLink)), this.mentionSuggestion) {
3398
3426
  const n = { ...this.mentionSuggestion, ...us };
3399
- t.push(Fi.configure({ suggestion: n }));
3427
+ t.push(zi.configure({ suggestion: n }));
3400
3428
  }
3401
3429
  if (this.channelSuggestion) {
3402
3430
  const n = { ...this.channelSuggestion, ...ms };
@@ -3471,11 +3499,11 @@ ${n.textContent}
3471
3499
  this.destroyEditor();
3472
3500
  },
3473
3501
  mounted() {
3474
- Fn(zt(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
3502
+ zn(Ft(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
3475
3503
  },
3476
3504
  methods: {
3477
3505
  createEditor() {
3478
- this.editor = new Fe({
3506
+ this.editor = new ze({
3479
3507
  autofocus: this.autoFocus,
3480
3508
  content: this.modelValue,
3481
3509
  editable: this.editable,
@@ -3536,7 +3564,7 @@ ${n.textContent}
3536
3564
  const t = this.editor.getAttributes("link").href;
3537
3565
  window.open(t, "_blank");
3538
3566
  },
3539
- setLink(t, e, o, n = Ft, i) {
3567
+ setLink(t, e, o, n = zt, i) {
3540
3568
  var a, l, u;
3541
3569
  if (!t) {
3542
3570
  this.removeLink();
@@ -3653,6 +3681,10 @@ ${n.textContent}
3653
3681
  this.$emit("blur", t);
3654
3682
  }), this.editor.on("mention-click", (t) => {
3655
3683
  this.$emit("mention-click", t);
3684
+ }), this.editor.on("mention-hover", (t) => {
3685
+ this.$emit("mention-hover", t);
3686
+ }), this.editor.on("mention-leave", (t) => {
3687
+ this.$emit("mention-leave", t);
3656
3688
  }), this.editor.on("channel-click", (t) => {
3657
3689
  this.$emit("channel-click", t);
3658
3690
  });