@dialpad/dialtone 9.153.9 → 9.154.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 (42) hide show
  1. package/dist/css/dialtone-default-theme.css +24 -13
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone.css +24 -13
  4. package/dist/css/dialtone.min.css +1 -1
  5. package/dist/tokens/doc.json +106852 -106852
  6. package/dist/vue2/component-documentation.json +1 -1
  7. package/dist/vue2/lib/stack/stack-constants.cjs +1 -1
  8. package/dist/vue2/lib/stack/stack-constants.cjs.map +1 -1
  9. package/dist/vue2/lib/stack/stack-constants.js +8 -8
  10. package/dist/vue2/lib/stack/stack-constants.js.map +1 -1
  11. package/dist/vue2/lib/stack/stack.cjs.map +1 -1
  12. package/dist/vue2/lib/stack/stack.js +1 -1
  13. package/dist/vue2/lib/stack/stack.js.map +1 -1
  14. package/dist/vue2/lib/stack/utils.cjs +1 -1
  15. package/dist/vue2/lib/stack/utils.cjs.map +1 -1
  16. package/dist/vue2/lib/stack/utils.js +56 -44
  17. package/dist/vue2/lib/stack/utils.js.map +1 -1
  18. package/dist/vue2/types/components/stack/stack_constants.d.ts.map +1 -1
  19. package/dist/vue2/types/components/stack/utils.d.ts.map +1 -1
  20. package/dist/vue3/component-documentation.json +1 -1
  21. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
  22. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  23. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +53 -32
  24. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  25. package/dist/vue3/lib/stack/stack-constants.cjs +1 -1
  26. package/dist/vue3/lib/stack/stack-constants.cjs.map +1 -1
  27. package/dist/vue3/lib/stack/stack-constants.js +8 -8
  28. package/dist/vue3/lib/stack/stack-constants.js.map +1 -1
  29. package/dist/vue3/lib/stack/stack.cjs.map +1 -1
  30. package/dist/vue3/lib/stack/stack.js +1 -1
  31. package/dist/vue3/lib/stack/stack.js.map +1 -1
  32. package/dist/vue3/lib/stack/utils.cjs +1 -1
  33. package/dist/vue3/lib/stack/utils.cjs.map +1 -1
  34. package/dist/vue3/lib/stack/utils.js +56 -44
  35. package/dist/vue3/lib/stack/utils.js.map +1 -1
  36. package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +3 -1
  37. package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
  38. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +2 -1
  39. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  40. package/dist/vue3/types/components/stack/stack_constants.d.ts.map +1 -1
  41. package/dist/vue3/types/components/stack/utils.d.ts.map +1 -1
  42. package/package.json +5 -5
@@ -5,7 +5,7 @@ import ue from "@tiptap/extension-code-block";
5
5
  import me from "@tiptap/extension-code";
6
6
  import he from "@tiptap/extension-document";
7
7
  import pe from "@tiptap/extension-hard-break";
8
- import U from "@tiptap/extension-paragraph";
8
+ import W from "@tiptap/extension-paragraph";
9
9
  import fe from "@tiptap/extension-placeholder";
10
10
  import ge from "@tiptap/extension-bold";
11
11
  import _e from "@tiptap/extension-bullet-list";
@@ -23,20 +23,20 @@ import $e from "@tiptap/extension-color";
23
23
  import ve from "@tiptap/extension-font-family";
24
24
  import { PluginKey as T, Plugin as Re } from "@tiptap/pm/state";
25
25
  import Ie from "@tiptap/suggestion";
26
- import { emojiPattern as W } from "regex-combined-emojis";
27
- import { resolveComponent as l, createBlock as m, openBlock as d, withCtx as u, createVNode as f, createElementBlock as _, withDirectives as Me, createElementVNode as k, Fragment as Be, renderList as Ne, withModifiers as z, normalizeClass as X, resolveDynamicComponent as Oe, vShow as De, createTextVNode as C, toDisplayString as h, markRaw as M, createCommentVNode as w, mergeProps as Ae } from "vue";
26
+ import { emojiPattern as z } from "regex-combined-emojis";
27
+ import { resolveComponent as l, createBlock as m, openBlock as d, withCtx as u, createVNode as f, createElementBlock as _, withDirectives as Me, createElementVNode as k, Fragment as Be, renderList as Ne, withModifiers as j, normalizeClass as X, resolveDynamicComponent as Oe, vShow as De, createTextVNode as C, toDisplayString as h, markRaw as M, createCommentVNode as w, mergeProps as Ae } from "vue";
28
28
  import { _ as g } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
