@dialpad/dialtone 9.125.0 → 9.126.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) 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 +26387 -26387
  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/en-US.cjs +1 -1
  31. package/dist/vue2/localization/en-US.cjs.map +1 -1
  32. package/dist/vue2/localization/en-US.js +1 -1
  33. package/dist/vue2/localization/en-US.js.map +1 -1
  34. package/dist/vue2/localization/es-LA.cjs +1 -1
  35. package/dist/vue2/localization/es-LA.cjs.map +1 -1
  36. package/dist/vue2/localization/es-LA.js +1 -1
  37. package/dist/vue2/localization/es-LA.js.map +1 -1
  38. package/dist/vue2/localization/index.cjs +157 -11
  39. package/dist/vue2/localization/index.cjs.map +1 -1
  40. package/dist/vue2/localization/index.js +164 -18
  41. package/dist/vue2/localization/index.js.map +1 -1
  42. package/dist/vue2/types/components/list_item/list_item.vue.d.ts +9 -0
  43. package/dist/vue2/types/components/list_item/list_item.vue.d.ts.map +1 -1
  44. package/dist/vue2/types/components/loader/index.d.ts +2 -0
  45. package/dist/vue2/types/components/loader/index.d.ts.map +1 -0
  46. package/dist/vue2/types/components/loader/loader.vue.d.ts +32 -0
  47. package/dist/vue2/types/components/loader/loader.vue.d.ts.map +1 -0
  48. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +10 -0
  49. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  50. package/dist/vue2/types/index.d.ts +1 -0
  51. package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +1 -1
  52. package/dist/vue3/component-documentation.json +1 -1
  53. package/dist/vue3/dialtone-vue.cjs +1 -1
  54. package/dist/vue3/dialtone-vue.js +208 -206
  55. package/dist/vue3/dialtone-vue.js.map +1 -1
  56. package/dist/vue3/lib/list-item/list-item.cjs +1 -1
  57. package/dist/vue3/lib/list-item/list-item.cjs.map +1 -1
  58. package/dist/vue3/lib/list-item/list-item.js +35 -30
  59. package/dist/vue3/lib/list-item/list-item.js.map +1 -1
  60. package/dist/vue3/lib/loader/index.cjs +2 -0
  61. package/dist/vue3/lib/loader/index.cjs.map +1 -0
  62. package/dist/vue3/lib/loader/index.js +5 -0
  63. package/dist/vue3/lib/loader/index.js.map +1 -0
  64. package/dist/vue3/lib/loader/loader.cjs +2 -0
  65. package/dist/vue3/lib/loader/loader.cjs.map +1 -0
  66. package/dist/vue3/lib/loader/loader.js +48 -0
  67. package/dist/vue3/lib/loader/loader.js.map +1 -0
  68. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  69. package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
  70. package/dist/vue3/lib/message-input/message-input.js +2 -1
  71. package/dist/vue3/lib/message-input/message-input.js.map +1 -1
  72. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +8 -4
  73. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  74. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +301 -235
  75. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  76. package/dist/vue3/types/components/list_item/list_item.vue.d.ts +10 -2
  77. package/dist/vue3/types/components/loader/index.d.ts +2 -0
  78. package/dist/vue3/types/components/loader/index.d.ts.map +1 -0
  79. package/dist/vue3/types/components/loader/loader.vue.d.ts +26 -0
  80. package/dist/vue3/types/components/loader/loader.vue.d.ts.map +1 -0
  81. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +19 -0
  82. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  83. package/dist/vue3/types/components/toggle/toggle.vue.d.ts +1 -1
  84. package/dist/vue3/types/index.d.ts +1 -0
  85. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  86. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as w, VueNodeViewRenderer as v, EditorContent as H, BubbleMenu as P, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
2
- import { Node as N, mergeAttributes as m, InputRule as U, nodePasteRule as E, getMarksBetween as q, combineTransactionSteps as K, getChangedRanges as V, findChildrenInRange as z, Mark as W, nodeInputRule as X, Extension as J } from "@tiptap/core";
1
+ import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as w, VueNodeViewRenderer as v, EditorContent as H, BubbleMenu as j, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
2
+ import { Node as N, mergeAttributes as m, InputRule as q, nodePasteRule as E, getMarksBetween as U, combineTransactionSteps as K, getChangedRanges as W, findChildrenInRange as V, Mark as z, nodeInputRule as X, Extension as J } from "@tiptap/core";
3
3
  import Y from "@tiptap/extension-blockquote";
4
4
  import G from "@tiptap/extension-code-block";
5
5
  import Q from "@tiptap/extension-code";
6
6
  import Z from "@tiptap/extension-document";
7
- import A from "@tiptap/extension-paragraph";
7
+ import O from "@tiptap/extension-paragraph";
8
8
  import ee from "@tiptap/extension-placeholder";
9
9
  import te from "@tiptap/extension-hard-break";
10
10
  import ne from "@tiptap/extension-bold";
11
11
  import re from "@tiptap/extension-bullet-list";
12
- import ie from "@tiptap/extension-italic";
13
- import se from "@tiptap/extension-link";
12
+ import se from "@tiptap/extension-italic";
13
+ import ie from "@tiptap/extension-link";
14
14
  import oe from "@tiptap/extension-list-item";
15
15
  import ae from "@tiptap/extension-ordered-list";
16
16
  import le from "@tiptap/extension-strike";
@@ -23,45 +23,45 @@ import fe from "@tiptap/extension-color";
23
23
  import pe from "@tiptap/extension-font-family";
24
24
  import { PluginKey as f, Plugin as ge } from "@tiptap/pm/state";
25
25
  import _e from "@tiptap/suggestion";
26
- import { emojiPattern as D } from "regex-combined-emojis";
26
+ import { emojiPattern as B } from "regex-combined-emojis";
27
27
  import { n as c } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
28
- import B from "../emoji/emoji.js";
29
- import { stringToUnicode as ye, codeToEmojiData as S, emojiRegex as we, emojiShortCodeRegex as ve } from "../../common/emoji/index.js";
30
- import { emojisIndexed as be } from "@dialpad/dialtone-emojis";
31
- import xe from "../list-item/list-item.js";
32
- import b from "../stack/stack.js";
33
- import x from "tippy.js";
34
- import { linkRegex as Ce, getPhoneNumberRegex as ke, warnIfUnmounted as Te } from "../../common/utils/index.js";
28
+ import P from "../emoji/emoji.js";
29
+ import { stringToUnicode as ye, codeToEmojiData as R, emojiRegex as we, emojiShortCodeRegex as ve } from "../../common/emoji/index.js";
30
+ import { emojisIndexed as xe } from "@dialpad/dialtone-emojis";
31
+ import be from "../list-item/list-item.js";
32
+ import x from "../stack/stack.js";
33
+ import b from "tippy.js";
34
+ import { linkRegex as ke, getPhoneNumberRegex as Te, warnIfUnmounted as Ce } from "../../common/utils/index.js";
35
35
  import Ee from "@tiptap/extension-image";
36
- import L from "@tiptap/extension-mention";
36
+ import S from "@tiptap/extension-mention";
37
37
  import M from "../link/link.js";
38
- import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Re, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Se, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as $ } from "./rich-text-editor-constants.js";
39
- import Le from "../avatar/avatar.js";
38
+ import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Le, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Re, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as $ } from "./rich-text-editor-constants.js";
39
+ import Se from "../avatar/avatar.js";
40
40
  import $e from "@dialpad/dialtone-icons/vue2/hash";
41
41
  import Ie from "@dialpad/dialtone-icons/vue2/lock";
