@dialpad/dialtone 9.116.0 → 9.117.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.
- package/dist/css/dialtone-default-theme.css +4 -4
- package/dist/css/dialtone-default-theme.min.css +1 -1
- package/dist/css/dialtone-docs.json +1 -1
- package/dist/css/tokens/tokens-base-dark.css +1 -1
- package/dist/css/tokens/tokens-base-deca-dark.css +1 -1
- package/dist/css/tokens/tokens-base-deca-light.css +1 -1
- package/dist/css/tokens/tokens-base-light.css +1 -1
- package/dist/css/tokens/tokens-debug-base.css +1 -1
- package/dist/css/tokens/tokens-debug-dp.css +3 -3
- package/dist/css/tokens/tokens-deca-dark.css +3 -3
- package/dist/css/tokens/tokens-deca-light.css +3 -3
- package/dist/css/tokens/tokens-dp-dark.css +3 -3
- package/dist/css/tokens/tokens-dp-light.css +3 -3
- package/dist/css/tokens/tokens-expressive-dark.css +3 -3
- package/dist/css/tokens/tokens-expressive-light.css +3 -3
- package/dist/css/tokens/tokens-expressive-sm-dark.css +3 -3
- package/dist/css/tokens/tokens-expressive-sm-light.css +3 -3
- package/dist/css/tokens/tokens-tmo-dark.css +3 -3
- package/dist/css/tokens/tokens-tmo-light.css +3 -3
- package/dist/css/tokens-docs.json +1 -1
- package/dist/tokens/css/tokens-base-dark.css +1 -1
- package/dist/tokens/css/tokens-base-deca-dark.css +1 -1
- package/dist/tokens/css/tokens-base-deca-light.css +1 -1
- package/dist/tokens/css/tokens-base-light.css +1 -1
- package/dist/tokens/css/tokens-debug-base.css +1 -1
- package/dist/tokens/css/tokens-debug-dp.css +3 -3
- package/dist/tokens/css/tokens-deca-dark.css +3 -3
- package/dist/tokens/css/tokens-deca-light.css +3 -3
- package/dist/tokens/css/tokens-dp-dark.css +3 -3
- package/dist/tokens/css/tokens-dp-light.css +3 -3
- package/dist/tokens/css/tokens-expressive-dark.css +3 -3
- package/dist/tokens/css/tokens-expressive-light.css +3 -3
- package/dist/tokens/css/tokens-expressive-sm-dark.css +3 -3
- package/dist/tokens/css/tokens-expressive-sm-light.css +3 -3
- package/dist/tokens/css/tokens-tmo-dark.css +3 -3
- package/dist/tokens/css/tokens-tmo-light.css +3 -3
- package/dist/tokens/doc.json +27262 -27262
- package/dist/tokens/less/tokens-base-dark.less +1 -1
- package/dist/tokens/less/tokens-base-deca-dark.less +1 -1
- package/dist/tokens/less/tokens-base-deca-light.less +1 -1
- package/dist/tokens/less/tokens-base-light.less +1 -1
- package/dist/tokens/less/tokens-deca-dark.less +3 -3
- package/dist/tokens/less/tokens-deca-light.less +3 -3
- package/dist/tokens/less/tokens-dp-dark.less +3 -3
- package/dist/tokens/less/tokens-dp-light.less +3 -3
- package/dist/tokens/less/tokens-expressive-dark.less +3 -3
- package/dist/tokens/less/tokens-expressive-light.less +3 -3
- package/dist/tokens/less/tokens-expressive-sm-dark.less +3 -3
- package/dist/tokens/less/tokens-expressive-sm-light.less +3 -3
- package/dist/tokens/less/tokens-tmo-dark.less +3 -3
- package/dist/tokens/less/tokens-tmo-light.less +3 -3
- package/dist/tokens/themes/chunks/tokens-base-dark-CKvoqrK2.js +1 -0
- package/dist/tokens/themes/chunks/tokens-base-dark-CLL9Sz8C.js +4 -0
- package/dist/tokens/themes/chunks/tokens-base-light-C7afXvK5.js +4 -0
- package/dist/tokens/themes/chunks/tokens-base-light-DgGeYJGp.js +1 -0
- package/dist/tokens/themes/debug.cjs +1 -1
- package/dist/tokens/themes/debug.js +1 -1
- package/dist/tokens/themes/dp-dark.cjs +1 -1
- package/dist/tokens/themes/dp-dark.js +2 -2
- package/dist/tokens/themes/dp-deca-dark.cjs +1 -1
- package/dist/tokens/themes/dp-deca-dark.js +1 -1
- package/dist/tokens/themes/dp-deca-light.cjs +1 -1
- package/dist/tokens/themes/dp-deca-light.js +1 -1
- package/dist/tokens/themes/dp-light.cjs +1 -1
- package/dist/tokens/themes/dp-light.js +2 -2
- package/dist/tokens/themes/expressive-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-dark.js +2 -2
- package/dist/tokens/themes/expressive-light.cjs +1 -1
- package/dist/tokens/themes/expressive-light.js +2 -2
- package/dist/tokens/themes/expressive-sm-dark.cjs +1 -1
- package/dist/tokens/themes/expressive-sm-dark.js +2 -2
- package/dist/tokens/themes/expressive-sm-light.cjs +1 -1
- package/dist/tokens/themes/expressive-sm-light.js +2 -2
- package/dist/tokens/themes/tmo-dark.cjs +1 -1
- package/dist/tokens/themes/tmo-dark.js +2 -2
- package/dist/tokens/themes/tmo-light.cjs +1 -1
- package/dist/tokens/themes/tmo-light.js +2 -2
- package/dist/tokens/tokens-base-dark.json +1 -1
- package/dist/tokens/tokens-base-deca-dark.json +1 -1
- package/dist/tokens/tokens-base-deca-light.json +1 -1
- package/dist/tokens/tokens-base-light.json +1 -1
- package/dist/tokens/tokens-deca-dark.json +3 -3
- package/dist/tokens/tokens-deca-light.json +3 -3
- package/dist/tokens/tokens-dp-dark.json +3 -3
- package/dist/tokens/tokens-dp-light.json +3 -3
- package/dist/tokens/tokens-expressive-dark.json +3 -3
- package/dist/tokens/tokens-expressive-light.json +3 -3
- package/dist/tokens/tokens-expressive-sm-dark.json +3 -3
- package/dist/tokens/tokens-expressive-sm-light.json +3 -3
- package/dist/tokens/tokens-tmo-dark.json +3 -3
- package/dist/tokens/tokens-tmo-light.json +3 -3
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor/editor.js +6 -6
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- 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 +183 -166
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/localization/index.cjs +5 -1
- package/dist/vue2/localization/index.cjs.map +1 -1
- package/dist/vue2/localization/index.js +4865 -21
- package/dist/vue2/localization/index.js.map +1 -1
- package/dist/vue2/node_modules/@tiptap/vue-2.cjs.map +1 -1
- package/dist/vue2/node_modules/@tiptap/vue-2.js.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +18 -0
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue3/component-documentation.json +1 -1
- package/dist/vue3/lib/editor/editor.cjs +1 -1
- package/dist/vue3/lib/editor/editor.cjs.map +1 -1
- package/dist/vue3/lib/editor/editor.js +15 -13
- package/dist/vue3/lib/editor/editor.js.map +1 -1
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
- 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 +181 -164
- package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +18 -0
- package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/package.json +3 -4
- package/dist/tokens/themes/chunks/tokens-base-dark-B42c8NRe.js +0 -1
- package/dist/tokens/themes/chunks/tokens-base-dark-D3XlzClW.js +0 -4
- package/dist/tokens/themes/chunks/tokens-base-light-5p3ZOPKU.js +0 -1
- package/dist/tokens/themes/chunks/tokens-base-light-C_G4p7UU.js +0 -4
- package/dist/vue2/node_modules/@dialpad/i18n-vue2.cjs +0 -6
- package/dist/vue2/node_modules/@dialpad/i18n-vue2.cjs.map +0 -1
- package/dist/vue2/node_modules/@dialpad/i18n-vue2.js +0 -4906
- package/dist/vue2/node_modules/@dialpad/i18n-vue2.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as b, VueNodeViewRenderer as
|
|
2
|
-
import { Node as
|
|
1
|
+
import { NodeViewWrapper as _, nodeViewProps as y, VueRenderer as b, VueNodeViewRenderer as w, EditorContent as D, 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";
|
|
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";
|
|
@@ -13,32 +13,35 @@ import ie from "@tiptap/extension-italic";
|
|
|
13
13
|
import oe from "@tiptap/extension-link";
|
|
14
14
|
import se from "@tiptap/extension-list-item";
|
|
15
15
|
import ae from "@tiptap/extension-ordered-list";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
16
|
+
import le from "@tiptap/extension-strike";
|
|
17
|
+
import de from "@tiptap/extension-underline";
|
|
18
18
|
import ce from "@tiptap/extension-text";
|
|
19
19
|
import ue from "@tiptap/extension-text-align";
|
|
20
20
|
import me from "@tiptap/extension-history";
|
|
21
|
-
import
|
|
22
|
-
import fe from "@tiptap/
|
|
21
|
+
import he from "@tiptap/extension-text-style";
|
|
22
|
+
import fe from "@tiptap/extension-color";
|
|
23
|
+
import pe from "@tiptap/extension-font-family";
|
|
24
|
+
import { PluginKey as f, Plugin as ge } from "@tiptap/pm/state";
|
|
25
|
+
import _e from "@tiptap/suggestion";
|
|
23
26
|
import { emojiPattern as M } from "regex-combined-emojis";
|
|
24
|
-
import { n as
|
|
27
|
+
import { n as d } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
25
28
|
import O from "../emoji/emoji.js";
|
|
26
|
-
import { stringToUnicode as
|
|
27
|
-
import { emojisIndexed as
|
|
28
|
-
import
|
|
29
|
-
import
|
|
29
|
+
import { stringToUnicode as ye, codeToEmojiData as E, emojiRegex as be, emojiShortCodeRegex as we } from "../../common/emoji/index.js";
|
|
30
|
+
import { emojisIndexed as ve } from "@dialpad/dialtone-emojis";
|
|
31
|
+
import xe from "../list-item/list-item.js";
|
|
32
|
+
import v from "../stack/stack.js";
|
|
30
33
|
import x from "tippy.js";
|
|
31
|
-
import { linkRegex as
|
|
32
|
-
import
|
|
34
|
+
import { linkRegex as ke, getPhoneNumberRegex as Ce, warnIfUnmounted as Se } from "../../common/utils/index.js";
|
|
35
|
+
import Re from "@tiptap/extension-image";
|
|
33
36
|
import $ from "@tiptap/extension-mention";
|
|
34
37
|
import B from "../link/link.js";
|
|
35
|
-
import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
const
|
|
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";
|
|
39
|
+
import $e from "../avatar/avatar.js";
|
|
40
|
+
import Le from "@dialpad/dialtone-icons/vue2/hash";
|
|
41
|
+
import Ie from "@dialpad/dialtone-icons/vue2/lock";
|
|
42
|
+
import Ae from "deep-equal";
|
|
43
|
+
import je from "../button/button.js";
|
|
44
|
+
const Me = {
|
|
42
45
|
name: "EmojiComponent",
|
|
43
46
|
components: {
|
|
44
47
|
NodeViewWrapper: _,
|
|
@@ -46,18 +49,18 @@ const Ie = {
|
|
|
46
49
|
},
|
|
47
50
|
props: y
|
|
48
51
|
};
|
|
49
|
-
var
|
|
52
|
+
var Oe = function() {
|
|
50
53
|
var t = this, r = t._self._c;
|
|
51
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);
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
}, Be = [], Pe = /* @__PURE__ */ d(
|
|
56
|
+
Me,
|
|
57
|
+
Oe,
|
|
58
|
+
Be
|
|
56
59
|
);
|
|
57
|
-
const
|
|
60
|
+
const De = Pe.exports, He = {
|
|
58
61
|
name: "SuggestionList",
|
|
59
62
|
components: {
|
|
60
|
-
DtListItem:
|
|
63
|
+
DtListItem: xe
|
|
61
64
|
},
|
|
62
65
|
props: {
|
|
63
66
|
items: {
|
|
@@ -127,7 +130,7 @@ const Oe = Me.exports, Be = {
|
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
132
|
};
|
|
130
|
-
var
|
|
133
|
+
var Fe = function() {
|
|
131
134
|
var t = this, r = t._self._c;
|
|
132
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) {
|
|
133
136
|
return r("dt-list-item", { key: n.id, class: [
|
|
@@ -139,16 +142,16 @@ var Pe = function() {
|
|
|
139
142
|
return s.preventDefault(), t.onKeyDown.apply(null, arguments);
|
|
140
143
|
} } }, [r(t.itemComponent, { tag: "component", attrs: { item: n } })], 1);
|
|
141
144
|
}), 1)]);
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
}, qe = [], Ke = /* @__PURE__ */ d(
|
|
146
|
+
He,
|
|
147
|
+
Fe,
|
|
148
|
+
qe
|
|
146
149
|
);
|
|
147
|
-
const k =
|
|
150
|
+
const k = Ke.exports, Ue = {
|
|
148
151
|
name: "EmojiSuggestion",
|
|
149
152
|
components: {
|
|
150
153
|
DtEmoji: O,
|
|
151
|
-
DtStack:
|
|
154
|
+
DtStack: v
|
|
152
155
|
},
|
|
153
156
|
props: {
|
|
154
157
|
item: {
|
|
@@ -157,15 +160,15 @@ const k = He.exports, qe = {
|
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
162
|
};
|
|
160
|
-
var
|
|
163
|
+
var Ne = function() {
|
|
161
164
|
var t = this, r = t._self._c;
|
|
162
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);
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
}, Ve = [], ze = /* @__PURE__ */ d(
|
|
167
|
+
Ue,
|
|
168
|
+
Ne,
|
|
169
|
+
Ve
|
|
167
170
|
);
|
|
168
|
-
const
|
|
171
|
+
const We = ze.exports, C = {
|
|
169
172
|
name: "hideOnEsc",
|
|
170
173
|
defaultValue: !0,
|
|
171
174
|
fn({ hide: e }) {
|
|
@@ -181,18 +184,18 @@ const Ne = Fe.exports, C = {
|
|
|
181
184
|
}
|
|
182
185
|
};
|
|
183
186
|
}
|
|
184
|
-
},
|
|
187
|
+
}, Xe = 20, Je = {
|
|
185
188
|
items: ({ query: e }) => {
|
|
186
189
|
if (e.length < 2)
|
|
187
190
|
return [];
|
|
188
|
-
const t = Object.values(
|
|
191
|
+
const t = Object.values(ve);
|
|
189
192
|
return e = e.toLowerCase(), t.filter(
|
|
190
193
|
(n) => [
|
|
191
194
|
n.name,
|
|
192
195
|
n.shortname.replaceAll(":", ""),
|
|
193
196
|
...n.keywords
|
|
194
197
|
].some((i) => i.startsWith(e))
|
|
195
|
-
).splice(0,
|
|
198
|
+
).splice(0, Xe).map((n) => ({ code: n.shortname }));
|
|
196
199
|
},
|
|
197
200
|
command: ({ editor: e, range: t, props: r }) => {
|
|
198
201
|
var s, o;
|
|
@@ -211,7 +214,7 @@ const Ne = Fe.exports, C = {
|
|
|
211
214
|
e = new b(k, {
|
|
212
215
|
parent: void 0,
|
|
213
216
|
propsData: {
|
|
214
|
-
itemComponent:
|
|
217
|
+
itemComponent: We,
|
|
215
218
|
itemType: "emoji",
|
|
216
219
|
...n
|
|
217
220
|
},
|
|
@@ -249,14 +252,14 @@ const Ne = Fe.exports, C = {
|
|
|
249
252
|
}
|
|
250
253
|
};
|
|
251
254
|
}
|
|
252
|
-
},
|
|
255
|
+
}, Ye = /(:\w+:)$/, Ge = new RegExp(M + "$"), Qe = (e) => {
|
|
253
256
|
if (e && E(e[0]))
|
|
254
257
|
return { text: e[2] || e[0] };
|
|
255
|
-
},
|
|
258
|
+
}, Ze = (e) => [...e.matchAll(we)].filter((r) => E(r[0])).map((r) => ({
|
|
256
259
|
index: r.index,
|
|
257
260
|
text: r[0],
|
|
258
261
|
match: r
|
|
259
|
-
})),
|
|
262
|
+
})), et = q.create({
|
|
260
263
|
name: "emoji",
|
|
261
264
|
addOptions() {
|
|
262
265
|
return {
|
|
@@ -268,7 +271,7 @@ const Ne = Fe.exports, C = {
|
|
|
268
271
|
selectable: !1,
|
|
269
272
|
atom: !0,
|
|
270
273
|
addNodeView() {
|
|
271
|
-
return
|
|
274
|
+
return w(De);
|
|
272
275
|
},
|
|
273
276
|
addAttributes() {
|
|
274
277
|
return {
|
|
@@ -285,22 +288,22 @@ const Ne = Fe.exports, C = {
|
|
|
285
288
|
];
|
|
286
289
|
},
|
|
287
290
|
renderText({ node: e }) {
|
|
288
|
-
return
|
|
291
|
+
return ye(E(e.attrs.code).unicode_output);
|
|
289
292
|
},
|
|
290
293
|
renderHTML({ HTMLAttributes: e }) {
|
|
291
294
|
return ["emoji-component", m(this.options.HTMLAttributes, e)];
|
|
292
295
|
},
|
|
293
296
|
addInputRules() {
|
|
294
297
|
return [
|
|
295
|
-
new
|
|
298
|
+
new K({
|
|
296
299
|
find: (e) => {
|
|
297
|
-
const t = e.match(
|
|
300
|
+
const t = e.match(Ye) || e.match(Ge);
|
|
298
301
|
if (t)
|
|
299
|
-
return
|
|
302
|
+
return Qe(t);
|
|
300
303
|
},
|
|
301
304
|
handler: ({ state: e, range: t, match: r, commands: n, chain: i, can: s }) => {
|
|
302
|
-
const { tr: o } = e, a = t.from,
|
|
303
|
-
o.replaceWith(a,
|
|
305
|
+
const { tr: o } = e, a = t.from, l = t.to;
|
|
306
|
+
o.replaceWith(a, l, this.type.create({ code: r[0] }));
|
|
304
307
|
}
|
|
305
308
|
})
|
|
306
309
|
];
|
|
@@ -308,7 +311,7 @@ const Ne = Fe.exports, C = {
|
|
|
308
311
|
addPasteRules() {
|
|
309
312
|
return [
|
|
310
313
|
R({
|
|
311
|
-
find:
|
|
314
|
+
find: Ze,
|
|
312
315
|
type: this.type,
|
|
313
316
|
getAttributes(e) {
|
|
314
317
|
return {
|
|
@@ -317,7 +320,7 @@ const Ne = Fe.exports, C = {
|
|
|
317
320
|
}
|
|
318
321
|
}),
|
|
319
322
|
R({
|
|
320
|
-
find:
|
|
323
|
+
find: be,
|
|
321
324
|
type: this.type,
|
|
322
325
|
getAttributes(e) {
|
|
323
326
|
return {
|
|
@@ -329,12 +332,12 @@ const Ne = Fe.exports, C = {
|
|
|
329
332
|
},
|
|
330
333
|
addProseMirrorPlugins() {
|
|
331
334
|
return [
|
|
332
|
-
|
|
335
|
+
_e({
|
|
333
336
|
char: ":",
|
|
334
337
|
pluginKey: new f("emoji"),
|
|
335
338
|
editor: this.editor,
|
|
336
339
|
...this.options.suggestion,
|
|
337
|
-
...
|
|
340
|
+
...Je
|
|
338
341
|
})
|
|
339
342
|
];
|
|
340
343
|
},
|
|
@@ -351,7 +354,7 @@ const Ne = Fe.exports, C = {
|
|
|
351
354
|
};
|
|
352
355
|
}
|
|
353
356
|
});
|
|
354
|
-
function
|
|
357
|
+
function tt(e, t, r = () => !0) {
|
|
355
358
|
const n = [];
|
|
356
359
|
t.lastIndex = 0;
|
|
357
360
|
let i;
|
|
@@ -359,10 +362,10 @@ function Qe(e, t, r = () => !0) {
|
|
|
359
362
|
r(e, i) && n.push(i);
|
|
360
363
|
return n;
|
|
361
364
|
}
|
|
362
|
-
function
|
|
365
|
+
function nt(e, t) {
|
|
363
366
|
return !["#", "@"].includes(e.charAt(t.index)) && !["#", "@"].includes(e.charAt(t.index - 1));
|
|
364
367
|
}
|
|
365
|
-
function
|
|
368
|
+
function rt(e) {
|
|
366
369
|
const t = new RegExp(
|
|
367
370
|
"(?:" + [
|
|
368
371
|
`[!?.,:;'"]`,
|
|
@@ -372,7 +375,7 @@ function et(e) {
|
|
|
372
375
|
);
|
|
373
376
|
return e.replace(t, "");
|
|
374
377
|
}
|
|
375
|
-
function
|
|
378
|
+
function it(e, t) {
|
|
376
379
|
const r = e.slice(0, t + 1).search(/\S+\s*$/), n = e.slice(t).search(/\s/);
|
|
377
380
|
if (n < 0) {
|
|
378
381
|
const i = e.slice(r);
|
|
@@ -389,24 +392,24 @@ function tt(e, t) {
|
|
|
389
392
|
};
|
|
390
393
|
}
|
|
391
394
|
function T(e, t, r, n) {
|
|
392
|
-
const i =
|
|
395
|
+
const i = it(e, t);
|
|
393
396
|
if (n.lastIndex = 0, !n.test(i.text))
|
|
394
397
|
return i;
|
|
395
398
|
const s = r === "left" ? i.from - 1 : i.to + 1;
|
|
396
399
|
return s <= 0 || s >= e.length || s === t ? i : T(e, s, r, n);
|
|
397
400
|
}
|
|
398
|
-
function
|
|
399
|
-
const i = Math.max(e.from - 1, 0), s = Math.min(e.to + 1, t.content.size), o =
|
|
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);
|
|
400
403
|
for (const a of o)
|
|
401
404
|
a.mark.type === n && r.removeMark(a.from, a.to, n);
|
|
402
405
|
}
|
|
403
|
-
const I =
|
|
406
|
+
const I = Ce(1, 15);
|
|
404
407
|
function A(e, t, r, n, i, s) {
|
|
405
408
|
if (!e)
|
|
406
409
|
return;
|
|
407
410
|
let o = r - t - 1;
|
|
408
411
|
o = o < 0 ? 0 : o;
|
|
409
|
-
const a = n - t,
|
|
412
|
+
const a = n - t, l = T(
|
|
410
413
|
e,
|
|
411
414
|
o,
|
|
412
415
|
"left",
|
|
@@ -416,15 +419,15 @@ function A(e, t, r, n, i, s) {
|
|
|
416
419
|
a,
|
|
417
420
|
"right",
|
|
418
421
|
I
|
|
419
|
-
), u = e.slice(
|
|
420
|
-
|
|
421
|
-
const h =
|
|
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, P = g + h.length;
|
|
422
425
|
i.addMark(g, P, s.create());
|
|
423
426
|
});
|
|
424
427
|
}
|
|
425
|
-
function
|
|
428
|
+
function st(e) {
|
|
426
429
|
let t = !1;
|
|
427
|
-
return new
|
|
430
|
+
return new ge({
|
|
428
431
|
key: new f("autolink"),
|
|
429
432
|
appendTransaction: (r, n, i) => {
|
|
430
433
|
const s = r.some((u) => u.docChanged) && !n.doc.eq(i.doc);
|
|
@@ -432,12 +435,12 @@ function rt(e) {
|
|
|
432
435
|
return;
|
|
433
436
|
const { tr: o } = i, { textContent: a } = i.doc;
|
|
434
437
|
t || A(a, 0, 0, a.length, o, e.type), t = !0;
|
|
435
|
-
const
|
|
438
|
+
const l = N(
|
|
436
439
|
n.doc,
|
|
437
440
|
[...r]
|
|
438
441
|
);
|
|
439
|
-
return V(
|
|
440
|
-
|
|
442
|
+
return V(l).forEach(({ oldRange: u, newRange: p }) => {
|
|
443
|
+
ot(p, i.doc, o, e.type), z(
|
|
441
444
|
i.doc,
|
|
442
445
|
p,
|
|
443
446
|
(h) => h.isTextblock
|
|
@@ -455,10 +458,10 @@ function rt(e) {
|
|
|
455
458
|
}
|
|
456
459
|
});
|
|
457
460
|
}
|
|
458
|
-
const
|
|
461
|
+
const at = {
|
|
459
462
|
class: "d-link d-c-text d-d-inline-block d-wb-break-all",
|
|
460
463
|
rel: "noopener noreferrer nofollow"
|
|
461
|
-
},
|
|
464
|
+
}, lt = W.create({
|
|
462
465
|
name: "CustomLink",
|
|
463
466
|
renderHTML({ HTMLAttributes: e }) {
|
|
464
467
|
return [
|
|
@@ -466,7 +469,7 @@ const it = {
|
|
|
466
469
|
m(
|
|
467
470
|
this.options.HTMLAttributes,
|
|
468
471
|
e,
|
|
469
|
-
|
|
472
|
+
at
|
|
470
473
|
)
|
|
471
474
|
];
|
|
472
475
|
},
|
|
@@ -475,10 +478,10 @@ const it = {
|
|
|
475
478
|
},
|
|
476
479
|
addProseMirrorPlugins() {
|
|
477
480
|
return [
|
|
478
|
-
|
|
481
|
+
st({ type: this.type })
|
|
479
482
|
];
|
|
480
483
|
}
|
|
481
|
-
}),
|
|
484
|
+
}), dt = Re.extend({
|
|
482
485
|
name: "ConfigurableImage",
|
|
483
486
|
addAttributes() {
|
|
484
487
|
return {
|
|
@@ -502,14 +505,14 @@ const it = {
|
|
|
502
505
|
}
|
|
503
506
|
};
|
|
504
507
|
}
|
|
505
|
-
}).configure({ inline: !0, allowBase64: !0 }),
|
|
508
|
+
}).configure({ inline: !0, allowBase64: !0 }), ct = j.extend({
|
|
506
509
|
parseHTML() {
|
|
507
510
|
return [{ tag: "div" }];
|
|
508
511
|
},
|
|
509
512
|
renderHTML({ HTMLAttributes: e }) {
|
|
510
513
|
return ["div", m(this.options.HTMLAttributes, e), 0];
|
|
511
514
|
}
|
|
512
|
-
}),
|
|
515
|
+
}), ut = {
|
|
513
516
|
name: "MentionComponent",
|
|
514
517
|
components: {
|
|
515
518
|
NodeViewWrapper: _,
|
|
@@ -522,17 +525,17 @@ const it = {
|
|
|
522
525
|
}
|
|
523
526
|
}
|
|
524
527
|
};
|
|
525
|
-
var
|
|
528
|
+
var mt = function() {
|
|
526
529
|
var t = this, r = t._self._c;
|
|
527
530
|
return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
531
|
+
}, ht = [], ft = /* @__PURE__ */ d(
|
|
532
|
+
ut,
|
|
533
|
+
mt,
|
|
534
|
+
ht
|
|
532
535
|
);
|
|
533
|
-
const
|
|
536
|
+
const pt = ft.exports, gt = $.extend({
|
|
534
537
|
addNodeView() {
|
|
535
|
-
return
|
|
538
|
+
return w(pt);
|
|
536
539
|
},
|
|
537
540
|
parseHTML() {
|
|
538
541
|
return [
|
|
@@ -565,7 +568,7 @@ const mt = ut.exports, ht = $.extend({
|
|
|
565
568
|
char: "@",
|
|
566
569
|
pluginKey: new f("mentionSuggestion")
|
|
567
570
|
}
|
|
568
|
-
}),
|
|
571
|
+
}), _t = {
|
|
569
572
|
name: "ChannelComponent",
|
|
570
573
|
components: {
|
|
571
574
|
NodeViewWrapper: _,
|
|
@@ -578,18 +581,18 @@ const mt = ut.exports, ht = $.extend({
|
|
|
578
581
|
}
|
|
579
582
|
}
|
|
580
583
|
};
|
|
581
|
-
var
|
|
584
|
+
var yt = function() {
|
|
582
585
|
var t = this, r = t._self._c;
|
|
583
586
|
return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [r("dt-link", { attrs: { kind: "mention" } }, [t._v(" " + t._s(t.text) + " ")])], 1);
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
587
|
+
}, bt = [], wt = /* @__PURE__ */ d(
|
|
588
|
+
_t,
|
|
589
|
+
yt,
|
|
590
|
+
bt
|
|
588
591
|
);
|
|
589
|
-
const
|
|
592
|
+
const vt = wt.exports, xt = $.extend({
|
|
590
593
|
name: "channel",
|
|
591
594
|
addNodeView() {
|
|
592
|
-
return
|
|
595
|
+
return w(vt);
|
|
593
596
|
},
|
|
594
597
|
parseHTML() {
|
|
595
598
|
return [
|
|
@@ -622,7 +625,7 @@ const yt = _t.exports, bt = $.extend({
|
|
|
622
625
|
char: "#",
|
|
623
626
|
pluginKey: new f("channelSuggestion")
|
|
624
627
|
}
|
|
625
|
-
}),
|
|
628
|
+
}), kt = {
|
|
626
629
|
name: "SlashCommandsComponent",
|
|
627
630
|
components: {
|
|
628
631
|
NodeViewWrapper: _
|
|
@@ -638,27 +641,27 @@ const yt = _t.exports, bt = $.extend({
|
|
|
638
641
|
this.$parent.$emit("selected-command", this.$props.node.attrs.command);
|
|
639
642
|
}
|
|
640
643
|
};
|
|
641
|
-
var
|
|
644
|
+
var Ct = function() {
|
|
642
645
|
var t = this, r = t._self._c;
|
|
643
646
|
return r("node-view-wrapper", { staticClass: "d-d-inline-block" }, [t._v(" " + t._s(t.text) + " ")]);
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
647
|
+
}, St = [], Rt = /* @__PURE__ */ d(
|
|
648
|
+
kt,
|
|
649
|
+
Ct,
|
|
650
|
+
St
|
|
648
651
|
);
|
|
649
|
-
const
|
|
652
|
+
const Tt = Rt.exports, Et = (e, t) => [...e.matchAll(t)].map((n) => {
|
|
650
653
|
let i = n[2];
|
|
651
654
|
return i.endsWith(" ") || (i += " "), {
|
|
652
655
|
index: n.index,
|
|
653
656
|
text: i,
|
|
654
657
|
match: n
|
|
655
658
|
};
|
|
656
|
-
}),
|
|
659
|
+
}), $t = $.extend({
|
|
657
660
|
name: "slash-commands",
|
|
658
661
|
group: "inline",
|
|
659
662
|
inline: !0,
|
|
660
663
|
addNodeView() {
|
|
661
|
-
return
|
|
664
|
+
return w(Tt);
|
|
662
665
|
},
|
|
663
666
|
parseHTML() {
|
|
664
667
|
return [
|
|
@@ -704,7 +707,7 @@ const Ct = kt.exports, St = (e, t) => [...e.matchAll(t)].map((n) => {
|
|
|
704
707
|
const e = (r = this.options.suggestion) == null ? void 0 : r.items({ query: "" }).map((n) => n.command), t = new RegExp(`^((?:\\/)(${e.join("|")})) ?$`, "g");
|
|
705
708
|
return [
|
|
706
709
|
R({
|
|
707
|
-
find: (n) =>
|
|
710
|
+
find: (n) => Et(n, t),
|
|
708
711
|
type: this.type,
|
|
709
712
|
getAttributes(n) {
|
|
710
713
|
return { command: n[0].trim() };
|
|
@@ -717,11 +720,11 @@ const Ct = kt.exports, St = (e, t) => [...e.matchAll(t)].map((n) => {
|
|
|
717
720
|
char: "/",
|
|
718
721
|
pluginKey: new f("slashCommandSuggestion")
|
|
719
722
|
}
|
|
720
|
-
}),
|
|
723
|
+
}), Lt = {
|
|
721
724
|
name: "MentionSuggestion",
|
|
722
725
|
components: {
|
|
723
|
-
DtAvatar:
|
|
724
|
-
DtStack:
|
|
726
|
+
DtAvatar: $e,
|
|
727
|
+
DtStack: v
|
|
725
728
|
},
|
|
726
729
|
props: {
|
|
727
730
|
item: {
|
|
@@ -738,15 +741,15 @@ const Ct = kt.exports, St = (e, t) => [...e.matchAll(t)].map((n) => {
|
|
|
738
741
|
}
|
|
739
742
|
}
|
|
740
743
|
};
|
|
741
|
-
var
|
|
744
|
+
var It = function() {
|
|
742
745
|
var t = this, r = t._self._c;
|
|
743
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);
|
|
744
|
-
},
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
747
|
+
}, At = [], jt = /* @__PURE__ */ d(
|
|
748
|
+
Lt,
|
|
749
|
+
It,
|
|
750
|
+
At
|
|
748
751
|
);
|
|
749
|
-
const
|
|
752
|
+
const Mt = jt.exports, Ot = {
|
|
750
753
|
// This function comes from the user and passed to the editor directly.
|
|
751
754
|
// This will also activate the mention plugin on the editor
|
|
752
755
|
// items: ({ query }) => { return [] },
|
|
@@ -758,7 +761,7 @@ const It = Lt.exports, At = {
|
|
|
758
761
|
e = new b(k, {
|
|
759
762
|
parent: void 0,
|
|
760
763
|
propsData: {
|
|
761
|
-
itemComponent:
|
|
764
|
+
itemComponent: Mt,
|
|
762
765
|
itemType: "mention",
|
|
763
766
|
...n
|
|
764
767
|
},
|
|
@@ -796,12 +799,12 @@ const It = Lt.exports, At = {
|
|
|
796
799
|
}
|
|
797
800
|
};
|
|
798
801
|
}
|
|
799
|
-
},
|
|
802
|
+
}, Bt = {
|
|
800
803
|
name: "ChannelSuggestion",
|
|
801
804
|
components: {
|
|
802
|
-
DtStack:
|
|
803
|
-
DtIconHash:
|
|
804
|
-
DtIconLock:
|
|
805
|
+
DtStack: v,
|
|
806
|
+
DtIconHash: Le,
|
|
807
|
+
DtIconLock: Ie
|
|
805
808
|
},
|
|
806
809
|
props: {
|
|
807
810
|
item: {
|
|
@@ -815,15 +818,15 @@ const It = Lt.exports, At = {
|
|
|
815
818
|
}
|
|
816
819
|
}
|
|
817
820
|
};
|
|
818
|
-
var
|
|
821
|
+
var Pt = function() {
|
|
819
822
|
var t = this, r = t._self._c;
|
|
820
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);
|
|
821
|
-
},
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
824
|
+
}, Dt = [], Ht = /* @__PURE__ */ d(
|
|
825
|
+
Bt,
|
|
826
|
+
Pt,
|
|
827
|
+
Dt
|
|
825
828
|
);
|
|
826
|
-
const
|
|
829
|
+
const Ft = Ht.exports, qt = {
|
|
827
830
|
// This function comes from the user and passed to the editor directly.
|
|
828
831
|
// This will also activate the mention plugin on the editor
|
|
829
832
|
// items: ({ query }) => { return [] },
|
|
@@ -835,7 +838,7 @@ const Pt = Bt.exports, Dt = {
|
|
|
835
838
|
e = new b(k, {
|
|
836
839
|
parent: void 0,
|
|
837
840
|
propsData: {
|
|
838
|
-
itemComponent:
|
|
841
|
+
itemComponent: Ft,
|
|
839
842
|
itemType: "channel",
|
|
840
843
|
...n
|
|
841
844
|
},
|
|
@@ -873,7 +876,7 @@ const Pt = Bt.exports, Dt = {
|
|
|
873
876
|
}
|
|
874
877
|
};
|
|
875
878
|
}
|
|
876
|
-
},
|
|
879
|
+
}, Kt = {
|
|
877
880
|
name: "SlashCommandSuggestion",
|
|
878
881
|
props: {
|
|
879
882
|
item: {
|
|
@@ -893,15 +896,15 @@ const Pt = Bt.exports, Dt = {
|
|
|
893
896
|
}
|
|
894
897
|
}
|
|
895
898
|
};
|
|
896
|
-
var
|
|
899
|
+
var Ut = function() {
|
|
897
900
|
var t = this, r = t._self._c;
|
|
898
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) + " ")])]);
|
|
899
|
-
},
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
902
|
+
}, Nt = [], Vt = /* @__PURE__ */ d(
|
|
903
|
+
Kt,
|
|
904
|
+
Ut,
|
|
905
|
+
Nt
|
|
903
906
|
);
|
|
904
|
-
const
|
|
907
|
+
const zt = Vt.exports, Wt = {
|
|
905
908
|
// This function comes from the user and passed to the editor directly.
|
|
906
909
|
// This will also activate the mention plugin on the editor
|
|
907
910
|
// items: ({ query }) => { return [] },
|
|
@@ -914,7 +917,7 @@ const Ft = Ut.exports, Nt = {
|
|
|
914
917
|
e = new b(k, {
|
|
915
918
|
parent: void 0,
|
|
916
919
|
propsData: {
|
|
917
|
-
itemComponent:
|
|
920
|
+
itemComponent: zt,
|
|
918
921
|
itemType: "slash-command",
|
|
919
922
|
...n
|
|
920
923
|
},
|
|
@@ -952,13 +955,13 @@ const Ft = Ut.exports, Nt = {
|
|
|
952
955
|
}
|
|
953
956
|
};
|
|
954
957
|
}
|
|
955
|
-
},
|
|
958
|
+
}, Xt = {
|
|
956
959
|
name: "DtRichTextEditor",
|
|
957
960
|
components: {
|
|
958
961
|
EditorContent: D,
|
|
959
962
|
BubbleMenu: H,
|
|
960
|
-
DtButton:
|
|
961
|
-
DtStack:
|
|
963
|
+
DtButton: je,
|
|
964
|
+
DtStack: v
|
|
962
965
|
},
|
|
963
966
|
props: {
|
|
964
967
|
/**
|
|
@@ -1022,7 +1025,7 @@ const Ft = Ut.exports, Nt = {
|
|
|
1022
1025
|
type: [Boolean, String, Number],
|
|
1023
1026
|
default: !1,
|
|
1024
1027
|
validator(e) {
|
|
1025
|
-
return typeof e == "string" ?
|
|
1028
|
+
return typeof e == "string" ? Te.includes(e) : !0;
|
|
1026
1029
|
}
|
|
1027
1030
|
},
|
|
1028
1031
|
/**
|
|
@@ -1035,7 +1038,7 @@ const Ft = Ut.exports, Nt = {
|
|
|
1035
1038
|
type: String,
|
|
1036
1039
|
default: "html",
|
|
1037
1040
|
validator(e) {
|
|
1038
|
-
return
|
|
1041
|
+
return Ee.includes(e);
|
|
1039
1042
|
}
|
|
1040
1043
|
},
|
|
1041
1044
|
/**
|
|
@@ -1180,6 +1183,20 @@ const Ft = Ut.exports, Nt = {
|
|
|
1180
1183
|
type: Boolean,
|
|
1181
1184
|
default: !1
|
|
1182
1185
|
},
|
|
1186
|
+
/**
|
|
1187
|
+
* Whether the input allows color to be introduced in the text.
|
|
1188
|
+
*/
|
|
1189
|
+
allowFontColor: {
|
|
1190
|
+
type: Boolean,
|
|
1191
|
+
default: !1
|
|
1192
|
+
},
|
|
1193
|
+
/**
|
|
1194
|
+
* Whether the input allows different font-families to be introduced in the text.
|
|
1195
|
+
*/
|
|
1196
|
+
allowFontFamily: {
|
|
1197
|
+
type: Boolean,
|
|
1198
|
+
default: !1
|
|
1199
|
+
},
|
|
1183
1200
|
/**
|
|
1184
1201
|
* Additional TipTap extensions to be added to the editor.
|
|
1185
1202
|
*/
|
|
@@ -1295,11 +1312,11 @@ const Ft = Ut.exports, Nt = {
|
|
|
1295
1312
|
// eslint-disable-next-line complexity
|
|
1296
1313
|
extensions() {
|
|
1297
1314
|
const e = [Z, ce, me, te];
|
|
1298
|
-
e.push(this.useDivTags ?
|
|
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({
|
|
1299
1316
|
renderText({ node: n }) {
|
|
1300
1317
|
return n.textContent;
|
|
1301
1318
|
}
|
|
1302
|
-
})), e.push(ae)), this.allowItalic && e.push(ie), this.allowStrike && e.push(
|
|
1319
|
+
})), e.push(ae)), this.allowItalic && e.push(ie), this.allowStrike && e.push(le), this.allowUnderline && e.push(de), this.placeholder && e.push(
|
|
1303
1320
|
ee.configure({ placeholder: this.placeholder })
|
|
1304
1321
|
);
|
|
1305
1322
|
const t = this, r = J.create({
|
|
@@ -1323,19 +1340,19 @@ const Ft = Ut.exports, Nt = {
|
|
|
1323
1340
|
openOnClick: !1,
|
|
1324
1341
|
autolink: !0,
|
|
1325
1342
|
protocols: L
|
|
1326
|
-
})), this.customLink && e.push(this.getExtension(
|
|
1327
|
-
const n = { ...this.mentionSuggestion, ...
|
|
1328
|
-
e.push(
|
|
1343
|
+
})), this.customLink && e.push(this.getExtension(lt, this.customLink)), this.mentionSuggestion) {
|
|
1344
|
+
const n = { ...this.mentionSuggestion, ...Ot };
|
|
1345
|
+
e.push(gt.configure({ suggestion: n }));
|
|
1329
1346
|
}
|
|
1330
1347
|
if (this.channelSuggestion) {
|
|
1331
|
-
const n = { ...this.channelSuggestion, ...
|
|
1332
|
-
e.push(
|
|
1348
|
+
const n = { ...this.channelSuggestion, ...qt };
|
|
1349
|
+
e.push(xt.configure({ suggestion: n }));
|
|
1333
1350
|
}
|
|
1334
1351
|
if (this.slashCommandSuggestion) {
|
|
1335
|
-
const n = { ...this.slashCommandSuggestion, ...
|
|
1336
|
-
e.push(
|
|
1352
|
+
const n = { ...this.slashCommandSuggestion, ...Wt };
|
|
1353
|
+
e.push($t.configure({ suggestion: n }));
|
|
1337
1354
|
}
|
|
1338
|
-
return e.push(
|
|
1355
|
+
return e.push(et), e.push(ue.configure({
|
|
1339
1356
|
types: ["paragraph"],
|
|
1340
1357
|
defaultAlignment: "left"
|
|
1341
1358
|
})), this.allowCode && e.push(Q), this.allowCodeblock && e.push(G.extend({
|
|
@@ -1348,7 +1365,7 @@ ${n.textContent}
|
|
|
1348
1365
|
HTMLAttributes: {
|
|
1349
1366
|
class: "d-rich-text-editor__code-block"
|
|
1350
1367
|
}
|
|
1351
|
-
})), this.allowInlineImages && e.push(
|
|
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;
|
|
1352
1369
|
},
|
|
1353
1370
|
inputAttrs() {
|
|
1354
1371
|
const e = {
|
|
@@ -1388,11 +1405,11 @@ ${n.textContent}
|
|
|
1388
1405
|
this.destroyEditor();
|
|
1389
1406
|
},
|
|
1390
1407
|
mounted() {
|
|
1391
|
-
|
|
1408
|
+
Se(this.$el, this.$options.name), this.processValue(this.value, !1);
|
|
1392
1409
|
},
|
|
1393
1410
|
methods: {
|
|
1394
1411
|
createEditor() {
|
|
1395
|
-
this.editor = new
|
|
1412
|
+
this.editor = new F({
|
|
1396
1413
|
autofocus: this.autoFocus,
|
|
1397
1414
|
content: this.value,
|
|
1398
1415
|
editable: this.editable,
|
|
@@ -1432,9 +1449,9 @@ ${n.textContent}
|
|
|
1432
1449
|
* @param editor the editor instance.
|
|
1433
1450
|
*/
|
|
1434
1451
|
getSelectedLinkText(e) {
|
|
1435
|
-
var a,
|
|
1452
|
+
var a, l, c;
|
|
1436
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);
|
|
1437
|
-
return o && ((c = (
|
|
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;
|
|
1438
1455
|
},
|
|
1439
1456
|
editLink() {
|
|
1440
1457
|
const e = this.getSelectedLinkText(this.editor), t = {
|
|
@@ -1455,19 +1472,19 @@ ${n.textContent}
|
|
|
1455
1472
|
},
|
|
1456
1473
|
// eslint-disable-next-line complexity
|
|
1457
1474
|
setLink(e, t, r, n = L, i) {
|
|
1458
|
-
var a,
|
|
1475
|
+
var a, l, c;
|
|
1459
1476
|
if (!e) {
|
|
1460
1477
|
this.removeLink();
|
|
1461
1478
|
return;
|
|
1462
1479
|
}
|
|
1463
1480
|
n.find((u) => u.test(e)) || (e = `${i}${e}`), this.editor.chain().focus().extendMarkRange("link").run();
|
|
1464
|
-
const o = (c = (
|
|
1481
|
+
const o = (c = (l = (a = this.editor) == null ? void 0 : a.view) == null ? void 0 : l.state) == null ? void 0 : c.selection;
|
|
1465
1482
|
this.editor.chain().focus().insertContent(t).setTextSelection({ from: o.from, to: o.from + t.length }).setLink({ href: e, class: r.class }).run();
|
|
1466
1483
|
},
|
|
1467
1484
|
// eslint-disable-next-line complexity
|
|
1468
1485
|
processValue(e, t = !0) {
|
|
1469
1486
|
const r = this.getOutput();
|
|
1470
|
-
if (!(t &&
|
|
1487
|
+
if (!(t && Ae(e, r))) {
|
|
1471
1488
|
if (typeof e == "string" && this.outputFormat === "text") {
|
|
1472
1489
|
const n = new RegExp(`(${M})`, "g");
|
|
1473
1490
|
e = e == null ? void 0 : e.replace(n, '<emoji-component code="$1"></emoji-component>');
|
|
@@ -1543,16 +1560,16 @@ ${n.textContent}
|
|
|
1543
1560
|
}
|
|
1544
1561
|
}
|
|
1545
1562
|
};
|
|
1546
|
-
var
|
|
1563
|
+
var Jt = function() {
|
|
1547
1564
|
var t = this, r = t._self._c;
|
|
1548
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);
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1566
|
+
}, Yt = [], Gt = /* @__PURE__ */ d(
|
|
1567
|
+
Xt,
|
|
1568
|
+
Jt,
|
|
1569
|
+
Yt
|
|
1553
1570
|
);
|
|
1554
|
-
const
|
|
1571
|
+
const Kn = Gt.exports;
|
|
1555
1572
|
export {
|
|
1556
|
-
|
|
1573
|
+
Kn as default
|
|
1557
1574
|
};
|
|
1558
1575
|
//# sourceMappingURL=rich-text-editor.js.map
|