29
29
  import J from "../emoji/emoji.js";
30
- import { getEmojiData as Pe, emojiRegex as je, stringToUnicode as He, codeToEmojiData as j, emojiShortCodeRegex as Ke } from "../../common/emoji/index.js";
30
+ import { getEmojiData as Pe, emojiRegex as je, stringToUnicode as He, codeToEmojiData as H, emojiShortCodeRegex as Ke } from "../../common/emoji/index.js";
31
31
  import Fe from "../list-item/list-item.js";
32
32
  import E from "../stack/stack.js";
33
33
  import B from "tippy.js";
34
- import { getPhoneNumberRegex as Ve, linkRegex as qe, warnIfUnmounted as Ue, returnFirstEl as K } from "../../common/utils/index.js";
34
+ import { getPhoneNumberRegex as Ve, linkRegex as qe, warnIfUnmounted as Ue, returnFirstEl as F } from "../../common/utils/index.js";
35
35
  import We from "@tiptap/extension-image";
36
- import H from "@tiptap/extension-mention";
36
+ import K from "@tiptap/extension-mention";
37
37
  import Y from "../link/link.js";
38
38
  import { DtIconLock as ze } from "@dialpad/dialtone-icons/vue3";
39
- import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as F, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Je } from "./rich-text-editor-constants.js";
39
+ import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as V, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Je } from "./rich-text-editor-constants.js";
40
40
  import Ye from "../avatar/avatar.js";
41
41
  import Ge from "@dialpad/dialtone-icons/vue3/hash";
42
42
  import Qe from "@dialpad/dialtone-icons/vue3/lock";
@@ -153,7 +153,7 @@ function ct(e, t, o, n, r, s) {
153
153
  ]),
154
154
  "navigation-type": "arrow-keys",
155
155
  onClick: (p) => s.selectItem(c),
