@dialpad/dialtone 9.139.0 → 9.140.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.
- package/dist/tokens/doc.json +59091 -59091
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +26 -18
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +6 -3
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.cjs +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.js +2 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +13 -4
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +356 -225
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js +1 -1
- package/dist/vue2/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue2/lib/tooltip-directive/tooltip.js +19 -14
- package/dist/vue2/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue2/localization/ja-JP.cjs +2 -0
- package/dist/vue2/localization/ja-JP.cjs.map +1 -1
- package/dist/vue2/localization/ja-JP.js +2 -0
- package/dist/vue2/localization/ja-JP.js.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/extensions/mentions/mention.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +21 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue2/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +2 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue3/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue3/lib/emoji-row/emoji-row.js +5 -4
- package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs +1 -1
- package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue3/lib/message-input/message-input.js +37 -28
- package/dist/vue3/lib/message-input/message-input.js.map +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs +1 -1
- package/dist/vue3/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue3/lib/pagination/pagination.js +37 -32
- package/dist/vue3/lib/pagination/pagination.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/channel-suggestion.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.cjs +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.js +2 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor-constants.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +15 -6
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +421 -278
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js +1 -1
- package/dist/vue3/lib/tooltip/tooltip.js.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/vue3/lib/tooltip-directive/tooltip.js +19 -14
- package/dist/vue3/lib/tooltip-directive/tooltip.js.map +1 -1
- package/dist/vue3/localization/ja-JP.cjs +2 -0
- package/dist/vue3/localization/ja-JP.cjs.map +1 -1
- package/dist/vue3/localization/ja-JP.js +2 -0
- package/dist/vue3/localization/ja-JP.js.map +1 -1
- package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/extensions/mentions/mention.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +22 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor_constants.d.ts.map +1 -1
- package/dist/vue3/types/components/tooltip/tooltip.vue.d.ts.map +1 -1
- package/dist/vue3/types/directives/tooltip_directive/tooltip.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +3 -1
- package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/package.json +3 -7
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { nodeViewProps as
|
|
2
|
-
import { Node as ee, nodePasteRule as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { nodeViewProps as $, NodeViewWrapper as R, VueRenderer as v, VueNodeViewRenderer as I, BubbleMenu as G, EditorContent as Q, Editor as Z } from "../../node_modules/@tiptap/vue-3.js";
|
|
2
|
+
import { Node as ee, nodePasteRule as A, InputRule as te, mergeAttributes as b, getMarksBetween as ne, combineTransactionSteps as oe, getChangedRanges as re, findChildrenInRange as se, Mark as ie, nodeInputRule as ae, Extension as ce } from "@tiptap/core";
|
|
3
|
+
import de from "@tiptap/extension-blockquote";
|
|
4
|
+
import le from "@tiptap/extension-code-block";
|
|
5
5
|
import ue from "@tiptap/extension-code";
|
|
6
6
|
import me from "@tiptap/extension-document";
|
|
7
7
|
import he from "@tiptap/extension-hard-break";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import U from "@tiptap/extension-paragraph";
|
|
9
|
+
import pe from "@tiptap/extension-placeholder";
|
|
10
|
+
import fe from "@tiptap/extension-bold";
|
|
11
11
|
import ge from "@tiptap/extension-bullet-list";
|
|
12
12
|
import _e from "@tiptap/extension-italic";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import ke from "@tiptap/extension-link";
|
|
14
|
+
import ye from "@tiptap/extension-list-item";
|
|
15
|
+
import we from "@tiptap/extension-ordered-list";
|
|
16
|
+
import Ce from "@tiptap/extension-strike";
|
|
17
17
|
import be from "@tiptap/extension-underline";
|
|
18
|
-
import
|
|
18
|
+
import xe from "@tiptap/extension-text";
|
|
19
19
|
import Te from "@tiptap/extension-text-align";
|
|
20
20
|
import Ee from "@tiptap/extension-history";
|
|
21
21
|
import Se from "@tiptap/extension-text-style";
|
|
22
22
|
import Le from "@tiptap/extension-color";
|
|
23
|
-
import
|
|
24
|
-
import { PluginKey as T, Plugin as
|
|
25
|
-
import
|
|
26
|
-
import { emojiPattern as
|
|
27
|
-
import { resolveComponent as
|
|
23
|
+
import $e from "@tiptap/extension-font-family";
|
|
24
|
+
import { PluginKey as T, Plugin as Re } from "@tiptap/pm/state";
|
|
25
|
+
import ve from "@tiptap/suggestion";
|
|
26
|
+
import { emojiPattern as W } from "regex-combined-emojis";
|
|
27
|
+
import { resolveComponent as l, createBlock as m, openBlock as d, withCtx as u, createVNode as f, createElementBlock as _, withDirectives as Ie, createElementVNode as k, Fragment as Me, renderList as Be, withModifiers as Ne, normalizeClass as z, resolveDynamicComponent as Oe, vShow as De, createTextVNode as C, toDisplayString as h, markRaw as M, createCommentVNode as w, mergeProps as Ae } from "vue";
|
|
28
28
|
import { _ as g } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
29
29
|
import X from "../emoji/emoji.js";
|
|
30
|
-
import { getEmojiData as
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import { getPhoneNumberRegex as Ve, linkRegex as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
30
|
+
import { getEmojiData as Pe, emojiRegex as je, stringToUnicode as He, codeToEmojiData as j, emojiShortCodeRegex as Ke } from "../../common/emoji/index.js";
|
|
31
|
+
import Fe from "../list-item/list-item.js";
|
|
32
|
+
import E from "../stack/stack.js";
|
|
33
|
+
import B from "tippy.js";
|
|
34
|
+
import { getPhoneNumberRegex as Ve, linkRegex as qe, warnIfUnmounted as Ue, returnFirstEl as K } from "../../common/utils/index.js";
|
|
35
|
+
import We from "@tiptap/extension-image";
|
|
36
|
+
import H from "@tiptap/extension-mention";
|
|
37
37
|
import J from "../link/link.js";
|
|
38
|
-
import {
|
|
39
|
-
import Je from "
|
|
40
|
-
import Ye from "
|
|
41
|
-
import Ge from "@dialpad/dialtone-icons/vue3/
|
|
42
|
-
import Qe from "
|
|
43
|
-
import
|
|
44
|
-
import et from "
|
|
45
|
-
|
|
38
|
+
import { DtIconLock as ze } from "@dialpad/dialtone-icons/vue3";
|
|
39
|
+
import { RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS as F, RICH_TEXT_EDITOR_OUTPUT_FORMATS as Xe, RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as Je } from "./rich-text-editor-constants.js";
|
|
40
|
+
import Ye from "../avatar/avatar.js";
|
|
41
|
+
import Ge from "@dialpad/dialtone-icons/vue3/hash";
|
|
42
|
+
import Qe from "@dialpad/dialtone-icons/vue3/lock";
|
|
43
|
+
import Ze from "deep-equal";
|
|
44
|
+
import { DialtoneLocalization as et } from "../../localization/index.js";
|
|
45
|
+
import tt from "../button/button.js";
|
|
46
|
+
const nt = {
|
|
46
47
|
compatConfig: { MODE: 3 },
|
|
47
48
|
name: "EmojiComponent",
|
|
48
49
|
components: {
|
|
49
50
|
NodeViewWrapper: R,
|
|
50
51
|
DtEmoji: X
|
|
51
52
|
},
|
|
52
|
-
props:
|
|
53
|
+
props: $
|
|
53
54
|
};
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
function ot(e, t, o, n, r, s) {
|
|
56
|
+
const i = l("dt-emoji"), a = l("node-view-wrapper");
|
|
57
|
+
return d(), m(a, { class: "d-d-inline-block d-va-bottom d-lh0" }, {
|
|
57
58
|
default: u(() => [
|
|
58
|
-
|
|
59
|
+
f(i, {
|
|
59
60
|
size: "500",
|
|
60
61
|
code: e.node.attrs.code
|
|
61
62
|
}, null, 8, ["code"])
|
|
@@ -63,11 +64,11 @@ function nt(e, t, o, n, r, i) {
|
|
|
63
64
|
_: 1
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
const
|
|
67
|
+
const rt = /* @__PURE__ */ g(nt, [["render", ot]]), st = {
|
|
67
68
|
compatConfig: { MODE: 3 },
|
|
68
69
|
name: "SuggestionList",
|
|
69
70
|
components: {
|
|
70
|
-
DtListItem:
|
|
71
|
+
DtListItem: Fe
|
|
71
72
|
},
|
|
72
73
|
props: {
|
|
73
74
|
items: {
|
|
@@ -128,7 +129,7 @@ const ot = /* @__PURE__ */ g(tt, [["render", nt]]), rt = {
|
|
|
128
129
|
this.command({ name: t.name, id: t.id, avatarSrc: t.avatarSrc });
|
|
129
130
|
break;
|
|
130
131
|
case "channel":
|
|
131
|
-
this.command({ name: t.name, id: t.id });
|
|
132
|
+
this.command({ name: t.name, id: t.id, locked: t.locked });
|
|
132
133
|
break;
|
|
133
134
|
case "slash-command":
|
|
134
135
|
this.command({ command: t.command });
|
|
@@ -136,26 +137,26 @@ const ot = /* @__PURE__ */ g(tt, [["render", nt]]), rt = {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
}, it = { class: "d-popover__dialog d-suggestion-list__container" },
|
|
140
|
+
}, it = { class: "d-popover__dialog d-suggestion-list__container" }, at = {
|
|
140
141
|
ref: "suggestionList",
|
|
141
142
|
class: "d-suggestion-list"
|
|
142
143
|
};
|
|
143
|
-
function
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
Ie(
|
|
147
|
-
(
|
|
144
|
+
function ct(e, t, o, n, r, s) {
|
|
145
|
+
const i = l("dt-list-item");
|
|
146
|
+
return d(), _("div", it, [
|
|
147
|
+
Ie(k("ul", at, [
|
|
148
|
+
(d(!0), _(Me, null, Be(o.items, (a, c) => (d(), m(i, {
|
|
148
149
|
key: a.id,
|
|
149
150
|
class: z([
|
|
150
151
|
"d-suggestion-list__item",
|
|
151
152
|
{ "d-list-item--highlighted": c === r.selectedIndex }
|
|
152
153
|
]),
|
|
153
154
|
"navigation-type": "arrow-keys",
|
|
154
|
-
onClick: (
|
|
155
|
-
onKeydown:
|
|
155
|
+
onClick: (p) => s.selectItem(c),
|
|
156
|
+
onKeydown: Ne(s.onKeyDown, ["prevent"])
|
|
156
157
|
}, {
|
|
157
158
|
default: u(() => [
|
|
158
|
-
(
|
|
159
|
+
(d(), m(Oe(o.itemComponent), { item: a }, null, 8, ["item"]))
|
|
159
160
|
]),
|
|
160
161
|
_: 2
|
|
161
162
|
}, 1032, ["class", "onClick", "onKeydown"]))), 128))
|
|
@@ -164,12 +165,12 @@ function at(e, t, o, n, r, i) {
|
|
|
164
165
|
])
|
|
165
166
|
]);
|
|
166
167
|
}
|
|
167
|
-
const
|
|
168
|
+
const N = /* @__PURE__ */ g(st, [["render", ct]]), dt = {
|
|
168
169
|
compatConfig: { MODE: 3 },
|
|
169
170
|
name: "EmojiSuggestion",
|
|
170
171
|
components: {
|
|
171
172
|
DtEmoji: X,
|
|
172
|
-
DtStack:
|
|
173
|
+
DtStack: E
|
|
173
174
|
},
|
|
174
175
|
props: {
|
|
175
176
|
item: {
|
|
@@ -178,23 +179,23 @@ const $ = /* @__PURE__ */ g(rt, [["render", at]]), lt = {
|
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
};
|
|
181
|
-
function
|
|
182
|
-
const
|
|
183
|
-
return
|
|
182
|
+
function lt(e, t, o, n, r, s) {
|
|
183
|
+
const i = l("dt-emoji"), a = l("dt-stack");
|
|
184
|
+
return d(), m(a, {
|
|
184
185
|
direction: "row",
|
|
185
186
|
gap: "400"
|
|
186
187
|
}, {
|
|
187
188
|
default: u(() => [
|
|
188
|
-
|
|
189
|
+
f(i, {
|
|
189
190
|
size: "200",
|
|
190
191
|
code: o.item.code
|
|
191
192
|
}, null, 8, ["code"]),
|
|
192
|
-
|
|
193
|
+
C(" " + h(o.item.code), 1)
|
|
193
194
|
]),
|
|
194
195
|
_: 1
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
|
-
const
|
|
198
|
+
const ut = /* @__PURE__ */ g(dt, [["render", lt]]), O = {
|
|
198
199
|
name: "hideOnEsc",
|
|
199
200
|
defaultValue: !0,
|
|
200
201
|
fn({ hide: e }) {
|
|
@@ -210,15 +211,15 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
210
211
|
}
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
|
-
},
|
|
214
|
+
}, mt = 20, ht = (e, t, o) => {
|
|
214
215
|
var a, c;
|
|
215
|
-
const n = (a = e.shortname) == null ? void 0 : a.replaceAll(":", ""), r = (c = t.shortname) == null ? void 0 : c.replaceAll(":", ""),
|
|
216
|
-
return
|
|
217
|
-
},
|
|
216
|
+
const n = (a = e.shortname) == null ? void 0 : a.replaceAll(":", ""), r = (c = t.shortname) == null ? void 0 : c.replaceAll(":", ""), s = n.startsWith(o), i = r.startsWith(o);
|
|
217
|
+
return s && !i ? -1 : !s && i ? 1 : n.localeCompare(r);
|
|
218
|
+
}, pt = {
|
|
218
219
|
items: ({ query: e }) => {
|
|
219
220
|
if (e.length < 2)
|
|
220
221
|
return [];
|
|
221
|
-
const t = Object.values(
|
|
222
|
+
const t = Object.values(Pe());
|
|
222
223
|
return e = e.toLowerCase(), t.filter(
|
|
223
224
|
(n) => {
|
|
224
225
|
var r;
|
|
@@ -226,32 +227,32 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
226
227
|
n.name,
|
|
227
228
|
(r = n.shortname) == null ? void 0 : r.replaceAll(":", ""),
|
|
228
229
|
...n.keywords || []
|
|
229
|
-
].some((
|
|
230
|
+
].some((s) => s && s.startsWith(e));
|
|
230
231
|
}
|
|
231
|
-
).splice(0,
|
|
232
|
+
).splice(0, mt).sort((n, r) => ht(n, r, e)).map((n) => ({ code: n.shortname }));
|
|
232
233
|
},
|
|
233
234
|
command: ({ editor: e, range: t, props: o }) => {
|
|
234
|
-
var
|
|
235
|
+
var s, i;
|
|
235
236
|
const n = e.view.state.selection.$to.nodeAfter;
|
|
236
|
-
((
|
|
237
|
+
((s = n == null ? void 0 : n.text) == null ? void 0 : s.startsWith(" ")) && (t.to += 1), e.chain().focus().insertContentAt(t, [
|
|
237
238
|
{
|
|
238
239
|
type: "emoji",
|
|
239
240
|
attrs: o
|
|
240
241
|
}
|
|
241
|
-
]).run(), (
|
|
242
|
+
]).run(), (i = window.getSelection()) == null || i.collapseToEnd();
|
|
242
243
|
},
|
|
243
244
|
render: () => {
|
|
244
245
|
let e, t, o = !1;
|
|
245
246
|
return {
|
|
246
247
|
onStart: (n) => {
|
|
247
|
-
e = new v(
|
|
248
|
+
e = new v(N, {
|
|
248
249
|
props: {
|
|
249
|
-
itemComponent:
|
|
250
|
+
itemComponent: M(ut),
|
|
250
251
|
itemType: "emoji",
|
|
251
252
|
...n
|
|
252
253
|
},
|
|
253
254
|
editor: n.editor
|
|
254
|
-
}), n.clientRect && (t =
|
|
255
|
+
}), n.clientRect && (t = B("body", {
|
|
255
256
|
getReferenceClientRect: n.clientRect,
|
|
256
257
|
appendTo: () => document.body,
|
|
257
258
|
content: e.element,
|
|
@@ -266,7 +267,7 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
266
267
|
trigger: "manual",
|
|
267
268
|
placement: "top-start",
|
|
268
269
|
zIndex: 650,
|
|
269
|
-
plugins: [
|
|
270
|
+
plugins: [O]
|
|
270
271
|
}), n.items.length > 0 && (t == null || t[0].show()));
|
|
271
272
|
},
|
|
272
273
|
onUpdate(n) {
|
|
@@ -284,10 +285,10 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
284
285
|
}
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
|
-
}, ft = /(:\w+:)$/,
|
|
288
|
-
if (e &&
|
|
288
|
+
}, ft = /(:\w+:)$/, gt = new RegExp(W + "$"), _t = (e) => {
|
|
289
|
+
if (e && j(e[0]))
|
|
289
290
|
return { text: e[2] || e[0] };
|
|
290
|
-
},
|
|
291
|
+
}, kt = (e) => [...e.matchAll(Ke)].filter((o) => j(o[0])).map((o) => ({
|
|
291
292
|
index: o.index,
|
|
292
293
|
text: o[0],
|
|
293
294
|
match: o
|
|
@@ -303,7 +304,7 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
303
304
|
selectable: !1,
|
|
304
305
|
atom: !0,
|
|
305
306
|
addNodeView() {
|
|
306
|
-
return
|
|
307
|
+
return I(rt);
|
|
307
308
|
},
|
|
308
309
|
addAttributes() {
|
|
309
310
|
return {
|
|
@@ -320,7 +321,7 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
320
321
|
];
|
|
321
322
|
},
|
|
322
323
|
renderText({ node: e }) {
|
|
323
|
-
return
|
|
324
|
+
return He(j(e.attrs.code).unicode_output);
|
|
324
325
|
},
|
|
325
326
|
renderHTML({ HTMLAttributes: e }) {
|
|
326
327
|
return ["emoji-component", b(this.options.HTMLAttributes, e)];
|
|
@@ -329,21 +330,21 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
329
330
|
return [
|
|
330
331
|
new te({
|
|
331
332
|
find: (e) => {
|
|
332
|
-
const t = e.match(ft) || e.match(
|
|
333
|
+
const t = e.match(ft) || e.match(gt);
|
|
333
334
|
if (t)
|
|
334
|
-
return
|
|
335
|
+
return _t(t);
|
|
335
336
|
},
|
|
336
337
|
handler: ({ state: e, range: t, match: o }) => {
|
|
337
|
-
const { tr: n } = e, r = t.from,
|
|
338
|
-
n.replaceWith(r,
|
|
338
|
+
const { tr: n } = e, r = t.from, s = t.to;
|
|
339
|
+
n.replaceWith(r, s, this.type.create({ code: o[0] }));
|
|
339
340
|
}
|
|
340
341
|
})
|
|
341
342
|
];
|
|
342
343
|
},
|
|
343
344
|
addPasteRules() {
|
|
344
345
|
return [
|
|
345
|
-
|
|
346
|
-
find:
|
|
346
|
+
A({
|
|
347
|
+
find: kt,
|
|
347
348
|
type: this.type,
|
|
348
349
|
getAttributes(e) {
|
|
349
350
|
return {
|
|
@@ -351,8 +352,8 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
351
352
|
};
|
|
352
353
|
}
|
|
353
354
|
}),
|
|
354
|
-
|
|
355
|
-
find:
|
|
355
|
+
A({
|
|
356
|
+
find: je,
|
|
356
357
|
type: this.type,
|
|
357
358
|
getAttributes(e) {
|
|
358
359
|
return {
|
|
@@ -364,12 +365,12 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
364
365
|
},
|
|
365
366
|
addProseMirrorPlugins() {
|
|
366
367
|
return [
|
|
367
|
-
|
|
368
|
+
ve({
|
|
368
369
|
char: ":",
|
|
369
370
|
pluginKey: new T("emoji"),
|
|
370
371
|
editor: this.editor,
|
|
371
372
|
...this.options.suggestion,
|
|
372
|
-
...
|
|
373
|
+
...pt
|
|
373
374
|
})
|
|
374
375
|
];
|
|
375
376
|
},
|
|
@@ -377,10 +378,10 @@ const dt = /* @__PURE__ */ g(lt, [["render", ct]]), A = {
|
|
|
377
378
|
return {
|
|
378
379
|
Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
|
|
379
380
|
let o = !1;
|
|
380
|
-
const { selection: n } = t, { empty: r, anchor:
|
|
381
|
-
return r ? (t.doc.nodesBetween(
|
|
382
|
-
if (
|
|
383
|
-
return o = !0, e.insertText("", a, a +
|
|
381
|
+
const { selection: n } = t, { empty: r, anchor: s } = n;
|
|
382
|
+
return r ? (t.doc.nodesBetween(s - 1, s, (i, a) => {
|
|
383
|
+
if (i.type.name === this.name)
|
|
384
|
+
return o = !0, e.insertText("", a, a + i.nodeSize), !1;
|
|
384
385
|
}), o) : !1;
|
|
385
386
|
})
|
|
386
387
|
};
|
|
@@ -394,10 +395,10 @@ function wt(e, t, o = () => !0) {
|
|
|
394
395
|
o(e, r) && n.push(r);
|
|
395
396
|
return n;
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
+
function Ct(e, t) {
|
|
398
399
|
return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function bt(e) {
|
|
401
402
|
const t = new RegExp(
|
|
402
403
|
"(?:" + [
|
|
403
404
|
`[!?.,:;'"]`,
|
|
@@ -407,7 +408,7 @@ function xt(e) {
|
|
|
407
408
|
);
|
|
408
409
|
return e.replace(t, "");
|
|
409
410
|
}
|
|
410
|
-
function
|
|
411
|
+
function xt(e, t) {
|
|
411
412
|
const o = e.slice(0, t + 1).search(/\S+\s*$/), n = e.slice(t).search(/\s/);
|
|
412
413
|
if (n < 0) {
|
|
413
414
|
const r = e.slice(o);
|
|
@@ -423,77 +424,77 @@ function bt(e, t) {
|
|
|
423
424
|
to: n + t
|
|
424
425
|
};
|
|
425
426
|
}
|
|
426
|
-
function
|
|
427
|
-
const r =
|
|
427
|
+
function P(e, t, o, n) {
|
|
428
|
+
const r = xt(e, t);
|
|
428
429
|
if (n.lastIndex = 0, !n.test(r.text))
|
|
429
430
|
return r;
|
|
430
|
-
const
|
|
431
|
-
return
|
|
431
|
+
const s = o === "left" ? r.from - 1 : r.to + 1;
|
|
432
|
+
return s <= 0 || s >= e.length || s === t ? r : P(e, s, o, n);
|
|
432
433
|
}
|
|
433
|
-
function
|
|
434
|
-
const r = Math.max(e.from - 1, 0),
|
|
435
|
-
for (const a of
|
|
434
|
+
function Tt(e, t, o, n) {
|
|
435
|
+
const r = Math.max(e.from - 1, 0), s = Math.min(e.to + 1, t.content.size), i = ne(r, s, t);
|
|
436
|
+
for (const a of i)
|
|
436
437
|
a.mark.type === n && o.removeMark(a.from, a.to, n);
|
|
437
438
|
}
|
|
438
439
|
const V = Ve(1, 15);
|
|
439
|
-
function
|
|
440
|
+
function q(e, t, o, n, r, s) {
|
|
440
441
|
if (!e)
|
|
441
442
|
return;
|
|
442
|
-
let
|
|
443
|
-
|
|
444
|
-
const a = n - t, c =
|
|
443
|
+
let i = o - t - 1;
|
|
444
|
+
i = i < 0 ? 0 : i;
|
|
445
|
+
const a = n - t, c = P(
|
|
445
446
|
e,
|
|
446
|
-
|
|
447
|
+
i,
|
|
447
448
|
"left",
|
|
448
449
|
V
|
|
449
|
-
),
|
|
450
|
+
), p = P(
|
|
450
451
|
e,
|
|
451
452
|
a,
|
|
452
453
|
"right",
|
|
453
454
|
V
|
|
454
|
-
), y = e.slice(c.from,
|
|
455
|
-
wt(y,
|
|
456
|
-
const
|
|
457
|
-
r.addMark(
|
|
455
|
+
), y = e.slice(c.from, p.to);
|
|
456
|
+
wt(y, qe, Ct).forEach((D) => {
|
|
457
|
+
const x = bt(D[0]), L = t + c.from + D.index + 1, Y = L + x.length;
|
|
458
|
+
r.addMark(L, Y, s.create());
|
|
458
459
|
});
|
|
459
460
|
}
|
|
460
|
-
function
|
|
461
|
+
function Et(e) {
|
|
461
462
|
let t = !1;
|
|
462
|
-
return new
|
|
463
|
+
return new Re({
|
|
463
464
|
key: new T("autolink"),
|
|
464
465
|
appendTransaction: (o, n, r) => {
|
|
465
|
-
const
|
|
466
|
-
if (t && !
|
|
466
|
+
const s = o.some((y) => y.docChanged) && !n.doc.eq(r.doc);
|
|
467
|
+
if (t && !s)
|
|
467
468
|
return;
|
|
468
|
-
const { tr:
|
|
469
|
-
t ||
|
|
469
|
+
const { tr: i } = r, { textContent: a } = r.doc;
|
|
470
|
+
t || q(a, 0, 0, a.length, i, e.type), t = !0;
|
|
470
471
|
const c = oe(
|
|
471
472
|
n.doc,
|
|
472
473
|
[...o]
|
|
473
474
|
);
|
|
474
|
-
return re(c).forEach(({ oldRange: y, newRange:
|
|
475
|
-
|
|
475
|
+
return re(c).forEach(({ oldRange: y, newRange: S }) => {
|
|
476
|
+
Tt(S, r.doc, i, e.type), se(
|
|
476
477
|
r.doc,
|
|
477
|
-
|
|
478
|
-
(
|
|
479
|
-
).forEach(({ node:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
S,
|
|
479
|
+
(x) => x.isTextblock
|
|
480
|
+
).forEach(({ node: x, pos: L }) => {
|
|
481
|
+
q(
|
|
482
|
+
x.textContent,
|
|
483
|
+
L,
|
|
483
484
|
y.from,
|
|
484
|
-
|
|
485
|
-
|
|
485
|
+
S.to,
|
|
486
|
+
i,
|
|
486
487
|
e.type
|
|
487
488
|
);
|
|
488
489
|
});
|
|
489
|
-
}),
|
|
490
|
+
}), i;
|
|
490
491
|
}
|
|
491
492
|
});
|
|
492
493
|
}
|
|
493
|
-
const
|
|
494
|
+
const St = {
|
|
494
495
|
class: "d-link d-c-text d-d-inline-block d-wb-break-all",
|
|
495
496
|
rel: "noopener noreferrer nofollow"
|
|
496
|
-
},
|
|
497
|
+
}, Lt = ie.create({
|
|
497
498
|
name: "CustomLink",
|
|
498
499
|
renderHTML({ HTMLAttributes: e }) {
|
|
499
500
|
return [
|
|
@@ -501,7 +502,7 @@ const Et = {
|
|
|
501
502
|
b(
|
|
502
503
|
this.options.HTMLAttributes,
|
|
503
504
|
e,
|
|
504
|
-
|
|
505
|
+
St
|
|
505
506
|
)
|
|
506
507
|
];
|
|
507
508
|
},
|
|
@@ -510,10 +511,10 @@ const Et = {
|
|
|
510
511
|
},
|
|
511
512
|
addProseMirrorPlugins() {
|
|
512
513
|
return [
|
|
513
|
-
|
|
514
|
+
Et({ type: this.type })
|
|
514
515
|
];
|
|
515
516
|
}
|
|
516
|
-
}),
|
|
517
|
+
}), $t = We.extend({
|
|
517
518
|
name: "ConfigurableImage",
|
|
518
519
|
addAttributes() {
|
|
519
520
|
return {
|
|
@@ -537,7 +538,7 @@ const Et = {
|
|
|
537
538
|
}
|
|
538
539
|
};
|
|
539
540
|
}
|
|
540
|
-
}).configure({ inline: !0, allowBase64: !0 }), Rt =
|
|
541
|
+
}).configure({ inline: !0, allowBase64: !0 }), Rt = U.extend({
|
|
541
542
|
parseHTML() {
|
|
542
543
|
return [{ tag: "div" }];
|
|
543
544
|
},
|
|
@@ -551,20 +552,20 @@ const Et = {
|
|
|
551
552
|
NodeViewWrapper: R,
|
|
552
553
|
DtLink: J
|
|
553
554
|
},
|
|
554
|
-
props:
|
|
555
|
+
props: $,
|
|
555
556
|
computed: {
|
|
556
557
|
text() {
|
|
557
558
|
return "@" + this.$props.node.attrs.name;
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
561
|
};
|
|
561
|
-
function
|
|
562
|
-
const
|
|
563
|
-
return
|
|
562
|
+
function It(e, t, o, n, r, s) {
|
|
563
|
+
const i = l("dt-link"), a = l("node-view-wrapper");
|
|
564
|
+
return d(), m(a, { class: "d-d-inline-block" }, {
|
|
564
565
|
default: u(() => [
|
|
565
|
-
|
|
566
|
+
f(i, { kind: "mention" }, {
|
|
566
567
|
default: u(() => [
|
|
567
|
-
|
|
568
|
+
C(h(s.text), 1)
|
|
568
569
|
]),
|
|
569
570
|
_: 1
|
|
570
571
|
})
|
|
@@ -572,9 +573,9 @@ function Ot(e, t, o, n, r, i) {
|
|
|
572
573
|
_: 1
|
|
573
574
|
});
|
|
574
575
|
}
|
|
575
|
-
const
|
|
576
|
+
const Mt = /* @__PURE__ */ g(vt, [["render", It]]), Bt = H.extend({
|
|
576
577
|
addNodeView() {
|
|
577
|
-
return
|
|
578
|
+
return I(Mt);
|
|
578
579
|
},
|
|
579
580
|
parseHTML() {
|
|
580
581
|
return [
|
|
@@ -593,6 +594,9 @@ const It = /* @__PURE__ */ g(vt, [["render", Ot]]), Bt = N.extend({
|
|
|
593
594
|
},
|
|
594
595
|
id: {
|
|
595
596
|
default: ""
|
|
597
|
+
},
|
|
598
|
+
contactKey: {
|
|
599
|
+
default: ""
|
|
596
600
|
}
|
|
597
601
|
};
|
|
598
602
|
},
|
|
@@ -607,27 +611,41 @@ const It = /* @__PURE__ */ g(vt, [["render", Ot]]), Bt = N.extend({
|
|
|
607
611
|
char: "@",
|
|
608
612
|
pluginKey: new T("mentionSuggestion")
|
|
609
613
|
}
|
|
610
|
-
}),
|
|
614
|
+
}), Nt = {
|
|
611
615
|
compatConfig: { MODE: 3 },
|
|
612
616
|
name: "ChannelComponent",
|
|
613
617
|
components: {
|
|
614
618
|
NodeViewWrapper: R,
|
|
615
|
-
DtLink: J
|
|
619
|
+
DtLink: J,
|
|
620
|
+
DtIconLock: ze,
|
|
621
|
+
DtStack: E
|
|
616
622
|
},
|
|
617
|
-
props:
|
|
623
|
+
props: $,
|
|
618
624
|
computed: {
|
|
619
625
|
text() {
|
|
620
|
-
return "#" + this.$props.node.attrs.name;
|
|
626
|
+
return this.$props.node.attrs.locked ? this.$props.node.attrs.name : "#" + this.$props.node.attrs.name;
|
|
621
627
|
}
|
|
622
628
|
}
|
|
623
629
|
};
|
|
624
|
-
function
|
|
625
|
-
const
|
|
626
|
-
return
|
|
630
|
+
function Ot(e, t, o, n, r, s) {
|
|
631
|
+
const i = l("dt-icon-lock"), a = l("dt-stack"), c = l("dt-link"), p = l("node-view-wrapper");
|
|
632
|
+
return d(), m(p, { class: "d-d-inline-block" }, {
|
|
627
633
|
default: u(() => [
|
|
628
|
-
|
|
634
|
+
f(c, { kind: "mention" }, {
|
|
629
635
|
default: u(() => [
|
|
630
|
-
|
|
636
|
+
f(a, {
|
|
637
|
+
direction: "row",
|
|
638
|
+
gap: "0"
|
|
639
|
+
}, {
|
|
640
|
+
default: u(() => [
|
|
641
|
+
e.$props.node.attrs.locked ? (d(), m(i, {
|
|
642
|
+
key: 0,
|
|
643
|
+
size: "200"
|
|
644
|
+
})) : w("", !0),
|
|
645
|
+
k("span", null, h(s.text), 1)
|
|
646
|
+
]),
|
|
647
|
+
_: 1
|
|
648
|
+
})
|
|
631
649
|
]),
|
|
632
650
|
_: 1
|
|
633
651
|
})
|
|
@@ -635,10 +653,10 @@ function $t(e, t, o, n, r, i) {
|
|
|
635
653
|
_: 1
|
|
636
654
|
});
|
|
637
655
|
}
|
|
638
|
-
const
|
|
656
|
+
const Dt = /* @__PURE__ */ g(Nt, [["render", Ot]]), At = H.extend({
|
|
639
657
|
name: "channel",
|
|
640
658
|
addNodeView() {
|
|
641
|
-
return
|
|
659
|
+
return I(Dt);
|
|
642
660
|
},
|
|
643
661
|
parseHTML() {
|
|
644
662
|
return [
|
|
@@ -678,7 +696,7 @@ const At = /* @__PURE__ */ g(Mt, [["render", $t]]), Dt = N.extend({
|
|
|
678
696
|
NodeViewWrapper: R
|
|
679
697
|
},
|
|
680
698
|
props: {
|
|
681
|
-
|
|
699
|
+
...$
|
|
682
700
|
},
|
|
683
701
|
emits: ["selected-command"],
|
|
684
702
|
computed: {
|
|
@@ -694,23 +712,23 @@ const At = /* @__PURE__ */ g(Mt, [["render", $t]]), Dt = N.extend({
|
|
|
694
712
|
t && typeof t == "function" && t(e);
|
|
695
713
|
}
|
|
696
714
|
};
|
|
697
|
-
function jt(e, t, o, n, r,
|
|
698
|
-
const
|
|
699
|
-
return
|
|
715
|
+
function jt(e, t, o, n, r, s) {
|
|
716
|
+
const i = l("node-view-wrapper");
|
|
717
|
+
return d(), m(i, { class: "d-d-inline-block" }, {
|
|
700
718
|
default: u(() => [
|
|
701
|
-
|
|
719
|
+
C(h(s.text), 1)
|
|
702
720
|
]),
|
|
703
721
|
_: 1
|
|
704
722
|
});
|
|
705
723
|
}
|
|
706
|
-
const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]),
|
|
724
|
+
const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Kt = (e, t) => [...e.matchAll(t)].map((n) => {
|
|
707
725
|
let r = n[2];
|
|
708
726
|
return r.endsWith(" ") || (r += " "), {
|
|
709
727
|
index: n.index,
|
|
710
728
|
text: r,
|
|
711
729
|
match: n
|
|
712
730
|
};
|
|
713
|
-
}), Ft =
|
|
731
|
+
}), Ft = H.extend({
|
|
714
732
|
name: "slash-commands",
|
|
715
733
|
group: "inline",
|
|
716
734
|
inline: !0,
|
|
@@ -727,7 +745,7 @@ const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Nt = (e, t) => [...e.matchAl
|
|
|
727
745
|
};
|
|
728
746
|
},
|
|
729
747
|
addNodeView() {
|
|
730
|
-
return
|
|
748
|
+
return I(Ht);
|
|
731
749
|
},
|
|
732
750
|
parseHTML() {
|
|
733
751
|
return [
|
|
@@ -772,8 +790,8 @@ const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Nt = (e, t) => [...e.matchAl
|
|
|
772
790
|
var o;
|
|
773
791
|
const e = (o = this.options.suggestion) == null ? void 0 : o.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
|
|
774
792
|
return [
|
|
775
|
-
|
|
776
|
-
find: (n) =>
|
|
793
|
+
A({
|
|
794
|
+
find: (n) => Kt(n, t),
|
|
777
795
|
type: this.type,
|
|
778
796
|
getAttributes(n) {
|
|
779
797
|
return { command: n[0].trim() };
|
|
@@ -786,12 +804,12 @@ const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Nt = (e, t) => [...e.matchAl
|
|
|
786
804
|
char: "/",
|
|
787
805
|
pluginKey: new T("slashCommandSuggestion")
|
|
788
806
|
}
|
|
789
|
-
}),
|
|
807
|
+
}), Vt = {
|
|
790
808
|
compatConfig: { MODE: 3 },
|
|
791
809
|
name: "MentionSuggestion",
|
|
792
810
|
components: {
|
|
793
|
-
DtAvatar:
|
|
794
|
-
DtStack:
|
|
811
|
+
DtAvatar: Ye,
|
|
812
|
+
DtStack: E
|
|
795
813
|
},
|
|
796
814
|
props: {
|
|
797
815
|
item: {
|
|
@@ -827,51 +845,51 @@ const Ht = /* @__PURE__ */ g(Pt, [["render", jt]]), Nt = (e, t) => [...e.matchAl
|
|
|
827
845
|
return this.item.showDetails;
|
|
828
846
|
}
|
|
829
847
|
}
|
|
830
|
-
},
|
|
848
|
+
}, qt = { class: "d-mention-suggestion__name" }, Ut = {
|
|
831
849
|
key: 1,
|
|
832
850
|
class: "d-mention-suggestion__divider"
|
|
833
851
|
}, Wt = {
|
|
834
852
|
key: 2,
|
|
835
853
|
class: "d-mention-suggestion__status"
|
|
836
854
|
};
|
|
837
|
-
function
|
|
838
|
-
const
|
|
839
|
-
return
|
|
855
|
+
function zt(e, t, o, n, r, s) {
|
|
856
|
+
const i = l("dt-avatar"), a = l("dt-stack");
|
|
857
|
+
return d(), m(a, {
|
|
840
858
|
direction: "row",
|
|
841
859
|
class: "d-mention-suggestion__container",
|
|
842
860
|
gap: "400"
|
|
843
861
|
}, {
|
|
844
862
|
default: u(() => [
|
|
845
|
-
|
|
846
|
-
"full-name":
|
|
847
|
-
"image-src":
|
|
848
|
-
"image-alt":
|
|
849
|
-
"show-presence":
|
|
850
|
-
presence:
|
|
863
|
+
f(i, {
|
|
864
|
+
"full-name": s.name,
|
|
865
|
+
"image-src": s.avatarSrc,
|
|
866
|
+
"image-alt": s.name,
|
|
867
|
+
"show-presence": s.showDetails,
|
|
868
|
+
presence: s.presence,
|
|
851
869
|
size: "sm"
|
|
852
870
|
}, null, 8, ["full-name", "image-src", "image-alt", "show-presence", "presence"]),
|
|
853
|
-
|
|
871
|
+
f(a, {
|
|
854
872
|
class: "d-mention-suggestion__details-container",
|
|
855
873
|
gap: "100"
|
|
856
874
|
}, {
|
|
857
875
|
default: u(() => [
|
|
858
|
-
|
|
859
|
-
|
|
876
|
+
k("span", qt, h(s.name), 1),
|
|
877
|
+
s.showDetails ? (d(), m(a, {
|
|
860
878
|
key: 0,
|
|
861
879
|
direction: "row",
|
|
862
880
|
gap: "300",
|
|
863
881
|
class: "d-label--sm-plain"
|
|
864
882
|
}, {
|
|
865
883
|
default: u(() => [
|
|
866
|
-
|
|
884
|
+
s.presenceText ? (d(), _("span", {
|
|
867
885
|
key: 0,
|
|
868
|
-
class: z(["d-mention-suggestion__presence", [
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
|
|
886
|
+
class: z(["d-mention-suggestion__presence", [s.presenceFontColorClass]])
|
|
887
|
+
}, h(s.presenceText), 3)) : w("", !0),
|
|
888
|
+
s.status && s.presenceText ? (d(), _("div", Ut, " • ")) : w("", !0),
|
|
889
|
+
s.status ? (d(), _("div", Wt, h(s.status), 1)) : w("", !0)
|
|
872
890
|
]),
|
|
873
891
|
_: 1
|
|
874
|
-
})) :
|
|
892
|
+
})) : w("", !0)
|
|
875
893
|
]),
|
|
876
894
|
_: 1
|
|
877
895
|
})
|
|
@@ -879,7 +897,7 @@ function qt(e, t, o, n, r, i) {
|
|
|
879
897
|
_: 1
|
|
880
898
|
});
|
|
881
899
|
}
|
|
882
|
-
const
|
|
900
|
+
const Xt = /* @__PURE__ */ g(Vt, [["render", zt]]), Jt = {
|
|
883
901
|
// This function comes from the user and passed to the editor directly.
|
|
884
902
|
// This will also activate the mention plugin on the editor
|
|
885
903
|
// items: ({ query }) => { return [] },
|
|
@@ -888,14 +906,14 @@ const zt = /* @__PURE__ */ g(Kt, [["render", qt]]), Xt = {
|
|
|
888
906
|
let e, t, o = !1;
|
|
889
907
|
return {
|
|
890
908
|
onStart: (n) => {
|
|
891
|
-
e = new v(
|
|
909
|
+
e = new v(N, {
|
|
892
910
|
props: {
|
|
893
|
-
itemComponent:
|
|
911
|
+
itemComponent: M(Xt),
|
|
894
912
|
itemType: "mention",
|
|
895
913
|
...n
|
|
896
914
|
},
|
|
897
915
|
editor: n.editor
|
|
898
|
-
}), n.clientRect && (t =
|
|
916
|
+
}), n.clientRect && (t = B("body", {
|
|
899
917
|
getReferenceClientRect: n.clientRect,
|
|
900
918
|
appendTo: () => document.body,
|
|
901
919
|
content: e.element,
|
|
@@ -910,7 +928,7 @@ const zt = /* @__PURE__ */ g(Kt, [["render", qt]]), Xt = {
|
|
|
910
928
|
trigger: "manual",
|
|
911
929
|
placement: "top-start",
|
|
912
930
|
zIndex: 650,
|
|
913
|
-
plugins: [
|
|
931
|
+
plugins: [O]
|
|
914
932
|
}), n.items.length > 0 && (t == null || t[0].show()));
|
|
915
933
|
},
|
|
916
934
|
onUpdate(n) {
|
|
@@ -928,13 +946,13 @@ const zt = /* @__PURE__ */ g(Kt, [["render", qt]]), Xt = {
|
|
|
928
946
|
}
|
|
929
947
|
};
|
|
930
948
|
}
|
|
931
|
-
},
|
|
949
|
+
}, Yt = {
|
|
932
950
|
compatConfig: { MODE: 3 },
|
|
933
951
|
name: "ChannelSuggestion",
|
|
934
952
|
components: {
|
|
935
|
-
DtStack:
|
|
936
|
-
DtIconHash:
|
|
937
|
-
DtIconLock:
|
|
953
|
+
DtStack: E,
|
|
954
|
+
DtIconHash: Ge,
|
|
955
|
+
DtIconLock: Qe
|
|
938
956
|
},
|
|
939
957
|
props: {
|
|
940
958
|
item: {
|
|
@@ -948,26 +966,26 @@ const zt = /* @__PURE__ */ g(Kt, [["render", qt]]), Xt = {
|
|
|
948
966
|
}
|
|
949
967
|
}
|
|
950
968
|
};
|
|
951
|
-
function
|
|
952
|
-
const
|
|
953
|
-
return
|
|
969
|
+
function Gt(e, t, o, n, r, s) {
|
|
970
|
+
const i = l("dt-icon-hash"), a = l("dt-icon-lock"), c = l("dt-stack");
|
|
971
|
+
return d(), m(c, {
|
|
954
972
|
direction: "row",
|
|
955
973
|
gap: "400"
|
|
956
974
|
}, {
|
|
957
975
|
default: u(() => [
|
|
958
|
-
o.item.locked ? (
|
|
976
|
+
o.item.locked ? (d(), m(a, {
|
|
959
977
|
key: 1,
|
|
960
978
|
size: "300"
|
|
961
|
-
})) : (
|
|
979
|
+
})) : (d(), m(i, {
|
|
962
980
|
key: 0,
|
|
963
981
|
size: "300"
|
|
964
982
|
})),
|
|
965
|
-
|
|
983
|
+
k("span", null, h(s.name), 1)
|
|
966
984
|
]),
|
|
967
985
|
_: 1
|
|
968
986
|
});
|
|
969
987
|
}
|
|
970
|
-
const
|
|
988
|
+
const Qt = /* @__PURE__ */ g(Yt, [["render", Gt]]), Zt = {
|
|
971
989
|
// This function comes from the user and passed to the editor directly.
|
|
972
990
|
// This will also activate the mention plugin on the editor
|
|
973
991
|
// items: ({ query }) => { return [] },
|
|
@@ -976,14 +994,14 @@ const Gt = /* @__PURE__ */ g(Jt, [["render", Yt]]), Qt = {
|
|
|
976
994
|
let e, t, o = !1;
|
|
977
995
|
return {
|
|
978
996
|
onStart: (n) => {
|
|
979
|
-
e = new v(
|
|
997
|
+
e = new v(N, {
|
|
980
998
|
props: {
|
|
981
|
-
itemComponent:
|
|
999
|
+
itemComponent: M(Qt),
|
|
982
1000
|
itemType: "channel",
|
|
983
1001
|
...n
|
|
984
1002
|
},
|
|
985
1003
|
editor: n.editor
|
|
986
|
-
}), n.clientRect && (t =
|
|
1004
|
+
}), n.clientRect && (t = B("body", {
|
|
987
1005
|
getReferenceClientRect: n.clientRect,
|
|
988
1006
|
appendTo: () => document.body,
|
|
989
1007
|
content: e.element,
|
|
@@ -998,7 +1016,7 @@ const Gt = /* @__PURE__ */ g(Jt, [["render", Yt]]), Qt = {
|
|
|
998
1016
|
trigger: "manual",
|
|
999
1017
|
placement: "top-start",
|
|
1000
1018
|
zIndex: 650,
|
|
1001
|
-
plugins: [
|
|
1019
|
+
plugins: [O]
|
|
1002
1020
|
}), n.items.length > 0 && (t == null || t[0].show()));
|
|
1003
1021
|
},
|
|
1004
1022
|
onUpdate(n) {
|
|
@@ -1016,7 +1034,7 @@ const Gt = /* @__PURE__ */ g(Jt, [["render", Yt]]), Qt = {
|
|
|
1016
1034
|
}
|
|
1017
1035
|
};
|
|
1018
1036
|
}
|
|
1019
|
-
},
|
|
1037
|
+
}, en = {
|
|
1020
1038
|
compatConfig: { MODE: 3 },
|
|
1021
1039
|
name: "SlashCommandSuggestion",
|
|
1022
1040
|
props: {
|
|
@@ -1036,17 +1054,17 @@ const Gt = /* @__PURE__ */ g(Jt, [["render", Yt]]), Qt = {
|
|
|
1036
1054
|
return this.item.parametersExample;
|
|
1037
1055
|
}
|
|
1038
1056
|
}
|
|
1039
|
-
},
|
|
1040
|
-
function
|
|
1041
|
-
return
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1057
|
+
}, tn = { class: "d-body--md-compact" }, nn = { key: 0 }, on = { class: "d-body--sm d-fc-tertiary" };
|
|
1058
|
+
function rn(e, t, o, n, r, s) {
|
|
1059
|
+
return d(), _("div", null, [
|
|
1060
|
+
k("div", tn, [
|
|
1061
|
+
k("span", null, "/" + h(s.command), 1),
|
|
1062
|
+
s.parametersExample ? (d(), _("span", nn, h(s.parametersExample), 1)) : w("", !0)
|
|
1045
1063
|
]),
|
|
1046
|
-
|
|
1064
|
+
k("div", on, h(s.description), 1)
|
|
1047
1065
|
]);
|
|
1048
1066
|
}
|
|
1049
|
-
const
|
|
1067
|
+
const sn = /* @__PURE__ */ g(en, [["render", rn]]), an = {
|
|
1050
1068
|
// This function comes from the user and passed to the editor directly.
|
|
1051
1069
|
// This will also activate the mention plugin on the editor
|
|
1052
1070
|
// items: ({ query }) => { return [] },
|
|
@@ -1056,15 +1074,15 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1056
1074
|
let e, t, o = !1;
|
|
1057
1075
|
return {
|
|
1058
1076
|
onStart: (n) => {
|
|
1059
|
-
e = new v(
|
|
1077
|
+
e = new v(N, {
|
|
1060
1078
|
parent: void 0,
|
|
1061
1079
|
props: {
|
|
1062
|
-
itemComponent:
|
|
1080
|
+
itemComponent: M(sn),
|
|
1063
1081
|
itemType: "slash-command",
|
|
1064
1082
|
...n
|
|
1065
1083
|
},
|
|
1066
1084
|
editor: n.editor
|
|
1067
|
-
}), n.clientRect && (t =
|
|
1085
|
+
}), n.clientRect && (t = B("body", {
|
|
1068
1086
|
getReferenceClientRect: n.clientRect,
|
|
1069
1087
|
appendTo: () => document.body,
|
|
1070
1088
|
content: e.element,
|
|
@@ -1079,7 +1097,7 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1079
1097
|
trigger: "manual",
|
|
1080
1098
|
placement: "top-start",
|
|
1081
1099
|
zIndex: 650,
|
|
1082
|
-
plugins: [
|
|
1100
|
+
plugins: [O]
|
|
1083
1101
|
}), n.items.length > 0 && (t == null || t[0].show()));
|
|
1084
1102
|
},
|
|
1085
1103
|
onUpdate(n) {
|
|
@@ -1097,14 +1115,14 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1097
1115
|
}
|
|
1098
1116
|
};
|
|
1099
1117
|
}
|
|
1100
|
-
},
|
|
1118
|
+
}, cn = {
|
|
1101
1119
|
compatConfig: { MODE: 3 },
|
|
1102
1120
|
name: "DtRichTextEditor",
|
|
1103
1121
|
components: {
|
|
1104
1122
|
EditorContent: Q,
|
|
1105
1123
|
BubbleMenu: G,
|
|
1106
|
-
DtButton:
|
|
1107
|
-
DtStack:
|
|
1124
|
+
DtButton: tt,
|
|
1125
|
+
DtStack: E
|
|
1108
1126
|
},
|
|
1109
1127
|
props: {
|
|
1110
1128
|
/**
|
|
@@ -1176,20 +1194,20 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1176
1194
|
type: [Boolean, String, Number],
|
|
1177
1195
|
default: !1,
|
|
1178
1196
|
validator(e) {
|
|
1179
|
-
return typeof e == "string" ?
|
|
1197
|
+
return typeof e == "string" ? Je.includes(e) : !0;
|
|
1180
1198
|
}
|
|
1181
1199
|
},
|
|
1182
1200
|
/**
|
|
1183
1201
|
* The output format that the editor uses when emitting the "@input" event.
|
|
1184
|
-
* One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for
|
|
1202
|
+
* One of `text`, `json`, `html`, `markdown`. See https://tiptap.dev/guide/output for
|
|
1185
1203
|
* examples.
|
|
1186
|
-
* @values text, json, html
|
|
1204
|
+
* @values text, json, html, markdown
|
|
1187
1205
|
*/
|
|
1188
1206
|
outputFormat: {
|
|
1189
1207
|
type: String,
|
|
1190
1208
|
default: "html",
|
|
1191
1209
|
validator(e) {
|
|
1192
|
-
return
|
|
1210
|
+
return Xe.includes(e);
|
|
1193
1211
|
}
|
|
1194
1212
|
},
|
|
1195
1213
|
/**
|
|
@@ -1397,6 +1415,12 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1397
1415
|
* @type {String}
|
|
1398
1416
|
*/
|
|
1399
1417
|
"text-input",
|
|
1418
|
+
/**
|
|
1419
|
+
* Input event always in markdown format.
|
|
1420
|
+
* @event input
|
|
1421
|
+
* @type {String}
|
|
1422
|
+
*/
|
|
1423
|
+
"markdown-input",
|
|
1400
1424
|
/**
|
|
1401
1425
|
* Event to sync the value with the parent
|
|
1402
1426
|
* @event update:value
|
|
@@ -1448,11 +1472,128 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1448
1472
|
tippyOptions: {
|
|
1449
1473
|
appendTo: () => {
|
|
1450
1474
|
var e;
|
|
1451
|
-
return (e =
|
|
1475
|
+
return (e = K(this.$refs.editor.$el).getRootNode()) == null ? void 0 : e.querySelector("body");
|
|
1452
1476
|
},
|
|
1453
1477
|
placement: "top-start"
|
|
1454
1478
|
},
|
|
1455
|
-
i18n: new
|
|
1479
|
+
i18n: new et(),
|
|
1480
|
+
// JSON-to-markdown converter
|
|
1481
|
+
jsonToMarkdownConverter: {
|
|
1482
|
+
convertToMarkdown(e) {
|
|
1483
|
+
return this.processNode(e);
|
|
1484
|
+
},
|
|
1485
|
+
processNodeContent(e) {
|
|
1486
|
+
return e.content ? e.content.map((t) => this.processNode(t)).join("") : "";
|
|
1487
|
+
},
|
|
1488
|
+
processNode(e) {
|
|
1489
|
+
if (!e) return "";
|
|
1490
|
+
const o = {
|
|
1491
|
+
doc: (n) => this.processDocNode(n),
|
|
1492
|
+
paragraph: (n) => this.processParagraphNode(n),
|
|
1493
|
+
text: (n) => this.processTextNode(n),
|
|
1494
|
+
hardBreak: () => this.processHardBreakNode(),
|
|
1495
|
+
blockquote: (n) => this.processBlockquoteNode(n),
|
|
1496
|
+
bulletList: (n) => this.processBulletListNode(n),
|
|
1497
|
+
orderedList: (n) => this.processOrderedListNode(n),
|
|
1498
|
+
listItem: (n) => this.processListItemNode(n),
|
|
1499
|
+
codeBlock: (n) => this.processCodeBlockNode(n),
|
|
1500
|
+
mention: (n) => this.processMentionNode(n),
|
|
1501
|
+
channel: (n) => this.processChannelNode(n),
|
|
1502
|
+
"slash-commands": (n) => this.processSlashCommandsNode(n),
|
|
1503
|
+
emoji: (n) => this.processEmojiNode(n)
|
|
1504
|
+
}[e.type];
|
|
1505
|
+
return o ? o(e) : this.processUnknownNode(e);
|
|
1506
|
+
},
|
|
1507
|
+
processDocNode(e) {
|
|
1508
|
+
return this.processNodeContent(e);
|
|
1509
|
+
},
|
|
1510
|
+
processParagraphNode(e) {
|
|
1511
|
+
const t = this.processNodeContent(e);
|
|
1512
|
+
return t ? t + `
|
|
1513
|
+
` : `
|
|
1514
|
+
`;
|
|
1515
|
+
},
|
|
1516
|
+
processTextNode(e) {
|
|
1517
|
+
let t = e.text || "";
|
|
1518
|
+
return e.marks && (t = this.applyMarks(t, e.marks)), t;
|
|
1519
|
+
},
|
|
1520
|
+
processHardBreakNode() {
|
|
1521
|
+
return `
|
|
1522
|
+
`;
|
|
1523
|
+
},
|
|
1524
|
+
processBlockquoteNode(e) {
|
|
1525
|
+
return this.processNodeContent(e).split(`
|
|
1526
|
+
`).map((o) => o ? `> ${o}` : ">").join(`
|
|
1527
|
+
`) + `
|
|
1528
|
+
`;
|
|
1529
|
+
},
|
|
1530
|
+
processBulletListNode(e) {
|
|
1531
|
+
return this.processNodeContent(e);
|
|
1532
|
+
},
|
|
1533
|
+
processOrderedListNode(e) {
|
|
1534
|
+
return e.content ? e.content.map((t, o) => this.processNode(t).replace(/^- /, `${o + 1}. `)).join("") : "";
|
|
1535
|
+
},
|
|
1536
|
+
processListItemNode(e) {
|
|
1537
|
+
const t = this.processNodeContent(e);
|
|
1538
|
+
return t ? `- ${t.replace(/\n$/, "")}
|
|
1539
|
+
` : "";
|
|
1540
|
+
},
|
|
1541
|
+
processCodeBlockNode(e) {
|
|
1542
|
+
return `\`\`\`
|
|
1543
|
+
${this.processNodeContent(e)}
|
|
1544
|
+
\`\`\``;
|
|
1545
|
+
},
|
|
1546
|
+
processMentionNode(e) {
|
|
1547
|
+
var r, s, i;
|
|
1548
|
+
const t = ((r = e.attrs) == null ? void 0 : r.name) || "", o = ((s = e.attrs) == null ? void 0 : s.id) || "", n = ((i = e.attrs) == null ? void 0 : i.contactKey) || "";
|
|
1549
|
+
return `<!-- @mention: {"id": "${o}", "contactKey": "${n}", "name": "${t}"} -->`;
|
|
1550
|
+
},
|
|
1551
|
+
processChannelNode(e) {
|
|
1552
|
+
var r, s, i;
|
|
1553
|
+
const t = ((r = e.attrs) == null ? void 0 : r.name) || "", o = ((s = e.attrs) == null ? void 0 : s.id) || "", n = ((i = e.attrs) == null ? void 0 : i.locked.toString()) || "";
|
|
1554
|
+
return `<!-- @channel: {"id": "${o}", "name": "${t}", "locked": "${n}"} -->`;
|
|
1555
|
+
},
|
|
1556
|
+
processSlashCommandsNode(e) {
|
|
1557
|
+
var n, r;
|
|
1558
|
+
const t = ((n = e.attrs) == null ? void 0 : n.command) || "", o = ((r = e.attrs) == null ? void 0 : r.parameters) || "";
|
|
1559
|
+
return `/${t}${o ? ` ${o}` : ""}`;
|
|
1560
|
+
},
|
|
1561
|
+
processEmojiNode(e) {
|
|
1562
|
+
var t;
|
|
1563
|
+
return ((t = e.attrs) == null ? void 0 : t.code) || "";
|
|
1564
|
+
},
|
|
1565
|
+
processUnknownNode(e) {
|
|
1566
|
+
return this.processNodeContent(e);
|
|
1567
|
+
},
|
|
1568
|
+
applyMarks(e, t) {
|
|
1569
|
+
let o = e;
|
|
1570
|
+
return [...t].sort((r, s) => {
|
|
1571
|
+
const i = { link: 0, bold: 1, italic: 2, strike: 3, code: 4 };
|
|
1572
|
+
return (i[r.type] || 5) - (i[s.type] || 5);
|
|
1573
|
+
}).forEach((r) => {
|
|
1574
|
+
var s;
|
|
1575
|
+
switch (r.type) {
|
|
1576
|
+
case "bold":
|
|
1577
|
+
o = `**${o}**`;
|
|
1578
|
+
break;
|
|
1579
|
+
case "italic":
|
|
1580
|
+
o = `*${o}*`;
|
|
1581
|
+
break;
|
|
1582
|
+
case "strike":
|
|
1583
|
+
o = `~~${o}~~`;
|
|
1584
|
+
break;
|
|
1585
|
+
case "code":
|
|
1586
|
+
o = `\`${o}\``;
|
|
1587
|
+
break;
|
|
1588
|
+
case "link": {
|
|
1589
|
+
const i = ((s = r.attrs) == null ? void 0 : s.href) || "";
|
|
1590
|
+
o = `[${o}](${i})`;
|
|
1591
|
+
break;
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}), o;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1456
1597
|
};
|
|
1457
1598
|
},
|
|
1458
1599
|
computed: {
|
|
@@ -1469,15 +1610,15 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1469
1610
|
},
|
|
1470
1611
|
// eslint-disable-next-line complexity
|
|
1471
1612
|
extensions() {
|
|
1472
|
-
const e = [me,
|
|
1473
|
-
e.push(this.useDivTags ? Rt :
|
|
1613
|
+
const e = [me, xe, Ee, he];
|
|
1614
|
+
e.push(this.useDivTags ? Rt : U), this.allowBold && e.push(fe), this.allowBlockquote && e.push(de), this.allowBulletList && (e.push(ge), e.push(ye.extend({
|
|
1474
1615
|
renderText({ node: n }) {
|
|
1475
1616
|
return n.textContent;
|
|
1476
1617
|
}
|
|
1477
|
-
})), e.push(
|
|
1478
|
-
|
|
1618
|
+
})), e.push(we)), this.allowItalic && e.push(_e), this.allowStrike && e.push(Ce), this.allowUnderline && e.push(be), this.placeholder && e.push(
|
|
1619
|
+
pe.configure({ placeholder: this.placeholder })
|
|
1479
1620
|
);
|
|
1480
|
-
const t = this, o =
|
|
1621
|
+
const t = this, o = ce.create({
|
|
1481
1622
|
addKeyboardShortcuts() {
|
|
1482
1623
|
return {
|
|
1483
1624
|
"Shift-Enter": ({ editor: n }) => t.allowLineBreaks ? !1 : (n.commands.first(({ commands: r }) => [
|
|
@@ -1491,7 +1632,7 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1491
1632
|
};
|
|
1492
1633
|
}
|
|
1493
1634
|
});
|
|
1494
|
-
if (e.push(o), this.link && e.push(
|
|
1635
|
+
if (e.push(o), this.link && e.push(ke.extend({
|
|
1495
1636
|
inclusive: !1,
|
|
1496
1637
|
addKeyboardShortcuts() {
|
|
1497
1638
|
return {
|
|
@@ -1504,17 +1645,17 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1504
1645
|
},
|
|
1505
1646
|
openOnClick: !1,
|
|
1506
1647
|
autolink: !0,
|
|
1507
|
-
protocols:
|
|
1508
|
-
})), this.customLink && e.push(this.getExtension(
|
|
1509
|
-
const n = { ...this.mentionSuggestion, ...
|
|
1648
|
+
protocols: F
|
|
1649
|
+
})), this.customLink && e.push(this.getExtension(Lt, this.customLink)), this.mentionSuggestion) {
|
|
1650
|
+
const n = { ...this.mentionSuggestion, ...Jt };
|
|
1510
1651
|
e.push(Bt.configure({ suggestion: n }));
|
|
1511
1652
|
}
|
|
1512
1653
|
if (this.channelSuggestion) {
|
|
1513
|
-
const n = { ...this.channelSuggestion, ...
|
|
1514
|
-
e.push(
|
|
1654
|
+
const n = { ...this.channelSuggestion, ...Zt };
|
|
1655
|
+
e.push(At.configure({ suggestion: n }));
|
|
1515
1656
|
}
|
|
1516
1657
|
if (this.slashCommandSuggestion) {
|
|
1517
|
-
const n = { ...this.slashCommandSuggestion, ...
|
|
1658
|
+
const n = { ...this.slashCommandSuggestion, ...an };
|
|
1518
1659
|
e.push(Ft.configure({
|
|
1519
1660
|
suggestion: n,
|
|
1520
1661
|
onSelectedCommand: (r) => {
|
|
@@ -1524,7 +1665,7 @@ const rn = /* @__PURE__ */ g(Zt, [["render", on]]), sn = {
|
|
|
1524
1665
|
}
|
|
1525
1666
|
return e.push(yt), e.push(Te.configure({
|
|
1526
1667
|
types: ["paragraph"]
|
|
1527
|
-
})), this.allowCode && e.push(ue), this.allowCodeblock && e.push(
|
|
1668
|
+
})), this.allowCode && e.push(ue), this.allowCodeblock && e.push(le.extend({
|
|
1528
1669
|
renderText({ node: n }) {
|
|
1529
1670
|
return `\`\`\`
|
|
1530
1671
|
${n.textContent}
|
|
@@ -1534,7 +1675,7 @@ ${n.textContent}
|
|
|
1534
1675
|
HTMLAttributes: {
|
|
1535
1676
|
class: "d-rich-text-editor__code-block"
|
|
1536
1677
|
}
|
|
1537
|
-
})), this.allowInlineImages && e.push(
|
|
1678
|
+
})), this.allowInlineImages && e.push($t), (this.allowFontFamily || this.allowFontColor) && (e.push(Se), this.allowFontColor && e.push(Le), this.allowFontFamily && e.push($e)), this.additionalExtensions.length && e.push(...this.additionalExtensions), e;
|
|
1538
1679
|
},
|
|
1539
1680
|
inputAttrs() {
|
|
1540
1681
|
const e = {
|
|
@@ -1574,7 +1715,7 @@ ${n.textContent}
|
|
|
1574
1715
|
this.destroyEditor();
|
|
1575
1716
|
},
|
|
1576
1717
|
mounted() {
|
|
1577
|
-
|
|
1718
|
+
Ue(K(this.$el), this.$options.name), this.processValue(this.modelValue, !1);
|
|
1578
1719
|
},
|
|
1579
1720
|
methods: {
|
|
1580
1721
|
createEditor() {
|
|
@@ -1617,9 +1758,9 @@ ${n.textContent}
|
|
|
1617
1758
|
* @param editor the editor instance.
|
|
1618
1759
|
*/
|
|
1619
1760
|
getSelectedLinkText(e) {
|
|
1620
|
-
var a, c,
|
|
1621
|
-
const { view: t, state: o } = e, { from: n, to: r } = t.state.selection,
|
|
1622
|
-
return
|
|
1761
|
+
var a, c, p;
|
|
1762
|
+
const { view: t, state: o } = e, { from: n, to: r } = t.state.selection, s = o.doc.textBetween(n, r, ""), i = this.editor.state.doc.nodeAt(n);
|
|
1763
|
+
return i && ((p = (c = (a = i.marks) == null ? void 0 : a.at(0)) == null ? void 0 : c.type) == null ? void 0 : p.name) === "link" ? i.textContent : s;
|
|
1623
1764
|
},
|
|
1624
1765
|
editLink() {
|
|
1625
1766
|
const e = this.getSelectedLinkText(this.editor), t = {
|
|
@@ -1638,23 +1779,21 @@ ${n.textContent}
|
|
|
1638
1779
|
const e = this.editor.getAttributes("link").href;
|
|
1639
1780
|
window.open(e, "_blank");
|
|
1640
1781
|
},
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
var a, c, f;
|
|
1782
|
+
setLink(e, t, o, n = F, r) {
|
|
1783
|
+
var a, c, p;
|
|
1644
1784
|
if (!e) {
|
|
1645
1785
|
this.removeLink();
|
|
1646
1786
|
return;
|
|
1647
1787
|
}
|
|
1648
1788
|
n.find((y) => y.test(e)) || (e = `${r}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
|
|
1649
|
-
const
|
|
1650
|
-
this.editor.chain().focus().insertContent(t).setTextSelection({ from:
|
|
1789
|
+
const i = (p = (c = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : c.state) == null ? void 0 : p.selection;
|
|
1790
|
+
this.editor.chain().focus().insertContent(t).setTextSelection({ from: i.from, to: i.from + t.length }).setLink({ href: e, class: o.class }).run();
|
|
1651
1791
|
},
|
|
1652
|
-
// eslint-disable-next-line complexity
|
|
1653
1792
|
processValue(e, t = !0) {
|
|
1654
1793
|
const o = this.getOutput();
|
|
1655
|
-
if (!(t &&
|
|
1794
|
+
if (!(t && Ze(e, o))) {
|
|
1656
1795
|
if (typeof e == "string" && this.outputFormat === "text") {
|
|
1657
|
-
const n = new RegExp(`(${
|
|
1796
|
+
const n = new RegExp(`(${W})`, "g");
|
|
1658
1797
|
e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
|
|
1659
1798
|
}
|
|
1660
1799
|
this.editor.commands.setContent(e, !1, { preserveWhitespace: "full" });
|
|
@@ -1666,10 +1805,10 @@ ${n.textContent}
|
|
|
1666
1805
|
insertPlainTextWithHardBreaks(e, t) {
|
|
1667
1806
|
const { tr: o } = e.state, { from: n, to: r } = e.state.selection;
|
|
1668
1807
|
o.deleteRange(n, r);
|
|
1669
|
-
const
|
|
1670
|
-
let
|
|
1671
|
-
for (let a = 0; a <
|
|
1672
|
-
a > 0 && (o.insert(
|
|
1808
|
+
const s = t.split(/\r?\n/);
|
|
1809
|
+
let i = n;
|
|
1810
|
+
for (let a = 0; a < s.length; a++)
|
|
1811
|
+
a > 0 && (o.insert(i, e.state.schema.nodes.hardBreak.create()), i++), o.insertText(s[a], i), i += s[a].length;
|
|
1673
1812
|
e.dispatch(o);
|
|
1674
1813
|
},
|
|
1675
1814
|
shouldPreserveLineBreaks(e, t) {
|
|
@@ -1737,6 +1876,8 @@ ${n.textContent}
|
|
|
1737
1876
|
const n = this.editor.getText({ blockSeparator: `
|
|
1738
1877
|
` });
|
|
1739
1878
|
this.$emit("text-input", n);
|
|
1879
|
+
const r = this.jsonToMarkdownConverter.convertToMarkdown(t);
|
|
1880
|
+
this.$emit("markdown-input", r);
|
|
1740
1881
|
},
|
|
1741
1882
|
/**
|
|
1742
1883
|
* The Editor exposes event hooks that we have to map our emits into. See
|
|
@@ -1761,6 +1902,8 @@ ${n.textContent}
|
|
|
1761
1902
|
return this.editor.getJSON();
|
|
1762
1903
|
case "html":
|
|
1763
1904
|
return this.editor.getHTML();
|
|
1905
|
+
case "markdown":
|
|
1906
|
+
return this.jsonToMarkdownConverter.convertToMarkdown(this.editor.getJSON());
|
|
1764
1907
|
case "text":
|
|
1765
1908
|
default:
|
|
1766
1909
|
return this.editor.getText({ blockSeparator: `
|
|
@@ -1786,52 +1929,52 @@ ${n.textContent}
|
|
|
1786
1929
|
this.editor.commands.focus();
|
|
1787
1930
|
}
|
|
1788
1931
|
}
|
|
1789
|
-
},
|
|
1790
|
-
function
|
|
1791
|
-
const
|
|
1792
|
-
return
|
|
1793
|
-
r.editor && o.link && !o.hideLinkBubbleMenu ? (
|
|
1932
|
+
}, dn = { class: "d-popover__dialog" };
|
|
1933
|
+
function ln(e, t, o, n, r, s) {
|
|
1934
|
+
const i = l("dt-button"), a = l("dt-stack"), c = l("bubble-menu"), p = l("editor-content");
|
|
1935
|
+
return d(), _("div", null, [
|
|
1936
|
+
r.editor && o.link && !o.hideLinkBubbleMenu ? (d(), m(c, {
|
|
1794
1937
|
key: 0,
|
|
1795
1938
|
editor: r.editor,
|
|
1796
|
-
"should-show":
|
|
1939
|
+
"should-show": s.bubbleMenuShouldShow,
|
|
1797
1940
|
"tippy-options": r.tippyOptions,
|
|
1798
1941
|
style: { visibility: "visible" }
|
|
1799
1942
|
}, {
|
|
1800
1943
|
default: u(() => [
|
|
1801
|
-
|
|
1802
|
-
|
|
1944
|
+
k("div", dn, [
|
|
1945
|
+
f(a, {
|
|
1803
1946
|
direction: "row",
|
|
1804
1947
|
class: "d-rich-text-editor-bubble-menu__button-stack",
|
|
1805
1948
|
gap: "0"
|
|
1806
1949
|
}, {
|
|
1807
1950
|
default: u(() => [
|
|
1808
|
-
|
|
1951
|
+
f(i, {
|
|
1809
1952
|
kind: "muted",
|
|
1810
1953
|
importance: "clear",
|
|
1811
|
-
onClick:
|
|
1954
|
+
onClick: s.editLink
|
|
1812
1955
|
}, {
|
|
1813
1956
|
default: u(() => [
|
|
1814
|
-
|
|
1957
|
+
C(h(r.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")), 1)
|
|
1815
1958
|
]),
|
|
1816
1959
|
_: 1
|
|
1817
1960
|
}, 8, ["onClick"]),
|
|
1818
|
-
|
|
1961
|
+
f(i, {
|
|
1819
1962
|
kind: "muted",
|
|
1820
1963
|
importance: "clear",
|
|
1821
|
-
onClick:
|
|
1964
|
+
onClick: s.openLink
|
|
1822
1965
|
}, {
|
|
1823
1966
|
default: u(() => [
|
|
1824
|
-
|
|
1967
|
+
C(h(r.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")), 1)
|
|
1825
1968
|
]),
|
|
1826
1969
|
_: 1
|
|
1827
1970
|
}, 8, ["onClick"]),
|
|
1828
|
-
|
|
1971
|
+
f(i, {
|
|
1829
1972
|
kind: "danger",
|
|
1830
1973
|
importance: "clear",
|
|
1831
|
-
onClick:
|
|
1974
|
+
onClick: s.removeLink
|
|
1832
1975
|
}, {
|
|
1833
1976
|
default: u(() => [
|
|
1834
|
-
|
|
1977
|
+
C(h(r.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")), 1)
|
|
1835
1978
|
]),
|
|
1836
1979
|
_: 1
|
|
1837
1980
|
}, 8, ["onClick"])
|
|
@@ -1841,17 +1984,17 @@ function cn(e, t, o, n, r, i) {
|
|
|
1841
1984
|
])
|
|
1842
1985
|
]),
|
|
1843
1986
|
_: 1
|
|
1844
|
-
}, 8, ["editor", "should-show", "tippy-options"])) :
|
|
1845
|
-
p
|
|
1987
|
+
}, 8, ["editor", "should-show", "tippy-options"])) : w("", !0),
|
|
1988
|
+
f(p, Ae({
|
|
1846
1989
|
ref: "editor",
|
|
1847
1990
|
editor: r.editor,
|
|
1848
1991
|
class: "d-rich-text-editor",
|
|
1849
1992
|
"data-qa": "dt-rich-text-editor"
|
|
1850
|
-
},
|
|
1993
|
+
}, s.attrs), null, 16, ["editor"])
|
|
1851
1994
|
]);
|
|
1852
1995
|
}
|
|
1853
|
-
const
|
|
1996
|
+
const no = /* @__PURE__ */ g(cn, [["render", ln]]);
|
|
1854
1997
|
export {
|
|
1855
|
-
|
|
1998
|
+
no as default
|
|
1856
1999
|
};
|
|
1857
2000
|
//# sourceMappingURL=rich-text-editor.js.map
|