@editora/core 1.0.29 → 1.0.30
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 +6 -5
- package/dist/{CollaborationPlugin.native-B2AsCMfm.mjs → CollaborationPlugin.native-B9aiC2s7.mjs} +923 -898
- package/dist/editora.min.js +2 -2
- package/dist/editora.umd.js +2 -2
- package/dist/{index-8sr_lMjf.mjs → index-BIsub9gV.mjs} +161 -159
- package/dist/{index-hTD8Iy46.js → index-Z9P9O-ty.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +1 -1
- package/dist/webcomponent-core.js +165 -163
- package/dist/webcomponent-core.min.js +19 -19
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +169 -167
- package/dist/webcomponent.min.js +197 -197
- package/package.json +1 -1
|
@@ -407,18 +407,18 @@ class pn {
|
|
|
407
407
|
codeBlock: "insertCodeBlock"
|
|
408
408
|
};
|
|
409
409
|
return o.forEach((c) => {
|
|
410
|
-
const
|
|
410
|
+
const p = [];
|
|
411
411
|
c.split(/\s+/).filter(Boolean).forEach((g) => {
|
|
412
412
|
if (g === "direction") {
|
|
413
413
|
const E = r.get("setDirectionLTR"), k = r.get("setDirectionRTL");
|
|
414
|
-
E &&
|
|
414
|
+
E && p.push({
|
|
415
415
|
id: "directionLTR",
|
|
416
416
|
label: E.label,
|
|
417
417
|
command: E.command,
|
|
418
418
|
icon: E.icon,
|
|
419
419
|
type: E.type || "button",
|
|
420
420
|
options: E.options
|
|
421
|
-
}), k &&
|
|
421
|
+
}), k && p.push({
|
|
422
422
|
id: "directionRTL",
|
|
423
423
|
label: k.label,
|
|
424
424
|
command: k.command,
|
|
@@ -430,14 +430,14 @@ class pn {
|
|
|
430
430
|
}
|
|
431
431
|
if (g === "comments") {
|
|
432
432
|
const E = r.get("addComment"), k = r.get("toggleComments");
|
|
433
|
-
E &&
|
|
433
|
+
E && p.push({
|
|
434
434
|
id: "addComment",
|
|
435
435
|
label: E.label,
|
|
436
436
|
command: E.command,
|
|
437
437
|
icon: E.icon,
|
|
438
438
|
type: E.type || "button",
|
|
439
439
|
options: E.options
|
|
440
|
-
}), k &&
|
|
440
|
+
}), k && p.push({
|
|
441
441
|
id: "toggleComments",
|
|
442
442
|
label: k.label,
|
|
443
443
|
command: k.command,
|
|
@@ -449,7 +449,7 @@ class pn {
|
|
|
449
449
|
}
|
|
450
450
|
const w = l[g] || g;
|
|
451
451
|
let T = r.get(w);
|
|
452
|
-
T || (T = r.get(g)), T &&
|
|
452
|
+
T || (T = r.get(g)), T && p.push({
|
|
453
453
|
id: g,
|
|
454
454
|
label: T.label,
|
|
455
455
|
command: T.command,
|
|
@@ -458,7 +458,7 @@ class pn {
|
|
|
458
458
|
options: T.options,
|
|
459
459
|
items: T.items
|
|
460
460
|
});
|
|
461
|
-
}),
|
|
461
|
+
}), p.length > 0 && e.push(p);
|
|
462
462
|
}), e;
|
|
463
463
|
}
|
|
464
464
|
/**
|
|
@@ -477,13 +477,13 @@ class pn {
|
|
|
477
477
|
const o = this.config.items || this.getDefaultToolbarString(), i = this.parseToolbarString(o);
|
|
478
478
|
i.forEach((r, l) => {
|
|
479
479
|
const c = document.createElement("div");
|
|
480
|
-
if (c.className = "editora-toolbar-group", r.forEach((
|
|
481
|
-
this.appendToolbarButton(c,
|
|
480
|
+
if (c.className = "editora-toolbar-group", r.forEach((p) => {
|
|
481
|
+
this.appendToolbarButton(c, p);
|
|
482
482
|
const m = c.lastElementChild;
|
|
483
483
|
m instanceof HTMLElement && (this.overflowUnits.push(m), this.overflowUnitHomes.set(m, c));
|
|
484
484
|
}), e.appendChild(c), l < i.length - 1) {
|
|
485
|
-
const
|
|
486
|
-
|
|
485
|
+
const p = document.createElement("div");
|
|
486
|
+
p.className = "editora-toolbar-separator", e.appendChild(p);
|
|
487
487
|
}
|
|
488
488
|
}), t.appendChild(e), this.setupOverflow(t);
|
|
489
489
|
}
|
|
@@ -502,12 +502,12 @@ class pn {
|
|
|
502
502
|
const c = this.overflowUnits;
|
|
503
503
|
if (c.length === 0) return;
|
|
504
504
|
c.forEach((H) => {
|
|
505
|
-
var
|
|
506
|
-
H.parentElement === i && ((
|
|
505
|
+
var D;
|
|
506
|
+
H.parentElement === i && ((D = this.overflowUnitHomes.get(H)) == null || D.appendChild(H));
|
|
507
507
|
});
|
|
508
|
-
const
|
|
509
|
-
const
|
|
510
|
-
return k ? et.right -
|
|
508
|
+
const p = t.clientWidth, m = 16, g = 40, w = 4, T = Math.max(0, p - m), E = Math.max(0, T - g - w), k = getComputedStyle(t).direction === "rtl", et = e.getBoundingClientRect(), $ = (H) => {
|
|
509
|
+
const D = H.getBoundingClientRect();
|
|
510
|
+
return k ? et.right - D.left : D.right - et.left;
|
|
511
511
|
};
|
|
512
512
|
let z = 0;
|
|
513
513
|
if ($(c[c.length - 1]) <= T)
|
|
@@ -518,8 +518,8 @@ class pn {
|
|
|
518
518
|
else break;
|
|
519
519
|
z = Math.max(1, Math.min(z, c.length));
|
|
520
520
|
const st = z < c.length;
|
|
521
|
-
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((H,
|
|
522
|
-
|
|
521
|
+
o.style.display = st ? "" : "none", o.classList.toggle("active", st && this.expandedOpen), !st && this.expandedOpen && this.setExpandedOpen(!1), c.forEach((H, D) => {
|
|
522
|
+
D >= z && i.appendChild(H);
|
|
523
523
|
});
|
|
524
524
|
}, l = () => {
|
|
525
525
|
this.overflowRafId !== void 0 && cancelAnimationFrame(this.overflowRafId), this.overflowRafId = requestAnimationFrame(r);
|
|
@@ -614,9 +614,9 @@ class pn {
|
|
|
614
614
|
e.setAttribute("aria-expanded", l() ? "true" : "false");
|
|
615
615
|
});
|
|
616
616
|
c.observe(o, { attributes: !0, attributeFilter: ["style"] });
|
|
617
|
-
const
|
|
617
|
+
const p = t._cleanupDropdown;
|
|
618
618
|
t._cleanupDropdown = () => {
|
|
619
|
-
c.disconnect(),
|
|
619
|
+
c.disconnect(), p == null || p();
|
|
620
620
|
}, e.addEventListener("click", (m) => {
|
|
621
621
|
var g;
|
|
622
622
|
m.detail === 0 && l() && ((g = r()[0]) == null || g.focus());
|
|
@@ -660,14 +660,14 @@ class pn {
|
|
|
660
660
|
o.className = "editora-toolbar-button editora-toolbar-dropdown-trigger", o.type = "button", o.textContent = t.label;
|
|
661
661
|
const i = document.createElement("div");
|
|
662
662
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
663
|
-
const
|
|
664
|
-
|
|
663
|
+
const p = document.createElement("button");
|
|
664
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
665
665
|
m.preventDefault(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
666
|
-
}), i.appendChild(
|
|
666
|
+
}), i.appendChild(p);
|
|
667
667
|
}), o.addEventListener("click", (c) => {
|
|
668
668
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
669
|
-
const
|
|
670
|
-
i.style.display =
|
|
669
|
+
const p = i.style.display === "block";
|
|
670
|
+
i.style.display = p ? "none" : "block";
|
|
671
671
|
});
|
|
672
672
|
const r = (c) => {
|
|
673
673
|
e.contains(c.target) || (i.style.display = "none");
|
|
@@ -695,17 +695,17 @@ class pn {
|
|
|
695
695
|
o.textContent = t.label;
|
|
696
696
|
const i = document.createElement("div");
|
|
697
697
|
i.className = "editora-toolbar-dropdown-menu", i.style.display = "none", t.options && t.options.forEach((c) => {
|
|
698
|
-
const
|
|
699
|
-
|
|
698
|
+
const p = document.createElement("button");
|
|
699
|
+
p.className = "editora-toolbar-dropdown-item", p.type = "button", p.textContent = c.label, p.setAttribute("data-value", c.value), p.addEventListener("click", (m) => {
|
|
700
700
|
m.preventDefault(), m.stopPropagation(), this.setLastCommandTrigger(o, t.command), this.commandHandler && t.command && this.commandHandler(t.command, c.value), i.style.display = "none";
|
|
701
|
-
}), i.appendChild(
|
|
701
|
+
}), i.appendChild(p);
|
|
702
702
|
}), o.addEventListener("click", (c) => {
|
|
703
703
|
var m;
|
|
704
704
|
c.preventDefault(), c.stopPropagation(), this.setLastCommandTrigger(o, t.command);
|
|
705
|
-
const
|
|
705
|
+
const p = (m = this.container) == null ? void 0 : m.querySelectorAll(
|
|
706
706
|
".editora-toolbar-dropdown-menu"
|
|
707
707
|
);
|
|
708
|
-
|
|
708
|
+
p == null || p.forEach((g) => {
|
|
709
709
|
g !== i && (g.style.display = "none");
|
|
710
710
|
}), i.style.display = i.style.display === "none" ? "block" : "none";
|
|
711
711
|
});
|
|
@@ -829,14 +829,14 @@ class hn {
|
|
|
829
829
|
}), o.forEach((r, l) => {
|
|
830
830
|
const c = document.createElement("span");
|
|
831
831
|
if (c.className = "editora-statusbar-item", c.textContent = r, t.appendChild(c), l < o.length - 1) {
|
|
832
|
-
const
|
|
833
|
-
|
|
832
|
+
const p = document.createElement("span");
|
|
833
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", t.appendChild(p);
|
|
834
834
|
}
|
|
835
835
|
}), i.forEach((r, l) => {
|
|
836
836
|
const c = document.createElement("span");
|
|
837
837
|
if (c.className = "editora-statusbar-item", c.textContent = r, e.appendChild(c), l < i.length - 1) {
|
|
838
|
-
const
|
|
839
|
-
|
|
838
|
+
const p = document.createElement("span");
|
|
839
|
+
p.className = "editora-statusbar-separator", p.textContent = "|", e.appendChild(p);
|
|
840
840
|
}
|
|
841
841
|
}), this.container.appendChild(t), this.container.appendChild(e);
|
|
842
842
|
}
|
|
@@ -1247,14 +1247,14 @@ function wn(a) {
|
|
|
1247
1247
|
function Tn(a, t) {
|
|
1248
1248
|
var e = a == null ? null : typeof Symbol != "undefined" && a[Symbol.iterator] || a["@@iterator"];
|
|
1249
1249
|
if (e != null) {
|
|
1250
|
-
var o, i, r, l, c = [],
|
|
1250
|
+
var o, i, r, l, c = [], p = !0, m = !1;
|
|
1251
1251
|
try {
|
|
1252
|
-
if (r = (e = e.call(a)).next, t !== 0) for (; !(
|
|
1252
|
+
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) ;
|
|
1253
1253
|
} catch (g) {
|
|
1254
1254
|
m = !0, i = g;
|
|
1255
1255
|
} finally {
|
|
1256
1256
|
try {
|
|
1257
|
-
if (!
|
|
1257
|
+
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
1258
1258
|
} finally {
|
|
1259
1259
|
if (m) throw i;
|
|
1260
1260
|
}
|
|
@@ -1292,7 +1292,7 @@ ke || (ke = function(t) {
|
|
|
1292
1292
|
for (var e = arguments.length, o = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) o[i - 1] = arguments[i];
|
|
1293
1293
|
return new t(...o);
|
|
1294
1294
|
});
|
|
1295
|
-
const at = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), At = L(Array.prototype.push), Mn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim),
|
|
1295
|
+
const at = L(Array.prototype.forEach), Ln = L(Array.prototype.lastIndexOf), so = L(Array.prototype.pop), At = L(Array.prototype.push), Mn = L(Array.prototype.splice), vt = Array.isArray, Mt = L(String.prototype.toLowerCase), he = L(String.prototype.toString), lo = L(String.prototype.match), Ct = L(String.prototype.replace), co = L(String.prototype.indexOf), In = L(String.prototype.trim), On = L(Number.prototype.toString), Dn = L(Boolean.prototype.toString), uo = typeof BigInt == "undefined" ? null : L(BigInt.prototype.toString), po = typeof Symbol == "undefined" ? null : L(Symbol.prototype.toString), P = L(Object.prototype.hasOwnProperty), St = L(Object.prototype.toString), O = L(RegExp.prototype.test), J = Rn(TypeError);
|
|
1296
1296
|
function L(a) {
|
|
1297
1297
|
return function(t) {
|
|
1298
1298
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -1338,9 +1338,9 @@ function Pn(a) {
|
|
|
1338
1338
|
case "string":
|
|
1339
1339
|
return a;
|
|
1340
1340
|
case "number":
|
|
1341
|
-
return Dn(a);
|
|
1342
|
-
case "boolean":
|
|
1343
1341
|
return On(a);
|
|
1342
|
+
case "boolean":
|
|
1343
|
+
return Dn(a);
|
|
1344
1344
|
case "bigint":
|
|
1345
1345
|
return uo ? uo(a) : "0";
|
|
1346
1346
|
case "symbol":
|
|
@@ -1377,7 +1377,7 @@ function W(a, t) {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
function zn(a) {
|
|
1379
1379
|
try {
|
|
1380
|
-
return
|
|
1380
|
+
return O(a, ""), !0;
|
|
1381
1381
|
} catch (t) {
|
|
1382
1382
|
return !1;
|
|
1383
1383
|
}
|
|
@@ -2092,10 +2092,10 @@ function Mo() {
|
|
|
2092
2092
|
let e = a.document;
|
|
2093
2093
|
const o = e, i = o.currentScript;
|
|
2094
2094
|
a.DocumentFragment;
|
|
2095
|
-
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element,
|
|
2095
|
+
const r = a.HTMLTemplateElement, l = a.Node, c = a.Element, p = a.NodeFilter;
|
|
2096
2096
|
a.NamedNodeMap === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
|
|
2097
|
-
const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = W(w, "remove"), k = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), H = W(w, "attributes"),
|
|
2098
|
-
return
|
|
2097
|
+
const m = a.DOMParser, g = a.trustedTypes, w = c.prototype, T = W(w, "cloneNode"), E = W(w, "remove"), k = W(w, "removeAttributeNode"), et = W(w, "nextSibling"), $ = W(w, "childNodes"), z = W(w, "parentNode"), st = W(w, "shadowRoot"), H = W(w, "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, Et = function(n) {
|
|
2098
|
+
return D ? D(n) : n.nodeType;
|
|
2099
2099
|
}, Xt = function(n) {
|
|
2100
2100
|
return lt ? lt(n) : n.nodeName;
|
|
2101
2101
|
};
|
|
@@ -2113,7 +2113,7 @@ function Mo() {
|
|
|
2113
2113
|
} finally {
|
|
2114
2114
|
wt--;
|
|
2115
2115
|
}
|
|
2116
|
-
},
|
|
2116
|
+
}, Do = function(n) {
|
|
2117
2117
|
_e(), wt++;
|
|
2118
2118
|
try {
|
|
2119
2119
|
return N.createScriptURL(n);
|
|
@@ -2122,7 +2122,7 @@ function Mo() {
|
|
|
2122
2122
|
}
|
|
2123
2123
|
}, Ro = function() {
|
|
2124
2124
|
return Se || (Zt = ti(g, i), Se = !0), Zt;
|
|
2125
|
-
},
|
|
2125
|
+
}, Ot = e, Jt = Ot.implementation, Le = Ot.createNodeIterator, No = Ot.createDocumentFragment, Po = Ot.getElementsByTagName, zo = o.importNode;
|
|
2126
2126
|
let x = Eo();
|
|
2127
2127
|
t.isSupported = typeof So == "function" && typeof z == "function" && Jt && Jt.createHTMLDocument !== void 0;
|
|
2128
2128
|
const Ho = Fn, Bo = Un, Fo = jn, Uo = Wn, jo = $n, Wo = Gn, Me = Kn, $o = qn;
|
|
@@ -2160,7 +2160,7 @@ function Mo() {
|
|
|
2160
2160
|
enumerable: !0,
|
|
2161
2161
|
value: !1
|
|
2162
2162
|
}
|
|
2163
|
-
})), Tt = null,
|
|
2163
|
+
})), Tt = null, Oe = null;
|
|
2164
2164
|
const V = Object.seal(yt(null, {
|
|
2165
2165
|
tagCheck: {
|
|
2166
2166
|
writable: !0,
|
|
@@ -2175,7 +2175,7 @@ function Mo() {
|
|
|
2175
2175
|
value: null
|
|
2176
2176
|
}
|
|
2177
2177
|
}));
|
|
2178
|
-
let
|
|
2178
|
+
let De = !0, ee = !0, Re = !1, Ne = !0, X = !1, nt = !0, it = !1, oe = !1, Dt = null, Rt = null, ne = !1, dt = !1, Nt = !1, Pt = !1, Pe = !0, ze = !1;
|
|
2179
2179
|
const He = "user-content-";
|
|
2180
2180
|
let ie = !0, re = !1, ut = {}, pt = null;
|
|
2181
2181
|
const Be = v({}, [
|
|
@@ -2268,7 +2268,7 @@ function Mo() {
|
|
|
2268
2268
|
}), Fe = Q(n, "ADD_DATA_URI_TAGS", Ue, {
|
|
2269
2269
|
transform: _,
|
|
2270
2270
|
base: Ue
|
|
2271
|
-
}), pt = Q(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = Q(n, "FORBID_TAGS", U({}), { transform: _ }),
|
|
2271
|
+
}), pt = Q(n, "FORBID_CONTENTS", Be, { transform: _ }), Tt = Q(n, "FORBID_TAGS", U({}), { transform: _ }), Oe = Q(n, "FORBID_ATTR", U({}), { transform: _ }), ut = P(n, "USE_PROFILES") ? n.USE_PROFILES && typeof n.USE_PROFILES == "object" ? U(n.USE_PROFILES) : n.USE_PROFILES : !1, De = n.ALLOW_ARIA_ATTR !== !1, ee = n.ALLOW_DATA_ATTR !== !1, Re = 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, Nt = n.RETURN_DOM_FRAGMENT || !1, Pt = n.RETURN_TRUSTED_TYPE || !1, ne = n.FORCE_BODY || !1, Pe = n.SANITIZE_DOM !== !1, ze = n.SANITIZE_NAMED_PROPS || !1, ie = n.KEEP_CONTENT !== !1, re = n.IN_PLACE || !1, Ie = zn(n.ALLOWED_URI_REGEXP) ? n.ALLOWED_URI_REGEXP : bo, ft = typeof n.NAMESPACE == "string" ? n.NAMESPACE : K, le = ve(n, "MATHML_TEXT_INTEGRATION_POINTS", () => v({}, $e)), ce = ve(n, "HTML_INTEGRATION_POINTS", () => v({}, Ge));
|
|
2272
2272
|
const s = ve(n, "CUSTOM_ELEMENT_HANDLING", () => yt(null));
|
|
2273
2273
|
if (G = yt(null), P(s, "tagNameCheck") && Ke(s.tagNameCheck) && (G.tagNameCheck = s.tagNameCheck), P(s, "attributeNameCheck") && Ke(s.attributeNameCheck) && (G.attributeNameCheck = s.attributeNameCheck), P(s, "allowCustomizedBuiltInElements") && typeof s.allowCustomizedBuiltInElements == "boolean" && (G.allowCustomizedBuiltInElements = s.allowCustomizedBuiltInElements), I(G), X && (ee = !1), Nt && (dt = !0), ut && (A = v({}, ho), C = yt(null), ut.html === !0 && (v(A, fo), v(C, mo)), ut.svg === !0 && (v(A, me), v(C, ye), v(C, Gt)), ut.svgFilters === !0 && (v(A, ge), v(C, ye), v(C, Gt)), ut.mathMl === !0 && (v(A, be), v(C, go), v(C, Gt))), V.tagCheck = null, V.attributeCheck = null, P(n, "ADD_TAGS") && (typeof n.ADD_TAGS == "function" ? V.tagCheck = n.ADD_TAGS : vt(n.ADD_TAGS) && (A === Qt && (A = U(A)), v(A, n.ADD_TAGS, _))), P(n, "ADD_ATTR") && (typeof n.ADD_ATTR == "function" ? V.attributeCheck = n.ADD_ATTR : vt(n.ADD_ATTR) && (C === te && (C = U(C)), v(C, n.ADD_ATTR, _))), P(n, "ADD_FORBID_CONTENTS") && vt(n.ADD_FORBID_CONTENTS) && (pt === Be && (pt = U(pt)), v(pt, n.ADD_FORBID_CONTENTS, _)), ie && (A["#text"] = !0), it && v(A, [
|
|
2274
2274
|
"html",
|
|
@@ -2281,8 +2281,8 @@ function Mo() {
|
|
|
2281
2281
|
N = n.TRUSTED_TYPES_POLICY;
|
|
2282
2282
|
try {
|
|
2283
2283
|
ot = ct("");
|
|
2284
|
-
} catch (
|
|
2285
|
-
throw N = d,
|
|
2284
|
+
} catch (f) {
|
|
2285
|
+
throw N = d, f;
|
|
2286
2286
|
}
|
|
2287
2287
|
} else n.TRUSTED_TYPES_POLICY === null ? (N = void 0, ot = "") : (N === void 0 && (N = Ro()), N && typeof ot == "string" && (ot = ct("")));
|
|
2288
2288
|
M && M(n), ht = n;
|
|
@@ -2302,8 +2302,8 @@ function Mo() {
|
|
|
2302
2302
|
namespaceURI: ft,
|
|
2303
2303
|
tagName: "template"
|
|
2304
2304
|
});
|
|
2305
|
-
const d = Mt(n.tagName),
|
|
2306
|
-
return se[n.namespaceURI] ? n.namespaceURI === Ht ? Xo(d, s,
|
|
2305
|
+
const d = Mt(n.tagName), f = Mt(s.tagName);
|
|
2306
|
+
return se[n.namespaceURI] ? n.namespaceURI === Ht ? Xo(d, s, f) : n.namespaceURI === zt ? Zo(d, s, f) : n.namespaceURI === K ? Jo(d, s, f) : !!(kt === "application/xhtml+xml" && se[n.namespaceURI]) : !1;
|
|
2307
2307
|
}, Z = function(n) {
|
|
2308
2308
|
At(t.removed, { element: n });
|
|
2309
2309
|
try {
|
|
@@ -2314,7 +2314,7 @@ function Mo() {
|
|
|
2314
2314
|
}, Ve = function(n, s, d) {
|
|
2315
2315
|
try {
|
|
2316
2316
|
k(n, s);
|
|
2317
|
-
} catch (
|
|
2317
|
+
} catch (f) {
|
|
2318
2318
|
try {
|
|
2319
2319
|
n.removeAttribute(d);
|
|
2320
2320
|
} catch (h) {
|
|
@@ -2324,10 +2324,10 @@ function Mo() {
|
|
|
2324
2324
|
Ft(n);
|
|
2325
2325
|
const s = $(n);
|
|
2326
2326
|
if (s) {
|
|
2327
|
-
const
|
|
2327
|
+
const f = [];
|
|
2328
2328
|
at(s, (h) => {
|
|
2329
|
-
At(
|
|
2330
|
-
}), at(
|
|
2329
|
+
At(f, h);
|
|
2330
|
+
}), at(f, (h) => {
|
|
2331
2331
|
try {
|
|
2332
2332
|
E(h);
|
|
2333
2333
|
} catch (b) {
|
|
@@ -2335,14 +2335,14 @@ function Mo() {
|
|
|
2335
2335
|
});
|
|
2336
2336
|
}
|
|
2337
2337
|
const d = H(n);
|
|
2338
|
-
if (d) for (let
|
|
2339
|
-
const h = d[
|
|
2338
|
+
if (d) for (let f = d.length - 1; f >= 0; --f) {
|
|
2339
|
+
const h = d[f], b = h && h.name;
|
|
2340
2340
|
typeof b == "string" && Ve(n, h, b);
|
|
2341
2341
|
}
|
|
2342
2342
|
}, rt = function(n, s, d) {
|
|
2343
2343
|
if (!d) try {
|
|
2344
2344
|
d = s.getAttributeNode(n);
|
|
2345
|
-
} catch (
|
|
2345
|
+
} catch (f) {
|
|
2346
2346
|
d = null;
|
|
2347
2347
|
}
|
|
2348
2348
|
At(t.removed, {
|
|
@@ -2351,7 +2351,7 @@ function Mo() {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
try {
|
|
2353
2353
|
d ? k(s, d) : s.removeAttribute(n);
|
|
2354
|
-
} catch (
|
|
2354
|
+
} catch (f) {
|
|
2355
2355
|
try {
|
|
2356
2356
|
s.removeAttribute(n);
|
|
2357
2357
|
} catch (h) {
|
|
@@ -2360,26 +2360,26 @@ function Mo() {
|
|
|
2360
2360
|
if (n === "is")
|
|
2361
2361
|
if (dt || Nt) try {
|
|
2362
2362
|
Z(s);
|
|
2363
|
-
} catch (
|
|
2363
|
+
} catch (f) {
|
|
2364
2364
|
}
|
|
2365
2365
|
else try {
|
|
2366
2366
|
s.setAttribute(n, "");
|
|
2367
|
-
} catch (
|
|
2367
|
+
} catch (f) {
|
|
2368
2368
|
}
|
|
2369
2369
|
}, tn = function(n) {
|
|
2370
2370
|
const s = H(n);
|
|
2371
2371
|
if (s)
|
|
2372
2372
|
for (let d = s.length - 1; d >= 0; --d) {
|
|
2373
|
-
const
|
|
2374
|
-
typeof h != "string" || C[_(h)] || Ve(n,
|
|
2373
|
+
const f = s[d], h = f && f.name;
|
|
2374
|
+
typeof h != "string" || C[_(h)] || Ve(n, f, h);
|
|
2375
2375
|
}
|
|
2376
2376
|
}, Ft = function(n) {
|
|
2377
2377
|
const s = [n];
|
|
2378
2378
|
for (; s.length > 0; ) {
|
|
2379
2379
|
const d = s.pop();
|
|
2380
2380
|
Et(d) === F.element && tn(d);
|
|
2381
|
-
const
|
|
2382
|
-
if (
|
|
2381
|
+
const f = $(d);
|
|
2382
|
+
if (f) for (let h = f.length - 1; h >= 0; --h) s.push(f[h]);
|
|
2383
2383
|
}
|
|
2384
2384
|
}, Xe = function(n, s) {
|
|
2385
2385
|
return nt ? n === "patchsrc" ? !0 : n === "for" && s !== "label" && s !== "output" : !1;
|
|
@@ -2387,15 +2387,15 @@ function Mo() {
|
|
|
2387
2387
|
if (!nt) return;
|
|
2388
2388
|
const s = [n];
|
|
2389
2389
|
for (; s.length > 0; ) {
|
|
2390
|
-
const d = s.pop(),
|
|
2391
|
-
if (
|
|
2390
|
+
const d = s.pop(), f = Et(d);
|
|
2391
|
+
if (f === F.processingInstruction || f === F.comment && O(vo, d.data)) {
|
|
2392
2392
|
try {
|
|
2393
2393
|
E(d);
|
|
2394
2394
|
} catch (b) {
|
|
2395
2395
|
}
|
|
2396
2396
|
continue;
|
|
2397
2397
|
}
|
|
2398
|
-
if (
|
|
2398
|
+
if (f === F.element) {
|
|
2399
2399
|
const b = d, y = _(Xt(d));
|
|
2400
2400
|
try {
|
|
2401
2401
|
b.hasAttribute && b.hasAttribute("patchsrc") && b.removeAttribute("patchsrc"), b.hasAttribute && b.hasAttribute("for") && Xe("for", y) && b.removeAttribute("for");
|
|
@@ -2413,15 +2413,15 @@ function Mo() {
|
|
|
2413
2413
|
d = b && b[0];
|
|
2414
2414
|
}
|
|
2415
2415
|
kt === "application/xhtml+xml" && ft === K && (n = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + n + "</body></html>");
|
|
2416
|
-
const
|
|
2416
|
+
const f = N ? ct(n) : n;
|
|
2417
2417
|
if (ft === K) try {
|
|
2418
|
-
s = new m().parseFromString(
|
|
2418
|
+
s = new m().parseFromString(f, kt);
|
|
2419
2419
|
} catch (b) {
|
|
2420
2420
|
}
|
|
2421
2421
|
if (!s || !s.documentElement) {
|
|
2422
2422
|
s = Jt.createDocument(ft, "template", null);
|
|
2423
2423
|
try {
|
|
2424
|
-
s.documentElement.innerHTML = ae ? ot :
|
|
2424
|
+
s.documentElement.innerHTML = ae ? ot : f;
|
|
2425
2425
|
} catch (b) {
|
|
2426
2426
|
}
|
|
2427
2427
|
}
|
|
@@ -2429,34 +2429,34 @@ function Mo() {
|
|
|
2429
2429
|
return n && d && h.insertBefore(e.createTextNode(d), h.childNodes[0] || null), ft === K ? Po.call(s, it ? "html" : "body")[0] : it ? s.documentElement : h;
|
|
2430
2430
|
}, Je = function(n) {
|
|
2431
2431
|
const s = It ? It(n) : n.ownerDocument;
|
|
2432
|
-
return Le.call(s || n, n,
|
|
2432
|
+
return Le.call(s || n, n, p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION, null);
|
|
2433
2433
|
}, Ut = function(n) {
|
|
2434
2434
|
return n = Ct(n, Ho, " "), n = Ct(n, Bo, " "), n = Ct(n, Fo, " "), n;
|
|
2435
2435
|
}, ue = function(n) {
|
|
2436
2436
|
var s;
|
|
2437
2437
|
n.normalize();
|
|
2438
|
-
const d = It ? It(n) : n.ownerDocument,
|
|
2439
|
-
let h =
|
|
2438
|
+
const d = It ? It(n) : n.ownerDocument, f = Le.call(d || n, n, p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION, null);
|
|
2439
|
+
let h = f.nextNode();
|
|
2440
2440
|
for (; h; )
|
|
2441
|
-
h.data = Ut(h.data), h =
|
|
2441
|
+
h.data = Ut(h.data), h = f.nextNode();
|
|
2442
2442
|
const b = (s = n.querySelectorAll) === null || s === void 0 ? void 0 : s.call(n, "template");
|
|
2443
2443
|
b && at(b, (y) => {
|
|
2444
2444
|
mt(y.content) && ue(y.content);
|
|
2445
2445
|
});
|
|
2446
2446
|
}, jt = function(n) {
|
|
2447
2447
|
const s = lt ? lt(n) : null;
|
|
2448
|
-
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== H(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 !==
|
|
2448
|
+
return typeof s != "string" || _(s) !== "form" ? !1 : typeof n.nodeName != "string" || typeof n.textContent != "string" || typeof n.removeChild != "function" || n.attributes !== H(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);
|
|
2449
2449
|
}, mt = function(n) {
|
|
2450
|
-
if (!
|
|
2450
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2451
2451
|
try {
|
|
2452
|
-
return
|
|
2452
|
+
return D(n) === F.documentFragment;
|
|
2453
2453
|
} catch (s) {
|
|
2454
2454
|
return !1;
|
|
2455
2455
|
}
|
|
2456
2456
|
}, xt = function(n) {
|
|
2457
|
-
if (!
|
|
2457
|
+
if (!D || typeof n != "object" || n === null) return !1;
|
|
2458
2458
|
try {
|
|
2459
|
-
return typeof
|
|
2459
|
+
return typeof D(n) == "number";
|
|
2460
2460
|
} catch (s) {
|
|
2461
2461
|
return !1;
|
|
2462
2462
|
}
|
|
@@ -2467,29 +2467,29 @@ function Mo() {
|
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
2469
2469
|
const on = function(n, s) {
|
|
2470
|
-
return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) &&
|
|
2470
|
+
return !!(nt && n.hasChildNodes() && !xt(n.firstElementChild) && O(yo, n.textContent) && O(yo, n.innerHTML) || nt && n.namespaceURI === K && Zn[s] && (xt(n.firstElementChild) || typeof n.textContent == "string" && O(Jn[s], n.textContent)) || n.nodeType === F.processingInstruction || nt && n.nodeType === F.comment && O(vo, n.data));
|
|
2471
2471
|
}, Wt = function(n, s) {
|
|
2472
|
-
if (n instanceof RegExp) return
|
|
2472
|
+
if (n instanceof RegExp) return O(n, s);
|
|
2473
2473
|
if (n instanceof Function) {
|
|
2474
|
-
for (var d = arguments.length,
|
|
2475
|
-
return !!n(s, ...
|
|
2474
|
+
for (var d = arguments.length, f = new Array(d > 2 ? d - 2 : 0), h = 2; h < d; h++) f[h - 2] = arguments[h];
|
|
2475
|
+
return !!n(s, ...f);
|
|
2476
2476
|
}
|
|
2477
2477
|
return !1;
|
|
2478
2478
|
}, nn = function(n, s, d) {
|
|
2479
2479
|
if (!Tt[s] && oo(s) && Wt(G.tagNameCheck, s)) return !1;
|
|
2480
2480
|
if (ie && !pt[s]) {
|
|
2481
|
-
const
|
|
2482
|
-
if (h &&
|
|
2481
|
+
const f = z(n), h = $(n);
|
|
2482
|
+
if (h && f) {
|
|
2483
2483
|
const b = h.length;
|
|
2484
2484
|
for (let y = b - 1; y >= 0; --y) {
|
|
2485
2485
|
const S = n === d ? T(h[y], !0) : h[y];
|
|
2486
|
-
|
|
2486
|
+
f.insertBefore(S, et(n));
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
2489
|
}
|
|
2490
2490
|
return Z(n), !0;
|
|
2491
|
-
}, Qe = function(n, s, d,
|
|
2492
|
-
return n.length === 0 ? s : s === d || s ===
|
|
2491
|
+
}, Qe = function(n, s, d, f) {
|
|
2492
|
+
return n.length === 0 ? s : s === d || s === f ? U(s) : s;
|
|
2493
2493
|
}, gt = function(n, s) {
|
|
2494
2494
|
return n === s || z(n) !== null ? !1 : (re && Ft(n), !0);
|
|
2495
2495
|
}, to = function(n, s) {
|
|
@@ -2497,27 +2497,27 @@ function Mo() {
|
|
|
2497
2497
|
if (jt(n))
|
|
2498
2498
|
return Z(n), !0;
|
|
2499
2499
|
const d = _(Xt(n));
|
|
2500
|
-
if (A = Qe(x.uponSanitizeElement, A, Qt,
|
|
2500
|
+
if (A = Qe(x.uponSanitizeElement, A, Qt, Dt), Y(x.uponSanitizeElement, n, {
|
|
2501
2501
|
tagName: d,
|
|
2502
2502
|
allowedTags: A
|
|
2503
2503
|
}), gt(n, s)) return !0;
|
|
2504
2504
|
if (on(n, d))
|
|
2505
2505
|
return Z(n), !0;
|
|
2506
2506
|
if (Tt[d] || !(V.tagCheck instanceof Function && V.tagCheck(d)) && !A[d]) {
|
|
2507
|
-
const
|
|
2508
|
-
return
|
|
2507
|
+
const f = nn(n, d, s);
|
|
2508
|
+
return f === !1 && (Y(x.afterSanitizeElements, n, null), gt(n, s)) ? !0 : f;
|
|
2509
2509
|
}
|
|
2510
|
-
if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") &&
|
|
2510
|
+
if (Et(n) === F.element && !Qo(n) || (d === "noscript" || d === "noembed" || d === "noframes") && O(Vn, n.innerHTML))
|
|
2511
2511
|
return Z(n), !0;
|
|
2512
2512
|
if (X && n.nodeType === F.text) {
|
|
2513
|
-
const
|
|
2514
|
-
n.textContent !==
|
|
2513
|
+
const f = Ut(n.textContent);
|
|
2514
|
+
n.textContent !== f && (At(t.removed, { element: n.cloneNode() }), n.textContent = f);
|
|
2515
2515
|
}
|
|
2516
2516
|
return Y(x.afterSanitizeElements, n, null), gt(n, s);
|
|
2517
2517
|
}, eo = function(n, s, d) {
|
|
2518
|
-
if (
|
|
2519
|
-
const
|
|
2520
|
-
return ee &&
|
|
2518
|
+
if (Oe[s] || Xe(s, n) || Pe && (s === "id" || s === "name") && (d in e || d in Vo)) return !1;
|
|
2519
|
+
const f = C[s] || V.attributeCheck instanceof Function && V.attributeCheck(s, n);
|
|
2520
|
+
return ee && O(Uo, s) || De && O(jo, s) ? !0 : f ? je[s] || O(Ie, Ct(d, Me, "")) || (s === "src" || s === "xlink:href" || s === "href") && n !== "script" && co(d, "data:") === 0 && Fe[n] || Re && !O(Wo, Ct(d, Me, "")) ? !0 : !d : oo(n) && Wt(G.tagNameCheck, n) && Wt(G.attributeNameCheck, s, n) || s === "is" && G.allowCustomizedBuiltInElements && Wt(G.tagNameCheck, d);
|
|
2521
2521
|
}, rn = v({}, [
|
|
2522
2522
|
"annotation-xml",
|
|
2523
2523
|
"color-profile",
|
|
@@ -2528,18 +2528,18 @@ function Mo() {
|
|
|
2528
2528
|
"font-face-uri",
|
|
2529
2529
|
"missing-glyph"
|
|
2530
2530
|
]), oo = function(n) {
|
|
2531
|
-
return !rn[Mt(n)] &&
|
|
2532
|
-
}, an = function(n, s, d,
|
|
2531
|
+
return !rn[Mt(n)] && O($o, n);
|
|
2532
|
+
}, an = function(n, s, d, f) {
|
|
2533
2533
|
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !d) switch (g.getAttributeType(n, s)) {
|
|
2534
2534
|
case "TrustedHTML":
|
|
2535
|
-
return ct(
|
|
2535
|
+
return ct(f);
|
|
2536
2536
|
case "TrustedScriptURL":
|
|
2537
|
-
return
|
|
2537
|
+
return Do(f);
|
|
2538
2538
|
}
|
|
2539
|
-
return
|
|
2540
|
-
}, sn = function(n, s, d,
|
|
2539
|
+
return f;
|
|
2540
|
+
}, sn = function(n, s, d, f) {
|
|
2541
2541
|
try {
|
|
2542
|
-
return d ? n.setAttributeNS(d, s,
|
|
2542
|
+
return d ? n.setAttributeNS(d, s, f) : n.setAttribute(s, f), jt(n) ? (Z(n), !1) : !0;
|
|
2543
2543
|
} catch (h) {
|
|
2544
2544
|
return rt(s, n), !1;
|
|
2545
2545
|
}
|
|
@@ -2548,7 +2548,7 @@ function Mo() {
|
|
|
2548
2548
|
const d = n.attributes;
|
|
2549
2549
|
if (!d || jt(n)) return;
|
|
2550
2550
|
C = Qe(x.uponSanitizeAttribute, C, te, Rt);
|
|
2551
|
-
const
|
|
2551
|
+
const f = {
|
|
2552
2552
|
attrName: "",
|
|
2553
2553
|
attrValue: "",
|
|
2554
2554
|
keepAttr: !0,
|
|
@@ -2560,7 +2560,7 @@ function Mo() {
|
|
|
2560
2560
|
for (; h--; ) {
|
|
2561
2561
|
const y = d[h], S = y.name, j = y.namespaceURI, B = y.value, bt = _(S), fe = B;
|
|
2562
2562
|
let R = S === "value" ? fe : In(fe), io = !1;
|
|
2563
|
-
if (
|
|
2563
|
+
if (f.attrName = bt, f.attrValue = R, f.keepAttr = !0, f.forceKeepAttr = void 0, Y(x.uponSanitizeAttribute, n, f), R = f.attrValue, ze && (bt === "id" || bt === "name") && co(R, He) !== 0 && (rt(S, n, y), R = He + R, io = !0), nt && O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, R)) {
|
|
2564
2564
|
rt(S, n, y);
|
|
2565
2565
|
continue;
|
|
2566
2566
|
}
|
|
@@ -2568,12 +2568,12 @@ function Mo() {
|
|
|
2568
2568
|
rt(S, n, y);
|
|
2569
2569
|
continue;
|
|
2570
2570
|
}
|
|
2571
|
-
if (!
|
|
2572
|
-
if (!
|
|
2571
|
+
if (!f.forceKeepAttr) {
|
|
2572
|
+
if (!f.keepAttr) {
|
|
2573
2573
|
rt(S, n, y);
|
|
2574
2574
|
continue;
|
|
2575
2575
|
}
|
|
2576
|
-
if (!Ne &&
|
|
2576
|
+
if (!Ne && O(Xn, R)) {
|
|
2577
2577
|
rt(S, n, y);
|
|
2578
2578
|
continue;
|
|
2579
2579
|
}
|
|
@@ -2590,8 +2590,8 @@ function Mo() {
|
|
|
2590
2590
|
const d = Je(n);
|
|
2591
2591
|
for (Y(x.beforeSanitizeShadowDOM, n, null); s = d.nextNode(); )
|
|
2592
2592
|
if (Y(x.uponSanitizeShadowNode, s, null), to(s, n), no(s, n), mt(s.content) && $t(s.content), Et(s) === F.element) {
|
|
2593
|
-
const
|
|
2594
|
-
mt(
|
|
2593
|
+
const f = st(s);
|
|
2594
|
+
mt(f) && (pe(f), $t(f));
|
|
2595
2595
|
}
|
|
2596
2596
|
Y(x.afterSanitizeShadowDOM, n, null);
|
|
2597
2597
|
}, pe = function(n) {
|
|
@@ -2605,15 +2605,15 @@ function Mo() {
|
|
|
2605
2605
|
$t(d.shadow);
|
|
2606
2606
|
continue;
|
|
2607
2607
|
}
|
|
2608
|
-
const
|
|
2608
|
+
const f = d.node, h = Et(f) === F.element, b = $(f);
|
|
2609
2609
|
if (b) for (let y = b.length - 1; y >= 0; --y) s.push({
|
|
2610
2610
|
node: b[y],
|
|
2611
2611
|
shadow: null
|
|
2612
2612
|
});
|
|
2613
2613
|
if (h) {
|
|
2614
|
-
const y = lt ? lt(
|
|
2614
|
+
const y = lt ? lt(f) : null;
|
|
2615
2615
|
if (typeof y == "string" && _(y) === "template") {
|
|
2616
|
-
const S =
|
|
2616
|
+
const S = f.content;
|
|
2617
2617
|
mt(S) && s.push({
|
|
2618
2618
|
node: S,
|
|
2619
2619
|
shadow: null
|
|
@@ -2621,7 +2621,7 @@ function Mo() {
|
|
|
2621
2621
|
}
|
|
2622
2622
|
}
|
|
2623
2623
|
if (h) {
|
|
2624
|
-
const y = st(
|
|
2624
|
+
const y = st(f);
|
|
2625
2625
|
mt(y) && s.push({
|
|
2626
2626
|
node: null,
|
|
2627
2627
|
shadow: y
|
|
@@ -2633,11 +2633,11 @@ function Mo() {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
};
|
|
2635
2635
|
return t.sanitize = function(u) {
|
|
2636
|
-
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null,
|
|
2636
|
+
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, d = null, f = null, h = null;
|
|
2637
2637
|
if (ae = !u, ae && (u = "<!-->"), typeof u != "string" && !xt(u) && (u = Pn(u), typeof u != "string"))
|
|
2638
2638
|
throw J("dirty is not a string, aborting");
|
|
2639
2639
|
if (!t.isSupported) return u;
|
|
2640
|
-
oe ? (A =
|
|
2640
|
+
oe ? (A = Dt, C = Rt) : de(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (A = U(A)), x.uponSanitizeAttribute.length > 0 && (C = U(C)), t.removed = [];
|
|
2641
2641
|
const b = re && typeof u != "string" && xt(u);
|
|
2642
2642
|
if (b) {
|
|
2643
2643
|
en(u);
|
|
@@ -2664,8 +2664,8 @@ function Mo() {
|
|
|
2664
2664
|
const y = b ? u : s;
|
|
2665
2665
|
try {
|
|
2666
2666
|
const j = Je(y);
|
|
2667
|
-
for (;
|
|
2668
|
-
to(
|
|
2667
|
+
for (; f = j.nextNode(); )
|
|
2668
|
+
to(f, y), no(f, y), mt(f.content) && $t(f.content);
|
|
2669
2669
|
} catch (j) {
|
|
2670
2670
|
throw b && (Bt(u), at(t.removed, (B) => {
|
|
2671
2671
|
B.element && Ft(B.element);
|
|
@@ -2685,17 +2685,17 @@ function Mo() {
|
|
|
2685
2685
|
return (C.shadowroot || C.shadowrootmode) && (h = zo.call(o, h, !0)), h;
|
|
2686
2686
|
}
|
|
2687
2687
|
let S = it ? s.outerHTML : s.innerHTML;
|
|
2688
|
-
return it && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name &&
|
|
2688
|
+
return it && A["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && O(Yn, s.ownerDocument.doctype.name) && (S = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
|
|
2689
2689
|
` + S), X && (S = Ut(S)), N && Pt ? ct(S) : S;
|
|
2690
2690
|
}, t.setConfig = function() {
|
|
2691
2691
|
let u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2692
|
-
de(u), oe = !0,
|
|
2692
|
+
de(u), oe = !0, Dt = A, Rt = C;
|
|
2693
2693
|
}, t.clearConfig = function() {
|
|
2694
|
-
ht = null, oe = !1,
|
|
2694
|
+
ht = null, oe = !1, Dt = null, Rt = null, N = Zt, ot = "";
|
|
2695
2695
|
}, t.isValidAttribute = function(u, n, s) {
|
|
2696
2696
|
ht || de({});
|
|
2697
|
-
const d = _(u),
|
|
2698
|
-
return eo(d,
|
|
2697
|
+
const d = _(u), f = _(n);
|
|
2698
|
+
return eo(d, f, s);
|
|
2699
2699
|
}, t.addHook = function(u, n) {
|
|
2700
2700
|
typeof n == "function" && P(x, u) && At(x[u], n);
|
|
2701
2701
|
}, t.removeHook = function(u, n) {
|
|
@@ -2792,12 +2792,12 @@ function ii(a) {
|
|
|
2792
2792
|
function Io(a, t, e, o) {
|
|
2793
2793
|
if ((t == null ? void 0 : t.sanitize) === !1)
|
|
2794
2794
|
return a;
|
|
2795
|
-
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, 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 : oi,
|
|
2795
|
+
const i = t != null && t.allowedTags && t.allowedTags.length > 0 ? t.allowedTags : ei, 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 : oi, p = /* @__PURE__ */ new Set();
|
|
2796
2796
|
for (const w of Object.values(c))
|
|
2797
|
-
for (const T of w)
|
|
2797
|
+
for (const T of w) p.add(T);
|
|
2798
2798
|
const m = {
|
|
2799
2799
|
ALLOWED_TAGS: r,
|
|
2800
|
-
ALLOWED_ATTR: Array.from(
|
|
2800
|
+
ALLOWED_ATTR: Array.from(p)
|
|
2801
2801
|
};
|
|
2802
2802
|
if (!o)
|
|
2803
2803
|
return Kt.sanitize(a, m);
|
|
@@ -2827,7 +2827,7 @@ function wo(a, t, e, o) {
|
|
|
2827
2827
|
return (e == null ? void 0 : e.sanitizeOnInput) === !1 ? a : Io(a, t, o, !0);
|
|
2828
2828
|
}
|
|
2829
2829
|
const si = ".resize-handle, .table-resize-handle, [data-rte-media-pending]", li = /resize-handle|data-rte-media-pending|rte-media/;
|
|
2830
|
-
function
|
|
2830
|
+
function Oo(a) {
|
|
2831
2831
|
if (!a || !li.test(a)) return a;
|
|
2832
2832
|
const t = document.createElement("template");
|
|
2833
2833
|
t.innerHTML = a;
|
|
@@ -2846,7 +2846,7 @@ function Do(a) {
|
|
|
2846
2846
|
}), t.innerHTML;
|
|
2847
2847
|
}
|
|
2848
2848
|
function _t(a) {
|
|
2849
|
-
return a ?
|
|
2849
|
+
return a ? Oo(a.innerHTML) : "";
|
|
2850
2850
|
}
|
|
2851
2851
|
const Vt = class Vt {
|
|
2852
2852
|
/**
|
|
@@ -3112,14 +3112,14 @@ Vt.EDITOR_DEFAULTS = {
|
|
|
3112
3112
|
let xe = Vt;
|
|
3113
3113
|
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}}';
|
|
3114
3114
|
let Yt;
|
|
3115
|
-
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", To = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", ko = ".rte-content, .editora-content", pi = "Rich text editor", Ae = /* @__PURE__ */ new Set();
|
|
3115
|
+
const di = "__editoraCommandEditorRoot", ui = "__editoraLastCommandButton", To = "editora-editor, [data-editora-editor], .rte-editor, .editora-editor", ko = ".rte-content, .editora-content", pi = "Rich text editor", fi = /* @__PURE__ */ new Set(["collaboration"]), Ae = /* @__PURE__ */ new Set();
|
|
3116
3116
|
let tt = null, xo = !1, Ee = null, we = null;
|
|
3117
3117
|
function Ao(a) {
|
|
3118
3118
|
if (!(a instanceof HTMLElement)) return !1;
|
|
3119
3119
|
const t = a;
|
|
3120
3120
|
return typeof t.execCommand == "function" && (t.tagName.toLowerCase() === "editora-editor" || t.classList.contains("editora-editor") || t.hasAttribute("data-editora-editor"));
|
|
3121
3121
|
}
|
|
3122
|
-
function
|
|
3122
|
+
function hi(a) {
|
|
3123
3123
|
return a ? a.nodeType === Node.ELEMENT_NODE ? a : a.parentElement : null;
|
|
3124
3124
|
}
|
|
3125
3125
|
function Lt(a) {
|
|
@@ -3129,7 +3129,7 @@ function Lt(a) {
|
|
|
3129
3129
|
const t = a.matches(To) ? a : a.closest(To);
|
|
3130
3130
|
return !t || !Ao(t) ? null : t;
|
|
3131
3131
|
}
|
|
3132
|
-
function
|
|
3132
|
+
function mi() {
|
|
3133
3133
|
var i;
|
|
3134
3134
|
if (typeof window == "undefined") return null;
|
|
3135
3135
|
const a = window[di];
|
|
@@ -3154,7 +3154,7 @@ function hi() {
|
|
|
3154
3154
|
}
|
|
3155
3155
|
const o = (i = window.getSelection) == null ? void 0 : i.call(window);
|
|
3156
3156
|
if (o && o.rangeCount > 0) {
|
|
3157
|
-
const r = Lt(
|
|
3157
|
+
const r = Lt(hi(o.getRangeAt(0).startContainer));
|
|
3158
3158
|
if (r) return r;
|
|
3159
3159
|
}
|
|
3160
3160
|
if (tt && tt.isConnected)
|
|
@@ -3163,23 +3163,23 @@ function hi() {
|
|
|
3163
3163
|
if (r.isConnected) return r;
|
|
3164
3164
|
return null;
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function gi() {
|
|
3167
3167
|
if (typeof window == "undefined" || xo) return;
|
|
3168
3168
|
Ee = typeof window.executeEditorCommand == "function" ? window.executeEditorCommand.bind(window) : null, we = typeof window.execEditorCommand == "function" ? window.execEditorCommand.bind(window) : null;
|
|
3169
3169
|
const a = (t, ...e) => {
|
|
3170
|
-
const o =
|
|
3170
|
+
const o = mi();
|
|
3171
3171
|
return o ? o.execCommand(t, ...e) : Ee ? Ee(t, ...e) : we ? we(t, ...e) : !1;
|
|
3172
3172
|
};
|
|
3173
3173
|
window.executeEditorCommand = a, window.execEditorCommand = a, xo = !0;
|
|
3174
3174
|
}
|
|
3175
|
-
function
|
|
3175
|
+
function bi() {
|
|
3176
3176
|
const a = "editora-webcomponent-styles";
|
|
3177
3177
|
if (!document.getElementById(a)) {
|
|
3178
3178
|
const t = document.createElement("style");
|
|
3179
3179
|
t.id = a, t.textContent = ci, document.head.appendChild(t);
|
|
3180
3180
|
}
|
|
3181
3181
|
}
|
|
3182
|
-
function
|
|
3182
|
+
function yi() {
|
|
3183
3183
|
if (!Yt) {
|
|
3184
3184
|
const a = q.__globalPluginLoader;
|
|
3185
3185
|
a ? Yt = a : Yt = new Co();
|
|
@@ -3188,7 +3188,7 @@ function bi() {
|
|
|
3188
3188
|
}
|
|
3189
3189
|
class q extends HTMLElement {
|
|
3190
3190
|
constructor() {
|
|
3191
|
-
if (super(), this.pluginLoader =
|
|
3191
|
+
if (super(), this.pluginLoader = yi(), this.config = {}, this.isInitialized = !1, this.buildGeneration = 0, this.keyboardShortcutManager = new En(), this.lastAutosavedContent = "", this.preservedContent = null, this.loadedPlugins = [], this.lastBeforeInputType = null, this.pendingHistorySnapshot = null, bi(), !this.hasAttribute("data-initial-content")) {
|
|
3192
3192
|
const t = this.innerHTML.trim();
|
|
3193
3193
|
t && this.setAttribute("data-initial-content", t);
|
|
3194
3194
|
}
|
|
@@ -3291,7 +3291,7 @@ class q extends HTMLElement {
|
|
|
3291
3291
|
var r;
|
|
3292
3292
|
if (this.querySelector(".editora-toolbar") || this.isInitialized) return;
|
|
3293
3293
|
const t = ++this.buildGeneration;
|
|
3294
|
-
this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this),
|
|
3294
|
+
this.setAttribute("data-editora-editor", "true"), Ae.add(this), tt || (tt = this), gi(), 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.config.theme && this.classList.add(`editora-theme-${this.config.theme}`), this.setAttribute("data-loading", "true"), this.setAttribute("aria-busy", "true");
|
|
3295
3295
|
const e = await this.loadPlugins();
|
|
3296
3296
|
if (t !== this.buildGeneration || !this.isConnected) return;
|
|
3297
3297
|
if (this.loadedPlugins = e, e.forEach((l) => {
|
|
@@ -3357,8 +3357,10 @@ class q extends HTMLElement {
|
|
|
3357
3357
|
} else {
|
|
3358
3358
|
const r = this.pluginLoader.getRegisteredPluginNames();
|
|
3359
3359
|
for (const l of r) {
|
|
3360
|
-
const c =
|
|
3361
|
-
|
|
3360
|
+
const c = this.getPluginLoadConfig(l);
|
|
3361
|
+
if (fi.has(l) && !c) continue;
|
|
3362
|
+
const p = await this.pluginLoader.load(l, c);
|
|
3363
|
+
p && t.push(p);
|
|
3362
3364
|
}
|
|
3363
3365
|
}
|
|
3364
3366
|
return t;
|
|
@@ -3649,10 +3651,10 @@ class q extends HTMLElement {
|
|
|
3649
3651
|
var c;
|
|
3650
3652
|
if (this.contentElement) {
|
|
3651
3653
|
this.contentElement.focus();
|
|
3652
|
-
const
|
|
3653
|
-
if (!
|
|
3654
|
+
const p = window.getSelection();
|
|
3655
|
+
if (!p || p.rangeCount === 0 || !this.contentElement.contains(p.anchorNode)) {
|
|
3654
3656
|
const m = document.createRange(), g = this.contentElement.lastChild || this.contentElement;
|
|
3655
|
-
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0),
|
|
3657
|
+
g.nodeType === Node.TEXT_NODE ? m.setStart(g, ((c = g.textContent) == null ? void 0 : c.length) || 0) : g.nodeType === Node.ELEMENT_NODE ? (m.selectNodeContents(g), m.collapse(!1)) : m.setStart(this.contentElement, 0), m.collapse(!0), p == null || p.removeAllRanges(), p == null || p.addRange(m);
|
|
3656
3658
|
}
|
|
3657
3659
|
}
|
|
3658
3660
|
return this.executeCommand(r, l);
|
|
@@ -3666,8 +3668,8 @@ class q extends HTMLElement {
|
|
|
3666
3668
|
const r = document.createElement("div");
|
|
3667
3669
|
r.innerHTML = e.trim(), !Array.from(r.childNodes).some((c) => {
|
|
3668
3670
|
if (c.nodeType === Node.ELEMENT_NODE) {
|
|
3669
|
-
const
|
|
3670
|
-
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(
|
|
3671
|
+
const p = c.tagName;
|
|
3672
|
+
return ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "UL", "OL", "BLOCKQUOTE", "PRE"].includes(p);
|
|
3671
3673
|
}
|
|
3672
3674
|
return !1;
|
|
3673
3675
|
}) && e.trim() ? this.contentElement.innerHTML = `<p>${e.trim()}</p>` : this.contentElement.innerHTML = e;
|
|
@@ -3710,9 +3712,9 @@ class q extends HTMLElement {
|
|
|
3710
3712
|
var T;
|
|
3711
3713
|
if (!this.contentElement) return;
|
|
3712
3714
|
let i = this.contentElement.innerHTML;
|
|
3713
|
-
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(),
|
|
3714
|
-
if (this.lastBeforeInputType = null,
|
|
3715
|
-
const E = wo(i, c,
|
|
3715
|
+
const r = (T = o == null ? void 0 : o.detail) == null ? void 0 : T.allowedTags, l = this.getPerformanceConfig(), c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = this.lastBeforeInputType;
|
|
3716
|
+
if (this.lastBeforeInputType = null, p.sanitizeOnInput !== !1 && c.sanitize !== !1 && !m) {
|
|
3717
|
+
const E = wo(i, c, p, r);
|
|
3716
3718
|
if (E !== i) {
|
|
3717
3719
|
const k = window.getSelection(), et = k && k.rangeCount > 0 ? k.getRangeAt(0) : null;
|
|
3718
3720
|
if (this.contentElement.innerHTML = E, et && k)
|
|
@@ -3726,7 +3728,7 @@ class q extends HTMLElement {
|
|
|
3726
3728
|
this.recordInputHistory(i), this.contentChangeDebounceTimer && clearTimeout(this.contentChangeDebounceTimer);
|
|
3727
3729
|
const w = () => {
|
|
3728
3730
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
3729
|
-
detail: { html:
|
|
3731
|
+
detail: { html: Oo(i) },
|
|
3730
3732
|
bubbles: !0
|
|
3731
3733
|
}));
|
|
3732
3734
|
};
|
|
@@ -3741,7 +3743,7 @@ class q extends HTMLElement {
|
|
|
3741
3743
|
o.preventDefault();
|
|
3742
3744
|
const i = this.config.paste || {};
|
|
3743
3745
|
let r = ((g = o.clipboardData) == null ? void 0 : g.getData("text/html")) || "";
|
|
3744
|
-
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(),
|
|
3746
|
+
const l = ((w = o.clipboardData) == null ? void 0 : w.getData("text/plain")) || "", c = this.getContentSanitizeConfig(), p = this.getSecurityConfig(), m = !!r && /class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(r);
|
|
3745
3747
|
if ((i.clean || !i.keepFormatting) && l) {
|
|
3746
3748
|
document.execCommand("insertText", !1, l);
|
|
3747
3749
|
return;
|
|
@@ -3751,7 +3753,7 @@ class q extends HTMLElement {
|
|
|
3751
3753
|
return;
|
|
3752
3754
|
}
|
|
3753
3755
|
if (r) {
|
|
3754
|
-
|
|
3756
|
+
p.sanitizeOnPaste !== !1 && c.sanitize !== !1 && (r = ai(r, c, p)), this.insertHTMLAtSelection(r);
|
|
3755
3757
|
return;
|
|
3756
3758
|
}
|
|
3757
3759
|
l && document.execCommand("insertText", !1, l);
|
|
@@ -3841,14 +3843,14 @@ class q extends HTMLElement {
|
|
|
3841
3843
|
if (t.viewportOnlyScan && !this.isEditorInViewport() && !e)
|
|
3842
3844
|
return;
|
|
3843
3845
|
const o = this.contentElement.textContent || "", { words: i, chars: r } = yn(o), l = bn(this.contentElement);
|
|
3844
|
-
let c,
|
|
3846
|
+
let c, p;
|
|
3845
3847
|
const m = this.getSelectionRangeInEditor();
|
|
3846
|
-
m && (c = mn(this.contentElement, m), m.collapsed || (
|
|
3848
|
+
m && (c = mn(this.contentElement, m), m.collapsed || (p = vn(m, c), c = void 0)), this.statusBar.update({
|
|
3847
3849
|
wordCount: i,
|
|
3848
3850
|
charCount: r,
|
|
3849
3851
|
lineCount: l,
|
|
3850
3852
|
cursorPosition: c,
|
|
3851
|
-
selectionInfo:
|
|
3853
|
+
selectionInfo: p
|
|
3852
3854
|
});
|
|
3853
3855
|
}
|
|
3854
3856
|
/**
|
|
@@ -3997,7 +3999,7 @@ class q extends HTMLElement {
|
|
|
3997
3999
|
}
|
|
3998
4000
|
const Ce = new Co();
|
|
3999
4001
|
q.__globalPluginLoader = Ce;
|
|
4000
|
-
const
|
|
4002
|
+
const vi = {
|
|
4001
4003
|
// Core editing plugins (always loaded)
|
|
4002
4004
|
bold: () => import("./BoldPlugin.native-CSh_LiIJ.mjs").then((a) => a.BoldPlugin()),
|
|
4003
4005
|
italic: () => import("./ItalicPlugin.native-CmnlwFHB.mjs").then((a) => a.ItalicPlugin()),
|
|
@@ -4010,12 +4012,12 @@ const yi = {
|
|
|
4010
4012
|
list: () => import("./ListPlugin.native-UYaoRiub.mjs").then((a) => a.ListPlugin()),
|
|
4011
4013
|
history: () => import("./HistoryPlugin.native-C8GyxsgC.mjs").then((a) => a.HistoryPlugin())
|
|
4012
4014
|
};
|
|
4013
|
-
async function
|
|
4014
|
-
return Object.entries(
|
|
4015
|
+
async function Ei() {
|
|
4016
|
+
return Object.entries(vi).forEach(([a, t]) => {
|
|
4015
4017
|
Ce.register(a, t);
|
|
4016
4018
|
}), Ce;
|
|
4017
4019
|
}
|
|
4018
|
-
typeof window != "undefined" &&
|
|
4020
|
+
typeof window != "undefined" && Ei().then((a) => {
|
|
4019
4021
|
q.__globalPluginLoader = a, customElements.get("editora-editor") || customElements.define("editora-editor", q);
|
|
4020
4022
|
const t = document.querySelectorAll("editora-editor:not([data-initial-content])"), e = [];
|
|
4021
4023
|
t.forEach((o) => {
|
|
@@ -4026,6 +4028,6 @@ typeof window != "undefined" && vi().then((a) => {
|
|
|
4026
4028
|
});
|
|
4027
4029
|
});
|
|
4028
4030
|
export {
|
|
4029
|
-
|
|
4031
|
+
Ei as initWebComponent
|
|
4030
4032
|
};
|
|
4031
4033
|
//# sourceMappingURL=webcomponent-core.js.map
|