@editora/core 1.0.7 → 1.0.9
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 +5 -0
- package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
- package/dist/ApprovalWorkflowPlugin.native-449ce66c.mjs +1115 -0
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
- package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
- package/dist/BlocksLibraryPlugin.native-1cc51e63.mjs +1386 -0
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
- package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
- package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
- package/dist/CitationsPlugin.native-169fb1e8.mjs +1532 -0
- package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
- package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
- package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
- package/dist/ConditionalContentPlugin.native-4983143a.mjs +1424 -0
- package/dist/ContentRulesPlugin.native-63ed405b.mjs +1149 -0
- package/dist/DataBindingPlugin.native-427e9d75.mjs +956 -0
- package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
- package/dist/DocSchemaPlugin.native-8e41eda0.mjs +1382 -0
- package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
- package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
- package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
- package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
- package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
- package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
- package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
- package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
- package/dist/MentionPlugin.native-3b1e8c05.mjs +778 -0
- package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
- package/dist/PIIRedactionPlugin.native-7ab10b9f.mjs +1449 -0
- package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-1794c5fb.mjs} +67 -52
- package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-f7b67cc0.mjs} +38 -33
- package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
- package/dist/SlashCommandsPlugin.native-8d45e511.mjs +790 -0
- package/dist/SmartPastePlugin.native-a6c5efec.mjs +1447 -0
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
- package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
- package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
- package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
- package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
- package/dist/TrackChangesPlugin.native-e96da509.mjs +818 -0
- package/dist/TranslationWorkflowPlugin.native-4e711b1e.mjs +1797 -0
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
- package/dist/VersionDiffPlugin.native-5bbeff85.mjs +801 -0
- package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
- package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
- package/dist/documentManager-8327fb6e.mjs +9166 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
- package/dist/editora.min.js +14 -13
- package/dist/editora.umd.js +14 -13
- package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
- package/dist/index-072ef022.js +11 -0
- package/dist/index-49d31221.mjs +16860 -0
- package/dist/{index-yzU4NdPT.mjs → index-7da30697.mjs} +490 -358
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-b47a189f.mjs +5782 -0
- package/dist/index.esm.js +12 -7
- package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
- package/dist/plugin-loader.js +77 -40
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
- package/dist/style.css +1 -0
- package/dist/webcomponent-core.js +546 -414
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +40 -39
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +484 -315
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +6035 -558
- package/package.json +11 -5
- package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
- package/dist/core.css +0 -1
- package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
- package/dist/index-BpE6GFbz.js +0 -10
- package/dist/index-BslAFzmv.mjs +0 -16544
- package/dist/index.es-BYD2KEo6.mjs +0 -6666
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const C = ".rte-content, .editora-content", x = '.rte-footnotes[data-type="footnotes"]', p = ".rte-footnote-ref[data-footnote-id]", h = 'li.rte-footnote-item[data-type="footnote"]', k = "__editoraCommandEditorRoot";
|
|
2
2
|
let w = !1, T = !1, N = 0;
|
|
3
3
|
function _() {
|
|
4
|
-
if (w || typeof document == "undefined")
|
|
4
|
+
if (w || typeof document == "undefined")
|
|
5
|
+
return;
|
|
5
6
|
w = !0;
|
|
6
7
|
const t = document.createElement("style");
|
|
7
8
|
t.id = "editora-footnote-plugin-styles", t.textContent = `
|
|
@@ -94,20 +95,25 @@ function L(t) {
|
|
|
94
95
|
return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
|
|
95
96
|
}
|
|
96
97
|
function q(t) {
|
|
97
|
-
if (!t)
|
|
98
|
+
if (!t)
|
|
99
|
+
return null;
|
|
98
100
|
const e = t.querySelector('[contenteditable="true"]');
|
|
99
101
|
return e instanceof HTMLElement ? e : null;
|
|
100
102
|
}
|
|
101
103
|
function H() {
|
|
102
|
-
if (typeof window == "undefined")
|
|
104
|
+
if (typeof window == "undefined")
|
|
105
|
+
return null;
|
|
103
106
|
const t = window[k];
|
|
104
|
-
if (!(t instanceof HTMLElement))
|
|
107
|
+
if (!(t instanceof HTMLElement))
|
|
108
|
+
return null;
|
|
105
109
|
window[k] = null;
|
|
106
110
|
const e = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
|
|
107
111
|
if (e) {
|
|
108
112
|
const o = q(e);
|
|
109
|
-
if (o)
|
|
110
|
-
|
|
113
|
+
if (o)
|
|
114
|
+
return o;
|
|
115
|
+
if (e.getAttribute("contenteditable") === "true")
|
|
116
|
+
return e;
|
|
111
117
|
}
|
|
112
118
|
if (t.getAttribute("contenteditable") === "true")
|
|
113
119
|
return t;
|
|
@@ -116,7 +122,8 @@ function H() {
|
|
|
116
122
|
}
|
|
117
123
|
function B(t) {
|
|
118
124
|
const e = t.closest('[contenteditable="true"]');
|
|
119
|
-
if (!e)
|
|
125
|
+
if (!e)
|
|
126
|
+
return null;
|
|
120
127
|
let n = e, o = n.parentElement;
|
|
121
128
|
for (; o; )
|
|
122
129
|
o.getAttribute("contenteditable") === "true" && (n = o), o = o.parentElement;
|
|
@@ -124,7 +131,8 @@ function B(t) {
|
|
|
124
131
|
}
|
|
125
132
|
function u(t) {
|
|
126
133
|
const e = L(t);
|
|
127
|
-
if (!e)
|
|
134
|
+
if (!e)
|
|
135
|
+
return null;
|
|
128
136
|
const n = e.closest(C);
|
|
129
137
|
return n || B(e);
|
|
130
138
|
}
|
|
@@ -137,9 +145,11 @@ function M() {
|
|
|
137
145
|
if (t && document.contains(t))
|
|
138
146
|
return t;
|
|
139
147
|
const e = $();
|
|
140
|
-
if (e)
|
|
148
|
+
if (e)
|
|
149
|
+
return e;
|
|
141
150
|
const n = document.activeElement, o = n ? u(n) : null;
|
|
142
|
-
if (o)
|
|
151
|
+
if (o)
|
|
152
|
+
return o;
|
|
143
153
|
const r = document.querySelector(C);
|
|
144
154
|
return r || document.querySelector('[contenteditable="true"]');
|
|
145
155
|
}
|
|
@@ -185,7 +195,8 @@ function A(t) {
|
|
|
185
195
|
t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
186
196
|
}
|
|
187
197
|
function S(t, e) {
|
|
188
|
-
if (!t || e === t.innerHTML)
|
|
198
|
+
if (!t || e === t.innerHTML)
|
|
199
|
+
return;
|
|
189
200
|
const n = window.execEditorCommand || window.executeEditorCommand;
|
|
190
201
|
if (typeof n == "function")
|
|
191
202
|
try {
|
|
@@ -219,17 +230,21 @@ function V(t) {
|
|
|
219
230
|
}
|
|
220
231
|
function R(t) {
|
|
221
232
|
const e = t.parentNode;
|
|
222
|
-
if (!e)
|
|
233
|
+
if (!e)
|
|
234
|
+
return;
|
|
223
235
|
const n = Array.from(e.childNodes).indexOf(t);
|
|
224
|
-
if (n < 0)
|
|
236
|
+
if (n < 0)
|
|
237
|
+
return;
|
|
225
238
|
const o = window.getSelection();
|
|
226
|
-
if (!o)
|
|
239
|
+
if (!o)
|
|
240
|
+
return;
|
|
227
241
|
const r = document.createRange();
|
|
228
242
|
r.setStart(e, n), r.setEnd(e, n + 1), o.removeAllRanges(), o.addRange(r), t.focus({ preventScroll: !0 });
|
|
229
243
|
}
|
|
230
244
|
function O(t, e) {
|
|
231
245
|
const n = window.getSelection();
|
|
232
|
-
if (!n)
|
|
246
|
+
if (!n)
|
|
247
|
+
return;
|
|
233
248
|
const o = Math.max(0, Math.min(e, t.childNodes.length)), r = document.createRange();
|
|
234
249
|
r.setStart(t, o), r.collapse(!0), n.removeAllRanges(), n.addRange(r);
|
|
235
250
|
}
|
|
@@ -244,7 +259,8 @@ function b(t, e, n) {
|
|
|
244
259
|
if (o.nodeType === Node.ELEMENT_NODE) {
|
|
245
260
|
const c = o;
|
|
246
261
|
if (n === "previous") {
|
|
247
|
-
if (r > 0)
|
|
262
|
+
if (r > 0)
|
|
263
|
+
return c.childNodes[r - 1] || null;
|
|
248
264
|
} else if (r < c.childNodes.length)
|
|
249
265
|
return c.childNodes[r] || null;
|
|
250
266
|
}
|
|
@@ -253,13 +269,15 @@ function b(t, e, n) {
|
|
|
253
269
|
let i = o;
|
|
254
270
|
for (; i && i !== e; ) {
|
|
255
271
|
const c = n === "previous" ? i.previousSibling : i.nextSibling;
|
|
256
|
-
if (c)
|
|
272
|
+
if (c)
|
|
273
|
+
return c;
|
|
257
274
|
i = i.parentNode;
|
|
258
275
|
}
|
|
259
276
|
return null;
|
|
260
277
|
}
|
|
261
278
|
function Y(t, e, n) {
|
|
262
|
-
if (!t.collapsed)
|
|
279
|
+
if (!t.collapsed)
|
|
280
|
+
return null;
|
|
263
281
|
const o = (c) => c instanceof HTMLElement && c.matches(p) ? c : null, { startContainer: r, startOffset: i } = t;
|
|
264
282
|
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
265
283
|
const c = r;
|
|
@@ -280,13 +298,15 @@ function Y(t, e, n) {
|
|
|
280
298
|
}
|
|
281
299
|
function m(t) {
|
|
282
300
|
const e = Array.from(t.querySelectorAll(p)).filter((a) => !a.closest(x)), n = g(t, e.length > 0);
|
|
283
|
-
if (!n)
|
|
301
|
+
if (!n)
|
|
302
|
+
return;
|
|
284
303
|
const o = D(n), r = Array.from(o.querySelectorAll(h)), i = /* @__PURE__ */ new Map();
|
|
285
304
|
r.forEach((a) => i.set(a.id, a));
|
|
286
305
|
const c = [];
|
|
287
306
|
e.forEach((a, f) => {
|
|
288
307
|
const l = a.getAttribute("data-footnote-id");
|
|
289
|
-
if (!l)
|
|
308
|
+
if (!l)
|
|
309
|
+
return;
|
|
290
310
|
const s = f + 1;
|
|
291
311
|
a.setAttribute("data-number", String(s)), a.id = `ref-${l}`, a.textContent = String(s);
|
|
292
312
|
let d = i.get(l);
|
|
@@ -299,9 +319,11 @@ function m(t) {
|
|
|
299
319
|
}
|
|
300
320
|
function F(t, e) {
|
|
301
321
|
const n = u(t), o = t.parentNode;
|
|
302
|
-
if (!n || !o)
|
|
322
|
+
if (!n || !o)
|
|
323
|
+
return !1;
|
|
303
324
|
const r = n.innerHTML, i = Array.from(o.childNodes).indexOf(t);
|
|
304
|
-
if (i < 0)
|
|
325
|
+
if (i < 0)
|
|
326
|
+
return !1;
|
|
305
327
|
const c = t.getAttribute("data-footnote-id") || "";
|
|
306
328
|
if (t.remove(), c) {
|
|
307
329
|
const a = n.querySelector(
|
|
@@ -314,38 +336,49 @@ function F(t, e) {
|
|
|
314
336
|
function G() {
|
|
315
337
|
T || typeof document == "undefined" || (T = !0, document.addEventListener("click", (t) => {
|
|
316
338
|
const e = t.target;
|
|
317
|
-
if (!e)
|
|
339
|
+
if (!e)
|
|
340
|
+
return;
|
|
318
341
|
const n = e.closest(p);
|
|
319
342
|
if (n) {
|
|
320
343
|
const f = u(n);
|
|
321
|
-
if (!f || !f.contains(n))
|
|
344
|
+
if (!f || !f.contains(n))
|
|
345
|
+
return;
|
|
322
346
|
t.preventDefault(), t.stopPropagation(), R(n), n.classList.add("rte-footnote-selected"), window.setTimeout(() => n.classList.remove("rte-footnote-selected"), 1200);
|
|
323
347
|
const l = n.getAttribute("data-footnote-id");
|
|
324
|
-
if (!l)
|
|
348
|
+
if (!l)
|
|
349
|
+
return;
|
|
325
350
|
const s = f.querySelector(
|
|
326
351
|
`${h}#${CSS.escape(l)}`
|
|
327
352
|
);
|
|
328
|
-
if (!s)
|
|
353
|
+
if (!s)
|
|
354
|
+
return;
|
|
329
355
|
s.scrollIntoView({ behavior: "smooth", block: "center" }), v(s);
|
|
330
356
|
return;
|
|
331
357
|
}
|
|
332
358
|
const o = e.closest(".rte-footnote-backref");
|
|
333
|
-
if (!o)
|
|
359
|
+
if (!o)
|
|
360
|
+
return;
|
|
334
361
|
const r = o.closest(h);
|
|
335
|
-
if (!r)
|
|
362
|
+
if (!r)
|
|
363
|
+
return;
|
|
336
364
|
const i = u(r);
|
|
337
|
-
if (!i || !i.contains(r))
|
|
365
|
+
if (!i || !i.contains(r))
|
|
366
|
+
return;
|
|
338
367
|
t.preventDefault(), t.stopPropagation();
|
|
339
368
|
const c = r.id;
|
|
340
|
-
if (!c)
|
|
369
|
+
if (!c)
|
|
370
|
+
return;
|
|
341
371
|
const a = X(i, c);
|
|
342
372
|
a && (a.scrollIntoView({ behavior: "smooth", block: "center" }), v(a), R(a));
|
|
343
373
|
}), document.addEventListener("keydown", (t) => {
|
|
344
|
-
if (t.key !== "Backspace" && t.key !== "Delete")
|
|
374
|
+
if (t.key !== "Backspace" && t.key !== "Delete")
|
|
375
|
+
return;
|
|
345
376
|
const e = window.getSelection();
|
|
346
|
-
if (!e || e.rangeCount === 0)
|
|
377
|
+
if (!e || e.rangeCount === 0)
|
|
378
|
+
return;
|
|
347
379
|
const n = e.getRangeAt(0), o = u(n.commonAncestorContainer);
|
|
348
|
-
if (!o || !o.contains(n.commonAncestorContainer))
|
|
380
|
+
if (!o || !o.contains(n.commonAncestorContainer))
|
|
381
|
+
return;
|
|
349
382
|
const r = K(n);
|
|
350
383
|
if (r) {
|
|
351
384
|
t.preventDefault(), t.stopPropagation(), F(r, t.key);
|
|
@@ -361,9 +394,11 @@ function G() {
|
|
|
361
394
|
}
|
|
362
395
|
const J = (t = "") => {
|
|
363
396
|
const e = M();
|
|
364
|
-
if (!e)
|
|
397
|
+
if (!e)
|
|
398
|
+
return !1;
|
|
365
399
|
const n = e.innerHTML, o = window.getSelection();
|
|
366
|
-
if (!o)
|
|
400
|
+
if (!o)
|
|
401
|
+
return !1;
|
|
367
402
|
let r;
|
|
368
403
|
try {
|
|
369
404
|
r = V(e);
|
|
@@ -380,7 +415,8 @@ const J = (t = "") => {
|
|
|
380
415
|
const a = document.createRange();
|
|
381
416
|
a.setStartAfter(c), a.collapse(!0), o.removeAllRanges(), o.addRange(a);
|
|
382
417
|
const f = g(e, !0);
|
|
383
|
-
if (!f)
|
|
418
|
+
if (!f)
|
|
419
|
+
return !1;
|
|
384
420
|
const l = D(f), s = t.trim() || "Footnote";
|
|
385
421
|
return l.appendChild(I(i, s)), m(e), S(e, n), A(e), !0;
|
|
386
422
|
}, Q = () => {
|
|
@@ -397,9 +433,11 @@ const J = (t = "") => {
|
|
|
397
433
|
const n = document.querySelector('[contenteditable="true"]');
|
|
398
434
|
n && m(n);
|
|
399
435
|
}, U = (t) => {
|
|
400
|
-
if (!t)
|
|
436
|
+
if (!t)
|
|
437
|
+
return;
|
|
401
438
|
const e = Array.from(document.querySelectorAll(p)).find((i) => i.getAttribute("data-footnote-id") === t) || null, n = document.getElementById(t), o = u(e || n);
|
|
402
|
-
if (!o)
|
|
439
|
+
if (!o)
|
|
440
|
+
return;
|
|
403
441
|
const r = o.innerHTML;
|
|
404
442
|
e == null || e.remove(), n == null || n.remove(), m(o), S(o, r), A(o);
|
|
405
443
|
}, W = () => (_(), G(), {
|
|
@@ -422,4 +460,4 @@ export {
|
|
|
422
460
|
J as insertFootnoteCommand,
|
|
423
461
|
Q as renumberAllFootnotes
|
|
424
462
|
};
|
|
425
|
-
//# sourceMappingURL=FootnotePlugin.native-
|
|
463
|
+
//# sourceMappingURL=FootnotePlugin.native-494657b3.mjs.map
|
|
@@ -2,20 +2,25 @@ const A = ".rte-content, .editora-content";
|
|
|
2
2
|
const y = "__editoraCommandEditorRoot", s = /* @__PURE__ */ new Map(), E = {};
|
|
3
3
|
let T = !1, c = null;
|
|
4
4
|
function N(t) {
|
|
5
|
-
if (!t)
|
|
5
|
+
if (!t)
|
|
6
|
+
return null;
|
|
6
7
|
const e = t.querySelector('[contenteditable="true"]');
|
|
7
8
|
return e instanceof HTMLElement ? e : null;
|
|
8
9
|
}
|
|
9
10
|
function z() {
|
|
10
|
-
if (typeof window == "undefined")
|
|
11
|
+
if (typeof window == "undefined")
|
|
12
|
+
return null;
|
|
11
13
|
const t = window[y];
|
|
12
|
-
if (!(t instanceof HTMLElement))
|
|
14
|
+
if (!(t instanceof HTMLElement))
|
|
15
|
+
return null;
|
|
13
16
|
window[y] = null;
|
|
14
17
|
const e = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
|
|
15
18
|
if (e) {
|
|
16
19
|
const o = N(e);
|
|
17
|
-
if (o)
|
|
18
|
-
|
|
20
|
+
if (o)
|
|
21
|
+
return o;
|
|
22
|
+
if (e.getAttribute("contenteditable") === "true")
|
|
23
|
+
return e;
|
|
19
24
|
}
|
|
20
25
|
if (t.getAttribute("contenteditable") === "true")
|
|
21
26
|
return t;
|
|
@@ -27,11 +32,14 @@ function F(t) {
|
|
|
27
32
|
}
|
|
28
33
|
function f(t) {
|
|
29
34
|
const e = F(t);
|
|
30
|
-
if (!e)
|
|
35
|
+
if (!e)
|
|
36
|
+
return null;
|
|
31
37
|
const n = e.closest(A);
|
|
32
|
-
if (n)
|
|
38
|
+
if (n)
|
|
39
|
+
return n;
|
|
33
40
|
const o = e.closest('[contenteditable="true"]');
|
|
34
|
-
if (!o)
|
|
41
|
+
if (!o)
|
|
42
|
+
return null;
|
|
35
43
|
let r = o, i = r.parentElement;
|
|
36
44
|
for (; i; )
|
|
37
45
|
i.getAttribute("contenteditable") === "true" && (r = i), i = i.parentElement;
|
|
@@ -44,16 +52,20 @@ function l() {
|
|
|
44
52
|
const e = window.getSelection();
|
|
45
53
|
if (e && e.rangeCount > 0) {
|
|
46
54
|
const i = f(e.getRangeAt(0).startContainer);
|
|
47
|
-
if (i)
|
|
55
|
+
if (i)
|
|
56
|
+
return i;
|
|
48
57
|
}
|
|
49
58
|
const n = document.activeElement;
|
|
50
59
|
if (n) {
|
|
51
60
|
const i = f(n);
|
|
52
|
-
if (i)
|
|
61
|
+
if (i)
|
|
62
|
+
return i;
|
|
53
63
|
}
|
|
54
|
-
if (c != null && c.isConnected)
|
|
64
|
+
if (c != null && c.isConnected)
|
|
65
|
+
return c;
|
|
55
66
|
const o = Array.from(s.keys()).find((i) => i.isConnected);
|
|
56
|
-
if (o)
|
|
67
|
+
if (o)
|
|
68
|
+
return o;
|
|
57
69
|
const r = document.querySelector(A);
|
|
58
70
|
return r || document.querySelector('[contenteditable="true"]');
|
|
59
71
|
}
|
|
@@ -73,7 +85,8 @@ function h(t) {
|
|
|
73
85
|
return t ? t.innerHTML : "";
|
|
74
86
|
}
|
|
75
87
|
function m(t, e) {
|
|
76
|
-
if (!t)
|
|
88
|
+
if (!t)
|
|
89
|
+
return;
|
|
77
90
|
const n = M(t);
|
|
78
91
|
n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
|
|
79
92
|
}
|
|
@@ -112,7 +125,8 @@ function w(t, e) {
|
|
|
112
125
|
}), t.innerHTML !== e.innerHTML && (t.innerHTML = e.innerHTML), e.value !== null && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && (t.value = e.value), e.checked !== null && t instanceof HTMLInputElement && (t.checked = e.checked);
|
|
113
126
|
}
|
|
114
127
|
function u(t, e) {
|
|
115
|
-
if (E[t] = e, typeof window == "undefined")
|
|
128
|
+
if (E[t] = e, typeof window == "undefined")
|
|
129
|
+
return;
|
|
116
130
|
const n = window.registerEditorCommand;
|
|
117
131
|
typeof n == "function" ? n(t, e) : (window.registerEditorCommand = (o, r) => {
|
|
118
132
|
E[o] = r;
|
|
@@ -144,7 +158,8 @@ const k = () => {
|
|
|
144
158
|
const t = l();
|
|
145
159
|
return x("redo", t).changed ? !0 : p(t != null ? t : void 0);
|
|
146
160
|
}, D = (t, e, n) => {
|
|
147
|
-
if (!(t instanceof HTMLElement))
|
|
161
|
+
if (!(t instanceof HTMLElement))
|
|
162
|
+
return;
|
|
148
163
|
const o = f(t), r = t.hasAttribute(e), i = t.getAttribute(e);
|
|
149
164
|
t.setAttribute(e, n), m(o, {
|
|
150
165
|
undo: () => {
|
|
@@ -156,7 +171,8 @@ const k = () => {
|
|
|
156
171
|
}), d(o);
|
|
157
172
|
}, _ = (t, e) => {
|
|
158
173
|
var r;
|
|
159
|
-
if (!(t instanceof HTMLElement))
|
|
174
|
+
if (!(t instanceof HTMLElement))
|
|
175
|
+
return;
|
|
160
176
|
const n = f(t), o = (r = t.textContent) != null ? r : "";
|
|
161
177
|
t.textContent = e, m(n, {
|
|
162
178
|
undo: () => {
|
|
@@ -169,9 +185,11 @@ const k = () => {
|
|
|
169
185
|
}, R = (t) => {
|
|
170
186
|
var a;
|
|
171
187
|
const e = t == null ? void 0 : t.element;
|
|
172
|
-
if (!(e instanceof HTMLElement))
|
|
188
|
+
if (!(e instanceof HTMLElement))
|
|
189
|
+
return;
|
|
173
190
|
const n = f(e), o = (a = window.a11yRuleRegistry) == null ? void 0 : a.find((g) => g.id === t.rule);
|
|
174
|
-
if (!o || typeof o.fix != "function")
|
|
191
|
+
if (!o || typeof o.fix != "function")
|
|
192
|
+
return;
|
|
175
193
|
const r = H(e);
|
|
176
194
|
o.fix(t);
|
|
177
195
|
const i = H(e);
|
|
@@ -184,7 +202,8 @@ const k = () => {
|
|
|
184
202
|
}
|
|
185
203
|
}), d(n);
|
|
186
204
|
}, I = (t, e, n) => {
|
|
187
|
-
if (!(t instanceof HTMLElement))
|
|
205
|
+
if (!(t instanceof HTMLElement))
|
|
206
|
+
return !1;
|
|
188
207
|
const o = typeof n == "string" ? n : t.innerHTML;
|
|
189
208
|
return e === o ? !1 : (m(t, {
|
|
190
209
|
undo: () => {
|
|
@@ -196,12 +215,14 @@ const k = () => {
|
|
|
196
215
|
}), !0);
|
|
197
216
|
}, b = (t) => {
|
|
198
217
|
const e = v(t, "undo");
|
|
199
|
-
if (!e)
|
|
218
|
+
if (!e)
|
|
219
|
+
return !1;
|
|
200
220
|
const n = M(e), o = n.undoStack.pop();
|
|
201
221
|
return o ? (o.undo(), n.redoStack.push(o), c = e, d(e), !0) : !1;
|
|
202
222
|
}, p = (t) => {
|
|
203
223
|
const e = v(t, "redo");
|
|
204
|
-
if (!e)
|
|
224
|
+
if (!e)
|
|
225
|
+
return !1;
|
|
205
226
|
const n = M(e), o = n.redoStack.pop();
|
|
206
227
|
return o ? (o.redo(), n.undoStack.push(o), c = e, d(e), !0) : !1;
|
|
207
228
|
};
|
|
@@ -254,4 +275,4 @@ export {
|
|
|
254
275
|
k as undo,
|
|
255
276
|
b as undoDom
|
|
256
277
|
};
|
|
257
|
-
//# sourceMappingURL=HistoryPlugin.native-
|
|
278
|
+
//# sourceMappingURL=HistoryPlugin.native-92ed4be4.mjs.map
|
|
@@ -16,7 +16,8 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
|
|
|
16
16
|
if (n.getAttribute("contenteditable") === "true")
|
|
17
17
|
return n;
|
|
18
18
|
const t = n.closest('[contenteditable="true"]');
|
|
19
|
-
if (t)
|
|
19
|
+
if (t)
|
|
20
|
+
return t;
|
|
20
21
|
}
|
|
21
22
|
return document.querySelector('[contenteditable="true"]');
|
|
22
23
|
}, l = (e) => {
|
|
@@ -49,7 +50,8 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
|
|
|
49
50
|
{
|
|
50
51
|
acceptNode: (r) => {
|
|
51
52
|
const a = r;
|
|
52
|
-
if (!s(a))
|
|
53
|
+
if (!s(a))
|
|
54
|
+
return NodeFilter.FILTER_SKIP;
|
|
53
55
|
if (typeof e.intersectsNode == "function")
|
|
54
56
|
return e.intersectsNode(a) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
55
57
|
const u = document.createRange();
|
|
@@ -71,7 +73,8 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
|
|
|
71
73
|
}
|
|
72
74
|
return 0;
|
|
73
75
|
}, p = (e, n) => {
|
|
74
|
-
if (n === e.innerHTML)
|
|
76
|
+
if (n === e.innerHTML)
|
|
77
|
+
return;
|
|
75
78
|
const t = window.execEditorCommand || window.executeEditorCommand;
|
|
76
79
|
if (typeof t == "function")
|
|
77
80
|
try {
|
|
@@ -80,13 +83,17 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
|
|
|
80
83
|
}
|
|
81
84
|
}, h = () => {
|
|
82
85
|
const e = m();
|
|
83
|
-
if (!e)
|
|
86
|
+
if (!e)
|
|
87
|
+
return !1;
|
|
84
88
|
const n = window.getSelection();
|
|
85
|
-
if (!n || n.rangeCount === 0)
|
|
89
|
+
if (!n || n.rangeCount === 0)
|
|
90
|
+
return !1;
|
|
86
91
|
const t = n.getRangeAt(0);
|
|
87
|
-
if (!e.contains(t.commonAncestorContainer))
|
|
92
|
+
if (!e.contains(t.commonAncestorContainer))
|
|
93
|
+
return !1;
|
|
88
94
|
const o = E(t, e);
|
|
89
|
-
if (o.length === 0)
|
|
95
|
+
if (o.length === 0)
|
|
96
|
+
return !1;
|
|
90
97
|
const c = e.innerHTML;
|
|
91
98
|
return o.forEach((i) => {
|
|
92
99
|
const r = T(i) + 40;
|
|
@@ -94,13 +101,17 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
|
|
|
94
101
|
}), p(e, c), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
|
|
95
102
|
}, N = () => {
|
|
96
103
|
const e = m();
|
|
97
|
-
if (!e)
|
|
104
|
+
if (!e)
|
|
105
|
+
return !1;
|
|
98
106
|
const n = window.getSelection();
|
|
99
|
-
if (!n || n.rangeCount === 0)
|
|
107
|
+
if (!n || n.rangeCount === 0)
|
|
108
|
+
return !1;
|
|
100
109
|
const t = n.getRangeAt(0);
|
|
101
|
-
if (!e.contains(t.commonAncestorContainer))
|
|
110
|
+
if (!e.contains(t.commonAncestorContainer))
|
|
111
|
+
return !1;
|
|
102
112
|
const o = E(t, e);
|
|
103
|
-
if (o.length === 0)
|
|
113
|
+
if (o.length === 0)
|
|
114
|
+
return !1;
|
|
104
115
|
const c = e.innerHTML;
|
|
105
116
|
return o.forEach((i) => {
|
|
106
117
|
const d = T(i), r = Math.max(0, d - 40);
|
|
@@ -147,4 +158,4 @@ export {
|
|
|
147
158
|
N as decreaseIndent,
|
|
148
159
|
h as increaseIndent
|
|
149
160
|
};
|
|
150
|
-
//# sourceMappingURL=IndentPlugin.native-
|
|
161
|
+
//# sourceMappingURL=IndentPlugin.native-e4ee902b.mjs.map
|
|
@@ -35,7 +35,8 @@ const g = [
|
|
|
35
35
|
if (t.getAttribute("contenteditable") === "true")
|
|
36
36
|
return t;
|
|
37
37
|
const n = t.closest('[contenteditable="true"]');
|
|
38
|
-
if (n)
|
|
38
|
+
if (n)
|
|
39
|
+
return n;
|
|
39
40
|
}
|
|
40
41
|
return document.querySelector('[contenteditable="true"]');
|
|
41
42
|
}, u = (e) => {
|
|
@@ -45,7 +46,8 @@ const g = [
|
|
|
45
46
|
const n = t;
|
|
46
47
|
if (d(n))
|
|
47
48
|
return n;
|
|
48
|
-
if (n.getAttribute("contenteditable") === "true")
|
|
49
|
+
if (n.getAttribute("contenteditable") === "true")
|
|
50
|
+
break;
|
|
49
51
|
}
|
|
50
52
|
t = t.parentNode;
|
|
51
53
|
}
|
|
@@ -62,7 +64,8 @@ const g = [
|
|
|
62
64
|
{
|
|
63
65
|
acceptNode: (i) => {
|
|
64
66
|
const c = i;
|
|
65
|
-
if (!d(c))
|
|
67
|
+
if (!d(c))
|
|
68
|
+
return NodeFilter.FILTER_SKIP;
|
|
66
69
|
if (typeof e.intersectsNode == "function")
|
|
67
70
|
return e.intersectsNode(c) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
68
71
|
const l = document.createRange();
|
|
@@ -77,7 +80,8 @@ const g = [
|
|
|
77
80
|
}, L = (e) => {
|
|
78
81
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
79
82
|
}, b = (e, t) => {
|
|
80
|
-
if (t === e.innerHTML)
|
|
83
|
+
if (t === e.innerHTML)
|
|
84
|
+
return;
|
|
81
85
|
const n = window.execEditorCommand || window.executeEditorCommand;
|
|
82
86
|
if (typeof n == "function")
|
|
83
87
|
try {
|
|
@@ -85,16 +89,21 @@ const g = [
|
|
|
85
89
|
} catch (o) {
|
|
86
90
|
}
|
|
87
91
|
}, h = (e) => {
|
|
88
|
-
if (!e)
|
|
92
|
+
if (!e)
|
|
93
|
+
return !1;
|
|
89
94
|
try {
|
|
90
95
|
const t = E();
|
|
91
|
-
if (!t)
|
|
96
|
+
if (!t)
|
|
97
|
+
return !1;
|
|
92
98
|
const n = window.getSelection();
|
|
93
|
-
if (!n || n.rangeCount === 0)
|
|
99
|
+
if (!n || n.rangeCount === 0)
|
|
100
|
+
return !1;
|
|
94
101
|
const o = n.getRangeAt(0);
|
|
95
|
-
if (!t.contains(o.commonAncestorContainer))
|
|
102
|
+
if (!t.contains(o.commonAncestorContainer))
|
|
103
|
+
return !1;
|
|
96
104
|
const r = H(o, t);
|
|
97
|
-
if (r.length === 0)
|
|
105
|
+
if (r.length === 0)
|
|
106
|
+
return !1;
|
|
98
107
|
const s = t.innerHTML;
|
|
99
108
|
return r.forEach((a) => {
|
|
100
109
|
a.style.lineHeight = e;
|
|
@@ -148,4 +157,4 @@ export {
|
|
|
148
157
|
N as LineHeightPlugin,
|
|
149
158
|
h as setLineHeight
|
|
150
159
|
};
|
|
151
|
-
//# sourceMappingURL=LineHeightPlugin.native-
|
|
160
|
+
//# sourceMappingURL=LineHeightPlugin.native-5668f78c.mjs.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
let a = null, u = !1, l = null;
|
|
2
2
|
const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
|
|
3
|
-
if (!e)
|
|
3
|
+
if (!e)
|
|
4
|
+
return null;
|
|
4
5
|
let t = e;
|
|
5
6
|
for (; t; ) {
|
|
6
7
|
if (t.hasAttribute("contenteditable") && t.getAttribute("contenteditable") === "true" || t.hasAttribute("data-editora-content"))
|
|
@@ -11,12 +12,14 @@ const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
|
|
|
11
12
|
}, C = (e) => {
|
|
12
13
|
if (e) {
|
|
13
14
|
const o = e.startContainer, n = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
|
|
14
|
-
if (n != null && n.closest(p))
|
|
15
|
+
if (n != null && n.closest(p))
|
|
16
|
+
return !0;
|
|
15
17
|
}
|
|
16
18
|
const t = document.activeElement;
|
|
17
19
|
return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
|
|
18
20
|
}, T = () => {
|
|
19
|
-
if (document.getElementById("rte-link-dialog-theme-styles"))
|
|
21
|
+
if (document.getElementById("rte-link-dialog-theme-styles"))
|
|
22
|
+
return;
|
|
20
23
|
const e = document.createElement("style");
|
|
21
24
|
e.id = "rte-link-dialog-theme-styles", e.textContent = `
|
|
22
25
|
.link-dialog-overlay.rte-theme-dark .link-dialog {
|
|
@@ -202,7 +205,8 @@ const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
|
|
|
202
205
|
}), setTimeout(() => i.focus(), 100);
|
|
203
206
|
}, x = () => {
|
|
204
207
|
const e = window.getSelection();
|
|
205
|
-
if (!e || e.rangeCount === 0)
|
|
208
|
+
if (!e || e.rangeCount === 0)
|
|
209
|
+
return !1;
|
|
206
210
|
const t = e.getRangeAt(0).cloneRange();
|
|
207
211
|
a = t;
|
|
208
212
|
const o = C(t), n = e.toString() || "", r = t.startContainer, i = r.nodeType === Node.TEXT_NODE ? r.parentElement : r, d = i == null ? void 0 : i.closest("a");
|
|
@@ -280,4 +284,4 @@ export {
|
|
|
280
284
|
x as openLinkDialog,
|
|
281
285
|
h as removeLink
|
|
282
286
|
};
|
|
283
|
-
//# sourceMappingURL=LinkPlugin.native-
|
|
287
|
+
//# sourceMappingURL=LinkPlugin.native-6df29111.mjs.map
|
|
@@ -3,7 +3,8 @@ function g() {
|
|
|
3
3
|
const o = window.getSelection();
|
|
4
4
|
if (o && o.rangeCount > 0) {
|
|
5
5
|
const t = o.getRangeAt(0).startContainer, r = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, e = r == null ? void 0 : r.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
6
|
-
if (e)
|
|
6
|
+
if (e)
|
|
7
|
+
return e;
|
|
7
8
|
}
|
|
8
9
|
const n = document.activeElement;
|
|
9
10
|
return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
@@ -36,11 +37,14 @@ function f(o) {
|
|
|
36
37
|
}
|
|
37
38
|
function m(o) {
|
|
38
39
|
const n = g();
|
|
39
|
-
if (!n)
|
|
40
|
+
if (!n)
|
|
41
|
+
return !1;
|
|
40
42
|
const t = window.getSelection();
|
|
41
|
-
if (!t || t.rangeCount === 0)
|
|
43
|
+
if (!t || t.rangeCount === 0)
|
|
44
|
+
return !1;
|
|
42
45
|
const r = t.getRangeAt(0);
|
|
43
|
-
if (!n.contains(r.commonAncestorContainer))
|
|
46
|
+
if (!n.contains(r.commonAncestorContainer))
|
|
47
|
+
return !1;
|
|
44
48
|
n.focus({ preventScroll: !0 });
|
|
45
49
|
const e = document.execCommand(o, !1);
|
|
46
50
|
return f(n), n.dispatchEvent(new Event("input", { bubbles: !0 })), e !== !1;
|
|
@@ -103,4 +107,4 @@ export {
|
|
|
103
107
|
d as toggleBulletList,
|
|
104
108
|
u as toggleOrderedList
|
|
105
109
|
};
|
|
106
|
-
//# sourceMappingURL=ListPlugin.native-
|
|
110
|
+
//# sourceMappingURL=ListPlugin.native-fe2e115a.mjs.map
|