42
- import Oe from "deep-equal";
43
- import Ae from "../button/button.js";
44
- import De from "../../common/mixins/localization.js";
45
- const Be = {
42
+ import Ae from "deep-equal";
43
+ import Oe from "../button/button.js";
44
+ import Be from "../../common/mixins/localization.js";
45
+ const Pe = {
46
46
  name: "EmojiComponent",
47
47
  components: {
48
48
  NodeViewWrapper: _,
49
- DtEmoji: B
49
+ DtEmoji: P
50
50
  },
51
51
  props: y
52
52
  };
53
53
  var Me = function() {
54
- var e = this, n = e._self._c;
55
- return n("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [n("dt-emoji", { attrs: { size: "500", code: e.node.attrs.code } })], 1);
56
- }, je = [], He = /* @__PURE__ */ c(
57
- Be,
54
+ var t = this, n = t._self._c;
55
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [n("dt-emoji", { attrs: { size: "500", code: t.node.attrs.code } })], 1);
56
+ }, De = [], He = /* @__PURE__ */ c(
57
+ Pe,
58
58
  Me,
59
- je
59
+ De
60
60
  );
61
- const Pe = He.exports, Fe = {
61
+ const je = He.exports, Fe = {
62
62
  name: "SuggestionList",
63
63
  components: {
64
- DtListItem: xe
64
+ DtListItem: be
65
65
  },
66
66
  props: {
67
67
  items: {
@@ -92,8 +92,8 @@ const Pe = He.exports, Fe = {
92
92
  }
93
93
  },
94
94
  methods: {
95
- onKeyDown({ event: t }) {
96
- return t.key === "ArrowUp" ? (this.upHandler(), !0) : t.key === "ArrowDown" ? (this.downHandler(), !0) : t.key === "Enter" || t.key === "Tab" ? (this.selectHandler(), !0) : !1;
95
+ onKeyDown({ event: e }) {
96
+ return e.key === "ArrowUp" ? (this.upHandler(), !0) : e.key === "ArrowDown" ? (this.downHandler(), !0) : e.key === "Enter" || e.key === "Tab" ? (this.selectHandler(), !0) : !1;
97
97
  },
98
98
  upHandler() {
99
99
  this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length, this.scrollActiveElementIntoView();
@@ -103,8 +103,8 @@ const Pe = He.exports, Fe = {
103
103
  },
104
104
  async scrollActiveElementIntoView() {
105
105
  await this.$nextTick();
106
- const t = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
107
- t && t.scrollIntoView({
106
+ const e = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
107
+ e && e.scrollIntoView({
108
108
  behaviour: "smooth",
109
109
  block: "center"
110
110
  });
@@ -112,47 +112,47 @@ const Pe = He.exports, Fe = {
112
112
  selectHandler() {
113
113
  this.selectItem(this.selectedIndex);
114
114
  },
115
- selectItem(t) {
116
- const e = this.items[t];
115
+ selectItem(e) {
116
+ const t = this.items[e];
117
117
  switch (this.itemType) {
118
118
  case "emoji":
119
- this.command(e);
119
+ this.command(t);
120
120
  return;
121
121
  case "mention":
122
- this.command({ name: e.name, id: e.id, avatarSrc: e.avatarSrc });
122
+ this.command({ name: t.name, id: t.id, avatarSrc: t.avatarSrc });
123
123
  break;
124
124
  case "channel":
125
- this.command({ name: e.name, id: e.id });
125
+ this.command({ name: t.name, id: t.id });
126
126
  break;
127
127
  case "slash-command":
128
- this.command({ command: e.command });
128
+ this.command({ command: t.command });
129
129
  break;
130
130
  }
131
131
  }
132
132
  }
133
133
  };
134
134
  var Ne = function() {
135
- var e = this, n = e._self._c;
136
- return n("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [n("ul", { directives: [{ name: "show", rawName: "v-show", value: e.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "d-suggestion-list" }, e._l(e.items, function(r, i) {
135
+ var t = this, n = t._self._c;
136
+ return n("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [n("ul", { directives: [{ name: "show", rawName: "v-show", value: t.items.length, expression: "items.length" }], ref: "suggestionList", staticClass: "d-suggestion-list" }, t._l(t.items, function(r, s) {
137
137
  return n("dt-list-item", { key: r.id, class: [
138
138
  "d-suggestion-list__item",
139
- { "d-list-item--highlighted": i === e.selectedIndex }
139
+ { "d-list-item--highlighted": s === t.selectedIndex }
140
140
  ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(o) {
141
- return e.selectItem(i);
141
+ return t.selectItem(s);
142
142
  }, keydown: function(o) {
143
- return o.preventDefault(), e.onKeyDown.apply(null, arguments);
144
- } } }, [n(e.itemComponent, { tag: "component", attrs: { item: r } })], 1);
143
+ return o.preventDefault(), t.onKeyDown.apply(null, arguments);
144
+ } } }, [n(t.itemComponent, { tag: "component", attrs: { item: r } })], 1);
145
145
  }), 1)]);
146
- }, Ue = [], qe = /* @__PURE__ */ c(
146
+ }, qe = [], Ue = /* @__PURE__ */ c(
147
147
  Fe,
148
148
  Ne,
149
- Ue
149
+ qe
150
150
  );
151
- const C = qe.exports, Ke = {
151
+ const k = Ue.exports, Ke = {
152
152
  name: "EmojiSuggestion",
153
153
  components: {
154
- DtEmoji: B,
155
- DtStack: b
154
+ DtEmoji: P,
155
+ DtStack: x
156
156
  },
157
157
  props: {
158
158
  item: {
@@ -161,58 +161,58 @@ const C = qe.exports, Ke = {
161
161
  }
162
162
  }
163
163
  };
164
- var Ve = function() {
165
- var e = this, n = e._self._c;
166
- return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [n("dt-emoji", { attrs: { size: "200", code: e.item.code } }), e._v(" " + e._s(e.item.code) + " ")], 1);
167
- }, ze = [], We = /* @__PURE__ */ c(
164
+ var We = function() {
165
+ var t = this, n = t._self._c;
166
+ return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [n("dt-emoji", { attrs: { size: "200", code: t.item.code } }), t._v(" " + t._s(t.item.code) + " ")], 1);
167
+ }, Ve = [], ze = /* @__PURE__ */ c(
168
168
  Ke,
169
- Ve,
170
- ze
169
+ We,
170
+ Ve
171
171
  );
172
- const Xe = We.exports, k = {
172
+ const Xe = ze.exports, T = {
173
173
  name: "hideOnEsc",
174
174
  defaultValue: !0,
175
- fn({ hide: t }) {
176
- function e(n) {
177
- n.keyCode === 27 && t();
175
+ fn({ hide: e }) {
176
+ function t(n) {
177
+ n.keyCode === 27 && e();
178
178
  }
179
179
  return {
180
180
  onShow() {
181
- document.addEventListener("keydown", e);
181
+ document.addEventListener("keydown", t);
182
182
  },
183
183
  onHide() {
184
- document.removeEventListener("keydown", e);
184
+ document.removeEventListener("keydown", t);
185
185
  }
186
186
  };
187
187
  }
188
188
  }, Je = 20, Ye = {
189
- items: ({ query: t }) => {
190
- if (t.length < 2)
189
+ items: ({ query: e }) => {
190
+ if (e.length < 2)
191
191
  return [];
192
- const e = Object.values(be);
193
- return t = t.toLowerCase(), e.filter(
192
+ const t = Object.values(xe);
193
+ return e = e.toLowerCase(), t.filter(
194
194
  (r) => [
195
195
  r.name,
196
196
  r.shortname.replaceAll(":", ""),
197
197
  ...r.keywords
198
- ].some((i) => i.startsWith(t))
198
+ ].some((s) => s.startsWith(e))
199
199
  ).splice(0, Je).map((r) => ({ code: r.shortname }));
200
200
  },
201
- command: ({ editor: t, range: e, props: n }) => {
202
- var o, s;
203
- const r = t.view.state.selection.$to.nodeAfter;
204
- ((o = r == null ? void 0 : r.text) == null ? void 0 : o.startsWith(" ")) && (e.to += 1), t.chain().focus().insertContentAt(e, [
201
+ command: ({ editor: e, range: t, props: n }) => {
202
+ var o, i;
203
+ const r = e.view.state.selection.$to.nodeAfter;
204
+ ((o = r == null ? void 0 : r.text) == null ? void 0 : o.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
205
205
  {
206
206
  type: "emoji",
207
207
  attrs: n
208
208
  }
209
- ]).run(), (s = window.getSelection()) == null || s.collapseToEnd();
209
+ ]).run(), (i = window.getSelection()) == null || i.collapseToEnd();
210
210
  },
211
211
  render: () => {
212
- let t, e, n = !1;
212
+ let e, t, n = !1;
213
213
  return {
214
214
  onStart: (r) => {
215
- t = new w(C, {
215
+ e = new w(k, {
216
216
  parent: void 0,
217
217
  propsData: {
218
218
  itemComponent: Xe,
@@ -220,10 +220,10 @@ const Xe = We.exports, k = {
220
220
  ...r
221
221
  },
222
222
  editor: r.editor
223
- }), r.clientRect && (e = x("body", {
223
+ }), r.clientRect && (t = b("body", {
224
224
  getReferenceClientRect: r.clientRect,
225
225
  appendTo: () => document.body,
226
- content: t.element,
226
+ content: e.element,
227
227
  showOnCreate: !1,
228
228
  onShow: () => {
229
229
  n = !0;
@@ -235,28 +235,28 @@ const Xe = We.exports, k = {
235
235
  trigger: "manual",
236
236
  placement: "top-start",
237
237
  zIndex: 650,
238
- plugins: [k]
239
- }), r.items.length > 0 && (e == null || e[0].show()));
238
+ plugins: [T]
239
+ }), r.items.length > 0 && (t == null || t[0].show()));
240
240
  },
241
241
  onUpdate(r) {
242
- t == null || t.updateProps(r), r.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), e == null || e[0].setProps({
242
+ e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), t == null || t[0].setProps({
243
243
  getReferenceClientRect: r.clientRect
244
244
  });
245
245
  },
246
246
  onKeyDown(r) {
247
- var i;
247
+ var s;
248
248
  if (n)
249
- return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(r);
249
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
250
250
  },
251
251
  onExit() {
252
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
252
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
253
253
  }
254
254
  };
255
255
  }
256
- }, Ge = /(:\w+:)$/, Qe = new RegExp(D + "$"), Ze = (t) => {
257
- if (t && S(t[0]))
258
- return { text: t[2] || t[0] };
259
- }, et = (t) => [...t.matchAll(ve)].filter((n) => S(n[0])).map((n) => ({
256
+ }, Ge = /(:\w+:)$/, Qe = new RegExp(B + "$"), Ze = (e) => {
257
+ if (e && R(e[0]))
258
+ return { text: e[2] || e[0] };
259
+ }, et = (e) => [...e.matchAll(ve)].filter((n) => R(n[0])).map((n) => ({
260
260
  index: n.index,
261
261
  text: n[0],
262
262
  match: n
@@ -272,7 +272,7 @@ const Xe = We.exports, k = {
272
272
  selectable: !1,
273
273
  atom: !0,
274
274
  addNodeView() {
275
- return v(Pe);
275
+ return v(je);
276
276
  },
277
277
  addAttributes() {
278
278
  return {
@@ -288,23 +288,23 @@ const Xe = We.exports, k = {
288
288
  }
289
289
  ];
290
290
  },
291
- renderText({ node: t }) {
292
- return ye(S(t.attrs.code).unicode_output);
291
+ renderText({ node: e }) {
292
+ return ye(R(e.attrs.code).unicode_output);
293
293
  },
294
- renderHTML({ HTMLAttributes: t }) {
295
- return ["emoji-component", m(this.options.HTMLAttributes, t)];
294
+ renderHTML({ HTMLAttributes: e }) {
295
+ return ["emoji-component", m(this.options.HTMLAttributes, e)];
296
296
  },
297
297
  addInputRules() {
298
298
  return [
299
- new U({
300
- find: (t) => {
301
- const e = t.match(Ge) || t.match(Qe);
302
- if (e)
303
- return Ze(e);
299
+ new q({
300
+ find: (e) => {
301
+ const t = e.match(Ge) || e.match(Qe);
302
+ if (t)
303
+ return Ze(t);
304
304
  },
305
- handler: ({ state: t, range: e, match: n, commands: r, chain: i, can: o }) => {
306
- const { tr: s } = t, a = e.from, l = e.to;
307
- s.replaceWith(a, l, this.type.create({ code: n[0] }));
305
+ handler: ({ state: e, range: t, match: n, commands: r, chain: s, can: o }) => {
306
+ const { tr: i } = e, a = t.from, l = t.to;
307
+ i.replaceWith(a, l, this.type.create({ code: n[0] }));
308
308
  }
309
309
  })
310
310
  ];
@@ -314,18 +314,18 @@ const Xe = We.exports, k = {
314
314
  E({
315
315
  find: et,
316
316
  type: this.type,
317
- getAttributes(t) {
317
+ getAttributes(e) {
318
318
  return {
319
- code: t[0]
319
+ code: e[0]
320
320
  };
321
321
  }
322
322
  }),
323
323
  E({
324
324
  find: we,
325
325
  type: this.type,
326
- getAttributes(t) {
326
+ getAttributes(e) {
327
327
  return {
328
- code: t[0]
328
+ code: e[0]
329
329
  };
330
330
  }
331
331
  })
@@ -344,138 +344,138 @@ const Xe = We.exports, k = {
344
344
  },
345
345
  addKeyboardShortcuts() {
346
346
  return {
347
- Backspace: () => this.editor.commands.command(({ tr: t, state: e }) => {
347
+ Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
348
348
  let n = !1;
349
- const { selection: r } = e, { empty: i, anchor: o } = r;
350
- return i ? (e.doc.nodesBetween(o - 1, o, (s, a) => {
351
- if (s.type.name === this.name)
352
- return n = !0, t.insertText("", a, a + s.nodeSize), !1;
349
+ const { selection: r } = t, { empty: s, anchor: o } = r;
350
+ return s ? (t.doc.nodesBetween(o - 1, o, (i, a) => {
351
+ if (i.type.name === this.name)
352
+ return n = !0, e.insertText("", a, a + i.nodeSize), !1;
353
353
  }), n) : !1;
354
354
  })
355
355
  };
356
356
  }
357
357
  });
358
- function nt(t, e, n = () => !0) {
358
+ function nt(e, t, n = () => !0) {
359
359
  const r = [];
360
- e.lastIndex = 0;
361
- let i;
362
- for (; i = e.exec(t); )
363
- n(t, i) && r.push(i);
360
+ t.lastIndex = 0;
361
+ let s;
362
+ for (; s = t.exec(e); )
363
+ n(e, s) && r.push(s);
364
364
  return r;
365
365
  }
366
- function rt(t, e) {
367
- return !["#", "@"].includes(t.charAt(e.index)) && !["#", "@"].includes(t.charAt(e.index - 1));
366
+ function rt(e, t) {
367
+ return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
368
368
  }
369
- function it(t) {
370
- const e = new RegExp(
369
+ function st(e) {
370
+ const t = new RegExp(
371
371
  "(?:" + [
372
372
  `[!?.,:;'"]`,
373
373
  "(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
374
374
  ].join("|"),
375
375
  "g"
376
376
  );
377
- return t.replace(e, "");
377
+ return e.replace(t, "");
378
378
  }
379
- function st(t, e) {
380
- const n = t.slice(0, e + 1).search(/\S+\s*$/), r = t.slice(e).search(/\s/);
379
+ function it(e, t) {
380
+ const n = e.slice(0, t + 1).search(/\S+\s*$/), r = e.slice(t).search(/\s/);
381
381
  if (r < 0) {
382
- const i = t.slice(n);
382
+ const s = e.slice(n);
383
383
  return {
384
- text: i,
384
+ text: s,
385
385
  from: n,
386
- to: n + i.length
386
+ to: n + s.length
387
387
  };
388
388
  }
389
389
  return {
390
- text: t.slice(n, r + e),
390
+ text: e.slice(n, r + t),
391
391
  from: n,
392
- to: r + e
392
+ to: r + t
393
393
  };
394
394
  }
395
- function R(t, e, n, r) {
396
- const i = st(t, e);
397
- if (r.lastIndex = 0, !r.test(i.text))
398
- return i;
399
- const o = n === "left" ? i.from - 1 : i.to + 1;
400
- return o <= 0 || o >= t.length || o === e ? i : R(t, o, n, r);
395
+ function L(e, t, n, r) {
396
+ const s = it(e, t);
397
+ if (r.lastIndex = 0, !r.test(s.text))
398
+ return s;
399
+ const o = n === "left" ? s.from - 1 : s.to + 1;
400
+ return o <= 0 || o >= e.length || o === t ? s : L(e, o, n, r);
401
401
  }
402
- function ot(t, e, n, r) {
403
- const i = Math.max(t.from - 1, 0), o = Math.min(t.to + 1, e.content.size), s = q(i, o, e);
404
- for (const a of s)
402
+ function ot(e, t, n, r) {
403
+ const s = Math.max(e.from - 1, 0), o = Math.min(e.to + 1, t.content.size), i = U(s, o, t);
404
+ for (const a of i)
405
405
  a.mark.type === r && n.removeMark(a.from, a.to, r);
406
406
  }
407
- const I = ke(1, 15);
408
- function O(t, e, n, r, i, o) {
409
- if (!t)
407
+ const I = Te(1, 15);
408
+ function A(e, t, n, r, s, o) {
409
+ if (!e)
410
410
  return;
411
- let s = n - e - 1;
412
- s = s < 0 ? 0 : s;
413
- const a = r - e, l = R(
414
- t,
415
- s,
411
+ let i = n - t - 1;
412
+ i = i < 0 ? 0 : i;
413
+ const a = r - t, l = L(
414
+ e,
415
+ i,
416
416
  "left",
417
417
  I
418
- ), d = R(
419
- t,
418
+ ), d = L(
419
+ e,
420
420
  a,
421
421
  "right",
422
422
  I
423
- ), u = t.slice(l.from, d.to);
424
- nt(u, Ce, rt).forEach((T) => {
425
- const h = it(T[0]), g = e + l.from + T.index + 1, j = g + h.length;
426
- i.addMark(g, j, o.create());
423
+ ), u = e.slice(l.from, d.to);
424
+ nt(u, ke, rt).forEach((C) => {
425
+ const h = st(C[0]), g = t + l.from + C.index + 1, D = g + h.length;
426
+ s.addMark(g, D, o.create());
427
427
  });
428
428
  }
429
- function at(t) {
430
- let e = !1;
429
+ function at(e) {
430
+ let t = !1;
431
431
  return new ge({
432
432
  key: new f("autolink"),
433
- appendTransaction: (n, r, i) => {
434
- const o = n.some((u) => u.docChanged) && !r.doc.eq(i.doc);
435
- if (e && !o)
433
+ appendTransaction: (n, r, s) => {
434
+ const o = n.some((u) => u.docChanged) && !r.doc.eq(s.doc);
435
+ if (t && !o)
436
436
  return;
437
- const { tr: s } = i, { textContent: a } = i.doc;
438
- e || O(a, 0, 0, a.length, s, t.type), e = !0;
437
+ const { tr: i } = s, { textContent: a } = s.doc;
438
+ t || A(a, 0, 0, a.length, i, e.type), t = !0;
439
439
  const l = K(
440
440
  r.doc,
441
441
  [...n]
442
442
  );
443
- return V(l).forEach(({ oldRange: u, newRange: p }) => {
444
- ot(p, i.doc, s, t.type), z(
445
- i.doc,
443
+ return W(l).forEach(({ oldRange: u, newRange: p }) => {
444
+ ot(p, s.doc, i, e.type), V(
445
+ s.doc,
446
446
  p,
447
447
  (h) => h.isTextblock
448
448
  ).forEach(({ node: h, pos: g }) => {
449
- O(
449
+ A(
450
450
  h.textContent,
451
451
  g,
452
452
  u.from,
453
453
  p.to,
454
- s,
455
- t.type
454
+ i,
455
+ e.type
456
456
  );
457
457
  });
458
- }), s;
458
+ }), i;
459
459
  }
460
460
  });
461
461
  }
462
462
  const lt = {
463
463
  class: "d-link d-c-text d-d-inline-block d-wb-break-all",
464
464
  rel: "noopener noreferrer nofollow"
465
- }, ct = W.create({
465
+ }, ct = z.create({
466
466
  name: "CustomLink",
467
- renderHTML({ HTMLAttributes: t }) {
467
+ renderHTML({ HTMLAttributes: e }) {
468
468
  return [
469
469
  "a",
470
470
  m(
471
471
  this.options.HTMLAttributes,
472
- t,
472
+ e,
473
473
  lt
474
474
  )
475
475
  ];
476
476
  },
477
- renderText({ node: t }) {
478
- return t.attrs.text;
477
+ renderText({ node: e }) {
478
+ return e.attrs.text;
479
479
  },
480
480
  addProseMirrorPlugins() {
481
481
  return [
@@ -506,12 +506,12 @@ const lt = {
506
506
  }
507
507
  };
508
508
  }
509
- }).configure({ inline: !0, allowBase64: !0 }), ut = A.extend({
509
+ }).configure({ inline: !0, allowBase64: !0 }), ut = O.extend({
510
510
  parseHTML() {
511
511
  return [{ tag: "div" }];
512
512
  },
513
- renderHTML({ HTMLAttributes: t }) {
514
- return ["div", m(this.options.HTMLAttributes, t), 0];
513
+ renderHTML({ HTMLAttributes: e }) {
514
+ return ["div", m(this.options.HTMLAttributes, e), 0];
515
515
  }
516
516
  }), mt = {
517
517
  name: "MentionComponent",
@@ -527,14 +527,14 @@ const lt = {
527
527
  }
528
528
  };
529
529
  var ht = function() {
530
- var e = this, n = e._self._c;
531
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
530
+ var t = this, n = t._self._c;
531
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
532
532
  }, ft = [], pt = /* @__PURE__ */ c(
533
533
  mt,
534
534
  ht,
535
535
  ft
536
536
  );
537
- const gt = pt.exports, _t = L.extend({
537
+ const gt = pt.exports, _t = S.extend({
538
538
  addNodeView() {
539
539
  return v(gt);
540
540
  },
@@ -558,11 +558,11 @@ const gt = pt.exports, _t = L.extend({
558
558
  }
559
559
  };
560
560
  },
561
- renderText({ node: t }) {
562
- return `@${t.attrs.id}`;
561
+ renderText({ node: e }) {
562
+ return `@${e.attrs.id}`;
563
563
  },
564
- renderHTML({ HTMLAttributes: t }) {
565
- return ["mention-component", m(this.options.HTMLAttributes, t)];
564
+ renderHTML({ HTMLAttributes: e }) {
565
+ return ["mention-component", m(this.options.HTMLAttributes, e)];
566
566
  }
567
567
  }).configure({
568
568
  suggestion: {
@@ -583,17 +583,17 @@ const gt = pt.exports, _t = L.extend({
583
583
  }
584
584
  };
585
585
  var wt = function() {
586
- var e = this, n = e._self._c;
587
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
588
- }, vt = [], bt = /* @__PURE__ */ c(
586
+ var t = this, n = t._self._c;
587
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
588
+ }, vt = [], xt = /* @__PURE__ */ c(
589
589
  yt,
590
590
  wt,
591
591
  vt
592
592
  );
593
- const xt = bt.exports, Ct = L.extend({
593
+ const bt = xt.exports, kt = S.extend({
594
594
  name: "channel",
595
595
  addNodeView() {
596
- return v(xt);
596
+ return v(bt);
597
597
  },
598
598
  parseHTML() {
599
599
  return [
@@ -615,18 +615,18 @@ const xt = bt.exports, Ct = L.extend({
615
615
  }
616
616
  };
617
617
  },
618
- renderText({ node: t }) {
619
- return `#${t.attrs.id}`;
618
+ renderText({ node: e }) {
619
+ return `#${e.attrs.id}`;
620
620
  },
621
- renderHTML({ HTMLAttributes: t }) {
622
- return ["channel-component", m(this.options.HTMLAttributes, t)];
621
+ renderHTML({ HTMLAttributes: e }) {
622
+ return ["channel-component", m(this.options.HTMLAttributes, e)];
623
623
  }
624
624
  }).configure({
625
625
  suggestion: {
626
626
  char: "#",
627
627
  pluginKey: new f("channelSuggestion")
628
628
  }
629
- }), kt = {
629
+ }), Tt = {
630
630
  name: "SlashCommandsComponent",
631
631
  components: {
632
632
  NodeViewWrapper: _
@@ -642,27 +642,27 @@ const xt = bt.exports, Ct = L.extend({
642
642
  this.$parent.$emit("selected-command", this.$props.node.attrs.command);
643
643
  }
644
644
  };
645
- var Tt = function() {
646
- var e = this, n = e._self._c;
647
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [e._v(" " + e._s(e.text) + " ")]);
648
- }, Et = [], Rt = /* @__PURE__ */ c(
649
- kt,
645
+ var Ct = function() {
646
+ var t = this, n = t._self._c;
647
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [t._v(" " + t._s(t.text) + " ")]);
648
+ }, Et = [], Lt = /* @__PURE__ */ c(
650
649
  Tt,
650
+ Ct,
651
651
  Et
652
652
  );
653
- const St = Rt.exports, Lt = (t, e) => [...t.matchAll(e)].map((r) => {
654
- let i = r[2];
655
- return i.endsWith(" ") || (i += " "), {
653
+ const Rt = Lt.exports, St = (e, t) => [...e.matchAll(t)].map((r) => {
654
+ let s = r[2];
655
+ return s.endsWith(" ") || (s += " "), {
656
656
  index: r.index,
657
- text: i,
657
+ text: s,
658
658
  match: r
659
659
  };
660
- }), $t = L.extend({
660
+ }), $t = S.extend({
661
661
  name: "slash-commands",
662
662
  group: "inline",
663
663
  inline: !0,
664
664
  addNodeView() {
665
- return v(St);
665
+ return v(Rt);
666
666
  },
667
667
  parseHTML() {
668
668
  return [
@@ -684,18 +684,18 @@ const St = Rt.exports, Lt = (t, e) => [...t.matchAll(e)].map((r) => {
684
684
  }
685
685
  };
686
686
  },
687
- renderText({ node: t }) {
688
- return `/${t.attrs.command}`;
687
+ renderText({ node: e }) {
688
+ return `/${e.attrs.command}`;
689
689
  },
690
- renderHTML({ HTMLAttributes: t }) {
691
- return ["command-component", m(this.options.HTMLAttributes, t)];
690
+ renderHTML({ HTMLAttributes: e }) {
691
+ return ["command-component", m(this.options.HTMLAttributes, e)];
692
692
  },
693
693
  addInputRules() {
694
694
  var n;
695
- const t = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) $`);
695
+ const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) $`);
696
696
  return [
697
697
  X({
698
- find: e,
698
+ find: t,
699
699
  type: this.type,
700
700
  getAttributes(r) {
701
701
  return { command: r[2] };
@@ -705,10 +705,10 @@ const St = Rt.exports, Lt = (t, e) => [...t.matchAll(e)].map((r) => {
705
705
  },
706
706
  addPasteRules() {
707
707
  var n;
708
- const t = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) ?$`, "g");
708
+ const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
709
709
  return [
710
710
  E({
711
- find: (r) => Lt(r, e),
711
+ find: (r) => St(r, t),
712
712
  type: this.type,
713
713
  getAttributes(r) {
714
714
  return { command: r[0].trim() };
@@ -724,8 +724,8 @@ const St = Rt.exports, Lt = (t, e) => [...t.matchAll(e)].map((r) => {
724
724
  }), It = {
725
725
  name: "MentionSuggestion",
726
726
  components: {
727
- DtAvatar: Le,
728
- DtStack: b
727
+ DtAvatar: Se,
728
+ DtStack: x
729
729
  },
730
730
  props: {
731
731
  item: {
@@ -762,35 +762,35 @@ const St = Rt.exports, Lt = (t, e) => [...t.matchAll(e)].map((r) => {
762
762
  }
763
763
  }
764
764
  };
765
- var Ot = function() {
766
- var e = this, n = e._self._c;
767
- return n("dt-stack", { staticClass: "d-mention-suggestion__container", attrs: { direction: "row", gap: "400" } }, [n("dt-avatar", { attrs: { "full-name": e.name, "image-src": e.avatarSrc, "image-alt": e.name, "show-presence": e.showDetails, presence: e.presence, size: "sm" } }), n("dt-stack", { staticClass: "d-mention-suggestion__details-container", attrs: { gap: "100" } }, [n("span", { staticClass: "d-mention-suggestion__name" }, [e._v(" " + e._s(e.name) + " ")]), e.showDetails ? n("dt-stack", { staticClass: "d-label--sm-plain", attrs: { direction: "row", gap: "300" } }, [e.presenceText ? n("span", { staticClass: "d-mention-suggestion__presence", class: [e.presenceFontColorClass] }, [e._v(" " + e._s(e.presenceText) + " ")]) : e._e(), e.status && e.presenceText ? n("div", { staticClass: "d-mention-suggestion__divider" }, [e._v(" • ")]) : e._e(), e.status ? n("div", { staticClass: "d-mention-suggestion__status" }, [e._v(" " + e._s(e.status) + " ")]) : e._e()]) : e._e()], 1)], 1);
768
- }, At = [], Dt = /* @__PURE__ */ c(
765
+ var At = function() {
766
+ var t = this, n = t._self._c;
767
+ return n("dt-stack", { staticClass: "d-mention-suggestion__container", attrs: { direction: "row", gap: "400" } }, [n("dt-avatar", { attrs: { "full-name": t.name, "image-src": t.avatarSrc, "image-alt": t.name, "show-presence": t.showDetails, presence: t.presence, size: "sm" } }), n("dt-stack", { staticClass: "d-mention-suggestion__details-container", attrs: { gap: "100" } }, [n("span", { staticClass: "d-mention-suggestion__name" }, [t._v(" " + t._s(t.name) + " ")]), t.showDetails ? n("dt-stack", { staticClass: "d-label--sm-plain", attrs: { direction: "row", gap: "300" } }, [t.presenceText ? n("span", { staticClass: "d-mention-suggestion__presence", class: [t.presenceFontColorClass] }, [t._v(" " + t._s(t.presenceText) + " ")]) : t._e(), t.status && t.presenceText ? n("div", { staticClass: "d-mention-suggestion__divider" }, [t._v(" • ")]) : t._e(), t.status ? n("div", { staticClass: "d-mention-suggestion__status" }, [t._v(" " + t._s(t.status) + " ")]) : t._e()]) : t._e()], 1)], 1);
768
+ }, Ot = [], Bt = /* @__PURE__ */ c(
769
769
  It,
770
- Ot,
771
- At
770
+ At,
771
+ Ot
772
772
  );
773
- const Bt = Dt.exports, Mt = {
773
+ const Pt = Bt.exports, Mt = {
774
774
  // This function comes from the user and passed to the editor directly.
775
775
  // This will also activate the mention plugin on the editor
776
776
  // items: ({ query }) => { return [] },
777
777
  allowSpaces: !0,
778
778
  render: () => {
779
- let t, e, n = !1;
779
+ let e, t, n = !1;
780
780
  return {
781
781
  onStart: (r) => {
782
- t = new w(C, {
782
+ e = new w(k, {
783
783
  parent: void 0,
784
784
  propsData: {
785
- itemComponent: Bt,
785
+ itemComponent: Pt,
786
786
  itemType: "mention",
787
787
  ...r
788
788
  },
789
789
  editor: r.editor
790
- }), r.clientRect && (e = x("body", {
790
+ }), r.clientRect && (t = b("body", {
791
791
  getReferenceClientRect: r.clientRect,
792
792
  appendTo: () => document.body,
793
- content: t.element,
793
+ content: e.element,
794
794
  showOnCreate: !1,
795
795
  onShow: () => {
796
796
  n = !0;
@@ -802,28 +802,28 @@ const Bt = Dt.exports, Mt = {
802
802
  trigger: "manual",
803
803
  placement: "top-start",
804
804
  zIndex: 650,
805
- plugins: [k]
806
- }), r.items.length > 0 && (e == null || e[0].show()));
805
+ plugins: [T]
806
+ }), r.items.length > 0 && (t == null || t[0].show()));
807
807
  },
808
808
  onUpdate(r) {
809
- t == null || t.updateProps(r), r.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), r.clientRect && (e == null || e[0].setProps({
809
+ e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
810
810
  getReferenceClientRect: r.clientRect
811
811
  }));
812
812
  },
813
813
  onKeyDown(r) {
814
- var i;
814
+ var s;
815
815
  if (n)
816
- return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(r);
816
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
817
817
  },
818
818
  onExit() {
819
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
819
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
820
820
  }
821
821
  };
822
822
  }
823
- }, jt = {
823
+ }, Dt = {
824
824
  name: "ChannelSuggestion",
825
825
  components: {
826
- DtStack: b,
826
+ DtStack: x,
827
827
  DtIconHash: $e,
828
828
  DtIconLock: Ie
829
829
  },
@@ -840,23 +840,23 @@ const Bt = Dt.exports, Mt = {
840
840
  }
841
841
  };
842
842
  var Ht = function() {
843
- var e = this, n = e._self._c;
844
- return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [e.item.locked ? n("dt-icon-lock", { attrs: { size: "300" } }) : n("dt-icon-hash", { attrs: { size: "300" } }), n("span", [e._v(e._s(e.name))])], 1);
845
- }, Pt = [], Ft = /* @__PURE__ */ c(
846
- jt,
843
+ var t = this, n = t._self._c;
844
+ return n("dt-stack", { attrs: { direction: "row", gap: "400" } }, [t.item.locked ? n("dt-icon-lock", { attrs: { size: "300" } }) : n("dt-icon-hash", { attrs: { size: "300" } }), n("span", [t._v(t._s(t.name))])], 1);
845
+ }, jt = [], Ft = /* @__PURE__ */ c(
846
+ Dt,
847
847
  Ht,
848
- Pt
848
+ jt
849
849
  );
850
- const Nt = Ft.exports, Ut = {
850
+ const Nt = Ft.exports, qt = {
851
851
  // This function comes from the user and passed to the editor directly.
852
852
  // This will also activate the mention plugin on the editor
853
853
  // items: ({ query }) => { return [] },
854
854
  allowSpaces: !0,
855
855
  render: () => {
856
- let t, e, n = !1;
856
+ let e, t, n = !1;
857
857
  return {
858
858
  onStart: (r) => {
859
- t = new w(C, {
859
+ e = new w(k, {
860
860
  parent: void 0,
861
861
  propsData: {
862
862
  itemComponent: Nt,
@@ -864,10 +864,10 @@ const Nt = Ft.exports, Ut = {
864
864
  ...r
865
865
  },
866
866
  editor: r.editor
867
- }), r.clientRect && (e = x("body", {
867
+ }), r.clientRect && (t = b("body", {
868
868
  getReferenceClientRect: r.clientRect,
869
869
  appendTo: () => document.body,
870
- content: t.element,
870
+ content: e.element,
871
871
  showOnCreate: !1,
872
872
  onShow: () => {
873
873
  n = !0;
@@ -879,25 +879,25 @@ const Nt = Ft.exports, Ut = {
879
879
  trigger: "manual",
880
880
  placement: "top-start",
881
881
  zIndex: 650,
882
- plugins: [k]
883
- }), r.items.length > 0 && (e == null || e[0].show()));
882
+ plugins: [T]
883
+ }), r.items.length > 0 && (t == null || t[0].show()));
884
884
  },
885
885
  onUpdate(r) {
886
- t == null || t.updateProps(r), r.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), r.clientRect && (e == null || e[0].setProps({
886
+ e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
887
887
  getReferenceClientRect: r.clientRect
888
888
  }));
889
889
  },
890
890
  onKeyDown(r) {
891
- var i;
891
+ var s;
892
892
  if (n)
893
- return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(r);
893
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
894
894
  },
895
895
  onExit() {
896
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
896
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
897
897
  }
898
898
  };
899
899
  }
900
- }, qt = {
900
+ }, Ut = {
901
901
  name: "SlashCommandSuggestion",
902
902
  props: {
903
903
  item: {
@@ -918,35 +918,35 @@ const Nt = Ft.exports, Ut = {
918
918
  }
919
919
  };
920
920
  var Kt = function() {
921
- var e = this, n = e._self._c;
922
- return n("div", [n("div", { staticClass: "d-body--md-compact" }, [n("span", [e._v("/" + e._s(e.command))]), e.parametersExample ? n("span", [e._v(" " + e._s(e.parametersExample))]) : e._e()]), n("div", { staticClass: "d-body--sm d-fc-tertiary" }, [e._v(" " + e._s(e.description) + " ")])]);
923
- }, Vt = [], zt = /* @__PURE__ */ c(
924
- qt,
921
+ var t = this, n = t._self._c;
922
+ return n("div", [n("div", { staticClass: "d-body--md-compact" }, [n("span", [t._v("/" + t._s(t.command))]), t.parametersExample ? n("span", [t._v(" " + t._s(t.parametersExample))]) : t._e()]), n("div", { staticClass: "d-body--sm d-fc-tertiary" }, [t._v(" " + t._s(t.description) + " ")])]);
923
+ }, Wt = [], Vt = /* @__PURE__ */ c(
924
+ Ut,
925
925
  Kt,
926
- Vt
926
+ Wt
927
927
  );
928
- const Wt = zt.exports, Xt = {
928
+ const zt = Vt.exports, Xt = {
929
929
  // This function comes from the user and passed to the editor directly.
930
930
  // This will also activate the mention plugin on the editor
931
931
  // items: ({ query }) => { return [] },
932
932
  allowSpaces: !0,
933
933
  startOfLine: !0,
934
934
  render: () => {
935
- let t, e, n = !1;
935
+ let e, t, n = !1;
936
936
  return {
937
937
  onStart: (r) => {
938
- t = new w(C, {
938
+ e = new w(k, {
939
939
  parent: void 0,
940
940
  propsData: {
941
- itemComponent: Wt,
941
+ itemComponent: zt,
942
942
  itemType: "slash-command",
943
943
  ...r
944
944
  },
945
945
  editor: r.editor
946
- }), r.clientRect && (e = x("body", {
946
+ }), r.clientRect && (t = b("body", {
947
947
  getReferenceClientRect: r.clientRect,
948
948
  appendTo: () => document.body,
949
- content: t.element,
949
+ content: e.element,
950
950
  showOnCreate: !1,
951
951
  onShow: () => {
952
952
  n = !0;
@@ -958,21 +958,21 @@ const Wt = zt.exports, Xt = {
958
958
  trigger: "manual",
959
959
  placement: "top-start",
960
960
  zIndex: 650,
961
- plugins: [k]
962
- }), r.items.length > 0 && (e == null || e[0].show()));
961
+ plugins: [T]
962
+ }), r.items.length > 0 && (t == null || t[0].show()));
963
963
  },
964
964
  onUpdate(r) {
965
- t == null || t.updateProps(r), r.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), r.clientRect && (e == null || e[0].setProps({
965
+ e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), r.clientRect && (t == null || t[0].setProps({
966
966
  getReferenceClientRect: r.clientRect
967
967
  }));
968
968
  },
969
969
  onKeyDown(r) {
970
- var i;
970
+ var s;
971
971
  if (n)
972
- return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(r);
972
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
973
973
  },
974
974
  onExit() {
975
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
975
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
976
976
  }
977
977
  };
978
978
  }
@@ -980,11 +980,11 @@ const Wt = zt.exports, Xt = {
980
980
  name: "DtRichTextEditor",
981
981
  components: {
982
982
  EditorContent: H,
983
- BubbleMenu: P,
984
- DtButton: Ae,
985
- DtStack: b
983
+ BubbleMenu: j,
984
+ DtButton: Oe,
985
+ DtStack: x
986
986
  },
987
- mixins: [De],
987
+ mixins: [Be],
988
988
  props: {
989
989
  /**
990
990
  * Value of the input. The object format should match TipTap's JSON
@@ -1054,8 +1054,8 @@ const Wt = zt.exports, Xt = {
1054
1054
  autoFocus: {
1055
1055
  type: [Boolean, String, Number],
1056
1056
  default: !1,
1057
- validator(t) {
1058
- return typeof t == "string" ? Re.includes(t) : !0;
1057
+ validator(e) {
1058
+ return typeof e == "string" ? Le.includes(e) : !0;
1059
1059
  }
1060
1060
  },
1061
1061
  /**
@@ -1067,8 +1067,8 @@ const Wt = zt.exports, Xt = {
1067
1067
  outputFormat: {
1068
1068
  type: String,
1069
1069
  default: "html",
1070
- validator(t) {
1071
- return Se.includes(t);
1070
+ validator(e) {
1071
+ return Re.includes(e);
1072
1072
  }
1073
1073
  },
1074
1074
  /**
@@ -1320,8 +1320,8 @@ const Wt = zt.exports, Xt = {
1320
1320
  editor: null,
1321
1321
  tippyOptions: {
1322
1322
  appendTo: () => {
1323
- var t;
1324
- return (t = this.$refs.editor.$el.getRootNode()) == null ? void 0 : t.querySelector("body");
1323
+ var e;
1324
+ return (e = this.$refs.editor.$el.getRootNode()) == null ? void 0 : e.querySelector("body");
1325
1325
  },
1326
1326
  placement: "top-start"
1327
1327
  }
@@ -1341,50 +1341,50 @@ const Wt = zt.exports, Xt = {
1341
1341
  },
1342
1342
  // eslint-disable-next-line complexity
1343
1343
  extensions() {
1344
- const t = [Z, de, me, te];
1345
- t.push(this.useDivTags ? ut : A), this.allowBlockquote && t.push(Y), this.allowBold && t.push(ne), this.allowBulletList && (t.push(re), t.push(oe.extend({
1344
+ const e = [Z, de, me, te];
1345
+ e.push(this.useDivTags ? ut : O), this.allowBlockquote && e.push(Y), this.allowBold && e.push(ne), this.allowBulletList && (e.push(re), e.push(oe.extend({
1346
1346
  renderText({ node: r }) {
1347
1347
  return r.textContent;
1348
1348
  }
1349
- })), t.push(ae)), this.allowItalic && t.push(ie), this.allowStrike && t.push(le), this.allowUnderline && t.push(ce), this.placeholder && t.push(
1349
+ })), e.push(ae)), this.allowItalic && e.push(se), this.allowStrike && e.push(le), this.allowUnderline && e.push(ce), this.placeholder && e.push(
1350
1350
  ee.configure({ placeholder: this.placeholder })
1351
1351
  );
1352
- const e = this, n = J.create({
1352
+ const t = this, n = J.create({
1353
1353
  addKeyboardShortcuts() {
1354
1354
  return {
1355
- "Shift-Enter": ({ editor: r }) => e.allowLineBreaks ? !1 : (r.commands.first(({ commands: i }) => [
1356
- () => i.newlineInCode(),
1357
- () => e.allowBulletList && i.splitListItem("listItem"),
1358
- () => i.createParagraphNear(),
1359
- () => i.liftEmptyBlock(),
1360
- () => i.splitBlock()
1355
+ "Shift-Enter": ({ editor: r }) => t.allowLineBreaks ? !1 : (r.commands.first(({ commands: s }) => [
1356
+ () => s.newlineInCode(),
1357
+ () => t.allowBulletList && s.splitListItem("listItem"),
1358
+ () => s.createParagraphNear(),
1359
+ () => s.liftEmptyBlock(),
1360
+ () => s.splitBlock()
1361
1361
  ]), !0),
1362
- Enter: () => e.allowLineBreaks ? !1 : (e.$emit("enter"), !0)
1362
+ Enter: () => t.allowLineBreaks ? !1 : (t.$emit("enter"), !0)
1363
1363
  };
1364
1364
  }
1365
1365
  });
1366
- if (t.push(n), this.link && t.push(se.extend({ inclusive: !1 }).configure({
1366
+ if (e.push(n), this.link && e.push(ie.extend({ inclusive: !1 }).configure({
1367
1367
  HTMLAttributes: {
1368
1368
  class: "d-link d-wb-break-all"
1369
1369
  },
1370
1370
  openOnClick: !1,
1371
1371
  autolink: !0,
1372
1372
  protocols: $
1373
- })), this.customLink && t.push(this.getExtension(ct, this.customLink)), this.mentionSuggestion) {
1373
+ })), this.customLink && e.push(this.getExtension(ct, this.customLink)), this.mentionSuggestion) {
1374
1374
  const r = { ...this.mentionSuggestion, ...Mt };
1375
- t.push(_t.configure({ suggestion: r }));
1375
+ e.push(_t.configure({ suggestion: r }));
1376
1376
  }
1377
1377
  if (this.channelSuggestion) {
1378
- const r = { ...this.channelSuggestion, ...Ut };
1379
- t.push(Ct.configure({ suggestion: r }));
1378
+ const r = { ...this.channelSuggestion, ...qt };
1379
+ e.push(kt.configure({ suggestion: r }));
1380
1380
  }
1381
1381
  if (this.slashCommandSuggestion) {
1382
1382
  const r = { ...this.slashCommandSuggestion, ...Xt };
1383
- t.push($t.configure({ suggestion: r }));
1383
+ e.push($t.configure({ suggestion: r }));
1384
1384
  }
1385
- return t.push(tt), t.push(ue.configure({
1385
+ return e.push(tt), e.push(ue.configure({
1386
1386
  types: ["paragraph"]
1387
- })), this.allowCode && t.push(Q), this.allowCodeblock && t.push(G.extend({
1387
+ })), this.allowCode && e.push(Q), this.allowCodeblock && e.push(G.extend({
1388
1388
  renderText({ node: r }) {
1389
1389
  return `\`\`\`
1390
1390
  ${r.textContent}
@@ -1394,15 +1394,15 @@ ${r.textContent}
1394
1394
  HTMLAttributes: {
1395
1395
  class: "d-rich-text-editor__code-block"
1396
1396
  }
1397
- })), this.allowInlineImages && t.push(dt), (this.allowFontFamily || this.allowFontColor) && (t.push(he), this.allowFontColor && t.push(fe), this.allowFontFamily && t.push(pe)), this.additionalExtensions.length && t.push(...this.additionalExtensions), t;
1397
+ })), this.allowInlineImages && e.push(dt), (this.allowFontFamily || this.allowFontColor) && (e.push(he), this.allowFontColor && e.push(fe), this.allowFontFamily && e.push(pe)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
1398
1398
  },
1399
1399
  inputAttrs() {
1400
- const t = {
1400
+ const e = {
1401
1401
  "aria-label": this.inputAriaLabel,
1402
1402
  "aria-multiline": !0,
1403
1403
  role: "textbox"
1404
1404
  };
1405
- return this.editable || (t["aria-readonly"] = !0), t;
1405
+ return this.editable || (e["aria-readonly"] = !0), e;
1406
1406
  }
1407
1407
  },
1408
1408
  /**
@@ -1411,20 +1411,20 @@ ${r.textContent}
1411
1411
  * to be hooked up to the Editor's own API.
1412
1412
  */
1413
1413
  watch: {
1414
- editable(t) {
1415
- this.editor.setEditable(t), this.updateEditorAttributes({ "aria-readonly": !t });
1414
+ editable(e) {
1415
+ this.editor.setEditable(e), this.updateEditorAttributes({ "aria-readonly": !e });
1416
1416
  },
1417
- inputClass(t) {
1418
- this.updateEditorAttributes({ class: t });
1417
+ inputClass(e) {
1418
+ this.updateEditorAttributes({ class: e });
1419
1419
  },
1420
- inputAriaLabel(t) {
1421
- this.updateEditorAttributes({ "aria-label": t });
1420
+ inputAriaLabel(e) {
1421
+ this.updateEditorAttributes({ "aria-label": e });
1422
1422
  },
1423
1423
  extensions() {
1424
1424
  this.destroyEditor(), this.createEditor();
1425
1425
  },
1426
- value(t) {
1427
- this.processValue(t);
1426
+ value(e) {
1427
+ this.processValue(e);
1428
1428
  }
1429
1429
  },
1430
1430
  created() {
@@ -1434,7 +1434,7 @@ ${r.textContent}
1434
1434
  this.destroyEditor();
1435
1435
  },
1436
1436
  mounted() {
1437
- Te(this.$el, this.$options.name), this.processValue(this.value, !1);
1437
+ Ce(this.$el, this.$options.name), this.processValue(this.value, !1);
1438
1438
  },
1439
1439
  methods: {
1440
1440
  createEditor() {
@@ -1451,84 +1451,142 @@ ${r.textContent}
1451
1451
  ...this.inputAttrs,
1452
1452
  class: this.inputClass
1453
1453
  },
1454
- handlePaste: (t, e, n) => {
1455
- if (!this.pasteRichText) {
1456
- const i = (e.clipboardData || window.clipboardData).getData("text/plain");
1457
- if (i) {
1458
- const { tr: o } = t.state, { from: s, to: a } = t.state.selection;
1459
- return o.insertText(i, s, a), t.dispatch(o), !0;
1460
- }
1461
- }
1462
- return !1;
1454
+ handlePaste: (e, t, n) => {
1455
+ const r = t.clipboardData || window.clipboardData, s = r.getData("text/plain"), o = r.getData("text/html");
1456
+ return this.processPasteData(e, s, o);
1463
1457
  },
1464
1458
  // Moves the <br /> tags inside the previous closing tag to avoid
1465
1459
  // Prosemirror wrapping them within another </p> tag.
1466
- transformPastedHTML(t) {
1467
- return t.replace(/<br\s*\/?>/gi, "<br />").replace(/(<\/(?:p|div)>)\s*\n/gi, "$1<br />").replace(/\n(?=\S)/g, "<br />").replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1460
+ transformPastedHTML(e) {
1461
+ return e.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1468
1462
  }
1469
1463
  }
1470
1464
  }), this.addEditorListeners();
1471
1465
  },
1472
- bubbleMenuShouldShow({ editor: t, view: e, state: n, oldState: r, from: i, to: o }) {
1473
- return t.isActive("link");
1466
+ bubbleMenuShouldShow({ editor: e, view: t, state: n, oldState: r, from: s, to: o }) {
1467
+ return e.isActive("link");
1474
1468
  },
1475
1469
  /**
1476
1470
  * If the selection contains a link, return the existing link text.
1477
1471
  * Otherwise, use just the selected text.
1478
1472
  * @param editor the editor instance.
1479
1473
  */
1480
- getSelectedLinkText(t) {
1474
+ getSelectedLinkText(e) {
1481
1475
  var a, l, d;
1482
- const { view: e, state: n } = t, { from: r, to: i } = e.state.selection, o = n.doc.textBetween(r, i, ""), s = this.editor.state.doc.nodeAt(r);
1483
- return s && ((d = (l = (a = s.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : d.name) === "link" ? s.textContent : o;
1476
+ const { view: t, state: n } = e, { from: r, to: s } = t.state.selection, o = n.doc.textBetween(r, s, ""), i = this.editor.state.doc.nodeAt(r);
1477
+ return i && ((d = (l = (a = i.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : d.name) === "link" ? i.textContent : o;
1484
1478
  },
1485
1479
  editLink() {
1486
- const t = this.getSelectedLinkText(this.editor), e = {
1480
+ const e = this.getSelectedLinkText(this.editor), t = {
1487
1481
  href: this.editor.getAttributes("link").href,
1488
- text: t
1482
+ text: e
1489
1483
  };
1490
- this.$emit("edit-link", e);
1484
+ this.$emit("edit-link", t);
1491
1485
  },
1492
1486
  removeLink() {
1493
- var t, e, n, r;
1494
- (r = (n = (e = (t = this.editor) == null ? void 0 : t.chain()) == null ? void 0 : e.focus()) == null ? void 0 : n.unsetLink()) == null || r.run();
1487
+ var e, t, n, r;
1488
+ (r = (n = (t = (e = this.editor) == null ? void 0 : e.chain()) == null ? void 0 : t.focus()) == null ? void 0 : n.unsetLink()) == null || r.run();
1495
1489
  },
1496
1490
  openLink() {
1497
- var e, n;
1498
- (n = (e = this.editor) == null ? void 0 : e.chain()) == null || n.focus();
1499
- const t = this.editor.getAttributes("link").href;
1500
- window.open(t, "_blank");
1491
+ var t, n;
1492
+ (n = (t = this.editor) == null ? void 0 : t.chain()) == null || n.focus();
1493
+ const e = this.editor.getAttributes("link").href;
1494
+ window.open(e, "_blank");
1501
1495
  },
1502
1496
  // eslint-disable-next-line complexity
1503
- setLink(t, e, n, r = $, i) {
1497
+ setLink(e, t, n, r = $, s) {
1504
1498
  var a, l, d;
1505
- if (!t) {
1499
+ if (!e) {
1506
1500
  this.removeLink();
1507
1501
  return;
1508
1502
  }
1509
- r.find((u) => u.test(t)) || (t = `${i}${t}`), this.editor.chain().focus().extendMarkRange("link").run();
1510
- const s = (d = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : d.selection;
1511
- this.editor.chain().focus().insertContent(e).setTextSelection({ from: s.from, to: s.from + e.length }).setLink({ href: t, class: n.class }).run();
1503
+ r.find((u) => u.test(e)) || (e = `${s}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1504
+ const i = (d = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : d.selection;
1505
+ this.editor.chain().focus().insertContent(t).setTextSelection({ from: i.from, to: i.from + t.length }).setLink({ href: e, class: n.class }).run();
1512
1506
  },
1513
1507
  // eslint-disable-next-line complexity
1514
- processValue(t, e = !0) {
1508
+ processValue(e, t = !0) {
1515
1509
  const n = this.getOutput();
1516
- if (!(e && Oe(t, n))) {
1517
- if (typeof t == "string" && this.outputFormat === "text") {
1518
- const r = new RegExp(`(${D})`, "g");
1519
- t = t == null ? void 0 : t.replace(r, '<emoji-component code="$1"></emoji-component>');
1510
+ if (!(t && Ae(e, n))) {
1511
+ if (typeof e == "string" && this.outputFormat === "text") {
1512
+ const r = new RegExp(`(${B})`, "g");
1513
+ e = e == null ? void 0 : e.replace(r, '<emoji-component code="$1"></emoji-component>');
1520
1514
  }
1521
- this.editor.commands.setContent(t, !1);
1515
+ this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
1522
1516
  }
1523
1517
  },
1524
1518
  destroyEditor() {
1525
1519
  this.editor.destroy();
1526
1520
  },
1521
+ insertPlainTextWithHardBreaks(e, t) {
1522
+ const { tr: n } = e.state, { from: r, to: s } = e.state.selection;
1523
+ n.deleteRange(r, s);
1524
+ const o = t.split(/\r?\n/);
1525
+ let i = r;
1526
+ for (let a = 0; a < o.length; a++)
1527
+ a > 0 && (n.insert(i, e.state.schema.nodes.hardBreak.create()), i++), n.insertText(o[a], i), i += o[a].length;
1528
+ e.dispatch(n);
1529
+ },
1530
+ shouldPreserveLineBreaks(e, t) {
1531
+ return this.pasteRichText ? !t && e && this.hasBlankLines(e) : !!e;
1532
+ },
1533
+ processPasteData(e, t, n) {
1534
+ if (this.shouldPreserveLineBreaks(t, n))
1535
+ return this.insertPlainTextWithHardBreaks(e, t), !0;
1536
+ if (this.shouldHandlePreformattedHTML(n)) {
1537
+ const r = this.extractPreformattedText(n);
1538
+ if (r && r.includes(`
1539
+ `))
1540
+ return this.insertPlainTextWithHardBreaks(e, r), !0;
1541
+ }
1542
+ return !1;
1543
+ },
1544
+ shouldHandlePreformattedHTML(e) {
1545
+ return this.pasteRichText && e && this.containsPreformattedContent(e);
1546
+ },
1547
+ containsPreformattedContent(e) {
1548
+ const t = document.createElement("div");
1549
+ t.innerHTML = e;
1550
+ const n = t.querySelectorAll("*");
1551
+ for (const r of n)
1552
+ if (this.hasPreWhitespace(r) && this.hasLineBreaks(r))
1553
+ return !0;
1554
+ return !1;
1555
+ },
1556
+ hasPreWhitespace(e) {
1557
+ const t = e.getAttribute("style") || "", n = e.style.whiteSpace || "", r = n === "pre" || n === "pre-wrap", s = t.includes("white-space: pre");
1558
+ return r || s;
1559
+ },
1560
+ hasLineBreaks(e) {
1561
+ return e.textContent && e.textContent.includes(`
1562
+ `);
1563
+ },
1564
+ hasBlankLines(e) {
1565
+ return e.includes(`
1566
+
1567
+ `) || /\n\s*\n/.test(e);
1568
+ },
1569
+ extractPreformattedText(e) {
1570
+ const t = document.createElement("div");
1571
+ return t.innerHTML = e, this.walkAndExtractText(t);
1572
+ },
1573
+ walkAndExtractText(e) {
1574
+ let t = "";
1575
+ if (e.nodeType === Node.TEXT_NODE)
1576
+ t += e.textContent;
1577
+ else if (e.nodeType === Node.ELEMENT_NODE)
1578
+ if (this.hasPreWhitespace(e))
1579
+ t += e.textContent;
1580
+ else
1581
+ for (const n of e.childNodes)
1582
+ t += this.walkAndExtractText(n);
1583
+ return t;
1584
+ },
1527
1585
  triggerInputChangeEvents() {
1528
- const t = this.getOutput();
1529
- this.$emit("input", t), this.$emit("update:value", t);
1530
- const e = this.editor.getJSON();
1531
- this.$emit("json-input", e);
1586
+ const e = this.getOutput();
1587
+ this.$emit("input", e), this.$emit("update:value", e);
1588
+ const t = this.editor.getJSON();
1589
+ this.$emit("json-input", t);
1532
1590
  const n = this.editor.getHTML();
1533
1591
  this.$emit("html-input", n);
1534
1592
  const r = this.editor.getText({ blockSeparator: `
@@ -1543,18 +1601,18 @@ ${r.textContent}
1543
1601
  this.editor.on("create", () => {
1544
1602
  this.triggerInputChangeEvents();
1545
1603
  }), this.editor.on("update", () => {
1546
- var t, e;
1547
- if (this.preventTyping && ((e = (t = this.editor.view) == null ? void 0 : t.input) == null ? void 0 : e.lastKeyCode) !== 8) {
1604
+ var e, t;
1605
+ if (this.preventTyping && ((t = (e = this.editor.view) == null ? void 0 : e.input) == null ? void 0 : t.lastKeyCode) !== 8) {
1548
1606
  this.editor.commands.setContent(this.value, !1);
1549
1607
  return;
1550
1608
  }
1551
1609
  this.triggerInputChangeEvents();
1552
- }), this.editor.on("selectionUpdate", ({ editor: t }) => {
1553
- this.$emit("selected", this.getSelectedLinkText(t));
1554
- }), this.editor.on("focus", ({ event: t }) => {
1555
- this.$emit("focus", t);
1556
- }), this.editor.on("blur", ({ event: t }) => {
1557
- this.$emit("blur", t);
1610
+ }), this.editor.on("selectionUpdate", ({ editor: e }) => {
1611
+ this.$emit("selected", this.getSelectedLinkText(e));
1612
+ }), this.editor.on("focus", ({ event: e }) => {
1613
+ this.$emit("focus", e);
1614
+ }), this.editor.on("blur", ({ event: e }) => {
1615
+ this.$emit("blur", e);
1558
1616
  });
1559
1617
  },
1560
1618
  getOutput() {
@@ -1569,17 +1627,17 @@ ${r.textContent}
1569
1627
  ` });
1570
1628
  }
1571
1629
  },
1572
- getExtension(t, e) {
1630
+ getExtension(e, t) {
1573
1631
  var n;
1574
- return typeof e == "boolean" ? t : (n = t.configure) == null ? void 0 : n.call(t, e);
1632
+ return typeof t == "boolean" ? e : (n = e.configure) == null ? void 0 : n.call(e, t);
1575
1633
  },
1576
- updateEditorAttributes(t) {
1634
+ updateEditorAttributes(e) {
1577
1635
  this.editor.setOptions({
1578
1636
  editorProps: {
1579
1637
  attributes: {
1580
1638
  ...this.inputAttrs,
1581
1639
  class: this.inputClass,
1582
- ...t
1640
+ ...e
1583
1641
  }
1584
1642
  }
1585
1643
  });
@@ -1590,8 +1648,8 @@ ${r.textContent}
1590
1648
  }
1591
1649
  };
1592
1650
  var Yt = function() {
1593
- var e = this, n = e._self._c;
1594
- return n("div", [e.editor && e.link && !e.hideLinkBubbleMenu ? n("bubble-menu", { staticStyle: { visibility: "visible" }, attrs: { editor: e.editor, "should-show": e.bubbleMenuShouldShow, "tippy-options": e.tippyOptions } }, [n("div", { staticClass: "d-popover__dialog" }, [n("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { direction: "row", gap: "0" } }, [n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: e.editLink } }, [e._v(" " + e._s(e.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: e.openLink } }, [e._v(" " + e._s(e.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "danger", importance: "clear" }, on: { click: e.removeLink } }, [e._v(" " + e._s(e.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")) + " ")])], 1)], 1)]) : e._e(), n("editor-content", e._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { editor: e.editor, "data-qa": "dt-rich-text-editor" } }, e.editorListeners))], 1);
1651
+ var t = this, n = t._self._c;
1652
+ return n("div", [t.editor && t.link && !t.hideLinkBubbleMenu ? n("bubble-menu", { staticStyle: { visibility: "visible" }, attrs: { editor: t.editor, "should-show": t.bubbleMenuShouldShow, "tippy-options": t.tippyOptions } }, [n("div", { staticClass: "d-popover__dialog" }, [n("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { direction: "row", gap: "0" } }, [n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.editLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.openLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")) + " ")]), n("dt-button", { attrs: { kind: "danger", importance: "clear" }, on: { click: t.removeLink } }, [t._v(" " + t._s(t.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")) + " ")])], 1)], 1)]) : t._e(), n("editor-content", t._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { editor: t.editor, "data-qa": "dt-rich-text-editor" } }, t.editorListeners))], 1);
1595
1653
  }, Gt = [], Qt = /* @__PURE__ */ c(
1596
1654
  Jt,
1597
1655
  Yt,