@dialpad/dialtone 9.125.0 → 9.126.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 (118) hide show
  1. package/dist/css/dialtone-default-theme.css +4 -0
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone.css +4 -0
  4. package/dist/css/dialtone.min.css +1 -1
  5. package/dist/tokens/doc.json +23474 -23474
  6. package/dist/vue2/component-documentation.json +1 -1
  7. package/dist/vue2/dialtone-vue.cjs +1 -1
  8. package/dist/vue2/dialtone-vue.js +227 -225
  9. package/dist/vue2/dialtone-vue.js.map +1 -1
  10. package/dist/vue2/lib/button/button.cjs +1 -1
  11. package/dist/vue2/lib/button/button.cjs.map +1 -1
  12. package/dist/vue2/lib/button/button.js +7 -7
  13. package/dist/vue2/lib/button/button.js.map +1 -1
  14. package/dist/vue2/lib/list-item/list-item.cjs +1 -1
  15. package/dist/vue2/lib/list-item/list-item.cjs.map +1 -1
  16. package/dist/vue2/lib/list-item/list-item.js +21 -11
  17. package/dist/vue2/lib/list-item/list-item.js.map +1 -1
  18. package/dist/vue2/lib/loader/index.cjs +2 -0
  19. package/dist/vue2/lib/loader/index.cjs.map +1 -0
  20. package/dist/vue2/lib/loader/index.js +5 -0
  21. package/dist/vue2/lib/loader/index.js.map +1 -0
  22. package/dist/vue2/lib/loader/loader.cjs +2 -0
  23. package/dist/vue2/lib/loader/loader.cjs.map +1 -0
  24. package/dist/vue2/lib/loader/loader.js +48 -0
  25. package/dist/vue2/lib/loader/loader.js.map +1 -0
  26. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +8 -4
  27. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  28. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +414 -356
  29. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  30. package/dist/vue2/localization/de-DE.cjs +169 -0
  31. package/dist/vue2/localization/de-DE.cjs.map +1 -0
  32. package/dist/vue2/localization/de-DE.js +172 -0
  33. package/dist/vue2/localization/de-DE.js.map +1 -0
  34. package/dist/vue2/localization/en-US.cjs +1 -1
  35. package/dist/vue2/localization/en-US.cjs.map +1 -1
  36. package/dist/vue2/localization/en-US.js +1 -1
  37. package/dist/vue2/localization/en-US.js.map +1 -1
  38. package/dist/vue2/localization/es-LA.cjs +2 -2
  39. package/dist/vue2/localization/es-LA.cjs.map +1 -1
  40. package/dist/vue2/localization/es-LA.js +2 -2
  41. package/dist/vue2/localization/es-LA.js.map +1 -1
  42. package/dist/vue2/localization/fr-FR.cjs +169 -0
  43. package/dist/vue2/localization/fr-FR.cjs.map +1 -0
  44. package/dist/vue2/localization/fr-FR.js +172 -0
  45. package/dist/vue2/localization/fr-FR.js.map +1 -0
  46. package/dist/vue2/localization/index.cjs +1 -1175
  47. package/dist/vue2/localization/index.cjs.map +1 -1
  48. package/dist/vue2/localization/index.js +46 -1211
  49. package/dist/vue2/localization/index.js.map +1 -1
  50. package/dist/vue2/localization/it-IT.cjs +169 -0
  51. package/dist/vue2/localization/it-IT.cjs.map +1 -0
  52. package/dist/vue2/localization/it-IT.js +172 -0
  53. package/dist/vue2/localization/it-IT.js.map +1 -0
  54. package/dist/vue2/localization/ja-JP.cjs +148 -0
  55. package/dist/vue2/localization/ja-JP.cjs.map +1 -0
  56. package/dist/vue2/localization/ja-JP.js +151 -0
  57. package/dist/vue2/localization/ja-JP.js.map +1 -0
  58. package/dist/vue2/localization/nl-NL.cjs +169 -0
  59. package/dist/vue2/localization/nl-NL.cjs.map +1 -0
  60. package/dist/vue2/localization/nl-NL.js +172 -0
  61. package/dist/vue2/localization/nl-NL.js.map +1 -0
  62. package/dist/vue2/localization/pt-BR.cjs +169 -0
  63. package/dist/vue2/localization/pt-BR.cjs.map +1 -0
  64. package/dist/vue2/localization/pt-BR.js +172 -0
  65. package/dist/vue2/localization/pt-BR.js.map +1 -0
  66. package/dist/vue2/localization/ru-RU.cjs +179 -0
  67. package/dist/vue2/localization/ru-RU.cjs.map +1 -0
  68. package/dist/vue2/localization/ru-RU.js +182 -0
  69. package/dist/vue2/localization/ru-RU.js.map +1 -0
  70. package/dist/vue2/localization/zh-CN.cjs +164 -0
  71. package/dist/vue2/localization/zh-CN.cjs.map +1 -0
  72. package/dist/vue2/localization/zh-CN.js +167 -0
  73. package/dist/vue2/localization/zh-CN.js.map +1 -0
  74. package/dist/vue2/types/components/list_item/list_item.vue.d.ts +9 -0
  75. package/dist/vue2/types/components/list_item/list_item.vue.d.ts.map +1 -1
  76. package/dist/vue2/types/components/loader/index.d.ts +2 -0
  77. package/dist/vue2/types/components/loader/index.d.ts.map +1 -0
  78. package/dist/vue2/types/components/loader/loader.vue.d.ts +32 -0
  79. package/dist/vue2/types/components/loader/loader.vue.d.ts.map +1 -0
  80. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +10 -0
  81. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  82. package/dist/vue2/types/index.d.ts +1 -0
  83. package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +1 -1
  84. package/dist/vue3/component-documentation.json +1 -1
  85. package/dist/vue3/dialtone-vue.cjs +1 -1
  86. package/dist/vue3/dialtone-vue.js +208 -206
  87. package/dist/vue3/dialtone-vue.js.map +1 -1
  88. package/dist/vue3/lib/list-item/list-item.cjs +1 -1
  89. package/dist/vue3/lib/list-item/list-item.cjs.map +1 -1
  90. package/dist/vue3/lib/list-item/list-item.js +35 -30
  91. package/dist/vue3/lib/list-item/list-item.js.map +1 -1
  92. package/dist/vue3/lib/loader/index.cjs +2 -0
  93. package/dist/vue3/lib/loader/index.cjs.map +1 -0
  94. package/dist/vue3/lib/loader/index.js +5 -0
  95. package/dist/vue3/lib/loader/index.js.map +1 -0
  96. package/dist/vue3/lib/loader/loader.cjs +2 -0
  97. package/dist/vue3/lib/loader/loader.cjs.map +1 -0
  98. package/dist/vue3/lib/loader/loader.js +48 -0
  99. package/dist/vue3/lib/loader/loader.js.map +1 -0
  100. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  101. package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
  102. package/dist/vue3/lib/message-input/message-input.js +2 -1
  103. package/dist/vue3/lib/message-input/message-input.js.map +1 -1
  104. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +8 -4
  105. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  106. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +301 -235
  107. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  108. package/dist/vue3/types/components/list_item/list_item.vue.d.ts +10 -2
  109. package/dist/vue3/types/components/loader/index.d.ts +2 -0
  110. package/dist/vue3/types/components/loader/index.d.ts.map +1 -0
  111. package/dist/vue3/types/components/loader/loader.vue.d.ts +26 -0
  112. package/dist/vue3/types/components/loader/loader.vue.d.ts.map +1 -0
  113. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +19 -0
  114. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  115. package/dist/vue3/types/components/toggle/toggle.vue.d.ts +1 -1
  116. package/dist/vue3/types/index.d.ts +1 -0
  117. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  118. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- import { NodeViewWrapper as R, nodeViewProps as L, VueRenderer as v, VueNodeViewRenderer as $, EditorContent as G, BubbleMenu as Q, Editor as Z } from "../../node_modules/@tiptap/vue-3.js";
