@dialpad/dialtone-vue 2.190.1 → 2.191.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
  3. package/dist/lib/emoji-picker/emoji-picker.cjs.map +1 -1
  4. package/dist/lib/emoji-picker/emoji-picker.js +9 -6
  5. package/dist/lib/emoji-picker/emoji-picker.js.map +1 -1
  6. package/dist/lib/message-input/message-input.cjs +1 -1
  7. package/dist/lib/message-input/message-input.cjs.map +1 -1
  8. package/dist/lib/message-input/message-input.js +14 -6
  9. package/dist/lib/message-input/message-input.js.map +1 -1
  10. package/dist/lib/popover/popover.cjs +1 -1
  11. package/dist/lib/popover/popover.cjs.map +1 -1
  12. package/dist/lib/popover/popover.js +1 -1
  13. package/dist/lib/popover/popover.js.map +1 -1
  14. package/dist/lib/rich-text-editor/mention-suggestion.cjs +1 -1
  15. package/dist/lib/rich-text-editor/mention-suggestion.cjs.map +1 -1
  16. package/dist/lib/rich-text-editor/mention-suggestion.js +33 -14
  17. package/dist/lib/rich-text-editor/mention-suggestion.js.map +1 -1
  18. package/dist/lib/rich-text-editor/rich-text-editor.cjs +4 -4
  19. package/dist/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  20. package/dist/lib/rich-text-editor/rich-text-editor.js +326 -307
  21. package/dist/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  22. package/dist/node_modules/@tiptap/vue-2.cjs +1 -1
  23. package/dist/node_modules/@tiptap/vue-2.cjs.map +1 -1
  24. package/dist/node_modules/@tiptap/vue-2.js +191 -149
  25. package/dist/node_modules/@tiptap/vue-2.js.map +1 -1
  26. package/dist/types/components/emoji_picker/emoji_picker.vue.d.ts.map +1 -1
  27. package/dist/types/components/popover/popover.vue.d.ts.map +1 -1
  28. package/dist/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +16 -16
  29. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +16 -16
  30. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +16 -16
  31. package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts +5 -0
  32. package/dist/types/components/rich_text_editor/extensions/mentions/MentionSuggestion.vue.d.ts.map +1 -1
  33. package/dist/types/components/rich_text_editor/extensions/slash_command/SlashCommandComponent.vue.d.ts +16 -16
  34. package/dist/types/components/rich_text_editor/mention_suggestion.d.ts +23 -3
  35. package/dist/types/components/rich_text_editor/mention_suggestion.d.ts.map +1 -1
  36. package/dist/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  37. package/dist/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +16 -16
  38. package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts +1 -1
  39. package/dist/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  40. package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +1 -1
  41. package/package.json +35 -35
@@ -1,5 +1,5 @@
1
- import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as b, VueNodeViewRenderer as w, EditorContent as P, BubbleMenu as H, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
2
- import { Node as q, mergeAttributes as m, InputRule as K, nodePasteRule as R, getMarksBetween as U, combineTransactionSteps as N, 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 b, EditorContent as P, BubbleMenu as H, Editor as F } from "../../node_modules/@tiptap/vue-2.js";
2
+ import { Node as q, mergeAttributes as m, InputRule as K, nodePasteRule as T, getMarksBetween as U, combineTransactionSteps as N, getChangedRanges as V, findChildrenInRange as z, Mark as W, 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";
@@ -10,12 +10,12 @@ 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
12
  import ie from "@tiptap/extension-italic";
13
- import oe from "@tiptap/extension-link";
14
- import se from "@tiptap/extension-list-item";
13
+ import se from "@tiptap/extension-link";
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,18 +24,18 @@ 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 M } from "regex-combined-emojis";
27
- import { n as d } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
27
+ import { n as c } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
28
28
  import O from "../emoji/emoji.js";
29
- import { stringToUnicode as ye, codeToEmojiData as E, emojiRegex as be, emojiShortCodeRegex as we } from "../../common/emoji/index.js";
29
+ import { stringToUnicode as ye, codeToEmojiData as E, emojiRegex as we, emojiShortCodeRegex as be } from "../../common/emoji/index.js";
30
30
  import { emojisIndexed as ve } from "@dialpad/dialtone-emojis";
31
31
  import xe from "../list-item/list-item.js";
32
32
  import v from "../stack/stack.js";
33
33
  import x from "tippy.js";
34
- import { linkRegex as ke, getPhoneNumberRegex as Ce, warnIfUnmounted as Se } from "../../common/utils/index.js";
35
- import Re from "@tiptap/extension-image";
34
+ import { linkRegex as Ce, getPhoneNumberRegex as ke, warnIfUnmounted as Se } from "../../common/utils/index.js";
35
+ import Te from "@tiptap/extension-image";
36
36
  import $ from "@tiptap/extension-mention";
37
- import B from "../link/link.js";
38
- import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Te, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Ee, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as L } from "./rich-text-editor-constants.js";
37
+ import D from "../link/link.js";
38
+ import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Re, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Ee, RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as L } from "./rich-text-editor-constants.js";
39
39
  import $e from "../avatar/avatar.js";
40
40
  import Le from "@dialpad/dialtone-icons/vue2/hash";
41
41
  import Ie from "@dialpad/dialtone-icons/vue2/lock";
@@ -50,14 +50,14 @@ const Me = {
50
50
  props: y
51
51
  };