156
- onKeydown: z(s.onKeyDown, ["prevent"])
156
+ onKeydown: j(s.onKeyDown, ["prevent"])
157
157
  }, {
158
158
  default: u(() => [
159
159
  (d(), m(Oe(o.itemComponent), { item: a }, null, 8, ["item"]))
@@ -285,10 +285,10 @@ const ut = /* @__PURE__ */ g(dt, [["render", lt]]), O = {
285
285
  }
286
286
  };
287
287
  }
288
- }, ft = /(:\w+:)$/, gt = new RegExp(W + "$"), _t = (e) => {
289
- if (e && j(e[0]))
288
+ }, ft = /(:\w+:)$/, gt = new RegExp(z + "$"), _t = (e) => {
289
+ if (e && H(e[0]))
290
290
  return { text: e[2] || e[0] };
291
- }, kt = (e) => [...e.matchAll(Ke)].filter((o) => j(o[0])).map((o) => ({
291
+ }, kt = (e) => [...e.matchAll(Ke)].filter((o) => H(o[0])).map((o) => ({
292
292
  index: o.index,
293
293
  text: o[0],
294
294
  match: o
@@ -321,7 +321,7 @@ const ut = /* @__PURE__ */ g(dt, [["render", lt]]), O = {
321
321
  ];
322
322
  },
323
323
  renderText({ node: e }) {
324
- return He(j(e.attrs.code).unicode_output);
324
+ return He(H(e.attrs.code).unicode_output);
325
325
  },
326
326
  renderHTML({ HTMLAttributes: e }) {
327
327
  return ["emoji-component", b(this.options.HTMLAttributes, e)];
@@ -436,8 +436,8 @@ function Tt(e, t, o, n) {
436
436
  for (const a of i)
437
437
  a.mark.type === n && o.removeMark(a.from, a.to, n);
438
438
  }
439
- const V = Ve(1, 15);
440
- function q(e, t, o, n, r, s) {
439
+ const q = Ve(1, 15);
440
+ function U(e, t, o, n, r, s) {
441
441
  if (!e)
442
442
  return;
443
443
  let i = o - t - 1;
@@ -446,12 +446,12 @@ function q(e, t, o, n, r, s) {
446
446
  e,
447
447
  i,
448
448
  "left",
449
- V
449
+ q
450
450
  ), p = P(
451
451
  e,
452
452
  a,
453
453
  "right",
454
- V
454
+ q
455
455
  ), y = e.slice(c.from, p.to);
456
456
  wt(y, qe, Ct).forEach((D) => {
457
457
  const x = bt(D[0]), L = t + c.from + D.index + 1, G = L + x.length;
@@ -467,7 +467,7 @@ function Et(e) {
467
467
  if (t && !s)
468
468
  return;
469
469
  const { tr: i } = r, { textContent: a } = r.doc;
470
- t || q(a, 0, 0, a.length, i, e.type), t = !0;
470
+ t || U(a, 0, 0, a.length, i, e.type), t = !0;
471
471
  const c = re(
472
472
  n.doc,
473
473
  [...o]
@@ -478,7 +478,7 @@ function Et(e) {
478
478
  S,
479
479
  (x) => x.isTextblock
480
480
  ).forEach(({ node: x, pos: L }) => {
481
- q(
481
+ U(
482
482
  x.textContent,
483
483
  L,
484
484
  y.from,
@@ -538,7 +538,7 @@ const St = {
538
538
  }
539
539
  };
540
540
  }
541
- }).configure({ inline: !0, allowBase64: !0 }), vt = U.extend({
541
+ }).configure({ inline: !0, allowBase64: !0 }), vt = W.extend({
542
542
  parseHTML() {
543
543
  return [{ tag: "div" }];
544
544
  },
@@ -576,7 +576,7 @@ function It(e, t, o, n, r, s) {
576
576
  default: u(() => [
577
577
  f(i, {
578
578
  kind: "mention",
579
- onClick: z(s.handleClick, ["prevent"])
579
+ onClick: j(s.handleClick, ["prevent"])
580
580
  }, {
581
581
  default: u(() => [
582
582
  C(h(s.text), 1)
@@ -587,7 +587,7 @@ function It(e, t, o, n, r, s) {
587
587
  _: 1
588
588
  });
589
589
  }
590
- const Mt = /* @__PURE__ */ g(Rt, [["render", It]]), Bt = H.extend({
590
+ const Mt = /* @__PURE__ */ g(Rt, [["render", It]]), Bt = K.extend({
591
591
  addNodeView() {
592
592
  return I(Mt);
593
593
  },
@@ -639,13 +639,26 @@ const Mt = /* @__PURE__ */ g(Rt, [["render", It]]), Bt = H.extend({
639
639
  text() {
640
640
  return this.$props.node.attrs.locked ? this.$props.node.attrs.name : "#" + this.$props.node.attrs.name;
641
641
  }
642
+ },
643
+ methods: {
644
+ handleClick() {
645
+ const e = {
646
+ name: this.$props.node.attrs.name,
647
+ id: this.$props.node.attrs.id,
648
+ locked: this.$props.node.attrs.locked
649
+ };
650
+ this.$props.editor.emit("channel-click", e);
651
+ }
642
652
  }
643
653
  };
644
654
  function Ot(e, t, o, n, r, s) {
645
655
  const i = l("dt-icon-lock"), a = l("dt-stack"), c = l("dt-link"), p = l("node-view-wrapper");
646
656
  return d(), m(p, { class: "d-d-inline-block" }, {
647
657
  default: u(() => [
648
- f(c, { kind: "mention" }, {
658
+ f(c, {
659
+ kind: "mention",
660
+ onClick: j(s.handleClick, ["prevent"])
661
+ }, {
649
662
  default: u(() => [
650
663
  f(a, {
651
664
  direction: "row",
@@ -662,12 +675,12 @@ function Ot(e, t, o, n, r, s) {
662
675
  })
663
676
  ]),
664
677
  _: 1
665
- })
678
+ }, 8, ["onClick"])
666
679
  ]),
667
680
  _: 1
668
681
  });
669
682
  }
670
- const Dt = /* @__PURE__ */ g(Nt, [["render", Ot]]), At = H.extend({
683
+ const Dt = /* @__PURE__ */ g(Nt, [["render", Ot]]), At = K.extend({
671
684
  name: "channel",
672
685
  addNodeView() {
673
686
  return I(Dt);
@@ -742,7 +755,7 @@ const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Kt = (e, t) => [...e.matchAl
742
755
  text: r,
743
756
  match: n
744
757
  };
745
- }), Ft = H.extend({
758
+ }), Ft = K.extend({
746
759
  name: "slash-commands",
747
760
  group: "inline",
748
761
  inline: !0,
@@ -1484,7 +1497,13 @@ const sn = /* @__PURE__ */ g(en, [["render", rn]]), an = {
1484
1497
  * @event mention-click
1485
1498
  * @type {Object}
1486
1499
  */
1487
- "mention-click"
1500
+ "mention-click",
1501
+ /**
1502
+ * Event fired when a channel is clicked
1503
+ * @event channel-click
1504
+ * @type {Object}
1505
+ */
1506
+ "channel-click"
1488
1507
  ],
1489
1508
  data() {
1490
1509
  return {
@@ -1492,7 +1511,7 @@ const sn = /* @__PURE__ */ g(en, [["render", rn]]), an = {
1492
1511
  tippyOptions: {
1493
1512
  appendTo: () => {
1494
1513
  var e;
1495
- return (e = K(this.$refs.editor.$el).getRootNode()) == null ? void 0 : e.querySelector("body");
1514
+ return (e = F(this.$refs.editor.$el).getRootNode()) == null ? void 0 : e.querySelector("body");
1496
1515
  },
1497
1516
  placement: "top-start"
1498
1517
  },
@@ -1631,7 +1650,7 @@ ${this.processNodeContent(e)}
1631
1650
  // eslint-disable-next-line complexity
1632
1651
  extensions() {
1633
1652
  const e = [he, Te, Se, pe];
1634
- e.push(this.useDivTags ? vt : U), this.allowBold && e.push(ge), this.allowBlockquote && e.push(le), this.allowBulletList && (e.push(_e), e.push(we.extend({
1653
+ e.push(this.useDivTags ? vt : W), this.allowBold && e.push(ge), this.allowBlockquote && e.push(le), this.allowBulletList && (e.push(_e), e.push(we.extend({
1635
1654
  renderText({ node: n }) {
1636
1655
  return n.textContent;
1637
1656
  }
@@ -1665,7 +1684,7 @@ ${this.processNodeContent(e)}
1665
1684
  },
1666
1685
  openOnClick: !1,
1667
1686
  autolink: !0,
1668
- protocols: F
1687
+ protocols: V
1669
1688
  })), this.customLink && e.push(this.getExtension(Lt, this.customLink)), this.mentionSuggestion) {
1670
1689
  const n = { ...this.mentionSuggestion, ...Jt };
1671
1690
  e.push(Bt.configure({ suggestion: n }));
@@ -1735,7 +1754,7 @@ ${n.textContent}
1735
1754
  this.destroyEditor();
1736
1755
  },
1737
1756
  mounted() {
1738
- Ue(K(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1757
+ Ue(F(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1739
1758
  },
1740
1759
  methods: {
1741
1760
  createEditor() {
@@ -1799,7 +1818,7 @@ ${n.textContent}
1799
1818
  const e = this.editor.getAttributes("link").href;
1800
1819
  window.open(e, "_blank");
1801
1820
  },
1802
- setLink(e, t, o, n = F, r) {
1821
+ setLink(e, t, o, n = V, r) {
1803
1822
  var a, c, p;
1804
1823
  if (!e) {
1805
1824
  this.removeLink();
@@ -1813,7 +1832,7 @@ ${n.textContent}
1813
1832
  const o = this.getOutput();
1814
1833
  if (!(t && Ze(e, o))) {
1815
1834
  if (typeof e == "string" && this.outputFormat === "text") {
1816
- const n = new RegExp(`(${W})`, "g");
1835
+ const n = new RegExp(`(${z})`, "g");
1817
1836
  e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
1818
1837
  }
1819
1838
  this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
@@ -1916,6 +1935,8 @@ ${n.textContent}
1916
1935
  this.$emit("blur", e);
1917
1936
  }), this.editor.on("mention-click", (e) => {
1918
1937
  this.$emit("mention-click", e);
1938
+ }), this.editor.on("channel-click", (e) => {
1939
+ this.$emit("channel-click", e);
1919
1940
  });
1920
1941
  },
1921
1942
  getOutput() {