2
- import { Node as ee, mergeAttributes as x, InputRule as te, nodePasteRule as B, getMarksBetween as ne, combineTransactionSteps as oe, getChangedRanges as ie, findChildrenInRange as re, Mark as se, nodeInputRule as ae, Extension as le } from "@tiptap/core";
1
+ import { NodeViewWrapper as L, nodeViewProps as v, VueRenderer as R, VueNodeViewRenderer as $, EditorContent as G, BubbleMenu as Q, Editor as Z } from "../../node_modules/@tiptap/vue-3.js";
2
+ import { Node as ee, mergeAttributes as b, InputRule as te, nodePasteRule as D, getMarksBetween as ne, combineTransactionSteps as oe, getChangedRanges as re, findChildrenInRange as ie, Mark as se, nodeInputRule as ae, Extension as le } from "@tiptap/core";
3
3
  import ce from "@tiptap/extension-blockquote";
4
4
  import de from "@tiptap/extension-code-block";
5
5
  import ue from "@tiptap/extension-code";
@@ -10,33 +10,33 @@ import fe from "@tiptap/extension-placeholder";
10
10
  import pe from "@tiptap/extension-bold";
11
11
  import ge from "@tiptap/extension-bullet-list";
12
12
  import _e from "@tiptap/extension-italic";
13
- import we from "@tiptap/extension-link";
14
- import ye from "@tiptap/extension-list-item";
13
+ import ye from "@tiptap/extension-link";
14
+ import we from "@tiptap/extension-list-item";
15
15
  import ke from "@tiptap/extension-ordered-list";
16
- import be from "@tiptap/extension-strike";
17
- import xe from "@tiptap/extension-underline";
16
+ import xe from "@tiptap/extension-strike";
17
+ import be from "@tiptap/extension-underline";
18
18
  import Ce from "@tiptap/extension-text";
19
- import Ee from "@tiptap/extension-text-align";
20
- import Se from "@tiptap/extension-history";
21
- import Te from "@tiptap/extension-text-style";
22
- import Re from "@tiptap/extension-color";
23
- import Le from "@tiptap/extension-font-family";
24
- import { PluginKey as E, Plugin as ve } from "@tiptap/pm/state";
19
+ import Te from "@tiptap/extension-text-align";
20
+ import Ee from "@tiptap/extension-history";
21
+ import Se from "@tiptap/extension-text-style";
22
+ import Le from "@tiptap/extension-color";
23
+ import ve from "@tiptap/extension-font-family";
24
+ import { PluginKey as T, Plugin as Re } from "@tiptap/pm/state";
25
25
  import $e from "@tiptap/suggestion";
26
- import { emojiPattern as z } from "regex-combined-emojis";
27
- import { resolveComponent as d, openBlock as l, createBlock as m, withCtx as u, createVNode as f, createElementBlock as _, withDirectives as Ie, createElementVNode as y, Fragment as Me, renderList as Oe, normalizeClass as W, withModifiers as Ae, resolveDynamicComponent as De, vShow as je, createTextVNode as k, toDisplayString as p, markRaw as I, createCommentVNode as b, mergeProps as Be } from "vue";
26
+ import { emojiPattern as W } from "regex-combined-emojis";
27
+ import { resolveComponent as d, openBlock as l, createBlock as m, withCtx as u, createVNode as f, createElementBlock as _, withDirectives as Me, createElementVNode as w, Fragment as Ie, renderList as Oe, normalizeClass as z, withModifiers as Pe, resolveDynamicComponent as Be, vShow as Ae, createTextVNode as k, toDisplayString as p, markRaw as M, createCommentVNode as x, mergeProps as De } from "vue";
28
28
  import { _ as g } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
29
29
  import X from "../emoji/emoji.js";
30
- import { stringToUnicode as Pe, codeToEmojiData as H, emojiRegex as He, emojiShortCodeRegex as Fe } from "../../common/emoji/index.js";
31
- import { emojisIndexed as Ve } from "@dialpad/dialtone-emojis";
32
- import Ke from "../list-item/list-item.js";
33
- import M from "../stack/stack.js";
30
+ import { stringToUnicode as je, codeToEmojiData as H, emojiRegex as He, emojiShortCodeRegex as Ne } from "../../common/emoji/index.js";
31
+ import { emojisIndexed as Fe } from "@dialpad/dialtone-emojis";
32
+ import Ve from "../list-item/list-item.js";
33
+ import I from "../stack/stack.js";
34
34
  import O from "tippy.js";
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";
37
- import F from "@tiptap/extension-mention";
35
+ import { linkRegex as qe, getPhoneNumberRegex as Ke, returnFirstEl as F, warnIfUnmounted as Ue } from "../../common/utils/index.js";
36
+ import We from "@tiptap/extension-image";
37
+ import N from "@tiptap/extension-mention";
38
38
  import J from "../link/link.js";
39
- import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as We, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as K } from "./rich-text-editor-constants.js";
39
+ import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as ze, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as V } from "./rich-text-editor-constants.js";
40
40
  import Je from "../avatar/avatar.js";
41
41
  import Ye from "@dialpad/dialtone-icons/vue3/hash";
42
42
  import Ge from "@dialpad/dialtone-icons/vue3/lock";
@@ -46,12 +46,12 @@ const et = {
46
46
  compatConfig: { MODE: 3 },
47
47
  name: "EmojiComponent",
48
48
  components: {
49
- NodeViewWrapper: R,
49
+ NodeViewWrapper: L,
50
50
  DtEmoji: X
51
51
  },
52
- props: L
52
+ props: v
53
53
  };