52
52
  var Oe = function() {
53
- var t = this, r = t._self._c;
54
- return r("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [r("dt-emoji", { attrs: { size: "500", code: t.node.attrs.code } })], 1);
55
- }, Be = [], De = /* @__PURE__ */ d(
53
+ var e = this, r = e._self._c;
54
+ return r("node-view-wrapper", { staticClass: "d-d-inline-block d-va-bottom d-lh0" }, [r("dt-emoji", { attrs: { size: "500", code: e.node.attrs.code } })], 1);
55
+ }, De = [], Be = /* @__PURE__ */ c(
56
56
  Me,
57
57
  Oe,
58
- Be
58
+ De
59
59
  );
60
- const Pe = De.exports, He = {
60
+ const Pe = Be.exports, He = {
61
61
  name: "SuggestionList",
62
62
  components: {
63
63
  DtListItem: xe
@@ -91,8 +91,8 @@ const Pe = De.exports, He = {
91
91
  }
92
92
  },
93
93
  methods: {
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;
94
+ onKeyDown({ event: t }) {
95
+ return t.key === "ArrowUp" ? (this.upHandler(), !0) : t.key === "ArrowDown" ? (this.downHandler(), !0) : t.key === "Enter" || t.key === "Tab" ? (this.selectHandler(), !0) : !1;
96
96
  },
97
97
  upHandler() {
98
98
  this.selectedIndex = (this.selectedIndex + this.items.length - 1) % this.items.length, this.scrollActiveElementIntoView();
@@ -102,8 +102,8 @@ const Pe = De.exports, He = {
102
102
  },
103
103
  async scrollActiveElementIntoView() {
104
104
  await this.$nextTick();
105
- const e = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
106
- e && e.scrollIntoView({
105
+ const t = this.$refs.suggestionList.querySelector(".d-list-item--highlighted");
106
+ t && t.scrollIntoView({
107
107
  behaviour: "smooth",
108
108
  block: "center"
109
109
  });
@@ -111,43 +111,43 @@ const Pe = De.exports, He = {
111
111
  selectHandler() {
112
112
  this.selectItem(this.selectedIndex);
113
113
  },
114
- selectItem(e) {
115
- const t = this.items[e];
114
+ selectItem(t) {
115
+ const e = this.items[t];
116
116
  switch (this.itemType) {
117
117
  case "emoji":
118
- this.command(t);
118
+ this.command(e);
119
119
  return;
120
120
  case "mention":
121
- this.command({ name: t.name, id: t.id, avatarSrc: t.avatarSrc });
121
+ this.command({ name: e.name, id: e.id, avatarSrc: e.avatarSrc });
122
122
  break;
123
123
  case "channel":
124
- this.command({ name: t.name, id: t.id });
124
+ this.command({ name: e.name, id: e.id });
125
125
  break;
126
126
  case "slash-command":
127
- this.command({ command: t.command });
127
+ this.command({ command: e.command });
128
128
  break;
129
129
  }
130
130
  }
131
131
  }
132
132
  };
133
133
  var Fe = function() {
134
- var t = this, r = t._self._c;
135
- return r("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [r("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(n, i) {
134
+ var e = this, r = e._self._c;
135
+ return r("div", { staticClass: "d-popover__dialog d-suggestion-list__container" }, [r("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(n, i) {
136
136
  return r("dt-list-item", { key: n.id, class: [
137
137
  "d-suggestion-list__item",
138
- { "d-list-item--highlighted": i === t.selectedIndex }
139
- ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(s) {
140
- return t.selectItem(i);
141
- }, keydown: function(s) {
142
- return s.preventDefault(), t.onKeyDown.apply(null, arguments);
143
- } } }, [r(t.itemComponent, { tag: "component", attrs: { item: n } })], 1);
138
+ { "d-list-item--highlighted": i === e.selectedIndex }
139
+ ], attrs: { "navigation-type": "arrow-keys" }, on: { click: function(o) {
140
+ return e.selectItem(i);
141
+ }, keydown: function(o) {
142
+ return o.preventDefault(), e.onKeyDown.apply(null, arguments);
143
+ } } }, [r(e.itemComponent, { tag: "component", attrs: { item: n } })], 1);
144
144
  }), 1)]);
145
- }, qe = [], Ke = /* @__PURE__ */ d(
145
+ }, qe = [], Ke = /* @__PURE__ */ c(
146
146
  He,
147
147
  Fe,
148
148
  qe
149
149
  );
150
- const k = Ke.exports, Ue = {
150
+ const C = Ke.exports, Ue = {
151
151
  name: "EmojiSuggestion",
152
152
  components: {
153
153
  DtEmoji: O,
@@ -161,57 +161,57 @@ const k = Ke.exports, Ue = {
161
161
  }
162
162
  };
163
163
  var Ne = function() {
164
- var t = this, r = t._self._c;
165
- return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [r("dt-emoji", { attrs: { size: "200", code: t.item.code } }), t._v(" " + t._s(t.item.code) + " ")], 1);
166
- }, Ve = [], ze = /* @__PURE__ */ d(
164
+ var e = this, r = e._self._c;
165
+ return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [r("dt-emoji", { attrs: { size: "200", code: e.item.code } }), e._v(" " + e._s(e.item.code) + " ")], 1);
166
+ }, Ve = [], ze = /* @__PURE__ */ c(
167
167
  Ue,
168
168
  Ne,
169
169
  Ve
170
170
  );
171
- const We = ze.exports, C = {
171
+ const We = ze.exports, k = {
172
172
  name: "hideOnEsc",
173
173
  defaultValue: !0,
174
- fn({ hide: e }) {
175
- function t(r) {
176
- r.keyCode === 27 && e();
174
+ fn({ hide: t }) {
175
+ function e(r) {
176
+ r.keyCode === 27 && t();
177
177
  }
178
178
  return {
179
179
  onShow() {
180
- document.addEventListener("keydown", t);
180
+ document.addEventListener("keydown", e);
181
181
  },
182
182
  onHide() {
183
- document.removeEventListener("keydown", t);
183
+ document.removeEventListener("keydown", e);
184
184
  }
185
185
  };
186
186
  }
187
187
  }, Xe = 20, Je = {
188
- items: ({ query: e }) => {
189
- if (e.length < 2)
188
+ items: ({ query: t }) => {
189
+ if (t.length < 2)
190
190
  return [];
191
- const t = Object.values(ve);
192
- return e = e.toLowerCase(), t.filter(
191
+ const e = Object.values(ve);
192
+ return t = t.toLowerCase(), e.filter(
193
193
  (n) => [
194
194
  n.name,
195
195
  n.shortname.replaceAll(":", ""),
196
196
  ...n.keywords
197
- ].some((i) => i.startsWith(e))
197
+ ].some((i) => i.startsWith(t))
198
198
  ).splice(0, Xe).map((n) => ({ code: n.shortname }));
199
199
  },
200
- command: ({ editor: e, range: t, props: r }) => {
201
- var s, o;
202
- const n = e.view.state.selection.$to.nodeAfter;
203
- ((s = n == null ? void 0 : n.text) == null ? void 0 : s.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
200
+ command: ({ editor: t, range: e, props: r }) => {
201
+ var o, s;
202
+ const n = t.view.state.selection.$to.nodeAfter;
203
+ ((o = n == null ? void 0 : n.text) == null ? void 0 : o.startsWith(" ")) && (e.to += 1), t.chain().focus().insertContentAt(e, [
204
204
  {
205
205
  type: "emoji",
206
206
  attrs: r
207
207
  }
208
- ]).run(), (o = window.getSelection()) == null || o.collapseToEnd();
208
+ ]).run(), (s = window.getSelection()) == null || s.collapseToEnd();
209
209
  },
210
210
  render: () => {
211
- let e, t, r = !1;
211
+ let t, e, r = !1;
212
212
  return {
213
213
  onStart: (n) => {
214
- e = new b(k, {
214
+ t = new w(C, {
215
215
  parent: void 0,
216
216
  propsData: {
217
217
  itemComponent: We,
@@ -219,10 +219,10 @@ const We = ze.exports, C = {
219
219
  ...n
220
220
  },
221
221
  editor: n.editor
222
- }), n.clientRect && (t = x("body", {
222
+ }), n.clientRect && (e = x("body", {
223
223
  getReferenceClientRect: n.clientRect,
224
224
  appendTo: () => document.body,
225
- content: e.element,
225
+ content: t.element,
226
226
  showOnCreate: !1,
227
227
  onShow: () => {
228
228
  r = !0;
@@ -234,28 +234,28 @@ const We = ze.exports, C = {
234
234
  trigger: "manual",
235
235
  placement: "top-start",
236
236
  zIndex: 650,
237
- plugins: [C]
238
- }), n.items.length > 0 && (t == null || t[0].show()));
237
+ plugins: [k]
238
+ }), n.items.length > 0 && (e == null || e[0].show()));
239
239
  },
240
240
  onUpdate(n) {
241
- e == null || e.updateProps(n), n.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), t == null || t[0].setProps({
241
+ t == null || t.updateProps(n), n.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), e == null || e[0].setProps({
242
242
  getReferenceClientRect: n.clientRect
243
243
  });
244
244
  },
245
245
  onKeyDown(n) {
246
246
  var i;
247
247
  if (r)
248
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
248
+ return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(n);
249
249
  },
250
250
  onExit() {
251
- t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
251
+ e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
252
252
  }
253
253
  };
254
254
  }
255
- }, Ye = /(:\w+:)$/, Ge = new RegExp(M + "$"), Qe = (e) => {
256
- if (e && E(e[0]))
257
- return { text: e[2] || e[0] };
258
- }, Ze = (e) => [...e.matchAll(we)].filter((r) => E(r[0])).map((r) => ({
255
+ }, Ye = /(:\w+:)$/, Ge = new RegExp(M + "$"), Qe = (t) => {
256
+ if (t && E(t[0]))
257
+ return { text: t[2] || t[0] };
258
+ }, Ze = (t) => [...t.matchAll(be)].filter((r) => E(r[0])).map((r) => ({
259
259
  index: r.index,
260
260
  text: r[0],
261
261
  match: r
@@ -271,7 +271,7 @@ const We = ze.exports, C = {
271
271
  selectable: !1,
272
272
  atom: !0,
273
273
  addNodeView() {
274
- return w(Pe);
274
+ return b(Pe);
275
275
  },
276
276
  addAttributes() {
277
277
  return {
@@ -287,44 +287,44 @@ const We = ze.exports, C = {
287
287
  }
288
288
  ];
289
289
  },
290
- renderText({ node: e }) {
291
- return ye(E(e.attrs.code).unicode_output);
290
+ renderText({ node: t }) {
291
+ return ye(E(t.attrs.code).unicode_output);
292
292
  },
293
- renderHTML({ HTMLAttributes: e }) {
294
- return ["emoji-component", m(this.options.HTMLAttributes, e)];
293
+ renderHTML({ HTMLAttributes: t }) {
294
+ return ["emoji-component", m(this.options.HTMLAttributes, t)];
295
295
  },
296
296
  addInputRules() {
297
297
  return [
298
298
  new K({
299
- find: (e) => {
300
- const t = e.match(Ye) || e.match(Ge);
301
- if (t)
302
- return Qe(t);
299
+ find: (t) => {
300
+ const e = t.match(Ye) || t.match(Ge);
301
+ if (e)
302
+ return Qe(e);
303
303
  },
304
- handler: ({ state: e, range: t, match: r, commands: n, chain: i, can: s }) => {
305
- const { tr: o } = e, a = t.from, l = t.to;
306
- o.replaceWith(a, l, this.type.create({ code: r[0] }));
304
+ handler: ({ state: t, range: e, match: r, commands: n, chain: i, can: o }) => {
305
+ const { tr: s } = t, a = e.from, l = e.to;
306
+ s.replaceWith(a, l, this.type.create({ code: r[0] }));
307
307
  }
308
308
  })
309
309
  ];
310
310
  },
311
311
  addPasteRules() {
312
312
  return [
313
- R({
313
+ T({
314
314
  find: Ze,
315
315
  type: this.type,
316
- getAttributes(e) {
316
+ getAttributes(t) {
317
317
  return {
318
- code: e[0]
318
+ code: t[0]
319
319
  };
320
320
  }
321
321
  }),
322
- R({
323
- find: be,
322
+ T({
323
+ find: we,
324
324
  type: this.type,
325
- getAttributes(e) {
325
+ getAttributes(t) {
326
326
  return {
327
- code: e[0]
327
+ code: t[0]
328
328
  };
329
329
  }
330
330
  })
@@ -343,42 +343,42 @@ const We = ze.exports, C = {
343
343
  },
344
344
  addKeyboardShortcuts() {
345
345
  return {
346
- Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
346
+ Backspace: () => this.editor.commands.command(({ tr: t, state: e }) => {
347
347
  let r = !1;
348
- const { selection: n } = t, { empty: i, anchor: s } = n;
349
- return i ? (t.doc.nodesBetween(s - 1, s, (o, a) => {
350
- if (o.type.name === this.name)
351
- return r = !0, e.insertText("", a, a + o.nodeSize), !1;
348
+ const { selection: n } = e, { empty: i, anchor: o } = n;
349
+ return i ? (e.doc.nodesBetween(o - 1, o, (s, a) => {
350
+ if (s.type.name === this.name)
351
+ return r = !0, t.insertText("", a, a + s.nodeSize), !1;
352
352
  }), r) : !1;
353
353
  })
354
354
  };
355
355
  }
356
356
  });
357
- function tt(e, t, r = () => !0) {
357
+ function tt(t, e, r = () => !0) {
358
358
  const n = [];
359
- t.lastIndex = 0;
359
+ e.lastIndex = 0;
360
360
  let i;
361
- for (; i = t.exec(e); )
362
- r(e, i) && n.push(i);
361
+ for (; i = e.exec(t); )
362
+ r(t, i) && n.push(i);
363
363
  return n;
364
364
  }
365
- function nt(e, t) {
366
- return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
365
+ function nt(t, e) {
366
+ return !["#", "@"].includes(t.charAt(e.index)) && !["#", "@"].includes(t.charAt(e.index - 1));
367
367
  }
368
- function rt(e) {
369
- const t = new RegExp(
368
+ function rt(t) {
369
+ const e = new RegExp(
370
370
  "(?:" + [
371
371
  `[!?.,:;'"]`,
372
372
  "(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"
373
373
  ].join("|"),
374
374
  "g"
375
375
  );
376
- return e.replace(t, "");
376
+ return t.replace(e, "");
377
377
  }
378
- function it(e, t) {
379
- const r = e.slice(0, t + 1).search(/\S+\s*$/), n = e.slice(t).search(/\s/);
378
+ function it(t, e) {
379
+ const r = t.slice(0, e + 1).search(/\S+\s*$/), n = t.slice(e).search(/\s/);
380
380
  if (n < 0) {
381
- const i = e.slice(r);
381
+ const i = t.slice(r);
382
382
  return {
383
383
  text: i,
384
384
  from: r,
@@ -386,61 +386,61 @@ function it(e, t) {
386
386
  };
387
387
  }
388
388
  return {
389
- text: e.slice(r, n + t),
389
+ text: t.slice(r, n + e),
390
390
  from: r,
391
- to: n + t
391
+ to: n + e
392
392
  };
393
393
  }
394
- function T(e, t, r, n) {
395
- const i = it(e, t);
394
+ function R(t, e, r, n) {
395
+ const i = it(t, e);
396
396
  if (n.lastIndex = 0, !n.test(i.text))
397
397
  return i;
398
- const s = r === "left" ? i.from - 1 : i.to + 1;
399
- return s <= 0 || s >= e.length || s === t ? i : T(e, s, r, n);
398
+ const o = r === "left" ? i.from - 1 : i.to + 1;
399
+ return o <= 0 || o >= t.length || o === e ? i : R(t, o, r, n);
400
400
  }
401
- function ot(e, t, r, n) {
402
- const i = Math.max(e.from - 1, 0), s = Math.min(e.to + 1, t.content.size), o = U(i, s, t);
403
- for (const a of o)
401
+ function st(t, e, r, n) {
402
+ const i = Math.max(t.from - 1, 0), o = Math.min(t.to + 1, e.content.size), s = U(i, o, e);
403
+ for (const a of s)
404
404
  a.mark.type === n && r.removeMark(a.from, a.to, n);
405
405
  }
406
- const I = Ce(1, 15);
407
- function A(e, t, r, n, i, s) {
408
- if (!e)
406
+ const I = ke(1, 15);
407
+ function A(t, e, r, n, i, o) {
408
+ if (!t)
409
409
  return;
410
- let o = r - t - 1;
411
- o = o < 0 ? 0 : o;
412
- const a = n - t, l = T(
413
- e,
414
- o,
410
+ let s = r - e - 1;
411
+ s = s < 0 ? 0 : s;
412
+ const a = n - e, l = R(
413
+ t,
414
+ s,
415
415
  "left",
416
416
  I
417
- ), c = T(
418
- e,
417
+ ), d = R(
418
+ t,
419
419
  a,
420
420
  "right",
421
421
  I
422
- ), u = e.slice(l.from, c.to);
423
- tt(u, ke, nt).forEach((S) => {
424
- const h = rt(S[0]), g = t + l.from + S.index + 1, D = g + h.length;
425
- i.addMark(g, D, s.create());
422
+ ), u = t.slice(l.from, d.to);
423
+ tt(u, Ce, nt).forEach((S) => {
424
+ const h = rt(S[0]), g = e + l.from + S.index + 1, B = g + h.length;
425
+ i.addMark(g, B, o.create());
426
426
  });
427
427
  }
428
- function st(e) {
429
- let t = !1;
428
+ function ot(t) {
429
+ let e = !1;
430
430
  return new ge({
431
431
  key: new f("autolink"),
432
432
  appendTransaction: (r, n, i) => {
433
- const s = r.some((u) => u.docChanged) && !n.doc.eq(i.doc);
434
- if (t && !s)
433
+ const o = r.some((u) => u.docChanged) && !n.doc.eq(i.doc);
434
+ if (e && !o)
435
435
  return;
436
- const { tr: o } = i, { textContent: a } = i.doc;
437
- t || A(a, 0, 0, a.length, o, e.type), t = !0;
436
+ const { tr: s } = i, { textContent: a } = i.doc;
437
+ e || A(a, 0, 0, a.length, s, t.type), e = !0;
438
438
  const l = N(
439
439
  n.doc,
440
440
  [...r]
441
441
  );
442
442
  return V(l).forEach(({ oldRange: u, newRange: p }) => {
443
- ot(p, i.doc, o, e.type), z(
443
+ st(p, i.doc, s, t.type), z(
444
444
  i.doc,
445
445
  p,
446
446
  (h) => h.isTextblock
@@ -450,11 +450,11 @@ function st(e) {
450
450
  g,
451
451
  u.from,
452
452
  p.to,
453
- o,
454
- e.type
453
+ s,
454
+ t.type
455
455
  );
456
456
  });
457
- }), o;
457
+ }), s;
458
458
  }
459
459
  });
460
460
  }
@@ -463,25 +463,25 @@ const at = {
463
463
  rel: "noopener noreferrer nofollow"
464
464
  }, lt = W.create({
465
465
  name: "CustomLink",
466
- renderHTML({ HTMLAttributes: e }) {
466
+ renderHTML({ HTMLAttributes: t }) {
467
467
  return [
468
468
  "a",
469
469
  m(
470
470
  this.options.HTMLAttributes,
471
- e,
471
+ t,
472
472
  at
473
473
  )
474
474
  ];
475
475
  },
476
- renderText({ node: e }) {
477
- return e.attrs.text;
476
+ renderText({ node: t }) {
477
+ return t.attrs.text;
478
478
  },
479
479
  addProseMirrorPlugins() {
480
480
  return [
481
- st({ type: this.type })
481
+ ot({ type: this.type })
482
482
  ];
483
483
  }
484
- }), dt = Re.extend({
484
+ }), ct = Te.extend({
485
485
  name: "ConfigurableImage",
486
486
  addAttributes() {
487
487
  return {
@@ -505,18 +505,18 @@ const at = {
505
505
  }
506
506
  };
507
507
  }
508
- }).configure({ inline: !0, allowBase64: !0 }), ct = j.extend({
508
+ }).configure({ inline: !0, allowBase64: !0 }), dt = j.extend({
509
509
  parseHTML() {
510
510
  return [{ tag: "div" }];
511
511
  },
512
- renderHTML({ HTMLAttributes: e }) {
513
- return ["div", m(this.options.HTMLAttributes, e), 0];
512
+ renderHTML({ HTMLAttributes: t }) {
513
+ return ["div", m(this.options.HTMLAttributes, t), 0];
514
514
  }
515
515
  }), ut = {
516
516
  name: "MentionComponent",
517
517
  components: {
518
518
  NodeViewWrapper: _,
519
- DtLink: B
519
+ DtLink: D
520
520
  },
521
521
  props: y,
522
522
  computed: {
@@ -526,16 +526,16 @@ const at = {
526
526
  }
527
527
  };
528
528
  var mt = function() {
529
- var t = this, r = t._self._c;
530
- return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
531
- }, ht = [], ft = /* @__PURE__ */ d(
529
+ var e = this, r = e._self._c;
530
+ return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
531
+ }, ht = [], ft = /* @__PURE__ */ c(
532
532
  ut,
533
533
  mt,
534
534
  ht
535
535
  );
536
536
  const pt = ft.exports, gt = $.extend({
537
537
  addNodeView() {
538
- return w(pt);
538
+ return b(pt);
539
539
  },
540
540
  parseHTML() {
541
541
  return [
@@ -557,11 +557,11 @@ const pt = ft.exports, gt = $.extend({
557
557
  }
558
558
  };
559
559
  },
560
- renderText({ node: e }) {
561
- return `@${e.attrs.id}`;
560
+ renderText({ node: t }) {
561
+ return `@${t.attrs.id}`;
562
562
  },
563
- renderHTML({ HTMLAttributes: e }) {
564
- return ["mention-component", m(this.options.HTMLAttributes, e)];
563
+ renderHTML({ HTMLAttributes: t }) {
564
+ return ["mention-component", m(this.options.HTMLAttributes, t)];
565
565
  }
566
566
  }).configure({
567
567
  suggestion: {
@@ -572,7 +572,7 @@ const pt = ft.exports, gt = $.extend({
572
572
  name: "ChannelComponent",
573
573
  components: {
574
574
  NodeViewWrapper: _,
575
- DtLink: B
575
+ DtLink: D
576
576
  },
577
577
  props: y,
578
578
  computed: {
@@ -582,17 +582,17 @@ const pt = ft.exports, gt = $.extend({
582
582
  }
583
583
  };
584
584
  var yt = function() {
585
- var t = this, r = t._self._c;
586
- return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
587
- }, bt = [], wt = /* @__PURE__ */ d(
585
+ var e = this, r = e._self._c;
586
+ return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [e._v(" " + e._s(e.text) + " ")])], 1);
587
+ }, wt = [], bt = /* @__PURE__ */ c(
588
588
  _t,
589
589
  yt,
590
- bt
590
+ wt
591
591
  );
592
- const vt = wt.exports, xt = $.extend({
592
+ const vt = bt.exports, xt = $.extend({
593
593
  name: "channel",
594
594
  addNodeView() {
595
- return w(vt);
595
+ return b(vt);
596
596
  },
597
597
  parseHTML() {
598
598
  return [
@@ -614,18 +614,18 @@ const vt = wt.exports, xt = $.extend({
614
614
  }
615
615
  };
616
616
  },
617
- renderText({ node: e }) {
618
- return `#${e.attrs.id}`;
617
+ renderText({ node: t }) {
618
+ return `#${t.attrs.id}`;
619
619
  },
620
- renderHTML({ HTMLAttributes: e }) {
621
- return ["channel-component", m(this.options.HTMLAttributes, e)];
620
+ renderHTML({ HTMLAttributes: t }) {
621
+ return ["channel-component", m(this.options.HTMLAttributes, t)];
622
622
  }
623
623
  }).configure({
624
624
  suggestion: {
625
625
  char: "#",
626
626
  pluginKey: new f("channelSuggestion")
627
627
  }
628
- }), kt = {
628
+ }), Ct = {
629
629
  name: "SlashCommandsComponent",
630
630
  components: {
631
631
  NodeViewWrapper: _
@@ -641,15 +641,15 @@ const vt = wt.exports, xt = $.extend({
641
641
  this.$parent.$emit("selected-command", this.$props.node.attrs.command);
642
642
  }
643
643
  };
644
- var Ct = function() {
645
- var t = this, r = t._self._c;
646
- return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [t._v(" " + t._s(t.text) + " ")]);
647
- }, St = [], Rt = /* @__PURE__ */ d(
648
- kt,
644
+ var kt = function() {
645
+ var e = this, r = e._self._c;
646
+ return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [e._v(" " + e._s(e.text) + " ")]);
647
+ }, St = [], Tt = /* @__PURE__ */ c(
649
648
  Ct,
649
+ kt,
650
650
  St
651
651
  );
652
- const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
652
+ const Rt = Tt.exports, Et = (t, e) => [...t.matchAll(e)].map((n) => {
653
653
  let i = n[2];
654
654
  return i.endsWith(" ") || (i += " "), {
655
655
  index: n.index,
@@ -661,7 +661,7 @@ const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
661
661
  group: "inline",
662
662
  inline: !0,
663
663
  addNodeView() {
664
- return w(Tt);
664
+ return b(Rt);
665
665
  },
666
666
  parseHTML() {
667
667
  return [
@@ -683,18 +683,18 @@ const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
683
683
  }
684
684
  };
685
685
  },
686
- renderText({ node: e }) {
687
- return `/${e.attrs.command}`;
686
+ renderText({ node: t }) {
687
+ return `/${t.attrs.command}`;
688
688
  },
689
- renderHTML({ HTMLAttributes: e }) {
690
- return ["command-component", m(this.options.HTMLAttributes, e)];
689
+ renderHTML({ HTMLAttributes: t }) {
690
+ return ["command-component", m(this.options.HTMLAttributes, t)];
691
691
  },
692
692
  addInputRules() {
693
693
  var r;
694
- const e = (r = this.options.suggestion) == null ? void 0 : r.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) $`);
694
+ const t = (r = this.options.suggestion) == null ? void 0 : r.items({ query: "" }).map((n) => n.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) $`);
695
695
  return [
696
696
  X({
697
- find: t,
697
+ find: e,
698
698
  type: this.type,
699
699
  getAttributes(n) {
700
700
  return { command: n[2] };
@@ -704,10 +704,10 @@ const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
704
704
  },
705
705
  addPasteRules() {
706
706
  var r;
707
- const e = (r = this.options.suggestion) == null ? void 0 : r.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
707
+ const t = (r = this.options.suggestion) == null ? void 0 : r.items({ query: "" }).map((n) => n.command), e = new RegExp(`^((?:\\/)(${t.join("|")})) ?$`, "g");
708
708
  return [
709
- R({
710
- find: (n) => Et(n, t),
709
+ T({
710
+ find: (n) => Et(n, e),
711
711
  type: this.type,
712
712
  getAttributes(n) {
713
713
  return { command: n[0].trim() };
@@ -738,13 +738,33 @@ const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
738
738
  },
739
739
  avatarSrc() {
740
740
  return this.item.avatarSrc;
741
+ },
742
+ presence() {
743
+ return this.item.presence;
744
+ },
745
+ status() {
746
+ return this.item.status;
747
+ },
748
+ presenceText() {
749
+ return this.item.presenceText;
750
+ },
751
+ presenceFontColorClass() {
752
+ return {
753
+ active: "d-recipe-contact-row--active",
754
+ busy: "d-recipe-contact-row--busy",
755
+ away: "d-recipe-contact-row--away",
756
+ offline: "d-recipe-contact-row--busy"
757
+ }[this.presence];
758
+ },
759
+ showDetails() {
760
+ return this.item.showDetails;
741
761
  }
742
762
  }
743
763
  };
744
764
  var It = function() {
745
- var t = this, r = t._self._c;
746
- return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [r("dt-avatar", { attrs: { "full-name": t.name, "image-src": t.avatarSrc, "image-alt": t.name, size: "xs" } }), r("span", { staticClass: "d-mention-suggestion__name" }, [t._v(" " + t._s(t.name) + " ")])], 1);
747
- }, At = [], jt = /* @__PURE__ */ d(
765
+ var e = this, r = e._self._c;
766
+ return r("dt-stack", { staticClass: "d-mention-suggestion__container", attrs: { direction: "row", gap: "400" } }, [r("dt-avatar", { attrs: { "full-name": e.name, "image-src": e.avatarSrc, "image-alt": e.name, "show-presence": e.showDetails, presence: e.presence, size: "sm" } }), r("dt-stack", { staticClass: "d-mention-suggestion__details-container", attrs: { gap: "100" } }, [r("span", { staticClass: "d-mention-suggestion__name" }, [e._v(" " + e._s(e.name) + " ")]), e.showDetails ? r("dt-stack", { staticClass: "d-label--sm-plain", attrs: { direction: "row", gap: "300" } }, [e.presenceText ? r("span", { staticClass: "d-mention-suggestion__presence", class: [e.presenceFontColorClass] }, [e._v(" " + e._s(e.presenceText) + " ")]) : e._e(), e.status && e.presenceText ? r("div", { staticClass: "d-mention-suggestion__divider" }, [e._v(" • ")]) : e._e(), e.status ? r("div", { staticClass: "d-mention-suggestion__status" }, [e._v(" " + e._s(e.status) + " ")]) : e._e()]) : e._e()], 1)], 1);
767
+ }, At = [], jt = /* @__PURE__ */ c(
748
768
  Lt,
749
769
  It,
750
770
  At
@@ -755,10 +775,10 @@ const Mt = jt.exports, Ot = {
755
775
  // items: ({ query }) => { return [] },
756
776
  allowSpaces: !0,
757
777
  render: () => {
758
- let e, t, r = !1;
778
+ let t, e, r = !1;
759
779
  return {
760
780
  onStart: (n) => {
761
- e = new b(k, {
781
+ t = new w(C, {
762
782
  parent: void 0,
763
783
  propsData: {
764
784
  itemComponent: Mt,
@@ -766,10 +786,10 @@ const Mt = jt.exports, Ot = {
766
786
  ...n
767
787
  },
768
788
  editor: n.editor
769
- }), n.clientRect && (t = x("body", {
789
+ }), n.clientRect && (e = x("body", {
770
790
  getReferenceClientRect: n.clientRect,
771
791
  appendTo: () => document.body,
772
- content: e.element,
792
+ content: t.element,
773
793
  showOnCreate: !1,
774
794
  onShow: () => {
775
795
  r = !0;
@@ -781,25 +801,25 @@ const Mt = jt.exports, Ot = {
781
801
  trigger: "manual",
782
802
  placement: "top-start",
783
803
  zIndex: 650,
784
- plugins: [C]
785
- }), n.items.length > 0 && (t == null || t[0].show()));
804
+ plugins: [k]
805
+ }), n.items.length > 0 && (e == null || e[0].show()));
786
806
  },
787
807
  onUpdate(n) {
788
- e == null || e.updateProps(n), n.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), n.clientRect && (t == null || t[0].setProps({
808
+ t == null || t.updateProps(n), n.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), n.clientRect && (e == null || e[0].setProps({
789
809
  getReferenceClientRect: n.clientRect
790
810
  }));
791
811
  },
792
812
  onKeyDown(n) {
793
813
  var i;
794
814
  if (r)
795
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
815
+ return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(n);
796
816
  },
797
817
  onExit() {
798
- t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
818
+ e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
799
819
  }
800
820
  };
801
821
  }
802
- }, Bt = {
822
+ }, Dt = {
803
823
  name: "ChannelSuggestion",
804
824
  components: {
805
825
  DtStack: v,
@@ -818,12 +838,12 @@ const Mt = jt.exports, Ot = {
818
838
  }
819
839
  }
820
840
  };
821
- var Dt = function() {
822
- var t = this, r = t._self._c;
823
- return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [t.item.locked ? r("dt-icon-lock", { attrs: { size: "300" } }) : r("dt-icon-hash", { attrs: { size: "300" } }), r("span", [t._v(t._s(t.name))])], 1);
824
- }, Pt = [], Ht = /* @__PURE__ */ d(
825
- Bt,
841
+ var Bt = function() {
842
+ var e = this, r = e._self._c;
843
+ return r("dt-stack", { attrs: { direction: "row", gap: "400" } }, [e.item.locked ? r("dt-icon-lock", { attrs: { size: "300" } }) : r("dt-icon-hash", { attrs: { size: "300" } }), r("span", [e._v(e._s(e.name))])], 1);
844
+ }, Pt = [], Ht = /* @__PURE__ */ c(
826
845
  Dt,
846
+ Bt,
827
847
  Pt
828
848
  );
829
849
  const Ft = Ht.exports, qt = {
@@ -832,10 +852,10 @@ const Ft = Ht.exports, qt = {
832
852
  // items: ({ query }) => { return [] },
833
853
  allowSpaces: !0,
834
854
  render: () => {
835
- let e, t, r = !1;
855
+ let t, e, r = !1;
836
856
  return {
837
857
  onStart: (n) => {
838
- e = new b(k, {
858
+ t = new w(C, {
839
859
  parent: void 0,
840
860
  propsData: {
841
861
  itemComponent: Ft,
@@ -843,10 +863,10 @@ const Ft = Ht.exports, qt = {
843
863
  ...n
844
864
  },
845
865
  editor: n.editor
846
- }), n.clientRect && (t = x("body", {
866
+ }), n.clientRect && (e = x("body", {
847
867
  getReferenceClientRect: n.clientRect,
848
868
  appendTo: () => document.body,
849
- content: e.element,
869
+ content: t.element,
850
870
  showOnCreate: !1,
851
871
  onShow: () => {
852
872
  r = !0;
@@ -858,21 +878,21 @@ const Ft = Ht.exports, qt = {
858
878
  trigger: "manual",
859
879
  placement: "top-start",
860
880
  zIndex: 650,
861
- plugins: [C]
862
- }), n.items.length > 0 && (t == null || t[0].show()));
881
+ plugins: [k]
882
+ }), n.items.length > 0 && (e == null || e[0].show()));
863
883
  },
864
884
  onUpdate(n) {
865
- e == null || e.updateProps(n), n.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), n.clientRect && (t == null || t[0].setProps({
885
+ t == null || t.updateProps(n), n.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), n.clientRect && (e == null || e[0].setProps({
866
886
  getReferenceClientRect: n.clientRect
867
887
  }));
868
888
  },
869
889
  onKeyDown(n) {
870
890
  var i;
871
891
  if (r)
872
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
892
+ return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(n);
873
893
  },
874
894
  onExit() {
875
- t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
895
+ e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
876
896
  }
877
897
  };
878
898
  }
@@ -897,9 +917,9 @@ const Ft = Ht.exports, qt = {
897
917
  }
898
918
  };
899
919
  var Ut = function() {
900
- var t = this, r = t._self._c;
901
- return r("div", [r("div", { staticClass: "d-body--md-compact" }, [r("span", [t._v("/" + t._s(t.command))]), t.parametersExample ? r("span", [t._v(" " + t._s(t.parametersExample))]) : t._e()]), r("div", { staticClass: "d-body--sm d-fc-tertiary" }, [t._v(" " + t._s(t.description) + " ")])]);
902
- }, Nt = [], Vt = /* @__PURE__ */ d(
920
+ var e = this, r = e._self._c;
921
+ return r("div", [r("div", { staticClass: "d-body--md-compact" }, [r("span", [e._v("/" + e._s(e.command))]), e.parametersExample ? r("span", [e._v(" " + e._s(e.parametersExample))]) : e._e()]), r("div", { staticClass: "d-body--sm d-fc-tertiary" }, [e._v(" " + e._s(e.description) + " ")])]);
922
+ }, Nt = [], Vt = /* @__PURE__ */ c(
903
923
  Kt,
904
924
  Ut,
905
925
  Nt
@@ -911,10 +931,10 @@ const zt = Vt.exports, Wt = {
911
931
  allowSpaces: !0,
912
932
  startOfLine: !0,
913
933
  render: () => {
914
- let e, t, r = !1;
934
+ let t, e, r = !1;
915
935
  return {
916
936
  onStart: (n) => {
917
- e = new b(k, {
937
+ t = new w(C, {
918
938
  parent: void 0,
919
939
  propsData: {
920
940
  itemComponent: zt,
@@ -922,10 +942,10 @@ const zt = Vt.exports, Wt = {
922
942
  ...n
923
943
  },
924
944
  editor: n.editor
925
- }), n.clientRect && (t = x("body", {
945
+ }), n.clientRect && (e = x("body", {
926
946
  getReferenceClientRect: n.clientRect,
927
947
  appendTo: () => document.body,
928
- content: e.element,
948
+ content: t.element,
929
949
  showOnCreate: !1,
930
950
  onShow: () => {
931
951
  r = !0;
@@ -937,21 +957,21 @@ const zt = Vt.exports, Wt = {
937
957
  trigger: "manual",
938
958
  placement: "top-start",
939
959
  zIndex: 650,
940
- plugins: [C]
941
- }), n.items.length > 0 && (t == null || t[0].show()));
960
+ plugins: [k]
961
+ }), n.items.length > 0 && (e == null || e[0].show()));
942
962
  },
943
963
  onUpdate(n) {
944
- e == null || e.updateProps(n), n.items.length > 0 ? t == null || t[0].show() : t == null || t[0].hide(), n.clientRect && (t == null || t[0].setProps({
964
+ t == null || t.updateProps(n), n.items.length > 0 ? e == null || e[0].show() : e == null || e[0].hide(), n.clientRect && (e == null || e[0].setProps({
945
965
  getReferenceClientRect: n.clientRect
946
966
  }));
947
967
  },
948
968
  onKeyDown(n) {
949
969
  var i;
950
970
  if (r)
951
- return (i = e == null ? void 0 : e.ref) == null ? void 0 : i.onKeyDown(n);
971
+ return (i = t == null ? void 0 : t.ref) == null ? void 0 : i.onKeyDown(n);
952
972
  },
953
973
  onExit() {
954
- t == null || t[0].destroy(), t = null, e == null || e.destroy(), e = null;
974
+ e == null || e[0].destroy(), e = null, t == null || t.destroy(), t = null;
955
975
  }
956
976
  };
957
977
  }
@@ -1024,8 +1044,8 @@ const zt = Vt.exports, Wt = {
1024
1044
  autoFocus: {
1025
1045
  type: [Boolean, String, Number],
1026
1046
  default: !1,
1027
- validator(e) {
1028
- return typeof e == "string" ? Te.includes(e) : !0;
1047
+ validator(t) {
1048
+ return typeof t == "string" ? Re.includes(t) : !0;
1029
1049
  }
1030
1050
  },
1031
1051
  /**
@@ -1037,8 +1057,8 @@ const zt = Vt.exports, Wt = {
1037
1057
  outputFormat: {
1038
1058
  type: String,
1039
1059
  default: "html",
1040
- validator(e) {
1041
- return Ee.includes(e);
1060
+ validator(t) {
1061
+ return Ee.includes(t);
1042
1062
  }
1043
1063
  },
1044
1064
  /**
@@ -1290,8 +1310,8 @@ const zt = Vt.exports, Wt = {
1290
1310
  editor: null,
1291
1311
  tippyOptions: {
1292
1312
  appendTo: () => {
1293
- var e;
1294
- return (e = this.$refs.editor.$el.getRootNode()) == null ? void 0 : e.querySelector("body");
1313
+ var t;
1314
+ return (t = this.$refs.editor.$el.getRootNode()) == null ? void 0 : t.querySelector("body");
1295
1315
  },
1296
1316
  placement: "top-start"
1297
1317
  }
@@ -1311,51 +1331,50 @@ const zt = Vt.exports, Wt = {
1311
1331
  },
1312
1332
  // eslint-disable-next-line complexity
1313
1333
  extensions() {
1314
- const e = [Z, ce, me, te];
1315
- e.push(this.useDivTags ? ct : j), this.allowBlockquote && e.push(Y), this.allowBold && e.push(ne), this.allowBulletList && (e.push(re), e.push(se.extend({
1334
+ const t = [Z, de, me, te];
1335
+ t.push(this.useDivTags ? dt : j), this.allowBlockquote && t.push(Y), this.allowBold && t.push(ne), this.allowBulletList && (t.push(re), t.push(oe.extend({
1316
1336
  renderText({ node: n }) {
1317
1337
  return n.textContent;
1318
1338
  }
1319
- })), e.push(ae)), this.allowItalic && e.push(ie), this.allowStrike && e.push(le), this.allowUnderline && e.push(de), this.placeholder && e.push(
1339
+ })), t.push(ae)), this.allowItalic && t.push(ie), this.allowStrike && t.push(le), this.allowUnderline && t.push(ce), this.placeholder && t.push(
1320
1340
  ee.configure({ placeholder: this.placeholder })
1321
1341
  );
1322
- const t = this, r = J.create({
1342
+ const e = this, r = J.create({
1323
1343
  addKeyboardShortcuts() {
1324
1344
  return {
1325
- "Shift-Enter": ({ editor: n }) => t.allowLineBreaks ? !1 : (n.commands.first(({ commands: i }) => [
1345
+ "Shift-Enter": ({ editor: n }) => e.allowLineBreaks ? !1 : (n.commands.first(({ commands: i }) => [
1326
1346
  () => i.newlineInCode(),
1327
- () => t.allowBulletList && i.splitListItem("listItem"),
1347
+ () => e.allowBulletList && i.splitListItem("listItem"),
1328
1348
  () => i.createParagraphNear(),
1329
1349
  () => i.liftEmptyBlock(),
1330
1350
  () => i.splitBlock()
1331
1351
  ]), !0),
1332
- Enter: () => t.allowLineBreaks ? !1 : (t.$emit("enter"), !0)
1352
+ Enter: () => e.allowLineBreaks ? !1 : (e.$emit("enter"), !0)
1333
1353
  };
1334
1354
  }
1335
1355
  });
1336
- if (e.push(r), this.link && e.push(oe.extend({ inclusive: !1 }).configure({
1356
+ if (t.push(r), this.link && t.push(se.extend({ inclusive: !1 }).configure({
1337
1357
  HTMLAttributes: {
1338
1358
  class: "d-link d-wb-break-all"
1339
1359
  },
1340
1360
  openOnClick: !1,
1341
1361
  autolink: !0,
1342
1362
  protocols: L
1343
- })), this.customLink && e.push(this.getExtension(lt, this.customLink)), this.mentionSuggestion) {
1363
+ })), this.customLink && t.push(this.getExtension(lt, this.customLink)), this.mentionSuggestion) {
1344
1364
  const n = { ...this.mentionSuggestion, ...Ot };
1345
- e.push(gt.configure({ suggestion: n }));
1365
+ t.push(gt.configure({ suggestion: n }));
1346
1366
  }
1347
1367
  if (this.channelSuggestion) {
1348
1368
  const n = { ...this.channelSuggestion, ...qt };
1349
- e.push(xt.configure({ suggestion: n }));
1369
+ t.push(xt.configure({ suggestion: n }));
1350
1370
  }
1351
1371
  if (this.slashCommandSuggestion) {
1352
1372
  const n = { ...this.slashCommandSuggestion, ...Wt };
1353
- e.push($t.configure({ suggestion: n }));
1373
+ t.push($t.configure({ suggestion: n }));
1354
1374
  }
1355
- return e.push(et), e.push(ue.configure({
1356
- types: ["paragraph"],
1357
- defaultAlignment: "left"
1358
- })), this.allowCode && e.push(Q), this.allowCodeblock && e.push(G.extend({
1375
+ return t.push(et), t.push(ue.configure({
1376
+ types: ["paragraph"]
1377
+ })), this.allowCode && t.push(Q), this.allowCodeblock && t.push(G.extend({
1359
1378
  renderText({ node: n }) {
1360
1379
  return `\`\`\`
1361
1380
  ${n.textContent}
@@ -1365,15 +1384,15 @@ ${n.textContent}
1365
1384
  HTMLAttributes: {
1366
1385
  class: "d-rich-text-editor__code-block"
1367
1386
  }
1368
- })), 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;
1387
+ })), this.allowInlineImages && t.push(ct), (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;
1369
1388
  },
1370
1389
  inputAttrs() {
1371
- const e = {
1390
+ const t = {
1372
1391
  "aria-label": this.inputAriaLabel,
1373
1392
  "aria-multiline": !0,
1374
1393
  role: "textbox"
1375
1394
  };
1376
- return this.editable || (e["aria-readonly"] = !0), e;
1395
+ return this.editable || (t["aria-readonly"] = !0), t;
1377
1396
  }
1378
1397
  },
1379
1398
  /**
@@ -1382,20 +1401,20 @@ ${n.textContent}
1382
1401
  * to be hooked up to the Editor's own API.
1383
1402
  */
1384
1403
  watch: {
1385
- editable(e) {
1386
- this.editor.setEditable(e), this.updateEditorAttributes({ "aria-readonly": !e });
1404
+ editable(t) {
1405
+ this.editor.setEditable(t), this.updateEditorAttributes({ "aria-readonly": !t });
1387
1406
  },
1388
- inputClass(e) {
1389
- this.updateEditorAttributes({ class: e });
1407
+ inputClass(t) {
1408
+ this.updateEditorAttributes({ class: t });
1390
1409
  },
1391
- inputAriaLabel(e) {
1392
- this.updateEditorAttributes({ "aria-label": e });
1410
+ inputAriaLabel(t) {
1411
+ this.updateEditorAttributes({ "aria-label": t });
1393
1412
  },
1394
1413
  extensions() {
1395
1414
  this.destroyEditor(), this.createEditor();
1396
1415
  },
1397
- value(e) {
1398
- this.processValue(e);
1416
+ value(t) {
1417
+ this.processValue(t);
1399
1418
  }
1400
1419
  },
1401
1420
  created() {
@@ -1419,13 +1438,13 @@ ${n.textContent}
1419
1438
  ...this.inputAttrs,
1420
1439
  class: this.inputClass
1421
1440
  },
1422
- handlePaste: (e, t) => {
1441
+ handlePaste: (t, e) => {
1423
1442
  if (!this.link && !this.customLink) {
1424
1443
  const r = /^https?:\/\//;
1425
- if (!(t != null && t.clipboardData))
1444
+ if (!(e != null && e.clipboardData))
1426
1445
  return !1;
1427
- const n = t.clipboardData.getData("text");
1428
- if (!r.test(n) || !t.clipboardData.getData("text/html"))
1446
+ const n = e.clipboardData.getData("text");
1447
+ if (!r.test(n) || !e.clipboardData.getData("text/html"))
1429
1448
  return !1;
1430
1449
  const i = n.replace(/\n/g, "<br>").replace(/ {2}/g, "&nbsp;&nbsp;");
1431
1450
  return this.editor.chain().focus().insertContent(i).run(), !0;
@@ -1434,72 +1453,72 @@ ${n.textContent}
1434
1453
  },
1435
1454
  // Moves the <br /> tags inside the previous closing tag to avoid
1436
1455
  // Prosemirror wrapping them within another </p> tag.
1437
- transformPastedHTML(e) {
1438
- return e.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1456
+ transformPastedHTML(t) {
1457
+ return t.replace(/(<\/\w+>)((<br \/>)+)/g, "$2$3$1");
1439
1458
  }
1440
1459
  }
1441
1460
  }), this.addEditorListeners();
1442
1461
  },
1443
- bubbleMenuShouldShow({ editor: e, view: t, state: r, oldState: n, from: i, to: s }) {
1444
- return e.isActive("link");
1462
+ bubbleMenuShouldShow({ editor: t, view: e, state: r, oldState: n, from: i, to: o }) {
1463
+ return t.isActive("link");
1445
1464
  },
1446
1465
  /**
1447
1466
  * If the selection contains a link, return the existing link text.
1448
1467
  * Otherwise, use just the selected text.
1449
1468
  * @param editor the editor instance.
1450
1469
  */
1451
- getSelectedLinkText(e) {
1452
- var a, l, c;
1453
- const { view: t, state: r } = e, { from: n, to: i } = t.state.selection, s = r.doc.textBetween(n, i, ""), o = this.editor.state.doc.nodeAt(n);
1454
- return o && ((c = (l = (a = o.marks) == null ? void 0 : a.at(0)) == null ? void 0 : l.type) == null ? void 0 : c.name) === "link" ? o.textContent : s;
1470
+ getSelectedLinkText(t) {
1471
+ var a, l, d;
1472
+ const { view: e, state: r } = t, { from: n, to: i } = e.state.selection, o = r.doc.textBetween(n, i, ""), s = this.editor.state.doc.nodeAt(n);
1473
+ 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;
1455
1474
  },
1456
1475
  editLink() {
1457
- const e = this.getSelectedLinkText(this.editor), t = {
1476
+ const t = this.getSelectedLinkText(this.editor), e = {
1458
1477
  href: this.editor.getAttributes("link").href,
1459
- text: e
1478
+ text: t
1460
1479
  };
1461
- this.$emit("edit-link", t);
1480
+ this.$emit("edit-link", e);
1462
1481
  },
1463
1482
  removeLink() {
1464
- var e, t, r, n;
1465
- (n = (r = (t = (e = this.editor) == null ? void 0 : e.chain()) == null ? void 0 : t.focus()) == null ? void 0 : r.unsetLink()) == null || n.run();
1483
+ var t, e, r, n;
1484
+ (n = (r = (e = (t = this.editor) == null ? void 0 : t.chain()) == null ? void 0 : e.focus()) == null ? void 0 : r.unsetLink()) == null || n.run();
1466
1485
  },
1467
1486
  openLink() {
1468
- var t, r;
1469
- (r = (t = this.editor) == null ? void 0 : t.chain()) == null || r.focus();
1470
- const e = this.editor.getAttributes("link").href;
1471
- window.open(e, "_blank");
1487
+ var e, r;
1488
+ (r = (e = this.editor) == null ? void 0 : e.chain()) == null || r.focus();
1489
+ const t = this.editor.getAttributes("link").href;
1490
+ window.open(t, "_blank");
1472
1491
  },
1473
1492
  // eslint-disable-next-line complexity
1474
- setLink(e, t, r, n = L, i) {
1475
- var a, l, c;
1476
- if (!e) {
1493
+ setLink(t, e, r, n = L, i) {
1494
+ var a, l, d;
1495
+ if (!t) {
1477
1496
  this.removeLink();
1478
1497
  return;
1479
1498
  }
1480
- n.find((u) => u.test(e)) || (e = `${i}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
1481
- const o = (c = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : c.selection;
1482
- this.editor.chain().focus().insertContent(t).setTextSelection({ from: o.from, to: o.from + t.length }).setLink({ href: e, class: r.class }).run();
1499
+ n.find((u) => u.test(t)) || (t = `${i}${t}`), this.editor.chain().focus().extendMarkRange("link").run();
1500
+ const s = (d = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : d.selection;
1501
+ this.editor.chain().focus().insertContent(e).setTextSelection({ from: s.from, to: s.from + e.length }).setLink({ href: t, class: r.class }).run();
1483
1502
  },
1484
1503
  // eslint-disable-next-line complexity
1485
- processValue(e, t = !0) {
1504
+ processValue(t, e = !0) {
1486
1505
  const r = this.getOutput();
1487
- if (!(t && Ae(e, r))) {
1488
- if (typeof e == "string" && this.outputFormat === "text") {
1506
+ if (!(e && Ae(t, r))) {
1507
+ if (typeof t == "string" && this.outputFormat === "text") {
1489
1508
  const n = new RegExp(`(${M})`, "g");
1490
- e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
1509
+ t = t == null ? void 0 : t.replace(n, '<emoji-component code="$1"></emoji-component>');
1491
1510
  }
1492
- this.editor.commands.setContent(e, !1);
1511
+ this.editor.commands.setContent(t, !1);
1493
1512
  }
1494
1513
  },
1495
1514
  destroyEditor() {
1496
1515
  this.editor.destroy();
1497
1516
  },
1498
1517
  triggerInputChangeEvents() {
1499
- const e = this.getOutput();
1500
- this.$emit("input", e), this.$emit("update:value", e);
1501
- const t = this.editor.getJSON();
1502
- this.$emit("json-input", t);
1518
+ const t = this.getOutput();
1519
+ this.$emit("input", t), this.$emit("update:value", t);
1520
+ const e = this.editor.getJSON();
1521
+ this.$emit("json-input", e);
1503
1522
  const r = this.editor.getHTML();
1504
1523
  this.$emit("html-input", r);
1505
1524
  const n = this.editor.getText({ blockSeparator: `
@@ -1514,18 +1533,18 @@ ${n.textContent}
1514
1533
  this.editor.on("create", () => {
1515
1534
  this.triggerInputChangeEvents();
1516
1535
  }), this.editor.on("update", () => {
1517
- var e, t;
1518
- if (this.preventTyping && ((t = (e = this.editor.view) == null ? void 0 : e.input) == null ? void 0 : t.lastKeyCode) !== 8) {
1536
+ var t, e;
1537
+ if (this.preventTyping && ((e = (t = this.editor.view) == null ? void 0 : t.input) == null ? void 0 : e.lastKeyCode) !== 8) {
1519
1538
  this.editor.commands.setContent(this.value, !1);
1520
1539
  return;
1521
1540
  }
1522
1541
  this.triggerInputChangeEvents();
1523
- }), this.editor.on("selectionUpdate", ({ editor: e }) => {
1524
- this.$emit("selected", this.getSelectedLinkText(e));
1525
- }), this.editor.on("focus", ({ event: e }) => {
1526
- this.$emit("focus", e);
1527
- }), this.editor.on("blur", ({ event: e }) => {
1528
- this.$emit("blur", e);
1542
+ }), this.editor.on("selectionUpdate", ({ editor: t }) => {
1543
+ this.$emit("selected", this.getSelectedLinkText(t));
1544
+ }), this.editor.on("focus", ({ event: t }) => {
1545
+ this.$emit("focus", t);
1546
+ }), this.editor.on("blur", ({ event: t }) => {
1547
+ this.$emit("blur", t);
1529
1548
  });
1530
1549
  },
1531
1550
  getOutput() {
@@ -1540,17 +1559,17 @@ ${n.textContent}
1540
1559
  ` });
1541
1560
  }
1542
1561
  },
1543
- getExtension(e, t) {
1562
+ getExtension(t, e) {
1544
1563
  var r;
1545
- return typeof t == "boolean" ? e : (r = e.configure) == null ? void 0 : r.call(e, t);
1564
+ return typeof e == "boolean" ? t : (r = t.configure) == null ? void 0 : r.call(t, e);
1546
1565
  },
1547
- updateEditorAttributes(e) {
1566
+ updateEditorAttributes(t) {
1548
1567
  this.editor.setOptions({
1549
1568
  editorProps: {
1550
1569
  attributes: {
1551
1570
  ...this.inputAttrs,
1552
1571
  class: this.inputClass,
1553
- ...e
1572
+ ...t
1554
1573
  }
1555
1574
  }
1556
1575
  });
@@ -1561,9 +1580,9 @@ ${n.textContent}
1561
1580
  }
1562
1581
  };
1563
1582
  var Jt = function() {
1564
- var t = this, r = t._self._c;
1565
- return r("div", [t.editor && t.link && !t.hideLinkBubbleMenu ? r("bubble-menu", { staticStyle: { visibility: "visible" }, attrs: { editor: t.editor, "should-show": t.bubbleMenuShouldShow, "tippy-options": t.tippyOptions } }, [r("div", { staticClass: "d-popover__dialog" }, [r("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { direction: "row", gap: "0" } }, [r("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.editLink } }, [t._v(" Edit ")]), r("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: t.openLink } }, [t._v(" Open link ")]), r("dt-button", { attrs: { kind: "danger", importance: "clear" }, on: { click: t.removeLink } }, [t._v(" Remove ")])], 1)], 1)]) : t._e(), r("editor-content", t._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { editor: t.editor, "data-qa": "dt-rich-text-editor" } }, t.editorListeners))], 1);
1566
- }, Yt = [], Gt = /* @__PURE__ */ d(
1583
+ var e = this, r = e._self._c;
1584
+ return r("div", [e.editor && e.link && !e.hideLinkBubbleMenu ? r("bubble-menu", { staticStyle: { visibility: "visible" }, attrs: { editor: e.editor, "should-show": e.bubbleMenuShouldShow, "tippy-options": e.tippyOptions } }, [r("div", { staticClass: "d-popover__dialog" }, [r("dt-stack", { staticClass: "d-rich-text-editor-bubble-menu__button-stack", attrs: { direction: "row", gap: "0" } }, [r("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: e.editLink } }, [e._v(" Edit ")]), r("dt-button", { attrs: { kind: "muted", importance: "clear" }, on: { click: e.openLink } }, [e._v(" Open link ")]), r("dt-button", { attrs: { kind: "danger", importance: "clear" }, on: { click: e.removeLink } }, [e._v(" Remove ")])], 1)], 1)]) : e._e(), r("editor-content", e._g({ ref: "editor", staticClass: "d-rich-text-editor", attrs: { editor: e.editor, "data-qa": "dt-rich-text-editor" } }, e.editorListeners))], 1);
1585
+ }, Yt = [], Gt = /* @__PURE__ */ c(
1567
1586
  Xt,
1568
1587
  Jt,
1569
1588
  Yt