@dialpad/dialtone 9.131.1 → 9.132.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 (52) hide show
  1. package/dist/css/dialtone-default-theme.css +1783 -5185
  2. package/dist/css/dialtone-default-theme.min.css +1 -1
  3. package/dist/css/dialtone-docs.json +1 -1
  4. package/dist/css/dialtone.css +622 -1999
  5. package/dist/css/dialtone.min.css +1 -1
  6. package/dist/tokens/doc.json +46028 -46028
  7. package/dist/vue2/common/emoji/index.cjs +1 -1
  8. package/dist/vue2/common/emoji/index.cjs.map +1 -1
  9. package/dist/vue2/common/emoji/index.js +25 -17
  10. package/dist/vue2/common/emoji/index.js.map +1 -1
  11. package/dist/vue2/component-documentation.json +1 -1
  12. package/dist/vue2/lib/emoji/emoji.cjs +1 -1
  13. package/dist/vue2/lib/emoji/emoji.cjs.map +1 -1
  14. package/dist/vue2/lib/emoji/emoji.js +16 -16
  15. package/dist/vue2/lib/emoji/emoji.js.map +1 -1
  16. package/dist/vue2/lib/message-input/message-input.cjs +1 -1
  17. package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
  18. package/dist/vue2/lib/message-input/message-input.js +14 -7
  19. package/dist/vue2/lib/message-input/message-input.js.map +1 -1
  20. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +7 -7
  21. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  22. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +387 -402
  23. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  24. package/dist/vue2/types/common/emoji/index.d.ts.map +1 -1
  25. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/emoji.d.ts.map +1 -1
  26. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts +1 -1
  27. package/dist/vue2/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts.map +1 -1
  28. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +1 -1
  29. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  30. package/dist/vue3/common/emoji/index.cjs +1 -1
  31. package/dist/vue3/common/emoji/index.cjs.map +1 -1
  32. package/dist/vue3/common/emoji/index.js +39 -33
  33. package/dist/vue3/common/emoji/index.js.map +1 -1
  34. package/dist/vue3/component-documentation.json +1 -1
  35. package/dist/vue3/lib/emoji/emoji.cjs +1 -1
  36. package/dist/vue3/lib/emoji/emoji.cjs.map +1 -1
  37. package/dist/vue3/lib/emoji/emoji.js +17 -17
  38. package/dist/vue3/lib/emoji/emoji.js.map +1 -1
  39. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  40. package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
  41. package/dist/vue3/lib/message-input/message-input.js +59 -51
  42. package/dist/vue3/lib/message-input/message-input.js.map +1 -1
  43. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
  44. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  45. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +125 -119
  46. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  47. package/dist/vue3/types/common/emoji/index.d.ts.map +1 -1
  48. package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts +1 -1
  49. package/dist/vue3/types/components/rich_text_editor/extensions/emoji/suggestion.d.ts.map +1 -1
  50. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +2 -1
  51. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  52. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- import { nodeViewProps as _, NodeViewWrapper as y, VueRenderer as w, VueNodeViewRenderer as v, BubbleMenu as H, EditorContent as j, Editor as N } from "../../node_modules/@tiptap/vue-2.js";
