@editora/core 1.0.15 → 1.0.17
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/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-XsYC_KdJ.mjs +3923 -0
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +17 -14
- package/dist/plugin-loader.js +53 -52
- package/dist/webcomponent-core.js +2055 -476
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +96 -66
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2223 -643
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1564 -1198
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-BLm1MtzH.js +0 -10
- package/dist/index-Cd9jEuZP.mjs +0 -2341
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { e as hn } from "./escapeHtml-CX8RelZ1.mjs";
|
|
2
|
+
import { i as Tn } from "./dialogHelpers-DBf7WqYH.mjs";
|
|
1
3
|
const {
|
|
2
|
-
entries:
|
|
4
|
+
entries: Ut,
|
|
3
5
|
setPrototypeOf: wt,
|
|
4
|
-
isFrozen:
|
|
5
|
-
getPrototypeOf:
|
|
6
|
-
getOwnPropertyDescriptor:
|
|
6
|
+
isFrozen: bn,
|
|
7
|
+
getPrototypeOf: En,
|
|
8
|
+
getOwnPropertyDescriptor: An
|
|
7
9
|
} = Object;
|
|
8
10
|
let {
|
|
9
11
|
freeze: L,
|
|
10
|
-
seal:
|
|
12
|
+
seal: M,
|
|
11
13
|
create: we
|
|
12
14
|
} = Object, {
|
|
13
15
|
apply: et,
|
|
@@ -16,7 +18,7 @@ let {
|
|
|
16
18
|
L || (L = function(t) {
|
|
17
19
|
return t;
|
|
18
20
|
});
|
|
19
|
-
|
|
21
|
+
M || (M = function(t) {
|
|
20
22
|
return t;
|
|
21
23
|
});
|
|
22
24
|
et || (et = function(t, o) {
|
|
@@ -29,7 +31,7 @@ tt || (tt = function(t) {
|
|
|
29
31
|
i[c - 1] = arguments[c];
|
|
30
32
|
return new t(...i);
|
|
31
33
|
});
|
|
32
|
-
const Re = R(Array.prototype.forEach),
|
|
34
|
+
const Re = R(Array.prototype.forEach), _n = R(Array.prototype.lastIndexOf), Ct = R(Array.prototype.pop), ce = R(Array.prototype.push), yn = R(Array.prototype.splice), Ce = R(String.prototype.toLowerCase), $e = R(String.prototype.toString), qe = R(String.prototype.match), ue = R(String.prototype.replace), vn = R(String.prototype.indexOf), Sn = R(String.prototype.trim), w = R(Object.prototype.hasOwnProperty), x = R(RegExp.prototype.test), pe = xn(TypeError);
|
|
33
35
|
function R(n) {
|
|
34
36
|
return function(t) {
|
|
35
37
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -38,7 +40,7 @@ function R(n) {
|
|
|
38
40
|
return et(n, t, i);
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function xn(n) {
|
|
42
44
|
return function() {
|
|
43
45
|
for (var t = arguments.length, o = new Array(t), i = 0; i < t; i++)
|
|
44
46
|
o[i] = arguments[i];
|
|
@@ -53,58 +55,58 @@ function s(n, t) {
|
|
|
53
55
|
let c = t[i];
|
|
54
56
|
if (typeof c == "string") {
|
|
55
57
|
const u = o(c);
|
|
56
|
-
u !== c && (
|
|
58
|
+
u !== c && (bn(t) || (t[i] = u), c = u);
|
|
57
59
|
}
|
|
58
60
|
n[c] = !0;
|
|
59
61
|
}
|
|
60
62
|
return n;
|
|
61
63
|
}
|
|
62
|
-
function
|
|
64
|
+
function Ln(n) {
|
|
63
65
|
for (let t = 0; t < n.length; t++)
|
|
64
|
-
|
|
66
|
+
w(n, t) || (n[t] = null);
|
|
65
67
|
return n;
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function H(n) {
|
|
68
70
|
const t = we(null);
|
|
69
|
-
for (const [o, i] of
|
|
70
|
-
|
|
71
|
+
for (const [o, i] of Ut(n))
|
|
72
|
+
w(n, o) && (Array.isArray(i) ? t[o] = Ln(i) : i && typeof i == "object" && i.constructor === Object ? t[o] = H(i) : t[o] = i);
|
|
71
73
|
return t;
|
|
72
74
|
}
|
|
73
75
|
function de(n, t) {
|
|
74
76
|
for (; n !== null; ) {
|
|
75
|
-
const i =
|
|
77
|
+
const i = An(n, t);
|
|
76
78
|
if (i) {
|
|
77
79
|
if (i.get)
|
|
78
80
|
return R(i.get);
|
|
79
81
|
if (typeof i.value == "function")
|
|
80
82
|
return R(i.value);
|
|
81
83
|
}
|
|
82
|
-
n =
|
|
84
|
+
n = En(n);
|
|
83
85
|
}
|
|
84
86
|
function o() {
|
|
85
87
|
return null;
|
|
86
88
|
}
|
|
87
89
|
return o;
|
|
88
90
|
}
|
|
89
|
-
const Ot = L(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Xe = L(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]),
|
|
91
|
+
const Ot = L(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Xe = L(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ke = L(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Rn = L(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ze = L(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Dn = L(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Nt = L(["#text"]), Mt = L(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Qe = L(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), It = L(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), De = L(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), wn = M(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Cn = M(/<%[\w\W]*|[\w\W]*%>/gm), On = M(/\$\{[\w\W]*/gm), Nn = M(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mn = M(/^aria-[\-\w]+$/), zt = M(
|
|
90
92
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
91
93
|
// eslint-disable-line no-useless-escape
|
|
92
|
-
),
|
|
94
|
+
), In = M(/^(?:\w+script|data):/i), kn = M(
|
|
93
95
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
94
96
|
// eslint-disable-line no-control-regex
|
|
95
|
-
),
|
|
97
|
+
), Gt = M(/^html$/i), Pn = M(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
96
98
|
var kt = /* @__PURE__ */ Object.freeze({
|
|
97
99
|
__proto__: null,
|
|
98
|
-
ARIA_ATTR:
|
|
99
|
-
ATTR_WHITESPACE:
|
|
100
|
-
CUSTOM_ELEMENT:
|
|
101
|
-
DATA_ATTR:
|
|
102
|
-
DOCTYPE_NAME:
|
|
103
|
-
ERB_EXPR:
|
|
104
|
-
IS_ALLOWED_URI:
|
|
105
|
-
IS_SCRIPT_OR_DATA:
|
|
106
|
-
MUSTACHE_EXPR:
|
|
107
|
-
TMPLIT_EXPR:
|
|
100
|
+
ARIA_ATTR: Mn,
|
|
101
|
+
ATTR_WHITESPACE: kn,
|
|
102
|
+
CUSTOM_ELEMENT: Pn,
|
|
103
|
+
DATA_ATTR: Nn,
|
|
104
|
+
DOCTYPE_NAME: Gt,
|
|
105
|
+
ERB_EXPR: Cn,
|
|
106
|
+
IS_ALLOWED_URI: zt,
|
|
107
|
+
IS_SCRIPT_OR_DATA: In,
|
|
108
|
+
MUSTACHE_EXPR: wn,
|
|
109
|
+
TMPLIT_EXPR: On
|
|
108
110
|
});
|
|
109
111
|
const me = {
|
|
110
112
|
element: 1,
|
|
@@ -113,9 +115,9 @@ const me = {
|
|
|
113
115
|
progressingInstruction: 7,
|
|
114
116
|
comment: 8,
|
|
115
117
|
document: 9
|
|
116
|
-
},
|
|
118
|
+
}, Hn = function() {
|
|
117
119
|
return typeof window == "undefined" ? null : window;
|
|
118
|
-
},
|
|
120
|
+
}, Fn = function(t, o) {
|
|
119
121
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
120
122
|
return null;
|
|
121
123
|
let i = null;
|
|
@@ -124,14 +126,14 @@ const me = {
|
|
|
124
126
|
const u = "dompurify" + (i ? "#" + i : "");
|
|
125
127
|
try {
|
|
126
128
|
return t.createPolicy(u, {
|
|
127
|
-
createHTML(
|
|
128
|
-
return
|
|
129
|
+
createHTML(C) {
|
|
130
|
+
return C;
|
|
129
131
|
},
|
|
130
|
-
createScriptURL(
|
|
131
|
-
return
|
|
132
|
+
createScriptURL(C) {
|
|
133
|
+
return C;
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
|
-
} catch (
|
|
136
|
+
} catch (C) {
|
|
135
137
|
return console.warn("TrustedTypes policy " + u + " could not be created."), null;
|
|
136
138
|
}
|
|
137
139
|
}, Pt = function() {
|
|
@@ -147,9 +149,9 @@ const me = {
|
|
|
147
149
|
uponSanitizeShadowNode: []
|
|
148
150
|
};
|
|
149
151
|
};
|
|
150
|
-
function
|
|
151
|
-
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
152
|
-
const t = (l) =>
|
|
152
|
+
function Wt() {
|
|
153
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Hn();
|
|
154
|
+
const t = (l) => Wt(l);
|
|
153
155
|
if (t.version = "3.3.2", t.removed = [], !n || !n.document || n.document.nodeType !== me.document || !n.Element)
|
|
154
156
|
return t.isSupported = !1, t;
|
|
155
157
|
let {
|
|
@@ -157,46 +159,46 @@ function Gt() {
|
|
|
157
159
|
} = n;
|
|
158
160
|
const i = o, c = i.currentScript, {
|
|
159
161
|
DocumentFragment: u,
|
|
160
|
-
HTMLTemplateElement:
|
|
161
|
-
Node:
|
|
162
|
+
HTMLTemplateElement: C,
|
|
163
|
+
Node: O,
|
|
162
164
|
Element: d,
|
|
163
|
-
NodeFilter:
|
|
164
|
-
NamedNodeMap:
|
|
165
|
-
HTMLFormElement:
|
|
165
|
+
NodeFilter: f,
|
|
166
|
+
NamedNodeMap: I = n.NamedNodeMap || n.MozNamedAttrMap,
|
|
167
|
+
HTMLFormElement: V,
|
|
166
168
|
DOMParser: Oe,
|
|
167
169
|
trustedTypes: Te
|
|
168
|
-
} = n, oe = d.prototype,
|
|
169
|
-
if (typeof
|
|
170
|
+
} = n, oe = d.prototype, Xt = de(oe, "cloneNode"), Kt = de(oe, "remove"), Zt = de(oe, "nextSibling"), Qt = de(oe, "childNodes"), be = de(oe, "parentNode");
|
|
171
|
+
if (typeof C == "function") {
|
|
170
172
|
const l = o.createElement("template");
|
|
171
173
|
l.content && l.content.ownerDocument && (o = l.content.ownerDocument);
|
|
172
174
|
}
|
|
173
175
|
let v, ae = "";
|
|
174
176
|
const {
|
|
175
|
-
implementation:
|
|
176
|
-
createNodeIterator:
|
|
177
|
-
createDocumentFragment:
|
|
178
|
-
getElementsByTagName:
|
|
177
|
+
implementation: Ne,
|
|
178
|
+
createNodeIterator: Jt,
|
|
179
|
+
createDocumentFragment: en,
|
|
180
|
+
getElementsByTagName: tn
|
|
179
181
|
} = o, {
|
|
180
|
-
importNode:
|
|
182
|
+
importNode: nn
|
|
181
183
|
} = i;
|
|
182
184
|
let S = Pt();
|
|
183
|
-
t.isSupported = typeof
|
|
185
|
+
t.isSupported = typeof Ut == "function" && typeof be == "function" && Ne && Ne.createHTMLDocument !== void 0;
|
|
184
186
|
const {
|
|
185
|
-
MUSTACHE_EXPR:
|
|
187
|
+
MUSTACHE_EXPR: Me,
|
|
186
188
|
ERB_EXPR: Ie,
|
|
187
189
|
TMPLIT_EXPR: ke,
|
|
188
|
-
DATA_ATTR:
|
|
189
|
-
ARIA_ATTR:
|
|
190
|
-
IS_SCRIPT_OR_DATA:
|
|
190
|
+
DATA_ATTR: rn,
|
|
191
|
+
ARIA_ATTR: on,
|
|
192
|
+
IS_SCRIPT_OR_DATA: an,
|
|
191
193
|
ATTR_WHITESPACE: at,
|
|
192
|
-
CUSTOM_ELEMENT:
|
|
194
|
+
CUSTOM_ELEMENT: ln
|
|
193
195
|
} = kt;
|
|
194
196
|
let {
|
|
195
197
|
IS_ALLOWED_URI: it
|
|
196
|
-
} = kt,
|
|
197
|
-
const lt = s({}, [...Ot, ...Xe, ...
|
|
198
|
+
} = kt, E = null;
|
|
199
|
+
const lt = s({}, [...Ot, ...Xe, ...Ke, ...Ze, ...Nt]);
|
|
198
200
|
let A = null;
|
|
199
|
-
const st = s({}, [...
|
|
201
|
+
const st = s({}, [...Mt, ...Qe, ...It, ...De]);
|
|
200
202
|
let m = Object.seal(we(null, {
|
|
201
203
|
tagNameCheck: {
|
|
202
204
|
writable: !0,
|
|
@@ -217,7 +219,7 @@ function Gt() {
|
|
|
217
219
|
value: !1
|
|
218
220
|
}
|
|
219
221
|
})), ie = null, Ee = null;
|
|
220
|
-
const
|
|
222
|
+
const B = Object.seal(we(null, {
|
|
221
223
|
tagCheck: {
|
|
222
224
|
writable: !0,
|
|
223
225
|
configurable: !1,
|
|
@@ -231,53 +233,53 @@ function Gt() {
|
|
|
231
233
|
value: null
|
|
232
234
|
}
|
|
233
235
|
}));
|
|
234
|
-
let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ae = !0,
|
|
235
|
-
const
|
|
236
|
-
let Ue = !0, le = !1, X = {},
|
|
236
|
+
let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ae = !0, j = !1, He = !1, Fe = !1, q = !1, _e = !1, ye = !1, dt = !0, mt = !1;
|
|
237
|
+
const sn = "user-content-";
|
|
238
|
+
let Ue = !0, le = !1, X = {}, k = null;
|
|
237
239
|
const ze = s({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
238
240
|
let ft = null;
|
|
239
241
|
const gt = s({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
240
242
|
let Ge = null;
|
|
241
|
-
const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Se = "http://www.w3.org/2000/svg",
|
|
242
|
-
let
|
|
243
|
-
const
|
|
243
|
+
const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Se = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml";
|
|
244
|
+
let K = U, We = !1, Be = null;
|
|
245
|
+
const cn = s({}, [ve, Se, U], $e);
|
|
244
246
|
let xe = s({}, ["mi", "mo", "mn", "ms", "mtext"]), Le = s({}, ["annotation-xml"]);
|
|
245
|
-
const
|
|
247
|
+
const un = s({}, ["title", "style", "font", "a", "script"]);
|
|
246
248
|
let se = null;
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
249
|
+
const pn = ["application/xhtml+xml", "text/html"], dn = "text/html";
|
|
250
|
+
let b = null, Z = null;
|
|
251
|
+
const mn = o.createElement("form"), Tt = function(e) {
|
|
250
252
|
return e instanceof RegExp || e instanceof Function;
|
|
251
|
-
},
|
|
253
|
+
}, Ve = function() {
|
|
252
254
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
253
|
-
if (!(
|
|
254
|
-
if ((!e || typeof e != "object") && (e = {}), e =
|
|
255
|
-
|
|
255
|
+
if (!(Z && Z === e)) {
|
|
256
|
+
if ((!e || typeof e != "object") && (e = {}), e = H(e), se = // eslint-disable-next-line unicorn/prefer-includes
|
|
257
|
+
pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? dn : e.PARSER_MEDIA_TYPE, b = se === "application/xhtml+xml" ? $e : Ce, E = w(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, b) : lt, A = w(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, b) : st, Be = w(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : cn, Ge = w(e, "ADD_URI_SAFE_ATTR") ? s(H(ht), e.ADD_URI_SAFE_ATTR, b) : ht, ft = w(e, "ADD_DATA_URI_TAGS") ? s(H(gt), e.ADD_DATA_URI_TAGS, b) : gt, k = w(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, b) : ze, ie = w(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, b) : H({}), Ee = w(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, b) : H({}), X = w(e, "USE_PROFILES") ? e.USE_PROFILES : !1, ct = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, ut = e.ALLOW_UNKNOWN_PROTOCOLS || !1, pt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, _e = e.RETURN_DOM_FRAGMENT || !1, ye = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, dt = e.SANITIZE_DOM !== !1, mt = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, le = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || zt, K = e.NAMESPACE || U, xe = e.MATHML_TEXT_INTEGRATION_POINTS || xe, Le = e.HTML_INTEGRATION_POINTS || Le, m = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (m.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (m.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (m.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), _e && (q = !0), X && (E = s({}, Nt), A = we(null), X.html === !0 && (s(E, Ot), s(A, Mt)), X.svg === !0 && (s(E, Xe), s(A, Qe), s(A, De)), X.svgFilters === !0 && (s(E, Ke), s(A, Qe), s(A, De)), X.mathMl === !0 && (s(E, Ze), s(A, It), s(A, De))), w(e, "ADD_TAGS") || (B.tagCheck = null), w(e, "ADD_ATTR") || (B.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : (E === lt && (E = H(E)), s(E, e.ADD_TAGS, b))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : (A === st && (A = H(A)), s(A, e.ADD_ATTR, b))), e.ADD_URI_SAFE_ATTR && s(Ge, e.ADD_URI_SAFE_ATTR, b), e.FORBID_CONTENTS && (k === ze && (k = H(k)), s(k, e.FORBID_CONTENTS, b)), e.ADD_FORBID_CONTENTS && (k === ze && (k = H(k)), s(k, e.ADD_FORBID_CONTENTS, b)), Ue && (E["#text"] = !0), j && s(E, ["html", "head", "body"]), E.table && (s(E, ["tbody"]), delete ie.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
256
258
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
257
259
|
throw pe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
258
260
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
259
261
|
throw pe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
260
262
|
v = e.TRUSTED_TYPES_POLICY, ae = v.createHTML("");
|
|
261
263
|
} else
|
|
262
|
-
v === void 0 && (v =
|
|
263
|
-
L && L(e),
|
|
264
|
+
v === void 0 && (v = Fn(Te, c)), v !== null && typeof ae == "string" && (ae = v.createHTML(""));
|
|
265
|
+
L && L(e), Z = e;
|
|
264
266
|
}
|
|
265
|
-
}, bt = s({}, [...Xe, ...
|
|
267
|
+
}, bt = s({}, [...Xe, ...Ke, ...Rn]), Et = s({}, [...Ze, ...Dn]), fn = function(e) {
|
|
266
268
|
let r = be(e);
|
|
267
269
|
(!r || !r.tagName) && (r = {
|
|
268
|
-
namespaceURI:
|
|
270
|
+
namespaceURI: K,
|
|
269
271
|
tagName: "template"
|
|
270
272
|
});
|
|
271
273
|
const a = Ce(e.tagName), p = Ce(r.tagName);
|
|
272
|
-
return Be[e.namespaceURI] ? e.namespaceURI === Se ? r.namespaceURI ===
|
|
273
|
-
},
|
|
274
|
+
return Be[e.namespaceURI] ? e.namespaceURI === Se ? r.namespaceURI === U ? a === "svg" : r.namespaceURI === ve ? a === "svg" && (p === "annotation-xml" || xe[p]) : !!bt[a] : e.namespaceURI === ve ? r.namespaceURI === U ? a === "math" : r.namespaceURI === Se ? a === "math" && Le[p] : !!Et[a] : e.namespaceURI === U ? r.namespaceURI === Se && !Le[p] || r.namespaceURI === ve && !xe[p] ? !1 : !Et[a] && (un[a] || !bt[a]) : !!(se === "application/xhtml+xml" && Be[e.namespaceURI]) : !1;
|
|
275
|
+
}, P = function(e) {
|
|
274
276
|
ce(t.removed, {
|
|
275
277
|
element: e
|
|
276
278
|
});
|
|
277
279
|
try {
|
|
278
280
|
be(e).removeChild(e);
|
|
279
281
|
} catch (r) {
|
|
280
|
-
|
|
282
|
+
Kt(e);
|
|
281
283
|
}
|
|
282
284
|
}, Y = function(e, r) {
|
|
283
285
|
try {
|
|
@@ -294,7 +296,7 @@ function Gt() {
|
|
|
294
296
|
if (r.removeAttribute(e), e === "is")
|
|
295
297
|
if (q || _e)
|
|
296
298
|
try {
|
|
297
|
-
|
|
299
|
+
P(r);
|
|
298
300
|
} catch (a) {
|
|
299
301
|
}
|
|
300
302
|
else
|
|
@@ -304,82 +306,82 @@ function Gt() {
|
|
|
304
306
|
}
|
|
305
307
|
}, At = function(e) {
|
|
306
308
|
let r = null, a = null;
|
|
307
|
-
if (
|
|
309
|
+
if (Fe)
|
|
308
310
|
e = "<remove></remove>" + e;
|
|
309
311
|
else {
|
|
310
|
-
const
|
|
311
|
-
a =
|
|
312
|
+
const g = qe(e, /^[\r\n\t ]+/);
|
|
313
|
+
a = g && g[0];
|
|
312
314
|
}
|
|
313
|
-
se === "application/xhtml+xml" &&
|
|
315
|
+
se === "application/xhtml+xml" && K === U && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
314
316
|
const p = v ? v.createHTML(e) : e;
|
|
315
|
-
if (
|
|
317
|
+
if (K === U)
|
|
316
318
|
try {
|
|
317
319
|
r = new Oe().parseFromString(p, se);
|
|
318
|
-
} catch (
|
|
320
|
+
} catch (g) {
|
|
319
321
|
}
|
|
320
322
|
if (!r || !r.documentElement) {
|
|
321
|
-
r =
|
|
323
|
+
r = Ne.createDocument(K, "template", null);
|
|
322
324
|
try {
|
|
323
325
|
r.documentElement.innerHTML = We ? ae : p;
|
|
324
|
-
} catch (
|
|
326
|
+
} catch (g) {
|
|
325
327
|
}
|
|
326
328
|
}
|
|
327
329
|
const y = r.body || r.documentElement;
|
|
328
|
-
return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null),
|
|
330
|
+
return e && a && y.insertBefore(o.createTextNode(a), y.childNodes[0] || null), K === U ? tn.call(r, j ? "html" : "body")[0] : j ? r.documentElement : y;
|
|
329
331
|
}, _t = function(e) {
|
|
330
|
-
return
|
|
332
|
+
return Jt.call(
|
|
331
333
|
e.ownerDocument || e,
|
|
332
334
|
e,
|
|
333
335
|
// eslint-disable-next-line no-bitwise
|
|
334
|
-
|
|
336
|
+
f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
|
|
335
337
|
null
|
|
336
338
|
);
|
|
337
|
-
},
|
|
338
|
-
return e instanceof
|
|
339
|
+
}, je = function(e) {
|
|
340
|
+
return e instanceof V && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof I) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
339
341
|
}, yt = function(e) {
|
|
340
|
-
return typeof
|
|
342
|
+
return typeof O == "function" && e instanceof O;
|
|
341
343
|
};
|
|
342
|
-
function
|
|
344
|
+
function z(l, e, r) {
|
|
343
345
|
Re(l, (a) => {
|
|
344
|
-
a.call(t, e, r,
|
|
346
|
+
a.call(t, e, r, Z);
|
|
345
347
|
});
|
|
346
348
|
}
|
|
347
349
|
const vt = function(e) {
|
|
348
350
|
let r = null;
|
|
349
|
-
if (
|
|
350
|
-
return
|
|
351
|
-
const a =
|
|
352
|
-
if (
|
|
351
|
+
if (z(S.beforeSanitizeElements, e, null), je(e))
|
|
352
|
+
return P(e), !0;
|
|
353
|
+
const a = b(e.nodeName);
|
|
354
|
+
if (z(S.uponSanitizeElement, e, {
|
|
353
355
|
tagName: a,
|
|
354
|
-
allowedTags:
|
|
356
|
+
allowedTags: E
|
|
355
357
|
}), Ae && e.hasChildNodes() && !yt(e.firstElementChild) && x(/<[/\w!]/g, e.innerHTML) && x(/<[/\w!]/g, e.textContent) || e.nodeType === me.progressingInstruction || Ae && e.nodeType === me.comment && x(/<[/\w]/g, e.data))
|
|
356
|
-
return
|
|
357
|
-
if (!(
|
|
358
|
+
return P(e), !0;
|
|
359
|
+
if (!(B.tagCheck instanceof Function && B.tagCheck(a)) && (!E[a] || ie[a])) {
|
|
358
360
|
if (!ie[a] && xt(a) && (m.tagNameCheck instanceof RegExp && x(m.tagNameCheck, a) || m.tagNameCheck instanceof Function && m.tagNameCheck(a)))
|
|
359
361
|
return !1;
|
|
360
|
-
if (Ue && !
|
|
361
|
-
const p = be(e) || e.parentNode, y =
|
|
362
|
+
if (Ue && !k[a]) {
|
|
363
|
+
const p = be(e) || e.parentNode, y = Qt(e) || e.childNodes;
|
|
362
364
|
if (y && p) {
|
|
363
|
-
const
|
|
364
|
-
for (let D =
|
|
365
|
-
const
|
|
366
|
-
|
|
365
|
+
const g = y.length;
|
|
366
|
+
for (let D = g - 1; D >= 0; --D) {
|
|
367
|
+
const G = Xt(y[D], !0);
|
|
368
|
+
G.__removalCount = (e.__removalCount || 0) + 1, p.insertBefore(G, Zt(e));
|
|
367
369
|
}
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
|
-
return
|
|
372
|
+
return P(e), !0;
|
|
371
373
|
}
|
|
372
|
-
return e instanceof d && !
|
|
374
|
+
return e instanceof d && !fn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (P(e), !0) : ($ && e.nodeType === me.text && (r = e.textContent, Re([Me, Ie, ke], (p) => {
|
|
373
375
|
r = ue(r, p, " ");
|
|
374
376
|
}), e.textContent !== r && (ce(t.removed, {
|
|
375
377
|
element: e.cloneNode()
|
|
376
|
-
}), e.textContent = r)),
|
|
378
|
+
}), e.textContent = r)), z(S.afterSanitizeElements, e, null), !1);
|
|
377
379
|
}, St = function(e, r, a) {
|
|
378
|
-
if (Ee[r] || dt && (r === "id" || r === "name") && (a in o || a in
|
|
380
|
+
if (Ee[r] || dt && (r === "id" || r === "name") && (a in o || a in mn))
|
|
379
381
|
return !1;
|
|
380
|
-
if (!(Pe && !Ee[r] && x(
|
|
381
|
-
if (!(ct && x(
|
|
382
|
-
if (!(
|
|
382
|
+
if (!(Pe && !Ee[r] && x(rn, r))) {
|
|
383
|
+
if (!(ct && x(on, r))) {
|
|
384
|
+
if (!(B.attributeCheck instanceof Function && B.attributeCheck(r, e))) {
|
|
383
385
|
if (!A[r] || Ee[r]) {
|
|
384
386
|
if (
|
|
385
387
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
@@ -391,8 +393,8 @@ function Gt() {
|
|
|
391
393
|
) return !1;
|
|
392
394
|
} else if (!Ge[r]) {
|
|
393
395
|
if (!x(it, ue(a, at, ""))) {
|
|
394
|
-
if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" &&
|
|
395
|
-
if (!(ut && !x(
|
|
396
|
+
if (!((r === "src" || r === "xlink:href" || r === "href") && e !== "script" && vn(a, "data:") === 0 && ft[e])) {
|
|
397
|
+
if (!(ut && !x(an, ue(a, at, "")))) {
|
|
396
398
|
if (a)
|
|
397
399
|
return !1;
|
|
398
400
|
}
|
|
@@ -404,13 +406,13 @@ function Gt() {
|
|
|
404
406
|
}
|
|
405
407
|
return !0;
|
|
406
408
|
}, xt = function(e) {
|
|
407
|
-
return e !== "annotation-xml" && qe(e,
|
|
409
|
+
return e !== "annotation-xml" && qe(e, ln);
|
|
408
410
|
}, Lt = function(e) {
|
|
409
|
-
|
|
411
|
+
z(S.beforeSanitizeAttributes, e, null);
|
|
410
412
|
const {
|
|
411
413
|
attributes: r
|
|
412
414
|
} = e;
|
|
413
|
-
if (!r ||
|
|
415
|
+
if (!r || je(e))
|
|
414
416
|
return;
|
|
415
417
|
const a = {
|
|
416
418
|
attrName: "",
|
|
@@ -422,35 +424,35 @@ function Gt() {
|
|
|
422
424
|
let p = r.length;
|
|
423
425
|
for (; p--; ) {
|
|
424
426
|
const y = r[p], {
|
|
425
|
-
name:
|
|
427
|
+
name: g,
|
|
426
428
|
namespaceURI: D,
|
|
427
|
-
value:
|
|
428
|
-
} = y, Q =
|
|
429
|
-
let _ =
|
|
430
|
-
if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0,
|
|
431
|
-
Y(
|
|
429
|
+
value: G
|
|
430
|
+
} = y, Q = b(g), Ye = G;
|
|
431
|
+
let _ = g === "value" ? Ye : Sn(Ye);
|
|
432
|
+
if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, z(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(g, e), _ = sn + _), Ae && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, _)) {
|
|
433
|
+
Y(g, e);
|
|
432
434
|
continue;
|
|
433
435
|
}
|
|
434
436
|
if (Q === "attributename" && qe(_, "href")) {
|
|
435
|
-
Y(
|
|
437
|
+
Y(g, e);
|
|
436
438
|
continue;
|
|
437
439
|
}
|
|
438
440
|
if (a.forceKeepAttr)
|
|
439
441
|
continue;
|
|
440
442
|
if (!a.keepAttr) {
|
|
441
|
-
Y(
|
|
443
|
+
Y(g, e);
|
|
442
444
|
continue;
|
|
443
445
|
}
|
|
444
446
|
if (!pt && x(/\/>/i, _)) {
|
|
445
|
-
Y(
|
|
447
|
+
Y(g, e);
|
|
446
448
|
continue;
|
|
447
449
|
}
|
|
448
|
-
$ && Re([
|
|
450
|
+
$ && Re([Me, Ie, ke], (Dt) => {
|
|
449
451
|
_ = ue(_, Dt, " ");
|
|
450
452
|
});
|
|
451
|
-
const Rt =
|
|
453
|
+
const Rt = b(e.nodeName);
|
|
452
454
|
if (!St(Rt, Q, _)) {
|
|
453
|
-
Y(
|
|
455
|
+
Y(g, e);
|
|
454
456
|
continue;
|
|
455
457
|
}
|
|
456
458
|
if (v && typeof Te == "object" && typeof Te.getAttributeType == "function" && !D)
|
|
@@ -466,18 +468,18 @@ function Gt() {
|
|
|
466
468
|
}
|
|
467
469
|
if (_ !== Ye)
|
|
468
470
|
try {
|
|
469
|
-
D ? e.setAttributeNS(D,
|
|
471
|
+
D ? e.setAttributeNS(D, g, _) : e.setAttribute(g, _), je(e) ? P(e) : Ct(t.removed);
|
|
470
472
|
} catch (Dt) {
|
|
471
|
-
Y(
|
|
473
|
+
Y(g, e);
|
|
472
474
|
}
|
|
473
475
|
}
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
+
z(S.afterSanitizeAttributes, e, null);
|
|
477
|
+
}, gn = function l(e) {
|
|
476
478
|
let r = null;
|
|
477
479
|
const a = _t(e);
|
|
478
|
-
for (
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
for (z(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
|
|
481
|
+
z(S.uponSanitizeShadowNode, r, null), vt(r), Lt(r), r.content instanceof u && l(r.content);
|
|
482
|
+
z(S.afterSanitizeShadowDOM, e, null);
|
|
481
483
|
};
|
|
482
484
|
return t.sanitize = function(l) {
|
|
483
485
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, a = null, p = null, y = null;
|
|
@@ -489,55 +491,55 @@ function Gt() {
|
|
|
489
491
|
throw pe("toString is not a function");
|
|
490
492
|
if (!t.isSupported)
|
|
491
493
|
return l;
|
|
492
|
-
if (
|
|
494
|
+
if (He || Ve(e), t.removed = [], typeof l == "string" && (le = !1), le) {
|
|
493
495
|
if (l.nodeName) {
|
|
494
|
-
const
|
|
495
|
-
if (!
|
|
496
|
+
const G = b(l.nodeName);
|
|
497
|
+
if (!E[G] || ie[G])
|
|
496
498
|
throw pe("root node is forbidden and cannot be sanitized in-place");
|
|
497
499
|
}
|
|
498
|
-
} else if (l instanceof
|
|
500
|
+
} else if (l instanceof O)
|
|
499
501
|
r = At("<!---->"), a = r.ownerDocument.importNode(l, !0), a.nodeType === me.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? r = a : r.appendChild(a);
|
|
500
502
|
else {
|
|
501
|
-
if (!q && !$ && !
|
|
503
|
+
if (!q && !$ && !j && // eslint-disable-next-line unicorn/prefer-includes
|
|
502
504
|
l.indexOf("<") === -1)
|
|
503
505
|
return v && ye ? v.createHTML(l) : l;
|
|
504
506
|
if (r = At(l), !r)
|
|
505
507
|
return q ? null : ye ? ae : "";
|
|
506
508
|
}
|
|
507
|
-
r &&
|
|
508
|
-
const
|
|
509
|
-
for (; p =
|
|
510
|
-
vt(p), Lt(p), p.content instanceof u &&
|
|
509
|
+
r && Fe && P(r.firstChild);
|
|
510
|
+
const g = _t(le ? l : r);
|
|
511
|
+
for (; p = g.nextNode(); )
|
|
512
|
+
vt(p), Lt(p), p.content instanceof u && gn(p.content);
|
|
511
513
|
if (le)
|
|
512
514
|
return l;
|
|
513
515
|
if (q) {
|
|
514
516
|
if (_e)
|
|
515
|
-
for (y =
|
|
517
|
+
for (y = en.call(r.ownerDocument); r.firstChild; )
|
|
516
518
|
y.appendChild(r.firstChild);
|
|
517
519
|
else
|
|
518
520
|
y = r;
|
|
519
|
-
return (A.shadowroot || A.shadowrootmode) && (y =
|
|
521
|
+
return (A.shadowroot || A.shadowrootmode) && (y = nn.call(i, y, !0)), y;
|
|
520
522
|
}
|
|
521
|
-
let D =
|
|
522
|
-
return
|
|
523
|
-
` + D), $ && Re([
|
|
524
|
-
D = ue(D,
|
|
523
|
+
let D = j ? r.outerHTML : r.innerHTML;
|
|
524
|
+
return j && E["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(Gt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
|
|
525
|
+
` + D), $ && Re([Me, Ie, ke], (G) => {
|
|
526
|
+
D = ue(D, G, " ");
|
|
525
527
|
}), v && ye ? v.createHTML(D) : D;
|
|
526
528
|
}, t.setConfig = function() {
|
|
527
529
|
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
528
|
-
|
|
530
|
+
Ve(l), He = !0;
|
|
529
531
|
}, t.clearConfig = function() {
|
|
530
|
-
|
|
532
|
+
Z = null, He = !1;
|
|
531
533
|
}, t.isValidAttribute = function(l, e, r) {
|
|
532
|
-
|
|
533
|
-
const a =
|
|
534
|
+
Z || Ve({});
|
|
535
|
+
const a = b(l), p = b(e);
|
|
534
536
|
return St(a, p, r);
|
|
535
537
|
}, t.addHook = function(l, e) {
|
|
536
538
|
typeof e == "function" && ce(S[l], e);
|
|
537
539
|
}, t.removeHook = function(l, e) {
|
|
538
540
|
if (e !== void 0) {
|
|
539
|
-
const r =
|
|
540
|
-
return r === -1 ? void 0 :
|
|
541
|
+
const r = _n(S[l], e);
|
|
542
|
+
return r === -1 ? void 0 : yn(S[l], r, 1)[0];
|
|
541
543
|
}
|
|
542
544
|
return Ct(S[l]);
|
|
543
545
|
}, t.removeHooks = function(l) {
|
|
@@ -546,9 +548,9 @@ function Gt() {
|
|
|
546
548
|
S = Pt();
|
|
547
549
|
}, t;
|
|
548
550
|
}
|
|
549
|
-
var
|
|
550
|
-
let
|
|
551
|
-
function
|
|
551
|
+
var Un = Wt();
|
|
552
|
+
let h = null, N = null, ee = null, T = null, te = "", ne = "", fe = "insert", ge = null, F = null, J = null;
|
|
553
|
+
function Bt(n, t) {
|
|
552
554
|
if (t === n.innerHTML) return;
|
|
553
555
|
const o = window.execEditorCommand || window.executeEditorCommand;
|
|
554
556
|
if (typeof o == "function")
|
|
@@ -557,7 +559,7 @@ function Wt(n, t) {
|
|
|
557
559
|
} catch (i) {
|
|
558
560
|
}
|
|
559
561
|
}
|
|
560
|
-
function
|
|
562
|
+
function zn(n) {
|
|
561
563
|
if (!n) return null;
|
|
562
564
|
let t = n.startContainer;
|
|
563
565
|
for (; t && t !== document.body; ) {
|
|
@@ -570,7 +572,7 @@ function Fn(n) {
|
|
|
570
572
|
}
|
|
571
573
|
return null;
|
|
572
574
|
}
|
|
573
|
-
const
|
|
575
|
+
const Gn = [
|
|
574
576
|
{
|
|
575
577
|
id: "formal-letter",
|
|
576
578
|
name: "Formal Letter",
|
|
@@ -641,12 +643,10 @@ const Hn = [
|
|
|
641
643
|
<h3>Q: What are the requirements?</h3>
|
|
642
644
|
<p>A: [Answer here]</p>`
|
|
643
645
|
}
|
|
644
|
-
]
|
|
645
|
-
let re = [...Hn];
|
|
646
|
-
const Bt = () => re, Zn = (n) => re.filter((t) => t.category === n), jt = () => {
|
|
646
|
+
], re = [...Gn], Vt = () => re, nr = (n) => re.filter((t) => t.category === n), jt = () => {
|
|
647
647
|
const n = new Set(re.map((t) => t.category));
|
|
648
648
|
return Array.from(n);
|
|
649
|
-
},
|
|
649
|
+
}, Wn = (n) => {
|
|
650
650
|
const t = n.toLowerCase();
|
|
651
651
|
return re.filter(
|
|
652
652
|
(o) => {
|
|
@@ -654,45 +654,45 @@ const Bt = () => re, Zn = (n) => re.filter((t) => t.category === n), jt = () =>
|
|
|
654
654
|
return o.name.toLowerCase().includes(t) || ((i = o.description) == null ? void 0 : i.toLowerCase().includes(t)) || ((c = o.tags) == null ? void 0 : c.some((u) => u.toLowerCase().includes(t)));
|
|
655
655
|
}
|
|
656
656
|
);
|
|
657
|
-
},
|
|
657
|
+
}, Yt = (n) => Un.sanitize(n, {
|
|
658
658
|
ALLOWED_TAGS: ["p", "br", "strong", "em", "u", "h1", "h2", "h3", "h4", "ul", "ol", "li", "blockquote", "table", "thead", "tbody", "tr", "th", "td", "a", "span"],
|
|
659
659
|
ALLOWED_ATTR: ["href", "target", "class", "data-key", "data-category"]
|
|
660
|
-
}),
|
|
661
|
-
function
|
|
662
|
-
|
|
660
|
+
}), rr = (n) => re.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (re.push(n), !0), or = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
|
|
661
|
+
function Bn(n) {
|
|
662
|
+
N && W(), N = document.createElement("div"), Tn(N), N.className = "rte-dialog-overlay", Yn(n) && N.classList.add("rte-ui-theme-dark"), N.addEventListener("click", () => W()), h = document.createElement("div"), h.className = "rte-dialog rte-template-dialog", h.addEventListener("click", (o) => o.stopPropagation());
|
|
663
663
|
const t = jt();
|
|
664
|
-
t.length > 0 && !te && (te = t[0]), he(),
|
|
664
|
+
t.length > 0 && !te && (te = t[0]), he(), N.appendChild(h), document.body.appendChild(N), Vn(), Jn();
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
n.key === "Escape" && (!
|
|
666
|
+
function Vn() {
|
|
667
|
+
$t(), ge = (n) => {
|
|
668
|
+
n.key === "Escape" && (!N || !h || (n.preventDefault(), n.stopPropagation(), W()));
|
|
669
669
|
}, document.addEventListener("keydown", ge, !0);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function $t() {
|
|
672
672
|
ge && (document.removeEventListener("keydown", ge, !0), ge = null);
|
|
673
673
|
}
|
|
674
|
-
const
|
|
674
|
+
const jn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
|
|
675
675
|
const n = window.getSelection();
|
|
676
676
|
if (!n || n.rangeCount === 0) return null;
|
|
677
677
|
const t = n.anchorNode, o = t instanceof HTMLElement ? t : t == null ? void 0 : t.parentElement;
|
|
678
678
|
return (o == null ? void 0 : o.closest(
|
|
679
679
|
".rte-content, .editora-content"
|
|
680
680
|
)) || null;
|
|
681
|
-
},
|
|
681
|
+
}, Yn = (n) => {
|
|
682
682
|
const t = n || nt();
|
|
683
|
-
return t ? !!t.closest(
|
|
683
|
+
return t ? !!t.closest(jn) : !1;
|
|
684
684
|
};
|
|
685
685
|
function rt() {
|
|
686
|
-
const n =
|
|
686
|
+
const n = zn(ee);
|
|
687
687
|
if (n) return n;
|
|
688
688
|
if (J != null && J.isConnected) return J;
|
|
689
689
|
const t = nt();
|
|
690
690
|
return t || document.querySelector(".rte-content, .editora-content");
|
|
691
691
|
}
|
|
692
692
|
function he() {
|
|
693
|
-
if (!
|
|
693
|
+
if (!h) return;
|
|
694
694
|
const n = jt(), t = ot();
|
|
695
|
-
|
|
695
|
+
h.innerHTML = `
|
|
696
696
|
<div class="rte-dialog-header">
|
|
697
697
|
<h2>Insert Template</h2>
|
|
698
698
|
<button class="rte-dialog-close" aria-label="Close">✕</button>
|
|
@@ -703,7 +703,7 @@ function he() {
|
|
|
703
703
|
<input
|
|
704
704
|
type="text"
|
|
705
705
|
placeholder="Search templates..."
|
|
706
|
-
value="${ne}"
|
|
706
|
+
value="${hn(ne)}"
|
|
707
707
|
class="rte-input rte-template-search"
|
|
708
708
|
aria-label="Search templates"
|
|
709
709
|
/>
|
|
@@ -721,7 +721,7 @@ function he() {
|
|
|
721
721
|
<div class="rte-template-list">
|
|
722
722
|
${t.length > 0 ? t.map((o) => `
|
|
723
723
|
<div
|
|
724
|
-
class="rte-template-item ${(
|
|
724
|
+
class="rte-template-item ${(T == null ? void 0 : T.id) === o.id ? "selected" : ""}"
|
|
725
725
|
data-template-id="${o.id}"
|
|
726
726
|
>
|
|
727
727
|
<div class="template-name">${o.name}</div>
|
|
@@ -731,10 +731,10 @@ function he() {
|
|
|
731
731
|
</div>
|
|
732
732
|
|
|
733
733
|
<!-- Preview -->
|
|
734
|
-
${
|
|
734
|
+
${T ? `
|
|
735
735
|
<div class="rte-template-preview">
|
|
736
736
|
<strong>Preview:</strong>
|
|
737
|
-
<div class="template-preview-content">${
|
|
737
|
+
<div class="template-preview-content">${T.html}</div>
|
|
738
738
|
</div>
|
|
739
739
|
` : ""}
|
|
740
740
|
|
|
@@ -753,15 +753,15 @@ function he() {
|
|
|
753
753
|
|
|
754
754
|
<div class="rte-dialog-footer">
|
|
755
755
|
<button class="rte-button-secondary rte-cancel-btn">Cancel</button>
|
|
756
|
-
<button class="rte-button-primary rte-insert-btn" ${
|
|
756
|
+
<button class="rte-button-primary rte-insert-btn" ${T ? "" : "disabled"}>
|
|
757
757
|
${fe === "insert" ? "Insert" : "Replace"}
|
|
758
758
|
</button>
|
|
759
759
|
</div>
|
|
760
|
-
`,
|
|
760
|
+
`, qn();
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
if (!
|
|
764
|
-
|
|
762
|
+
function $n() {
|
|
763
|
+
if (!h) return;
|
|
764
|
+
h.innerHTML = `
|
|
765
765
|
<div class="rte-dialog-header">
|
|
766
766
|
<h2>Replace Document?</h2>
|
|
767
767
|
</div>
|
|
@@ -773,77 +773,101 @@ function jn() {
|
|
|
773
773
|
<button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
|
|
774
774
|
</div>
|
|
775
775
|
`;
|
|
776
|
-
const n =
|
|
777
|
-
n == null || n.addEventListener("click", () => he()), t == null || t.addEventListener("click", () =>
|
|
776
|
+
const n = h.querySelector(".rte-cancel-warning-btn"), t = h.querySelector(".rte-confirm-replace-btn");
|
|
777
|
+
n == null || n.addEventListener("click", () => he()), t == null || t.addEventListener("click", () => Xn());
|
|
778
778
|
}
|
|
779
779
|
function ot() {
|
|
780
|
-
const n =
|
|
781
|
-
return ne.trim() ?
|
|
780
|
+
const n = Vt();
|
|
781
|
+
return ne.trim() ? Wn(ne) : te ? n.filter((t) => t.category === te) : n;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
if (!
|
|
785
|
-
const n =
|
|
783
|
+
function qn() {
|
|
784
|
+
if (!h) return;
|
|
785
|
+
const n = h.querySelector(".rte-dialog-close");
|
|
786
786
|
n == null || n.addEventListener("click", () => W());
|
|
787
|
-
const t =
|
|
787
|
+
const t = h.querySelector(".rte-cancel-btn");
|
|
788
788
|
t == null || t.addEventListener("click", () => W());
|
|
789
|
-
const o =
|
|
789
|
+
const o = h.querySelector(".rte-insert-btn");
|
|
790
790
|
o == null || o.addEventListener("click", () => Je());
|
|
791
|
-
const i =
|
|
791
|
+
const i = h.querySelector(".rte-template-search");
|
|
792
792
|
i == null || i.addEventListener("input", (d) => {
|
|
793
|
-
|
|
794
|
-
|
|
793
|
+
F !== null && cancelAnimationFrame(F), ne = d.target.value, F = requestAnimationFrame(() => {
|
|
794
|
+
F = null, Ht();
|
|
795
795
|
});
|
|
796
796
|
}), i == null || i.addEventListener("keydown", (d) => {
|
|
797
|
-
d.key === "Enter" &&
|
|
797
|
+
d.key === "Enter" && T ? Je() : d.key === "Escape" && W();
|
|
798
798
|
});
|
|
799
|
-
const c =
|
|
799
|
+
const c = h.querySelector(".rte-tabs");
|
|
800
800
|
c == null || c.addEventListener("click", (d) => {
|
|
801
|
-
const
|
|
802
|
-
if (!
|
|
803
|
-
const
|
|
804
|
-
|
|
801
|
+
const I = d.target.closest(".rte-tab");
|
|
802
|
+
if (!I) return;
|
|
803
|
+
const V = I.getAttribute("data-category");
|
|
804
|
+
V && (te = V, ne = "", F !== null && (cancelAnimationFrame(F), F = null), Ht());
|
|
805
805
|
});
|
|
806
|
-
const u =
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
809
|
-
const
|
|
810
|
-
return
|
|
806
|
+
const u = h.querySelector(".rte-template-list"), C = (d) => {
|
|
807
|
+
const I = d.target.closest(".rte-template-item");
|
|
808
|
+
if (!I) return null;
|
|
809
|
+
const V = I.getAttribute("data-template-id");
|
|
810
|
+
return V && Vt().find((Oe) => Oe.id === V) || null;
|
|
811
811
|
};
|
|
812
812
|
u == null || u.addEventListener("click", (d) => {
|
|
813
|
-
const
|
|
814
|
-
|
|
813
|
+
const f = C(d);
|
|
814
|
+
f && (T = f, he());
|
|
815
815
|
}), u == null || u.addEventListener("dblclick", (d) => {
|
|
816
|
-
const
|
|
817
|
-
|
|
816
|
+
const f = C(d);
|
|
817
|
+
f && (T = f, Je());
|
|
818
818
|
});
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
!
|
|
819
|
+
const O = h.querySelector(".rte-insert-mode");
|
|
820
|
+
O == null || O.addEventListener("change", (d) => {
|
|
821
|
+
const f = d.target;
|
|
822
|
+
!f || f.name !== "insertMode" || (fe = f.value, he());
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Ht() {
|
|
826
826
|
const n = ot();
|
|
827
|
-
n.length > 0 ? (!
|
|
827
|
+
n.length > 0 ? (!T || !n.find((t) => t.id === T.id)) && (T = n[0]) : T = null, he();
|
|
828
828
|
}
|
|
829
829
|
function Je() {
|
|
830
830
|
var n;
|
|
831
|
-
if (
|
|
831
|
+
if (T)
|
|
832
832
|
if (fe === "replace") {
|
|
833
833
|
const t = rt();
|
|
834
834
|
if ((n = t == null ? void 0 : t.innerHTML) != null && n.trim()) {
|
|
835
|
-
|
|
835
|
+
$n();
|
|
836
836
|
return;
|
|
837
837
|
}
|
|
838
|
-
|
|
838
|
+
qt(T), W();
|
|
839
839
|
} else
|
|
840
|
-
|
|
840
|
+
Zn(T), W();
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
842
|
+
function Xn() {
|
|
843
|
+
T && (qt(T), W());
|
|
844
844
|
}
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
const Kn = /* @__PURE__ */ new Set([
|
|
846
|
+
"DIV",
|
|
847
|
+
"P",
|
|
848
|
+
"BLOCKQUOTE",
|
|
849
|
+
"PRE",
|
|
850
|
+
"H1",
|
|
851
|
+
"H2",
|
|
852
|
+
"H3",
|
|
853
|
+
"H4",
|
|
854
|
+
"H5",
|
|
855
|
+
"H6",
|
|
856
|
+
"LI",
|
|
857
|
+
"TD",
|
|
858
|
+
"TH"
|
|
859
|
+
]);
|
|
860
|
+
function Ft(n, t) {
|
|
861
|
+
let o = n;
|
|
862
|
+
for (; o && o !== t; ) {
|
|
863
|
+
if (o.nodeType === Node.ELEMENT_NODE && Kn.has(o.tagName))
|
|
864
|
+
return o;
|
|
865
|
+
o = o.parentNode;
|
|
866
|
+
}
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
function Zn(n) {
|
|
870
|
+
var f;
|
|
847
871
|
const t = window.getSelection();
|
|
848
872
|
if (!t) return;
|
|
849
873
|
const o = rt();
|
|
@@ -851,34 +875,36 @@ function $n(n) {
|
|
|
851
875
|
if (ee)
|
|
852
876
|
t.removeAllRanges(), t.addRange(ee);
|
|
853
877
|
else {
|
|
854
|
-
const
|
|
855
|
-
|
|
878
|
+
const I = document.createRange();
|
|
879
|
+
I.selectNodeContents(o), I.collapse(!1), t.removeAllRanges(), t.addRange(I);
|
|
856
880
|
}
|
|
857
881
|
if (t.rangeCount === 0) return;
|
|
858
|
-
const i = t.getRangeAt(0), c = (
|
|
859
|
-
i.deleteContents()
|
|
860
|
-
const
|
|
861
|
-
|
|
882
|
+
const i = t.getRangeAt(0), c = (f = o == null ? void 0 : o.innerHTML) != null ? f : "", u = document.createRange().createContextualFragment(Yt(n.html));
|
|
883
|
+
i.deleteContents();
|
|
884
|
+
const C = u.lastChild, O = Ft(i.endContainer, o) || Ft(i.startContainer, o);
|
|
885
|
+
O && O.parentNode ? O.parentNode.insertBefore(u, O.nextSibling) : i.insertNode(u);
|
|
886
|
+
const d = document.createRange();
|
|
887
|
+
C ? d.setStartAfter(C) : d.setStartAfter(i.endContainer), d.collapse(!0), t.removeAllRanges(), t.addRange(d), o && (Bt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
862
888
|
}
|
|
863
|
-
function
|
|
889
|
+
function qt(n) {
|
|
864
890
|
const t = rt();
|
|
865
891
|
if (t) {
|
|
866
892
|
const o = t.innerHTML;
|
|
867
|
-
t.innerHTML =
|
|
893
|
+
t.innerHTML = Yt(n.html), Bt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
868
894
|
}
|
|
869
895
|
}
|
|
870
896
|
function W() {
|
|
871
|
-
|
|
897
|
+
$t(), F !== null && (cancelAnimationFrame(F), F = null), N && (N.remove(), N = null), h = null, ee = null, ne = "", J = null;
|
|
872
898
|
}
|
|
873
|
-
function
|
|
899
|
+
function Qn(n) {
|
|
874
900
|
const t = window.getSelection();
|
|
875
901
|
t && t.rangeCount > 0 ? ee = t.getRangeAt(0).cloneRange() : ee = null;
|
|
876
902
|
const o = ot();
|
|
877
|
-
o.length > 0 && !
|
|
903
|
+
o.length > 0 && !T && (T = o[0]);
|
|
878
904
|
const i = (n == null ? void 0 : n.contentElement) instanceof HTMLElement ? n.contentElement : nt();
|
|
879
|
-
J = i || null,
|
|
905
|
+
J = i || null, Bn(i);
|
|
880
906
|
}
|
|
881
|
-
function
|
|
907
|
+
function Jn() {
|
|
882
908
|
if (typeof document == "undefined") return;
|
|
883
909
|
const n = "template-plugin-dialog-styles";
|
|
884
910
|
if (document.getElementById(n)) return;
|
|
@@ -1122,7 +1148,7 @@ function Xn() {
|
|
|
1122
1148
|
}
|
|
1123
1149
|
`, document.head.appendChild(t);
|
|
1124
1150
|
}
|
|
1125
|
-
const
|
|
1151
|
+
const ar = () => ({
|
|
1126
1152
|
name: "template",
|
|
1127
1153
|
toolbar: [
|
|
1128
1154
|
{
|
|
@@ -1132,19 +1158,19 @@ const Jn = () => ({
|
|
|
1132
1158
|
}
|
|
1133
1159
|
],
|
|
1134
1160
|
commands: {
|
|
1135
|
-
insertTemplate: (n, t) => (
|
|
1161
|
+
insertTemplate: (n, t) => (Qn(t), !0)
|
|
1136
1162
|
},
|
|
1137
1163
|
keymap: {}
|
|
1138
1164
|
});
|
|
1139
1165
|
export {
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1166
|
+
Gn as PREDEFINED_TEMPLATES,
|
|
1167
|
+
ar as TemplatePlugin,
|
|
1168
|
+
rr as addCustomTemplate,
|
|
1169
|
+
Vt as getAllTemplates,
|
|
1144
1170
|
jt as getTemplateCategories,
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1171
|
+
nr as getTemplatesByCategory,
|
|
1172
|
+
Yt as sanitizeTemplate,
|
|
1173
|
+
Wn as searchTemplates,
|
|
1174
|
+
or as validateTemplate
|
|
1149
1175
|
};
|
|
1150
|
-
//# sourceMappingURL=TemplatePlugin.native-
|
|
1176
|
+
//# sourceMappingURL=TemplatePlugin.native-D6n5RUnC.mjs.map
|