@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 u = '.rte-page-break[data-type="page-break"]', f = ".rte-content, .editora-content";
|
|
2
2
|
let p = null, m = !1;
|
|
3
3
|
const h = (e, n) => {
|
|
4
|
-
if (n === e.innerHTML)
|
|
5
|
-
return;
|
|
4
|
+
if (n === e.innerHTML) return;
|
|
6
5
|
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
7
6
|
if (typeof t == "function")
|
|
8
7
|
try {
|
|
@@ -98,14 +97,12 @@ const h = (e, n) => {
|
|
|
98
97
|
`, document.head.appendChild(p));
|
|
99
98
|
}, T = () => {
|
|
100
99
|
const e = window.getSelection();
|
|
101
|
-
if (!e || e.rangeCount === 0)
|
|
102
|
-
return null;
|
|
100
|
+
if (!e || e.rangeCount === 0) return null;
|
|
103
101
|
const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
|
|
104
102
|
return (t == null ? void 0 : t.closest(f)) || null;
|
|
105
103
|
}, w = () => {
|
|
106
104
|
const e = T();
|
|
107
|
-
if (e)
|
|
108
|
-
return e;
|
|
105
|
+
if (e) return e;
|
|
109
106
|
const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
|
|
110
107
|
return t || document.querySelector(f);
|
|
111
108
|
}, E = (e, n) => {
|
|
@@ -142,14 +139,12 @@ const h = (e, n) => {
|
|
|
142
139
|
return t.innerHTML = "<br>", (r = e.parentNode) == null || r.insertBefore(t, e.nextSibling), t;
|
|
143
140
|
}, d = (e) => {
|
|
144
141
|
const n = window.getSelection();
|
|
145
|
-
if (!n)
|
|
146
|
-
return;
|
|
142
|
+
if (!n) return;
|
|
147
143
|
const t = document.createRange();
|
|
148
144
|
e.nodeType, Node.TEXT_NODE, t.setStart(e, 0), t.collapse(!0), n.removeAllRanges(), n.addRange(t);
|
|
149
145
|
}, b = (e) => {
|
|
150
146
|
const n = window.getSelection();
|
|
151
|
-
if (!n)
|
|
152
|
-
return;
|
|
147
|
+
if (!n) return;
|
|
153
148
|
const t = document.createRange();
|
|
154
149
|
if (e.nodeType === Node.TEXT_NODE) {
|
|
155
150
|
const r = e;
|
|
@@ -167,21 +162,17 @@ const h = (e, n) => {
|
|
|
167
162
|
return null;
|
|
168
163
|
}, A = (e) => {
|
|
169
164
|
const n = window.getSelection();
|
|
170
|
-
if (!n || !e.parentNode)
|
|
171
|
-
return;
|
|
165
|
+
if (!n || !e.parentNode) return;
|
|
172
166
|
const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
|
|
173
|
-
if (r < 0)
|
|
174
|
-
return;
|
|
167
|
+
if (r < 0) return;
|
|
175
168
|
const o = document.createRange();
|
|
176
169
|
o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
|
|
177
170
|
}, y = (e) => {
|
|
178
|
-
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment))
|
|
179
|
-
return null;
|
|
171
|
+
if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
|
|
180
172
|
const n = e.startContainer.childNodes[e.startOffset];
|
|
181
173
|
return n instanceof HTMLElement && n.matches(u) ? n : null;
|
|
182
174
|
}, B = (e, n, t) => {
|
|
183
|
-
if (!e.collapsed)
|
|
184
|
-
return null;
|
|
175
|
+
if (!e.collapsed) return null;
|
|
185
176
|
const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
|
|
186
177
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
187
178
|
const l = r;
|
|
@@ -196,8 +187,7 @@ const h = (e, n) => {
|
|
|
196
187
|
let c = r;
|
|
197
188
|
for (; c && c !== n; ) {
|
|
198
189
|
const l = i === "previous" ? c.previousSibling : c.nextSibling;
|
|
199
|
-
if (l)
|
|
200
|
-
return l;
|
|
190
|
+
if (l) return l;
|
|
201
191
|
c = c.parentNode;
|
|
202
192
|
}
|
|
203
193
|
return null;
|
|
@@ -243,11 +233,9 @@ const h = (e, n) => {
|
|
|
243
233
|
return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
|
|
244
234
|
}, D = () => {
|
|
245
235
|
const e = w();
|
|
246
|
-
if (!e)
|
|
247
|
-
return !1;
|
|
236
|
+
if (!e) return !1;
|
|
248
237
|
const n = e.innerHTML, t = window.getSelection();
|
|
249
|
-
if (!t)
|
|
250
|
-
return !1;
|
|
238
|
+
if (!t) return !1;
|
|
251
239
|
let r;
|
|
252
240
|
t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
|
|
253
241
|
const o = E(r.endContainer, e) || E(r.startContainer, e), a = C();
|
|
@@ -263,11 +251,9 @@ const h = (e, n) => {
|
|
|
263
251
|
if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
|
|
264
252
|
return;
|
|
265
253
|
const t = window.getSelection();
|
|
266
|
-
if (!t || t.rangeCount === 0)
|
|
267
|
-
return;
|
|
254
|
+
if (!t || t.rangeCount === 0) return;
|
|
268
255
|
const r = t.getRangeAt(0), o = w();
|
|
269
|
-
if (!o || !o.contains(r.commonAncestorContainer))
|
|
270
|
-
return;
|
|
256
|
+
if (!o || !o.contains(r.commonAncestorContainer)) return;
|
|
271
257
|
const a = y(r);
|
|
272
258
|
if (a) {
|
|
273
259
|
if (n === "Backspace" || n === "Delete") {
|
|
@@ -293,8 +279,7 @@ const h = (e, n) => {
|
|
|
293
279
|
o,
|
|
294
280
|
n
|
|
295
281
|
);
|
|
296
|
-
if (!s)
|
|
297
|
-
return;
|
|
282
|
+
if (!s) return;
|
|
298
283
|
e.preventDefault(), e.stopPropagation(), k(s, n);
|
|
299
284
|
}
|
|
300
285
|
}));
|
|
@@ -318,4 +303,4 @@ const h = (e, n) => {
|
|
|
318
303
|
export {
|
|
319
304
|
P as PageBreakPlugin
|
|
320
305
|
};
|
|
321
|
-
//# sourceMappingURL=PageBreakPlugin.native-
|
|
306
|
+
//# sourceMappingURL=PageBreakPlugin.native-DijGuHJZ.mjs.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
let c = !1;
|
|
2
2
|
const g = () => {
|
|
3
|
-
if (typeof document == "undefined")
|
|
4
|
-
return;
|
|
3
|
+
if (typeof document == "undefined") return;
|
|
5
4
|
const i = "rte-preview-plugin-styles";
|
|
6
|
-
if (document.getElementById(i))
|
|
7
|
-
return;
|
|
5
|
+
if (document.getElementById(i)) return;
|
|
8
6
|
const t = document.createElement("style");
|
|
9
7
|
t.id = i, t.textContent = `
|
|
10
8
|
/* Preview Editor Dialog Styles */
|
|
@@ -244,14 +242,12 @@ const g = () => {
|
|
|
244
242
|
if (t.getAttribute("contenteditable") === "true")
|
|
245
243
|
return t;
|
|
246
244
|
const e = t.closest('[contenteditable="true"]');
|
|
247
|
-
if (e)
|
|
248
|
-
return e;
|
|
245
|
+
if (e) return e;
|
|
249
246
|
}
|
|
250
247
|
return document.querySelector('[contenteditable="true"]');
|
|
251
248
|
}, h = () => {
|
|
252
249
|
const i = v();
|
|
253
|
-
if (!i)
|
|
254
|
-
return "";
|
|
250
|
+
if (!i) return "";
|
|
255
251
|
const t = i.cloneNode(!0);
|
|
256
252
|
return [
|
|
257
253
|
".rte-floating-toolbar",
|
|
@@ -272,8 +268,7 @@ const g = () => {
|
|
|
272
268
|
}), r.setAttribute("contenteditable", "false");
|
|
273
269
|
}), t.innerHTML;
|
|
274
270
|
}, u = () => {
|
|
275
|
-
if (typeof window == "undefined" || c)
|
|
276
|
-
return;
|
|
271
|
+
if (typeof window == "undefined" || c) return;
|
|
277
272
|
c = !0, g();
|
|
278
273
|
const i = h(), t = w(i), e = document.createElement("div");
|
|
279
274
|
e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
|
|
@@ -324,4 +319,4 @@ const g = () => {
|
|
|
324
319
|
export {
|
|
325
320
|
f as PreviewPlugin
|
|
326
321
|
};
|
|
327
|
-
//# sourceMappingURL=PreviewPlugin.native-
|
|
322
|
+
//# sourceMappingURL=PreviewPlugin.native-WuIwOAOR.mjs.map
|
|
@@ -240,8 +240,7 @@ const g = () => `
|
|
|
240
240
|
}
|
|
241
241
|
`, p = () => {
|
|
242
242
|
var d;
|
|
243
|
-
if (typeof window == "undefined")
|
|
244
|
-
return !1;
|
|
243
|
+
if (typeof window == "undefined") return !1;
|
|
245
244
|
const a = (() => {
|
|
246
245
|
const i = window.getSelection();
|
|
247
246
|
if (i && i.rangeCount > 0) {
|
|
@@ -260,8 +259,7 @@ const g = () => `
|
|
|
260
259
|
if (n.getAttribute("contenteditable") === "true")
|
|
261
260
|
return n;
|
|
262
261
|
const t = n.closest('[contenteditable="true"]');
|
|
263
|
-
if (t)
|
|
264
|
-
return t;
|
|
262
|
+
if (t) return t;
|
|
265
263
|
}
|
|
266
264
|
return document.querySelector('[contenteditable="true"]');
|
|
267
265
|
})();
|
|
@@ -310,4 +308,4 @@ const g = () => `
|
|
|
310
308
|
export {
|
|
311
309
|
b as PrintPlugin
|
|
312
310
|
};
|
|
313
|
-
//# sourceMappingURL=PrintPlugin.native-
|
|
311
|
+
//# sourceMappingURL=PrintPlugin.native-7qt5v7L5.mjs.map
|
package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs}
RENAMED
|
@@ -138,8 +138,7 @@ function D(e) {
|
|
|
138
138
|
const u = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark';
|
|
139
139
|
let v = !1;
|
|
140
140
|
function B() {
|
|
141
|
-
if (v || typeof document == "undefined")
|
|
142
|
-
return;
|
|
141
|
+
if (v || typeof document == "undefined") return;
|
|
143
142
|
v = !0;
|
|
144
143
|
const e = document.createElement("style");
|
|
145
144
|
e.id = "rte-slash-commands-styles", e.textContent = `
|
|
@@ -239,29 +238,23 @@ function I(e) {
|
|
|
239
238
|
return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
|
|
240
239
|
}
|
|
241
240
|
function F(e) {
|
|
242
|
-
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
243
|
-
return e.contentElement;
|
|
241
|
+
if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
|
|
244
242
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
245
243
|
const n = e.editorElement;
|
|
246
|
-
if (n.matches(s))
|
|
247
|
-
return n;
|
|
244
|
+
if (n.matches(s)) return n;
|
|
248
245
|
const r = n.querySelector(s);
|
|
249
|
-
if (r instanceof HTMLElement)
|
|
250
|
-
return r;
|
|
246
|
+
if (r instanceof HTMLElement) return r;
|
|
251
247
|
}
|
|
252
248
|
const t = window.getSelection();
|
|
253
249
|
if (t && t.rangeCount > 0) {
|
|
254
250
|
const n = t.getRangeAt(0).startContainer, r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = r == null ? void 0 : r.closest(s);
|
|
255
|
-
if (i)
|
|
256
|
-
return i;
|
|
251
|
+
if (i) return i;
|
|
257
252
|
}
|
|
258
253
|
const o = document.activeElement;
|
|
259
254
|
if (o) {
|
|
260
|
-
if (o.matches(s))
|
|
261
|
-
return o;
|
|
255
|
+
if (o.matches(s)) return o;
|
|
262
256
|
const n = o.closest(s);
|
|
263
|
-
if (n)
|
|
264
|
-
return n;
|
|
257
|
+
if (n) return n;
|
|
265
258
|
}
|
|
266
259
|
return document.querySelector(s);
|
|
267
260
|
}
|
|
@@ -273,8 +266,7 @@ function _(e) {
|
|
|
273
266
|
}
|
|
274
267
|
function E(e) {
|
|
275
268
|
const t = window.getSelection();
|
|
276
|
-
if (!t || t.rangeCount === 0)
|
|
277
|
-
return null;
|
|
269
|
+
if (!t || t.rangeCount === 0) return null;
|
|
278
270
|
const o = t.getRangeAt(0);
|
|
279
271
|
return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
|
|
280
272
|
}
|
|
@@ -283,8 +275,7 @@ function y(e, t) {
|
|
|
283
275
|
o && (o.removeAllRanges(), o.addRange(t), e.focus({ preventScroll: !0 }));
|
|
284
276
|
}
|
|
285
277
|
function j(e) {
|
|
286
|
-
if (!e.collapsed)
|
|
287
|
-
return null;
|
|
278
|
+
if (!e.collapsed) return null;
|
|
288
279
|
const t = e.startContainer, o = e.startOffset;
|
|
289
280
|
if (t.nodeType === Node.TEXT_NODE) {
|
|
290
281
|
const n = t;
|
|
@@ -333,8 +324,7 @@ function Q(e, t) {
|
|
|
333
324
|
return r.remove(), e.normalize(), i;
|
|
334
325
|
}
|
|
335
326
|
function A(e, t) {
|
|
336
|
-
if (!e.panel)
|
|
337
|
-
return;
|
|
327
|
+
if (!e.panel) return;
|
|
338
328
|
const o = Q(e.editor, t), n = e.panel;
|
|
339
329
|
n.style.display = "block", n.classList.add("show"), n.style.left = "0px", n.style.top = "0px";
|
|
340
330
|
const r = n.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight;
|
|
@@ -342,17 +332,14 @@ function A(e, t) {
|
|
|
342
332
|
d + r.height > a - 8 && (d = Math.max(8, o.top - r.height - 8)), n.style.position = "fixed", n.style.left = `${l}px`, n.style.top = `${d}px`;
|
|
343
333
|
}
|
|
344
334
|
function k(e, t) {
|
|
345
|
-
if (!t)
|
|
346
|
-
return m(e);
|
|
335
|
+
if (!t) return m(e);
|
|
347
336
|
const o = e.toLowerCase(), n = t.toLowerCase(), r = o.indexOf(n);
|
|
348
|
-
if (r < 0)
|
|
349
|
-
return m(e);
|
|
337
|
+
if (r < 0) return m(e);
|
|
350
338
|
const i = m(e.slice(0, r)), a = m(e.slice(r, r + t.length)), l = m(e.slice(r + t.length));
|
|
351
339
|
return `${i}<mark>${a}</mark>${l}`;
|
|
352
340
|
}
|
|
353
341
|
function U(e, t) {
|
|
354
|
-
if (e.panel && e.list)
|
|
355
|
-
return;
|
|
342
|
+
if (e.panel && e.list) return;
|
|
356
343
|
const o = document.createElement("div");
|
|
357
344
|
o.className = "rte-slash-panel", o.style.display = "none", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false");
|
|
358
345
|
const n = document.createElement("div");
|
|
@@ -360,11 +347,9 @@ function U(e, t) {
|
|
|
360
347
|
r.preventDefault();
|
|
361
348
|
}), o.addEventListener("click", (r) => {
|
|
362
349
|
const i = r.target;
|
|
363
|
-
if (!i)
|
|
364
|
-
return;
|
|
350
|
+
if (!i) return;
|
|
365
351
|
const a = i.closest(".rte-slash-item");
|
|
366
|
-
if (!a)
|
|
367
|
-
return;
|
|
352
|
+
if (!a) return;
|
|
368
353
|
const l = Number(a.getAttribute("data-index"));
|
|
369
354
|
Number.isFinite(l) && M(e, l);
|
|
370
355
|
});
|
|
@@ -373,8 +358,7 @@ function c(e) {
|
|
|
373
358
|
e.panel && (e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.filteredItems = [], e.activeIndex = 0, e.query = "", e.replaceRange = null, e.anchorRange = null);
|
|
374
359
|
}
|
|
375
360
|
function W(e, t, o) {
|
|
376
|
-
if (!t)
|
|
377
|
-
return e.slice(0, o);
|
|
361
|
+
if (!t) return e.slice(0, o);
|
|
378
362
|
const n = t.toLowerCase();
|
|
379
363
|
return e.filter((i) => [
|
|
380
364
|
i.id,
|
|
@@ -385,8 +369,7 @@ function W(e, t, o) {
|
|
|
385
369
|
].join(" ").toLowerCase().includes(n)).slice(0, o);
|
|
386
370
|
}
|
|
387
371
|
function Z(e, t) {
|
|
388
|
-
if (!e.list)
|
|
389
|
-
return;
|
|
372
|
+
if (!e.list) return;
|
|
390
373
|
const o = e.list;
|
|
391
374
|
if (o.innerHTML = "", e.filteredItems.length === 0) {
|
|
392
375
|
const n = document.createElement("div");
|
|
@@ -402,8 +385,7 @@ function Z(e, t) {
|
|
|
402
385
|
}), e.filteredItems.length > 0 && o.setAttribute("aria-activedescendant", `rte-slash-item-${e.instanceId}-${e.activeIndex}`);
|
|
403
386
|
}
|
|
404
387
|
function G(e, t) {
|
|
405
|
-
if (t === e.innerHTML)
|
|
406
|
-
return;
|
|
388
|
+
if (t === e.innerHTML) return;
|
|
407
389
|
const o = window.execEditorCommand || window.executeEditorCommand;
|
|
408
390
|
if (typeof o == "function")
|
|
409
391
|
try {
|
|
@@ -422,11 +404,9 @@ function L(e, t) {
|
|
|
422
404
|
} catch (l) {
|
|
423
405
|
}
|
|
424
406
|
const o = window.getSelection();
|
|
425
|
-
if (!o || o.rangeCount === 0)
|
|
426
|
-
return !1;
|
|
407
|
+
if (!o || o.rangeCount === 0) return !1;
|
|
427
408
|
const n = o.getRangeAt(0);
|
|
428
|
-
if (!e.contains(n.commonAncestorContainer))
|
|
429
|
-
return !1;
|
|
409
|
+
if (!e.contains(n.commonAncestorContainer)) return !1;
|
|
430
410
|
n.deleteContents();
|
|
431
411
|
const r = document.createElement("template");
|
|
432
412
|
r.innerHTML = t;
|
|
@@ -445,11 +425,9 @@ function X(e, t) {
|
|
|
445
425
|
} catch (a) {
|
|
446
426
|
}
|
|
447
427
|
const o = window.getSelection();
|
|
448
|
-
if (!o || o.rangeCount === 0)
|
|
449
|
-
return !1;
|
|
428
|
+
if (!o || o.rangeCount === 0) return !1;
|
|
450
429
|
const n = o.getRangeAt(0);
|
|
451
|
-
if (!e.contains(n.commonAncestorContainer))
|
|
452
|
-
return !1;
|
|
430
|
+
if (!e.contains(n.commonAncestorContainer)) return !1;
|
|
453
431
|
n.deleteContents();
|
|
454
432
|
const r = document.createTextNode(t);
|
|
455
433
|
n.insertNode(r);
|
|
@@ -512,8 +490,7 @@ function S(e, t, o) {
|
|
|
512
490
|
const n = I(e);
|
|
513
491
|
if (n && typeof n.execCommand == "function")
|
|
514
492
|
try {
|
|
515
|
-
if (n.execCommand(t, o) !== !1)
|
|
516
|
-
return !0;
|
|
493
|
+
if (n.execCommand(t, o) !== !1) return !0;
|
|
517
494
|
} catch (i) {
|
|
518
495
|
}
|
|
519
496
|
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
@@ -522,8 +499,7 @@ function S(e, t, o) {
|
|
|
522
499
|
if (r(t, o, {
|
|
523
500
|
editorElement: n,
|
|
524
501
|
contentElement: e
|
|
525
|
-
}) !== !1)
|
|
526
|
-
return !0;
|
|
502
|
+
}) !== !1) return !0;
|
|
527
503
|
} catch (i) {
|
|
528
504
|
}
|
|
529
505
|
return J(t, o);
|
|
@@ -540,14 +516,11 @@ async function Y(e, t) {
|
|
|
540
516
|
return t.action ? await Promise.resolve(t.action(r)) !== !1 : t.insertHTML ? L(o, t.insertHTML) : t.command ? S(o, t.command, t.commandValue) : !1;
|
|
541
517
|
}
|
|
542
518
|
async function M(e, t) {
|
|
543
|
-
if (t < 0 || t >= e.filteredItems.length || !e.replaceRange)
|
|
544
|
-
return;
|
|
519
|
+
if (t < 0 || t >= e.filteredItems.length || !e.replaceRange) return;
|
|
545
520
|
const o = e.filteredItems[t], n = e.editor, r = n.innerHTML, i = `${e.trigger}${e.query}`;
|
|
546
|
-
if (!window.getSelection())
|
|
547
|
-
return;
|
|
521
|
+
if (!window.getSelection()) return;
|
|
548
522
|
const l = e.replaceRange.cloneRange();
|
|
549
|
-
if (!n.contains(l.commonAncestorContainer))
|
|
550
|
-
return;
|
|
523
|
+
if (!n.contains(l.commonAncestorContainer)) return;
|
|
551
524
|
l.deleteContents();
|
|
552
525
|
const d = l.cloneRange();
|
|
553
526
|
d.collapse(!0), y(n, d);
|
|
@@ -560,11 +533,9 @@ async function M(e, t) {
|
|
|
560
533
|
c(e), x ? (V(n), G(n, r)) : i && X(n, i), n.focus({ preventScroll: !0 });
|
|
561
534
|
}
|
|
562
535
|
function R(e, t) {
|
|
563
|
-
if (e.filteredItems.length === 0)
|
|
564
|
-
return;
|
|
536
|
+
if (e.filteredItems.length === 0) return;
|
|
565
537
|
const o = e.filteredItems.length;
|
|
566
|
-
if (e.activeIndex = ((e.activeIndex + t) % o + o) % o, !e.list)
|
|
567
|
-
return;
|
|
538
|
+
if (e.activeIndex = ((e.activeIndex + t) % o + o) % o, !e.list) return;
|
|
568
539
|
const n = Array.from(e.list.querySelectorAll(".rte-slash-item"));
|
|
569
540
|
n.forEach((i, a) => {
|
|
570
541
|
const l = a === e.activeIndex;
|
|
@@ -659,8 +630,7 @@ function re(e) {
|
|
|
659
630
|
t && ((o = t.panel) != null && o.parentNode && t.panel.parentNode.removeChild(t.panel), g.delete(e));
|
|
660
631
|
}
|
|
661
632
|
function C(e, t, o) {
|
|
662
|
-
if (p.has(e))
|
|
663
|
-
return;
|
|
633
|
+
if (p.has(e)) return;
|
|
664
634
|
const n = {
|
|
665
635
|
input: () => {
|
|
666
636
|
ee(t, o);
|
|
@@ -704,14 +674,12 @@ function C(e, t, o) {
|
|
|
704
674
|
}, 0);
|
|
705
675
|
},
|
|
706
676
|
mousedown: (r) => {
|
|
707
|
-
if (!t.isOpen || !t.panel)
|
|
708
|
-
return;
|
|
677
|
+
if (!t.isOpen || !t.panel) return;
|
|
709
678
|
const i = r.target;
|
|
710
679
|
i && !t.panel.contains(i) && !e.contains(i) && c(t);
|
|
711
680
|
},
|
|
712
681
|
selectionchange: () => {
|
|
713
|
-
if (!t.isOpen)
|
|
714
|
-
return;
|
|
682
|
+
if (!t.isOpen) return;
|
|
715
683
|
const r = E(e);
|
|
716
684
|
if (!r || !r.collapsed) {
|
|
717
685
|
c(t);
|
|
@@ -732,11 +700,9 @@ function oe(e) {
|
|
|
732
700
|
function ie(e) {
|
|
733
701
|
b || (b = !0, f = (t) => {
|
|
734
702
|
const o = t.target;
|
|
735
|
-
if (!(o instanceof Node))
|
|
736
|
-
return;
|
|
703
|
+
if (!(o instanceof Node)) return;
|
|
737
704
|
const n = P(o), r = (n == null ? void 0 : n.closest(s)) || null;
|
|
738
|
-
if (!r)
|
|
739
|
-
return;
|
|
705
|
+
if (!r) return;
|
|
740
706
|
const i = w(r, e);
|
|
741
707
|
C(r, i, e);
|
|
742
708
|
}, document.addEventListener("focusin", f, !0));
|
|
@@ -760,8 +726,7 @@ const ce = (e = {}) => {
|
|
|
760
726
|
commands: {
|
|
761
727
|
openSlashCommands: (o, n) => {
|
|
762
728
|
const r = F(n);
|
|
763
|
-
if (!r)
|
|
764
|
-
return !1;
|
|
729
|
+
if (!r) return !1;
|
|
765
730
|
const i = w(r, t);
|
|
766
731
|
return C(r, i, t), H(i, t);
|
|
767
732
|
}
|
|
@@ -787,4 +752,4 @@ const ce = (e = {}) => {
|
|
|
787
752
|
export {
|
|
788
753
|
ce as SlashCommandsPlugin
|
|
789
754
|
};
|
|
790
|
-
//# sourceMappingURL=SlashCommandsPlugin.native-
|
|
755
|
+
//# sourceMappingURL=SlashCommandsPlugin.native-BiN6ODw5.mjs.map
|