2
- import { Node as F, nodePasteRule as E, InputRule as K, mergeAttributes as m, getMarksBetween as q, combineTransactionSteps as U, getChangedRanges as z, findChildrenInRange as W, Mark as V, nodeInputRule as X, Extension as J } from "@tiptap/core";
1
+ import { nodeViewProps as _, NodeViewWrapper as y, VueRenderer as w, VueNodeViewRenderer as v, BubbleMenu as H, EditorContent as j, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
2
+ import { Node as N, nodePasteRule as E, InputRule as K, mergeAttributes as m, getMarksBetween as U, combineTransactionSteps as W, getChangedRanges as q, 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";
@@ -14,8 +14,8 @@ 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";
17
- import de from "@tiptap/extension-underline";
18
- import ce from "@tiptap/extension-text";
17
+ import ce from "@tiptap/extension-underline";
18
+ import de from "@tiptap/extension-text";
19
19
  import ue from "@tiptap/extension-text-align";
20
20
  import me from "@tiptap/extension-history";
21
21
  import he from "@tiptap/extension-text-style";
@@ -24,56 +24,40 @@ 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
26
  import { emojiPattern as O } from "regex-combined-emojis";
27
- import { n as d } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
28
- import ye from "../skeleton/skeleton.js";
27
+ import { n as c } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
29
28
  import P from "../emoji/emoji.js";
30
- import { emojiRegex as we, codeToEmojiData as L, stringToUnicode as ve, emojiShortCodeRegex as xe } from "../../common/emoji/index.js";
31
- import { emojisIndexed as ke } from "@dialpad/dialtone-emojis";
29
+ import { getEmojiData as ye, emojiRegex as we, stringToUnicode as ve, codeToEmojiData as L, emojiShortCodeRegex as xe } from "../../common/emoji/index.js";
32
30
  import be from "../list-item/list-item.js";
33
31
  import x from "../stack/stack.js";
34
- import k from "tippy.js";
35
- import { getPhoneNumberRegex as Ce, linkRegex as Te, warnIfUnmounted as Ee } from "../../common/utils/index.js";
36
- import Se from "@tiptap/extension-image";
32
+ import b from "tippy.js";
33
+ import { getPhoneNumberRegex as ke, linkRegex as Ce, warnIfUnmounted as Te } from "../../common/utils/index.js";
34
+ import Ee from "@tiptap/extension-image";
37
35
  import R from "@tiptap/extension-mention";
38
36
  import D from "../link/link.js";
39
- import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as $, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Le, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Re } from "./rich-text-editor-constants.js";
40
- import $e from "../avatar/avatar.js";
41
- import Ie from "@dialpad/dialtone-icons/vue2/hash";
42
- import Ae from "@dialpad/dialtone-icons/vue2/lock";
43
- import Be from "deep-equal";
44
- import { DialtoneLocalization as Oe } from "../../localization/index.js";
45
- import Pe from "../button/button.js";
46
- const De = {
37
+ import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as $, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Se, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Le } from "./rich-text-editor-constants.js";
38
+ import Re from "../avatar/avatar.js";
39
+ import $e from "@dialpad/dialtone-icons/vue2/hash";
40
+ import Ie from "@dialpad/dialtone-icons/vue2/lock";
41
+ import Ae from "deep-equal";
42
+ import { DialtoneLocalization as Be } from "../../localization/index.js";
43
+ import Oe from "../button/button.js";
44
+ const Pe = {
47
45
  name: "EmojiComponent",
48
46
  components: {
49
47
  NodeViewWrapper: y,
50
- DtEmoji: P,
51
- DtSkeleton: ye
48
+ DtEmoji: P
52
49
  },
53
- props: _,
54
- data() {
55
- return {
56
- showSkeleton: !0
57
- };
58
- },
59
- methods: {
60
- handleImageLoad() {
61
- this.showSkeleton = !1;
62
- },
63
- handleImageError: function(t) {
64
- this.showSkeleton = !1, t.target.parentNode.remove();
65
- }
66
- }
50
+ props: _
67
51
  };
68
- var Me = function() {
69
- var e = this, n = e._self._c;
70
- return n("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [e.node.attrs.code ? n("dt-emoji", { attrs: { size: "500", code: e.node.attrs.code } }) : [e.showSkeleton ? n("dt-skeleton", { staticClass: "d-icon d-icon--size-500", attrs: { offset: 0, "shape-option": { shape: "circle", size: "100%" } } }) : e._e(), n("img", { directives: [{ name: "show", rawName: "v-show", value: !e.showSkeleton, expression: "!showSkeleton" }], staticClass: "d-icon d-icon--size-500", attrs: { alt: e.node.attrs.name, "aria-label": e.node.attrs.name, title: e.node.attrs.name, src: e.node.attrs.image }, on: { load: e.handleImageLoad, error: e.handleImageError } })]], 2);
71
- }, He = [], je = /* @__PURE__ */ d(
52
+ var De = function() {
53
+ var t = this, n = t._self._c;
54
+ 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);
55
+ }, Me = [], He = /* @__PURE__ */ c(
56
+ Pe,
72
57
  De,
73
- Me,
74
- He
58
+ Me
75
59
  );
76
- const Ne = je.exports, Fe = {
60
+ const je = He.exports, Fe = {
77
61
  name: "SuggestionList",
78
62
  components: {
79
63
  DtListItem: be
@@ -107,8 +91,8 @@ const Ne = je.exports, Fe = {
107
91
  }
108
92
  },
109
93
  methods: {
110
- onKeyDown({ event: t }) {
111
- return t.key === "ArrowUp" ? (this.upHandler(), !0) : t.key === "ArrowDown" ? (this.downHandler(), !0) : t.key === "Enter" || t.key === "Tab" ? (this.selectHandler(), !0) : !1;
94
+ onKeyDown({ event: e }) {
95
+ return e.key === "ArrowUp" ? (this.upHandler(), !0) : e.key === "ArrowDown" ? (this.downHandler(), !0) : e.key === "Enter" || e.key === "Tab" ? (this.selectHandler(), !0) : !1;
112
96
  },
113
97
  upHandler() {
114
98
  this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length, this.scrollActiveElementIntoView();
@@ -118,8 +102,8 @@ const Ne = je.exports, Fe = {
118
102
  },
119
103
  async scrollActiveElementIntoView() {
120
104
  await this.$nextTick();
121
- const t = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
122
- t && t.scrollIntoView({
105
+ const e = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
106
+ e && e.scrollIntoView({
123
107
  behaviour: "smooth",
124
108
  block: "center"
125
109
  });
@@ -127,43 +111,43 @@ const Ne = je.exports, Fe = {
127
111
  selectHandler() {
128
112
  this.selectItem(this.selectedIndex);
129
113
  },
130
- selectItem(t) {
131
- const e = this.items[t];
114
+ selectItem(e) {
115
+ const t = this.items[e];
132
116
  switch (this.itemType) {
133
117
  case "emoji":
134
- this.command(e);
118
+ this.command(t);
135
119
  return;
136
120
  case "mention":
137
- this.command({ name: e.name, id: e.id, avatarSrc: e.avatarSrc });
121
+ this.command({ name: t.name, id: t.id, avatarSrc: t.avatarSrc });
138
122
  break;
139
123
  case "channel":
140
- this.command({ name: e.name, id: e.id });
124
+ this.command({ name: t.name, id: t.id });
141
125
  break;
142
126
  case "slash-command":
143
- this.command({ command: e.command });
127
+ this.command({ command: t.command });
144
128
  break;
145
129
  }
146
130
  }
147
131
  }
148
132
  };
149
- var Ke = function() {
150
- var e = this, n = e._self._c;
151
- 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, s) {
133
+ var Ne = function() {
134
+ var t = this, n = t._self._c;
135
+ 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) {
152
136
  return n("dt-list-item", { key: r.id, class: [
153
137
  "d-suggestion-list__item",
154
- { "d-list-item--highlighted": s === e.selectedIndex }
155
- ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(o) {
156
- return e.selectItem(s);
157
- }, keydown: function(o) {
158
- return o.preventDefault(), e.onKeyDown.apply(null, arguments);
159
- } } }, [n(e.itemComponent, { tag: "component", attrs: { item: r } })], 1);
138
+ { "d-list-item--highlighted": s === t.selectedIndex }
139
+ ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(i) {
140
+ return t.selectItem(s);
141
+ }, keydown: function(i) {
142
+ return i.preventDefault(), t.onKeyDown.apply(null, arguments);
143
+ } } }, [n(t.itemComponent, { tag: "component", attrs: { item: r } })], 1);
160
144
  }), 1)]);
161
- }, qe = [], Ue = /* @__PURE__ */ d(
145
+ }, Ke = [], Ue = /* @__PURE__ */ c(
162
146
  Fe,
163
- Ke,
164
- qe
147
+ Ne,
148
+ Ke
165
149
  );
166
- const b = Ue.exports, ze = {
150
+ const k = Ue.exports, We = {
167
151
  name: "EmojiSuggestion",
168
152
  components: {
169
153
  DtEmoji: P,
@@ -176,69 +160,76 @@ const b = Ue.exports, ze = {
176
160
  }
177
161
  }
178
162
  };
179
- var We = function() {
180
- var e = this, n = e._self._c;
181
- 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);
182
- }, Ve = [], Xe = /* @__PURE__ */ d(
183
- ze,
163
+ var qe = function() {
164
+ var t = this, n = t._self._c;
165
+ 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);
166
+ }, Ve = [], ze = /* @__PURE__ */ c(
184
167
  We,
168
+ qe,
185
169
  Ve
186
170
  );
187
- const Je = Xe.exports, C = {
171
+ const Xe = ze.exports, C = {
188
172
  name: "hideOnEsc",
189
173
  defaultValue: !0,
190
- fn({ hide: t }) {
191
- function e(n) {
192
- n.keyCode === 27 && t();
174
+ fn({ hide: e }) {
175
+ function t(n) {
176
+ n.keyCode === 27 && e();
193
177
  }
194
178
  return {
195
179
  onShow() {
196
- document.addEventListener("keydown", e);
180
+ document.addEventListener("keydown", t);
197
181
  },
198
182
  onHide() {
199
- document.removeEventListener("keydown", e);
183
+ document.removeEventListener("keydown", t);
200
184
  }
201
185
  };
202
186
  }
203
- }, Ye = 20, Ge = {
204
- items: ({ query: t }) => {
205
- if (t.length < 2)
187
+ }, Je = 20, Ye = (e, t, n) => {
188
+ var a, l;
189
+ const r = (a = e.shortname) == null ? void 0 : a.replaceAll(":", ""), s = (l = t.shortname) == null ? void 0 : l.replaceAll(":", ""), i = r.startsWith(n), o = s.startsWith(n);
190
+ return i && !o ? -1 : !i && o ? 1 : r.localeCompare(s);
191
+ }, Ge = {
192
+ items: ({ query: e }) => {
193
+ if (e.length < 2)
206
194
  return [];
207
- const e = Object.values(ke);
208
- return t = t.toLowerCase(), e.filter(
209
- (r) => [
210
- r.name,
211
- r.shortname.replaceAll(":", ""),
212
- ...r.keywords
213
- ].some((s) => s.startsWith(t))
214
- ).splice(0, Ye).map((r) => ({ code: r.shortname }));
195
+ const t = Object.values(ye());
196
+ return e = e.toLowerCase(), t.filter(
197
+ (r) => {
198
+ var s;
199
+ return [
200
+ r.name,
201
+ (s = r.shortname) == null ? void 0 : s.replaceAll(":", ""),
202
+ ...r.keywords || []
203
+ ].some((i) => i && i.startsWith(e));
204
+ }
205
+ ).splice(0, Je).sort((r, s) => Ye(r, s, e)).map((r) => ({ code: r.shortname }));
215
206
  },
216
- command: ({ editor: t, range: e, props: n }) => {
217
- var o, i;
218
- const r = t.view.state.selection.$to.nodeAfter;
219
- ((o = r == null ? void 0 : r.text) == null ? void 0 : o.startsWith(" ")) && (e.to += 1), t.chain().focus().insertContentAt(e, [
207
+ command: ({ editor: e, range: t, props: n }) => {
208
+ var i, o;
209
+ const r = e.view.state.selection.$to.nodeAfter;
210
+ ((i = r == null ? void 0 : r.text) == null ? void 0 : i.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
220
211
  {
221
212
  type: "emoji",
222
213
  attrs: n
223
214
  }
224
- ]).run(), (i = window.getSelection()) == null || i.collapseToEnd();
215
+ ]).run(), (o = window.getSelection()) == null || o.collapseToEnd();
225
216
  },
226
217
  render: () => {
227
- let t, e, n = !1;
218
+ let e, t, n = !1;
228
219
  return {
229
220
  onStart: (r) => {
230
- t = new w(b, {
221
+ e = new w(k, {
231
222
  parent: void 0,
232
223
  propsData: {
233
- itemComponent: Je,
224
+ itemComponent: Xe,
234
225
  itemType: "emoji",
235
226
  ...r
236
227
  },
237
228
  editor: r.editor
238
- }), r.clientRect && (e = k("body", {
229
+ }), r.clientRect && (t = b("body", {
239
230
  getReferenceClientRect: r.clientRect,
240
231
  appendTo: () => document.body,
241
- content: t.element,
232
+ content: e.element,
242
233
  showOnCreate: !1,
243
234
  onShow: () => {
244
235
  n = !0;
@@ -251,31 +242,31 @@ const Je = Xe.exports, C = {
251
242
  placement: "top-start",
252
243
  zIndex: 650,
253
244
  plugins: [C]
254
- }), r.items.length > 0 && (e == null || e[0].show()));
245
+ }), r.items.length > 0 && (t == null || t[0].show()));
255
246
  },
256
247
  onUpdate(r) {
257
- t == null || t.updateProps(r), r.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), e == null || e[0].setProps({
248
+ e == null || e.updateProps(r), r.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), t == null || t[0].setProps({
258
249
  getReferenceClientRect: r.clientRect
259
250
  });
260
251
  },
261
252
  onKeyDown(r) {
262
253
  var s;
263
254
  if (n)
264
- return (s = t == null ? void 0 : t.ref) == null ? void 0 : s.onKeyDown(r);
255
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
265
256
  },
266
257
  onExit() {
267
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
258
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
268
259
  }
269
260
  };
270
261
  }
271
- }, Qe = /(:\w+:)$/, Ze = new RegExp(O + "$"), et = (t) => {
272
- if (t && L(t[0]))
273
- return { text: t[2] || t[0] };
274
- }, tt = (t) => [...t.matchAll(xe)].filter((n) => L(n[0])).map((n) => ({
262
+ }, Qe = /(:\w+:)$/, Ze = new RegExp(O + "$"), et = (e) => {
263
+ if (e && L(e[0]))
264
+ return { text: e[2] || e[0] };
265
+ }, tt = (e) => [...e.matchAll(xe)].filter((n) => L(n[0])).map((n) => ({
275
266
  index: n.index,
276
267
  text: n[0],
277
268
  match: n
278
- })), nt = F.create({
269
+ })), nt = N.create({
279
270
  name: "emoji",
280
271
  addOptions() {
281
272
  return {
@@ -287,7 +278,7 @@ const Je = Xe.exports, C = {
287
278
  selectable: !1,
288
279
  atom: !0,
289
280
  addNodeView() {
290
- return v(Ne);
281
+ return v(je);
291
282
  },
292
283
  addAttributes() {
293
284
  return {
@@ -309,29 +300,23 @@ const Je = Xe.exports, C = {
309
300
  }
310
301
  ];
311
302
  },
312
- renderText({ node: t }) {
313
- const { image: e, code: n } = t.attrs;
314
- if (e !== null)
315
- return e;
316
- {
317
- const r = L(n);
318
- return ve(r.unicode_output);
319
- }
303
+ renderText({ node: e }) {
304
+ return ve(L(e.attrs.code).unicode_output);
320
305
  },
321
- renderHTML({ HTMLAttributes: t }) {
322
- return ["emoji-component", m(this.options.HTMLAttributes, t)];
306
+ renderHTML({ HTMLAttributes: e }) {
307
+ return ["emoji-component", m(this.options.HTMLAttributes, e)];
323
308
  },
324
309
  addInputRules() {
325
310
  return [
326
311
  new K({
327
- find: (t) => {
328
- const e = t.match(Qe) || t.match(Ze);
329
- if (e)
330
- return et(e);
312
+ find: (e) => {
313
+ const t = e.match(Qe) || e.match(Ze);
314
+ if (t)
315
+ return et(t);
331
316
  },
332
- handler: ({ state: t, range: e, match: n }) => {
333
- const { tr: r } = t, s = e.from, o = e.to;
334
- r.replaceWith(s, o, this.type.create({ code: n[0] }));
317
+ handler: ({ state: e, range: t, match: n }) => {
318
+ const { tr: r } = e, s = t.from, i = t.to;
319
+ r.replaceWith(s, i, this.type.create({ code: n[0] }));
335
320
  }
336
321
  })
337
322
  ];
@@ -341,22 +326,22 @@ const Je = Xe.exports, C = {
341
326
  E({
342
327
  find: tt,
343
328
  type: this.type,
344
- getAttributes(t) {
329
+ getAttributes(e) {
345
330
  return {
346
- code: t[0],
347
- image: t[1],
348
- name: t[2]
331
+ code: e[0],
332
+ image: e[1],
333
+ name: e[2]
349
334
  };
350
335
  }
351
336
  }),
352
337
  E({
353
338
  find: we,
354
339
  type: this.type,
355
- getAttributes(t) {
340
+ getAttributes(e) {
356
341
  return {
357
- code: t[0],
358
- image: t[1],
359
- name: t[2]
342
+ code: e[0],
343
+ image: e[1],
344
+ name: e[2]
360
345
  };
361
346
  }
362
347
  })
@@ -375,42 +360,42 @@ const Je = Xe.exports, C = {
375
360
  },
376
361
  addKeyboardShortcuts() {
377
362
  return {
378
- Backspace: () => this.editor.commands.command(({ tr: t, state: e }) => {
363
+ Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
379
364
  let n = !1;
380
- const { selection: r } = e, { empty: s, anchor: o } = r;
381
- return s ? (e.doc.nodesBetween(o - 1, o, (i, a) => {
382
- if (i.type.name === this.name)
383
- return n = !0, t.insertText("", a, a + i.nodeSize), !1;
365
+ const { selection: r } = t, { empty: s, anchor: i } = r;
366
+ return s ? (t.doc.nodesBetween(i - 1, i, (o, a) => {
367
+ if (o.type.name === this.name)
368
+ return n = !0, e.insertText("", a, a + o.nodeSize), !1;
384
369
  }), n) : !1;
385
370
  })
386
371
  };
387
372
  }
388
373
  });
389
- function rt(t, e, n = () => !0) {
374
+ function rt(e, t, n = () => !0) {
390
375
  const r = [];
391
- e.lastIndex = 0;
376
+ t.lastIndex = 0;
392
377
  let s;
393
- for (; s = e.exec(t); )
394
- n(t, s) && r.push(s);
378
+ for (; s = t.exec(e); )
379
+ n(e, s) && r.push(s);
395
380
  return r;
396
381
  }
397
- function st(t, e) {
398
- return !["#", "@"].includes(t.charAt(e.index)) && !["#", "@"].includes(t.charAt(e.index - 1));
382
+ function st(e, t) {
383
+ return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
399
384
  }
400
- function it(t) {
401
- const e = new RegExp(
385
+ function it(e) {
386
+ const t = new RegExp(
402
387
  "(?:" + [
403
388
  `[!?.,:;'"]`,
404
389
  "(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
405
390
  ].join("|"),
406
391
  "g"
407
392
  );
408
- return t.replace(e, "");
393
+ return e.replace(t, "");
409
394
  }
410
- function ot(t, e) {
411
- const n = t.slice(0, e + 1).search(/\S+\s*$/), r = t.slice(e).search(/\s/);
395
+ function ot(e, t) {
396
+ const n = e.slice(0, t + 1).search(/\S+\s*$/), r = e.slice(t).search(/\s/);
412
397
  if (r < 0) {
413
- const s = t.slice(n);
398
+ const s = e.slice(n);
414
399
  return {
415
400
  text: s,
416
401
  from: n,
@@ -418,61 +403,61 @@ function ot(t, e) {
418
403
  };
419
404
  }
420
405
  return {
421
- text: t.slice(n, r + e),
406
+ text: e.slice(n, r + t),
422
407
  from: n,
423
- to: r + e
408
+ to: r + t
424
409
  };
425
410
  }
426
- function S(t, e, n, r) {
427
- const s = ot(t, e);
411
+ function S(e, t, n, r) {
412
+ const s = ot(e, t);
428
413
  if (r.lastIndex = 0, !r.test(s.text))
429
414
  return s;
430
- const o = n === "left" ? s.from - 1 : s.to + 1;
431
- return o <= 0 || o >= t.length || o === e ? s : S(t, o, n, r);
415
+ const i = n === "left" ? s.from - 1 : s.to + 1;
416
+ return i <= 0 || i >= e.length || i === t ? s : S(e, i, n, r);
432
417
  }
433
- function at(t, e, n, r) {
434
- const s = Math.max(t.from - 1, 0), o = Math.min(t.to + 1, e.content.size), i = q(s, o, e);
435
- for (const a of i)
418
+ function at(e, t, n, r) {
419
+ const s = Math.max(e.from - 1, 0), i = Math.min(e.to + 1, t.content.size), o = U(s, i, t);
420
+ for (const a of o)
436
421
  a.mark.type === r && n.removeMark(a.from, a.to, r);
437
422
  }
438
- const I = Ce(1, 15);
439
- function A(t, e, n, r, s, o) {
440
- if (!t)
423
+ const I = ke(1, 15);
424
+ function A(e, t, n, r, s, i) {
425
+ if (!e)
441
426
  return;
442
- let i = n - e - 1;
443
- i = i < 0 ? 0 : i;
444
- const a = r - e, l = S(
445
- t,
446
- i,
427
+ let o = n - t - 1;
428
+ o = o < 0 ? 0 : o;
429
+ const a = r - t, l = S(
430
+ e,
431
+ o,
447
432
  "left",
448
433
  I
449
- ), c = S(
450
- t,
434
+ ), d = S(
435
+ e,
451
436
  a,
452
437
  "right",
453
438
  I
454
- ), u = t.slice(l.from, c.to);
455
- rt(u, Te, st).forEach((T) => {
456
- const h = it(T[0]), g = e + l.from + T.index + 1, M = g + h.length;
457
- s.addMark(g, M, o.create());
439
+ ), u = e.slice(l.from, d.to);
440
+ rt(u, Ce, st).forEach((T) => {
441
+ const h = it(T[0]), g = t + l.from + T.index + 1, M = g + h.length;
442
+ s.addMark(g, M, i.create());
458
443
  });
459
444
  }
460
- function lt(t) {
461
- let e = !1;
445
+ function lt(e) {
446
+ let t = !1;
462
447
  return new ge({
463
448
  key: new f("autolink"),
464
449
  appendTransaction: (n, r, s) => {
465
- const o = n.some((u) => u.docChanged) && !r.doc.eq(s.doc);
466
- if (e && !o)
450
+ const i = n.some((u) => u.docChanged) && !r.doc.eq(s.doc);
451
+ if (t && !i)
467
452
  return;
468
- const { tr: i } = s, { textContent: a } = s.doc;
469
- e || A(a, 0, 0, a.length, i, t.type), e = !0;
470
- const l = U(
453
+ const { tr: o } = s, { textContent: a } = s.doc;
454
+ t || A(a, 0, 0, a.length, o, e.type), t = !0;
455
+ const l = W(
471
456
  r.doc,
472
457
  [...n]
473
458
  );
474
- return z(l).forEach(({ oldRange: u, newRange: p }) => {
475
- at(p, s.doc, i, t.type), W(
459
+ return q(l).forEach(({ oldRange: u, newRange: p }) => {
460
+ at(p, s.doc, o, e.type), V(
476
461
  s.doc,
477
462
  p,
478
463
  (h) => h.isTextblock
@@ -482,38 +467,38 @@ function lt(t) {
482
467
  g,
483
468
  u.from,
484
469
  p.to,
485
- i,
486
- t.type
470
+ o,
471
+ e.type
487
472
  );
488
473
  });
489
- }), i;
474
+ }), o;
490
475
  }
491
476
  });
492
477
  }
493
- const dt = {
478
+ const ct = {
494
479
  class: "d-link d-c-text d-d-inline-block d-wb-break-all",
495
480
  rel: "noopener noreferrer nofollow"
496
- }, ct = V.create({
481
+ }, dt = z.create({
497
482
  name: "CustomLink",
498
- renderHTML({ HTMLAttributes: t }) {
483
+ renderHTML({ HTMLAttributes: e }) {
499
484
  return [
500
485
  "a",
501
486
  m(
502
487
  this.options.HTMLAttributes,
503
- t,
504
- dt
488
+ e,
489
+ ct
505
490
  )
506
491
  ];
507
492
  },
508
- renderText({ node: t }) {
509
- return t.attrs.text;
493
+ renderText({ node: e }) {
494
+ return e.attrs.text;
510
495
  },
511
496
  addProseMirrorPlugins() {
512
497
  return [
513
498
  lt({ type: this.type })
514
499
  ];
515
500
  }
516
- }), ut = Se.extend({
501
+ }), ut = Ee.extend({
517
502
  name: "ConfigurableImage",
518
503
  addAttributes() {
519
504
  return {
@@ -541,8 +526,8 @@ const dt = {
541
526
  parseHTML() {
542
527
  return [{ tag: "div" }];
543
528
  },
544
- renderHTML({ HTMLAttributes: t }) {
545
- return ["div", m(this.options.HTMLAttributes, t), 0];
529
+ renderHTML({ HTMLAttributes: e }) {
530
+ return ["div", m(this.options.HTMLAttributes, e), 0];
546
531
  }
547
532
  }), ht = {
548
533
  name: "MentionComponent",
@@ -558,9 +543,9 @@ const dt = {
558
543
  }
559
544
  };
560
545
  var ft = function() {
561
- var e = this, n = e._self._c;
562
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
563
- }, pt = [], gt = /* @__PURE__ */ d(
546
+ var t = this, n = t._self._c;
547
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
548
+ }, pt = [], gt = /* @__PURE__ */ c(
564
549
  ht,
565
550
  ft,
566
551
  pt
@@ -589,11 +574,11 @@ const _t = gt.exports, yt = R.extend({
589
574
  }
590
575
  };
591
576
  },
592
- renderText({ node: t }) {
593
- return `@${t.attrs.id}`;
577
+ renderText({ node: e }) {
578
+ return `@${e.attrs.id}`;
594
579
  },
595
- renderHTML({ HTMLAttributes: t }) {
596
- return ["mention-component", m(this.options.HTMLAttributes, t)];
580
+ renderHTML({ HTMLAttributes: e }) {
581
+ return ["mention-component", m(this.options.HTMLAttributes, e)];
597
582
  }
598
583
  }).configure({
599
584
  suggestion: {
@@ -614,17 +599,17 @@ const _t = gt.exports, yt = R.extend({
614
599
  }
615
600
  };
616
601
  var vt = function() {
617
- var e = this, n = e._self._c;
618
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
619
- }, xt = [], kt = /* @__PURE__ */ d(
602
+ var t = this, n = t._self._c;
603
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [n("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
604
+ }, xt = [], bt = /* @__PURE__ */ c(
620
605
  wt,
621
606
  vt,
622
607
  xt
623
608
  );
624
- const bt = kt.exports, Ct = R.extend({
609
+ const kt = bt.exports, Ct = R.extend({
625
610
  name: "channel",
626
611
  addNodeView() {
627
- return v(bt);
612
+ return v(kt);
628
613
  },
629
614
  parseHTML() {
630
615
  return [
@@ -646,11 +631,11 @@ const bt = kt.exports, Ct = R.extend({
646
631
  }
647
632
  };
648
633
  },
649
- renderText({ node: t }) {
650
- return `#${t.attrs.id}`;
634
+ renderText({ node: e }) {
635
+ return `#${e.attrs.id}`;
651
636
  },
652
- renderHTML({ HTMLAttributes: t }) {
653
- return ["channel-component", m(this.options.HTMLAttributes, t)];
637
+ renderHTML({ HTMLAttributes: e }) {
638
+ return ["channel-component", m(this.options.HTMLAttributes, e)];
654
639
  }
655
640
  }).configure({
656
641
  suggestion: {
@@ -673,21 +658,21 @@ const bt = kt.exports, Ct = R.extend({
673
658
  },
674
659
  created() {
675
660
  var n, r, s;
676
- const t = this.$props.node.attrs.command;
677
- this.$emit("selected-command", t);
678
- const e = (s = (r = (n = this.editor) == null ? void 0 : n.storage) == null ? void 0 : r["slash-commands"]) == null ? void 0 : s.onSelectedCommand;
679
- e && typeof e == "function" && e(t);
661
+ const e = this.$props.node.attrs.command;
662
+ this.$emit("selected-command", e);
663
+ const t = (s = (r = (n = this.editor) == null ? void 0 : n.storage) == null ? void 0 : r["slash-commands"]) == null ? void 0 : s.onSelectedCommand;
664
+ t && typeof t == "function" && t(e);
680
665
  }
681
666
  };
682
667
  var Et = function() {
683
- var e = this, n = e._self._c;
684
- return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [e._v(" " + e._s(e.text) + " ")]);
685
- }, St = [], Lt = /* @__PURE__ */ d(
668
+ var t = this, n = t._self._c;
669
+ return n("node-view-wrapper", { staticClass: "d-d-inline-block" }, [t._v(" " + t._s(t.text) + " ")]);
670
+ }, St = [], Lt = /* @__PURE__ */ c(
686
671
  Tt,
687
672
  Et,
688
673
  St
689
674
  );
690
- const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
675
+ const Rt = Lt.exports, $t = (e, t) => [...e.matchAll(t)].map((r) => {
691
676
  let s = r[2];
692
677
  return s.endsWith(" ") || (s += " "), {
693
678
  index: r.index,
@@ -699,9 +684,9 @@ const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
699
684
  group: "inline",
700
685
  inline: !0,
701
686
  addOptions() {
702
- var t;
687
+ var e;
703
688
  return {
704
- ...(t = this.parent) == null ? void 0 : t.call(this),
689
+ ...(e = this.parent) == null ? void 0 : e.call(this),
705
690
  onSelectedCommand: null
706
691
  };
707
692
  },
@@ -733,18 +718,18 @@ const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
733
718
  }
734
719
  };
735
720
  },
736
- renderText({ node: t }) {
737
- return `/${t.attrs.command}`;
721
+ renderText({ node: e }) {
722
+ return `/${e.attrs.command}`;
738
723
  },
739
- renderHTML({ HTMLAttributes: t }) {
740
- return ["command-component", m(this.options.HTMLAttributes, t)];
724
+ renderHTML({ HTMLAttributes: e }) {
725
+ return ["command-component", m(this.options.HTMLAttributes, e)];
741
726
  },
742
727
  addInputRules() {
743
728
  var n;
744
- const t = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) $`);
729
+ const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) $`);
745
730
  return [
746
731
  X({
747
- find: e,
732
+ find: t,
748
733
  type: this.type,
749
734
  getAttributes(r) {
750
735
  return { command: r[2] };
@@ -754,10 +739,10 @@ const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
754
739
  },
755
740
  addPasteRules() {
756
741
  var n;
757
- const t = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) ?$`, "g");
742
+ const e = (n = this.options.suggestion) == null ? void 0 : n.items({ query: "" }).map((r) => r.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
758
743
  return [
759
744
  E({
760
- find: (r) => $t(r, e),
745
+ find: (r) => $t(r, t),
761
746
  type: this.type,
762
747
  getAttributes(r) {
763
748
  return { command: r[0].trim() };
@@ -773,7 +758,7 @@ const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
773
758
  }), At = {
774
759
  name: "MentionSuggestion",
775
760
  components: {
776
- DtAvatar: $e,
761
+ DtAvatar: Re,
777
762
  DtStack: x
778
763
  },
779
764
  props: {
@@ -812,9 +797,9 @@ const Rt = Lt.exports, $t = (t, e) => [...t.matchAll(e)].map((r) => {
812
797
  }
813
798
  };
814
799
  var Bt = function() {
815
- var e = this, n = e._self._c;
816
- 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);
817
- }, Ot = [], Pt = /* @__PURE__ */ d(
800
+ var t = this, n = t._self._c;
801
+ 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);
802
+ }, Ot = [], Pt = /* @__PURE__ */ c(
818
803
  At,
819
804
  Bt,
820
805
  Ot
@@ -825,10 +810,10 @@ const Dt = Pt.exports, Mt = {
825
810
  // items: ({ query }) => { return [] },
826
811
  allowSpaces: !0,
827
812
  render: () => {
828
- let t, e, n = !1;
813
+ let e, t, n = !1;
829
814
  return {
830
815
  onStart: (r) => {
831
- t = new w(b, {
816
+ e = new w(k, {
832
817
  parent: void 0,
833
818
  propsData: {
834
819
  itemComponent: Dt,
@@ -836,10 +821,10 @@ const Dt = Pt.exports, Mt = {
836
821
  ...r
837
822
  },
838
823
  editor: r.editor
839
- }), r.clientRect && (e = k("body", {
824
+ }), r.clientRect && (t = b("body", {
840
825
  getReferenceClientRect: r.clientRect,
841
826
  appendTo: () => document.body,
842
- content: t.element,
827
+ content: e.element,
843
828
  showOnCreate: !1,
844
829
  onShow: () => {
845
830
  n = !0;
@@ -852,20 +837,20 @@ const Dt = Pt.exports, Mt = {
852
837
  placement: "top-start",
853
838
  zIndex: 650,
854
839
  plugins: [C]
855
- }), r.items.length > 0 && (e == null || e[0].show()));
840
+ }), r.items.length > 0 && (t == null || t[0].show()));
856
841
  },
857
842
  onUpdate(r) {
858
- 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({
843
+ 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({
859
844
  getReferenceClientRect: r.clientRect
860
845
  }));
861
846
  },
862
847
  onKeyDown(r) {
863
848
  var s;
864
849
  if (n)
865
- return (s = t == null ? void 0 : t.ref) == null ? void 0 : s.onKeyDown(r);
850
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
866
851
  },
867
852
  onExit() {
868
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
853
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
869
854
  }
870
855
  };
871
856
  }
@@ -873,8 +858,8 @@ const Dt = Pt.exports, Mt = {
873
858
  name: "ChannelSuggestion",
874
859
  components: {
875
860
  DtStack: x,
876
- DtIconHash: Ie,
877
- DtIconLock: Ae
861
+ DtIconHash: $e,
862
+ DtIconLock: Ie
878
863
  },
879
864
  props: {
880
865
  item: {
@@ -889,23 +874,23 @@ const Dt = Pt.exports, Mt = {
889
874
  }
890
875
  };
891
876
  var jt = function() {
892
- var e = this, n = e._self._c;
893
- 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);
894
- }, Nt = [], Ft = /* @__PURE__ */ d(
877
+ var t = this, n = t._self._c;
878
+ 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);
879
+ }, Ft = [], Nt = /* @__PURE__ */ c(
895
880
  Ht,
896
881
  jt,
897
- Nt
882
+ Ft
898
883
  );
899
- const Kt = Ft.exports, qt = {
884
+ const Kt = Nt.exports, Ut = {
900
885
  // This function comes from the user and passed to the editor directly.
901
886
  // This will also activate the mention plugin on the editor
902
887
  // items: ({ query }) => { return [] },
903
888
  allowSpaces: !0,
904
889
  render: () => {
905
- let t, e, n = !1;
890
+ let e, t, n = !1;
906
891
  return {
907
892
  onStart: (r) => {
908
- t = new w(b, {
893
+ e = new w(k, {
909
894
  parent: void 0,
910
895
  propsData: {
911
896
  itemComponent: Kt,
@@ -913,10 +898,10 @@ const Kt = Ft.exports, qt = {
913
898
  ...r
914
899
  },
915
900
  editor: r.editor
916
- }), r.clientRect && (e = k("body", {
901
+ }), r.clientRect && (t = b("body", {
917
902
  getReferenceClientRect: r.clientRect,
918
903
  appendTo: () => document.body,
919
- content: t.element,
904
+ content: e.element,
920
905
  showOnCreate: !1,
921
906
  onShow: () => {
922
907
  n = !0;
@@ -929,24 +914,24 @@ const Kt = Ft.exports, qt = {
929
914
  placement: "top-start",
930
915
  zIndex: 650,
931
916
  plugins: [C]
932
- }), r.items.length > 0 && (e == null || e[0].show()));
917
+ }), r.items.length > 0 && (t == null || t[0].show()));
933
918
  },
934
919
  onUpdate(r) {
935
- 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({
920
+ 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({
936
921
  getReferenceClientRect: r.clientRect
937
922
  }));
938
923
  },
939
924
  onKeyDown(r) {
940
925
  var s;
941
926
  if (n)
942
- return (s = t == null ? void 0 : t.ref) == null ? void 0 : s.onKeyDown(r);
927
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
943
928
  },
944
929
  onExit() {
945
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
930
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
946
931
  }
947
932
  };
948
933
  }
949
- }, Ut = {
934
+ }, Wt = {
950
935
  name: "SlashCommandSuggestion",
951
936
  props: {
952
937
  item: {
@@ -966,25 +951,25 @@ const Kt = Ft.exports, qt = {
966
951
  }
967
952
  }
968
953
  };
969
- var zt = function() {
970
- var e = this, n = e._self._c;
971
- 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) + " ")])]);
972
- }, Wt = [], Vt = /* @__PURE__ */ d(
973
- Ut,
974
- zt,
975
- Wt
954
+ var qt = function() {
955
+ var t = this, n = t._self._c;
956
+ 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) + " ")])]);
957
+ }, Vt = [], zt = /* @__PURE__ */ c(
958
+ Wt,
959
+ qt,
960
+ Vt
976
961
  );
977
- const Xt = Vt.exports, Jt = {
962
+ const Xt = zt.exports, Jt = {
978
963
  // This function comes from the user and passed to the editor directly.
979
964
  // This will also activate the mention plugin on the editor
980
965
  // items: ({ query }) => { return [] },
981
966
  allowSpaces: !0,
982
967
  startOfLine: !0,
983
968
  render: () => {
984
- let t, e, n = !1;
969
+ let e, t, n = !1;
985
970
  return {
986
971
  onStart: (r) => {
987
- t = new w(b, {
972
+ e = new w(k, {
988
973
  parent: void 0,
989
974
  propsData: {
990
975
  itemComponent: Xt,
@@ -992,10 +977,10 @@ const Xt = Vt.exports, Jt = {
992
977
  ...r
993
978
  },
994
979
  editor: r.editor
995
- }), r.clientRect && (e = k("body", {
980
+ }), r.clientRect && (t = b("body", {
996
981
  getReferenceClientRect: r.clientRect,
997
982
  appendTo: () => document.body,
998
- content: t.element,
983
+ content: e.element,
999
984
  showOnCreate: !1,
1000
985
  onShow: () => {
1001
986
  n = !0;
@@ -1008,20 +993,20 @@ const Xt = Vt.exports, Jt = {
1008
993
  placement: "top-start",
1009
994
  zIndex: 650,
1010
995
  plugins: [C]
1011
- }), r.items.length > 0 && (e == null || e[0].show()));
996
+ }), r.items.length > 0 && (t == null || t[0].show()));
1012
997
  },
1013
998
  onUpdate(r) {
1014
- 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({
999
+ 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({
1015
1000
  getReferenceClientRect: r.clientRect
1016
1001
  }));
1017
1002
  },
1018
1003
  onKeyDown(r) {
1019
1004
  var s;
1020
1005
  if (n)
1021
- return (s = t == null ? void 0 : t.ref) == null ? void 0 : s.onKeyDown(r);
1006
+ return (s = e == null ? void 0 : e.ref) == null ? void 0 : s.onKeyDown(r);
1022
1007
  },
1023
1008
  onExit() {
1024
- e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
1009
+ t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
1025
1010
  }
1026
1011
  };
1027
1012
  }
@@ -1030,7 +1015,7 @@ const Xt = Vt.exports, Jt = {
1030
1015
  components: {
1031
1016
  EditorContent: j,
1032
1017
  BubbleMenu: H,
1033
- DtButton: Pe,
1018
+ DtButton: Oe,
1034
1019
  DtStack: x
1035
1020
  },
1036
1021
  props: {
@@ -1102,8 +1087,8 @@ const Xt = Vt.exports, Jt = {
1102
1087
  autoFocus: {
1103
1088
  type: [Boolean, String, Number],
1104
1089
  default: !1,
1105
- validator(t) {
1106
- return typeof t == "string" ? Re.includes(t) : !0;
1090
+ validator(e) {
1091
+ return typeof e == "string" ? Le.includes(e) : !0;
1107
1092
  }
1108
1093
  },
1109
1094
  /**
@@ -1115,8 +1100,8 @@ const Xt = Vt.exports, Jt = {
1115
1100
  outputFormat: {
1116
1101
  type: String,
1117
1102
  default: "html",
1118
- validator(t) {
1119
- return Le.includes(t);
1103
+ validator(e) {
1104
+ return Se.includes(e);
1120
1105
  }
1121
1106
  },
1122
1107
  /**
@@ -1374,12 +1359,12 @@ const Xt = Vt.exports, Jt = {
1374
1359
  editor: null,
1375
1360
  tippyOptions: {
1376
1361
  appendTo: () => {
1377
- var t;
1378
- return (t = this.$refs.editor.$el.getRootNode()) == null ? void 0 : t.querySelector("body");
1362
+ var e;
1363
+ return (e = this.$refs.editor.$el.getRootNode()) == null ? void 0 : e.querySelector("body");
1379
1364
  },
1380
1365
  placement: "top-start"
1381
1366
  },
1382
- i18n: new Oe()
1367
+ i18n: new Be()
1383
1368
  };
1384
1369
  },
1385
1370
  computed: {
@@ -1396,33 +1381,33 @@ const Xt = Vt.exports, Jt = {
1396
1381
  },
1397
1382
  // eslint-disable-next-line complexity
1398
1383
  extensions() {
1399
- const t = [Z, ce, me, te];
1400
- t.push(this.useDivTags ? mt : B), this.allowBold && t.push(ne), this.allowBlockquote && t.push(Y), this.allowBulletList && (t.push(re), t.push(oe.extend({
1384
+ const e = [Z, de, me, te];
1385
+ e.push(this.useDivTags ? mt : B), this.allowBold && e.push(ne), this.allowBlockquote && e.push(Y), this.allowBulletList && (e.push(re), e.push(oe.extend({
1401
1386
  renderText({ node: r }) {
1402
1387
  return r.textContent;
1403
1388
  }
1404
- })), t.push(ae)), this.allowItalic && t.push(se), this.allowStrike && t.push(le), this.allowUnderline && t.push(de), this.placeholder && t.push(
1389
+ })), e.push(ae)), this.allowItalic && e.push(se), this.allowStrike && e.push(le), this.allowUnderline && e.push(ce), this.placeholder && e.push(
1405
1390
  ee.configure({ placeholder: this.placeholder })
1406
1391
  );
1407
- const e = this, n = J.create({
1392
+ const t = this, n = J.create({
1408
1393
  addKeyboardShortcuts() {
1409
1394
  return {
1410
- "Shift-Enter": ({ editor: r }) => e.allowLineBreaks ? !1 : (r.commands.first(({ commands: s }) => [
1395
+ "Shift-Enter": ({ editor: r }) => t.allowLineBreaks ? !1 : (r.commands.first(({ commands: s }) => [
1411
1396
  () => s.newlineInCode(),
1412
- () => e.allowBulletList && s.splitListItem("listItem"),
1397
+ () => t.allowBulletList && s.splitListItem("listItem"),
1413
1398
  () => s.createParagraphNear(),
1414
1399
  () => s.liftEmptyBlock(),
1415
1400
  () => s.splitBlock()
1416
1401
  ]), !0),
1417
- Enter: () => e.allowLineBreaks ? !1 : (e.$emit("enter"), !0)
1402
+ Enter: () => t.allowLineBreaks ? !1 : (t.$emit("enter"), !0)
1418
1403
  };
1419
1404
  }
1420
1405
  });
1421
- if (t.push(n), this.link && t.push(ie.extend({
1406
+ if (e.push(n), this.link && e.push(ie.extend({
1422
1407
  inclusive: !1,
1423
1408
  addKeyboardShortcuts() {
1424
1409
  return {
1425
- "Mod-k": () => (e.$emit("edit-link"), !0)
1410
+ "Mod-k": () => (t.$emit("edit-link"), !0)
1426
1411
  };
1427
1412
  }
1428
1413
  }).configure({
@@ -1432,26 +1417,26 @@ const Xt = Vt.exports, Jt = {
1432
1417
  openOnClick: !1,
1433
1418
  autolink: !0,
1434
1419
  protocols: $
1435
- })), this.customLink && t.push(this.getExtension(ct, this.customLink)), this.mentionSuggestion) {
1420
+ })), this.customLink && e.push(this.getExtension(dt, this.customLink)), this.mentionSuggestion) {
1436
1421
  const r = { ...this.mentionSuggestion, ...Mt };
1437
- t.push(yt.configure({ suggestion: r }));
1422
+ e.push(yt.configure({ suggestion: r }));
1438
1423
  }
1439
1424
  if (this.channelSuggestion) {
1440
- const r = { ...this.channelSuggestion, ...qt };
1441
- t.push(Ct.configure({ suggestion: r }));
1425
+ const r = { ...this.channelSuggestion, ...Ut };
1426
+ e.push(Ct.configure({ suggestion: r }));
1442
1427
  }
1443
1428
  if (this.slashCommandSuggestion) {
1444
1429
  const r = { ...this.slashCommandSuggestion, ...Jt };
1445
- t.push(It.configure({
1430
+ e.push(It.configure({
1446
1431
  suggestion: r,
1447
1432
  onSelectedCommand: (s) => {
1448
1433
  this.$emit("selected-command", s);
1449
1434
  }
1450
1435
  }));
1451
1436
  }
1452
- return t.push(nt), t.push(ue.configure({
1437
+ return e.push(nt), e.push(ue.configure({
1453
1438
  types: ["paragraph"]
1454
- })), this.allowCode && t.push(Q), this.allowCodeblock && t.push(G.extend({
1439
+ })), this.allowCode && e.push(Q), this.allowCodeblock && e.push(G.extend({
1455
1440
  renderText({ node: r }) {
1456
1441
  return `\`\`\`
1457
1442
  ${r.textContent}
@@ -1461,15 +1446,15 @@ ${r.textContent}
1461
1446
  HTMLAttributes: {
1462
1447
  class: "d-rich-text-editor__code-block"
1463
1448
  }
1464
- })), this.allowInlineImages && t.push(ut), (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;
1449
+ })), this.allowInlineImages && e.push(ut), (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;
1465
1450
  },
1466
1451
  inputAttrs() {
1467
- const t = {
1452
+ const e = {
1468
1453
  "aria-label": this.inputAriaLabel,
1469
1454
  "aria-multiline": !0,
1470
1455
  role: "textbox"
1471
1456
  };
1472
- return this.editable || (t["aria-readonly"] = !0), t;
1457
+ return this.editable || (e["aria-readonly"] = !0), e;
1473
1458
  }
1474
1459
  },
1475
1460
  /**
@@ -1478,20 +1463,20 @@ ${r.textContent}
1478
1463
  * to be hooked up to the Editor's own API.
1479
1464
  */
1480
1465
  watch: {
1481
- editable(t) {
1482
- this.editor.setEditable(t), this.updateEditorAttributes({ "aria-readonly": !t });
1466
+ editable(e) {
1467
+ this.editor.setEditable(e), this.updateEditorAttributes({ "aria-readonly": !e });
1483
1468
  },
1484
- inputClass(t) {
1485
- this.updateEditorAttributes({ class: t });
1469
+ inputClass(e) {
1470
+ this.updateEditorAttributes({ class: e });
1486
1471
  },
1487
- inputAriaLabel(t) {
1488
- this.updateEditorAttributes({ "aria-label": t });
1472
+ inputAriaLabel(e) {
1473
+ this.updateEditorAttributes({ "aria-label": e });
1489
1474
  },
1490
1475
  extensions() {
1491
1476
  this.destroyEditor(), this.createEditor();
1492
1477
  },
1493
- value(t) {
1494
- this.processValue(t);
1478
+ value(e) {
1479
+ this.processValue(e);
1495
1480
  }
1496
1481
  },
1497
1482
  created() {
@@ -1501,11 +1486,11 @@ ${r.textContent}
1501
1486
  this.destroyEditor();
1502
1487
  },
1503
1488
  mounted() {
1504
- Ee(this.$el, this.$options.name), this.processValue(this.value, !1);
1489
+ Te(this.$el, this.$options.name), this.processValue(this.value, !1);
1505
1490
  },
1506
1491
  methods: {
1507
1492
  createEditor() {
1508
- this.editor = new N({
1493
+ this.editor = new F({
1509
1494
  autofocus: this.autoFocus,
1510
1495
  content: this.value,
1511
1496
  editable: this.editable,
@@ -1518,147 +1503,147 @@ ${r.textContent}
1518
1503
  ...this.inputAttrs,
1519
1504
  class: this.inputClass
1520
1505
  },
1521
- handleKeyDown: (t, e) => {
1506
+ handleKeyDown: (e, t) => {
1522
1507
  if (!this.preventTyping) return !1;
1523
1508
  const n = ["Backspace"];
1524
- return !this.allowLineBreaks && !e.shiftKey && n.push("Enter"), !n.includes(e.key);
1509
+ return !this.allowLineBreaks && !t.shiftKey && n.push("Enter"), !n.includes(t.key);
1525
1510
  },
1526
- handlePaste: (t, e) => {
1527
- const n = e.clipboardData || window.clipboardData, r = n.getData("text/plain"), s = n.getData("text/html");
1528
- return this.processPasteData(t, r, s);
1511
+ handlePaste: (e, t) => {
1512
+ const n = t.clipboardData || window.clipboardData, r = n.getData("text/plain"), s = n.getData("text/html");
1513
+ return this.processPasteData(e, r, s);
1529
1514
  },
1530
1515
  // Moves the <br /> tags inside the previous closing tag to avoid
1531
1516
  // Prosemirror wrapping them within another </p> tag.
1532
- transformPastedHTML(t) {
1533
- return t.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1517
+ transformPastedHTML(e) {
1518
+ return e.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1534
1519
  }
1535
1520
  }
1536
1521
  }), this.addEditorListeners();
1537
1522
  },
1538
- bubbleMenuShouldShow({ editor: t }) {
1539
- return t.isActive("link");
1523
+ bubbleMenuShouldShow({ editor: e }) {
1524
+ return e.isActive("link");
1540
1525
  },
1541
1526
  /**
1542
1527
  * If the selection contains a link, return the existing link text.
1543
1528
  * Otherwise, use just the selected text.
1544
1529
  * @param editor the editor instance.
1545
1530
  */
1546
- getSelectedLinkText(t) {
1547
- var a, l, c;
1548
- const { view: e, state: n } = t, { from: r, to: s } = e.state.selection, o = n.doc.textBetween(r, s, ""), i = this.editor.state.doc.nodeAt(r);
1549
- return i && ((c = (l = (a = i.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : c.name) === "link" ? i.textContent : o;
1531
+ getSelectedLinkText(e) {
1532
+ var a, l, d;
1533
+ const { view: t, state: n } = e, { from: r, to: s } = t.state.selection, i = n.doc.textBetween(r, s, ""), o = this.editor.state.doc.nodeAt(r);
1534
+ return o && ((d = (l = (a = o.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : d.name) === "link" ? o.textContent : i;
1550
1535
  },
1551
1536
  editLink() {
1552
- const t = this.getSelectedLinkText(this.editor), e = {
1537
+ const e = this.getSelectedLinkText(this.editor), t = {
1553
1538
  href: this.editor.getAttributes("link").href,
1554
- text: t
1539
+ text: e
1555
1540
  };
1556
- this.$emit("edit-link", e);
1541
+ this.$emit("edit-link", t);
1557
1542
  },
1558
1543
  removeLink() {
1559
- var t, e, n, r;
1560
- (r = (n = (e = (t = this.editor) == null ? void 0 : t.chain()) == null ? void 0 : e.focus()) == null ? void 0 : n.unsetLink()) == null || r.run();
1544
+ var e, t, n, r;
1545
+ (r = (n = (t = (e = this.editor) == null ? void 0 : e.chain()) == null ? void 0 : t.focus()) == null ? void 0 : n.unsetLink()) == null || r.run();
1561
1546
  },
1562
1547
  openLink() {
1563
- var e, n;
1564
- (n = (e = this.editor) == null ? void 0 : e.chain()) == null || n.focus();
1565
- const t = this.editor.getAttributes("link").href;
1566
- window.open(t, "_blank");
1548
+ var t, n;
1549
+ (n = (t = this.editor) == null ? void 0 : t.chain()) == null || n.focus();
1550
+ const e = this.editor.getAttributes("link").href;
1551
+ window.open(e, "_blank");
1567
1552
  },
1568
1553
  // eslint-disable-next-line complexity
1569
- setLink(t, e, n, r = $, s) {
1570
- var a, l, c;
1571
- if (!t) {
1554
+ setLink(e, t, n, r = $, s) {
1555
+ var a, l, d;
1556
+ if (!e) {
1572
1557
  this.removeLink();
1573
1558
  return;
1574
1559
  }
1575
- r.find((u) => u.test(t)) || (t = `${s}${t}`), this.editor.chain().focus().extendMarkRange("link").run();
1576
- const i = (c = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : c.selection;
1577
- this.editor.chain().focus().insertContent(e).setTextSelection({ from: i.from, to: i.from + e.length }).setLink({ href: t, class: n.class }).run();
1560
+ r.find((u) => u.test(e)) || (e = `${s}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1561
+ const o = (d = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : d.selection;
1562
+ this.editor.chain().focus().insertContent(t).setTextSelection({ from: o.from, to: o.from + t.length }).setLink({ href: e, class: n.class }).run();
1578
1563
  },
1579
1564
  // eslint-disable-next-line complexity
1580
- processValue(t, e = !0) {
1565
+ processValue(e, t = !0) {
1581
1566
  const n = this.getOutput();
1582
- if (!(e && Be(t, n))) {
1583
- if (typeof t == "string" && this.outputFormat === "text") {
1567
+ if (!(t && Ae(e, n))) {
1568
+ if (typeof e == "string" && this.outputFormat === "text") {
1584
1569
  const r = new RegExp(`(${O})`, "g");
1585
- t = t == null ? void 0 : t.replace(r, '<emoji-component code="$1"></emoji-component>');
1570
+ e = e == null ? void 0 : e.replace(r, '<emoji-component code="$1"></emoji-component>');
1586
1571
  }
1587
- this.editor.commands.setContent(t, !1, { preserveWhitespace: "full" });
1572
+ this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
1588
1573
  }
1589
1574
  },
1590
1575
  destroyEditor() {
1591
1576
  this.editor.destroy();
1592
1577
  },
1593
- insertPlainTextWithHardBreaks(t, e) {
1594
- const { tr: n } = t.state, { from: r, to: s } = t.state.selection;
1578
+ insertPlainTextWithHardBreaks(e, t) {
1579
+ const { tr: n } = e.state, { from: r, to: s } = e.state.selection;
1595
1580
  n.deleteRange(r, s);
1596
- const o = e.split(/\r?\n/);
1597
- let i = r;
1598
- for (let a = 0; a < o.length; a++)
1599
- a > 0 && (n.insert(i, t.state.schema.nodes.hardBreak.create()), i++), n.insertText(o[a], i), i += o[a].length;
1600
- t.dispatch(n);
1601
- },
1602
- shouldPreserveLineBreaks(t, e) {
1603
- return this.pasteRichText ? !e && t && this.hasBlankLines(t) : !!t;
1604
- },
1605
- processPasteData(t, e, n) {
1606
- if (this.shouldPreserveLineBreaks(e, n))
1607
- return this.insertPlainTextWithHardBreaks(t, e), !0;
1581
+ const i = t.split(/\r?\n/);
1582
+ let o = r;
1583
+ for (let a = 0; a < i.length; a++)
1584
+ a > 0 && (n.insert(o, e.state.schema.nodes.hardBreak.create()), o++), n.insertText(i[a], o), o += i[a].length;
1585
+ e.dispatch(n);
1586
+ },
1587
+ shouldPreserveLineBreaks(e, t) {
1588
+ return this.pasteRichText ? !t && e && this.hasBlankLines(e) : !!e;
1589
+ },
1590
+ processPasteData(e, t, n) {
1591
+ if (this.shouldPreserveLineBreaks(t, n))
1592
+ return this.insertPlainTextWithHardBreaks(e, t), !0;
1608
1593
  if (this.shouldHandlePreformattedHTML(n)) {
1609
1594
  const r = this.extractPreformattedText(n);
1610
1595
  if (r && r.includes(`
1611
1596
  `))
1612
- return this.insertPlainTextWithHardBreaks(t, r), !0;
1597
+ return this.insertPlainTextWithHardBreaks(e, r), !0;
1613
1598
  }
1614
1599
  return !1;
1615
1600
  },
1616
- shouldHandlePreformattedHTML(t) {
1617
- return this.pasteRichText && t && this.containsPreformattedContent(t);
1601
+ shouldHandlePreformattedHTML(e) {
1602
+ return this.pasteRichText && e && this.containsPreformattedContent(e);
1618
1603
  },
1619
- containsPreformattedContent(t) {
1620
- const e = document.createElement("div");
1621
- e.innerHTML = t;
1622
- const n = e.querySelectorAll("*");
1604
+ containsPreformattedContent(e) {
1605
+ const t = document.createElement("div");
1606
+ t.innerHTML = e;
1607
+ const n = t.querySelectorAll("*");
1623
1608
  for (const r of n)
1624
1609
  if (this.hasPreWhitespace(r) && this.hasLineBreaks(r))
1625
1610
  return !0;
1626
1611
  return !1;
1627
1612
  },
1628
- hasPreWhitespace(t) {
1629
- const e = t.getAttribute("style") || "", n = t.style.whiteSpace || "", r = n === "pre" || n === "pre-wrap", s = e.includes("white-space: pre");
1613
+ hasPreWhitespace(e) {
1614
+ const t = e.getAttribute("style") || "", n = e.style.whiteSpace || "", r = n === "pre" || n === "pre-wrap", s = t.includes("white-space: pre");
1630
1615
  return r || s;
1631
1616
  },
1632
- hasLineBreaks(t) {
1633
- return t.textContent && t.textContent.includes(`
1617
+ hasLineBreaks(e) {
1618
+ return e.textContent && e.textContent.includes(`
1634
1619
  `);
1635
1620
  },
1636
- hasBlankLines(t) {
1637
- return t.includes(`
1621
+ hasBlankLines(e) {
1622
+ return e.includes(`
1638
1623
 
1639
- `) || /\n\s*\n/.test(t);
1640
- },
1641
- extractPreformattedText(t) {
1642
- const e = document.createElement("div");
1643
- return e.innerHTML = t, this.walkAndExtractText(e);
1644
- },
1645
- walkAndExtractText(t) {
1646
- let e = "";
1647
- if (t.nodeType === Node.TEXT_NODE)
1648
- e += t.textContent;
1649
- else if (t.nodeType === Node.ELEMENT_NODE)
1650
- if (this.hasPreWhitespace(t))
1651
- e += t.textContent;
1624
+ `) || /\n\s*\n/.test(e);
1625
+ },
1626
+ extractPreformattedText(e) {
1627
+ const t = document.createElement("div");
1628
+ return t.innerHTML = e, this.walkAndExtractText(t);
1629
+ },
1630
+ walkAndExtractText(e) {
1631
+ let t = "";
1632
+ if (e.nodeType === Node.TEXT_NODE)
1633
+ t += e.textContent;
1634
+ else if (e.nodeType === Node.ELEMENT_NODE)
1635
+ if (this.hasPreWhitespace(e))
1636
+ t += e.textContent;
1652
1637
  else
1653
- for (const n of t.childNodes)
1654
- e += this.walkAndExtractText(n);
1655
- return e;
1638
+ for (const n of e.childNodes)
1639
+ t += this.walkAndExtractText(n);
1640
+ return t;
1656
1641
  },
1657
1642
  triggerInputChangeEvents() {
1658
- const t = this.getOutput();
1659
- this.$emit("input", t), this.$emit("update:value", t);
1660
- const e = this.editor.getJSON();
1661
- this.$emit("json-input", e);
1643
+ const e = this.getOutput();
1644
+ this.$emit("input", e), this.$emit("update:value", e);
1645
+ const t = this.editor.getJSON();
1646
+ this.$emit("json-input", t);
1662
1647
  const n = this.editor.getHTML();
1663
1648
  this.$emit("html-input", n);
1664
1649
  const r = this.editor.getText({ blockSeparator: `
@@ -1674,12 +1659,12 @@ ${r.textContent}
1674
1659
  this.triggerInputChangeEvents();
1675
1660
  }), this.editor.on("update", () => {
1676
1661
  this.triggerInputChangeEvents();
1677
- }), this.editor.on("selectionUpdate", ({ editor: t }) => {
1678
- this.$emit("selected", this.getSelectedLinkText(t));
1679
- }), this.editor.on("focus", ({ event: t }) => {
1680
- this.$emit("focus", t);
1681
- }), this.editor.on("blur", ({ event: t }) => {
1682
- this.$emit("blur", t);
1662
+ }), this.editor.on("selectionUpdate", ({ editor: e }) => {
1663
+ this.$emit("selected", this.getSelectedLinkText(e));
1664
+ }), this.editor.on("focus", ({ event: e }) => {
1665
+ this.$emit("focus", e);
1666
+ }), this.editor.on("blur", ({ event: e }) => {
1667
+ this.$emit("blur", e);
1683
1668
  });
1684
1669
  },
1685
1670
  getOutput() {
@@ -1694,17 +1679,17 @@ ${r.textContent}
1694
1679
  ` });
1695
1680
  }
1696
1681
  },
1697
- getExtension(t, e) {
1682
+ getExtension(e, t) {
1698
1683
  var n;
1699
- return typeof e == "boolean" ? t : (n = t.configure) == null ? void 0 : n.call(t, e);
1684
+ return typeof t == "boolean" ? e : (n = e.configure) == null ? void 0 : n.call(e, t);
1700
1685
  },
1701
- updateEditorAttributes(t) {
1686
+ updateEditorAttributes(e) {
1702
1687
  this.editor.setOptions({
1703
1688
  editorProps: {
1704
1689
  attributes: {
1705
1690
  ...this.inputAttrs,
1706
1691
  class: this.inputClass,
1707
- ...t
1692
+ ...e
1708
1693
  }
1709
1694
  }
1710
1695
  });
@@ -1715,9 +1700,9 @@ ${r.textContent}
1715
1700
  }
1716
1701
  };
1717
1702
  var Gt = function() {
1718
- var e = this, n = e._self._c;
1719
- 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);
1720
- }, Qt = [], Zt = /* @__PURE__ */ d(
1703
+ var t = this, n = t._self._c;
1704
+ 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);
1705
+ }, Qt = [], Zt = /* @__PURE__ */ c(
1721
1706
  Yt,
1722
1707
  Gt,
1723
1708
  Qt