@editora/core 1.0.9 → 1.0.11
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/README.md +1 -1
- package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
- package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
- package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
- package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
- package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
- package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
- package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
- package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-veDC_kx5.mjs +4600 -0
- package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
- package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
- package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
- package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
- package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
- package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
- package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
- package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
- package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
- package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
- package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
- package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
- package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
- package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
- package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
- package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
- package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
- package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
- package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
- package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
- package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
- package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
- package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
- package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
- package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
- package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
- package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
- package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
- package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
- package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
- package/dist/core.css +1 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
- package/dist/editora.min.js +13 -14
- package/dist/editora.umd.js +13 -14
- package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-BYD2KEo6.mjs +6666 -0
- package/dist/index.esm.js +7 -12
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
- package/dist/plugin-loader.js +67 -67
- package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
- package/dist/webcomponent-core.js +131 -168
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +147 -65
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +191 -228
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1248 -1346
- package/package.json +1 -1
- package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
- package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
- package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
- package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
- package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
- package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
- package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
- package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
- package/dist/MathPlugin.native-735bbac2.mjs +0 -296
- package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
- package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
- package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
- package/dist/documentManager-8327fb6e.mjs +0 -9166
- package/dist/index-072ef022.js +0 -11
- package/dist/index-49d31221.mjs +0 -16860
- package/dist/index.es-b47a189f.mjs +0 -5782
- package/dist/style.css +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const p = ".rte-content, .editora-content", ie = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", w = '.rte-mention[data-mention="true"]', b = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', R = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap();
|
|
2
2
|
let F = !1, S = !1, T = null, k = 0;
|
|
3
3
|
function X(e, n) {
|
|
4
|
-
if (n === e.innerHTML)
|
|
5
|
-
return;
|
|
4
|
+
if (n === e.innerHTML) return;
|
|
6
5
|
const o = window.execEditorCommand || window.executeEditorCommand;
|
|
7
6
|
if (typeof o == "function")
|
|
8
7
|
try {
|
|
@@ -22,8 +21,7 @@ function A(e, n) {
|
|
|
22
21
|
}
|
|
23
22
|
function E(e) {
|
|
24
23
|
const n = window.getSelection();
|
|
25
|
-
if (!n || n.rangeCount === 0)
|
|
26
|
-
return null;
|
|
24
|
+
if (!n || n.rangeCount === 0) return null;
|
|
27
25
|
const o = n.getRangeAt(0);
|
|
28
26
|
return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
|
|
29
27
|
}
|
|
@@ -43,8 +41,7 @@ function L(e) {
|
|
|
43
41
|
}
|
|
44
42
|
function le(e) {
|
|
45
43
|
const n = ae(e);
|
|
46
|
-
if (L(n))
|
|
47
|
-
return !0;
|
|
44
|
+
if (L(n)) return !0;
|
|
48
45
|
const o = n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
49
46
|
return L(o) ? !0 : L(document.documentElement) || L(document.body);
|
|
50
47
|
}
|
|
@@ -52,29 +49,23 @@ function Z(e, n) {
|
|
|
52
49
|
e.classList.remove("rte-mention-theme-dark"), le(n) && e.classList.add("rte-mention-theme-dark");
|
|
53
50
|
}
|
|
54
51
|
function se(e) {
|
|
55
|
-
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
56
|
-
return e.contentElement;
|
|
52
|
+
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
|
|
57
53
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
58
54
|
const t = e.editorElement;
|
|
59
|
-
if (t.matches(p))
|
|
60
|
-
return t;
|
|
55
|
+
if (t.matches(p)) return t;
|
|
61
56
|
const r = t.querySelector(p);
|
|
62
|
-
if (r instanceof HTMLElement)
|
|
63
|
-
return r;
|
|
57
|
+
if (r instanceof HTMLElement) return r;
|
|
64
58
|
}
|
|
65
59
|
const n = window.getSelection();
|
|
66
60
|
if (n && n.rangeCount > 0) {
|
|
67
61
|
const t = n.getRangeAt(0).startContainer, r = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, i = r == null ? void 0 : r.closest(p);
|
|
68
|
-
if (i)
|
|
69
|
-
return i;
|
|
62
|
+
if (i) return i;
|
|
70
63
|
}
|
|
71
64
|
const o = document.activeElement;
|
|
72
65
|
if (o) {
|
|
73
|
-
if (o.matches(p))
|
|
74
|
-
return o;
|
|
66
|
+
if (o.matches(p)) return o;
|
|
75
67
|
const t = o.closest(p);
|
|
76
|
-
if (t)
|
|
77
|
-
return t;
|
|
68
|
+
if (t) return t;
|
|
78
69
|
}
|
|
79
70
|
return document.querySelector(p);
|
|
80
71
|
}
|
|
@@ -94,8 +85,7 @@ function ue(e) {
|
|
|
94
85
|
return e ? /\s|[([{"'`]/.test(e) : !0;
|
|
95
86
|
}
|
|
96
87
|
function de(e) {
|
|
97
|
-
if (!e.collapsed)
|
|
98
|
-
return null;
|
|
88
|
+
if (!e.collapsed) return null;
|
|
99
89
|
const n = e.startContainer, o = e.startOffset;
|
|
100
90
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
101
91
|
const t = n;
|
|
@@ -126,8 +116,7 @@ function fe(e, n, o) {
|
|
|
126
116
|
if (n.forEach((a) => {
|
|
127
117
|
const l = e.lastIndexOf(a);
|
|
128
118
|
l > t && (t = l, r = a);
|
|
129
|
-
}), t < 0 || !ue(e[t - 1]))
|
|
130
|
-
return null;
|
|
119
|
+
}), t < 0 || !ue(e[t - 1])) return null;
|
|
131
120
|
const i = e.slice(t + 1);
|
|
132
121
|
return /\s/.test(i) || i.length > o ? null : {
|
|
133
122
|
trigger: r,
|
|
@@ -147,8 +136,7 @@ function me(e, n) {
|
|
|
147
136
|
return r.remove(), e.normalize(), i;
|
|
148
137
|
}
|
|
149
138
|
function ge(e, n) {
|
|
150
|
-
if (e.panel && e.list)
|
|
151
|
-
return;
|
|
139
|
+
if (e.panel && e.list) return;
|
|
152
140
|
const o = document.createElement("div");
|
|
153
141
|
o.className = "rte-mention-panel", o.style.display = "none";
|
|
154
142
|
const t = document.createElement("div");
|
|
@@ -156,11 +144,9 @@ function ge(e, n) {
|
|
|
156
144
|
r.preventDefault();
|
|
157
145
|
}), o.addEventListener("click", (r) => {
|
|
158
146
|
const i = r.target;
|
|
159
|
-
if (!i)
|
|
160
|
-
return;
|
|
147
|
+
if (!i) return;
|
|
161
148
|
const a = i.closest(".rte-mention-item");
|
|
162
|
-
if (!a)
|
|
163
|
-
return;
|
|
149
|
+
if (!a) return;
|
|
164
150
|
const l = Number(a.getAttribute("data-index"));
|
|
165
151
|
Number.isFinite(l) && ee(e, n, l);
|
|
166
152
|
});
|
|
@@ -169,8 +155,7 @@ function m(e) {
|
|
|
169
155
|
e.panel && (e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), e.abortController && (e.abortController.abort(), e.abortController = null), e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.loading = !1, e.items = [], e.activeIndex = 0, e.query = "", e.replaceRange = null);
|
|
170
156
|
}
|
|
171
157
|
function U(e, n) {
|
|
172
|
-
if (!e.panel)
|
|
173
|
-
return;
|
|
158
|
+
if (!e.panel) return;
|
|
174
159
|
Z(e.panel, e.editor);
|
|
175
160
|
const o = me(e.editor, n), t = e.panel;
|
|
176
161
|
t.style.display = "block", t.classList.add("show"), t.style.left = "0px", t.style.top = "0px";
|
|
@@ -179,17 +164,14 @@ function U(e, n) {
|
|
|
179
164
|
s + r.height > a - 8 && (s = Math.max(8, o.top - r.height - 8)), t.style.position = "fixed", t.style.left = `${l}px`, t.style.top = `${s}px`;
|
|
180
165
|
}
|
|
181
166
|
function pe(e, n) {
|
|
182
|
-
if (!n)
|
|
183
|
-
return x(e);
|
|
167
|
+
if (!n) return x(e);
|
|
184
168
|
const o = e.toLowerCase(), t = n.toLowerCase(), r = o.indexOf(t);
|
|
185
|
-
if (r < 0)
|
|
186
|
-
return x(e);
|
|
169
|
+
if (r < 0) return x(e);
|
|
187
170
|
const i = x(e.slice(0, r)), a = x(e.slice(r, r + n.length)), l = x(e.slice(r + n.length));
|
|
188
171
|
return `${i}<mark>${a}</mark>${l}`;
|
|
189
172
|
}
|
|
190
173
|
function W(e, n) {
|
|
191
|
-
if (!e.list)
|
|
192
|
-
return;
|
|
174
|
+
if (!e.list) return;
|
|
193
175
|
const o = e.list;
|
|
194
176
|
if (o.innerHTML = "", e.loading) {
|
|
195
177
|
const t = document.createElement("div");
|
|
@@ -258,8 +240,7 @@ function he(e, n) {
|
|
|
258
240
|
async function ye(e, n, o, t) {
|
|
259
241
|
var f, c;
|
|
260
242
|
const r = n.api;
|
|
261
|
-
if (!r)
|
|
262
|
-
return [];
|
|
243
|
+
if (!r) return [];
|
|
263
244
|
e.abortController && e.abortController.abort();
|
|
264
245
|
const i = new AbortController();
|
|
265
246
|
e.abortController = i;
|
|
@@ -288,11 +269,9 @@ async function ye(e, n, o, t) {
|
|
|
288
269
|
var _, $, B, j, z;
|
|
289
270
|
if (r.mapItem)
|
|
290
271
|
return r.mapItem(d, re);
|
|
291
|
-
if (!q(d))
|
|
292
|
-
return null;
|
|
272
|
+
if (!q(d)) return null;
|
|
293
273
|
const H = String((B = ($ = (_ = d.id) != null ? _ : d.value) != null ? $ : d.key) != null ? B : "").trim();
|
|
294
|
-
if (!H)
|
|
295
|
-
return null;
|
|
274
|
+
if (!H) return null;
|
|
296
275
|
const oe = String((z = (j = d.label) != null ? j : d.name) != null ? z : H).trim();
|
|
297
276
|
return {
|
|
298
277
|
id: H,
|
|
@@ -325,8 +304,7 @@ async function be(e, n, o, t) {
|
|
|
325
304
|
}
|
|
326
305
|
function Ee(e, n, o) {
|
|
327
306
|
const t = e.editor;
|
|
328
|
-
if (C(t), !window.getSelection())
|
|
329
|
-
return !1;
|
|
307
|
+
if (C(t), !window.getSelection()) return !1;
|
|
330
308
|
const i = t.innerHTML;
|
|
331
309
|
let a = e.replaceRange ? e.replaceRange.cloneRange() : E(t);
|
|
332
310
|
if (!a || !t.contains(a.commonAncestorContainer) && (a = E(t), !a))
|
|
@@ -344,8 +322,7 @@ function Ee(e, n, o) {
|
|
|
344
322
|
return u.setStart(f, c), u.collapse(!0), h(t, u), m(e), C(t), J(t), X(t, i), !0;
|
|
345
323
|
}
|
|
346
324
|
function ee(e, n, o) {
|
|
347
|
-
if (o < 0 || o >= e.items.length)
|
|
348
|
-
return;
|
|
325
|
+
if (o < 0 || o >= e.items.length) return;
|
|
349
326
|
const t = e.items[o];
|
|
350
327
|
Ee(e, n, t);
|
|
351
328
|
}
|
|
@@ -358,18 +335,15 @@ function we(e, n) {
|
|
|
358
335
|
}
|
|
359
336
|
function ne(e, n) {
|
|
360
337
|
const o = we(e, n);
|
|
361
|
-
if (o)
|
|
362
|
-
return o;
|
|
338
|
+
if (o) return o;
|
|
363
339
|
const t = Q(e.startContainer), r = t == null ? void 0 : t.closest(w);
|
|
364
|
-
if (r && n.contains(r))
|
|
365
|
-
return r;
|
|
340
|
+
if (r && n.contains(r)) return r;
|
|
366
341
|
const i = Q(e.endContainer), a = i == null ? void 0 : i.closest(w);
|
|
367
342
|
return a && n.contains(a) ? a : null;
|
|
368
343
|
}
|
|
369
344
|
function O(e, n, o = "after") {
|
|
370
345
|
const t = ne(n, e);
|
|
371
|
-
if (!t)
|
|
372
|
-
return n;
|
|
346
|
+
if (!t) return n;
|
|
373
347
|
const r = document.createRange();
|
|
374
348
|
return o === "before" ? r.setStartBefore(t) : r.setStartAfter(t), r.collapse(!0), r;
|
|
375
349
|
}
|
|
@@ -378,8 +352,7 @@ function G(e, n, o = "after") {
|
|
|
378
352
|
o === "before" ? t.setStartBefore(n) : t.setStartAfter(n), t.collapse(!0), h(e, t);
|
|
379
353
|
}
|
|
380
354
|
function Te(e, n, o) {
|
|
381
|
-
if (!e.collapsed)
|
|
382
|
-
return null;
|
|
355
|
+
if (!e.collapsed) return null;
|
|
383
356
|
const t = e.startContainer, r = e.startOffset;
|
|
384
357
|
let i = null;
|
|
385
358
|
if (t.nodeType === Node.TEXT_NODE) {
|
|
@@ -393,14 +366,11 @@ function Te(e, n, o) {
|
|
|
393
366
|
}
|
|
394
367
|
function K(e, n) {
|
|
395
368
|
const o = E(e);
|
|
396
|
-
if (!o)
|
|
397
|
-
return !1;
|
|
369
|
+
if (!o) return !1;
|
|
398
370
|
const t = Te(o, n, e);
|
|
399
|
-
if (!t)
|
|
400
|
-
return !1;
|
|
371
|
+
if (!t) return !1;
|
|
401
372
|
const r = t.parentNode;
|
|
402
|
-
if (!r)
|
|
403
|
-
return !1;
|
|
373
|
+
if (!r) return !1;
|
|
404
374
|
const i = e.innerHTML, a = Array.prototype.indexOf.call(r.childNodes, t);
|
|
405
375
|
t.remove();
|
|
406
376
|
const l = document.createRange();
|
|
@@ -408,8 +378,7 @@ function K(e, n) {
|
|
|
408
378
|
}
|
|
409
379
|
function te(e, n, o, t, r, i) {
|
|
410
380
|
var s;
|
|
411
|
-
if (ge(e, n), e.query = t, e.trigger = r, e.replaceRange = i.cloneRange(), e.loading = !!(n.api && !n.search), e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), !e.panel)
|
|
412
|
-
return;
|
|
381
|
+
if (ge(e, n), e.query = t, e.trigger = r, e.replaceRange = i.cloneRange(), e.loading = !!(n.api && !n.search), e.debounceHandle !== null && (window.clearTimeout(e.debounceHandle), e.debounceHandle = null), !e.panel) return;
|
|
413
382
|
e.isOpen || (e.panel.style.display = "block", e.panel.classList.add("show"), e.isOpen = !0), W(e, n), U(e, o);
|
|
414
383
|
const a = () => {
|
|
415
384
|
e.debounceHandle = null, be(e, n, t, r).then((f) => {
|
|
@@ -449,11 +418,9 @@ function Ce(e, n) {
|
|
|
449
418
|
l.setStart(i.node, a.startOffset), l.setEnd(i.node, i.caretOffset), te(e, n, t, a.query, a.trigger, l);
|
|
450
419
|
}
|
|
451
420
|
function V(e, n) {
|
|
452
|
-
if (e.items.length === 0)
|
|
453
|
-
return;
|
|
421
|
+
if (e.items.length === 0) return;
|
|
454
422
|
const o = e.items.length;
|
|
455
|
-
if (e.activeIndex = ((e.activeIndex + n) % o + o) % o, !e.list)
|
|
456
|
-
return;
|
|
423
|
+
if (e.activeIndex = ((e.activeIndex + n) % o + o) % o, !e.list) return;
|
|
457
424
|
const t = Array.from(e.list.querySelectorAll(".rte-mention-item"));
|
|
458
425
|
t.forEach((i, a) => i.classList.toggle("active", a === e.activeIndex));
|
|
459
426
|
const r = t[e.activeIndex];
|
|
@@ -482,18 +449,15 @@ function ke(e) {
|
|
|
482
449
|
n && ((o = n.panel) != null && o.parentNode && n.panel.parentNode.removeChild(n.panel), R.delete(e));
|
|
483
450
|
}
|
|
484
451
|
function D(e, n, o) {
|
|
485
|
-
if (N.has(e))
|
|
486
|
-
return;
|
|
452
|
+
if (N.has(e)) return;
|
|
487
453
|
C(e);
|
|
488
454
|
const t = {
|
|
489
455
|
beforeInput: (r) => {
|
|
490
456
|
C(e);
|
|
491
457
|
const i = E(e);
|
|
492
|
-
if (!i)
|
|
493
|
-
return;
|
|
458
|
+
if (!i) return;
|
|
494
459
|
const a = ne(i, e);
|
|
495
|
-
if (!a)
|
|
496
|
-
return;
|
|
460
|
+
if (!a) return;
|
|
497
461
|
const l = r.inputType || "";
|
|
498
462
|
if (l.startsWith("insert")) {
|
|
499
463
|
if (r.preventDefault(), G(e, a, "after"), l === "insertParagraph" || l === "insertLineBreak") {
|
|
@@ -503,8 +467,7 @@ function D(e, n, o) {
|
|
|
503
467
|
}
|
|
504
468
|
if (l === "insertText" || l === "insertCompositionText") {
|
|
505
469
|
const s = r.data || "";
|
|
506
|
-
if (!s)
|
|
507
|
-
return;
|
|
470
|
+
if (!s) return;
|
|
508
471
|
document.execCommand("insertText", !1, s);
|
|
509
472
|
}
|
|
510
473
|
}
|
|
@@ -553,8 +516,7 @@ function D(e, n, o) {
|
|
|
553
516
|
},
|
|
554
517
|
click: (r) => {
|
|
555
518
|
const i = r.target;
|
|
556
|
-
if (!i)
|
|
557
|
-
return;
|
|
519
|
+
if (!i) return;
|
|
558
520
|
const a = i.nodeType === Node.ELEMENT_NODE ? i : i.parentElement, l = a == null ? void 0 : a.closest(w);
|
|
559
521
|
!l || !e.contains(l) || (r.preventDefault(), r.stopPropagation(), G(e, l, "after"), m(n));
|
|
560
522
|
},
|
|
@@ -565,8 +527,7 @@ function D(e, n, o) {
|
|
|
565
527
|
}, 0);
|
|
566
528
|
},
|
|
567
529
|
mousedown: (r) => {
|
|
568
|
-
if (!n.isOpen || !n.panel)
|
|
569
|
-
return;
|
|
530
|
+
if (!n.isOpen || !n.panel) return;
|
|
570
531
|
const i = r.target;
|
|
571
532
|
i && !n.panel.contains(i) && !e.contains(i) && m(n);
|
|
572
533
|
}
|
|
@@ -578,8 +539,7 @@ function Le(e) {
|
|
|
578
539
|
n && (e.removeEventListener("beforeinput", n.beforeInput), e.removeEventListener("input", n.input), e.removeEventListener("keydown", n.keydown), e.removeEventListener("click", n.click), e.removeEventListener("blur", n.blur), document.removeEventListener("mousedown", n.mousedown, !0), N.delete(e));
|
|
579
540
|
}
|
|
580
541
|
function Me() {
|
|
581
|
-
if (F || typeof document == "undefined")
|
|
582
|
-
return;
|
|
542
|
+
if (F || typeof document == "undefined") return;
|
|
583
543
|
F = !0;
|
|
584
544
|
const e = document.createElement("style");
|
|
585
545
|
e.id = "rte-mention-plugin-styles", e.textContent = `
|
|
@@ -712,19 +672,16 @@ function Re(e) {
|
|
|
712
672
|
}
|
|
713
673
|
function M(e) {
|
|
714
674
|
const n = R.get(e);
|
|
715
|
-
if (n)
|
|
716
|
-
return n;
|
|
675
|
+
if (n) return n;
|
|
717
676
|
const o = ve(e);
|
|
718
677
|
return R.set(e, o), o;
|
|
719
678
|
}
|
|
720
679
|
function Ne(e) {
|
|
721
680
|
S || (S = !0, T = (n) => {
|
|
722
681
|
const o = n.target;
|
|
723
|
-
if (!(o instanceof Node))
|
|
724
|
-
return;
|
|
682
|
+
if (!(o instanceof Node)) return;
|
|
725
683
|
const t = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement, r = (t == null ? void 0 : t.closest(p)) || null;
|
|
726
|
-
if (!r)
|
|
727
|
-
return;
|
|
684
|
+
if (!r) return;
|
|
728
685
|
const i = M(r);
|
|
729
686
|
D(r, i, e);
|
|
730
687
|
}, document.addEventListener("focusin", T, !0));
|
|
@@ -747,8 +704,7 @@ const Ie = (e = {}) => {
|
|
|
747
704
|
commands: {
|
|
748
705
|
insertMention: (o, t) => {
|
|
749
706
|
const r = se(t);
|
|
750
|
-
if (!r)
|
|
751
|
-
return !1;
|
|
707
|
+
if (!r) return !1;
|
|
752
708
|
const i = M(r);
|
|
753
709
|
D(r, i, n);
|
|
754
710
|
let a = E(r);
|
|
@@ -775,4 +731,4 @@ const Ie = (e = {}) => {
|
|
|
775
731
|
export {
|
|
776
732
|
Ie as MentionPlugin
|
|
777
733
|
};
|
|
778
|
-
//# sourceMappingURL=MentionPlugin.native-
|
|
734
|
+
//# sourceMappingURL=MentionPlugin.native-BMDlOqur.mjs.map
|