@dialpad/dialtone 9.117.0 → 9.117.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 (36) hide show
  1. package/dist/tokens/doc.json +15601 -15601
  2. package/dist/vue2/component-documentation.json +1 -1
  3. package/dist/vue2/lib/editor/editor.cjs +1 -1
  4. package/dist/vue2/lib/editor/editor.cjs.map +1 -1
  5. package/dist/vue2/lib/editor/editor.js +48 -48
  6. package/dist/vue2/lib/editor/editor.js.map +1 -1
  7. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +3 -3
  8. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  9. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +183 -166
  10. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  11. package/dist/vue2/localization/index.cjs +5 -1
  12. package/dist/vue2/localization/index.cjs.map +1 -1
  13. package/dist/vue2/localization/index.js +4865 -21
  14. package/dist/vue2/localization/index.js.map +1 -1
  15. package/dist/vue2/node_modules/@tiptap/vue-2.cjs.map +1 -1
  16. package/dist/vue2/node_modules/@tiptap/vue-2.js.map +1 -1
  17. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +18 -0
  18. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  19. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  20. package/dist/vue3/component-documentation.json +1 -1
  21. package/dist/vue3/lib/editor/editor.cjs +1 -1
  22. package/dist/vue3/lib/editor/editor.cjs.map +1 -1
  23. package/dist/vue3/lib/editor/editor.js +2 -0
  24. package/dist/vue3/lib/editor/editor.js.map +1 -1
  25. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
  26. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  27. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +181 -164
  28. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  29. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +18 -0
  30. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  31. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  32. package/package.json +4 -5
  33. package/dist/vue2/node_modules/@dialpad/i18n-vue2.cjs +0 -6
  34. package/dist/vue2/node_modules/@dialpad/i18n-vue2.cjs.map +0 -1
  35. package/dist/vue2/node_modules/@dialpad/i18n-vue2.js +0 -4906
  36. package/dist/vue2/node_modules/@dialpad/i18n-vue2.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { NodeViewWrapper as T, nodeViewProps as R, VueRenderer as L, VueNodeViewRenderer as $, EditorContent as Y, BubbleMenu as G, Editor as Q } from "../../node_modules/@tiptap/vue-3.js";
2
- import { Node as Z, mergeAttributes as k, InputRule as ee, nodePasteRule as D, getMarksBetween as te, combineTransactionSteps as ne, getChangedRanges as oe, findChildrenInRange as ie, Mark as re, nodeInputRule as se, Extension as ae } from "@tiptap/core";
3
- import de from "@tiptap/extension-blockquote";
4
- import le from "@tiptap/extension-code-block";
2
+ import { Node as Z, mergeAttributes as k, InputRule as ee, nodePasteRule as B, getMarksBetween as te, combineTransactionSteps as ne, getChangedRanges as oe, findChildrenInRange as ie, Mark as re, nodeInputRule as se, Extension as ae } from "@tiptap/core";
3
+ import le from "@tiptap/extension-blockquote";
4
+ import de from "@tiptap/extension-code-block";
5
5
  import ce from "@tiptap/extension-code";
6
6
  import ue from "@tiptap/extension-document";
7
7
  import me from "@tiptap/extension-hard-break";
8
- import U from "@tiptap/extension-paragraph";
8
+ import N from "@tiptap/extension-paragraph";
9
9
  import he from "@tiptap/extension-placeholder";
10
10
  import fe from "@tiptap/extension-bold";
11
11
  import pe from "@tiptap/extension-bullet-list";
@@ -18,28 +18,31 @@ import be from "@tiptap/extension-underline";
18
18
  import xe from "@tiptap/extension-text";
19
19
  import Ce from "@tiptap/extension-text-align";
20
20
  import Ee from "@tiptap/extension-history";
21
- import { PluginKey as C, Plugin as Se } from "@tiptap/pm/state";
22
- import Te from "@tiptap/suggestion";
23
- import { emojiPattern as z } from "regex-combined-emojis";
24
- import { resolveComponent as l, openBlock as c, createBlock as m, withCtx as u, createVNode as f, createElementBlock as x, withDirectives as Re, createElementVNode as y, Fragment as Le, renderList as $e, normalizeClass as ve, withModifiers as Ie, resolveDynamicComponent as Me, vShow as Oe, createTextVNode as w, toDisplayString as g, markRaw as v, createCommentVNode as F, mergeProps as Ae } from "vue";
21
+ import Se from "@tiptap/extension-text-style";
22
+ import Te from "@tiptap/extension-color";
23
+ import Re from "@tiptap/extension-font-family";
24
+ import { PluginKey as C, Plugin as Le } from "@tiptap/pm/state";
25
+ import $e from "@tiptap/suggestion";
26
+ import { emojiPattern as U } from "regex-combined-emojis";
27
+ import { resolveComponent as d, openBlock as c, createBlock as m, withCtx as u, createVNode as f, createElementBlock as x, withDirectives as ve, createElementVNode as y, Fragment as Ie, renderList as Me, normalizeClass as Oe, withModifiers as Ae, resolveDynamicComponent as je, vShow as Be, createTextVNode as w, toDisplayString as g, markRaw as v, createCommentVNode as z, mergeProps as De } from "vue";
25
28
  import { _ as p } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
26
29
  import W from "../emoji/emoji.js";
27
- import { stringToUnicode as je, codeToEmojiData as P, emojiRegex as De, emojiShortCodeRegex as Be } from "../../common/emoji/index.js";
28
- import { emojisIndexed as Pe } from "@dialpad/dialtone-emojis";
29
- import He from "../list-item/list-item.js";
30
+ import { stringToUnicode as Pe, codeToEmojiData as P, emojiRegex as He, emojiShortCodeRegex as Ve } from "../../common/emoji/index.js";
31
+ import { emojisIndexed as Fe } from "@dialpad/dialtone-emojis";
32
+ import Ke from "../list-item/list-item.js";
30
33
  import I from "../stack/stack.js";
