@editora/core 1.0.32 → 1.1.0
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 +40 -12
- package/dist/{VersionDiffPlugin.native-DJZIzFSK.mjs → VersionDiffPlugin.native-2v8ZaZWN.mjs} +248 -247
- package/dist/editora.min.js +21 -21
- package/dist/editora.umd.js +15 -15
- package/dist/index-GWw_bIws.js +12 -0
- package/dist/{index-BV8-D8fY.mjs → index-aIPU3kLC.mjs} +1023 -750
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +3 -3
- package/dist/webcomponent-core.js +911 -638
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +62 -62
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +1065 -795
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +253 -253
- package/package.json +1 -1
- package/dist/index--nPMqCvI.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class _o {
|
|
2
2
|
constructor() {
|
|
3
3
|
this.loadedPlugins = /* @__PURE__ */ new Map(), this.pluginRegistry = /* @__PURE__ */ new Map();
|
|
4
4
|
}
|
|
@@ -86,19 +86,19 @@ class Co {
|
|
|
86
86
|
return this.loadedPlugins.has(t);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class Yt {
|
|
90
90
|
constructor(t, e, o) {
|
|
91
91
|
this.doc = t, this.selection = e, this.schema = o;
|
|
92
92
|
}
|
|
93
93
|
static create(t, e) {
|
|
94
94
|
const o = e || t.node("doc", {}, [t.node("paragraph")]);
|
|
95
|
-
return new
|
|
95
|
+
return new Yt(o, { anchor: 0, head: 0 }, t);
|
|
96
96
|
}
|
|
97
97
|
apply(t, e) {
|
|
98
|
-
return new
|
|
98
|
+
return new Yt(t, e || this.selection, this.schema);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class fn {
|
|
102
102
|
constructor(t, e) {
|
|
103
103
|
this.nodes = new Map(Object.entries(t)), this.marks = new Map(Object.entries(e));
|
|
104
104
|
}
|
|
@@ -109,7 +109,7 @@ class ln {
|
|
|
109
109
|
return { type: "text", text: t, marks: e };
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
class
|
|
112
|
+
class pn {
|
|
113
113
|
constructor() {
|
|
114
114
|
this.plugins = [], this.pluginConfigs = /* @__PURE__ */ new Map();
|
|
115
115
|
}
|
|
@@ -146,7 +146,7 @@ class cn {
|
|
|
146
146
|
const t = {}, e = {};
|
|
147
147
|
return this.plugins.forEach((o) => {
|
|
148
148
|
o.nodes && Object.assign(t, o.nodes), o.marks && Object.assign(e, o.marks);
|
|
149
|
-
}), new
|
|
149
|
+
}), new fn(t, e);
|
|
150
150
|
}
|
|
151
151
|
getCommands() {
|
|
152
152
|
const t = {};
|
|
@@ -200,7 +200,7 @@ class cn {
|
|
|
200
200
|
await Promise.all(t), this.plugins = [], this.pluginConfigs.clear();
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
class
|
|
203
|
+
class hn {
|
|
204
204
|
constructor(t = {}) {
|
|
205
205
|
this.commands = /* @__PURE__ */ new Map(), Object.entries(t).forEach(([e, o]) => {
|
|
206
206
|
this.register(e, o);
|
|
@@ -243,11 +243,11 @@ class dn {
|
|
|
243
243
|
this.commands.clear();
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
class
|
|
246
|
+
class mn {
|
|
247
247
|
constructor(t = {}) {
|
|
248
|
-
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new
|
|
248
|
+
this.listeners = /* @__PURE__ */ new Map(), this.isReadonly = !1, this.isDestroyed = !1, this.isReadonly = t.readonly || !1, this.pluginManager = new pn(), t.plugins && Array.isArray(t.plugins) && t.plugins.forEach((o) => this.pluginManager.register(o));
|
|
249
249
|
const e = this.pluginManager.buildSchema();
|
|
250
|
-
this.state =
|
|
250
|
+
this.state = Yt.create(e), this.commandRegistry = new hn(this.pluginManager.getCommands());
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
253
253
|
* Execute a command
|
|
@@ -329,7 +329,70 @@ class un {
|
|
|
329
329
|
return this.isDestroyed;
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
const Mo = {
|
|
333
|
+
bold: "toggleBold",
|
|
334
|
+
italic: "toggleItalic",
|
|
335
|
+
underline: "toggleUnderline",
|
|
336
|
+
strikethrough: "toggleStrikethrough",
|
|
337
|
+
bullist: "toggleBulletList",
|
|
338
|
+
numlist: "toggleOrderedList",
|
|
339
|
+
checklist: "toggleChecklist",
|
|
340
|
+
link: "openLinkDialog",
|
|
341
|
+
image: "insertImage",
|
|
342
|
+
table: "insertTable",
|
|
343
|
+
trackChanges: "toggleTrackChanges",
|
|
344
|
+
acceptTrackChanges: "acceptAllTrackChanges",
|
|
345
|
+
rejectTrackChanges: "rejectAllTrackChanges",
|
|
346
|
+
anchor: "insertAnchor",
|
|
347
|
+
code: "toggleSourceView",
|
|
348
|
+
blockquote: "toggleBlockquote",
|
|
349
|
+
undo: "undo",
|
|
350
|
+
redo: "redo",
|
|
351
|
+
textColor: "openTextColorPicker",
|
|
352
|
+
backgroundColor: "openBackgroundColorPicker",
|
|
353
|
+
fontSize: "fontSize",
|
|
354
|
+
fontFamily: "setFontFamily",
|
|
355
|
+
lineHeight: "setLineHeight",
|
|
356
|
+
heading: "setBlockType",
|
|
357
|
+
paragraph: "setParagraph",
|
|
358
|
+
textAlignment: "setTextAlignment",
|
|
359
|
+
direction: "setDirectionLTR",
|
|
360
|
+
indent: "increaseIndent",
|
|
361
|
+
outdent: "decreaseIndent",
|
|
362
|
+
capitalization: "setCapitalization",
|
|
363
|
+
math: "insertMath",
|
|
364
|
+
specialCharacters: "insertSpecialCharacter",
|
|
365
|
+
emojis: "openEmojiDialog",
|
|
366
|
+
embedIframe: "openEmbedIframeDialog",
|
|
367
|
+
fullscreen: "toggleFullscreen",
|
|
368
|
+
preview: "togglePreview",
|
|
369
|
+
print: "print",
|
|
370
|
+
a11yChecker: "toggleA11yChecker",
|
|
371
|
+
spellCheck: "toggleSpellCheck",
|
|
372
|
+
comments: "addComment",
|
|
373
|
+
showHideComments: "toggleComments",
|
|
374
|
+
toggleComments: "toggleComments",
|
|
375
|
+
footnote: "insertFootnote",
|
|
376
|
+
mergeTags: "insertMergeTag",
|
|
377
|
+
dataBinding: "openDataBindingDialog",
|
|
378
|
+
dataBindingPreview: "openDataBindingDialog",
|
|
379
|
+
contentRules: "toggleContentRulesPanel",
|
|
380
|
+
contentRulesAudit: "runContentRulesAudit",
|
|
381
|
+
contentRulesRealtime: "toggleContentRulesRealtime",
|
|
382
|
+
mention: "insertMention",
|
|
383
|
+
slash: "openSlashCommands",
|
|
384
|
+
slashCommands: "openSlashCommands",
|
|
385
|
+
pageBreak: "insertPageBreak",
|
|
386
|
+
template: "insertTemplate",
|
|
387
|
+
importWord: "importWord",
|
|
388
|
+
exportWord: "exportWord",
|
|
389
|
+
exportPdf: "exportPdf",
|
|
390
|
+
insertImage: "insertImage",
|
|
391
|
+
insertVideo: "insertVideo",
|
|
392
|
+
insertAudio: "insertAudio",
|
|
393
|
+
codeBlock: "insertCodeBlock"
|
|
394
|
+
};
|
|
395
|
+
class gn {
|
|
333
396
|
constructor(t, e, o) {
|
|
334
397
|
this.overflowUnits = [], this.overflowUnitHomes = /* @__PURE__ */ new WeakMap(), this.expandedOpen = !1, this.onDocumentPointerDownForOverflow = (i) => {
|
|
335
398
|
var l, c;
|
|
@@ -353,126 +416,62 @@ class pn {
|
|
|
353
416
|
* Parse toolbar string into button groups
|
|
354
417
|
*/
|
|
355
418
|
parseToolbarString(t) {
|
|
356
|
-
const e = [], o = t.split("|").map((
|
|
357
|
-
i.forEach((
|
|
358
|
-
|
|
359
|
-
})
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
bullist: "toggleBulletList",
|
|
366
|
-
numlist: "toggleOrderedList",
|
|
367
|
-
checklist: "toggleChecklist",
|
|
368
|
-
link: "openLinkDialog",
|
|
369
|
-
image: "openImageDialog",
|
|
370
|
-
table: "insertTable",
|
|
371
|
-
trackChanges: "toggleTrackChanges",
|
|
372
|
-
acceptTrackChanges: "acceptAllTrackChanges",
|
|
373
|
-
rejectTrackChanges: "rejectAllTrackChanges",
|
|
374
|
-
anchor: "insertAnchor",
|
|
375
|
-
code: "toggleSourceView",
|
|
376
|
-
blockquote: "toggleBlockquote",
|
|
377
|
-
undo: "undo",
|
|
378
|
-
redo: "redo",
|
|
379
|
-
textColor: "openTextColorPicker",
|
|
380
|
-
backgroundColor: "openBackgroundColorPicker",
|
|
381
|
-
fontSize: "fontSize",
|
|
382
|
-
fontFamily: "setFontFamily",
|
|
383
|
-
lineHeight: "setLineHeight",
|
|
384
|
-
heading: "setBlockType",
|
|
385
|
-
paragraph: "setParagraph",
|
|
386
|
-
textAlignment: "setTextAlignment",
|
|
387
|
-
direction: "setDirectionLTR",
|
|
388
|
-
indent: "increaseIndent",
|
|
389
|
-
outdent: "decreaseIndent",
|
|
390
|
-
capitalization: "setCapitalization",
|
|
391
|
-
math: "insertMath",
|
|
392
|
-
specialCharacters: "insertSpecialCharacter",
|
|
393
|
-
emojis: "openEmojiDialog",
|
|
394
|
-
embedIframe: "openEmbedIframeDialog",
|
|
395
|
-
fullscreen: "toggleFullscreen",
|
|
396
|
-
preview: "togglePreview",
|
|
397
|
-
print: "print",
|
|
398
|
-
a11yChecker: "toggleA11yChecker",
|
|
399
|
-
spellCheck: "toggleSpellCheck",
|
|
400
|
-
comments: "addComment",
|
|
401
|
-
showHideComments: "toggleComments",
|
|
402
|
-
toggleComments: "toggleComments",
|
|
403
|
-
footnote: "insertFootnote",
|
|
404
|
-
mergeTags: "insertMergeTag",
|
|
405
|
-
dataBinding: "openDataBindingDialog",
|
|
406
|
-
dataBindingPreview: "openDataBindingDialog",
|
|
407
|
-
contentRules: "toggleContentRulesPanel",
|
|
408
|
-
contentRulesAudit: "runContentRulesAudit",
|
|
409
|
-
contentRulesRealtime: "toggleContentRulesRealtime",
|
|
410
|
-
mention: "insertMention",
|
|
411
|
-
slash: "openSlashCommands",
|
|
412
|
-
slashCommands: "openSlashCommands",
|
|
413
|
-
pageBreak: "insertPageBreak",
|
|
414
|
-
template: "insertTemplate",
|
|
415
|
-
importWord: "importWord",
|
|
416
|
-
exportWord: "exportWord",
|
|
417
|
-
exportPdf: "exportPdf",
|
|
418
|
-
insertImage: "insertImage",
|
|
419
|
-
insertVideo: "insertVideo",
|
|
420
|
-
insertAudio: "insertAudio",
|
|
421
|
-
codeBlock: "insertCodeBlock"
|
|
422
|
-
};
|
|
423
|
-
return o.forEach((c) => {
|
|
424
|
-
const p = [];
|
|
425
|
-
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
426
|
-
if (g === "direction") {
|
|
427
|
-
const v = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
428
|
-
v && p.push({
|
|
419
|
+
const e = [], o = t.split("|").map((l) => l.trim()), i = this.getAvailableToolbarItems(), r = /* @__PURE__ */ new Map();
|
|
420
|
+
return i.forEach((l) => {
|
|
421
|
+
l.command && r.set(l.command, l), l.type === "group" && l.label && r.set(l.label, l);
|
|
422
|
+
}), o.forEach((l) => {
|
|
423
|
+
const c = [];
|
|
424
|
+
l.split(/\s+/).filter(Boolean).forEach((h) => {
|
|
425
|
+
if (h === "direction") {
|
|
426
|
+
const k = r.get("setDirectionLTR"), w = r.get("setDirectionRTL");
|
|
427
|
+
k && c.push({
|
|
429
428
|
id: "directionLTR",
|
|
430
|
-
label: v.label,
|
|
431
|
-
command: v.command,
|
|
432
|
-
icon: v.icon,
|
|
433
|
-
type: v.type || "button",
|
|
434
|
-
options: v.options
|
|
435
|
-
}), k && p.push({
|
|
436
|
-
id: "directionRTL",
|
|
437
429
|
label: k.label,
|
|
438
430
|
command: k.command,
|
|
439
431
|
icon: k.icon,
|
|
440
432
|
type: k.type || "button",
|
|
441
433
|
options: k.options
|
|
434
|
+
}), w && c.push({
|
|
435
|
+
id: "directionRTL",
|
|
436
|
+
label: w.label,
|
|
437
|
+
command: w.command,
|
|
438
|
+
icon: w.icon,
|
|
439
|
+
type: w.type || "button",
|
|
440
|
+
options: w.options
|
|
442
441
|
});
|
|
443
442
|
return;
|
|
444
443
|
}
|
|
445
|
-
if (
|
|
446
|
-
const
|
|
447
|
-
|
|
444
|
+
if (h === "comments") {
|
|
445
|
+
const k = r.get("addComment"), w = r.get("toggleComments");
|
|
446
|
+
k && c.push({
|
|
448
447
|
id: "addComment",
|
|
449
|
-
label: v.label,
|
|
450
|
-
command: v.command,
|
|
451
|
-
icon: v.icon,
|
|
452
|
-
type: v.type || "button",
|
|
453
|
-
options: v.options
|
|
454
|
-
}), k && p.push({
|
|
455
|
-
id: "toggleComments",
|
|
456
448
|
label: k.label,
|
|
457
449
|
command: k.command,
|
|
458
450
|
icon: k.icon,
|
|
459
451
|
type: k.type || "button",
|
|
460
452
|
options: k.options
|
|
453
|
+
}), w && c.push({
|
|
454
|
+
id: "toggleComments",
|
|
455
|
+
label: w.label,
|
|
456
|
+
command: w.command,
|
|
457
|
+
icon: w.icon,
|
|
458
|
+
type: w.type || "button",
|
|
459
|
+
options: w.options
|
|
461
460
|
});
|
|
462
461
|
return;
|
|
463
462
|
}
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
|
|
467
|
-
id:
|
|
468
|
-
label:
|
|
469
|
-
command:
|
|
470
|
-
icon:
|
|
471
|
-
type:
|
|
472
|
-
options:
|
|
473
|
-
items:
|
|
463
|
+
const g = Mo[h] || h;
|
|
464
|
+
let b = r.get(g);
|
|
465
|
+
b || (b = r.get(h)), b && c.push({
|
|
466
|
+
id: h,
|
|
467
|
+
label: b.label,
|
|
468
|
+
command: b.command,
|
|
469
|
+
icon: b.icon,
|
|
470
|
+
type: b.type === "separator" ? "separator" : b.type || "button",
|
|
471
|
+
options: b.options,
|
|
472
|
+
items: b.items
|
|
474
473
|
});
|
|
475
|
-
}),
|
|
474
|
+
}), c.length > 0 && e.push(c);
|
|
476
475
|
}), e;
|
|
477
476
|
}
|
|
478
477
|
/**
|
|
@@ -493,8 +492,8 @@ class pn {
|
|
|
493
492
|
const c = document.createElement("div");
|
|
494
493
|
if (c.className = "editora-toolbar-group", r.forEach((p) => {
|
|
495
494
|
this.appendToolbarButton(c, p);
|
|
496
|
-
const
|
|
497
|
-
|
|
495
|
+
const h = c.lastElementChild;
|
|
496
|
+
h instanceof HTMLElement && (this.overflowUnits.push(h), this.overflowUnitHomes.set(h, c));
|
|
498
497
|
}), e.appendChild(c), l < i.length - 1) {
|
|
499
498
|
const p = document.createElement("div");
|
|
500
499
|
p.className = "editora-toolbar-separator", e.appendChild(p);
|
|
@@ -515,25 +514,25 @@ class pn {
|
|
|
515
514
|
const r = () => {
|
|
516
515
|
const c = this.overflowUnits;
|
|
517
516
|
if (c.length === 0) return;
|
|
518
|
-
c.forEach((
|
|
517
|
+
c.forEach((B) => {
|
|
519
518
|
var D;
|
|
520
|
-
|
|
519
|
+
B.parentElement === i && ((D = this.overflowUnitHomes.get(B)) == null || D.appendChild(B));
|
|
521
520
|
});
|
|
522
|
-
const p = t.clientWidth,
|
|
523
|
-
const D =
|
|
524
|
-
return
|
|
521
|
+
const p = t.clientWidth, h = 16, g = 40, b = 4, k = Math.max(0, p - h), w = Math.max(0, k - g - b), R = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), $ = (B) => {
|
|
522
|
+
const D = B.getBoundingClientRect();
|
|
523
|
+
return R ? et.right - D.left : D.right - et.left;
|
|
525
524
|
};
|
|
526
525
|
let z = 0;
|
|
527
|
-
if ($(c[c.length - 1]) <=
|
|
526
|
+
if ($(c[c.length - 1]) <= k)
|
|
528
527
|
z = c.length;
|
|
529
528
|
else
|
|
530
|
-
for (const
|
|
531
|
-
if ($(
|
|
529
|
+
for (const B of c)
|
|
530
|
+
if ($(B) <= w) z++;
|
|
532
531
|
else break;
|
|
533
532
|
z = Math.max(1, Math.min(z, c.length));
|
|
534
533
|
const st = z < c.length;
|
|
535
|
-
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((
|
|
536
|
-
D >= z && i.appendChild(
|
|
534
|
+
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((B, D) => {
|
|
535
|
+
D >= z && i.appendChild(B);
|
|
537
536
|
});
|
|
538
537
|
}, l = () => {
|
|
539
538
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -621,8 +620,8 @@ class pn {
|
|
|
621
620
|
* mouse click leaves the focus alone, so the editor keeps its selection.
|
|
622
621
|
*/
|
|
623
622
|
makeMenuAccessible(t, e, o, i) {
|
|
624
|
-
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((
|
|
625
|
-
|
|
623
|
+
e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", "false"), o.setAttribute("role", "menu"), o.setAttribute("aria-label", i), o.querySelectorAll(".editora-toolbar-dropdown-item").forEach((h) => {
|
|
624
|
+
h.setAttribute("role", "menuitem"), h.tabIndex = -1;
|
|
626
625
|
});
|
|
627
626
|
const r = () => Array.from(o.querySelectorAll('[role="menuitem"]')), l = () => o.style.display === "block", c = new MutationObserver(() => {
|
|
628
627
|
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
@@ -631,32 +630,32 @@ class pn {
|
|
|
631
630
|
const p = t._cleanupDropdown;
|
|
632
631
|
t._cleanupDropdown = () => {
|
|
633
632
|
c.disconnect(), p == null || p();
|
|
634
|
-
}, e.addEventListener("click", (
|
|
633
|
+
}, e.addEventListener("click", (h) => {
|
|
635
634
|
var g;
|
|
636
|
-
|
|
637
|
-
}), e.addEventListener("keydown", (
|
|
638
|
-
var
|
|
639
|
-
if (
|
|
640
|
-
|
|
635
|
+
h.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
636
|
+
}), e.addEventListener("keydown", (h) => {
|
|
637
|
+
var b;
|
|
638
|
+
if (h.key !== "ArrowDown" && h.key !== "ArrowUp") return;
|
|
639
|
+
h.preventDefault(), l() || e.click();
|
|
641
640
|
const g = r();
|
|
642
|
-
(
|
|
643
|
-
}), o.addEventListener("keydown", (
|
|
641
|
+
(b = h.key === "ArrowUp" ? g[g.length - 1] : g[0]) == null || b.focus();
|
|
642
|
+
}), o.addEventListener("keydown", (h) => {
|
|
644
643
|
const g = r();
|
|
645
644
|
if (g.length === 0) return;
|
|
646
|
-
const
|
|
647
|
-
|
|
645
|
+
const b = g.indexOf(document.activeElement), k = (w) => {
|
|
646
|
+
h.preventDefault(), g[(w + g.length) % g.length].focus();
|
|
648
647
|
};
|
|
649
|
-
switch (
|
|
648
|
+
switch (h.key) {
|
|
650
649
|
case "ArrowDown":
|
|
651
|
-
return
|
|
650
|
+
return k(b + 1);
|
|
652
651
|
case "ArrowUp":
|
|
653
|
-
return
|
|
652
|
+
return k(b < 0 ? g.length - 1 : b - 1);
|
|
654
653
|
case "Home":
|
|
655
|
-
return
|
|
654
|
+
return k(0);
|
|
656
655
|
case "End":
|
|
657
|
-
return
|
|
656
|
+
return k(g.length - 1);
|
|
658
657
|
case "Escape":
|
|
659
|
-
|
|
658
|
+
h.preventDefault(), h.stopPropagation(), o.style.display = "none", e.focus();
|
|
660
659
|
return;
|
|
661
660
|
case "Tab":
|
|
662
661
|
o.style.display = "none";
|
|
@@ -675,8 +674,8 @@ class pn {
|
|
|
675
674
|
const i = document.createElement("div");
|
|
676
675
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
677
676
|
const p = document.createElement("button");
|
|
678
|
-
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (
|
|
679
|
-
|
|
677
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
|
|
678
|
+
h.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
680
679
|
}), i.appendChild(p);
|
|
681
680
|
}), o.addEventListener("click", (c) => {
|
|
682
681
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
@@ -710,13 +709,13 @@ class pn {
|
|
|
710
709
|
const i = document.createElement("div");
|
|
711
710
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
712
711
|
const p = document.createElement("button");
|
|
713
|
-
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (
|
|
714
|
-
|
|
712
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (h) => {
|
|
713
|
+
h.preventDefault(), h.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
715
714
|
}), i.appendChild(p);
|
|
716
715
|
}), o.addEventListener("click", (c) => {
|
|
717
|
-
var
|
|
716
|
+
var h;
|
|
718
717
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
719
|
-
const p = (
|
|
718
|
+
const p = (h = this.container) == null ? void 0 : h.querySelectorAll(
|
|
720
719
|
".editora-toolbar-dropdown-menu"
|
|
721
720
|
);
|
|
722
721
|
p == null || p.forEach((g) => {
|
|
@@ -759,7 +758,7 @@ class pn {
|
|
|
759
758
|
}), this.container.innerHTML = ""), (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), document.removeEventListener("mousedown", this.onDocumentPointerDownForOverflow, !0), this.itemsContainer = void 0, this.moreButton = void 0, this.expandedRow = void 0, this.commandHandler = void 0;
|
|
760
759
|
}
|
|
761
760
|
}
|
|
762
|
-
class
|
|
761
|
+
class bn {
|
|
763
762
|
constructor(t) {
|
|
764
763
|
this.visible = !1, this.config = t;
|
|
765
764
|
}
|
|
@@ -801,7 +800,7 @@ class fn {
|
|
|
801
800
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0, this.visible = !1;
|
|
802
801
|
}
|
|
803
802
|
}
|
|
804
|
-
class
|
|
803
|
+
class yn {
|
|
805
804
|
constructor(t = {}) {
|
|
806
805
|
this.statusInfo = {}, this.config = t;
|
|
807
806
|
}
|
|
@@ -861,12 +860,12 @@ class hn {
|
|
|
861
860
|
this.container && this.container.parentNode && this.container.parentNode.removeChild(this.container), this.container = void 0;
|
|
862
861
|
}
|
|
863
862
|
}
|
|
864
|
-
function
|
|
865
|
-
const e = a.textContent || "", o =
|
|
863
|
+
function En(a, t) {
|
|
864
|
+
const e = a.textContent || "", o = vn(a, t.startContainer, t.startOffset), r = e.substring(0, o).split(`
|
|
866
865
|
`), l = r.length, c = r[r.length - 1].length + 1;
|
|
867
866
|
return { line: l, column: c };
|
|
868
867
|
}
|
|
869
|
-
function
|
|
868
|
+
function vn(a, t, e) {
|
|
870
869
|
var l;
|
|
871
870
|
let o = 0;
|
|
872
871
|
const i = document.createTreeWalker(
|
|
@@ -884,7 +883,7 @@ function gn(a, t, e) {
|
|
|
884
883
|
}
|
|
885
884
|
return o;
|
|
886
885
|
}
|
|
887
|
-
function
|
|
886
|
+
function kn(a) {
|
|
888
887
|
var o, i;
|
|
889
888
|
const t = a.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");
|
|
890
889
|
let e = 1;
|
|
@@ -899,11 +898,11 @@ function bn(a) {
|
|
|
899
898
|
}
|
|
900
899
|
return e;
|
|
901
900
|
}
|
|
902
|
-
function
|
|
901
|
+
function wn(a) {
|
|
903
902
|
const t = a.trim() ? a.trim().split(/\s+/).length : 0, e = a.length;
|
|
904
903
|
return { words: t, chars: e };
|
|
905
904
|
}
|
|
906
|
-
function
|
|
905
|
+
function Tn(a, t) {
|
|
907
906
|
const e = a.toString();
|
|
908
907
|
return {
|
|
909
908
|
startLine: t.line,
|
|
@@ -915,7 +914,7 @@ function En(a, t) {
|
|
|
915
914
|
selectedWords: e.trim().split(/\s+/).filter(Boolean).length
|
|
916
915
|
};
|
|
917
916
|
}
|
|
918
|
-
class
|
|
917
|
+
class Cn {
|
|
919
918
|
constructor(t) {
|
|
920
919
|
this.shortcuts = /* @__PURE__ */ new Map(), this.enabled = !0, this.isMac = typeof navigator != "undefined" && navigator.platform.toUpperCase().indexOf("MAC") >= 0, (t == null ? void 0 : t.enabled) === !1 && (this.enabled = !1), this.registerDefaultShortcuts(), t != null && t.shortcuts && t.shortcuts.forEach((e) => this.registerShortcut(e)), t != null && t.customShortcuts && Object.values(t.customShortcuts).forEach((e) => {
|
|
921
920
|
this.registerShortcut(e);
|
|
@@ -1250,63 +1249,63 @@ class vn {
|
|
|
1250
1249
|
return t.includes("toggle") && (t.includes("Bold") || t.includes("Italic") || t.includes("Underline") || t.includes("Strike") || t.includes("Code") || t.includes("Super") || t.includes("Sub")) ? "Text Formatting" : t.includes("Heading") || t.includes("Paragraph") ? "Block Formatting" : t.includes("List") || t.includes("Checklist") ? "Lists" : t.includes("Alignment") || t.includes("Indent") ? "Alignment & Indentation" : t.includes("undo") || t.includes("redo") ? "History" : t.includes("insert") ? "Insert" : t.includes("find") || t.includes("replace") ? "Find & Replace" : t.includes("Accessibility") || t.includes("spell") ? "Tools" : "Other";
|
|
1251
1250
|
}
|
|
1252
1251
|
}
|
|
1253
|
-
function
|
|
1252
|
+
function ao(a, t) {
|
|
1254
1253
|
(t == null || t > a.length) && (t = a.length);
|
|
1255
1254
|
for (var e = 0, o = Array(t); e < t; e++) o[e] = a[e];
|
|
1256
1255
|
return o;
|
|
1257
1256
|
}
|
|
1258
|
-
function
|
|
1257
|
+
function xn(a) {
|
|
1259
1258
|
if (Array.isArray(a)) return a;
|
|
1260
1259
|
}
|
|
1261
|
-
function
|
|
1260
|
+
function An(a, t) {
|
|
1262
1261
|
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1263
1262
|
if (e != null) {
|
|
1264
|
-
var o, i, r, l, c = [], p = !0,
|
|
1263
|
+
var o, i, r, l, c = [], p = !0, h = !1;
|
|
1265
1264
|
try {
|
|
1266
1265
|
if (r = (e = e.call(a)).next, t !== 0) for (; !(p = (o = r.call(e)).done) && (c.push(o.value), c.length !== t); p = !0) ;
|
|
1267
1266
|
} catch (g) {
|
|
1268
|
-
|
|
1267
|
+
h = !0, i = g;
|
|
1269
1268
|
} finally {
|
|
1270
1269
|
try {
|
|
1271
1270
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1272
1271
|
} finally {
|
|
1273
|
-
if (
|
|
1272
|
+
if (h) throw i;
|
|
1274
1273
|
}
|
|
1275
1274
|
}
|
|
1276
1275
|
return c;
|
|
1277
1276
|
}
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1278
|
+
function Sn() {
|
|
1280
1279
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1281
1280
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1282
1281
|
}
|
|
1283
|
-
function
|
|
1284
|
-
return
|
|
1282
|
+
function Ln(a, t) {
|
|
1283
|
+
return xn(a) || An(a, t) || _n(a, t) || Sn();
|
|
1285
1284
|
}
|
|
1286
|
-
function
|
|
1285
|
+
function _n(a, t) {
|
|
1287
1286
|
if (a) {
|
|
1288
|
-
if (typeof a == "string") return
|
|
1287
|
+
if (typeof a == "string") return ao(a, t);
|
|
1289
1288
|
var e = {}.toString.call(a).slice(8, -1);
|
|
1290
|
-
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ?
|
|
1289
|
+
return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ao(a, t) : void 0;
|
|
1291
1290
|
}
|
|
1292
1291
|
}
|
|
1293
|
-
const
|
|
1294
|
-
let
|
|
1295
|
-
|
|
1292
|
+
const Io = Object.entries, so = Object.setPrototypeOf, Mn = Object.isFrozen, In = Object.getPrototypeOf, Dn = Object.getOwnPropertyDescriptor;
|
|
1293
|
+
let _ = Object.freeze, M = Object.seal, Et = Object.create, Do = typeof Reflect != "undefined" && Reflect, Te = Do.apply, Ce = Do.construct;
|
|
1294
|
+
_ || (_ = function(t) {
|
|
1296
1295
|
return t;
|
|
1297
1296
|
});
|
|
1298
|
-
|
|
1297
|
+
M || (M = function(t) {
|
|
1299
1298
|
return t;
|
|
1300
1299
|
});
|
|
1301
1300
|
Te || (Te = function(t, e) {
|
|
1302
1301
|
for (var o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), r = 2; r < o; r++) i[r - 2] = arguments[r];
|
|
1303
1302
|
return t.apply(e, i);
|
|
1304
1303
|
});
|
|
1305
|
-
|
|
1304
|
+
Ce || (Ce = function(t) {
|
|
1306
1305
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1307
1306
|
return new t(...o);
|
|
1308
1307
|
});
|
|
1309
|
-
const at = L(Array.prototype.forEach),
|
|
1308
|
+
const at = L(Array.prototype.forEach), On = L(Array.prototype.lastIndexOf), lo = L(Array.prototype.pop), At = L(Array.prototype.push), Rn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), co = L(String.prototype.match), St = L(String.prototype.replace), uo = L(String.prototype.indexOf), Pn = L(String.prototype.trim), Nn = L(Number.prototype.toString), zn = L(Boolean.prototype.toString), fo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), N = L(Object.prototype.hasOwnProperty), Lt = L(Object.prototype.toString), I = L(RegExp.prototype.test), Z = Bn(TypeError);
|
|
1310
1309
|
function L(a) {
|
|
1311
1310
|
return function(t) {
|
|
1312
1311
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1314,89 +1313,89 @@ function L(a) {
|
|
|
1314
1313
|
return Te(a, t, o);
|
|
1315
1314
|
};
|
|
1316
1315
|
}
|
|
1317
|
-
function
|
|
1316
|
+
function Bn(a) {
|
|
1318
1317
|
return function() {
|
|
1319
1318
|
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++) e[o] = arguments[o];
|
|
1320
|
-
return
|
|
1319
|
+
return Ce(a, e);
|
|
1321
1320
|
};
|
|
1322
1321
|
}
|
|
1323
|
-
function
|
|
1322
|
+
function v(a, t) {
|
|
1324
1323
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Mt;
|
|
1325
|
-
if (
|
|
1324
|
+
if (so && so(a, null), !vt(t)) return a;
|
|
1326
1325
|
let o = t.length;
|
|
1327
1326
|
for (; o--; ) {
|
|
1328
1327
|
let i = t[o];
|
|
1329
1328
|
if (typeof i == "string") {
|
|
1330
1329
|
const r = e(i);
|
|
1331
|
-
r !== i && (
|
|
1330
|
+
r !== i && (Mn(t) || (t[o] = r), i = r);
|
|
1332
1331
|
}
|
|
1333
1332
|
a[i] = !0;
|
|
1334
1333
|
}
|
|
1335
1334
|
return a;
|
|
1336
1335
|
}
|
|
1337
|
-
function
|
|
1336
|
+
function Fn(a) {
|
|
1338
1337
|
for (let t = 0; t < a.length; t++) N(a, t) || (a[t] = null);
|
|
1339
1338
|
return a;
|
|
1340
1339
|
}
|
|
1341
1340
|
function U(a) {
|
|
1342
|
-
const t =
|
|
1343
|
-
for (const o of
|
|
1344
|
-
var e =
|
|
1341
|
+
const t = Et(null);
|
|
1342
|
+
for (const o of Io(a)) {
|
|
1343
|
+
var e = Ln(o, 2);
|
|
1345
1344
|
const i = e[0], r = e[1];
|
|
1346
|
-
N(a, i) && (
|
|
1345
|
+
N(a, i) && (vt(r) ? t[i] = Fn(r) : r && typeof r == "object" && r.constructor === Object ? t[i] = U(r) : t[i] = r);
|
|
1347
1346
|
}
|
|
1348
1347
|
return t;
|
|
1349
1348
|
}
|
|
1350
|
-
function
|
|
1349
|
+
function Hn(a) {
|
|
1351
1350
|
switch (typeof a) {
|
|
1352
1351
|
case "string":
|
|
1353
1352
|
return a;
|
|
1354
1353
|
case "number":
|
|
1355
|
-
return
|
|
1354
|
+
return Nn(a);
|
|
1356
1355
|
case "boolean":
|
|
1357
|
-
return
|
|
1356
|
+
return zn(a);
|
|
1358
1357
|
case "bigint":
|
|
1359
|
-
return
|
|
1358
|
+
return fo ? fo(a) : "0";
|
|
1360
1359
|
case "symbol":
|
|
1361
1360
|
return po ? po(a) : "Symbol()";
|
|
1362
1361
|
case "undefined":
|
|
1363
|
-
return
|
|
1362
|
+
return Lt(a);
|
|
1364
1363
|
case "function":
|
|
1365
1364
|
case "object": {
|
|
1366
|
-
if (a === null) return
|
|
1365
|
+
if (a === null) return Lt(a);
|
|
1367
1366
|
const t = a, e = W(t, "toString");
|
|
1368
1367
|
if (typeof e == "function") {
|
|
1369
1368
|
const o = e(t);
|
|
1370
|
-
return typeof o == "string" ? o :
|
|
1369
|
+
return typeof o == "string" ? o : Lt(o);
|
|
1371
1370
|
}
|
|
1372
|
-
return
|
|
1371
|
+
return Lt(a);
|
|
1373
1372
|
}
|
|
1374
1373
|
default:
|
|
1375
|
-
return
|
|
1374
|
+
return Lt(a);
|
|
1376
1375
|
}
|
|
1377
1376
|
}
|
|
1378
1377
|
function W(a, t) {
|
|
1379
1378
|
for (; a !== null; ) {
|
|
1380
|
-
const o =
|
|
1379
|
+
const o = Dn(a, t);
|
|
1381
1380
|
if (o) {
|
|
1382
1381
|
if (o.get) return L(o.get);
|
|
1383
1382
|
if (typeof o.value == "function") return L(o.value);
|
|
1384
1383
|
}
|
|
1385
|
-
a =
|
|
1384
|
+
a = In(a);
|
|
1386
1385
|
}
|
|
1387
1386
|
function e() {
|
|
1388
1387
|
return null;
|
|
1389
1388
|
}
|
|
1390
1389
|
return e;
|
|
1391
1390
|
}
|
|
1392
|
-
function
|
|
1391
|
+
function Un(a) {
|
|
1393
1392
|
try {
|
|
1394
|
-
return
|
|
1393
|
+
return I(a, ""), !0;
|
|
1395
1394
|
} catch (t) {
|
|
1396
1395
|
return !1;
|
|
1397
1396
|
}
|
|
1398
1397
|
}
|
|
1399
|
-
const
|
|
1398
|
+
const ho = _([
|
|
1400
1399
|
"a",
|
|
1401
1400
|
"abbr",
|
|
1402
1401
|
"acronym",
|
|
@@ -1516,7 +1515,7 @@ const fo = M([
|
|
|
1516
1515
|
"var",
|
|
1517
1516
|
"video",
|
|
1518
1517
|
"wbr"
|
|
1519
|
-
]), me =
|
|
1518
|
+
]), me = _([
|
|
1520
1519
|
"svg",
|
|
1521
1520
|
"a",
|
|
1522
1521
|
"altglyph",
|
|
@@ -1564,7 +1563,7 @@ const fo = M([
|
|
|
1564
1563
|
"tspan",
|
|
1565
1564
|
"view",
|
|
1566
1565
|
"vkern"
|
|
1567
|
-
]), ge =
|
|
1566
|
+
]), ge = _([
|
|
1568
1567
|
"feBlend",
|
|
1569
1568
|
"feColorMatrix",
|
|
1570
1569
|
"feComponentTransfer",
|
|
@@ -1590,7 +1589,7 @@ const fo = M([
|
|
|
1590
1589
|
"feSpotLight",
|
|
1591
1590
|
"feTile",
|
|
1592
1591
|
"feTurbulence"
|
|
1593
|
-
]),
|
|
1592
|
+
]), jn = _([
|
|
1594
1593
|
"animate",
|
|
1595
1594
|
"color-profile",
|
|
1596
1595
|
"cursor",
|
|
@@ -1613,7 +1612,7 @@ const fo = M([
|
|
|
1613
1612
|
"solidcolor",
|
|
1614
1613
|
"unknown",
|
|
1615
1614
|
"use"
|
|
1616
|
-
]), be =
|
|
1615
|
+
]), be = _([
|
|
1617
1616
|
"math",
|
|
1618
1617
|
"menclose",
|
|
1619
1618
|
"merror",
|
|
@@ -1644,7 +1643,7 @@ const fo = M([
|
|
|
1644
1643
|
"munder",
|
|
1645
1644
|
"munderover",
|
|
1646
1645
|
"mprescripts"
|
|
1647
|
-
]),
|
|
1646
|
+
]), Wn = _([
|
|
1648
1647
|
"maction",
|
|
1649
1648
|
"maligngroup",
|
|
1650
1649
|
"malignmark",
|
|
@@ -1660,7 +1659,7 @@ const fo = M([
|
|
|
1660
1659
|
"annotation-xml",
|
|
1661
1660
|
"mprescripts",
|
|
1662
1661
|
"none"
|
|
1663
|
-
]),
|
|
1662
|
+
]), mo = _(["#text"]), go = _([
|
|
1664
1663
|
"accept",
|
|
1665
1664
|
"action",
|
|
1666
1665
|
"align",
|
|
@@ -1779,7 +1778,7 @@ const fo = M([
|
|
|
1779
1778
|
"width",
|
|
1780
1779
|
"wrap",
|
|
1781
1780
|
"xmlns"
|
|
1782
|
-
]), ye =
|
|
1781
|
+
]), ye = _([
|
|
1783
1782
|
"accent-height",
|
|
1784
1783
|
"accumulate",
|
|
1785
1784
|
"additive",
|
|
@@ -1972,7 +1971,7 @@ const fo = M([
|
|
|
1972
1971
|
"y2",
|
|
1973
1972
|
"z",
|
|
1974
1973
|
"zoomandpan"
|
|
1975
|
-
]),
|
|
1974
|
+
]), bo = _([
|
|
1976
1975
|
"accent",
|
|
1977
1976
|
"accentunder",
|
|
1978
1977
|
"align",
|
|
@@ -2027,13 +2026,13 @@ const fo = M([
|
|
|
2027
2026
|
"voffset",
|
|
2028
2027
|
"width",
|
|
2029
2028
|
"xmlns"
|
|
2030
|
-
]), Gt =
|
|
2029
|
+
]), Gt = _([
|
|
2031
2030
|
"xlink:href",
|
|
2032
2031
|
"xml:id",
|
|
2033
2032
|
"xlink:title",
|
|
2034
2033
|
"xml:space",
|
|
2035
2034
|
"xmlns:xlink"
|
|
2036
|
-
]),
|
|
2035
|
+
]), $n = M(/{{[\w\W]*|^[\w\W]*}}/g), Gn = M(/<%[\w\W]*|^[\w\W]*%>/g), qn = M(/\${[\w\W]*/g), Kn = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), Yn = M(/^aria-[\-\w]+$/), yo = M(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Vn = M(/^(?:\w+script|data):/i), Xn = M(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Qn = M(/^html$/i), Zn = M(/^[a-z][.\w]*(-[.\w]+)+$/i), Eo = M(/<[/\w!]/g), vo = M(/<[/\w]/g), Jn = M(/<\/no(script|embed|frames)/i), ti = M(/\/>/i), H = {
|
|
2037
2036
|
element: 1,
|
|
2038
2037
|
attribute: 2,
|
|
2039
2038
|
text: 3,
|
|
@@ -2046,7 +2045,7 @@ const fo = M([
|
|
|
2046
2045
|
documentType: 10,
|
|
2047
2046
|
documentFragment: 11,
|
|
2048
2047
|
notation: 12
|
|
2049
|
-
},
|
|
2048
|
+
}, Oo = [
|
|
2050
2049
|
"style",
|
|
2051
2050
|
"script",
|
|
2052
2051
|
"xmp",
|
|
@@ -2055,14 +2054,14 @@ const fo = M([
|
|
|
2055
2054
|
"noframes",
|
|
2056
2055
|
"plaintext",
|
|
2057
2056
|
"noscript"
|
|
2058
|
-
],
|
|
2057
|
+
], ei = _(v({}, Oo)), oi = (function() {
|
|
2059
2058
|
const a = {};
|
|
2060
|
-
return at(
|
|
2061
|
-
a[t] =
|
|
2062
|
-
}),
|
|
2063
|
-
})(),
|
|
2059
|
+
return at(Oo, (t) => {
|
|
2060
|
+
a[t] = M(new RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2061
|
+
}), _(a);
|
|
2062
|
+
})(), ni = function() {
|
|
2064
2063
|
return typeof window == "undefined" ? null : window;
|
|
2065
|
-
},
|
|
2064
|
+
}, ii = function(t, e) {
|
|
2066
2065
|
if (typeof t != "object" || typeof t.createPolicy != "function") return null;
|
|
2067
2066
|
let o = null;
|
|
2068
2067
|
const i = "data-tt-policy-suffix";
|
|
@@ -2080,7 +2079,7 @@ const fo = M([
|
|
|
2080
2079
|
} catch (l) {
|
|
2081
2080
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
2082
2081
|
}
|
|
2083
|
-
},
|
|
2082
|
+
}, ko = function() {
|
|
2084
2083
|
return {
|
|
2085
2084
|
afterSanitizeAttributes: [],
|
|
2086
2085
|
afterSanitizeElements: [],
|
|
@@ -2092,23 +2091,23 @@ const fo = M([
|
|
|
2092
2091
|
uponSanitizeElement: [],
|
|
2093
2092
|
uponSanitizeShadowNode: []
|
|
2094
2093
|
};
|
|
2095
|
-
},
|
|
2096
|
-
return N(t, e) &&
|
|
2094
|
+
}, J = function(t, e, o, i) {
|
|
2095
|
+
return N(t, e) && vt(t[e]) ? v(i.base ? U(i.base) : {}, t[e], i.transform) : o;
|
|
2097
2096
|
}, Ee = function(t, e, o) {
|
|
2098
2097
|
const i = N(t, e) ? t[e] : void 0;
|
|
2099
2098
|
return i && typeof i == "object" ? U(i) : o();
|
|
2100
2099
|
};
|
|
2101
|
-
function
|
|
2102
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2103
|
-
const t = (u) =>
|
|
2104
|
-
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
2100
|
+
function Ro() {
|
|
2101
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ni();
|
|
2102
|
+
const t = (u) => Ro(u);
|
|
2103
|
+
if (t.version = "3.4.16", t.removed = [], !a || !a.document || a.document.nodeType !== H.document || !a.Element)
|
|
2105
2104
|
return t.isSupported = !1, t;
|
|
2106
2105
|
let e = a.document;
|
|
2107
2106
|
const o = e, i = o.currentScript;
|
|
2108
2107
|
a.DocumentFragment;
|
|
2109
2108
|
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
|
|
2110
2109
|
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2111
|
-
const
|
|
2110
|
+
const h = a.DOMParser, g = a.trustedTypes, b = c.prototype, k = W(b, "cloneNode"), w = W(b, "remove"), R = W(b, "removeAttributeNode"), et = W(b, "nextSibling"), $ = W(b, "childNodes"), z = W(b, "parentNode"), st = W(b, "shadowRoot"), B = W(b, "attributes"), D = l && l.prototype ? W(l.prototype, "nodeType") : null, lt = l && l.prototype ? W(l.prototype, "nodeName") : null, It = l && l.prototype ? W(l.prototype, "ownerDocument") : null, kt = function(n) {
|
|
2112
2111
|
return D ? D(n) : n.nodeType;
|
|
2113
2112
|
}, Xt = function(n) {
|
|
2114
2113
|
return lt ? lt(n) : n.nodeName;
|
|
@@ -2117,9 +2116,9 @@ function Mo() {
|
|
|
2117
2116
|
const u = e.createElement("template");
|
|
2118
2117
|
u.content && u.content.ownerDocument && (e = u.content.ownerDocument);
|
|
2119
2118
|
}
|
|
2120
|
-
let P, ot = "",
|
|
2119
|
+
let P, ot = "", Qt, Le = !1, wt = 0;
|
|
2121
2120
|
const _e = function() {
|
|
2122
|
-
if (wt > 0) throw
|
|
2121
|
+
if (wt > 0) throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
|
|
2123
2122
|
}, ct = function(n) {
|
|
2124
2123
|
_e(), wt++;
|
|
2125
2124
|
try {
|
|
@@ -2127,35 +2126,35 @@ function Mo() {
|
|
|
2127
2126
|
} finally {
|
|
2128
2127
|
wt--;
|
|
2129
2128
|
}
|
|
2130
|
-
},
|
|
2129
|
+
}, zo = function(n) {
|
|
2131
2130
|
_e(), wt++;
|
|
2132
2131
|
try {
|
|
2133
2132
|
return P.createScriptURL(n);
|
|
2134
2133
|
} finally {
|
|
2135
2134
|
wt--;
|
|
2136
2135
|
}
|
|
2137
|
-
},
|
|
2138
|
-
return
|
|
2139
|
-
},
|
|
2140
|
-
let
|
|
2141
|
-
t.isSupported = typeof
|
|
2142
|
-
const
|
|
2143
|
-
let
|
|
2144
|
-
const
|
|
2145
|
-
...
|
|
2136
|
+
}, Bo = function() {
|
|
2137
|
+
return Le || (Qt = ii(g, i), Le = !0), Qt;
|
|
2138
|
+
}, Dt = e, Zt = Dt.implementation, Me = Dt.createNodeIterator, Fo = Dt.createDocumentFragment, Ho = Dt.getElementsByTagName, Uo = o.importNode;
|
|
2139
|
+
let T = ko();
|
|
2140
|
+
t.isSupported = typeof Io == "function" && typeof z == "function" && Zt && Zt.createHTMLDocument !== void 0;
|
|
2141
|
+
const jo = $n, Wo = Gn, $o = qn, Go = Kn, qo = Yn, Ko = Vn, Ie = Xn, Yo = Zn;
|
|
2142
|
+
let De = yo, C = null;
|
|
2143
|
+
const Jt = v({}, [
|
|
2144
|
+
...ho,
|
|
2146
2145
|
...me,
|
|
2147
2146
|
...ge,
|
|
2148
2147
|
...be,
|
|
2149
|
-
...
|
|
2148
|
+
...mo
|
|
2150
2149
|
]);
|
|
2151
|
-
let
|
|
2152
|
-
const te =
|
|
2153
|
-
...mo,
|
|
2154
|
-
...ye,
|
|
2150
|
+
let x = null;
|
|
2151
|
+
const te = v({}, [
|
|
2155
2152
|
...go,
|
|
2153
|
+
...ye,
|
|
2154
|
+
...bo,
|
|
2156
2155
|
...Gt
|
|
2157
2156
|
]);
|
|
2158
|
-
let G = Object.seal(
|
|
2157
|
+
let G = Object.seal(Et(null, {
|
|
2159
2158
|
tagNameCheck: {
|
|
2160
2159
|
writable: !0,
|
|
2161
2160
|
configurable: !1,
|
|
@@ -2175,7 +2174,7 @@ function Mo() {
|
|
|
2175
2174
|
value: !1
|
|
2176
2175
|
}
|
|
2177
2176
|
})), Tt = null, Oe = null;
|
|
2178
|
-
const V = Object.seal(
|
|
2177
|
+
const V = Object.seal(Et(null, {
|
|
2179
2178
|
tagCheck: {
|
|
2180
2179
|
writable: !0,
|
|
2181
2180
|
configurable: !1,
|
|
@@ -2189,10 +2188,10 @@ function Mo() {
|
|
|
2189
2188
|
value: null
|
|
2190
2189
|
}
|
|
2191
2190
|
}));
|
|
2192
|
-
let
|
|
2193
|
-
const
|
|
2194
|
-
let ie = !0, re = !1, ut = {},
|
|
2195
|
-
const
|
|
2191
|
+
let Re = !0, ee = !0, Pe = !1, Ne = !0, X = !1, nt = !0, it = !1, oe = !1, Ot = null, Rt = null, ne = !1, dt = !1, Pt = !1, Nt = !1, ze = !0, Be = !1;
|
|
2192
|
+
const Fe = "user-content-";
|
|
2193
|
+
let ie = !0, re = !1, ut = {}, ft = null;
|
|
2194
|
+
const He = v({}, [
|
|
2196
2195
|
"annotation-xml",
|
|
2197
2196
|
"audio",
|
|
2198
2197
|
"colgroup",
|
|
@@ -2220,8 +2219,8 @@ function Mo() {
|
|
|
2220
2219
|
"video",
|
|
2221
2220
|
"xmp"
|
|
2222
2221
|
]);
|
|
2223
|
-
let
|
|
2224
|
-
const
|
|
2222
|
+
let Ue = null;
|
|
2223
|
+
const je = v({}, [
|
|
2225
2224
|
"audio",
|
|
2226
2225
|
"video",
|
|
2227
2226
|
"img",
|
|
@@ -2229,8 +2228,8 @@ function Mo() {
|
|
|
2229
2228
|
"image",
|
|
2230
2229
|
"track"
|
|
2231
2230
|
]);
|
|
2232
|
-
let
|
|
2233
|
-
const
|
|
2231
|
+
let We = null;
|
|
2232
|
+
const $e = v({}, [
|
|
2234
2233
|
"alt",
|
|
2235
2234
|
"class",
|
|
2236
2235
|
"for",
|
|
@@ -2245,52 +2244,52 @@ function Mo() {
|
|
|
2245
2244
|
"value",
|
|
2246
2245
|
"style",
|
|
2247
2246
|
"xmlns"
|
|
2248
|
-
]), zt = "http://www.w3.org/1998/Math/MathML",
|
|
2249
|
-
let
|
|
2250
|
-
const
|
|
2247
|
+
]), zt = "http://www.w3.org/1998/Math/MathML", Bt = "http://www.w3.org/2000/svg", q = "http://www.w3.org/1999/xhtml";
|
|
2248
|
+
let pt = q, ae = !1, se = null;
|
|
2249
|
+
const Vo = v({}, [
|
|
2251
2250
|
zt,
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
], he),
|
|
2251
|
+
Bt,
|
|
2252
|
+
q
|
|
2253
|
+
], he), Ge = _([
|
|
2255
2254
|
"mi",
|
|
2256
2255
|
"mo",
|
|
2257
2256
|
"mn",
|
|
2258
2257
|
"ms",
|
|
2259
2258
|
"mtext"
|
|
2260
2259
|
]);
|
|
2261
|
-
let le =
|
|
2262
|
-
const
|
|
2263
|
-
let ce =
|
|
2264
|
-
const
|
|
2260
|
+
let le = v({}, Ge);
|
|
2261
|
+
const qe = _(["annotation-xml"]);
|
|
2262
|
+
let ce = v({}, qe);
|
|
2263
|
+
const Xo = v({}, [
|
|
2265
2264
|
"title",
|
|
2266
2265
|
"style",
|
|
2267
2266
|
"font",
|
|
2268
2267
|
"a",
|
|
2269
2268
|
"script"
|
|
2270
2269
|
]);
|
|
2271
|
-
let
|
|
2272
|
-
const
|
|
2273
|
-
let
|
|
2274
|
-
const
|
|
2270
|
+
let Ct = null;
|
|
2271
|
+
const Qo = ["application/xhtml+xml", "text/html"], Zo = "text/html";
|
|
2272
|
+
let S = null, ht = null;
|
|
2273
|
+
const Jo = e.createElement("form"), Ke = function(n) {
|
|
2275
2274
|
return n instanceof RegExp || n instanceof Function;
|
|
2276
2275
|
}, de = function() {
|
|
2277
2276
|
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2278
2277
|
if (ht && ht === n) return;
|
|
2279
|
-
(!n || typeof n != "object") && (n = {}), n = U(n),
|
|
2280
|
-
transform:
|
|
2281
|
-
base:
|
|
2282
|
-
}),
|
|
2283
|
-
transform:
|
|
2284
|
-
base:
|
|
2285
|
-
}),
|
|
2286
|
-
const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () =>
|
|
2287
|
-
if (G =
|
|
2278
|
+
(!n || typeof n != "object") && (n = {}), n = U(n), Ct = Qo.indexOf(n.PARSER_MEDIA_TYPE) === -1 ? Zo : n.PARSER_MEDIA_TYPE, S = Ct === "application/xhtml+xml" ? he : Mt, C = J(n, "ALLOWED_TAGS", Jt, { transform: S }), x = J(n, "ALLOWED_ATTR", te, { transform: S }), se = J(n, "ALLOWED_NAMESPACES", Vo, { transform: he }), We = J(n, "ADD_URI_SAFE_ATTR", $e, {
|
|
2279
|
+
transform: S,
|
|
2280
|
+
base: $e
|
|
2281
|
+
}), Ue = J(n, "ADD_DATA_URI_TAGS", je, {
|
|
2282
|
+
transform: S,
|
|
2283
|
+
base: je
|
|
2284
|
+
}), ft = J(n, "FORBID_CONTENTS", He, { transform: S }), Tt = J(n, "FORBID_TAGS", U({}), { transform: S }), Oe = J(n, "FORBID_ATTR", U({}), { transform: S }), ut = N(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, Re = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Pe = n.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = n.ALLOW_SELF_CLOSE_IN_ATTR !== !1, X = n.SAFE_FOR_TEMPLATES || !1, nt = n.SAFE_FOR_XML !== !1, it = n.WHOLE_DOCUMENT || !1, dt = n.RETURN_DOM || !1, Pt = n.RETURN_DOM_FRAGMENT || !1, Nt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, ze = n.SANITIZE_DOM !== !1, Be = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, De = Un(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : yo, pt = typeof n.NAMESPACE == "string" ? n.NAMESPACE : q, le = Ee(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, Ge)), ce = Ee(n, "HTML_INTEGRATION_POINTS", () => v({}, qe));
|
|
2285
|
+
const s = Ee(n, "CUSTOM_ELEMENT_HANDLING", () => Et(null));
|
|
2286
|
+
if (G = Et(null), N(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), N(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), N(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), M(G), X && (ee = !1), Pt && (dt = !0), ut && (C = v({}, mo), x = Et(null), ut.html === !0 && (v(C, ho), v(x, go)), ut.svg === !0 && (v(C, me), v(x, ye), v(x, Gt)), ut.svgFilters === !0 && (v(C, ge), v(x, ye), v(x, Gt)), ut.mathMl === !0 && (v(C, be), v(x, bo), v(x, Gt))), V.tagCheck = null, V.attributeCheck = null, N(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? V.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (C === Jt && (C = U(C)), v(C, n.ADD_TAGS, S))), N(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? V.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (x === te && (x = U(x)), v(x, n.ADD_ATTR, S))), N(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (ft === He && (ft = U(ft)), v(ft, n.ADD_FORBID_CONTENTS, S)), ie && (C["#text"] = !0), it && v(C, [
|
|
2288
2287
|
"html",
|
|
2289
2288
|
"head",
|
|
2290
2289
|
"body"
|
|
2291
|
-
]),
|
|
2292
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2293
|
-
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2290
|
+
]), C.table && (v(C, ["tbody"]), delete Tt.tbody), n.TRUSTED_TYPES_POLICY) {
|
|
2291
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createHTML != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2292
|
+
if (typeof n.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2294
2293
|
const d = P;
|
|
2295
2294
|
P = n.TRUSTED_TYPES_POLICY;
|
|
2296
2295
|
try {
|
|
@@ -2298,60 +2297,60 @@ function Mo() {
|
|
|
2298
2297
|
} catch (f) {
|
|
2299
2298
|
throw P = d, f;
|
|
2300
2299
|
}
|
|
2301
|
-
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P =
|
|
2302
|
-
|
|
2303
|
-
}, Ye =
|
|
2300
|
+
} else n.TRUSTED_TYPES_POLICY === null ? (P = void 0, ot = "") : (P === void 0 && (P = Bo()), P && typeof ot == "string" && (ot = ct("")));
|
|
2301
|
+
_ && _(n), ht = n;
|
|
2302
|
+
}, Ye = v({}, [
|
|
2304
2303
|
...me,
|
|
2305
2304
|
...ge,
|
|
2306
|
-
...
|
|
2307
|
-
]),
|
|
2308
|
-
return s.namespaceURI ===
|
|
2309
|
-
},
|
|
2310
|
-
return s.namespaceURI ===
|
|
2311
|
-
},
|
|
2312
|
-
return s.namespaceURI ===
|
|
2313
|
-
},
|
|
2305
|
+
...jn
|
|
2306
|
+
]), Ve = v({}, [...be, ...Wn]), tn = function(n, s, d) {
|
|
2307
|
+
return s.namespaceURI === q ? n === "svg" : s.namespaceURI === zt ? n === "svg" && (d === "annotation-xml" || le[d]) : !!Ye[n];
|
|
2308
|
+
}, en = function(n, s, d) {
|
|
2309
|
+
return s.namespaceURI === q ? n === "math" : s.namespaceURI === Bt ? n === "math" && ce[d] : !!Ve[n];
|
|
2310
|
+
}, on = function(n, s, d) {
|
|
2311
|
+
return s.namespaceURI === Bt && !ce[d] || s.namespaceURI === zt && !le[d] ? !1 : !Ve[n] && (Xo[n] || !Ye[n]);
|
|
2312
|
+
}, nn = function(n) {
|
|
2314
2313
|
let s = z(n);
|
|
2315
2314
|
(!s || !s.tagName) && (s = {
|
|
2316
|
-
namespaceURI:
|
|
2315
|
+
namespaceURI: pt,
|
|
2317
2316
|
tagName: "template"
|
|
2318
2317
|
});
|
|
2319
2318
|
const d = Mt(n.tagName), f = Mt(s.tagName);
|
|
2320
|
-
return se[n.namespaceURI] ? n.namespaceURI ===
|
|
2321
|
-
},
|
|
2319
|
+
return se[n.namespaceURI] ? n.namespaceURI === Bt ? tn(d, s, f) : n.namespaceURI === zt ? en(d, s, f) : n.namespaceURI === q ? on(d, s, f) : !!(Ct === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2320
|
+
}, Q = function(n) {
|
|
2322
2321
|
At(t.removed, { element: n });
|
|
2323
2322
|
try {
|
|
2324
2323
|
z(n).removeChild(n);
|
|
2325
2324
|
} catch (s) {
|
|
2326
|
-
if (
|
|
2325
|
+
if (w(n), !z(n)) throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2327
2326
|
}
|
|
2328
|
-
},
|
|
2327
|
+
}, Xe = function(n, s, d) {
|
|
2329
2328
|
try {
|
|
2330
|
-
|
|
2329
|
+
R(n, s);
|
|
2331
2330
|
} catch (f) {
|
|
2332
2331
|
try {
|
|
2333
2332
|
n.removeAttribute(d);
|
|
2334
|
-
} catch (
|
|
2333
|
+
} catch (m) {
|
|
2335
2334
|
}
|
|
2336
2335
|
}
|
|
2337
|
-
},
|
|
2338
|
-
|
|
2336
|
+
}, Ft = function(n) {
|
|
2337
|
+
Ht(n);
|
|
2339
2338
|
const s = $(n);
|
|
2340
2339
|
if (s) {
|
|
2341
2340
|
const f = [];
|
|
2342
|
-
at(s, (
|
|
2343
|
-
At(f,
|
|
2344
|
-
}), at(f, (
|
|
2341
|
+
at(s, (m) => {
|
|
2342
|
+
At(f, m);
|
|
2343
|
+
}), at(f, (m) => {
|
|
2345
2344
|
try {
|
|
2346
|
-
|
|
2347
|
-
} catch (
|
|
2345
|
+
w(m);
|
|
2346
|
+
} catch (y) {
|
|
2348
2347
|
}
|
|
2349
2348
|
});
|
|
2350
2349
|
}
|
|
2351
|
-
const d =
|
|
2350
|
+
const d = B(n);
|
|
2352
2351
|
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2353
|
-
const
|
|
2354
|
-
typeof
|
|
2352
|
+
const m = d[f], y = m && m.name;
|
|
2353
|
+
typeof y == "string" && Xe(n, m, y);
|
|
2355
2354
|
}
|
|
2356
2355
|
}, rt = function(n, s, d) {
|
|
2357
2356
|
if (!d) try {
|
|
@@ -2364,106 +2363,106 @@ function Mo() {
|
|
|
2364
2363
|
from: s
|
|
2365
2364
|
});
|
|
2366
2365
|
try {
|
|
2367
|
-
d ?
|
|
2366
|
+
d ? R(s, d) : s.removeAttribute(n);
|
|
2368
2367
|
} catch (f) {
|
|
2369
2368
|
try {
|
|
2370
2369
|
s.removeAttribute(n);
|
|
2371
|
-
} catch (
|
|
2370
|
+
} catch (m) {
|
|
2372
2371
|
}
|
|
2373
2372
|
}
|
|
2374
2373
|
if (n === "is")
|
|
2375
2374
|
if (dt || Pt) try {
|
|
2376
|
-
|
|
2375
|
+
Q(s);
|
|
2377
2376
|
} catch (f) {
|
|
2378
2377
|
}
|
|
2379
2378
|
else try {
|
|
2380
2379
|
s.setAttribute(n, "");
|
|
2381
2380
|
} catch (f) {
|
|
2382
2381
|
}
|
|
2383
|
-
},
|
|
2384
|
-
const s =
|
|
2382
|
+
}, rn = function(n) {
|
|
2383
|
+
const s = B(n);
|
|
2385
2384
|
if (s)
|
|
2386
2385
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2387
|
-
const f = s[d],
|
|
2388
|
-
typeof
|
|
2386
|
+
const f = s[d], m = f && f.name;
|
|
2387
|
+
typeof m != "string" || x[S(m)] || Xe(n, f, m);
|
|
2389
2388
|
}
|
|
2390
|
-
},
|
|
2389
|
+
}, Ht = function(n) {
|
|
2391
2390
|
const s = [n];
|
|
2392
2391
|
for (; s.length > 0; ) {
|
|
2393
2392
|
const d = s.pop();
|
|
2394
|
-
|
|
2393
|
+
kt(d) === H.element && rn(d);
|
|
2395
2394
|
const f = $(d);
|
|
2396
|
-
if (f) for (let
|
|
2395
|
+
if (f) for (let m = f.length - 1; m >= 0; --m) s.push(f[m]);
|
|
2397
2396
|
}
|
|
2398
|
-
},
|
|
2397
|
+
}, Qe = function(n, s) {
|
|
2399
2398
|
return nt ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
2400
|
-
},
|
|
2399
|
+
}, an = function(n) {
|
|
2401
2400
|
if (!nt) return;
|
|
2402
2401
|
const s = [n];
|
|
2403
2402
|
for (; s.length > 0; ) {
|
|
2404
|
-
const d = s.pop(), f =
|
|
2405
|
-
if (f ===
|
|
2403
|
+
const d = s.pop(), f = kt(d);
|
|
2404
|
+
if (f === H.processingInstruction || f === H.comment && I(vo, d.data)) {
|
|
2406
2405
|
try {
|
|
2407
|
-
|
|
2408
|
-
} catch (
|
|
2406
|
+
w(d);
|
|
2407
|
+
} catch (y) {
|
|
2409
2408
|
}
|
|
2410
2409
|
continue;
|
|
2411
2410
|
}
|
|
2412
|
-
if (f ===
|
|
2413
|
-
const
|
|
2411
|
+
if (f === H.element) {
|
|
2412
|
+
const y = d, E = S(Xt(d));
|
|
2414
2413
|
try {
|
|
2415
|
-
|
|
2416
|
-
} catch (
|
|
2414
|
+
y.hasAttribute && y.hasAttribute("patchsrc") && y.removeAttribute("patchsrc"), y.hasAttribute && y.hasAttribute("for") && Qe("for", E) && y.removeAttribute("for");
|
|
2415
|
+
} catch (A) {
|
|
2417
2416
|
}
|
|
2418
2417
|
}
|
|
2419
|
-
const
|
|
2420
|
-
if (
|
|
2418
|
+
const m = $(d);
|
|
2419
|
+
if (m) for (let y = m.length - 1; y >= 0; --y) s.push(m[y]);
|
|
2421
2420
|
}
|
|
2422
2421
|
}, Ze = function(n) {
|
|
2423
2422
|
let s = null, d = null;
|
|
2424
2423
|
if (ne) n = "<remove></remove>" + n;
|
|
2425
2424
|
else {
|
|
2426
|
-
const
|
|
2427
|
-
d =
|
|
2425
|
+
const y = co(n, /^[\r\n\t ]+/);
|
|
2426
|
+
d = y && y[0];
|
|
2428
2427
|
}
|
|
2429
|
-
|
|
2428
|
+
Ct === "application/xhtml+xml" && pt === q && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2430
2429
|
const f = P ? ct(n) : n;
|
|
2431
|
-
if (
|
|
2432
|
-
s = new
|
|
2433
|
-
} catch (
|
|
2430
|
+
if (pt === q) try {
|
|
2431
|
+
s = new h().parseFromString(f, Ct);
|
|
2432
|
+
} catch (y) {
|
|
2434
2433
|
}
|
|
2435
2434
|
if (!s || !s.documentElement) {
|
|
2436
|
-
s =
|
|
2435
|
+
s = Zt.createDocument(pt, "template", null);
|
|
2437
2436
|
try {
|
|
2438
2437
|
s.documentElement.innerHTML = ae ? ot : f;
|
|
2439
|
-
} catch (
|
|
2438
|
+
} catch (y) {
|
|
2440
2439
|
}
|
|
2441
2440
|
}
|
|
2442
|
-
const
|
|
2443
|
-
return n && d &&
|
|
2441
|
+
const m = s.body || s.documentElement;
|
|
2442
|
+
return n && d && m.insertBefore(e.createTextNode(d), m.childNodes[0] || null), pt === q ? Ho.call(s, it ? "html" : "body")[0] : it ? s.documentElement : m;
|
|
2444
2443
|
}, Je = function(n) {
|
|
2445
2444
|
const s = It ? It(n) : n.ownerDocument;
|
|
2446
|
-
return
|
|
2445
|
+
return Me.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2447
2446
|
}, Ut = function(n) {
|
|
2448
|
-
return n =
|
|
2447
|
+
return n = St(n, jo, " "), n = St(n, Wo, " "), n = St(n, $o, " "), n;
|
|
2449
2448
|
}, ue = function(n) {
|
|
2450
2449
|
var s;
|
|
2451
2450
|
n.normalize();
|
|
2452
|
-
const d = It ? It(n) : n.ownerDocument, f =
|
|
2453
|
-
let
|
|
2454
|
-
for (;
|
|
2455
|
-
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2458
|
-
mt(
|
|
2451
|
+
const d = It ? It(n) : n.ownerDocument, f = Me.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2452
|
+
let m = f.nextNode();
|
|
2453
|
+
for (; m; )
|
|
2454
|
+
m.data = Ut(m.data), m = f.nextNode();
|
|
2455
|
+
const y = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2456
|
+
y && at(y, (E) => {
|
|
2457
|
+
mt(E.content) && ue(E.content);
|
|
2459
2458
|
});
|
|
2460
2459
|
}, jt = function(n) {
|
|
2461
2460
|
const s = lt ? lt(n) : null;
|
|
2462
|
-
return typeof s != "string" ||
|
|
2461
|
+
return typeof s != "string" || S(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== B(n) || typeof n.removeAttribute != "function" || typeof n.removeAttributeNode != "function" || typeof n.getAttributeNode != "function" || typeof n.setAttribute != "function" || typeof n.namespaceURI != "string" || typeof n.insertBefore != "function" || typeof n.hasChildNodes != "function" || n.nodeType !== D(n) || n.childNodes !== $(n);
|
|
2463
2462
|
}, mt = function(n) {
|
|
2464
2463
|
if (!D || typeof n != "object" || n === null) return !1;
|
|
2465
2464
|
try {
|
|
2466
|
-
return D(n) ===
|
|
2465
|
+
return D(n) === H.documentFragment;
|
|
2467
2466
|
} catch (s) {
|
|
2468
2467
|
return !1;
|
|
2469
2468
|
}
|
|
@@ -2475,64 +2474,64 @@ function Mo() {
|
|
|
2475
2474
|
return !1;
|
|
2476
2475
|
}
|
|
2477
2476
|
};
|
|
2478
|
-
function
|
|
2477
|
+
function K(u, n, s) {
|
|
2479
2478
|
u.length !== 0 && at(u, (d) => {
|
|
2480
2479
|
d.call(t, n, s, ht);
|
|
2481
2480
|
});
|
|
2482
2481
|
}
|
|
2483
|
-
const
|
|
2484
|
-
return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) &&
|
|
2482
|
+
const sn = function(n, s) {
|
|
2483
|
+
return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) && I(Eo, n.textContent) && I(Eo, n.innerHTML) || nt && n.namespaceURI === q && ei[s] && (xt(n.firstElementChild) || typeof n.textContent == "string" && I(oi[s], n.textContent)) || n.nodeType === H.processingInstruction || nt && n.nodeType === H.comment && I(vo, n.data));
|
|
2485
2484
|
}, Wt = function(n, s) {
|
|
2486
|
-
if (n instanceof RegExp) return
|
|
2485
|
+
if (n instanceof RegExp) return I(n, s);
|
|
2487
2486
|
if (n instanceof Function) {
|
|
2488
|
-
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0),
|
|
2487
|
+
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), m = 2; m < d; m++) f[m - 2] = arguments[m];
|
|
2489
2488
|
return !!n(s, ...f);
|
|
2490
2489
|
}
|
|
2491
2490
|
return !1;
|
|
2492
|
-
},
|
|
2493
|
-
if (!Tt[s] &&
|
|
2494
|
-
if (ie && !
|
|
2495
|
-
const f = z(n),
|
|
2496
|
-
if (
|
|
2497
|
-
const
|
|
2498
|
-
for (let
|
|
2499
|
-
const
|
|
2500
|
-
f.insertBefore(
|
|
2491
|
+
}, ln = function(n, s, d) {
|
|
2492
|
+
if (!Tt[s] && no(s) && Wt(G.tagNameCheck, s)) return !1;
|
|
2493
|
+
if (ie && !ft[s]) {
|
|
2494
|
+
const f = z(n), m = $(n);
|
|
2495
|
+
if (m && f) {
|
|
2496
|
+
const y = m.length;
|
|
2497
|
+
for (let E = y - 1; E >= 0; --E) {
|
|
2498
|
+
const A = n === d ? k(m[E], !0) : m[E];
|
|
2499
|
+
f.insertBefore(A, et(n));
|
|
2501
2500
|
}
|
|
2502
2501
|
}
|
|
2503
2502
|
}
|
|
2504
|
-
return
|
|
2505
|
-
},
|
|
2503
|
+
return Q(n), !0;
|
|
2504
|
+
}, to = function(n, s, d, f) {
|
|
2506
2505
|
return n.length === 0 ? s : s === d || s === f ? U(s) : s;
|
|
2507
2506
|
}, gt = function(n, s) {
|
|
2508
|
-
return n === s || z(n) !== null ? !1 : (re &&
|
|
2509
|
-
},
|
|
2510
|
-
if (
|
|
2507
|
+
return n === s || z(n) !== null ? !1 : (re && Ht(n), !0);
|
|
2508
|
+
}, eo = function(n, s) {
|
|
2509
|
+
if (K(T.beforeSanitizeElements, n, null), gt(n, s)) return !0;
|
|
2511
2510
|
if (jt(n))
|
|
2512
|
-
return
|
|
2513
|
-
const d =
|
|
2514
|
-
if (
|
|
2511
|
+
return Q(n), !0;
|
|
2512
|
+
const d = S(Xt(n));
|
|
2513
|
+
if (C = to(T.uponSanitizeElement, C, Jt, Ot), K(T.uponSanitizeElement, n, {
|
|
2515
2514
|
tagName: d,
|
|
2516
|
-
allowedTags:
|
|
2515
|
+
allowedTags: C
|
|
2517
2516
|
}), gt(n, s)) return !0;
|
|
2518
|
-
if (
|
|
2519
|
-
return
|
|
2520
|
-
if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !
|
|
2521
|
-
const f =
|
|
2522
|
-
return f === !1 && (
|
|
2523
|
-
}
|
|
2524
|
-
if (
|
|
2525
|
-
return
|
|
2526
|
-
if (X && n.nodeType ===
|
|
2517
|
+
if (sn(n, d))
|
|
2518
|
+
return Q(n), !0;
|
|
2519
|
+
if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !C[d]) {
|
|
2520
|
+
const f = ln(n, d, s);
|
|
2521
|
+
return f === !1 && (K(T.afterSanitizeElements, n, null), gt(n, s)) ? !0 : f;
|
|
2522
|
+
}
|
|
2523
|
+
if (kt(n) === H.element && !nn(n) || (d === "noscript" || d === "noembed" || d === "noframes") && I(Jn, n.innerHTML))
|
|
2524
|
+
return Q(n), !0;
|
|
2525
|
+
if (X && n.nodeType === H.text) {
|
|
2527
2526
|
const f = Ut(n.textContent);
|
|
2528
2527
|
n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2529
2528
|
}
|
|
2530
|
-
return
|
|
2531
|
-
},
|
|
2532
|
-
if (Oe[s] ||
|
|
2533
|
-
const f =
|
|
2534
|
-
return ee &&
|
|
2535
|
-
},
|
|
2529
|
+
return K(T.afterSanitizeElements, n, null), gt(n, s);
|
|
2530
|
+
}, oo = function(n, s, d) {
|
|
2531
|
+
if (Oe[s] || Qe(s, n) || ze && (s === "id" || s === "name") && (d in e || d in Jo)) return !1;
|
|
2532
|
+
const f = x[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, n);
|
|
2533
|
+
return ee && I(Go, s) || Re && I(qo, s) ? !0 : f ? We[s] || I(De, St(d, Ie, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && uo(d, "data:") === 0 && Ue[n] || Pe && !I(Ko, St(d, Ie, "")) ? !0 : !d : no(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2534
|
+
}, cn = v({}, [
|
|
2536
2535
|
"annotation-xml",
|
|
2537
2536
|
"color-profile",
|
|
2538
2537
|
"font-face",
|
|
@@ -2541,74 +2540,74 @@ function Mo() {
|
|
|
2541
2540
|
"font-face-src",
|
|
2542
2541
|
"font-face-uri",
|
|
2543
2542
|
"missing-glyph"
|
|
2544
|
-
]),
|
|
2545
|
-
return !
|
|
2546
|
-
},
|
|
2543
|
+
]), no = function(n) {
|
|
2544
|
+
return !cn[Mt(n)] && I(Yo, n);
|
|
2545
|
+
}, dn = function(n, s, d, f) {
|
|
2547
2546
|
if (P && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
|
|
2548
2547
|
case "TrustedHTML":
|
|
2549
2548
|
return ct(f);
|
|
2550
2549
|
case "TrustedScriptURL":
|
|
2551
|
-
return
|
|
2550
|
+
return zo(f);
|
|
2552
2551
|
}
|
|
2553
2552
|
return f;
|
|
2554
|
-
},
|
|
2553
|
+
}, un = function(n, s, d, f) {
|
|
2555
2554
|
try {
|
|
2556
|
-
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (
|
|
2557
|
-
} catch (
|
|
2555
|
+
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (Q(n), !1) : !0;
|
|
2556
|
+
} catch (m) {
|
|
2558
2557
|
return rt(s, n), !1;
|
|
2559
2558
|
}
|
|
2560
|
-
},
|
|
2561
|
-
if (
|
|
2559
|
+
}, io = function(n, s) {
|
|
2560
|
+
if (K(T.beforeSanitizeAttributes, n, null), gt(n, s)) return;
|
|
2562
2561
|
const d = n.attributes;
|
|
2563
2562
|
if (!d || jt(n)) return;
|
|
2564
|
-
|
|
2563
|
+
x = to(T.uponSanitizeAttribute, x, te, Rt);
|
|
2565
2564
|
const f = {
|
|
2566
2565
|
attrName: "",
|
|
2567
2566
|
attrValue: "",
|
|
2568
2567
|
keepAttr: !0,
|
|
2569
|
-
allowedAttributes:
|
|
2568
|
+
allowedAttributes: x,
|
|
2570
2569
|
forceKeepAttr: void 0
|
|
2571
2570
|
};
|
|
2572
|
-
let
|
|
2573
|
-
const
|
|
2574
|
-
for (;
|
|
2575
|
-
const
|
|
2576
|
-
let
|
|
2577
|
-
if (f.attrName = bt, f.attrValue =
|
|
2578
|
-
rt(
|
|
2571
|
+
let m = d.length;
|
|
2572
|
+
const y = S(n.nodeName);
|
|
2573
|
+
for (; m--; ) {
|
|
2574
|
+
const E = d[m], A = E.name, j = E.namespaceURI, F = E.value, bt = S(A), pe = F;
|
|
2575
|
+
let O = A === "value" ? pe : Pn(pe), ro = !1;
|
|
2576
|
+
if (f.attrName = bt, f.attrValue = O, f.keepAttr = !0, f.forceKeepAttr = void 0, K(T.uponSanitizeAttribute, n, f), O = f.attrValue, Be && (bt === "id" || bt === "name") && uo(O, Fe) !== 0 && (rt(A, n, E), O = Fe + O, ro = !0), nt && I(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
|
|
2577
|
+
rt(A, n, E);
|
|
2579
2578
|
continue;
|
|
2580
2579
|
}
|
|
2581
|
-
if (bt === "attributename" &&
|
|
2582
|
-
rt(
|
|
2580
|
+
if (bt === "attributename" && co(O, "href")) {
|
|
2581
|
+
rt(A, n, E);
|
|
2583
2582
|
continue;
|
|
2584
2583
|
}
|
|
2585
2584
|
if (!f.forceKeepAttr) {
|
|
2586
2585
|
if (!f.keepAttr) {
|
|
2587
|
-
rt(
|
|
2586
|
+
rt(A, n, E);
|
|
2588
2587
|
continue;
|
|
2589
2588
|
}
|
|
2590
|
-
if (!
|
|
2591
|
-
rt(
|
|
2589
|
+
if (!Ne && I(ti, O)) {
|
|
2590
|
+
rt(A, n, E);
|
|
2592
2591
|
continue;
|
|
2593
2592
|
}
|
|
2594
|
-
if (X && (
|
|
2595
|
-
rt(
|
|
2593
|
+
if (X && (O = Ut(O)), !oo(y, bt, O)) {
|
|
2594
|
+
rt(A, n, E);
|
|
2596
2595
|
continue;
|
|
2597
2596
|
}
|
|
2598
|
-
|
|
2597
|
+
O = dn(y, bt, j, O), O !== pe && un(n, A, j, O) && ro && lo(t.removed);
|
|
2599
2598
|
}
|
|
2600
2599
|
}
|
|
2601
|
-
|
|
2600
|
+
K(T.afterSanitizeAttributes, n, null), gt(n, s);
|
|
2602
2601
|
}, $t = function(n) {
|
|
2603
2602
|
let s = null;
|
|
2604
2603
|
const d = Je(n);
|
|
2605
|
-
for (
|
|
2606
|
-
if (
|
|
2604
|
+
for (K(T.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2605
|
+
if (K(T.uponSanitizeShadowNode, s, null), eo(s, n), io(s, n), mt(s.content) && $t(s.content), kt(s) === H.element) {
|
|
2607
2606
|
const f = st(s);
|
|
2608
|
-
mt(f) && (
|
|
2607
|
+
mt(f) && (fe(f), $t(f));
|
|
2609
2608
|
}
|
|
2610
|
-
|
|
2611
|
-
},
|
|
2609
|
+
K(T.afterSanitizeShadowDOM, n, null);
|
|
2610
|
+
}, fe = function(n) {
|
|
2612
2611
|
const s = [{
|
|
2613
2612
|
node: n,
|
|
2614
2613
|
shadow: null
|
|
@@ -2619,115 +2618,115 @@ function Mo() {
|
|
|
2619
2618
|
$t(d.shadow);
|
|
2620
2619
|
continue;
|
|
2621
2620
|
}
|
|
2622
|
-
const f = d.node,
|
|
2623
|
-
if (
|
|
2624
|
-
node:
|
|
2621
|
+
const f = d.node, m = kt(f) === H.element, y = $(f);
|
|
2622
|
+
if (y) for (let E = y.length - 1; E >= 0; --E) s.push({
|
|
2623
|
+
node: y[E],
|
|
2625
2624
|
shadow: null
|
|
2626
2625
|
});
|
|
2627
|
-
if (
|
|
2628
|
-
const
|
|
2629
|
-
if (typeof
|
|
2630
|
-
const
|
|
2631
|
-
mt(
|
|
2632
|
-
node:
|
|
2626
|
+
if (m) {
|
|
2627
|
+
const E = lt ? lt(f) : null;
|
|
2628
|
+
if (typeof E == "string" && S(E) === "template") {
|
|
2629
|
+
const A = f.content;
|
|
2630
|
+
mt(A) && s.push({
|
|
2631
|
+
node: A,
|
|
2633
2632
|
shadow: null
|
|
2634
2633
|
});
|
|
2635
2634
|
}
|
|
2636
2635
|
}
|
|
2637
|
-
if (
|
|
2638
|
-
const
|
|
2639
|
-
mt(
|
|
2636
|
+
if (m) {
|
|
2637
|
+
const E = st(f);
|
|
2638
|
+
mt(E) && s.push({
|
|
2640
2639
|
node: null,
|
|
2641
|
-
shadow:
|
|
2640
|
+
shadow: E
|
|
2642
2641
|
}, {
|
|
2643
|
-
node:
|
|
2642
|
+
node: E,
|
|
2644
2643
|
shadow: null
|
|
2645
2644
|
});
|
|
2646
2645
|
}
|
|
2647
2646
|
}
|
|
2648
2647
|
};
|
|
2649
2648
|
return t.sanitize = function(u) {
|
|
2650
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null,
|
|
2651
|
-
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u =
|
|
2652
|
-
throw
|
|
2649
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, m = null;
|
|
2650
|
+
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Hn(u), typeof u != "string"))
|
|
2651
|
+
throw Z("dirty is not a string, aborting");
|
|
2653
2652
|
if (!t.isSupported) return u;
|
|
2654
|
-
oe ? (
|
|
2655
|
-
const
|
|
2656
|
-
if (
|
|
2657
|
-
|
|
2653
|
+
oe ? (C = Ot, x = Rt) : de(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (C = U(C)), T.uponSanitizeAttribute.length > 0 && (x = U(x)), t.removed = [];
|
|
2654
|
+
const y = re && typeof u != "string" && xt(u);
|
|
2655
|
+
if (y) {
|
|
2656
|
+
an(u);
|
|
2658
2657
|
const j = Xt(u);
|
|
2659
2658
|
if (typeof j == "string") {
|
|
2660
|
-
const
|
|
2661
|
-
if (!
|
|
2662
|
-
throw
|
|
2659
|
+
const F = S(j);
|
|
2660
|
+
if (!C[F] || Tt[F])
|
|
2661
|
+
throw Ft(u), Z("root node is forbidden and cannot be sanitized in-place");
|
|
2663
2662
|
}
|
|
2664
2663
|
if (jt(u))
|
|
2665
|
-
throw
|
|
2664
|
+
throw Ft(u), Z("root node is clobbered and cannot be sanitized in-place");
|
|
2666
2665
|
try {
|
|
2667
|
-
|
|
2668
|
-
} catch (
|
|
2669
|
-
throw
|
|
2666
|
+
fe(u);
|
|
2667
|
+
} catch (F) {
|
|
2668
|
+
throw Ft(u), F;
|
|
2670
2669
|
}
|
|
2671
2670
|
} else if (xt(u))
|
|
2672
|
-
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType ===
|
|
2671
|
+
s = Ze("<!---->"), d = s.ownerDocument.importNode(u, !0), d.nodeType === H.element && d.nodeName === "BODY" || d.nodeName === "HTML" ? s = d : s.appendChild(d), fe(s);
|
|
2673
2672
|
else {
|
|
2674
2673
|
if (!dt && !X && !it && u.indexOf("<") === -1) return P && Nt ? ct(u) : u;
|
|
2675
2674
|
if (s = Ze(u), !s) return dt ? null : Nt ? ot : "";
|
|
2676
2675
|
}
|
|
2677
|
-
s && ne &&
|
|
2678
|
-
const
|
|
2676
|
+
s && ne && Q(s.firstChild);
|
|
2677
|
+
const E = y ? u : s;
|
|
2679
2678
|
try {
|
|
2680
|
-
const j = Je(
|
|
2679
|
+
const j = Je(E);
|
|
2681
2680
|
for (; f = j.nextNode(); )
|
|
2682
|
-
|
|
2681
|
+
eo(f, E), io(f, E), mt(f.content) && $t(f.content);
|
|
2683
2682
|
} catch (j) {
|
|
2684
|
-
throw
|
|
2685
|
-
|
|
2683
|
+
throw y && (Ft(u), at(t.removed, (F) => {
|
|
2684
|
+
F.element && Ht(F.element);
|
|
2686
2685
|
})), j;
|
|
2687
2686
|
}
|
|
2688
|
-
if (
|
|
2687
|
+
if (y) {
|
|
2689
2688
|
let j = !1;
|
|
2690
|
-
if (at(t.removed, (
|
|
2691
|
-
|
|
2692
|
-
}), j) throw
|
|
2689
|
+
if (at(t.removed, (F) => {
|
|
2690
|
+
F.element && (F.element === u && (j = !0), Ht(F.element));
|
|
2691
|
+
}), j) throw Z("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
2693
2692
|
return X && ue(u), u;
|
|
2694
2693
|
}
|
|
2695
2694
|
if (dt) {
|
|
2696
2695
|
if (X && ue(s), Pt)
|
|
2697
|
-
for (
|
|
2698
|
-
else
|
|
2699
|
-
return (
|
|
2696
|
+
for (m = Fo.call(s.ownerDocument); s.firstChild; ) m.appendChild(s.firstChild);
|
|
2697
|
+
else m = s;
|
|
2698
|
+
return (x.shadowroot || x.shadowrootmode) && (m = Uo.call(o, m, !0)), m;
|
|
2700
2699
|
}
|
|
2701
|
-
let
|
|
2702
|
-
return it &&
|
|
2703
|
-
` +
|
|
2700
|
+
let A = it ? s.outerHTML : s.innerHTML;
|
|
2701
|
+
return it && C["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && I(Qn, s.ownerDocument.doctype.name) && (A = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2702
|
+
` + A), X && (A = Ut(A)), P && Nt ? ct(A) : A;
|
|
2704
2703
|
}, t.setConfig = function() {
|
|
2705
2704
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2706
|
-
de(u), oe = !0,
|
|
2705
|
+
de(u), oe = !0, Ot = C, Rt = x;
|
|
2707
2706
|
}, t.clearConfig = function() {
|
|
2708
|
-
ht = null, oe = !1,
|
|
2707
|
+
ht = null, oe = !1, Ot = null, Rt = null, P = Qt, ot = "";
|
|
2709
2708
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2710
2709
|
ht || de({});
|
|
2711
|
-
const d =
|
|
2712
|
-
return
|
|
2710
|
+
const d = S(u), f = S(n);
|
|
2711
|
+
return oo(d, f, s);
|
|
2713
2712
|
}, t.addHook = function(u, n) {
|
|
2714
|
-
typeof n == "function" && N(
|
|
2713
|
+
typeof n == "function" && N(T, u) && At(T[u], n);
|
|
2715
2714
|
}, t.removeHook = function(u, n) {
|
|
2716
|
-
if (N(
|
|
2715
|
+
if (N(T, u)) {
|
|
2717
2716
|
if (n !== void 0) {
|
|
2718
|
-
const s =
|
|
2719
|
-
return s === -1 ? void 0 :
|
|
2717
|
+
const s = On(T[u], n);
|
|
2718
|
+
return s === -1 ? void 0 : Rn(T[u], s, 1)[0];
|
|
2720
2719
|
}
|
|
2721
|
-
return
|
|
2720
|
+
return lo(T[u]);
|
|
2722
2721
|
}
|
|
2723
2722
|
}, t.removeHooks = function(u) {
|
|
2724
|
-
N(
|
|
2723
|
+
N(T, u) && (T[u] = []);
|
|
2725
2724
|
}, t.removeAllHooks = function() {
|
|
2726
|
-
|
|
2725
|
+
T = ko();
|
|
2727
2726
|
}, t;
|
|
2728
2727
|
}
|
|
2729
|
-
var
|
|
2730
|
-
const
|
|
2728
|
+
var qt = Ro();
|
|
2729
|
+
const ri = [
|
|
2731
2730
|
"p",
|
|
2732
2731
|
"br",
|
|
2733
2732
|
"strong",
|
|
@@ -2776,7 +2775,7 @@ const ei = [
|
|
|
2776
2775
|
// user-initiated dialog, a different trust boundary that never calls
|
|
2777
2776
|
// through this sanitizer. A consumer that genuinely wants iframes in
|
|
2778
2777
|
// pasted/typed content can still opt in via a custom allowedTags list.
|
|
2779
|
-
],
|
|
2778
|
+
], ai = {
|
|
2780
2779
|
"*": ["class", "style", "id", "data-*", "role", "aria-*", "tabindex", "contenteditable", "spellcheck", "dir", "lang"],
|
|
2781
2780
|
a: ["href", "target", "rel", "title"],
|
|
2782
2781
|
img: ["src", "alt", "width", "height", "loading"],
|
|
@@ -2793,8 +2792,8 @@ const ei = [
|
|
|
2793
2792
|
// additionalAllowedTags), restoring the attributes that make an inserted
|
|
2794
2793
|
// iframe actually usable (src, sizing, fullscreen, scrolling/border).
|
|
2795
2794
|
iframe: ["src", "width", "height", "name", "title", "frameborder", "scrolling", "allowfullscreen", "longdesc", "allow"]
|
|
2796
|
-
},
|
|
2797
|
-
function
|
|
2795
|
+
}, si = "data-editora-embed";
|
|
2796
|
+
function li(a) {
|
|
2798
2797
|
if (!a || /\s/.test(a.trim())) return !1;
|
|
2799
2798
|
try {
|
|
2800
2799
|
const t = new URL(a.trim());
|
|
@@ -2803,50 +2802,50 @@ function ii(a) {
|
|
|
2803
2802
|
return !1;
|
|
2804
2803
|
}
|
|
2805
2804
|
}
|
|
2806
|
-
function
|
|
2805
|
+
function Po(a, t, e, o) {
|
|
2807
2806
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2808
2807
|
return a;
|
|
2809
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags :
|
|
2810
|
-
for (const
|
|
2811
|
-
for (const
|
|
2812
|
-
const
|
|
2808
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ri, r = e != null && e.length ? Array.from(/* @__PURE__ */ new Set([...i, ...e])) : i, c = !!(t != null && t.allowedAttributes) && Object.keys(t.allowedAttributes).length > 0 ? t.allowedAttributes : ai, p = /* @__PURE__ */ new Set();
|
|
2809
|
+
for (const b of Object.values(c))
|
|
2810
|
+
for (const k of b) p.add(k);
|
|
2811
|
+
const h = {
|
|
2813
2812
|
ALLOWED_TAGS: r,
|
|
2814
2813
|
ALLOWED_ATTR: Array.from(p)
|
|
2815
2814
|
};
|
|
2816
2815
|
if (!o)
|
|
2817
|
-
return
|
|
2816
|
+
return qt.sanitize(a, h);
|
|
2818
2817
|
const g = r.includes("iframe");
|
|
2819
|
-
|
|
2818
|
+
qt.addHook(
|
|
2820
2819
|
"uponSanitizeElement",
|
|
2821
|
-
(
|
|
2822
|
-
var
|
|
2823
|
-
if (
|
|
2824
|
-
const
|
|
2825
|
-
|
|
2820
|
+
(b, k) => {
|
|
2821
|
+
var R;
|
|
2822
|
+
if (k.tagName !== "iframe") return;
|
|
2823
|
+
const w = b;
|
|
2824
|
+
k.allowedTags.iframe = g || ((R = w.getAttribute) == null ? void 0 : R.call(w, si)) === "true" && li(w.getAttribute("src"));
|
|
2826
2825
|
}
|
|
2827
2826
|
);
|
|
2828
2827
|
try {
|
|
2829
|
-
return
|
|
2828
|
+
return qt.sanitize(a, h);
|
|
2830
2829
|
} finally {
|
|
2831
|
-
|
|
2830
|
+
qt.removeHook("uponSanitizeElement");
|
|
2832
2831
|
}
|
|
2833
2832
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return
|
|
2833
|
+
function ci(a, t, e, o) {
|
|
2834
|
+
return Po(a, t, o, !1);
|
|
2836
2835
|
}
|
|
2837
|
-
function
|
|
2838
|
-
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a :
|
|
2836
|
+
function di(a, t, e) {
|
|
2837
|
+
return (e == null ? void 0 : e.sanitizeOnPaste) === !1 ? a : ci(a, t);
|
|
2839
2838
|
}
|
|
2840
2839
|
function wo(a, t, e, o) {
|
|
2841
|
-
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a :
|
|
2840
|
+
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Po(a, t, o, !0);
|
|
2842
2841
|
}
|
|
2843
|
-
const
|
|
2844
|
-
function
|
|
2845
|
-
if (!a || !
|
|
2842
|
+
const ui = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", fi = /resize-handle|data-rte-media-pending|rte-media/;
|
|
2843
|
+
function No(a) {
|
|
2844
|
+
if (!a || !fi.test(a)) return a;
|
|
2846
2845
|
const t = document.createElement("template");
|
|
2847
2846
|
t.innerHTML = a;
|
|
2848
2847
|
const e = /* @__PURE__ */ new Set();
|
|
2849
|
-
return t.content.querySelectorAll(
|
|
2848
|
+
return t.content.querySelectorAll(ui).forEach((o) => {
|
|
2850
2849
|
const i = o.parentElement;
|
|
2851
2850
|
i && (i.tagName === "TD" || i.tagName === "TH") && e.add(i), o.remove();
|
|
2852
2851
|
}), e.forEach((o) => {
|
|
@@ -2859,8 +2858,8 @@ function Oo(a) {
|
|
|
2859
2858
|
i && (i.removeAttribute("contenteditable"), !((r = i.textContent) != null && r.trim()) && !i.querySelector("img, video, a") && i.remove());
|
|
2860
2859
|
}), t.innerHTML;
|
|
2861
2860
|
}
|
|
2862
|
-
function
|
|
2863
|
-
return a ?
|
|
2861
|
+
function yt(a) {
|
|
2862
|
+
return a ? No(a.innerHTML) : "";
|
|
2864
2863
|
}
|
|
2865
2864
|
const Vt = class Vt {
|
|
2866
2865
|
/**
|
|
@@ -3059,7 +3058,7 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
3059
3058
|
width: "100%",
|
|
3060
3059
|
readonly: !1,
|
|
3061
3060
|
disabled: !1,
|
|
3062
|
-
menubar: !
|
|
3061
|
+
menubar: !1,
|
|
3063
3062
|
toolbar: !0,
|
|
3064
3063
|
plugins: [],
|
|
3065
3064
|
theme: "light",
|
|
@@ -3124,51 +3123,227 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
3124
3123
|
"security-sanitize-on-input"
|
|
3125
3124
|
]);
|
|
3126
3125
|
let xe = Vt;
|
|
3127
|
-
const ci = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3126
|
+
const To = /* @__PURE__ */ new Set();
|
|
3127
|
+
function pi(a, t) {
|
|
3128
|
+
To.has(a) || (To.add(a), console.warn(
|
|
3129
|
+
`[Editora] The "${a}" option has no effect: ${t} It is still accepted so existing code keeps working, and will be removed in a future major release.`
|
|
3130
|
+
));
|
|
3131
|
+
}
|
|
3132
|
+
const hi = [
|
|
3133
|
+
"bold",
|
|
3134
|
+
"italic",
|
|
3135
|
+
"underline",
|
|
3136
|
+
"strikethrough",
|
|
3137
|
+
"clearFormatting",
|
|
3138
|
+
"heading",
|
|
3139
|
+
"blockquote",
|
|
3140
|
+
"list",
|
|
3141
|
+
"link",
|
|
3142
|
+
"table",
|
|
3143
|
+
"history"
|
|
3144
|
+
], mi = /* @__PURE__ */ new Set([
|
|
3145
|
+
"bold",
|
|
3146
|
+
"italic",
|
|
3147
|
+
"underline",
|
|
3148
|
+
"strikethrough",
|
|
3149
|
+
"clearFormatting",
|
|
3150
|
+
"heading",
|
|
3151
|
+
"blockquote",
|
|
3152
|
+
"code",
|
|
3153
|
+
"codeSample",
|
|
3154
|
+
"list",
|
|
3155
|
+
"checklist",
|
|
3156
|
+
"textAlignment",
|
|
3157
|
+
"indent",
|
|
3158
|
+
"direction",
|
|
3159
|
+
"textColor",
|
|
3160
|
+
"backgroundColor",
|
|
3161
|
+
"fontSize",
|
|
3162
|
+
"fontFamily",
|
|
3163
|
+
"formatPainter",
|
|
3164
|
+
"format-painter",
|
|
3165
|
+
"formatpainter",
|
|
3166
|
+
"lineHeight",
|
|
3167
|
+
"capitalization",
|
|
3168
|
+
"history",
|
|
3169
|
+
"link",
|
|
3170
|
+
"table",
|
|
3171
|
+
"trackChanges",
|
|
3172
|
+
"versionDiff",
|
|
3173
|
+
"version-diff",
|
|
3174
|
+
"versiondiff",
|
|
3175
|
+
"conditionalContent",
|
|
3176
|
+
"conditional-content",
|
|
3177
|
+
"conditionalcontent",
|
|
3178
|
+
"dataBinding",
|
|
3179
|
+
"data-binding",
|
|
3180
|
+
"databinding",
|
|
3181
|
+
"docSchema",
|
|
3182
|
+
"doc-schema",
|
|
3183
|
+
"docschema",
|
|
3184
|
+
"translationWorkflow",
|
|
3185
|
+
"translation-workflow",
|
|
3186
|
+
"translationworkflow",
|
|
3187
|
+
"contentRules",
|
|
3188
|
+
"content-rules",
|
|
3189
|
+
"contentrules",
|
|
3190
|
+
"citations",
|
|
3191
|
+
"citation",
|
|
3192
|
+
"approvalWorkflow",
|
|
3193
|
+
"approval-workflow",
|
|
3194
|
+
"approvalworkflow",
|
|
3195
|
+
"piiRedaction",
|
|
3196
|
+
"pii-redaction",
|
|
3197
|
+
"piiredaction",
|
|
3198
|
+
"smartPaste",
|
|
3199
|
+
"smart-paste",
|
|
3200
|
+
"smartpaste",
|
|
3201
|
+
"blocksLibrary",
|
|
3202
|
+
"blocks-library",
|
|
3203
|
+
"blockslibrary",
|
|
3204
|
+
"mentions",
|
|
3205
|
+
"mention",
|
|
3206
|
+
"anchor",
|
|
3207
|
+
"embedIframe",
|
|
3208
|
+
"math",
|
|
3209
|
+
"image",
|
|
3210
|
+
"mergeTag",
|
|
3211
|
+
"pageBreak",
|
|
3212
|
+
"print",
|
|
3213
|
+
"preview",
|
|
3214
|
+
"specialCharacters",
|
|
3215
|
+
"slashCommands",
|
|
3216
|
+
"slash-commands",
|
|
3217
|
+
"spellCheck",
|
|
3218
|
+
"emojis",
|
|
3219
|
+
"a11yChecker",
|
|
3220
|
+
"comments",
|
|
3221
|
+
"collaboration",
|
|
3222
|
+
"document-manager",
|
|
3223
|
+
"fullscreen",
|
|
3224
|
+
"template",
|
|
3225
|
+
"footnote"
|
|
3226
|
+
]), gi = "all", Co = {
|
|
3227
|
+
toggleBold: "bold",
|
|
3228
|
+
toggleItalic: "italic",
|
|
3229
|
+
toggleUnderline: "underline",
|
|
3230
|
+
toggleStrikethrough: "strikethrough",
|
|
3231
|
+
clearFormatting: "clearFormatting",
|
|
3232
|
+
setBlockType: "heading",
|
|
3233
|
+
toggleBlockquote: "blockquote",
|
|
3234
|
+
toggleSourceView: "code",
|
|
3235
|
+
insertCodeBlock: "codeSample",
|
|
3236
|
+
toggleBulletList: "list",
|
|
3237
|
+
toggleOrderedList: "list",
|
|
3238
|
+
toggleChecklist: "checklist",
|
|
3239
|
+
setTextAlignment: "textAlignment",
|
|
3240
|
+
increaseIndent: "indent",
|
|
3241
|
+
decreaseIndent: "indent",
|
|
3242
|
+
setDirectionLTR: "direction",
|
|
3243
|
+
setDirectionRTL: "direction",
|
|
3244
|
+
openTextColorPicker: "textColor",
|
|
3245
|
+
openBackgroundColorPicker: "backgroundColor",
|
|
3246
|
+
fontSize: "fontSize",
|
|
3247
|
+
setFontFamily: "fontFamily",
|
|
3248
|
+
toggleFormatPainter: "formatPainter",
|
|
3249
|
+
setLineHeight: "lineHeight",
|
|
3250
|
+
setCapitalization: "capitalization",
|
|
3251
|
+
undo: "history",
|
|
3252
|
+
redo: "history",
|
|
3253
|
+
openLinkDialog: "link",
|
|
3254
|
+
insertTable: "table",
|
|
3255
|
+
toggleTrackChanges: "trackChanges",
|
|
3256
|
+
openVersionDiff: "versionDiff",
|
|
3257
|
+
conditionalContent: "conditionalContent",
|
|
3258
|
+
openDataBindingDialog: "dataBinding",
|
|
3259
|
+
docSchema: "docSchema",
|
|
3260
|
+
translationWorkflow: "translationWorkflow",
|
|
3261
|
+
contentRules: "contentRules",
|
|
3262
|
+
citations: "citations",
|
|
3263
|
+
approvalWorkflow: "approvalWorkflow",
|
|
3264
|
+
piiRedaction: "piiRedaction",
|
|
3265
|
+
smartPaste: "smartPaste",
|
|
3266
|
+
blocksLibrary: "blocksLibrary",
|
|
3267
|
+
insertMention: "mentions",
|
|
3268
|
+
insertAnchor: "anchor",
|
|
3269
|
+
openEmbedIframeDialog: "embedIframe",
|
|
3270
|
+
insertMath: "math",
|
|
3271
|
+
insertImage: "image",
|
|
3272
|
+
insertVideo: "image",
|
|
3273
|
+
insertMergeTag: "mergeTag",
|
|
3274
|
+
insertPageBreak: "pageBreak",
|
|
3275
|
+
print: "print",
|
|
3276
|
+
togglePreview: "preview",
|
|
3277
|
+
insertSpecialCharacter: "specialCharacters",
|
|
3278
|
+
openSlashCommands: "slashCommands",
|
|
3279
|
+
toggleSpellCheck: "spellCheck",
|
|
3280
|
+
openEmojiDialog: "emojis",
|
|
3281
|
+
toggleA11yChecker: "a11yChecker",
|
|
3282
|
+
addComment: "comments",
|
|
3283
|
+
toggleComments: "comments",
|
|
3284
|
+
importWord: "document-manager",
|
|
3285
|
+
exportWord: "document-manager",
|
|
3286
|
+
exportPdf: "document-manager",
|
|
3287
|
+
toggleFullscreen: "fullscreen",
|
|
3288
|
+
insertTemplate: "template",
|
|
3289
|
+
insertFootnote: "footnote"
|
|
3290
|
+
};
|
|
3291
|
+
function bi(a, t) {
|
|
3292
|
+
var o, i;
|
|
3293
|
+
if (!a) return [];
|
|
3294
|
+
const e = [];
|
|
3295
|
+
for (const r of a.split(/[\s|]+/)) {
|
|
3296
|
+
if (!r) continue;
|
|
3297
|
+
const l = Mo[r] || r, c = (i = (o = Co[l]) != null ? o : Co[r]) != null ? i : t(r) ? r : void 0;
|
|
3298
|
+
c && !e.includes(c) && e.push(c);
|
|
3299
|
+
}
|
|
3300
|
+
return e;
|
|
3301
|
+
}
|
|
3302
|
+
const yi = '.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor.editora-disabled{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';
|
|
3303
|
+
let Kt;
|
|
3304
|
+
const Ei = "__editoraCommandEditorRoot", vi = "__editoraLastCommandButton", xo = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", Ao = ".rte-content, .editora-content", ki = "Rich text editor", wi = /* @__PURE__ */ new Set(["collaboration"]), ve = "data-editora-disabled-by-host", Ae = /* @__PURE__ */ new Set();
|
|
3305
|
+
let tt = null, So = !1, ke = null, we = null;
|
|
3306
|
+
function Lo(a) {
|
|
3132
3307
|
if (!(a instanceof HTMLElement)) return !1;
|
|
3133
3308
|
const t = a;
|
|
3134
3309
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3135
3310
|
}
|
|
3136
|
-
function
|
|
3311
|
+
function Ti(a) {
|
|
3137
3312
|
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
3138
3313
|
}
|
|
3139
|
-
function
|
|
3314
|
+
function _t(a) {
|
|
3140
3315
|
if (!a) return null;
|
|
3141
|
-
if (
|
|
3316
|
+
if (Lo(a))
|
|
3142
3317
|
return a;
|
|
3143
|
-
const t = a.matches(
|
|
3144
|
-
return !t || !
|
|
3318
|
+
const t = a.matches(xo) ? a : a.closest(xo);
|
|
3319
|
+
return !t || !Lo(t) ? null : t;
|
|
3145
3320
|
}
|
|
3146
|
-
function
|
|
3321
|
+
function Ci() {
|
|
3147
3322
|
var i;
|
|
3148
3323
|
if (typeof window == "undefined") return null;
|
|
3149
|
-
const a = window[
|
|
3324
|
+
const a = window[Ei];
|
|
3150
3325
|
if (a instanceof HTMLElement) {
|
|
3151
|
-
const r =
|
|
3326
|
+
const r = _t(a);
|
|
3152
3327
|
if (r) return r;
|
|
3153
|
-
const l = a.matches(
|
|
3328
|
+
const l = a.matches(Ao) ? a : a.querySelector(Ao);
|
|
3154
3329
|
if (l) {
|
|
3155
|
-
const c =
|
|
3330
|
+
const c = _t(l);
|
|
3156
3331
|
if (c) return c;
|
|
3157
3332
|
}
|
|
3158
3333
|
}
|
|
3159
|
-
const t = window[
|
|
3334
|
+
const t = window[vi];
|
|
3160
3335
|
if (t instanceof HTMLElement) {
|
|
3161
|
-
const r =
|
|
3336
|
+
const r = _t(t);
|
|
3162
3337
|
if (r) return r;
|
|
3163
3338
|
}
|
|
3164
3339
|
const e = document.activeElement;
|
|
3165
3340
|
if (e) {
|
|
3166
|
-
const r =
|
|
3341
|
+
const r = _t(e);
|
|
3167
3342
|
if (r) return r;
|
|
3168
3343
|
}
|
|
3169
3344
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3170
3345
|
if (o && o.rangeCount > 0) {
|
|
3171
|
-
const r =
|
|
3346
|
+
const r = _t(Ti(o.getRangeAt(0).startContainer));
|
|
3172
3347
|
if (r) return r;
|
|
3173
3348
|
}
|
|
3174
3349
|
if (tt && tt.isConnected)
|
|
@@ -3177,34 +3352,34 @@ function mi() {
|
|
|
3177
3352
|
if (r.isConnected) return r;
|
|
3178
3353
|
return null;
|
|
3179
3354
|
}
|
|
3180
|
-
function
|
|
3181
|
-
if (typeof window == "undefined" ||
|
|
3182
|
-
|
|
3355
|
+
function xi() {
|
|
3356
|
+
if (typeof window == "undefined" || So) return;
|
|
3357
|
+
ke = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3183
3358
|
const a = (t, ...e) => {
|
|
3184
|
-
const o =
|
|
3185
|
-
return o ? o.execCommand(t, ...e) :
|
|
3359
|
+
const o = Ci();
|
|
3360
|
+
return o ? o.execCommand(t, ...e) : ke ? ke(t, ...e) : we ? we(t, ...e) : !1;
|
|
3186
3361
|
};
|
|
3187
|
-
window.executeEditorCommand = a, window.execEditorCommand = a,
|
|
3362
|
+
window.executeEditorCommand = a, window.execEditorCommand = a, So = !0;
|
|
3188
3363
|
}
|
|
3189
|
-
function
|
|
3364
|
+
function Ai() {
|
|
3190
3365
|
const a = "editora-webcomponent-styles";
|
|
3191
3366
|
if (!document.getElementById(a)) {
|
|
3192
3367
|
const t = document.createElement("style");
|
|
3193
|
-
t.id = a, t.textContent =
|
|
3368
|
+
t.id = a, t.textContent = yi, document.head.appendChild(t);
|
|
3194
3369
|
}
|
|
3195
3370
|
}
|
|
3196
|
-
function
|
|
3197
|
-
if (!
|
|
3198
|
-
const a =
|
|
3199
|
-
a ?
|
|
3371
|
+
function Si() {
|
|
3372
|
+
if (!Kt) {
|
|
3373
|
+
const a = Y.__globalPluginLoader;
|
|
3374
|
+
a ? Kt = a : Kt = new _o();
|
|
3200
3375
|
}
|
|
3201
|
-
return
|
|
3376
|
+
return Kt;
|
|
3202
3377
|
}
|
|
3203
|
-
const
|
|
3378
|
+
const Li = typeof HTMLElement == "undefined" ? class {
|
|
3204
3379
|
} : HTMLElement;
|
|
3205
|
-
class
|
|
3380
|
+
class Y extends Li {
|
|
3206
3381
|
constructor() {
|
|
3207
|
-
if (super(), this.pluginLoader =
|
|
3382
|
+
if (super(), this.pluginLoader = Si(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new Cn(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.pluginInstances = /* @__PURE__ */ new Map(), this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, this.hasConnected = !1, this.reinitializeQueued = !1, this.lastReportedContent = null, Ai(), !this.hasAttribute("data-initial-content")) {
|
|
3208
3383
|
const t = this.innerHTML.trim();
|
|
3209
3384
|
t && this.setAttribute("data-initial-content", t);
|
|
3210
3385
|
}
|
|
@@ -3261,7 +3436,7 @@ class q extends Ei {
|
|
|
3261
3436
|
* Called when element is added to DOM
|
|
3262
3437
|
*/
|
|
3263
3438
|
connectedCallback() {
|
|
3264
|
-
this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3439
|
+
this.hasConnected = !0, this.config = this.resolveConfig(), this.waitForPluginLoader().then(() => {
|
|
3265
3440
|
setTimeout(async () => {
|
|
3266
3441
|
await this.initialize();
|
|
3267
3442
|
}, 0);
|
|
@@ -3271,13 +3446,13 @@ class q extends Ei {
|
|
|
3271
3446
|
* Wait for the global plugin loader to be available
|
|
3272
3447
|
*/
|
|
3273
3448
|
async waitForPluginLoader() {
|
|
3274
|
-
if (
|
|
3275
|
-
this.pluginLoader =
|
|
3449
|
+
if (Y.__globalPluginLoader) {
|
|
3450
|
+
this.pluginLoader = Y.__globalPluginLoader;
|
|
3276
3451
|
return;
|
|
3277
3452
|
}
|
|
3278
3453
|
return new Promise((t) => {
|
|
3279
3454
|
const e = () => {
|
|
3280
|
-
|
|
3455
|
+
Y.__globalPluginLoader ? (this.pluginLoader = Y.__globalPluginLoader, t()) : setTimeout(e, 0);
|
|
3281
3456
|
};
|
|
3282
3457
|
e();
|
|
3283
3458
|
});
|
|
@@ -3298,7 +3473,22 @@ class q extends Ei {
|
|
|
3298
3473
|
* Set configuration via JavaScript API
|
|
3299
3474
|
*/
|
|
3300
3475
|
async setConfig(t) {
|
|
3301
|
-
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected
|
|
3476
|
+
this.jsConfig = t, this.config = this.resolveConfig(), this.isConnected ? (this.destroy(), this.adoptConfiguredContent(t), await this.waitForPluginLoader(), await this.initialize()) : this.adoptConfiguredContent(t);
|
|
3477
|
+
}
|
|
3478
|
+
/**
|
|
3479
|
+
* `content` in setConfig() is a one-off replacement, not a setting: it feeds the next initialize()
|
|
3480
|
+
* the same way the live content that destroy() keeps does, so a later rebuild (a `plugins`
|
|
3481
|
+
* attribute change, the element being moved) resumes from what the user typed, not from this value.
|
|
3482
|
+
* It outranks that kept content, autosave and the element's own markup.
|
|
3483
|
+
*/
|
|
3484
|
+
adoptConfiguredContent(t) {
|
|
3485
|
+
typeof t.content == "string" && (this.preservedContent = t.content);
|
|
3486
|
+
}
|
|
3487
|
+
/** Replace the `editora-theme-*` class (there is only ever one) with the one for `theme`. */
|
|
3488
|
+
applyThemeClass(t) {
|
|
3489
|
+
Array.from(this.classList).forEach((e) => {
|
|
3490
|
+
e.startsWith("editora-theme-") && this.classList.remove(e);
|
|
3491
|
+
}), t && this.classList.add(`editora-theme-${t}`);
|
|
3302
3492
|
}
|
|
3303
3493
|
/**
|
|
3304
3494
|
* Initialize the editor
|
|
@@ -3307,7 +3497,7 @@ class q extends Ei {
|
|
|
3307
3497
|
var r;
|
|
3308
3498
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3309
3499
|
const t = ++this.buildGeneration;
|
|
3310
|
-
this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this),
|
|
3500
|
+
this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this), xi(), this.config.height && (this.style.height = typeof this.config.height == "number" ? `${this.config.height}px` : this.config.height), this.config.width && (this.style.width = typeof this.config.width == "number" ? `${this.config.width}px` : this.config.width), this.classList.add("editora-editor"), this.classList.toggle("editora-disabled", this.isEditorDisabled()), this.applyThemeClass(this.config.theme), this.isMenubarRequested() && pi("menubar", "<editora-editor> does not render a menu bar."), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3311
3501
|
const e = await this.loadPlugins();
|
|
3312
3502
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3313
3503
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3326,10 +3516,10 @@ class q extends Ei {
|
|
|
3326
3516
|
const i = this.sanitizeLoadedContent(
|
|
3327
3517
|
(r = o != null ? o : this.restoreAutosavedContent()) != null ? r : this.getAttribute("data-initial-content") || ""
|
|
3328
3518
|
);
|
|
3329
|
-
this.engine = new
|
|
3519
|
+
this.engine = new mn({
|
|
3330
3520
|
content: i,
|
|
3331
3521
|
plugins: e,
|
|
3332
|
-
readonly: this.config.readonly
|
|
3522
|
+
readonly: !!this.config.readonly || this.isEditorDisabled()
|
|
3333
3523
|
}), this.createUI(e, i), this.setupEventListeners(), this.startAutosave(), this.isInitialized = !0, this.removeAttribute("data-loading"), this.removeAttribute("aria-busy"), this.dispatchEvent(new CustomEvent("editor-ready", {
|
|
3334
3524
|
detail: { api: this.getAPI() },
|
|
3335
3525
|
bubbles: !0
|
|
@@ -3345,41 +3535,76 @@ class q extends Ei {
|
|
|
3345
3535
|
return t ? t.innerHTML : this.hasChildNodes() ? Array.from(this.childNodes).map((o) => o.nodeType === Node.TEXT_NODE ? o.textContent : o.nodeType === Node.ELEMENT_NODE ? o.outerHTML : "").join("").trim() : "";
|
|
3346
3536
|
}
|
|
3347
3537
|
/**
|
|
3348
|
-
* Load plugins based on configuration
|
|
3538
|
+
* Load plugins based on configuration.
|
|
3539
|
+
*
|
|
3540
|
+
* With `plugins` listed, exactly those load (`all` stands for every registered plugin). Without it,
|
|
3541
|
+
* the editor loads DEFAULT_PLUGINS plus whatever the page asks for in other ways: a toolbar item, a
|
|
3542
|
+
* `pluginConfig` entry, `accessibility.checker`, a plugin it registered itself, or one it already
|
|
3543
|
+
* loaded through the plugin loader.
|
|
3349
3544
|
*/
|
|
3350
3545
|
async loadPlugins() {
|
|
3351
3546
|
this.pluginLoader || await this.waitForPluginLoader();
|
|
3352
|
-
const t =
|
|
3353
|
-
if (e) {
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
} else
|
|
3367
|
-
t.push(r);
|
|
3368
|
-
if (i && !t.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3369
|
-
const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3370
|
-
r && t.push(r);
|
|
3371
|
-
}
|
|
3372
|
-
}
|
|
3373
|
-
} else {
|
|
3374
|
-
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3375
|
-
for (const l of r) {
|
|
3376
|
-
const c = this.getPluginLoadConfig(l);
|
|
3377
|
-
if (fi.has(l) && !c) continue;
|
|
3378
|
-
const p = await this.loadPlugin(l, c);
|
|
3379
|
-
p && t.push(p);
|
|
3547
|
+
const t = this.config.plugins, e = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : Array.isArray(t) ? t : [], o = this.getAccessibilityConfig().checker === !0;
|
|
3548
|
+
if (e.length === 0) {
|
|
3549
|
+
const r = this.resolveDefaultPluginNames();
|
|
3550
|
+
return o && r.push("a11yChecker"), this.loadPluginsByName(r);
|
|
3551
|
+
}
|
|
3552
|
+
const i = [];
|
|
3553
|
+
for (const r of e)
|
|
3554
|
+
if (typeof r != "string")
|
|
3555
|
+
i.push(r);
|
|
3556
|
+
else if (r === gi)
|
|
3557
|
+
i.push(...await this.loadPluginsByName(this.resolveAllPluginNames()));
|
|
3558
|
+
else {
|
|
3559
|
+
const l = await this.loadPlugin(r, this.getPluginLoadConfig(r));
|
|
3560
|
+
l && i.push(l);
|
|
3380
3561
|
}
|
|
3562
|
+
if (o && !i.some((r) => (r == null ? void 0 : r.name) === "a11yChecker")) {
|
|
3563
|
+
const r = await this.loadPlugin("a11yChecker", this.getPluginLoadConfig("a11yChecker"));
|
|
3564
|
+
r && i.push(r);
|
|
3381
3565
|
}
|
|
3382
|
-
return
|
|
3566
|
+
return this.withoutDuplicatePlugins(i);
|
|
3567
|
+
}
|
|
3568
|
+
/** The plugins a bare editor loads: see loadPlugins(). Only registered names, in a stable order. */
|
|
3569
|
+
resolveDefaultPluginNames() {
|
|
3570
|
+
const t = this.pluginLoader.getRegisteredPluginNames(), e = (i) => t.includes(i), o = /* @__PURE__ */ new Set([
|
|
3571
|
+
...hi,
|
|
3572
|
+
...bi(this.resolveToolbarItems(), e)
|
|
3573
|
+
]);
|
|
3574
|
+
for (const i of t)
|
|
3575
|
+
(!mi.has(i) || this.pluginLoader.isLoaded(i) || this.isPluginRequestedByConfig(i)) && o.add(i);
|
|
3576
|
+
return t.filter((i) => o.has(i));
|
|
3577
|
+
}
|
|
3578
|
+
/** Every registered plugin, except the ones that act on their own and have not been configured. */
|
|
3579
|
+
resolveAllPluginNames() {
|
|
3580
|
+
return this.pluginLoader.getRegisteredPluginNames().filter((t) => !wi.has(t) || this.getPluginLoadConfig(t));
|
|
3581
|
+
}
|
|
3582
|
+
async loadPluginsByName(t) {
|
|
3583
|
+
const e = [];
|
|
3584
|
+
for (const o of t) {
|
|
3585
|
+
const i = await this.loadPlugin(o, this.getPluginLoadConfig(o));
|
|
3586
|
+
i && e.push(i);
|
|
3587
|
+
}
|
|
3588
|
+
return this.withoutDuplicatePlugins(e);
|
|
3589
|
+
}
|
|
3590
|
+
/**
|
|
3591
|
+
* One instance per plugin. Several registered names can create the same plugin (`formatPainter`,
|
|
3592
|
+
* `format-painter`, `formatpainter`), and loading each of them put its buttons on the toolbar again.
|
|
3593
|
+
*/
|
|
3594
|
+
withoutDuplicatePlugins(t) {
|
|
3595
|
+
const e = /* @__PURE__ */ new Set();
|
|
3596
|
+
return t.filter((o) => o != null && o.name ? e.has(o.name) ? !1 : (e.add(o.name), !0) : !0);
|
|
3597
|
+
}
|
|
3598
|
+
/**
|
|
3599
|
+
* True when the page configured this plugin, under `pluginConfig` or as a top-level option of its own
|
|
3600
|
+
* name. `spellcheck` does not count: it is the editor's own setting (the browser's spell checking) and
|
|
3601
|
+
* always has a value.
|
|
3602
|
+
*/
|
|
3603
|
+
isPluginRequestedByConfig(t) {
|
|
3604
|
+
if (!this.getPluginLoadConfig(t)) return !1;
|
|
3605
|
+
if (t !== "spellCheck") return !0;
|
|
3606
|
+
const o = this.config.pluginConfig;
|
|
3607
|
+
return !!(o && typeof o == "object" && (o.spellCheck || o.spellcheck));
|
|
3383
3608
|
}
|
|
3384
3609
|
/**
|
|
3385
3610
|
* This editor's instance of a registered plugin: created on first use, then reused (with the
|
|
@@ -3472,12 +3697,15 @@ class q extends Ei {
|
|
|
3472
3697
|
if (!this.contentElement) return;
|
|
3473
3698
|
const t = this.getAccessibilityConfig();
|
|
3474
3699
|
if (t.enableARIA) {
|
|
3475
|
-
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3700
|
+
this.contentElement.setAttribute("role", "textbox"), this.contentElement.setAttribute("aria-multiline", "true"), this.contentElement.setAttribute(
|
|
3701
|
+
"aria-disabled",
|
|
3702
|
+
this.config.readonly || this.isEditorDisabled() ? "true" : "false"
|
|
3703
|
+
);
|
|
3476
3704
|
const o = (e = this.getAttribute("aria-label")) == null ? void 0 : e.trim(), i = typeof this.config.placeholder == "string" ? this.config.placeholder.trim() : "";
|
|
3477
|
-
this.contentElement.setAttribute("aria-label", o || i ||
|
|
3705
|
+
this.contentElement.setAttribute("aria-label", o || i || ki);
|
|
3478
3706
|
} else
|
|
3479
3707
|
this.contentElement.removeAttribute("role"), this.contentElement.removeAttribute("aria-multiline"), this.contentElement.removeAttribute("aria-disabled"), this.contentElement.removeAttribute("aria-label");
|
|
3480
|
-
this.contentElement.tabIndex = t.keyboardNavigation ? 0 : -1;
|
|
3708
|
+
this.contentElement.tabIndex = t.keyboardNavigation && !this.isEditorDisabled() ? 0 : -1;
|
|
3481
3709
|
}
|
|
3482
3710
|
applyLanguageSettings() {
|
|
3483
3711
|
if (!this.contentElement) return;
|
|
@@ -3642,7 +3870,7 @@ class q extends Ei {
|
|
|
3642
3870
|
this.stopAutosave();
|
|
3643
3871
|
const t = this.getAutosaveConfig();
|
|
3644
3872
|
!t.enabled || !this.contentElement || (this.autosaveTimer = setInterval(() => {
|
|
3645
|
-
this.persistAutosave(
|
|
3873
|
+
this.persistAutosave(yt(this.contentElement));
|
|
3646
3874
|
}, t.intervalMs));
|
|
3647
3875
|
}
|
|
3648
3876
|
insertHTMLAtSelection(t) {
|
|
@@ -3665,7 +3893,7 @@ class q extends Ei {
|
|
|
3665
3893
|
*/
|
|
3666
3894
|
createUI(t, e) {
|
|
3667
3895
|
const o = this.querySelector('[slot="toolbar"]'), i = this.querySelector('[slot="statusbar"]');
|
|
3668
|
-
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new
|
|
3896
|
+
this.innerHTML = "", this.config.toolbar !== !1 && !o ? (this.toolbarElement = document.createElement("div"), this.toolbarElement.className = "editora-toolbar-container", this.appendChild(this.toolbarElement), this.toolbar = new gn(
|
|
3669
3897
|
{
|
|
3670
3898
|
items: this.resolveToolbarItems(),
|
|
3671
3899
|
sticky: this.isToolbarStickyEnabled(),
|
|
@@ -3676,16 +3904,17 @@ class q extends Ei {
|
|
|
3676
3904
|
// Pass plugin loader to get all registered plugins
|
|
3677
3905
|
), this.toolbar.setCommandHandler((r, l) => {
|
|
3678
3906
|
var c;
|
|
3907
|
+
if (this.isEditorDisabled()) return !1;
|
|
3679
3908
|
if (this.contentElement) {
|
|
3680
3909
|
this.contentElement.focus();
|
|
3681
3910
|
const p = window.getSelection();
|
|
3682
3911
|
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3683
|
-
const
|
|
3684
|
-
g.nodeType === Node.TEXT_NODE ?
|
|
3912
|
+
const h = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3913
|
+
g.nodeType === Node.TEXT_NODE ? h.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (h.selectNodeContents(g), h.collapse(!1)) : h.setStart(this.contentElement, 0), h.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(h);
|
|
3685
3914
|
}
|
|
3686
3915
|
}
|
|
3687
3916
|
return this.executeCommand(r, l);
|
|
3688
|
-
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3917
|
+
}), this.toolbar.render(this.toolbarElement)) : o && this.appendChild(o), this.contentElement = document.createElement("div"), this.contentElement.className = "editora-content rte-content", this.contentElement.contentEditable = this.config.readonly || this.isEditorDisabled() ? "false" : "true", this.applyLanguageSettings(), this.applyAccessibilitySettings(), this.applySpellcheckSettings(), this.config.placeholder && this.contentElement.setAttribute("data-placeholder", this.config.placeholder);
|
|
3689
3918
|
try {
|
|
3690
3919
|
document.execCommand("defaultParagraphSeparator", !1, "p");
|
|
3691
3920
|
} catch (r) {
|
|
@@ -3702,11 +3931,20 @@ class q extends Ei {
|
|
|
3702
3931
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
3703
3932
|
} else
|
|
3704
3933
|
this.config.placeholder ? this.contentElement.innerHTML = "" : this.contentElement.innerHTML = "<p><br></p>";
|
|
3705
|
-
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new
|
|
3934
|
+
this.appendChild(this.contentElement), this.isToolbarFloatingEnabled() && (this.floatingToolbar = new bn({ enabled: !0 }), this.floatingToolbar.create(this)), i ? this.appendChild(i) : this.isStatusbarEnabled() && (this.statusBarElement = document.createElement("div"), this.statusBarElement.className = "editora-statusbar-container", this.appendChild(this.statusBarElement), this.statusBar = new yn({ position: this.getStatusbarPosition() }), this.statusBar.create(this.statusBarElement)), this.setToolbarControlsDisabled(this.isEditorDisabled()), this.lastReportedContent = yt(this.contentElement), this.config.autofocus && !this.isEditorDisabled() && setTimeout(() => {
|
|
3706
3935
|
var r;
|
|
3707
3936
|
return (r = this.contentElement) == null ? void 0 : r.focus();
|
|
3708
3937
|
}, 0);
|
|
3709
3938
|
}
|
|
3939
|
+
/** True only when the page asked for a menu bar (the default is not a request), through setConfig() or the attribute. */
|
|
3940
|
+
isMenubarRequested() {
|
|
3941
|
+
var o;
|
|
3942
|
+
const t = (o = this.jsConfig) == null ? void 0 : o.menubar;
|
|
3943
|
+
if (t !== void 0)
|
|
3944
|
+
return t === !0 || typeof t == "object" && t !== null && t.enabled !== !1;
|
|
3945
|
+
const e = this.getAttribute("menubar");
|
|
3946
|
+
return e !== null && e !== "false";
|
|
3947
|
+
}
|
|
3710
3948
|
/**
|
|
3711
3949
|
* Hands what a keystroke changed to the history plugin, so Undo takes back typing. Without this the
|
|
3712
3950
|
* plugin only knew about changes that plugins reported themselves, and typed text could not be undone.
|
|
@@ -3721,6 +3959,30 @@ class q extends Ei {
|
|
|
3721
3959
|
selectionCollapsed: e.selectionCollapsed
|
|
3722
3960
|
});
|
|
3723
3961
|
}
|
|
3962
|
+
/**
|
|
3963
|
+
* `disabled` is `readonly` plus a toolbar that cannot be pressed and a surface that leaves the tab
|
|
3964
|
+
* order, like a disabled form control.
|
|
3965
|
+
*/
|
|
3966
|
+
isEditorDisabled() {
|
|
3967
|
+
return this.config.disabled === !0;
|
|
3968
|
+
}
|
|
3969
|
+
applyDisabledState() {
|
|
3970
|
+
var e, o;
|
|
3971
|
+
const t = this.isEditorDisabled();
|
|
3972
|
+
this.classList.toggle("editora-disabled", t), t && ((e = this.floatingToolbar) == null || e.hide()), this.contentElement && (this.contentElement.contentEditable = t || this.config.readonly ? "false" : "true", this.applyAccessibilitySettings()), (o = this.engine) == null || o.setReadonly(t || !!this.config.readonly), this.setToolbarControlsDisabled(t);
|
|
3973
|
+
}
|
|
3974
|
+
/**
|
|
3975
|
+
* Disable (or give back) every control the default toolbar rendered. Controls that were already
|
|
3976
|
+
* disabled for another reason are marked untouched, so enabling the editor does not wake them up.
|
|
3977
|
+
*/
|
|
3978
|
+
setToolbarControlsDisabled(t) {
|
|
3979
|
+
if (!this.toolbarElement) return;
|
|
3980
|
+
this.toolbarElement.querySelectorAll(
|
|
3981
|
+
"button, input, select, textarea"
|
|
3982
|
+
).forEach((o) => {
|
|
3983
|
+
t ? o.disabled || (o.disabled = !0, o.setAttribute(ve, "")) : o.hasAttribute(ve) && (o.disabled = !1, o.removeAttribute(ve));
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3724
3986
|
/**
|
|
3725
3987
|
* Setup event listeners
|
|
3726
3988
|
*/
|
|
@@ -3736,63 +3998,61 @@ class q extends Ei {
|
|
|
3736
3998
|
selectionCollapsed: (r = (i = window.getSelection()) == null ? void 0 : i.isCollapsed) != null ? r : !0
|
|
3737
3999
|
});
|
|
3738
4000
|
}), this.contentElement.addEventListener("input", (o) => {
|
|
3739
|
-
var
|
|
4001
|
+
var k;
|
|
3740
4002
|
if (!this.contentElement) return;
|
|
3741
4003
|
let i = this.contentElement.innerHTML;
|
|
3742
|
-
const r = (
|
|
3743
|
-
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !
|
|
3744
|
-
const
|
|
3745
|
-
if (
|
|
3746
|
-
const
|
|
3747
|
-
if (this.contentElement.innerHTML =
|
|
4004
|
+
const r = (k = o == null ? void 0 : o.detail) == null ? void 0 : k.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = this.lastBeforeInputType;
|
|
4005
|
+
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !h) {
|
|
4006
|
+
const w = wo(i, c, p, r);
|
|
4007
|
+
if (w !== i) {
|
|
4008
|
+
const R = window.getSelection(), et = R && R.rangeCount > 0 ? R.getRangeAt(0) : null;
|
|
4009
|
+
if (this.contentElement.innerHTML = w, et && R)
|
|
3748
4010
|
try {
|
|
3749
|
-
|
|
4011
|
+
R.removeAllRanges(), R.addRange(et);
|
|
3750
4012
|
} catch ($) {
|
|
3751
4013
|
}
|
|
3752
|
-
i =
|
|
4014
|
+
i = w;
|
|
3753
4015
|
}
|
|
3754
4016
|
}
|
|
3755
4017
|
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3756
|
-
const
|
|
3757
|
-
this.
|
|
3758
|
-
detail: { html: Oo(i) },
|
|
3759
|
-
bubbles: !0
|
|
3760
|
-
}));
|
|
4018
|
+
const b = () => {
|
|
4019
|
+
this.emitContentChange(No(i));
|
|
3761
4020
|
};
|
|
3762
|
-
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(
|
|
4021
|
+
l.debounceInputMs > 0 ? this.contentChangeDebounceTimer = setTimeout(b, l.debounceInputMs) : b(), this.updateStatusBar();
|
|
3763
4022
|
}), this.contentElement.addEventListener("contextmenu", (o) => {
|
|
3764
4023
|
const i = this.config.contextMenu;
|
|
3765
4024
|
(i === !1 || typeof i == "object" && i !== null && i.enabled === !1) && o.preventDefault();
|
|
3766
4025
|
}), this.contentElement.addEventListener("paste", (o) => {
|
|
3767
|
-
var g,
|
|
4026
|
+
var g, b;
|
|
3768
4027
|
if (o.__editoraSmartPasteHandled === !0 || o.defaultPrevented)
|
|
3769
4028
|
return;
|
|
3770
4029
|
o.preventDefault();
|
|
3771
4030
|
const i = this.config.paste || {};
|
|
3772
4031
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3773
|
-
const l = ((
|
|
4032
|
+
const l = ((b = o.clipboardData) == null ? void 0 : b.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), h = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3774
4033
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3775
4034
|
document.execCommand("insertText", !1, l);
|
|
3776
4035
|
return;
|
|
3777
4036
|
}
|
|
3778
|
-
if (i.convertWord === !1 &&
|
|
4037
|
+
if (i.convertWord === !1 && h && l) {
|
|
3779
4038
|
document.execCommand("insertText", !1, l);
|
|
3780
4039
|
return;
|
|
3781
4040
|
}
|
|
3782
4041
|
if (r) {
|
|
3783
|
-
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r =
|
|
4042
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = di(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3784
4043
|
return;
|
|
3785
4044
|
}
|
|
3786
4045
|
l && document.execCommand("insertText", !1, l);
|
|
3787
4046
|
}), this.contentElement.addEventListener("focus", () => {
|
|
3788
4047
|
tt = this, this.dispatchEvent(new Event("editor-focus", { bubbles: !0 })), this.updateStatusBar();
|
|
3789
4048
|
}), this.contentElement.addEventListener("blur", () => {
|
|
3790
|
-
this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
}
|
|
4049
|
+
if (this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement) {
|
|
4050
|
+
const o = yt(this.contentElement);
|
|
4051
|
+
o !== this.lastReportedContent && this.emitContentChange(o);
|
|
4052
|
+
}
|
|
4053
|
+
this.dispatchEvent(new Event("editor-blur", { bubbles: !0 })), this.updateFloatingToolbar(), this.updateStatusBar();
|
|
3794
4054
|
}), this.contentElement.addEventListener("keydown", (o) => {
|
|
3795
|
-
this.getAccessibilityConfig().keyboardNavigation
|
|
4055
|
+
!this.getAccessibilityConfig().keyboardNavigation || this.isEditorDisabled() || t.handleKeyDown(o, (r, l) => {
|
|
3796
4056
|
this.executeCommand(r, l);
|
|
3797
4057
|
});
|
|
3798
4058
|
});
|
|
@@ -3802,6 +4062,12 @@ class q extends Ei {
|
|
|
3802
4062
|
};
|
|
3803
4063
|
this.selectionChangeHandler = e, document.addEventListener("selectionchange", this.selectionChangeHandler);
|
|
3804
4064
|
}
|
|
4065
|
+
emitContentChange(t) {
|
|
4066
|
+
this.lastReportedContent = t, this.dispatchEvent(new CustomEvent("content-change", {
|
|
4067
|
+
detail: { html: t },
|
|
4068
|
+
bubbles: !0
|
|
4069
|
+
}));
|
|
4070
|
+
}
|
|
3805
4071
|
getSelectionRangeInEditor() {
|
|
3806
4072
|
if (!this.contentElement) return null;
|
|
3807
4073
|
const t = window.getSelection();
|
|
@@ -3869,10 +4135,10 @@ class q extends Ei {
|
|
|
3869
4135
|
const t = this.getPerformanceConfig(), e = document.activeElement === this.contentElement || this.contentElement.contains(document.activeElement);
|
|
3870
4136
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3871
4137
|
return;
|
|
3872
|
-
const o = this.contentElement.textContent || "", { words: i, chars: r } =
|
|
4138
|
+
const o = this.contentElement.textContent || "", { words: i, chars: r } = wn(o), l = kn(this.contentElement);
|
|
3873
4139
|
let c, p;
|
|
3874
|
-
const
|
|
3875
|
-
|
|
4140
|
+
const h = this.getSelectionRangeInEditor();
|
|
4141
|
+
h && (c = En(this.contentElement, h), h.collapsed || (p = Tn(h, c), c = void 0)), this.statusBar.update({
|
|
3876
4142
|
wordCount: i,
|
|
3877
4143
|
charCount: r,
|
|
3878
4144
|
lineCount: l,
|
|
@@ -3893,12 +4159,13 @@ class q extends Ei {
|
|
|
3893
4159
|
handleAttributeChange(t, e) {
|
|
3894
4160
|
switch (t) {
|
|
3895
4161
|
case "readonly":
|
|
3896
|
-
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e));
|
|
4162
|
+
this.contentElement && (this.contentElement.contentEditable = this.isReadonlyAttribute(e) || this.isEditorDisabled() ? "false" : "true", this.applyAccessibilitySettings()), this.engine && this.engine.setReadonly(this.isReadonlyAttribute(e) || this.isEditorDisabled());
|
|
4163
|
+
break;
|
|
4164
|
+
case "disabled":
|
|
4165
|
+
this.applyDisabledState();
|
|
3897
4166
|
break;
|
|
3898
4167
|
case "theme":
|
|
3899
|
-
this.
|
|
3900
|
-
o.startsWith("editora-theme-") && this.classList.remove(o);
|
|
3901
|
-
}), e && this.classList.add(`editora-theme-${e}`);
|
|
4168
|
+
this.applyThemeClass(e);
|
|
3902
4169
|
break;
|
|
3903
4170
|
case "placeholder":
|
|
3904
4171
|
this.contentElement && (this.contentElement.setAttribute("data-placeholder", e), this.applyAccessibilitySettings());
|
|
@@ -3948,14 +4215,20 @@ class q extends Ei {
|
|
|
3948
4215
|
case "toolbar-sticky":
|
|
3949
4216
|
case "plugins":
|
|
3950
4217
|
case "statusbar":
|
|
3951
|
-
this.isConnected &&
|
|
3952
|
-
this.initialize().catch((o) => {
|
|
3953
|
-
console.error("[RichTextEditor] Error during attribute change re-initialization:", o);
|
|
3954
|
-
});
|
|
3955
|
-
}));
|
|
4218
|
+
this.isConnected && this.hasConnected && this.scheduleReinitialize();
|
|
3956
4219
|
break;
|
|
3957
4220
|
}
|
|
3958
4221
|
}
|
|
4222
|
+
/** One rebuild for however many attributes are changed in the same task. */
|
|
4223
|
+
scheduleReinitialize() {
|
|
4224
|
+
this.reinitializeQueued || (this.reinitializeQueued = !0, queueMicrotask(() => {
|
|
4225
|
+
this.reinitializeQueued = !1, this.isConnected && (this.destroy(), this.waitForPluginLoader().then(() => {
|
|
4226
|
+
this.initialize().catch((t) => {
|
|
4227
|
+
console.error("[RichTextEditor] Error during attribute change re-initialization:", t);
|
|
4228
|
+
});
|
|
4229
|
+
}));
|
|
4230
|
+
}));
|
|
4231
|
+
}
|
|
3959
4232
|
/**
|
|
3960
4233
|
* Resolve configuration from all sources
|
|
3961
4234
|
*/
|
|
@@ -3975,7 +4248,7 @@ class q extends Ei {
|
|
|
3975
4248
|
*/
|
|
3976
4249
|
getAPI() {
|
|
3977
4250
|
return {
|
|
3978
|
-
getContent: () =>
|
|
4251
|
+
getContent: () => yt(this.contentElement),
|
|
3979
4252
|
setContent: (t) => {
|
|
3980
4253
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
3981
4254
|
},
|
|
@@ -4003,11 +4276,11 @@ class q extends Ei {
|
|
|
4003
4276
|
*/
|
|
4004
4277
|
destroy() {
|
|
4005
4278
|
var t, e, o, i;
|
|
4006
|
-
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent =
|
|
4279
|
+
this.buildGeneration += 1, this.contentChangeDebounceTimer && (clearTimeout(this.contentChangeDebounceTimer), this.contentChangeDebounceTimer = void 0), this.contentElement && (this.preservedContent = yt(this.contentElement), this.persistAutosave(this.preservedContent)), this.stopAutosave(), this.selectionChangeHandler && (document.removeEventListener("selectionchange", this.selectionChangeHandler), this.selectionChangeHandler = void 0), (t = this.engine) == null || t.destroy(), (e = this.toolbar) == null || e.destroy(), (o = this.floatingToolbar) == null || o.destroy(), (i = this.statusBar) == null || i.destroy(), this.innerHTML = "", this.contentElement = void 0, this.toolbarElement = void 0, this.statusBarElement = void 0, this.loadedPlugins = [], this.lastReportedContent = null, this.isInitialized = !1, Ae.delete(this), tt === this && (tt = null), this.dispatchEvent(new Event("editor-destroy", { bubbles: !0 }));
|
|
4007
4280
|
}
|
|
4008
4281
|
// Public API methods
|
|
4009
4282
|
getContent() {
|
|
4010
|
-
return
|
|
4283
|
+
return yt(this.contentElement);
|
|
4011
4284
|
}
|
|
4012
4285
|
setContent(t) {
|
|
4013
4286
|
this.contentElement && (this.contentElement.innerHTML = this.sanitizeLoadedContent(t));
|
|
@@ -4024,9 +4297,9 @@ class q extends Ei {
|
|
|
4024
4297
|
(t = this.contentElement) == null || t.blur();
|
|
4025
4298
|
}
|
|
4026
4299
|
}
|
|
4027
|
-
const
|
|
4028
|
-
|
|
4029
|
-
const
|
|
4300
|
+
const Se = new _o();
|
|
4301
|
+
Y.__globalPluginLoader = Se;
|
|
4302
|
+
const _i = {
|
|
4030
4303
|
// Core editing plugins (always loaded)
|
|
4031
4304
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
|
|
4032
4305
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
|
|
@@ -4039,22 +4312,22 @@ const vi = {
|
|
|
4039
4312
|
list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((a) => a.ListPlugin()),
|
|
4040
4313
|
history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((a) => a.HistoryPlugin())
|
|
4041
4314
|
};
|
|
4042
|
-
async function
|
|
4043
|
-
return Object.entries(
|
|
4044
|
-
|
|
4045
|
-
}),
|
|
4315
|
+
async function Mi() {
|
|
4316
|
+
return Object.entries(_i).forEach(([a, t]) => {
|
|
4317
|
+
Se.register(a, t);
|
|
4318
|
+
}), Se;
|
|
4046
4319
|
}
|
|
4047
|
-
typeof window != "undefined" &&
|
|
4048
|
-
|
|
4320
|
+
typeof window != "undefined" && Mi().then((a) => {
|
|
4321
|
+
Y.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", Y);
|
|
4049
4322
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
4050
4323
|
t.forEach((o) => {
|
|
4051
4324
|
const i = o.innerHTML.trim();
|
|
4052
4325
|
i && (e.push(i), o.setAttribute("data-initial-content", i), o.innerHTML = "");
|
|
4053
4326
|
}), t.forEach((o, i) => {
|
|
4054
|
-
o instanceof
|
|
4327
|
+
o instanceof Y && !o.isInitialized && e[i] && o.setAttribute("content", e[i]);
|
|
4055
4328
|
});
|
|
4056
4329
|
});
|
|
4057
4330
|
export {
|
|
4058
|
-
|
|
4331
|
+
Mi as initWebComponent
|
|
4059
4332
|
};
|
|
4060
4333
|
//# sourceMappingURL=webcomponent-core.js.map
|