54
- function tt(e, t, o, n, i, r) {
54
+ function tt(e, t, o, n, r, i) {
55
55
  const s = d("dt-emoji"), a = d("node-view-wrapper");
56
56
  return l(), m(a, { class: "d-d-inline-block d-va-bottom d-lh0" }, {
57
57
  default: u(() => [
@@ -67,7 +67,7 @@ const nt = /* @__PURE__ */ g(et, [["render", tt]]), ot = {
67
67
  compatConfig: { MODE: 3 },
68
68
  name: "SuggestionList",
69
69
  components: {
70
- DtListItem: Ke
70
+ DtListItem: Ve
71
71
  },
72
72
  props: {
73
73
  items: {
@@ -136,40 +136,40 @@ const nt = /* @__PURE__ */ g(et, [["render", tt]]), ot = {
136
136
  }
137
137
  }
138
138
  }
139
- }, it = { class: "d-popover__dialog d-suggestion-list__container" }, rt = {
139
+ }, rt = { class: "d-popover__dialog d-suggestion-list__container" }, it = {
140
140
  ref: "suggestionList",
141
141
  class: "d-suggestion-list"
142
142
  };
143
- function st(e, t, o, n, i, r) {
143
+ function st(e, t, o, n, r, i) {
144
144
  const s = d("dt-list-item");
145
- return l(), _("div", it, [
146
- Ie(y("ul", rt, [
147
- (l(!0), _(Me, null, Oe(o.items, (a, c) => (l(), m(s, {
145
+ return l(), _("div", rt, [
146
+ Me(w("ul", it, [
147
+ (l(!0), _(Ie, null, Oe(o.items, (a, c) => (l(), m(s, {
148
148
  key: a.id,
149
- class: W([
149
+ class: z([
150
150
  "d-suggestion-list__item",
151
- { "d-list-item--highlighted": c === i.selectedIndex }
151
+ { "d-list-item--highlighted": c === r.selectedIndex }
152
152
  ]),
153
153
  "navigation-type": "arrow-keys",
154
- onClick: (h) => r.selectItem(c),
155
- onKeydown: Ae(r.onKeyDown, ["prevent"])
154
+ onClick: (h) => i.selectItem(c),
155
+ onKeydown: Pe(i.onKeyDown, ["prevent"])
156
156
  }, {
157
157
  default: u(() => [
158
- (l(), m(De(o.itemComponent), { item: a }, null, 8, ["item"]))
158
+ (l(), m(Be(o.itemComponent), { item: a }, null, 8, ["item"]))
159
159
  ]),
160
160
  _: 2
161
161
  }, 1032, ["class", "onClick", "onKeydown"]))), 128))
162
162
  ], 512), [
163
- [je, o.items.length]
163
+ [Ae, o.items.length]
164
164
  ])
165
165
  ]);
166
166
  }
167
- const A = /* @__PURE__ */ g(ot, [["render", st]]), at = {
167
+ const P = /* @__PURE__ */ g(ot, [["render", st]]), at = {
168
168
  compatConfig: { MODE: 3 },
169
169
  name: "EmojiSuggestion",
170
170
  components: {
171
171
  DtEmoji: X,
172
- DtStack: M
172
+ DtStack: I
173
173
  },
174
174
  props: {
175
175
  item: {
@@ -178,7 +178,7 @@ const A = /* @__PURE__ */ g(ot, [["render", st]]), at = {
178
178
  }
179
179
  }
180
180
  };
181
- function lt(e, t, o, n, i, r) {
181
+ function lt(e, t, o, n, r, i) {
182
182
  const s = d("dt-emoji"), a = d("dt-stack");
183
183
  return l(), m(a, {
184
184
  direction: "row",
@@ -194,7 +194,7 @@ function lt(e, t, o, n, i, r) {
194
194
  _: 1
195
195
  });
196
196
  }
197
- const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
197
+ const ct = /* @__PURE__ */ g(at, [["render", lt]]), B = {
198
198
  name: "hideOnEsc",
199
199
  defaultValue: !0,
200
200
  fn({ hide: e }) {
@@ -214,19 +214,19 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
214
214
  items: ({ query: e }) => {
215
215
  if (e.length < 2)
216
216
  return [];
217
- const t = Object.values(Ve);
217
+ const t = Object.values(Fe);
218
218
  return e = e.toLowerCase(), t.filter(
219
219
  (n) => [
220
220
  n.name,
221
221
  n.shortname.replaceAll(":", ""),
222
222
  ...n.keywords
223
- ].some((i) => i.startsWith(e))
223
+ ].some((r) => r.startsWith(e))
224
224
  ).splice(0, dt).map((n) => ({ code: n.shortname }));
225
225
  },
226
226
  command: ({ editor: e, range: t, props: o }) => {
227
- var r, s;
227
+ var i, s;
228
228
  const n = e.view.state.selection.$to.nodeAfter;
229
- ((r = n == null ? void 0 : n.text) == null ? void 0 : r.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
229
+ ((i = n == null ? void 0 : n.text) == null ? void 0 : i.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
230
230
  {
231
231
  type: "emoji",
232
232
  attrs: o
@@ -237,9 +237,9 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
237
237
  let e, t, o = !1;
238
238
  return {
239
239
  onStart: (n) => {
240
- e = new v(A, {
240
+ e = new R(P, {
241
241
  props: {
242
- itemComponent: I(ct),
242
+ itemComponent: M(ct),
243
243
  itemType: "emoji",
244
244
  ...n
245
245
  },
@@ -259,7 +259,7 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
259
259
  trigger: "manual",
260
260
  placement: "top-start",
261
261
  zIndex: 650,
262
- plugins: [D]
262
+ plugins: [B]
263
263
  }), n.items.length > 0 && (t == null || t[0].show()));
264
264
  },
265
265
  onUpdate(n) {
@@ -268,19 +268,19 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
268
268
  });
269
269
  },
270
270
  onKeyDown(n) {
271
- var i;
271
+ var r;
272
272
  if (o)
273
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
273
+ return (r = e == null ? void 0 : e.ref) == null ? void 0 : r.onKeyDown(n);
274
274
  },
275
275
  onExit() {
276
276
  t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
277
277
  }
278
278
  };
279
279
  }
280
- }, mt = /(:\w+:)$/, ht = new RegExp(z + "$"), ft = (e) => {
280
+ }, mt = /(:\w+:)$/, ht = new RegExp(W + "$"), ft = (e) => {
281
281
  if (e && H(e[0]))
282
282
  return { text: e[2] || e[0] };
283
- }, pt = (e) => [...e.matchAll(Fe)].filter((o) => H(o[0])).map((o) => ({
283
+ }, pt = (e) => [...e.matchAll(Ne)].filter((o) => H(o[0])).map((o) => ({
284
284
  index: o.index,
285
285
  text: o[0],
286
286
  match: o
@@ -313,10 +313,10 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
313
313
  ];
314
314
  },
315
315
  renderText({ node: e }) {
316
- return Pe(H(e.attrs.code).unicode_output);
316
+ return je(H(e.attrs.code).unicode_output);
317
317
  },
318
318
  renderHTML({ HTMLAttributes: e }) {
319
- return ["emoji-component", x(this.options.HTMLAttributes, e)];
319
+ return ["emoji-component", b(this.options.HTMLAttributes, e)];
320
320
  },
321
321
  addInputRules() {
322
322
  return [
@@ -326,7 +326,7 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
326
326
  if (t)
327
327
  return ft(t);
328
328
  },
329
- handler: ({ state: e, range: t, match: o, commands: n, chain: i, can: r }) => {
329
+ handler: ({ state: e, range: t, match: o, commands: n, chain: r, can: i }) => {
330
330
  const { tr: s } = e, a = t.from, c = t.to;
331
331
  s.replaceWith(a, c, this.type.create({ code: o[0] }));
332
332
  }
@@ -335,7 +335,7 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
335
335
  },
336
336
  addPasteRules() {
337
337
  return [
338
- B({
338
+ D({
339
339
  find: pt,
340
340
  type: this.type,
341
341
  getAttributes(e) {
@@ -344,7 +344,7 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
344
344
  };
345
345
  }
346
346
  }),
347
- B({
347
+ D({
348
348
  find: He,
349
349
  type: this.type,
350
350
  getAttributes(e) {
@@ -359,7 +359,7 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
359
359
  return [
360
360
  $e({
361
361
  char: ":",
362
- pluginKey: new E("emoji"),
362
+ pluginKey: new T("emoji"),
363
363
  editor: this.editor,
364
364
  ...this.options.suggestion,
365
365
  ...ut
@@ -370,8 +370,8 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
370
370
  return {
371
371
  Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
372
372
  let o = !1;
373
- const { selection: n } = t, { empty: i, anchor: r } = n;
374
- return i ? (t.doc.nodesBetween(r - 1, r, (s, a) => {
373
+ const { selection: n } = t, { empty: r, anchor: i } = n;
374
+ return r ? (t.doc.nodesBetween(i - 1, i, (s, a) => {
375
375
  if (s.type.name === this.name)
376
376
  return o = !0, e.insertText("", a, a + s.nodeSize), !1;
377
377
  }), o) : !1;
@@ -382,15 +382,15 @@ const ct = /* @__PURE__ */ g(at, [["render", lt]]), D = {
382
382
  function _t(e, t, o = () => !0) {
383
383
  const n = [];
384
384
  t.lastIndex = 0;
385
- let i;
386
- for (; i = t.exec(e); )
387
- o(e, i) && n.push(i);
385
+ let r;
386
+ for (; r = t.exec(e); )
387
+ o(e, r) && n.push(r);
388
388
  return n;
389
389
  }
390
- function wt(e, t) {
390
+ function yt(e, t) {
391
391
  return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
392
392
  }
393
- function yt(e) {
393
+ function wt(e) {
394
394
  const t = new RegExp(
395
395
  "(?:" + [
396
396
  `[!?.,:;'"]`,
@@ -403,11 +403,11 @@ function yt(e) {
403
403
  function kt(e, t) {
404
404
  const o = e.slice(0, t + 1).search(/\S+\s*$/), n = e.slice(t).search(/\s/);
405
405
  if (n < 0) {
406
- const i = e.slice(o);
406
+ const r = e.slice(o);
407
407
  return {
408
- text: i,
408
+ text: r,
409
409
  from: o,
410
- to: o + i.length
410
+ to: o + r.length
411
411
  };
412
412
  }
413
413
  return {
@@ -416,65 +416,65 @@ function kt(e, t) {
416
416
  to: n + t
417
417
  };
418
418
  }
419
- function P(e, t, o, n) {
420
- const i = kt(e, t);
421
- if (n.lastIndex = 0, !n.test(i.text))
422
- return i;
423
- const r = o === "left" ? i.from - 1 : i.to + 1;
424
- return r <= 0 || r >= e.length || r === t ? i : P(e, r, o, n);
419
+ function j(e, t, o, n) {
420
+ const r = kt(e, t);
421
+ if (n.lastIndex = 0, !n.test(r.text))
422
+ return r;
423
+ const i = o === "left" ? r.from - 1 : r.to + 1;
424
+ return i <= 0 || i >= e.length || i === t ? r : j(e, i, o, n);
425
425
  }
426
- function bt(e, t, o, n) {
427
- const i = Math.max(e.from - 1, 0), r = Math.min(e.to + 1, t.content.size), s = ne(i, r, t);
426
+ function xt(e, t, o, n) {
427
+ const r = Math.max(e.from - 1, 0), i = Math.min(e.to + 1, t.content.size), s = ne(r, i, t);
428
428
  for (const a of s)
429
429
  a.mark.type === n && o.removeMark(a.from, a.to, n);
430
430
  }
431
- const q = Ne(1, 15);
432
- function N(e, t, o, n, i, r) {
431
+ const q = Ke(1, 15);
432
+ function K(e, t, o, n, r, i) {
433
433
  if (!e)
434
434
  return;
435
435
  let s = o - t - 1;
436
436
  s = s < 0 ? 0 : s;
437
- const a = n - t, c = P(
437
+ const a = n - t, c = j(
438
438
  e,
439
439
  s,
440
440
  "left",
441
441
  q
442
- ), h = P(
442
+ ), h = j(
443
443
  e,
444
444
  a,
445
445
  "right",
446
446
  q
447
- ), w = e.slice(c.from, h.to);
448
- _t(w, qe, wt).forEach((j) => {
449
- const C = yt(j[0]), T = t + c.from + j.index + 1, Y = T + C.length;
450
- i.addMark(T, Y, r.create());
447
+ ), y = e.slice(c.from, h.to);
448
+ _t(y, qe, yt).forEach((A) => {
449
+ const C = wt(A[0]), S = t + c.from + A.index + 1, Y = S + C.length;
450
+ r.addMark(S, Y, i.create());
451
451
  });
452
452
  }
453
- function xt(e) {
453
+ function bt(e) {
454
454
  let t = !1;
455
- return new ve({
456
- key: new E("autolink"),
457
- appendTransaction: (o, n, i) => {
458
- const r = o.some((w) => w.docChanged) && !n.doc.eq(i.doc);
459
- if (t && !r)
455
+ return new Re({
456
+ key: new T("autolink"),
457
+ appendTransaction: (o, n, r) => {
458
+ const i = o.some((y) => y.docChanged) && !n.doc.eq(r.doc);
459
+ if (t && !i)
460
460
  return;
461
- const { tr: s } = i, { textContent: a } = i.doc;
462
- t || N(a, 0, 0, a.length, s, e.type), t = !0;
461
+ const { tr: s } = r, { textContent: a } = r.doc;
462
+ t || K(a, 0, 0, a.length, s, e.type), t = !0;
463
463
  const c = oe(
464
464
  n.doc,
465
465
  [...o]
466
466
  );
467
- return ie(c).forEach(({ oldRange: w, newRange: S }) => {
468
- bt(S, i.doc, s, e.type), re(
469
- i.doc,
470
- S,
467
+ return re(c).forEach(({ oldRange: y, newRange: E }) => {
468
+ xt(E, r.doc, s, e.type), ie(
469
+ r.doc,
470
+ E,
471
471
  (C) => C.isTextblock
472
- ).forEach(({ node: C, pos: T }) => {
473
- N(
472
+ ).forEach(({ node: C, pos: S }) => {
473
+ K(
474
474
  C.textContent,
475
- T,
476
- w.from,
477
- S.to,
475
+ S,
476
+ y.from,
477
+ E.to,
478
478
  s,
479
479
  e.type
480
480
  );
@@ -486,12 +486,12 @@ function xt(e) {
486
486
  const Ct = {
487
487
  class: "d-link d-c-text d-d-inline-block d-wb-break-all",
488
488
  rel: "noopener noreferrer nofollow"
489
- }, Et = se.create({
489
+ }, Tt = se.create({
490
490
  name: "CustomLink",
491
491
  renderHTML({ HTMLAttributes: e }) {
492
492
  return [
493
493
  "a",
494
- x(
494
+ b(
495
495
  this.options.HTMLAttributes,
496
496
  e,
497
497
  Ct
@@ -503,10 +503,10 @@ const Ct = {
503
503
  },
504
504
  addProseMirrorPlugins() {
505
505
  return [
506
- xt({ type: this.type })
506
+ bt({ type: this.type })
507
507
  ];
508
508
  }
509
- }), St = ze.extend({
509
+ }), Et = We.extend({
510
510
  name: "ConfigurableImage",
511
511
  addAttributes() {
512
512
  return {
@@ -530,34 +530,34 @@ const Ct = {
530
530
  }
531
531
  };
532
532
  }
533
- }).configure({ inline: !0, allowBase64: !0 }), Tt = U.extend({
533
+ }).configure({ inline: !0, allowBase64: !0 }), St = U.extend({
534
534
  parseHTML() {
535
535
  return [{ tag: "div" }];
536
536
  },
537
537
  renderHTML({ HTMLAttributes: e }) {
538
- return ["div", x(this.options.HTMLAttributes, e), 0];
538
+ return ["div", b(this.options.HTMLAttributes, e), 0];
539
539
  }
540
- }), Rt = {
540
+ }), Lt = {
541
541
  compatConfig: { MODE: 3 },
542
542
  name: "MentionComponent",
543
543
  components: {
544
- NodeViewWrapper: R,
544
+ NodeViewWrapper: L,
545
545
  DtLink: J
546
546
  },
547
- props: L,
547
+ props: v,
548
548
  computed: {
549
549
  text() {
550
550
  return "@" + this.$props.node.attrs.name;
551
551
  }
552
552
  }
553
553
  };
554
- function Lt(e, t, o, n, i, r) {
554
+ function vt(e, t, o, n, r, i) {
555
555
  const s = d("dt-link"), a = d("node-view-wrapper");
556
556
  return l(), m(a, { class: "d-d-inline-block" }, {
557
557
  default: u(() => [
558
558
  f(s, { kind: "mention" }, {
559
559
  default: u(() => [
560
- k(p(r.text), 1)
560
+ k(p(i.text), 1)
561
561
  ]),
562
562
  _: 1
563
563
  })
@@ -565,9 +565,9 @@ function Lt(e, t, o, n, i, r) {
565
565
  _: 1
566
566
  });
567
567
  }
568
- const vt = /* @__PURE__ */ g(Rt, [["render", Lt]]), $t = F.extend({
568
+ const Rt = /* @__PURE__ */ g(Lt, [["render", vt]]), $t = N.extend({
569
569
  addNodeView() {
570
- return $(vt);
570
+ return $(Rt);
571
571
  },
572
572
  parseHTML() {
573
573
  return [
@@ -593,34 +593,34 @@ const vt = /* @__PURE__ */ g(Rt, [["render", Lt]]), $t = F.extend({
593
593
  return `@${e.attrs.id}`;
594
594
  },
595
595
  renderHTML({ HTMLAttributes: e }) {
596
- return ["mention-component", x(this.options.HTMLAttributes, e)];
596
+ return ["mention-component", b(this.options.HTMLAttributes, e)];
597
597
  }
598
598
  }).configure({
599
599
  suggestion: {
600
600
  char: "@",
601
- pluginKey: new E("mentionSuggestion")
601
+ pluginKey: new T("mentionSuggestion")
602
602
  }
603
- }), It = {
603
+ }), Mt = {
604
604
  compatConfig: { MODE: 3 },
605
605
  name: "ChannelComponent",
606
606
  components: {
607
- NodeViewWrapper: R,
607
+ NodeViewWrapper: L,
608
608
  DtLink: J
609
609
  },
610
- props: L,
610
+ props: v,
611
611
  computed: {
612
612
  text() {
613
613
  return "#" + this.$props.node.attrs.name;
614
614
  }
615
615
  }
616
616
  };
617
- function Mt(e, t, o, n, i, r) {
617
+ function It(e, t, o, n, r, i) {
618
618
  const s = d("dt-link"), a = d("node-view-wrapper");
619
619
  return l(), m(a, { class: "d-d-inline-block" }, {
620
620
  default: u(() => [
621
621
  f(s, { kind: "mention" }, {
622
622
  default: u(() => [
623
- k(p(r.text), 1)
623
+ k(p(i.text), 1)
624
624
  ]),
625
625
  _: 1
626
626
  })
@@ -628,7 +628,7 @@ function Mt(e, t, o, n, i, r) {
628
628
  _: 1
629
629
  });
630
630
  }
631
- const Ot = /* @__PURE__ */ g(It, [["render", Mt]]), At = F.extend({
631
+ const Ot = /* @__PURE__ */ g(Mt, [["render", It]]), Pt = N.extend({
632
632
  name: "channel",
633
633
  addNodeView() {
634
634
  return $(Ot);
@@ -657,20 +657,20 @@ const Ot = /* @__PURE__ */ g(It, [["render", Mt]]), At = F.extend({
657
657
  return `#${e.attrs.id}`;
658
658
  },
659
659
  renderHTML({ HTMLAttributes: e }) {
660
- return ["channel-component", x(this.options.HTMLAttributes, e)];
660
+ return ["channel-component", b(this.options.HTMLAttributes, e)];
661
661
  }
662
662
  }).configure({
663
663
  suggestion: {
664
664
  char: "#",
665
- pluginKey: new E("channelSuggestion")
665
+ pluginKey: new T("channelSuggestion")
666
666
  }
667
- }), Dt = {
667
+ }), Bt = {
668
668
  compatConfig: { MODE: 3 },
669
669
  name: "SlashCommandsComponent",
670
670
  components: {
671
- NodeViewWrapper: R
671
+ NodeViewWrapper: L
672
672
  },
673
- props: L,
673
+ props: v,
674
674
  emits: ["selected-command"],
675
675
  computed: {
676
676
  text() {
@@ -681,28 +681,28 @@ const Ot = /* @__PURE__ */ g(It, [["render", Mt]]), At = F.extend({
681
681
  this.$parent.$emit("selected-command", this.$props.node.attrs.command);
682
682
  }
683
683
  };
684
- function jt(e, t, o, n, i, r) {
684
+ function At(e, t, o, n, r, i) {
685
685
  const s = d("node-view-wrapper");
686
686
  return l(), m(s, { class: "d-d-inline-block" }, {
687
687
  default: u(() => [
688
- k(p(r.text), 1)
688
+ k(p(i.text), 1)
689
689
  ]),
690
690
  _: 1
691
691
  });
692
692
  }
693
- const Bt = /* @__PURE__ */ g(Dt, [["render", jt]]), Pt = (e, t) => [...e.matchAll(t)].map((n) => {
694
- let i = n[2];
695
- return i.endsWith(" ") || (i += " "), {
693
+ const Dt = /* @__PURE__ */ g(Bt, [["render", At]]), jt = (e, t) => [...e.matchAll(t)].map((n) => {
694
+ let r = n[2];
695
+ return r.endsWith(" ") || (r += " "), {
696
696
  index: n.index,
697
- text: i,
697
+ text: r,
698
698
  match: n
699
699
  };
700
- }), Ht = F.extend({
700
+ }), Ht = N.extend({
701
701
  name: "slash-commands",
702
702
  group: "inline",
703
703
  inline: !0,
704
704
  addNodeView() {
705
- return $(Bt);
705
+ return $(Dt);
706
706
  },
707
707
  parseHTML() {
708
708
  return [
@@ -728,7 +728,7 @@ const Bt = /* @__PURE__ */ g(Dt, [["render", jt]]), Pt = (e, t) => [...e.matchAl
728
728
  return `/${e.attrs.command}`;
729
729
  },
730
730
  renderHTML({ HTMLAttributes: e }) {
731
- return ["command-component", x(this.options.HTMLAttributes, e)];
731
+ return ["command-component", b(this.options.HTMLAttributes, e)];
732
732
  },
733
733
  addInputRules() {
734
734
  var o;
@@ -747,8 +747,8 @@ const Bt = /* @__PURE__ */ g(Dt, [["render", jt]]), Pt = (e, t) => [...e.matchAl
747
747
  var o;
748
748
  const e = (o = this.options.suggestion) == null ? void 0 : o.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
749
749
  return [
750
- B({
751
- find: (n) => Pt(n, t),
750
+ D({
751
+ find: (n) => jt(n, t),
752
752
  type: this.type,
753
753
  getAttributes(n) {
754
754
  return { command: n[0].trim() };
@@ -759,14 +759,14 @@ const Bt = /* @__PURE__ */ g(Dt, [["render", jt]]), Pt = (e, t) => [...e.matchAl
759
759
  }).configure({
760
760
  suggestion: {
761
761
  char: "/",
762
- pluginKey: new E("slashCommandSuggestion")
762
+ pluginKey: new T("slashCommandSuggestion")
763
763
  }
764
- }), Ft = {
764
+ }), Nt = {
765
765
  compatConfig: { MODE: 3 },
766
766
  name: "MentionSuggestion",
767
767
  components: {
768
768
  DtAvatar: Je,
769
- DtStack: M
769
+ DtStack: I
770
770
  },
771
771
  props: {
772
772
  item: {
@@ -802,14 +802,14 @@ const Bt = /* @__PURE__ */ g(Dt, [["render", jt]]), Pt = (e, t) => [...e.matchAl
802
802
  return this.item.showDetails;
803
803
  }
804
804
  }
805
- }, Vt = { class: "d-mention-suggestion__name" }, Kt = {
805
+ }, Ft = { class: "d-mention-suggestion__name" }, Vt = {
806
806
  key: 1,
807
807
  class: "d-mention-suggestion__divider"
808
808
  }, qt = {
809
809
  key: 2,
810
810
  class: "d-mention-suggestion__status"
811
811
  };
812
- function Nt(e, t, o, n, i, r) {
812
+ function Kt(e, t, o, n, r, i) {
813
813
  const s = d("dt-avatar"), a = d("dt-stack");
814
814
  return l(), m(a, {
815
815
  direction: "row",
@@ -818,11 +818,11 @@ function Nt(e, t, o, n, i, r) {
818
818
  }, {
819
819
  default: u(() => [
820
820
  f(s, {
821
- "full-name": r.name,
822
- "image-src": r.avatarSrc,
823
- "image-alt": r.name,
824
- "show-presence": r.showDetails,
825
- presence: r.presence,
821
+ "full-name": i.name,
822
+ "image-src": i.avatarSrc,
823
+ "image-alt": i.name,
824
+ "show-presence": i.showDetails,
825
+ presence: i.presence,
826
826
  size: "sm"
827
827
  }, null, 8, ["full-name", "image-src", "image-alt", "show-presence", "presence"]),
828
828
  f(a, {
@@ -830,23 +830,23 @@ function Nt(e, t, o, n, i, r) {
830
830
  gap: "100"
831
831
  }, {
832
832
  default: u(() => [
833
- y("span", Vt, p(r.name), 1),
834
- r.showDetails ? (l(), m(a, {
833
+ w("span", Ft, p(i.name), 1),
834
+ i.showDetails ? (l(), m(a, {
835
835
  key: 0,
836
836
  direction: "row",
837
837
  gap: "300",
838
838
  class: "d-label--sm-plain"
839
839
  }, {
840
840
  default: u(() => [
841
- r.presenceText ? (l(), _("span", {
841
+ i.presenceText ? (l(), _("span", {
842
842
  key: 0,
843
- class: W(["d-mention-suggestion__presence", [r.presenceFontColorClass]])
844
- }, p(r.presenceText), 3)) : b("", !0),
845
- r.status && r.presenceText ? (l(), _("div", Kt, " • ")) : b("", !0),
846
- r.status ? (l(), _("div", qt, p(r.status), 1)) : b("", !0)
843
+ class: z(["d-mention-suggestion__presence", [i.presenceFontColorClass]])
844
+ }, p(i.presenceText), 3)) : x("", !0),
845
+ i.status && i.presenceText ? (l(), _("div", Vt, " • ")) : x("", !0),
846
+ i.status ? (l(), _("div", qt, p(i.status), 1)) : x("", !0)
847
847
  ]),
848
848
  _: 1
849
- })) : b("", !0)
849
+ })) : x("", !0)
850
850
  ]),
851
851
  _: 1
852
852
  })
@@ -854,7 +854,7 @@ function Nt(e, t, o, n, i, r) {
854
854
  _: 1
855
855
  });
856
856
  }
857
- const Ut = /* @__PURE__ */ g(Ft, [["render", Nt]]), zt = {
857
+ const Ut = /* @__PURE__ */ g(Nt, [["render", Kt]]), Wt = {
858
858
  // This function comes from the user and passed to the editor directly.
859
859
  // This will also activate the mention plugin on the editor
860
860
  // items: ({ query }) => { return [] },
@@ -863,9 +863,9 @@ const Ut = /* @__PURE__ */ g(Ft, [["render", Nt]]), zt = {
863
863
  let e, t, o = !1;
864
864
  return {
865
865
  onStart: (n) => {
866
- e = new v(A, {
866
+ e = new R(P, {
867
867
  props: {
868
- itemComponent: I(Ut),
868
+ itemComponent: M(Ut),
869
869
  itemType: "mention",
870
870
  ...n
871
871
  },
@@ -885,7 +885,7 @@ const Ut = /* @__PURE__ */ g(Ft, [["render", Nt]]), zt = {
885
885
  trigger: "manual",
886
886
  placement: "top-start",
887
887
  zIndex: 650,
888
- plugins: [D]
888
+ plugins: [B]
889
889
  }), n.items.length > 0 && (t == null || t[0].show()));
890
890
  },
891
891
  onUpdate(n) {
@@ -894,20 +894,20 @@ const Ut = /* @__PURE__ */ g(Ft, [["render", Nt]]), zt = {
894
894
  }));
895
895
  },
896
896
  onKeyDown(n) {
897
- var i;
897
+ var r;
898
898
  if (o)
899
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
899
+ return (r = e == null ? void 0 : e.ref) == null ? void 0 : r.onKeyDown(n);
900
900
  },
901
901
  onExit() {
902
902
  t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
903
903
  }
904
904
  };
905
905
  }
906
- }, Wt = {
906
+ }, zt = {
907
907
  compatConfig: { MODE: 3 },
908
908
  name: "ChannelSuggestion",
909
909
  components: {
910
- DtStack: M,
910
+ DtStack: I,
911
911
  DtIconHash: Ye,
912
912
  DtIconLock: Ge
913
913
  },
@@ -923,7 +923,7 @@ const Ut = /* @__PURE__ */ g(Ft, [["render", Nt]]), zt = {
923
923
  }
924
924
  }
925
925
  };
926
- function Xt(e, t, o, n, i, r) {
926
+ function Xt(e, t, o, n, r, i) {
927
927
  const s = d("dt-icon-hash"), a = d("dt-icon-lock"), c = d("dt-stack");
928
928
  return l(), m(c, {
929
929
  direction: "row",
@@ -937,12 +937,12 @@ function Xt(e, t, o, n, i, r) {
937
937
  key: 0,
938
938
  size: "300"
939
939
  })),
940
- y("span", null, p(r.name), 1)
940
+ w("span", null, p(i.name), 1)
941
941
  ]),
942
942
  _: 1
943
943
  });
944
944
  }
945
- const Jt = /* @__PURE__ */ g(Wt, [["render", Xt]]), Yt = {
945
+ const Jt = /* @__PURE__ */ g(zt, [["render", Xt]]), Yt = {
946
946
  // This function comes from the user and passed to the editor directly.
947
947
  // This will also activate the mention plugin on the editor
948
948
  // items: ({ query }) => { return [] },
@@ -951,9 +951,9 @@ const Jt = /* @__PURE__ */ g(Wt, [["render", Xt]]), Yt = {
951
951
  let e, t, o = !1;
952
952
  return {
953
953
  onStart: (n) => {
954
- e = new v(A, {
954
+ e = new R(P, {
955
955
  props: {
956
- itemComponent: I(Jt),
956
+ itemComponent: M(Jt),
957
957
  itemType: "channel",
958
958
  ...n
959
959
  },
@@ -973,7 +973,7 @@ const Jt = /* @__PURE__ */ g(Wt, [["render", Xt]]), Yt = {
973
973
  trigger: "manual",
974
974
  placement: "top-start",
975
975
  zIndex: 650,
976
- plugins: [D]
976
+ plugins: [B]
977
977
  }), n.items.length > 0 && (t == null || t[0].show()));
978
978
  },
979
979
  onUpdate(n) {
@@ -982,9 +982,9 @@ const Jt = /* @__PURE__ */ g(Wt, [["render", Xt]]), Yt = {
982
982
  }));
983
983
  },
984
984
  onKeyDown(n) {
985
- var i;
985
+ var r;
986
986
  if (o)
987
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
987
+ return (r = e == null ? void 0 : e.ref) == null ? void 0 : r.onKeyDown(n);
988
988
  },
989
989
  onExit() {
990
990
  t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
@@ -1012,13 +1012,13 @@ const Jt = /* @__PURE__ */ g(Wt, [["render", Xt]]), Yt = {
1012
1012
  }
1013
1013
  }
1014
1014
  }, Qt = { class: "d-body--md-compact" }, Zt = { key: 0 }, en = { class: "d-body--sm d-fc-tertiary" };
1015
- function tn(e, t, o, n, i, r) {
1015
+ function tn(e, t, o, n, r, i) {
1016
1016
  return l(), _("div", null, [
1017
- y("div", Qt, [
1018
- y("span", null, "/" + p(r.command), 1),
1019
- r.parametersExample ? (l(), _("span", Zt, p(r.parametersExample), 1)) : b("", !0)
1017
+ w("div", Qt, [
1018
+ w("span", null, "/" + p(i.command), 1),
1019
+ i.parametersExample ? (l(), _("span", Zt, p(i.parametersExample), 1)) : x("", !0)
1020
1020
  ]),
1021
- y("div", en, p(r.description), 1)
1021
+ w("div", en, p(i.description), 1)
1022
1022
  ]);
1023
1023
  }
1024
1024
  const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
@@ -1031,10 +1031,10 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1031
1031
  let e, t, o = !1;
1032
1032
  return {
1033
1033
  onStart: (n) => {
1034
- e = new v(A, {
1034
+ e = new R(P, {
1035
1035
  parent: void 0,
1036
1036
  props: {
1037
- itemComponent: I(nn),
1037
+ itemComponent: M(nn),
1038
1038
  itemType: "slash-command",
1039
1039
  ...n
1040
1040
  },
@@ -1054,7 +1054,7 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1054
1054
  trigger: "manual",
1055
1055
  placement: "top-start",
1056
1056
  zIndex: 650,
1057
- plugins: [D]
1057
+ plugins: [B]
1058
1058
  }), n.items.length > 0 && (t == null || t[0].show()));
1059
1059
  },
1060
1060
  onUpdate(n) {
@@ -1063,9 +1063,9 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1063
1063
  }));
1064
1064
  },
1065
1065
  onKeyDown(n) {
1066
- var i;
1066
+ var r;
1067
1067
  if (o)
1068
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
1068
+ return (r = e == null ? void 0 : e.ref) == null ? void 0 : r.onKeyDown(n);
1069
1069
  },
1070
1070
  onExit() {
1071
1071
  t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
@@ -1079,7 +1079,7 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1079
1079
  EditorContent: G,
1080
1080
  BubbleMenu: Q,
1081
1081
  DtButton: Ze,
1082
- DtStack: M
1082
+ DtStack: I
1083
1083
  },
1084
1084
  props: {
1085
1085
  /**
@@ -1104,6 +1104,14 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1104
1104
  type: Boolean,
1105
1105
  default: !1
1106
1106
  },
1107
+ /**
1108
+ * When this option is false the editor will only ever paste plain text, no rich text formatting will be applied,
1109
+ * and any HTML will be rendered as text.
1110
+ */
1111
+ pasteRichText: {
1112
+ type: Boolean,
1113
+ default: !0
1114
+ },
1107
1115
  /**
1108
1116
  * Whether the input allows for line breaks to be introduced in the text by pressing enter. If this is disabled,
1109
1117
  * line breaks can still be entered by pressing shift+enter.
@@ -1143,7 +1151,7 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1143
1151
  type: [Boolean, String, Number],
1144
1152
  default: !1,
1145
1153
  validator(e) {
1146
- return typeof e == "string" ? We.includes(e) : !0;
1154
+ return typeof e == "string" ? ze.includes(e) : !0;
1147
1155
  }
1148
1156
  },
1149
1157
  /**
@@ -1409,7 +1417,7 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1409
1417
  tippyOptions: {
1410
1418
  appendTo: () => {
1411
1419
  var e;
1412
- return (e = V(this.$refs.editor.$el).getRootNode()) == null ? void 0 : e.querySelector("body");
1420
+ return (e = F(this.$refs.editor.$el).getRootNode()) == null ? void 0 : e.querySelector("body");
1413
1421
  },
1414
1422
  placement: "top-start"
1415
1423
  }
@@ -1429,48 +1437,48 @@ const nn = /* @__PURE__ */ g(Gt, [["render", tn]]), on = {
1429
1437
  },
1430
1438
  // eslint-disable-next-line complexity
1431
1439
  extensions() {
1432
- const e = [me, Ce, Se, he];
1433
- e.push(this.useDivTags ? Tt : U), this.allowBlockquote && e.push(ce), this.allowBold && e.push(pe), this.allowBulletList && (e.push(ge), e.push(ye.extend({
1440
+ const e = [me, Ce, Ee, he];
1441
+ e.push(this.useDivTags ? St : U), this.allowBlockquote && e.push(ce), this.allowBold && e.push(pe), this.allowBulletList && (e.push(ge), e.push(we.extend({
1434
1442
  renderText({ node: n }) {
1435
1443
  return n.textContent;
1436
1444
  }
1437
- })), e.push(ke)), this.allowItalic && e.push(_e), this.allowStrike && e.push(be), this.allowUnderline && e.push(xe), this.placeholder && e.push(
1445
+ })), e.push(ke)), this.allowItalic && e.push(_e), this.allowStrike && e.push(xe), this.allowUnderline && e.push(be), this.placeholder && e.push(
1438
1446
  fe.configure({ placeholder: this.placeholder })
1439
1447
  );
1440
1448
  const t = this, o = le.create({
1441
1449
  addKeyboardShortcuts() {
1442
1450
  return {
1443
- "Shift-Enter": ({ editor: n }) => t.allowLineBreaks ? !1 : (n.commands.first(({ commands: i }) => [
1444
- () => i.newlineInCode(),
1445
- () => t.allowBulletList && i.splitListItem("listItem"),
1446
- () => i.createParagraphNear(),
1447
- () => i.liftEmptyBlock(),
1448
- () => i.splitBlock()
1451
+ "Shift-Enter": ({ editor: n }) => t.allowLineBreaks ? !1 : (n.commands.first(({ commands: r }) => [
1452
+ () => r.newlineInCode(),
1453
+ () => t.allowBulletList && r.splitListItem("listItem"),
1454
+ () => r.createParagraphNear(),
1455
+ () => r.liftEmptyBlock(),
1456
+ () => r.splitBlock()
1449
1457
  ]), !0),
1450
1458
  Enter: () => t.allowLineBreaks ? !1 : (t.$emit("enter"), !0)
1451
1459
  };
1452
1460
  }
1453
1461
  });
1454
- if (e.push(o), this.link && e.push(we.extend({ inclusive: !1 }).configure({
1462
+ if (e.push(o), this.link && e.push(ye.extend({ inclusive: !1 }).configure({
1455
1463
  HTMLAttributes: {
1456
1464
  class: "d-link d-wb-break-all"
1457
1465
  },
1458
1466
  openOnClick: !1,
1459
1467
  autolink: !0,
1460
- protocols: K
1461
- })), this.customLink && e.push(this.getExtension(Et, this.customLink)), this.mentionSuggestion) {
1462
- const n = { ...this.mentionSuggestion, ...zt };
1468
+ protocols: V
1469
+ })), this.customLink && e.push(this.getExtension(Tt, this.customLink)), this.mentionSuggestion) {
1470
+ const n = { ...this.mentionSuggestion, ...Wt };
1463
1471
  e.push($t.configure({ suggestion: n }));
1464
1472
  }
1465
1473
  if (this.channelSuggestion) {
1466
1474
  const n = { ...this.channelSuggestion, ...Yt };
1467
- e.push(At.configure({ suggestion: n }));
1475
+ e.push(Pt.configure({ suggestion: n }));
1468
1476
  }
1469
1477
  if (this.slashCommandSuggestion) {
1470
1478
  const n = { ...this.slashCommandSuggestion, ...on };
1471
1479
  e.push(Ht.configure({ suggestion: n }));
1472
1480
  }
1473
- return e.push(gt), e.push(Ee.configure({
1481
+ return e.push(gt), e.push(Te.configure({
1474
1482
  types: ["paragraph"]
1475
1483
  })), this.allowCode && e.push(ue), this.allowCodeblock && e.push(de.extend({
1476
1484
  renderText({ node: n }) {
@@ -1482,7 +1490,7 @@ ${n.textContent}
1482
1490
  HTMLAttributes: {
1483
1491
  class: "d-rich-text-editor__code-block"
1484
1492
  }
1485
- })), this.allowInlineImages && e.push(St), (this.allowFontFamily || this.allowFontColor) && (e.push(Te), this.allowFontColor && e.push(Re), this.allowFontFamily && e.push(Le)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
1493
+ })), this.allowInlineImages && e.push(Et), (this.allowFontFamily || this.allowFontColor) && (e.push(Se), this.allowFontColor && e.push(Le), this.allowFontFamily && e.push(ve)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
1486
1494
  },
1487
1495
  inputAttrs() {
1488
1496
  const e = {
@@ -1522,7 +1530,7 @@ ${n.textContent}
1522
1530
  this.destroyEditor();
1523
1531
  },
1524
1532
  mounted() {
1525
- Ue(V(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1533
+ Ue(F(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
1526
1534
  },
1527
1535
  methods: {
1528
1536
  createEditor() {
@@ -1531,23 +1539,17 @@ ${n.textContent}
1531
1539
  content: this.modelValue,
1532
1540
  editable: this.editable,
1533
1541
  extensions: this.extensions,
1542
+ parseOptions: {
1543
+ preserveWhitespace: "full"
1544
+ },
1534
1545
  editorProps: {
1535
1546
  attributes: {
1536
1547
  ...this.inputAttrs,
1537
1548
  class: this.inputClass
1538
1549
  },
1539
- handlePaste: (e, t) => {
1540
- if (!this.link && !this.customLink) {
1541
- const o = /^https?:\/\//;
1542
- if (!(t != null && t.clipboardData))
1543
- return !1;
1544
- const n = t.clipboardData.getData("text");
1545
- if (!o.test(n) || !t.clipboardData.getData("text/html"))
1546
- return !1;
1547
- const i = n.replace(/\n/g, "<br>").replace(/ {2}/g, "&nbsp;&nbsp;");
1548
- return this.editor.chain().focus().insertContent(i).run(), !0;
1549
- }
1550
- return !1;
1550
+ handlePaste: (e, t, o) => {
1551
+ const n = t.clipboardData || window.clipboardData, r = n.getData("text/plain"), i = n.getData("text/html");
1552
+ return this.processPasteData(e, r, i);
1551
1553
  },
1552
1554
  // Moves the <br /> tags inside the previous closing tag to avoid
1553
1555
  // Prosemirror wrapping them within another </p> tag.
@@ -1557,7 +1559,7 @@ ${n.textContent}
1557
1559
  }
1558
1560
  }), this.addEditorListeners();
1559
1561
  },
1560
- bubbleMenuShouldShow({ editor: e, view: t, state: o, oldState: n, from: i, to: r }) {
1562
+ bubbleMenuShouldShow({ editor: e, view: t, state: o, oldState: n, from: r, to: i }) {
1561
1563
  return e.isActive("link");
1562
1564
  },
1563
1565
  /**
@@ -1567,8 +1569,8 @@ ${n.textContent}
1567
1569
  */
1568
1570
  getSelectedLinkText(e) {
1569
1571
  var a, c, h;
1570
- 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);
1571
- return s && ((h = (c = (a = s.marks) == null ? void 0 : a.at(0)) == null ? void 0 : c.type) == null ? void 0 : h.name) === "link" ? s.textContent : r;
1572
+ const { view: t, state: o } = e, { from: n, to: r } = t.state.selection, i = o.doc.textBetween(n, r, ""), s = this.editor.state.doc.nodeAt(n);
1573
+ return s && ((h = (c = (a = s.marks) == null ? void 0 : a.at(0)) == null ? void 0 : c.type) == null ? void 0 : h.name) === "link" ? s.textContent : i;
1572
1574
  },
1573
1575
  editLink() {
1574
1576
  const e = this.getSelectedLinkText(this.editor), t = {
@@ -1588,13 +1590,13 @@ ${n.textContent}
1588
1590
  window.open(e, "_blank");
1589
1591
  },
1590
1592
  // eslint-disable-next-line complexity
1591
- setLink(e, t, o, n = K, i) {
1593
+ setLink(e, t, o, n = V, r) {
1592
1594
  var a, c, h;
1593
1595
  if (!e) {
1594
1596
  this.removeLink();
1595
1597
  return;
1596
1598
  }
1597
- n.find((w) => w.test(e)) || (e = `${i}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1599
+ n.find((y) => y.test(e)) || (e = `${r}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1598
1600
  const s = (h = (c = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : c.state) == null ? void 0 : h.selection;
1599
1601
  this.editor.chain().focus().insertContent(t).setTextSelection({ from: s.from, to: s.from + t.length }).setLink({ href: e, class: o.class }).run();
1600
1602
  },
@@ -1603,15 +1605,79 @@ ${n.textContent}
1603
1605
  const o = this.getOutput();
1604
1606
  if (!(t && Qe(e, o))) {
1605
1607
  if (typeof e == "string" && this.outputFormat === "text") {
1606
- const n = new RegExp(`(${z})`, "g");
1608
+ const n = new RegExp(`(${W})`, "g");
1607
1609
  e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
1608
1610
  }
1609
- this.editor.commands.setContent(e, !1);
1611
+ this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
1610
1612
  }
1611
1613
  },
1612
1614
  destroyEditor() {
1613
1615
  this.editor.destroy();
1614
1616
  },
1617
+ insertPlainTextWithHardBreaks(e, t) {
1618
+ const { tr: o } = e.state, { from: n, to: r } = e.state.selection;
1619
+ o.deleteRange(n, r);
1620
+ const i = t.split(/\r?\n/);
1621
+ let s = n;
1622
+ for (let a = 0; a < i.length; a++)
1623
+ a > 0 && (o.insert(s, e.state.schema.nodes.hardBreak.create()), s++), o.insertText(i[a], s), s += i[a].length;
1624
+ e.dispatch(o);
1625
+ },
1626
+ shouldPreserveLineBreaks(e, t) {
1627
+ return this.pasteRichText ? !t && e && this.hasBlankLines(e) : !!e;
1628
+ },
1629
+ processPasteData(e, t, o) {
1630
+ if (this.shouldPreserveLineBreaks(t, o))
1631
+ return this.insertPlainTextWithHardBreaks(e, t), !0;
1632
+ if (this.shouldHandlePreformattedHTML(o)) {
1633
+ const n = this.extractPreformattedText(o);
1634
+ if (n && n.includes(`
1635
+ `))
1636
+ return this.insertPlainTextWithHardBreaks(e, n), !0;
1637
+ }
1638
+ return !1;
1639
+ },
1640
+ shouldHandlePreformattedHTML(e) {
1641
+ return this.pasteRichText && e && this.containsPreformattedContent(e);
1642
+ },
1643
+ containsPreformattedContent(e) {
1644
+ const t = document.createElement("div");
1645
+ t.innerHTML = e;
1646
+ const o = t.querySelectorAll("*");
1647
+ for (const n of o)
1648
+ if (this.hasPreWhitespace(n) && this.hasLineBreaks(n))
1649
+ return !0;
1650
+ return !1;
1651
+ },
1652
+ hasPreWhitespace(e) {
1653
+ const t = e.getAttribute("style") || "", o = e.style.whiteSpace || "", n = o === "pre" || o === "pre-wrap", r = t.includes("white-space: pre");
1654
+ return n || r;
1655
+ },
1656
+ hasLineBreaks(e) {
1657
+ return e.textContent && e.textContent.includes(`
1658
+ `);
1659
+ },
1660
+ hasBlankLines(e) {
1661
+ return e.includes(`
1662
+
1663
+ `) || /\n\s*\n/.test(e);
1664
+ },
1665
+ extractPreformattedText(e) {
1666
+ const t = document.createElement("div");
1667
+ return t.innerHTML = e, this.walkAndExtractText(t);
1668
+ },
1669
+ walkAndExtractText(e) {
1670
+ let t = "";
1671
+ if (e.nodeType === Node.TEXT_NODE)
1672
+ t += e.textContent;
1673
+ else if (e.nodeType === Node.ELEMENT_NODE)
1674
+ if (this.hasPreWhitespace(e))
1675
+ t += e.textContent;
1676
+ else
1677
+ for (const o of e.childNodes)
1678
+ t += this.walkAndExtractText(o);
1679
+ return t;
1680
+ },
1615
1681
  triggerInputChangeEvents() {
1616
1682
  const e = this.getOutput();
1617
1683
  this.$emit("input", e), this.$emit("update:modelValue", e);
@@ -1633,7 +1699,7 @@ ${n.textContent}
1633
1699
  }), this.editor.on("update", () => {
1634
1700
  var e, t;
1635
1701
  if (this.preventTyping && ((t = (e = this.editor.view) == null ? void 0 : e.input) == null ? void 0 : t.lastKeyCode) !== 8) {
1636
- this.editor.commands.setContent(this.value, !1);
1702
+ this.editor.commands.setContent(this.modelValue, !1);
1637
1703
  return;
1638
1704
  }
1639
1705
  this.triggerInputChangeEvents();
@@ -1677,18 +1743,18 @@ ${n.textContent}
1677
1743
  }
1678
1744
  }
1679
1745
  }, sn = { class: "d-popover__dialog" };
1680
- function an(e, t, o, n, i, r) {
1746
+ function an(e, t, o, n, r, i) {
1681
1747
  const s = d("dt-button"), a = d("dt-stack"), c = d("bubble-menu"), h = d("editor-content");
1682
1748
  return l(), _("div", null, [
1683
- i.editor && o.link && !o.hideLinkBubbleMenu ? (l(), m(c, {
1749
+ r.editor && o.link && !o.hideLinkBubbleMenu ? (l(), m(c, {
1684
1750
  key: 0,
1685
- editor: i.editor,
1686
- "should-show": r.bubbleMenuShouldShow,
1687
- "tippy-options": i.tippyOptions,
1751
+ editor: r.editor,
1752
+ "should-show": i.bubbleMenuShouldShow,
1753
+ "tippy-options": r.tippyOptions,
1688
1754
  style: { visibility: "visible" }
1689
1755
  }, {
1690
1756
  default: u(() => [
1691
- y("div", sn, [
1757
+ w("div", sn, [
1692
1758
  f(a, {
1693
1759
  direction: "row",
1694
1760
  class: "d-rich-text-editor-bubble-menu__button-stack",
@@ -1698,7 +1764,7 @@ function an(e, t, o, n, i, r) {
1698
1764
  f(s, {
1699
1765
  kind: "muted",
1700
1766
  importance: "clear",
1701
- onClick: r.editLink
1767
+ onClick: i.editLink
1702
1768
  }, {
1703
1769
  default: u(() => [
1704
1770
  k(" Edit ")
@@ -1708,7 +1774,7 @@ function an(e, t, o, n, i, r) {
1708
1774
  f(s, {
1709
1775
  kind: "muted",
1710
1776
  importance: "clear",
1711
- onClick: r.openLink
1777
+ onClick: i.openLink
1712
1778
  }, {
1713
1779
  default: u(() => [
1714
1780
  k(" Open link ")
@@ -1718,7 +1784,7 @@ function an(e, t, o, n, i, r) {
1718
1784
  f(s, {
1719
1785
  kind: "danger",
1720
1786
  importance: "clear",
1721
- onClick: r.removeLink
1787
+ onClick: i.removeLink
1722
1788
  }, {
1723
1789
  default: u(() => [
1724
1790
  k(" Remove ")
@@ -1731,13 +1797,13 @@ function an(e, t, o, n, i, r) {
1731
1797
  ])
1732
1798
  ]),
1733
1799
  _: 1
1734
- }, 8, ["editor", "should-show", "tippy-options"])) : b("", !0),
1735
- f(h, Be({
1800
+ }, 8, ["editor", "should-show", "tippy-options"])) : x("", !0),
1801
+ f(h, De({
1736
1802
  ref: "editor",
1737
- editor: i.editor,
1803
+ editor: r.editor,
1738
1804
  class: "d-rich-text-editor",
1739
1805
  "data-qa": "dt-rich-text-editor"
1740
- }, r.attrs), null, 16, ["editor"])
1806
+ }, i.attrs), null, 16, ["editor"])
1741
1807
  ]);
1742
1808
  }
1743
1809
  const Qn = /* @__PURE__ */ g(rn, [["render", an]]);