@editora/core 1.0.8 → 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-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-449ce66c.mjs} +79 -40
- 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-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs} +119 -60
- 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-BnU0qCwR.mjs → CitationsPlugin.native-169fb1e8.mjs} +137 -69
- 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-CfhY46rU.mjs → ConditionalContentPlugin.native-4983143a.mjs} +108 -51
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-63ed405b.mjs} +100 -50
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-427e9d75.mjs} +79 -40
- package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-8e41eda0.mjs} +115 -58
- 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-BMDlOqur.mjs → MentionPlugin.native-3b1e8c05.mjs} +89 -45
- package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-7ab10b9f.mjs} +107 -54
- package/dist/{PageBreakPlugin.native-DijGuHJZ.mjs → PageBreakPlugin.native-1794c5fb.mjs} +31 -16
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-f7b67cc0.mjs} +11 -6
- package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-8d45e511.mjs} +72 -37
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-a6c5efec.mjs} +99 -50
- 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-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs} +115 -58
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-4e711b1e.mjs} +160 -91
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-5bbeff85.mjs} +51 -26
- 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-DqC57IEH.mjs → index-7da30697.mjs} +163 -124
- 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 +67 -67
- package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
- package/dist/style.css +1 -0
- package/dist/webcomponent-core.js +164 -125
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +18 -17
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +226 -187
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1324 -1117
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
- package/dist/core.css +0 -1
- package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
- package/dist/index-BslAFzmv.mjs +0 -16544
- package/dist/index-D1LOqg5C.js +0 -10
- package/dist/index.es-BYD2KEo6.mjs +0 -6666
package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs}
RENAMED
|
@@ -45,7 +45,8 @@ function xe(e) {
|
|
|
45
45
|
/\s(href|src|xlink:href)\s*=\s*("([^"]*)"|'([^']*)')/gi,
|
|
46
46
|
(r, o, l, n, a) => {
|
|
47
47
|
const s = typeof n == "string" && n.length > 0 ? n : a || "", i = ce(s);
|
|
48
|
-
if (!i)
|
|
48
|
+
if (!i)
|
|
49
|
+
return "";
|
|
49
50
|
const c = l.startsWith('"') ? '"' : "'";
|
|
50
51
|
return ` ${o}=${c}${i}${c}`;
|
|
51
52
|
}
|
|
@@ -61,7 +62,8 @@ function xe(e) {
|
|
|
61
62
|
}).trim(), t;
|
|
62
63
|
}
|
|
63
64
|
function We(e) {
|
|
64
|
-
if (!e)
|
|
65
|
+
if (!e)
|
|
66
|
+
return "";
|
|
65
67
|
if (typeof document == "undefined")
|
|
66
68
|
return xe(e);
|
|
67
69
|
const t = document.createElement("template");
|
|
@@ -98,7 +100,8 @@ function ne(e) {
|
|
|
98
100
|
return e.trim().toLowerCase();
|
|
99
101
|
}
|
|
100
102
|
function Fe(e) {
|
|
101
|
-
if (!e)
|
|
103
|
+
if (!e)
|
|
104
|
+
return "";
|
|
102
105
|
if (typeof document == "undefined")
|
|
103
106
|
return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
104
107
|
const t = document.createElement("template");
|
|
@@ -107,11 +110,13 @@ function Fe(e) {
|
|
|
107
110
|
return !r || typeof r.textContent != "string" ? e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim() : r.textContent.replace(/\s+/g, " ").trim();
|
|
108
111
|
}
|
|
109
112
|
function Be(e, t) {
|
|
110
|
-
if (!Array.isArray(e) || e.length === 0)
|
|
113
|
+
if (!Array.isArray(e) || e.length === 0)
|
|
114
|
+
return [];
|
|
111
115
|
const r = /* @__PURE__ */ new Set(), o = [];
|
|
112
116
|
return e.forEach((l) => {
|
|
113
117
|
const n = t.normalizeText(l.label || ""), a = t.sanitizeBlockHtml(l.html || "", l).trim();
|
|
114
|
-
if (!n || !a)
|
|
118
|
+
if (!n || !a)
|
|
119
|
+
return;
|
|
115
120
|
const s = t.normalizeText(l.category || "General") || "General", i = ne(s);
|
|
116
121
|
let d = je(t.normalizeText(l.id || n)) || `block-${ke++}`;
|
|
117
122
|
for (; r.has(d); )
|
|
@@ -177,22 +182,28 @@ function le(e) {
|
|
|
177
182
|
return e.closest(fe) || e;
|
|
178
183
|
}
|
|
179
184
|
function G(e) {
|
|
180
|
-
if (!e)
|
|
181
|
-
|
|
185
|
+
if (!e)
|
|
186
|
+
return null;
|
|
187
|
+
if (e.matches(L))
|
|
188
|
+
return e;
|
|
182
189
|
const t = e.querySelector(L);
|
|
183
190
|
return t instanceof HTMLElement ? t : null;
|
|
184
191
|
}
|
|
185
192
|
function Ue() {
|
|
186
|
-
if (typeof window == "undefined")
|
|
193
|
+
if (typeof window == "undefined")
|
|
194
|
+
return null;
|
|
187
195
|
const e = window[ye];
|
|
188
|
-
if (!(e instanceof HTMLElement))
|
|
196
|
+
if (!(e instanceof HTMLElement))
|
|
197
|
+
return null;
|
|
189
198
|
window[ye] = null;
|
|
190
199
|
const t = G(e);
|
|
191
|
-
if (t)
|
|
200
|
+
if (t)
|
|
201
|
+
return t;
|
|
192
202
|
const r = e.closest(fe);
|
|
193
203
|
if (r) {
|
|
194
204
|
const l = G(r);
|
|
195
|
-
if (l)
|
|
205
|
+
if (l)
|
|
206
|
+
return l;
|
|
196
207
|
}
|
|
197
208
|
const o = e.closest(L);
|
|
198
209
|
return o instanceof HTMLElement ? o : null;
|
|
@@ -218,26 +229,33 @@ function ee() {
|
|
|
218
229
|
});
|
|
219
230
|
}
|
|
220
231
|
function S(e, t = !0, r = !0) {
|
|
221
|
-
if (ee(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
232
|
+
if (ee(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
|
|
233
|
+
return e.contentElement;
|
|
222
234
|
if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
|
|
223
235
|
const a = G(e.editorElement);
|
|
224
|
-
if (a)
|
|
236
|
+
if (a)
|
|
237
|
+
return a;
|
|
225
238
|
}
|
|
226
239
|
const o = Ue();
|
|
227
|
-
if (o)
|
|
240
|
+
if (o)
|
|
241
|
+
return o;
|
|
228
242
|
const l = window.getSelection();
|
|
229
243
|
if (l && l.rangeCount > 0) {
|
|
230
244
|
const a = $e(l.getRangeAt(0).startContainer), s = a == null ? void 0 : a.closest(L);
|
|
231
|
-
if (s)
|
|
245
|
+
if (s)
|
|
246
|
+
return s;
|
|
232
247
|
}
|
|
233
248
|
const n = document.activeElement;
|
|
234
249
|
if (n) {
|
|
235
|
-
if (n.matches(L))
|
|
250
|
+
if (n.matches(L))
|
|
251
|
+
return n;
|
|
236
252
|
const a = n.closest(L);
|
|
237
|
-
if (a)
|
|
253
|
+
if (a)
|
|
254
|
+
return a;
|
|
238
255
|
}
|
|
239
256
|
if (r) {
|
|
240
|
-
if (y && y.isConnected)
|
|
257
|
+
if (y && y.isConnected)
|
|
258
|
+
return y;
|
|
241
259
|
y && !y.isConnected && (y = null);
|
|
242
260
|
}
|
|
243
261
|
return t ? document.querySelector(L) : null;
|
|
@@ -246,12 +264,14 @@ function Ye(e) {
|
|
|
246
264
|
const t = e.target;
|
|
247
265
|
if (t) {
|
|
248
266
|
const o = t.closest(L);
|
|
249
|
-
if (o)
|
|
267
|
+
if (o)
|
|
268
|
+
return o;
|
|
250
269
|
}
|
|
251
270
|
const r = window.getSelection();
|
|
252
271
|
if (r && r.rangeCount > 0) {
|
|
253
272
|
const o = $e(r.getRangeAt(0).startContainer), l = o == null ? void 0 : o.closest(L);
|
|
254
|
-
if (l)
|
|
273
|
+
if (l)
|
|
274
|
+
return l;
|
|
255
275
|
}
|
|
256
276
|
return null;
|
|
257
277
|
}
|
|
@@ -260,7 +280,8 @@ function Z(e) {
|
|
|
260
280
|
}
|
|
261
281
|
function Xe(e) {
|
|
262
282
|
const t = le(e);
|
|
263
|
-
if (Z(t))
|
|
283
|
+
if (Z(t))
|
|
284
|
+
return !0;
|
|
264
285
|
const r = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
265
286
|
return Z(r) ? !0 : Z(document.documentElement) || Z(document.body);
|
|
266
287
|
}
|
|
@@ -294,7 +315,8 @@ function se(e) {
|
|
|
294
315
|
}
|
|
295
316
|
function Se(e) {
|
|
296
317
|
const t = q.get(e);
|
|
297
|
-
if (!t)
|
|
318
|
+
if (!t)
|
|
319
|
+
return null;
|
|
298
320
|
if (!e.isConnected)
|
|
299
321
|
return q.delete(e), null;
|
|
300
322
|
try {
|
|
@@ -309,10 +331,12 @@ function Ze(e) {
|
|
|
309
331
|
return t ? (He(e, t), !0) : !1;
|
|
310
332
|
}
|
|
311
333
|
function Je(e) {
|
|
312
|
-
if (te.has(e))
|
|
334
|
+
if (te.has(e))
|
|
335
|
+
return;
|
|
313
336
|
const t = () => {
|
|
314
337
|
const r = window.getSelection();
|
|
315
|
-
if (!r || r.rangeCount === 0)
|
|
338
|
+
if (!r || r.rangeCount === 0)
|
|
339
|
+
return;
|
|
316
340
|
const o = r.getRangeAt(0);
|
|
317
341
|
e.contains(o.commonAncestorContainer) && se(e);
|
|
318
342
|
};
|
|
@@ -356,7 +380,8 @@ function et(e) {
|
|
|
356
380
|
if (!(a.type !== "childList" || a.removedNodes.length === 0))
|
|
357
381
|
for (let s = 0; s < a.removedNodes.length; s += 1) {
|
|
358
382
|
const i = a.removedNodes[s];
|
|
359
|
-
if (i.nodeType !== Node.ELEMENT_NODE)
|
|
383
|
+
if (i.nodeType !== Node.ELEMENT_NODE)
|
|
384
|
+
continue;
|
|
360
385
|
const c = i;
|
|
361
386
|
if ((t = c.matches) != null && t.call(c, L) || (r = c.matches) != null && r.call(c, `.${u}`) || (o = c.querySelector) != null && o.call(c, L) || (l = c.querySelector) != null && l.call(c, `.${u}`))
|
|
362
387
|
return !0;
|
|
@@ -368,7 +393,8 @@ function pe(e) {
|
|
|
368
393
|
return U.get(e) === !0;
|
|
369
394
|
}
|
|
370
395
|
function de(e, t) {
|
|
371
|
-
if (!t.classList.contains("show"))
|
|
396
|
+
if (!t.classList.contains("show"))
|
|
397
|
+
return;
|
|
372
398
|
const r = le(e).getBoundingClientRect(), o = Math.min(window.innerWidth - 20, 420), l = Math.max(10, window.innerWidth - o - 10), n = Math.min(Math.max(10, r.right - o), l), a = Math.max(10, Math.min(window.innerHeight - 10, r.top + 12));
|
|
373
399
|
t.style.width = `${o}px`, t.style.left = `${n}px`, t.style.top = `${a}px`, t.style.maxHeight = `${Math.max(260, window.innerHeight - 20)}px`;
|
|
374
400
|
}
|
|
@@ -407,7 +433,8 @@ function Ae(e, t) {
|
|
|
407
433
|
}
|
|
408
434
|
function rt(e, t) {
|
|
409
435
|
const r = w.get(e);
|
|
410
|
-
if (!r)
|
|
436
|
+
if (!r)
|
|
437
|
+
return;
|
|
411
438
|
if (t.length === 0) {
|
|
412
439
|
r.selectedBlockId = null;
|
|
413
440
|
return;
|
|
@@ -420,7 +447,8 @@ function N(e) {
|
|
|
420
447
|
}
|
|
421
448
|
function v(e) {
|
|
422
449
|
const t = x.get(e), r = b.get(e) || A, o = w.get(e);
|
|
423
|
-
if (!t || !r || !o)
|
|
450
|
+
if (!t || !r || !o)
|
|
451
|
+
return;
|
|
424
452
|
re(t, e);
|
|
425
453
|
const l = t.querySelector(".rte-blocks-library-title");
|
|
426
454
|
l && (l.textContent = r.labels.panelTitle);
|
|
@@ -499,11 +527,14 @@ function ot(e) {
|
|
|
499
527
|
}
|
|
500
528
|
function Le(e, t) {
|
|
501
529
|
const r = b.get(e) || A;
|
|
502
|
-
if (!r)
|
|
530
|
+
if (!r)
|
|
531
|
+
return;
|
|
503
532
|
const o = w.get(e);
|
|
504
|
-
if (!o)
|
|
533
|
+
if (!o)
|
|
534
|
+
return;
|
|
505
535
|
const l = Ae(e, r);
|
|
506
|
-
if (l.length === 0)
|
|
536
|
+
if (l.length === 0)
|
|
537
|
+
return;
|
|
507
538
|
const a = (Math.max(
|
|
508
539
|
0,
|
|
509
540
|
l.findIndex((i) => i.id === o.selectedBlockId)
|
|
@@ -526,23 +557,27 @@ function Ie(e, t) {
|
|
|
526
557
|
}
|
|
527
558
|
function Re(e) {
|
|
528
559
|
const t = window.getSelection();
|
|
529
|
-
if (!t || t.rangeCount === 0)
|
|
560
|
+
if (!t || t.rangeCount === 0)
|
|
561
|
+
return null;
|
|
530
562
|
const r = t.getRangeAt(0);
|
|
531
563
|
return e.contains(r.commonAncestorContainer) ? r : null;
|
|
532
564
|
}
|
|
533
565
|
function He(e, t) {
|
|
534
|
-
if (!e.isConnected)
|
|
566
|
+
if (!e.isConnected)
|
|
567
|
+
return;
|
|
535
568
|
const r = window.getSelection();
|
|
536
569
|
r && (r.removeAllRanges(), r.addRange(t));
|
|
537
570
|
}
|
|
538
571
|
function ve(e, t, r) {
|
|
539
572
|
const o = t.cloneRange();
|
|
540
|
-
if (!e.contains(o.commonAncestorContainer))
|
|
573
|
+
if (!e.contains(o.commonAncestorContainer))
|
|
574
|
+
return !1;
|
|
541
575
|
o.deleteContents();
|
|
542
576
|
const l = document.createElement("template");
|
|
543
577
|
l.innerHTML = r;
|
|
544
578
|
const n = l.content;
|
|
545
|
-
if (!n)
|
|
579
|
+
if (!n)
|
|
580
|
+
return !1;
|
|
546
581
|
const a = n.lastChild;
|
|
547
582
|
if (o.insertNode(n), a) {
|
|
548
583
|
const s = document.createRange();
|
|
@@ -564,7 +599,8 @@ function nt(e, t) {
|
|
|
564
599
|
return o ? ve(e, o, t) : !1;
|
|
565
600
|
}
|
|
566
601
|
function lt(e, t) {
|
|
567
|
-
if (t === e.innerHTML)
|
|
602
|
+
if (t === e.innerHTML)
|
|
603
|
+
return;
|
|
568
604
|
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
569
605
|
if (typeof r == "function")
|
|
570
606
|
try {
|
|
@@ -577,12 +613,14 @@ function st(e) {
|
|
|
577
613
|
}
|
|
578
614
|
function F(e, t) {
|
|
579
615
|
const r = b.get(e) || A;
|
|
580
|
-
if (!r)
|
|
616
|
+
if (!r)
|
|
617
|
+
return !1;
|
|
581
618
|
const o = k(e, r), l = x.get(e);
|
|
582
619
|
if (Te(e))
|
|
583
620
|
return l && Ee(l, r.labels.readonlyMessage), !1;
|
|
584
621
|
const n = ae(e).find((i) => i.id === t);
|
|
585
|
-
if (!n)
|
|
622
|
+
if (!n)
|
|
623
|
+
return !1;
|
|
586
624
|
const a = e.innerHTML;
|
|
587
625
|
return nt(e, n.html) ? (o.lastInsertedBlockId = n.id, o.selectedBlockId = n.id, o.recentBlockIds = [n.id, ...o.recentBlockIds.filter((i) => i !== n.id)].slice(
|
|
588
626
|
0,
|
|
@@ -604,9 +642,11 @@ function ze(e) {
|
|
|
604
642
|
}
|
|
605
643
|
function at(e) {
|
|
606
644
|
const t = b.get(e) || A;
|
|
607
|
-
if (!t)
|
|
645
|
+
if (!t)
|
|
646
|
+
return;
|
|
608
647
|
const r = w.get(e);
|
|
609
|
-
if (!r)
|
|
648
|
+
if (!r)
|
|
649
|
+
return;
|
|
610
650
|
Me(e);
|
|
611
651
|
const o = () => {
|
|
612
652
|
r.debounceTimer = null, r.filterCache.clear(), v(e);
|
|
@@ -619,7 +659,8 @@ function at(e) {
|
|
|
619
659
|
}
|
|
620
660
|
function it(e) {
|
|
621
661
|
const t = x.get(e);
|
|
622
|
-
if (t)
|
|
662
|
+
if (t)
|
|
663
|
+
return t;
|
|
623
664
|
const r = b.get(e) || A || Q(), o = k(e, r), l = `rte-blocks-library-panel-${Ne++}`, n = `${l}-query`, a = `${l}-category`, s = document.createElement("section");
|
|
624
665
|
return s.className = u, s.id = l, s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "false"), s.setAttribute("aria-label", r.labels.panelAriaLabel), s.innerHTML = `
|
|
625
666
|
<header class="rte-blocks-library-header">
|
|
@@ -653,13 +694,15 @@ function it(e) {
|
|
|
653
694
|
return;
|
|
654
695
|
}
|
|
655
696
|
if (h === "insert-selected") {
|
|
656
|
-
if (!o.selectedBlockId)
|
|
697
|
+
if (!o.selectedBlockId)
|
|
698
|
+
return;
|
|
657
699
|
F(e, o.selectedBlockId) && M(e, !0);
|
|
658
700
|
}
|
|
659
701
|
return;
|
|
660
702
|
}
|
|
661
703
|
const f = c == null ? void 0 : c.closest("[data-block-id]");
|
|
662
|
-
if (!f)
|
|
704
|
+
if (!f)
|
|
705
|
+
return;
|
|
663
706
|
const g = f.getAttribute("data-block-id");
|
|
664
707
|
g && (o.selectedBlockId = g, v(e), i.detail >= 2 && F(e, g) && M(e, !0));
|
|
665
708
|
}), s.addEventListener("input", (i) => {
|
|
@@ -683,7 +726,8 @@ function it(e) {
|
|
|
683
726
|
}
|
|
684
727
|
if (i.key === "Enter") {
|
|
685
728
|
const c = i.target;
|
|
686
|
-
if (!(c == null ? void 0 : c.matches('[data-field="query"], [data-field="category"], [data-block-id]')) || !o.selectedBlockId)
|
|
729
|
+
if (!(c == null ? void 0 : c.matches('[data-field="query"], [data-field="category"], [data-block-id]')) || !o.selectedBlockId)
|
|
730
|
+
return;
|
|
687
731
|
i.preventDefault(), F(e, o.selectedBlockId) && M(e, !0);
|
|
688
732
|
}
|
|
689
733
|
}), re(s, e), document.body.appendChild(s), x.set(e, s), U.set(e, !1), v(e), s;
|
|
@@ -704,7 +748,8 @@ function ct(e) {
|
|
|
704
748
|
}
|
|
705
749
|
async function be(e, t) {
|
|
706
750
|
const r = b.get(e) || A;
|
|
707
|
-
if (!r || typeof r.getBlocks != "function")
|
|
751
|
+
if (!r || typeof r.getBlocks != "function")
|
|
752
|
+
return;
|
|
708
753
|
const o = k(e, r), l = O.get(e) || 0;
|
|
709
754
|
if (!t && r.cacheTtlMs > 0 && Date.now() - l < r.cacheTtlMs)
|
|
710
755
|
return;
|
|
@@ -724,13 +769,15 @@ async function be(e, t) {
|
|
|
724
769
|
editorRoot: le(e),
|
|
725
770
|
signal: s.signal
|
|
726
771
|
}, f = await ((C = r.getBlocks) == null ? void 0 : C.call(r, d));
|
|
727
|
-
if (s.signal.aborted || z.get(e) !== i)
|
|
772
|
+
if (s.signal.aborted || z.get(e) !== i)
|
|
773
|
+
return;
|
|
728
774
|
const g = Be(f || [], r);
|
|
729
775
|
R.set(e, g), O.set(e, Date.now());
|
|
730
776
|
const h = w.get(e);
|
|
731
777
|
h && (h.loading = !1, h.loadError = null, h.filterCache.clear());
|
|
732
778
|
}).catch(() => {
|
|
733
|
-
if (s.signal.aborted || z.get(e) !== i)
|
|
779
|
+
if (s.signal.aborted || z.get(e) !== i)
|
|
780
|
+
return;
|
|
734
781
|
const d = w.get(e);
|
|
735
782
|
d && (d.loading = !1, d.loadError = r.labels.loadErrorText);
|
|
736
783
|
}).finally(() => {
|
|
@@ -750,13 +797,15 @@ function bt(e) {
|
|
|
750
797
|
A = e, _ || (_ = (t) => {
|
|
751
798
|
ee();
|
|
752
799
|
const r = t.target, o = r == null ? void 0 : r.closest(L);
|
|
753
|
-
if (!o)
|
|
800
|
+
if (!o)
|
|
801
|
+
return;
|
|
754
802
|
const l = b.get(o) || e;
|
|
755
803
|
k(o, l), b.set(o, l), y = o, N(o);
|
|
756
804
|
const n = x.get(o);
|
|
757
805
|
n && (re(n, o), de(o, n), v(o));
|
|
758
806
|
}, document.addEventListener("focusin", _, !0)), P || (P = (t) => {
|
|
759
|
-
if (t.defaultPrevented)
|
|
807
|
+
if (t.defaultPrevented)
|
|
808
|
+
return;
|
|
760
809
|
const r = `.${u} input, .${u} textarea, .${u} select`, o = t.target;
|
|
761
810
|
if (o != null && o.closest(r)) {
|
|
762
811
|
if (t.key === "Escape") {
|
|
@@ -766,7 +815,8 @@ function bt(e) {
|
|
|
766
815
|
return;
|
|
767
816
|
}
|
|
768
817
|
const l = Ye(t);
|
|
769
|
-
if (!l)
|
|
818
|
+
if (!l)
|
|
819
|
+
return;
|
|
770
820
|
const n = b.get(l) || A || e;
|
|
771
821
|
if (k(l, n), b.set(l, n), y = l, t.key === "Escape" && pe(l)) {
|
|
772
822
|
t.preventDefault(), M(l, !0);
|
|
@@ -792,7 +842,8 @@ function ft() {
|
|
|
792
842
|
_ && (document.removeEventListener("focusin", _, !0), _ = null), P && (document.removeEventListener("keydown", P, !0), P = null), I && (window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I), I = null), D && (D.disconnect(), D = null), x.forEach((t) => t.remove()), x.clear(), Array.from(oe).forEach((t) => ge(t)), A = null, y = null;
|
|
793
843
|
}
|
|
794
844
|
function gt() {
|
|
795
|
-
if (typeof document == "undefined" || document.getElementById(he))
|
|
845
|
+
if (typeof document == "undefined" || document.getElementById(he))
|
|
846
|
+
return;
|
|
796
847
|
const e = document.createElement("style");
|
|
797
848
|
e.id = he, e.textContent = `
|
|
798
849
|
.rte-toolbar-group-items.${E},
|
|
@@ -1225,25 +1276,29 @@ const pt = (e = {}) => {
|
|
|
1225
1276
|
commands: {
|
|
1226
1277
|
blocksLibrary: (o, l) => {
|
|
1227
1278
|
const n = S(l, !1, !1);
|
|
1228
|
-
if (!n)
|
|
1279
|
+
if (!n)
|
|
1280
|
+
return !1;
|
|
1229
1281
|
const a = b.get(n) || t;
|
|
1230
1282
|
return k(n, a), b.set(n, a), y = n, ue(n), !0;
|
|
1231
1283
|
},
|
|
1232
1284
|
openBlocksLibraryPanel: (o, l) => {
|
|
1233
1285
|
const n = S(l, !1, !1);
|
|
1234
|
-
if (!n)
|
|
1286
|
+
if (!n)
|
|
1287
|
+
return !1;
|
|
1235
1288
|
const a = b.get(n) || t;
|
|
1236
1289
|
return k(n, a), b.set(n, a), y = n, ue(n), !0;
|
|
1237
1290
|
},
|
|
1238
1291
|
toggleBlocksLibraryPanel: (o, l) => {
|
|
1239
1292
|
const n = S(l, !1, !1);
|
|
1240
|
-
if (!n)
|
|
1293
|
+
if (!n)
|
|
1294
|
+
return !1;
|
|
1241
1295
|
const a = b.get(n) || t;
|
|
1242
1296
|
return k(n, a), b.set(n, a), y = n, Ie(n, typeof o == "boolean" ? o : void 0);
|
|
1243
1297
|
},
|
|
1244
1298
|
insertBlockSnippet: (o, l) => {
|
|
1245
1299
|
const n = S(l, !1, !1);
|
|
1246
|
-
if (!n)
|
|
1300
|
+
if (!n)
|
|
1301
|
+
return !1;
|
|
1247
1302
|
const a = b.get(n) || t;
|
|
1248
1303
|
k(n, a), b.set(n, a);
|
|
1249
1304
|
const s = typeof o == "string" ? o : o == null ? void 0 : o.id;
|
|
@@ -1251,19 +1306,22 @@ const pt = (e = {}) => {
|
|
|
1251
1306
|
},
|
|
1252
1307
|
insertLastBlockSnippet: (o, l) => {
|
|
1253
1308
|
const n = S(l, !1, !1);
|
|
1254
|
-
if (!n)
|
|
1309
|
+
if (!n)
|
|
1310
|
+
return !1;
|
|
1255
1311
|
const a = b.get(n) || t;
|
|
1256
1312
|
return k(n, a), b.set(n, a), y = n, ze(n);
|
|
1257
1313
|
},
|
|
1258
1314
|
refreshBlocksLibraryData: (o, l) => {
|
|
1259
1315
|
const n = S(l, !1, !1);
|
|
1260
|
-
if (!n)
|
|
1316
|
+
if (!n)
|
|
1317
|
+
return !1;
|
|
1261
1318
|
const a = b.get(n) || t;
|
|
1262
1319
|
return k(n, a), b.set(n, a), be(n, !0), !0;
|
|
1263
1320
|
},
|
|
1264
1321
|
setBlocksLibraryOptions: (o, l) => {
|
|
1265
1322
|
const n = S(l, !1, !1);
|
|
1266
|
-
if (!n || !o || typeof o != "object")
|
|
1323
|
+
if (!n || !o || typeof o != "object")
|
|
1324
|
+
return !1;
|
|
1267
1325
|
const a = b.get(n) || t, s = J.get(n) || Ge(a), i = {
|
|
1268
1326
|
...s,
|
|
1269
1327
|
...o,
|
|
@@ -1282,7 +1340,8 @@ const pt = (e = {}) => {
|
|
|
1282
1340
|
},
|
|
1283
1341
|
getBlocksLibraryState: (o, l) => {
|
|
1284
1342
|
const n = S(l, !1, !1);
|
|
1285
|
-
if (!n)
|
|
1343
|
+
if (!n)
|
|
1344
|
+
return !1;
|
|
1286
1345
|
const a = b.get(n) || t;
|
|
1287
1346
|
k(n, a);
|
|
1288
1347
|
const s = ct(n);
|
|
@@ -1324,4 +1383,4 @@ const pt = (e = {}) => {
|
|
|
1324
1383
|
export {
|
|
1325
1384
|
pt as BlocksLibraryPlugin
|
|
1326
1385
|
};
|
|
1327
|
-
//# sourceMappingURL=BlocksLibraryPlugin.native-
|
|
1386
|
+
//# sourceMappingURL=BlocksLibraryPlugin.native-1cc51e63.mjs.map
|
package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs}
RENAMED
|
@@ -50,7 +50,8 @@ const i = () => {
|
|
|
50
50
|
],
|
|
51
51
|
commands: {
|
|
52
52
|
setCapitalization: (e) => {
|
|
53
|
-
if (!e)
|
|
53
|
+
if (!e)
|
|
54
|
+
return !1;
|
|
54
55
|
switch (e) {
|
|
55
56
|
case "uppercase":
|
|
56
57
|
return o();
|
|
@@ -76,4 +77,4 @@ const i = () => {
|
|
|
76
77
|
export {
|
|
77
78
|
i as CapitalizationPlugin
|
|
78
79
|
};
|
|
79
|
-
//# sourceMappingURL=CapitalizationPlugin.native-
|
|
80
|
+
//# sourceMappingURL=CapitalizationPlugin.native-42c135dc.mjs.map
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
2
|
-
if (!t)
|
|
2
|
+
if (!t)
|
|
3
|
+
return null;
|
|
3
4
|
const e = t.querySelector('[contenteditable="true"]');
|
|
4
5
|
return e instanceof HTMLElement ? e : null;
|
|
5
6
|
}, A = () => {
|
|
6
|
-
if (typeof window == "undefined")
|
|
7
|
+
if (typeof window == "undefined")
|
|
8
|
+
return null;
|
|
7
9
|
const t = window[N];
|
|
8
|
-
if (!(t instanceof HTMLElement))
|
|
10
|
+
if (!(t instanceof HTMLElement))
|
|
11
|
+
return null;
|
|
9
12
|
window[N] = null;
|
|
10
13
|
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);
|
|
11
14
|
if (e) {
|
|
12
15
|
const n = w(e);
|
|
13
|
-
if (n)
|
|
14
|
-
|
|
16
|
+
if (n)
|
|
17
|
+
return n;
|
|
18
|
+
if (e.getAttribute("contenteditable") === "true")
|
|
19
|
+
return e;
|
|
15
20
|
}
|
|
16
21
|
if (t.getAttribute("contenteditable") === "true")
|
|
17
22
|
return t;
|
|
@@ -38,18 +43,21 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
38
43
|
if (r.getAttribute("contenteditable") === "true")
|
|
39
44
|
return r;
|
|
40
45
|
const n = r.closest('[contenteditable="true"]');
|
|
41
|
-
if (n)
|
|
46
|
+
if (n)
|
|
47
|
+
return n;
|
|
42
48
|
}
|
|
43
49
|
return document.querySelector('[contenteditable="true"]');
|
|
44
50
|
}, H = (t) => t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null, S = (t) => {
|
|
45
51
|
const e = window.getSelection();
|
|
46
|
-
if (!e || e.rangeCount === 0)
|
|
52
|
+
if (!e || e.rangeCount === 0)
|
|
53
|
+
return null;
|
|
47
54
|
const r = e.getRangeAt(0);
|
|
48
55
|
return t.contains(r.commonAncestorContainer) ? r : null;
|
|
49
56
|
}, y = (t) => {
|
|
50
57
|
t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
51
58
|
}, M = (t, e) => {
|
|
52
|
-
if (e === t.innerHTML)
|
|
59
|
+
if (e === t.innerHTML)
|
|
60
|
+
return;
|
|
53
61
|
const r = window.execEditorCommand || window.executeEditorCommand;
|
|
54
62
|
if (typeof r == "function")
|
|
55
63
|
try {
|
|
@@ -62,7 +70,8 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
62
70
|
return;
|
|
63
71
|
}
|
|
64
72
|
const r = window.getSelection();
|
|
65
|
-
if (!r)
|
|
73
|
+
if (!r)
|
|
74
|
+
return;
|
|
66
75
|
const n = document.createRange();
|
|
67
76
|
n.selectNodeContents(t), n.collapse(!1), r.removeAllRanges();
|
|
68
77
|
try {
|
|
@@ -109,8 +118,10 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
109
118
|
for (; l && l !== document.body; ) {
|
|
110
119
|
if (l.nodeType === Node.ELEMENT_NODE) {
|
|
111
120
|
const h = l;
|
|
112
|
-
if (b(h))
|
|
113
|
-
|
|
121
|
+
if (b(h))
|
|
122
|
+
return h;
|
|
123
|
+
if (h.getAttribute("contenteditable") === "true")
|
|
124
|
+
break;
|
|
114
125
|
}
|
|
115
126
|
l = l.parentNode;
|
|
116
127
|
}
|
|
@@ -124,7 +135,8 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
124
135
|
{
|
|
125
136
|
acceptNode: (a) => {
|
|
126
137
|
const l = a;
|
|
127
|
-
if (!b(l) || l.closest("ul, ol"))
|
|
138
|
+
if (!b(l) || l.closest("ul, ol"))
|
|
139
|
+
return NodeFilter.FILTER_SKIP;
|
|
128
140
|
if (typeof t.intersectsNode == "function")
|
|
129
141
|
return t.intersectsNode(l) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
130
142
|
const h = document.createRange();
|
|
@@ -142,7 +154,8 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
142
154
|
}, O = (t) => {
|
|
143
155
|
const e = [], r = document.createElement("div"), n = () => {
|
|
144
156
|
const o = r.innerHTML.trim();
|
|
145
|
-
if (!o)
|
|
157
|
+
if (!o)
|
|
158
|
+
return;
|
|
146
159
|
const u = document.createElement("p");
|
|
147
160
|
u.innerHTML = o, e.push(u), r.innerHTML = "";
|
|
148
161
|
};
|
|
@@ -167,16 +180,20 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
167
180
|
name: "checklist",
|
|
168
181
|
// Initialize click handler when plugin is loaded
|
|
169
182
|
init: () => {
|
|
170
|
-
if (typeof document == "undefined" || typeof window == "undefined" || window.__checklistPluginClickInitialized)
|
|
183
|
+
if (typeof document == "undefined" || typeof window == "undefined" || window.__checklistPluginClickInitialized)
|
|
184
|
+
return;
|
|
171
185
|
window.__checklistPluginClickInitialized = !0;
|
|
172
186
|
const t = (e) => {
|
|
173
187
|
const n = e.target.closest('li[data-type="checklist-item"]');
|
|
174
|
-
if (!n)
|
|
188
|
+
if (!n)
|
|
189
|
+
return;
|
|
175
190
|
const o = n.getBoundingClientRect();
|
|
176
|
-
if (!(e.clientX - o.left < 32))
|
|
191
|
+
if (!(e.clientX - o.left < 32))
|
|
192
|
+
return;
|
|
177
193
|
e.preventDefault(), e.stopPropagation();
|
|
178
194
|
const i = n.closest("[contenteditable], .rte-content, .editora-content");
|
|
179
|
-
if ((i == null ? void 0 : i.getAttribute("contenteditable")) === "false" || !!(i != null && i.closest('[data-readonly="true"], .editora-editor[readonly], editora-editor[readonly]')))
|
|
195
|
+
if ((i == null ? void 0 : i.getAttribute("contenteditable")) === "false" || !!(i != null && i.closest('[data-readonly="true"], .editora-editor[readonly], editora-editor[readonly]')))
|
|
196
|
+
return;
|
|
180
197
|
const a = (i == null ? void 0 : i.innerHTML) || "", l = n.getAttribute("data-checked") === "true";
|
|
181
198
|
n.setAttribute("data-checked", (!l).toString()), i && (M(i, a), y(i));
|
|
182
199
|
};
|
|
@@ -228,15 +245,19 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
228
245
|
toggleChecklist: () => {
|
|
229
246
|
try {
|
|
230
247
|
const t = _();
|
|
231
|
-
if (!t)
|
|
248
|
+
if (!t)
|
|
249
|
+
return !1;
|
|
232
250
|
const e = t.innerHTML, r = () => (M(t, e), y(t), !0), n = S(t);
|
|
233
|
-
if (!n)
|
|
251
|
+
if (!n)
|
|
252
|
+
return !1;
|
|
234
253
|
const o = H(n.startContainer);
|
|
235
|
-
if (!o)
|
|
254
|
+
if (!o)
|
|
255
|
+
return !1;
|
|
236
256
|
const u = o.closest('ul[data-type="checklist"]');
|
|
237
257
|
if (u && t.contains(u)) {
|
|
238
258
|
const c = T(u);
|
|
239
|
-
if (c.length === 0)
|
|
259
|
+
if (c.length === 0)
|
|
260
|
+
return !1;
|
|
240
261
|
const p = document.createDocumentFragment();
|
|
241
262
|
let s = null;
|
|
242
263
|
return c.forEach((f, g) => {
|
|
@@ -306,4 +327,4 @@ const N = "__editoraCommandEditorRoot", w = (t) => {
|
|
|
306
327
|
export {
|
|
307
328
|
D as ChecklistPlugin
|
|
308
329
|
};
|
|
309
|
-
//# sourceMappingURL=ChecklistPlugin.native-
|
|
330
|
+
//# sourceMappingURL=ChecklistPlugin.native-3b397ee9.mjs.map
|