31
34
  import M from "tippy.js";
32
- import { linkRegex as Ve, getPhoneNumberRegex as Ke, returnFirstEl as V, warnIfUnmounted as qe } from "../../common/utils/index.js";
33
- import Ne from "@tiptap/extension-image";
35
+ import { linkRegex as qe, getPhoneNumberRegex as Ne, returnFirstEl as V, warnIfUnmounted as Ue } from "../../common/utils/index.js";
36
+ import ze from "@tiptap/extension-image";
34
37
  import H from "@tiptap/extension-mention";
35
38
  import X from "../link/link.js";
36
- import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Ue, RICH_TEXT_EDITOR_OUTPUT_FORMATS as ze, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as K } from "./rich-text-editor-constants.js";
37
- import Fe from "../avatar/avatar.js";
38
- import We from "@dialpad/dialtone-icons/vue3/hash";
39
- import Xe from "@dialpad/dialtone-icons/vue3/lock";
40
- import Je from "deep-equal";
41
- import Ye from "../button/button.js";
42
- const Ge = {
39
+ import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as We, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as F } from "./rich-text-editor-constants.js";
40
+ import Je from "../avatar/avatar.js";
41
+ import Ye from "@dialpad/dialtone-icons/vue3/hash";
42
+ import Ge from "@dialpad/dialtone-icons/vue3/lock";
43
+ import Qe from "deep-equal";
44
+ import Ze from "../button/button.js";
45
+ const et = {
43
46
  compatConfig: { MODE: 3 },
44
47
  name: "EmojiComponent",
45
48
  components: {
@@ -48,8 +51,8 @@ const Ge = {
48
51
  },
49
52
  props: R
50
53
  };
51
- function Qe(e, t, o, n, i, r) {
52
- const s = l("dt-emoji"), a = l("node-view-wrapper");
54
+ function tt(e, t, o, n, i, r) {
55
+ const s = d("dt-emoji"), a = d("node-view-wrapper");
53
56
  return c(), m(a, { class: "d-d-inline-block d-va-bottom d-lh0" }, {
54
57
  default: u(() => [
55
58
  f(s, {
@@ -60,11 +63,11 @@ function Qe(e, t, o, n, i, r) {
60
63
  _: 1
61
64
  });
62
65
  }
63
- const Ze = /* @__PURE__ */ p(Ge, [["render", Qe]]), et = {
66
+ const nt = /* @__PURE__ */ p(et, [["render", tt]]), ot = {
64
67
  compatConfig: { MODE: 3 },
65
68
  name: "SuggestionList",
66
69
  components: {
67
- DtListItem: He
70
+ DtListItem: Ke
68
71
  },
69
72
  props: {
70
73
  items: {
@@ -133,35 +136,35 @@ const Ze = /* @__PURE__ */ p(Ge, [["render", Qe]]), et = {
133
136
  }
134
137
  }
135
138
  }
136
- }, tt = { class: "d-popover__dialog d-suggestion-list__container" }, nt = {
139
+ }, it = { class: "d-popover__dialog d-suggestion-list__container" }, rt = {
137
140
  ref: "suggestionList",
138
141
  class: "d-suggestion-list"
139
142
  };
140
- function ot(e, t, o, n, i, r) {
141
- const s = l("dt-list-item");
142
- return c(), x("div", tt, [
143
- Re(y("ul", nt, [
144
- (c(!0), x(Le, null, $e(o.items, (a, d) => (c(), m(s, {
143
+ function st(e, t, o, n, i, r) {
144
+ const s = d("dt-list-item");
145
+ return c(), x("div", it, [
146
+ ve(y("ul", rt, [
147
+ (c(!0), x(Ie, null, Me(o.items, (a, l) => (c(), m(s, {
145
148
  key: a.id,
146
- class: ve([
149
+ class: Oe([
147
150
  "d-suggestion-list__item",
148
- { "d-list-item--highlighted": d === i.selectedIndex }
151
+ { "d-list-item--highlighted": l === i.selectedIndex }
149
152
  ]),
150
153
  "navigation-type": "arrow-keys",
151
- onClick: (h) => r.selectItem(d),
152
- onKeydown: Ie(r.onKeyDown, ["prevent"])
154
+ onClick: (h) => r.selectItem(l),
155
+ onKeydown: Ae(r.onKeyDown, ["prevent"])
153
156
  }, {
154
157
  default: u(() => [
155
- (c(), m(Me(o.itemComponent), { item: a }, null, 8, ["item"]))
158
+ (c(), m(je(o.itemComponent), { item: a }, null, 8, ["item"]))
156
159
  ]),
157
160
  _: 2
158
161
  }, 1032, ["class", "onClick", "onKeydown"]))), 128))
159
162
  ], 512), [
160
- [Oe, o.items.length]
163
+ [Be, o.items.length]
161
164
  ])
162
165
  ]);
163
166
  }
164
- const O = /* @__PURE__ */ p(et, [["render", ot]]), it = {
167
+ const O = /* @__PURE__ */ p(ot, [["render", st]]), at = {
165
168
  compatConfig: { MODE: 3 },
166
169
  name: "EmojiSuggestion",
167
170
  components: {
@@ -175,8 +178,8 @@ const O = /* @__PURE__ */ p(et, [["render", ot]]), it = {
175
178
  }
176
179
  }
177
180
  };
178
- function rt(e, t, o, n, i, r) {
179
- const s = l("dt-emoji"), a = l("dt-stack");
181
+ function lt(e, t, o, n, i, r) {
182
+ const s = d("dt-emoji"), a = d("dt-stack");
180
183
  return c(), m(a, {
181
184
  direction: "row",
182
185
  gap: "400"
@@ -191,7 +194,7 @@ function rt(e, t, o, n, i, r) {
191
194
  _: 1
192
195
  });
193
196
  }
194
- const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
197
+ const dt = /* @__PURE__ */ p(at, [["render", lt]]), A = {
195
198
  name: "hideOnEsc",
196
199
  defaultValue: !0,
197
200
  fn({ hide: e }) {
@@ -207,18 +210,18 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
207
210
  }
208
211
  };
209
212
  }
210
- }, at = 20, dt = {
213
+ }, ct = 20, ut = {
211
214
  items: ({ query: e }) => {
212
215
  if (e.length < 2)
213
216
  return [];
214
- const t = Object.values(Pe);
217
+ const t = Object.values(Fe);
215
218
  return e = e.toLowerCase(), t.filter(
216
219
  (n) => [
217
220
  n.name,
218
221
  n.shortname.replaceAll(":", ""),
219
222
  ...n.keywords
220
223
  ].some((i) => i.startsWith(e))
221
- ).splice(0, at).map((n) => ({ code: n.shortname }));
224
+ ).splice(0, ct).map((n) => ({ code: n.shortname }));
222
225
  },
223
226
  command: ({ editor: e, range: t, props: o }) => {
224
227
  var r, s;
@@ -236,7 +239,7 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
236
239
  onStart: (n) => {
237
240
  e = new L(O, {
238
241
  props: {
239
- itemComponent: v(st),
242
+ itemComponent: v(dt),
240
243
  itemType: "emoji",
241
244
  ...n
242
245
  },
@@ -274,14 +277,14 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
274
277
  }
275
278
  };
276
279
  }
277
- }, lt = /(:\w+:)$/, ct = new RegExp(z + "$"), ut = (e) => {
280
+ }, mt = /(:\w+:)$/, ht = new RegExp(U + "$"), ft = (e) => {
278
281
  if (e && P(e[0]))
279
282
  return { text: e[2] || e[0] };
280
- }, mt = (e) => [...e.matchAll(Be)].filter((o) => P(o[0])).map((o) => ({
283
+ }, pt = (e) => [...e.matchAll(Ve)].filter((o) => P(o[0])).map((o) => ({
281
284
  index: o.index,
282
285
  text: o[0],
283
286
  match: o
284
- })), ht = Z.create({
287
+ })), gt = Z.create({
285
288
  name: "emoji",
286
289
  addOptions() {
287
290
  return {
@@ -293,7 +296,7 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
293
296
  selectable: !1,
294
297
  atom: !0,
295
298
  addNodeView() {
296
- return $(Ze);
299
+ return $(nt);
297
300
  },
298
301
  addAttributes() {
299
302
  return {
@@ -310,7 +313,7 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
310
313
  ];
311
314
  },
312
315
  renderText({ node: e }) {
313
- return je(P(e.attrs.code).unicode_output);
316
+ return Pe(P(e.attrs.code).unicode_output);
314
317
  },
315
318
  renderHTML({ HTMLAttributes: e }) {
316
319
  return ["emoji-component", k(this.options.HTMLAttributes, e)];
@@ -319,21 +322,21 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
319
322
  return [
320
323
  new ee({
321
324
  find: (e) => {
322
- const t = e.match(lt) || e.match(ct);
325
+ const t = e.match(mt) || e.match(ht);
323
326
  if (t)
324
- return ut(t);
327
+ return ft(t);
325
328
  },
326
329
  handler: ({ state: e, range: t, match: o, commands: n, chain: i, can: r }) => {
327
- const { tr: s } = e, a = t.from, d = t.to;
328
- s.replaceWith(a, d, this.type.create({ code: o[0] }));
330
+ const { tr: s } = e, a = t.from, l = t.to;
331
+ s.replaceWith(a, l, this.type.create({ code: o[0] }));
329
332
  }
330
333
  })
331
334
  ];
332
335
  },
333
336
  addPasteRules() {
334
337
  return [
335
- D({
336
- find: mt,
338
+ B({
339
+ find: pt,
337
340
  type: this.type,
338
341
  getAttributes(e) {
339
342
  return {
@@ -341,8 +344,8 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
341
344
  };
342
345
  }
343
346
  }),
344
- D({
345
- find: De,
347
+ B({
348
+ find: He,
346
349
  type: this.type,
347
350
  getAttributes(e) {
348
351
  return {
@@ -354,12 +357,12 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
354
357
  },
355
358
  addProseMirrorPlugins() {
356
359
  return [
357
- Te({
360
+ $e({
358
361
  char: ":",
359
362
  pluginKey: new C("emoji"),
360
363
  editor: this.editor,
361
364
  ...this.options.suggestion,
362
- ...dt
365
+ ...ut
363
366
  })
364
367
  ];
365
368
  },
@@ -376,7 +379,7 @@ const st = /* @__PURE__ */ p(it, [["render", rt]]), A = {
376
379
  };
377
380
  }
378
381
  });
379
- function ft(e, t, o = () => !0) {
382
+ function _t(e, t, o = () => !0) {
380
383
  const n = [];
381
384
  t.lastIndex = 0;
382
385
  let i;
@@ -384,10 +387,10 @@ function ft(e, t, o = () => !0) {
384
387
  o(e, i) && n.push(i);
385
388
  return n;
386
389
  }
387
- function pt(e, t) {
390
+ function yt(e, t) {
388
391
  return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
389
392
  }
390
- function gt(e) {
393
+ function wt(e) {
391
394
  const t = new RegExp(
392
395
  "(?:" + [
393
396
  `[!?.,:;'"]`,
@@ -397,7 +400,7 @@ function gt(e) {
397
400
  );
398
401
  return e.replace(t, "");
399
402
  }
400
- function _t(e, t) {
403
+ function kt(e, t) {
401
404
  const o = e.slice(0, t + 1).search(/\S+\s*$/), n = e.slice(t).search(/\s/);
402
405
  if (n < 0) {
403
406
  const i = e.slice(o);
@@ -413,61 +416,61 @@ function _t(e, t) {
413
416
  to: n + t
414
417
  };
415
418
  }
416
- function B(e, t, o, n) {
417
- const i = _t(e, t);
419
+ function D(e, t, o, n) {
420
+ const i = kt(e, t);
418
421
  if (n.lastIndex = 0, !n.test(i.text))
419
422
  return i;
420
423
  const r = o === "left" ? i.from - 1 : i.to + 1;
421
- return r <= 0 || r >= e.length || r === t ? i : B(e, r, o, n);
424
+ return r <= 0 || r >= e.length || r === t ? i : D(e, r, o, n);
422
425
  }
423
- function yt(e, t, o, n) {
426
+ function bt(e, t, o, n) {
424
427
  const i = Math.max(e.from - 1, 0), r = Math.min(e.to + 1, t.content.size), s = te(i, r, t);
425
428
  for (const a of s)
426
429
  a.mark.type === n && o.removeMark(a.from, a.to, n);
427
430
  }
428
- const q = Ke(1, 15);
429
- function N(e, t, o, n, i, r) {
431
+ const K = Ne(1, 15);
432
+ function q(e, t, o, n, i, r) {
430
433
  if (!e)
431
434
  return;
432
435
  let s = o - t - 1;
433
436
  s = s < 0 ? 0 : s;
434
- const a = n - t, d = B(
437
+ const a = n - t, l = D(
435
438
  e,
436
439
  s,
437
440
  "left",
438
- q
439
- ), h = B(
441
+ K
442
+ ), h = D(
440
443
  e,
441
444
  a,
442
445
  "right",
443
- q
444
- ), _ = e.slice(d.from, h.to);
445
- ft(_, Ve, pt).forEach((j) => {
446
- const b = gt(j[0]), S = t + d.from + j.index + 1, J = S + b.length;
446
+ K
447
+ ), _ = e.slice(l.from, h.to);
448
+ _t(_, qe, yt).forEach((j) => {
449
+ const b = wt(j[0]), S = t + l.from + j.index + 1, J = S + b.length;
447
450
  i.addMark(S, J, r.create());
448
451
  });
449
452
  }
450
- function wt(e) {
453
+ function xt(e) {
451
454
  let t = !1;
452
- return new Se({
455
+ return new Le({
453
456
  key: new C("autolink"),
454
457
  appendTransaction: (o, n, i) => {
455
458
  const r = o.some((_) => _.docChanged) && !n.doc.eq(i.doc);
456
459
  if (t && !r)
457
460
  return;
458
461
  const { tr: s } = i, { textContent: a } = i.doc;
459
- t || N(a, 0, 0, a.length, s, e.type), t = !0;
460
- const d = ne(
462
+ t || q(a, 0, 0, a.length, s, e.type), t = !0;
463
+ const l = ne(
461
464
  n.doc,
462
465
  [...o]
463
466
  );
464
- return oe(d).forEach(({ oldRange: _, newRange: E }) => {
465
- yt(E, i.doc, s, e.type), ie(
467
+ return oe(l).forEach(({ oldRange: _, newRange: E }) => {
468
+ bt(E, i.doc, s, e.type), ie(
466
469
  i.doc,
467
470
  E,
468
471
  (b) => b.isTextblock
469
472
  ).forEach(({ node: b, pos: S }) => {
470
- N(
473
+ q(
471
474
  b.textContent,
472
475
  S,
473
476
  _.from,
@@ -480,10 +483,10 @@ function wt(e) {
480
483
  }
481
484
  });
482
485
  }
483
- const kt = {
486
+ const Ct = {
484
487
  class: "d-link d-c-text d-d-inline-block d-wb-break-all",
485
488
  rel: "noopener noreferrer nofollow"
486
- }, bt = re.create({
489
+ }, Et = re.create({
487
490
  name: "CustomLink",
488
491
  renderHTML({ HTMLAttributes: e }) {
489
492
  return [
@@ -491,7 +494,7 @@ const kt = {
491
494
  k(
492
495
  this.options.HTMLAttributes,
493
496
  e,
494
- kt
497
+ Ct
495
498
  )
496
499
  ];
497
500
  },
@@ -500,10 +503,10 @@ const kt = {
500
503
  },
501
504
  addProseMirrorPlugins() {
502
505
  return [
503
- wt({ type: this.type })
506
+ xt({ type: this.type })
504
507
  ];
505
508
  }
506
- }), xt = Ne.extend({
509
+ }), St = ze.extend({
507
510
  name: "ConfigurableImage",
508
511
  addAttributes() {
509
512
  return {
@@ -527,14 +530,14 @@ const kt = {
527
530
  }
528
531
  };
529
532
  }
530
- }).configure({ inline: !0, allowBase64: !0 }), Ct = U.extend({
533
+ }).configure({ inline: !0, allowBase64: !0 }), Tt = N.extend({
531
534
  parseHTML() {
532
535
  return [{ tag: "div" }];
533
536
  },
534
537
  renderHTML({ HTMLAttributes: e }) {
535
538
  return ["div", k(this.options.HTMLAttributes, e), 0];
536
539
  }
537
- }), Et = {
540
+ }), Rt = {
538
541
  compatConfig: { MODE: 3 },
539
542
  name: "MentionComponent",
540
543
  components: {
@@ -548,8 +551,8 @@ const kt = {
548
551
  }
549
552
  }
550
553
  };
551
- function St(e, t, o, n, i, r) {
552
- const s = l("dt-link"), a = l("node-view-wrapper");
554
+ function Lt(e, t, o, n, i, r) {
555
+ const s = d("dt-link"), a = d("node-view-wrapper");
553
556
  return c(), m(a, { class: "d-d-inline-block" }, {
554
557
  default: u(() => [
555
558
  f(s, { kind: "mention" }, {
@@ -562,9 +565,9 @@ function St(e, t, o, n, i, r) {
562
565
  _: 1
563
566
  });
564
567
  }
565
- const Tt = /* @__PURE__ */ p(Et, [["render", St]]), Rt = H.extend({
568
+ const $t = /* @__PURE__ */ p(Rt, [["render", Lt]]), vt = H.extend({
566
569
  addNodeView() {
567
- return $(Tt);
570
+ return $($t);
568
571
  },
569
572
  parseHTML() {
570
573
  return [
@@ -597,7 +600,7 @@ const Tt = /* @__PURE__ */ p(Et, [["render", St]]), Rt = H.extend({
597
600
  char: "@",
598
601
  pluginKey: new C("mentionSuggestion")
599
602
  }
600
- }), Lt = {
603
+ }), It = {
601
604
  compatConfig: { MODE: 3 },
602
605
  name: "ChannelComponent",
603
606
  components: {
@@ -611,8 +614,8 @@ const Tt = /* @__PURE__ */ p(Et, [["render", St]]), Rt = H.extend({
611
614
  }
612
615
  }
613
616
  };
614
- function $t(e, t, o, n, i, r) {
615
- const s = l("dt-link"), a = l("node-view-wrapper");
617
+ function Mt(e, t, o, n, i, r) {
618
+ const s = d("dt-link"), a = d("node-view-wrapper");
616
619
  return c(), m(a, { class: "d-d-inline-block" }, {
617
620
  default: u(() => [
618
621
  f(s, { kind: "mention" }, {
@@ -625,10 +628,10 @@ function $t(e, t, o, n, i, r) {
625
628
  _: 1
626
629
  });
627
630
  }
628
- const vt = /* @__PURE__ */ p(Lt, [["render", $t]]), It = H.extend({
631
+ const Ot = /* @__PURE__ */ p(It, [["render", Mt]]), At = H.extend({
629
632
  name: "channel",
630
633
  addNodeView() {
631
- return $(vt);
634
+ return $(Ot);
632
635
  },
633
636
  parseHTML() {
634
637
  return [
@@ -661,7 +664,7 @@ const vt = /* @__PURE__ */ p(Lt, [["render", $t]]), It = H.extend({
661
664
  char: "#",
662
665
  pluginKey: new C("channelSuggestion")
663
666
  }
664
- }), Mt = {
667
+ }), jt = {
665
668
  compatConfig: { MODE: 3 },
666
669
  name: "SlashCommandsComponent",
667
670
  components: {
@@ -678,8 +681,8 @@ const vt = /* @__PURE__ */ p(Lt, [["render", $t]]), It = H.extend({
678
681
  this.$parent.$emit("selected-command", this.$props.node.attrs.command);
679
682
  }
680
683
  };
681
- function Ot(e, t, o, n, i, r) {
682
- const s = l("node-view-wrapper");
684
+ function Bt(e, t, o, n, i, r) {
685
+ const s = d("node-view-wrapper");
683
686
  return c(), m(s, { class: "d-d-inline-block" }, {
684
687
  default: u(() => [
685
688
  w(g(r.text), 1)
@@ -687,19 +690,19 @@ function Ot(e, t, o, n, i, r) {
687
690
  _: 1
688
691
  });
689
692
  }
690
- const At = /* @__PURE__ */ p(Mt, [["render", Ot]]), jt = (e, t) => [...e.matchAll(t)].map((n) => {
693
+ const Dt = /* @__PURE__ */ p(jt, [["render", Bt]]), Pt = (e, t) => [...e.matchAll(t)].map((n) => {
691
694
  let i = n[2];
692
695
  return i.endsWith(" ") || (i += " "), {
693
696
  index: n.index,
694
697
  text: i,
695
698
  match: n
696
699
  };
697
- }), Dt = H.extend({
700
+ }), Ht = H.extend({
698
701
  name: "slash-commands",
699
702
  group: "inline",
700
703
  inline: !0,
701
704
  addNodeView() {
702
- return $(At);
705
+ return $(Dt);
703
706
  },
704
707
  parseHTML() {
705
708
  return [
@@ -744,8 +747,8 @@ const At = /* @__PURE__ */ p(Mt, [["render", Ot]]), jt = (e, t) => [...e.matchAl
744
747
  var o;
745
748
  const e = (o = this.options.suggestion) == null ? void 0 : o.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
746
749
  return [
747
- D({
748
- find: (n) => jt(n, t),
750
+ B({
751
+ find: (n) => Pt(n, t),
749
752
  type: this.type,
750
753
  getAttributes(n) {
751
754
  return { command: n[0].trim() };
@@ -758,11 +761,11 @@ const At = /* @__PURE__ */ p(Mt, [["render", Ot]]), jt = (e, t) => [...e.matchAl
758
761
  char: "/",
759
762
  pluginKey: new C("slashCommandSuggestion")
760
763
  }
761
- }), Bt = {
764
+ }), Vt = {
762
765
  compatConfig: { MODE: 3 },
763
766
  name: "MentionSuggestion",
764
767
  components: {
765
- DtAvatar: Fe,
768
+ DtAvatar: Je,
766
769
  DtStack: I
767
770
  },
768
771
  props: {
@@ -779,9 +782,9 @@ const At = /* @__PURE__ */ p(Mt, [["render", Ot]]), jt = (e, t) => [...e.matchAl
779
782
  return this.item.avatarSrc;
780
783
  }
781
784
  }
782
- }, Pt = { class: "d-mention-suggestion__name" };
783
- function Ht(e, t, o, n, i, r) {
784
- const s = l("dt-avatar"), a = l("dt-stack");
785
+ }, Ft = { class: "d-mention-suggestion__name" };
786
+ function Kt(e, t, o, n, i, r) {
787
+ const s = d("dt-avatar"), a = d("dt-stack");
785
788
  return c(), m(a, {
786
789
  direction: "row",
787
790
  gap: "400"
@@ -793,12 +796,12 @@ function Ht(e, t, o, n, i, r) {
793
796
  "image-alt": r.name,
794
797
  size: "xs"
795
798
  }, null, 8, ["full-name", "image-src", "image-alt"]),
796
- y("span", Pt, g(r.name), 1)
799
+ y("span", Ft, g(r.name), 1)
797
800
  ]),
798
801
  _: 1
799
802
  });
800
803
  }
801
- const Vt = /* @__PURE__ */ p(Bt, [["render", Ht]]), Kt = {
804
+ const qt = /* @__PURE__ */ p(Vt, [["render", Kt]]), Nt = {
802
805
  // This function comes from the user and passed to the editor directly.
803
806
  // This will also activate the mention plugin on the editor
804
807
  // items: ({ query }) => { return [] },
@@ -809,7 +812,7 @@ const Vt = /* @__PURE__ */ p(Bt, [["render", Ht]]), Kt = {
809
812
  onStart: (n) => {
810
813
  e = new L(O, {
811
814
  props: {
812
- itemComponent: v(Vt),
815
+ itemComponent: v(qt),
813
816
  itemType: "mention",
814
817
  ...n
815
818
  },
@@ -847,13 +850,13 @@ const Vt = /* @__PURE__ */ p(Bt, [["render", Ht]]), Kt = {
847
850
  }
848
851
  };
849
852
  }
850
- }, qt = {
853
+ }, Ut = {
851
854
  compatConfig: { MODE: 3 },
852
855
  name: "ChannelSuggestion",
853
856
  components: {
854
857
  DtStack: I,
855
- DtIconHash: We,
856
- DtIconLock: Xe
858
+ DtIconHash: Ye,
859
+ DtIconLock: Ge
857
860
  },
858
861
  props: {
859
862
  item: {
@@ -867,9 +870,9 @@ const Vt = /* @__PURE__ */ p(Bt, [["render", Ht]]), Kt = {
867
870
  }
868
871
  }
869
872
  };
870
- function Nt(e, t, o, n, i, r) {
871
- const s = l("dt-icon-hash"), a = l("dt-icon-lock"), d = l("dt-stack");
872
- return c(), m(d, {
873
+ function zt(e, t, o, n, i, r) {
874
+ const s = d("dt-icon-hash"), a = d("dt-icon-lock"), l = d("dt-stack");
875
+ return c(), m(l, {
873
876
  direction: "row",
874
877
  gap: "400"
875
878
  }, {
@@ -886,7 +889,7 @@ function Nt(e, t, o, n, i, r) {
886
889
  _: 1
887
890
  });
888
891
  }
889
- const Ut = /* @__PURE__ */ p(qt, [["render", Nt]]), zt = {
892
+ const Wt = /* @__PURE__ */ p(Ut, [["render", zt]]), Xt = {
890
893
  // This function comes from the user and passed to the editor directly.
891
894
  // This will also activate the mention plugin on the editor
892
895
  // items: ({ query }) => { return [] },
@@ -897,7 +900,7 @@ const Ut = /* @__PURE__ */ p(qt, [["render", Nt]]), zt = {
897
900
  onStart: (n) => {
898
901
  e = new L(O, {
899
902
  props: {
900
- itemComponent: v(Ut),
903
+ itemComponent: v(Wt),
901
904
  itemType: "channel",
902
905
  ...n
903
906
  },
@@ -935,7 +938,7 @@ const Ut = /* @__PURE__ */ p(qt, [["render", Nt]]), zt = {
935
938
  }
936
939
  };
937
940
  }
938
- }, Ft = {
941
+ }, Jt = {
939
942
  compatConfig: { MODE: 3 },
940
943
  name: "SlashCommandSuggestion",
941
944
  props: {
@@ -955,17 +958,17 @@ const Ut = /* @__PURE__ */ p(qt, [["render", Nt]]), zt = {
955
958
  return this.item.parametersExample;
956
959
  }
957
960
  }
958
- }, Wt = { class: "d-body--md-compact" }, Xt = { key: 0 }, Jt = { class: "d-body--sm d-fc-tertiary" };
959
- function Yt(e, t, o, n, i, r) {
961
+ }, Yt = { class: "d-body--md-compact" }, Gt = { key: 0 }, Qt = { class: "d-body--sm d-fc-tertiary" };
962
+ function Zt(e, t, o, n, i, r) {
960
963
  return c(), x("div", null, [
961
- y("div", Wt, [
964
+ y("div", Yt, [
962
965
  y("span", null, "/" + g(r.command), 1),
963
- r.parametersExample ? (c(), x("span", Xt, g(r.parametersExample), 1)) : F("", !0)
966
+ r.parametersExample ? (c(), x("span", Gt, g(r.parametersExample), 1)) : z("", !0)
964
967
  ]),
965
- y("div", Jt, g(r.description), 1)
968
+ y("div", Qt, g(r.description), 1)
966
969
  ]);
967
970
  }
968
- const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
971
+ const en = /* @__PURE__ */ p(Jt, [["render", Zt]]), tn = {
969
972
  // This function comes from the user and passed to the editor directly.
970
973
  // This will also activate the mention plugin on the editor
971
974
  // items: ({ query }) => { return [] },
@@ -978,7 +981,7 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
978
981
  e = new L(O, {
979
982
  parent: void 0,
980
983
  props: {
981
- itemComponent: v(Gt),
984
+ itemComponent: v(en),
982
985
  itemType: "slash-command",
983
986
  ...n
984
987
  },
@@ -1016,13 +1019,13 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1016
1019
  }
1017
1020
  };
1018
1021
  }
1019
- }, Zt = {
1022
+ }, nn = {
1020
1023
  compatConfig: { MODE: 3 },
1021
1024
  name: "DtRichTextEditor",
1022
1025
  components: {
1023
1026
  EditorContent: Y,
1024
1027
  BubbleMenu: G,
1025
- DtButton: Ye,
1028
+ DtButton: Ze,
1026
1029
  DtStack: I
1027
1030
  },
1028
1031
  props: {
@@ -1087,7 +1090,7 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1087
1090
  type: [Boolean, String, Number],
1088
1091
  default: !1,
1089
1092
  validator(e) {
1090
- return typeof e == "string" ? Ue.includes(e) : !0;
1093
+ return typeof e == "string" ? We.includes(e) : !0;
1091
1094
  }
1092
1095
  },
1093
1096
  /**
@@ -1100,7 +1103,7 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1100
1103
  type: String,
1101
1104
  default: "html",
1102
1105
  validator(e) {
1103
- return ze.includes(e);
1106
+ return Xe.includes(e);
1104
1107
  }
1105
1108
  },
1106
1109
  /**
@@ -1245,6 +1248,20 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1245
1248
  type: Boolean,
1246
1249
  default: !1
1247
1250
  },
1251
+ /**
1252
+ * Whether the input allows color to be introduced in the text.
1253
+ */
1254
+ allowFontColor: {
1255
+ type: Boolean,
1256
+ default: !1
1257
+ },
1258
+ /**
1259
+ * Whether the input allows different font-families to be introduced in the text.
1260
+ */
1261
+ allowFontFamily: {
1262
+ type: Boolean,
1263
+ default: !1
1264
+ },
1248
1265
  /**
1249
1266
  * Additional TipTap extensions to be added to the editor.
1250
1267
  */
@@ -1360,7 +1377,7 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1360
1377
  // eslint-disable-next-line complexity
1361
1378
  extensions() {
1362
1379
  const e = [ue, xe, Ee, me];
1363
- e.push(this.useDivTags ? Ct : U), this.allowBlockquote && e.push(de), this.allowBold && e.push(fe), this.allowBulletList && (e.push(pe), e.push(ye.extend({
1380
+ e.push(this.useDivTags ? Tt : N), this.allowBlockquote && e.push(le), this.allowBold && e.push(fe), this.allowBulletList && (e.push(pe), e.push(ye.extend({
1364
1381
  renderText({ node: n }) {
1365
1382
  return n.textContent;
1366
1383
  }
@@ -1387,23 +1404,23 @@ const Gt = /* @__PURE__ */ p(Ft, [["render", Yt]]), Qt = {
1387
1404
  },
1388
1405
  openOnClick: !1,
1389
1406
  autolink: !0,
1390
- protocols: K
1391
- })), this.customLink && e.push(this.getExtension(bt, this.customLink)), this.mentionSuggestion) {
1392
- const n = { ...this.mentionSuggestion, ...Kt };
1393
- e.push(Rt.configure({ suggestion: n }));
1407
+ protocols: F
1408
+ })), this.customLink && e.push(this.getExtension(Et, this.customLink)), this.mentionSuggestion) {
1409
+ const n = { ...this.mentionSuggestion, ...Nt };
1410
+ e.push(vt.configure({ suggestion: n }));
1394
1411
  }
1395
1412
  if (this.channelSuggestion) {
1396
- const n = { ...this.channelSuggestion, ...zt };
1397
- e.push(It.configure({ suggestion: n }));
1413
+ const n = { ...this.channelSuggestion, ...Xt };
1414
+ e.push(At.configure({ suggestion: n }));
1398
1415
  }
1399
1416
  if (this.slashCommandSuggestion) {
1400
- const n = { ...this.slashCommandSuggestion, ...Qt };
1401
- e.push(Dt.configure({ suggestion: n }));
1417
+ const n = { ...this.slashCommandSuggestion, ...tn };
1418
+ e.push(Ht.configure({ suggestion: n }));
1402
1419
  }
1403
- return e.push(ht), e.push(Ce.configure({
1420
+ return e.push(gt), e.push(Ce.configure({
1404
1421
  types: ["paragraph"],
1405
1422
  defaultAlignment: "left"
1406
- })), this.allowCode && e.push(ce), this.allowCodeblock && e.push(le.extend({
1423
+ })), this.allowCode && e.push(ce), this.allowCodeblock && e.push(de.extend({
1407
1424
  renderText({ node: n }) {
1408
1425
  return `\`\`\`
1409
1426
  ${n.textContent}
@@ -1413,7 +1430,7 @@ ${n.textContent}
1413
1430
  HTMLAttributes: {
1414
1431
  class: "d-rich-text-editor__code-block"
1415
1432
  }
1416
- })), this.allowInlineImages && e.push(xt), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
1433
+ })), this.allowInlineImages && e.push(St), (this.allowFontFamily || this.allowFontColor) && (e.push(Se), this.allowFontColor && e.push(Te), this.allowFontFamily && e.push(Re)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
1417
1434
  },
1418
1435
  inputAttrs() {
1419
1436
  const e = {
@@ -1453,7 +1470,7 @@ ${n.textContent}
1453
1470
  this.destroyEditor();
1454
1471
  },
1455
1472
  mounted() {
1456
- qe(V(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1473
+ Ue(V(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1457
1474
  },
1458
1475
  methods: {
1459
1476
  createEditor() {
@@ -1497,9 +1514,9 @@ ${n.textContent}
1497
1514
  * @param editor the editor instance.
1498
1515
  */
1499
1516
  getSelectedLinkText(e) {
1500
- var a, d, h;
1517
+ var a, l, h;
1501
1518
  const { view: t, state: o } = e, { from: n, to: i } = t.state.selection, r = o.doc.textBetween(n, i, ""), s = this.editor.state.doc.nodeAt(n);
1502
- return s && ((h = (d = (a = s.marks) == null ? void 0 : a.at(0)) == null ? void 0 : d.type) == null ? void 0 : h.name) === "link" ? s.textContent : r;
1519
+ return s && ((h = (l = (a = s.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : h.name) === "link" ? s.textContent : r;
1503
1520
  },
1504
1521
  editLink() {
1505
1522
  const e = this.getSelectedLinkText(this.editor), t = {
@@ -1519,22 +1536,22 @@ ${n.textContent}
1519
1536
  window.open(e, "_blank");
1520
1537
  },
1521
1538
  // eslint-disable-next-line complexity
1522
- setLink(e, t, o, n = K, i) {
1523
- var a, d, h;
1539
+ setLink(e, t, o, n = F, i) {
1540
+ var a, l, h;
1524
1541
  if (!e) {
1525
1542
  this.removeLink();
1526
1543
  return;
1527
1544
  }
1528
1545
  n.find((_) => _.test(e)) || (e = `${i}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1529
- const s = (h = (d = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : d.state) == null ? void 0 : h.selection;
1546
+ const s = (h = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : h.selection;
1530
1547
  this.editor.chain().focus().insertContent(t).setTextSelection({ from: s.from, to: s.from + t.length }).setLink({ href: e, class: o.class }).run();
1531
1548
  },
1532
1549
  // eslint-disable-next-line complexity
1533
1550
  processValue(e, t = !0) {
1534
1551
  const o = this.getOutput();
1535
- if (!(t && Je(e, o))) {
1552
+ if (!(t && Qe(e, o))) {
1536
1553
  if (typeof e == "string" && this.outputFormat === "text") {
1537
- const n = new RegExp(`(${z})`, "g");
1554
+ const n = new RegExp(`(${U})`, "g");
1538
1555
  e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
1539
1556
  }
1540
1557
  this.editor.commands.setContent(e, !1);
@@ -1607,11 +1624,11 @@ ${n.textContent}
1607
1624
  this.editor.commands.focus();
1608
1625
  }
1609
1626
  }
1610
- }, en = { class: "d-popover__dialog" };
1611
- function tn(e, t, o, n, i, r) {
1612
- const s = l("dt-button"), a = l("dt-stack"), d = l("bubble-menu"), h = l("editor-content");
1627
+ }, on = { class: "d-popover__dialog" };
1628
+ function rn(e, t, o, n, i, r) {
1629
+ const s = d("dt-button"), a = d("dt-stack"), l = d("bubble-menu"), h = d("editor-content");
1613
1630
  return c(), x("div", null, [
1614
- i.editor && o.link && !o.hideLinkBubbleMenu ? (c(), m(d, {
1631
+ i.editor && o.link && !o.hideLinkBubbleMenu ? (c(), m(l, {
1615
1632
  key: 0,
1616
1633
  editor: i.editor,
1617
1634
  "should-show": r.bubbleMenuShouldShow,
@@ -1619,7 +1636,7 @@ function tn(e, t, o, n, i, r) {
1619
1636
  style: { visibility: "visible" }
1620
1637
  }, {
1621
1638
  default: u(() => [
1622
- y("div", en, [
1639
+ y("div", on, [
1623
1640
  f(a, {
1624
1641
  direction: "row",
1625
1642
  class: "d-rich-text-editor-bubble-menu__button-stack",
@@ -1662,8 +1679,8 @@ function tn(e, t, o, n, i, r) {
1662
1679
  ])
1663
1680
  ]),
1664
1681
  _: 1
1665
- }, 8, ["editor", "should-show", "tippy-options"])) : F("", !0),
1666
- f(h, Ae({
1682
+ }, 8, ["editor", "should-show", "tippy-options"])) : z("", !0),
1683
+ f(h, De({
1667
1684
  ref: "editor",
1668
1685
  editor: i.editor,
1669
1686
  class: "d-rich-text-editor",
@@ -1671,8 +1688,8 @@ function tn(e, t, o, n, i, r) {
1671
1688
  }, r.attrs), null, 16, ["editor"])
1672
1689
  ]);
1673
1690
  }
1674
- const Un = /* @__PURE__ */ p(Zt, [["render", tn]]);
1691
+ const Yn = /* @__PURE__ */ p(nn, [["render", rn]]);
1675
1692
  export {
1676
- Un as default
1693
+ Yn as default
1677
1694
  };
1678
1695
  //# sourceMappingURL=rich-text-editor.js.map