@editora/plugins 1.0.16 → 1.0.18
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/CodePlugin.native-Bwf25lLX.js +460 -0
- package/dist/CodePlugin.native-Cpp4u3Jl.mjs +648 -0
- package/dist/a11y-checker.cjs.js +16 -16
- package/dist/a11y-checker.esm.js +79 -75
- package/dist/anchor.cjs.js +9 -9
- package/dist/anchor.esm.js +61 -60
- package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
- package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
- package/dist/approval-workflow.cjs.js +5 -5
- package/dist/approval-workflow.esm.js +105 -104
- package/dist/background-color.cjs.js +1 -1
- package/dist/background-color.esm.js +1 -1
- package/dist/blocks-library.cjs.js +6 -6
- package/dist/blocks-library.esm.js +226 -202
- package/dist/capitalization.cjs.js +1 -1
- package/dist/capitalization.esm.js +9 -4
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +154 -116
- package/dist/citations.cjs.js +43 -18
- package/dist/citations.esm.js +465 -446
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +21 -20
- package/dist/code-sample.cjs.js +85 -66
- package/dist/code-sample.esm.js +301 -190
- package/dist/code.cjs.js +1 -669
- package/dist/code.esm.js +2 -4560
- package/dist/collaboration.cjs.js +68 -0
- package/dist/collaboration.esm.js +7428 -0
- package/dist/comments.cjs.js +11 -11
- package/dist/comments.esm.js +284 -237
- package/dist/conditional-content.cjs.js +67 -60
- package/dist/conditional-content.esm.js +270 -220
- package/dist/data-binding.cjs.js +3 -3
- package/dist/data-binding.esm.js +28 -27
- package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
- package/dist/dialogHelpers-zU6zpMIA.js +12 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/{documentManager-Jf0RbSks.js → documentManager-BDz6tovy.js} +2 -2
- package/dist/{documentManager-CTqRftU8.mjs → documentManager-yjRBab4v.mjs} +3 -3
- package/dist/embed-iframe.cjs.js +37 -17
- package/dist/embed-iframe.esm.js +188 -143
- package/dist/emojis.cjs.js +13 -10
- package/dist/emojis.esm.js +288 -76
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +9 -7
- package/dist/escapeHtml-D2Zh82pD.js +1 -0
- package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +48 -41
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +67 -60
- package/dist/format-painter.cjs.js +1 -1
- package/dist/format-painter.esm.js +2 -1
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +40 -36
- package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
- package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
- package/dist/index-Bm1eqYHh.mjs +194 -0
- package/dist/index-CoflqYuK.js +30 -0
- package/dist/index-CxhJLMPS.js +221 -0
- package/dist/{index-D3CycEFU.mjs → index-Di1ZqIDs.mjs} +6420 -6232
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-DQ78mYYo.mjs → index.es-B7pVaNEV.mjs} +1558 -1542
- package/dist/{index.es-CE_A4QSm.js → index.es-I9N4o4Iq.js} +5 -5
- package/dist/index.esm.js +17 -15
- package/dist/{jspdf.es.min-BoS80556.js → jspdf.es.min-B5Idu0Wl.js} +2 -2
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-BCzHIwvz.mjs} +3 -2
- package/dist/link.cjs.js +17 -13
- package/dist/link.esm.js +138 -69
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +66 -33
- package/dist/math.cjs.js +22 -22
- package/dist/math.esm.js +221 -126
- package/dist/media-manager.cjs.js +12 -12
- package/dist/media-manager.esm.js +55 -50
- package/dist/mentions.cjs.js +2 -2
- package/dist/mentions.esm.js +17 -12
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +43 -42
- package/dist/plugins.css +1 -1
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +30 -27
- package/dist/{purify.es-T2a3nLiC.js → purify.es-DWpzYfqy.js} +1 -1
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-Dewe88eZ.mjs} +2 -2
- package/dist/slash-commands.cjs.js +13 -7
- package/dist/slash-commands.esm.js +90 -79
- package/dist/smart-paste.cjs.js +5 -5
- package/dist/smart-paste.esm.js +85 -81
- package/dist/special-characters.cjs.js +6 -3
- package/dist/special-characters.esm.js +72 -25
- package/dist/spell-check.cjs.js +8 -8
- package/dist/spell-check.esm.js +10189 -295
- package/dist/table.cjs.js +166 -13
- package/dist/table.esm.js +543 -266
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +290 -264
- package/dist/text-color.cjs.js +1 -1
- package/dist/text-color.esm.js +1 -1
- package/dist/translation-workflow.cjs.js +4 -4
- package/dist/translation-workflow.esm.js +33 -31
- package/dist/version-diff.cjs.js +6 -6
- package/dist/version-diff.esm.js +40 -40
- package/package.json +10 -4
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/index-BFsKNTTj.mjs +0 -145
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-tqLTHcO6.js +0 -1
package/dist/template.esm.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { e as hn } from "./escapeHtml-DyksyvcZ.mjs";
|
|
2
|
+
import { i as Tn } from "./dialogHelpers-5d5BuOCW.mjs";
|
|
1
3
|
const {
|
|
2
|
-
entries:
|
|
3
|
-
setPrototypeOf:
|
|
4
|
-
isFrozen:
|
|
5
|
-
getPrototypeOf:
|
|
6
|
-
getOwnPropertyDescriptor:
|
|
4
|
+
entries: Ut,
|
|
5
|
+
setPrototypeOf: Ct,
|
|
6
|
+
isFrozen: bn,
|
|
7
|
+
getPrototypeOf: En,
|
|
8
|
+
getOwnPropertyDescriptor: An
|
|
7
9
|
} = Object;
|
|
8
10
|
let {
|
|
9
11
|
freeze: R,
|
|
10
|
-
seal:
|
|
12
|
+
seal: N,
|
|
11
13
|
create: De
|
|
12
14
|
} = Object, {
|
|
13
15
|
apply: et,
|
|
@@ -16,12 +18,12 @@ let {
|
|
|
16
18
|
R || (R = function(t) {
|
|
17
19
|
return t;
|
|
18
20
|
});
|
|
19
|
-
|
|
21
|
+
N || (N = function(t) {
|
|
20
22
|
return t;
|
|
21
23
|
});
|
|
22
24
|
et || (et = function(t, o) {
|
|
23
|
-
for (var l = arguments.length, c = new Array(l > 2 ? l - 2 : 0),
|
|
24
|
-
c[
|
|
25
|
+
for (var l = arguments.length, c = new Array(l > 2 ? l - 2 : 0), d = 2; d < l; d++)
|
|
26
|
+
c[d - 2] = arguments[d];
|
|
25
27
|
return t.apply(o, c);
|
|
26
28
|
});
|
|
27
29
|
tt || (tt = function(t) {
|
|
@@ -29,7 +31,7 @@ tt || (tt = function(t) {
|
|
|
29
31
|
l[c - 1] = arguments[c];
|
|
30
32
|
return new t(...l);
|
|
31
33
|
});
|
|
32
|
-
const Re = L(Array.prototype.forEach),
|
|
34
|
+
const Re = L(Array.prototype.forEach), _n = L(Array.prototype.lastIndexOf), wt = L(Array.prototype.pop), se = L(Array.prototype.push), yn = L(Array.prototype.splice), Ce = L(String.prototype.toLowerCase), $e = L(String.prototype.toString), qe = L(String.prototype.match), ce = L(String.prototype.replace), vn = L(String.prototype.indexOf), Sn = L(String.prototype.trim), C = L(Object.prototype.hasOwnProperty), x = L(RegExp.prototype.test), ue = xn(TypeError);
|
|
33
35
|
function L(n) {
|
|
34
36
|
return function(t) {
|
|
35
37
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -38,7 +40,7 @@ function L(n) {
|
|
|
38
40
|
return et(n, t, l);
|
|
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), l = 0; l < t; l++)
|
|
44
46
|
o[l] = arguments[l];
|
|
@@ -46,65 +48,65 @@ function yn(n) {
|
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
50
|
function s(n, t) {
|
|
49
|
-
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
50
|
-
|
|
51
|
+
let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ce;
|
|
52
|
+
Ct && Ct(n, null);
|
|
51
53
|
let l = t.length;
|
|
52
54
|
for (; l--; ) {
|
|
53
55
|
let c = t[l];
|
|
54
56
|
if (typeof c == "string") {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
+
const d = o(c);
|
|
58
|
+
d !== c && (bn(t) || (t[l] = d), c = d);
|
|
57
59
|
}
|
|
58
60
|
n[c] = !0;
|
|
59
61
|
}
|
|
60
62
|
return n;
|
|
61
63
|
}
|
|
62
|
-
function
|
|
64
|
+
function Rn(n) {
|
|
63
65
|
for (let t = 0; t < n.length; t++)
|
|
64
66
|
C(n, t) || (n[t] = null);
|
|
65
67
|
return n;
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function k(n) {
|
|
68
70
|
const t = De(null);
|
|
69
|
-
for (const [o, l] of
|
|
70
|
-
C(n, o) && (Array.isArray(l) ? t[o] =
|
|
71
|
+
for (const [o, l] of Ut(n))
|
|
72
|
+
C(n, o) && (Array.isArray(l) ? t[o] = Rn(l) : l && typeof l == "object" && l.constructor === Object ? t[o] = k(l) : t[o] = l);
|
|
71
73
|
return t;
|
|
72
74
|
}
|
|
73
75
|
function pe(n, t) {
|
|
74
76
|
for (; n !== null; ) {
|
|
75
|
-
const l =
|
|
77
|
+
const l = An(n, t);
|
|
76
78
|
if (l) {
|
|
77
79
|
if (l.get)
|
|
78
80
|
return L(l.get);
|
|
79
81
|
if (typeof l.value == "function")
|
|
80
82
|
return L(l.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 = R(["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 = R(["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 = R(["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 = R(["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 = R(["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"]), Ln = R(["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 = R(["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 = R(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Nt = R(["#text"]), Mt = R(["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 = R(["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 = R(["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"]), Le = R(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Cn = N(/\{\{[\w\W]*|[\w\W]*\}\}/gm), wn = N(/<%[\w\W]*|[\w\W]*%>/gm), On = N(/\$\{[\w\W]*/gm), Nn = N(/^data-[\-\w.\u00B7-\uFFFF]+$/), Mn = N(/^aria-[\-\w]+$/), zt = N(
|
|
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 = N(/^(?:\w+script|data):/i), kn = N(
|
|
93
95
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
94
96
|
// eslint-disable-line no-control-regex
|
|
95
|
-
),
|
|
97
|
+
), Bt = N(/^html$/i), Pn = N(/^[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: Bt,
|
|
105
|
+
ERB_EXPR: wn,
|
|
106
|
+
IS_ALLOWED_URI: zt,
|
|
107
|
+
IS_SCRIPT_OR_DATA: In,
|
|
108
|
+
MUSTACHE_EXPR: Cn,
|
|
109
|
+
TMPLIT_EXPR: On
|
|
108
110
|
});
|
|
109
111
|
const de = {
|
|
110
112
|
element: 1,
|
|
@@ -113,17 +115,17 @@ const de = {
|
|
|
113
115
|
progressingInstruction: 7,
|
|
114
116
|
comment: 8,
|
|
115
117
|
document: 9
|
|
116
|
-
},
|
|
118
|
+
}, Hn = function() {
|
|
117
119
|
return typeof window > "u" ? 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 l = null;
|
|
122
124
|
const c = "data-tt-policy-suffix";
|
|
123
125
|
o && o.hasAttribute(c) && (l = o.getAttribute(c));
|
|
124
|
-
const
|
|
126
|
+
const d = "dompurify" + (l ? "#" + l : "");
|
|
125
127
|
try {
|
|
126
|
-
return t.createPolicy(
|
|
128
|
+
return t.createPolicy(d, {
|
|
127
129
|
createHTML(w) {
|
|
128
130
|
return w;
|
|
129
131
|
},
|
|
@@ -132,7 +134,7 @@ const de = {
|
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
136
|
} catch {
|
|
135
|
-
return console.warn("TrustedTypes policy " +
|
|
137
|
+
return console.warn("TrustedTypes policy " + d + " could not be created."), null;
|
|
136
138
|
}
|
|
137
139
|
}, Pt = function() {
|
|
138
140
|
return {
|
|
@@ -147,57 +149,57 @@ const de = {
|
|
|
147
149
|
uponSanitizeShadowNode: []
|
|
148
150
|
};
|
|
149
151
|
};
|
|
150
|
-
function
|
|
151
|
-
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
152
|
-
const t = (i) =>
|
|
152
|
+
function Gt() {
|
|
153
|
+
let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Hn();
|
|
154
|
+
const t = (i) => Gt(i);
|
|
153
155
|
if (t.version = "3.3.2", t.removed = [], !n || !n.document || n.document.nodeType !== de.document || !n.Element)
|
|
154
156
|
return t.isSupported = !1, t;
|
|
155
157
|
let {
|
|
156
158
|
document: o
|
|
157
159
|
} = n;
|
|
158
160
|
const l = o, c = l.currentScript, {
|
|
159
|
-
DocumentFragment:
|
|
161
|
+
DocumentFragment: d,
|
|
160
162
|
HTMLTemplateElement: w,
|
|
161
|
-
Node:
|
|
162
|
-
Element:
|
|
163
|
-
NodeFilter:
|
|
163
|
+
Node: H,
|
|
164
|
+
Element: p,
|
|
165
|
+
NodeFilter: m,
|
|
164
166
|
NamedNodeMap: W = n.NamedNodeMap || n.MozNamedAttrMap,
|
|
165
|
-
HTMLFormElement:
|
|
167
|
+
HTMLFormElement: V,
|
|
166
168
|
DOMParser: Oe,
|
|
167
169
|
trustedTypes: he
|
|
168
|
-
} = n, re =
|
|
170
|
+
} = n, re = p.prototype, Xt = pe(re, "cloneNode"), Kt = pe(re, "remove"), Zt = pe(re, "nextSibling"), Qt = pe(re, "childNodes"), Te = pe(re, "parentNode");
|
|
169
171
|
if (typeof w == "function") {
|
|
170
172
|
const i = o.createElement("template");
|
|
171
173
|
i.content && i.content.ownerDocument && (o = i.content.ownerDocument);
|
|
172
174
|
}
|
|
173
175
|
let v, oe = "";
|
|
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
|
} = l;
|
|
182
184
|
let S = Pt();
|
|
183
|
-
t.isSupported = typeof
|
|
185
|
+
t.isSupported = typeof Ut == "function" && typeof Te == "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, b = null;
|
|
199
|
+
const lt = s({}, [...Ot, ...Xe, ...Ke, ...Ze, ...Nt]);
|
|
198
200
|
let A = null;
|
|
199
|
-
const st = s({}, [...
|
|
200
|
-
let
|
|
201
|
+
const st = s({}, [...Mt, ...Qe, ...It, ...Le]);
|
|
202
|
+
let f = Object.seal(De(null, {
|
|
201
203
|
tagNameCheck: {
|
|
202
204
|
writable: !0,
|
|
203
205
|
configurable: !1,
|
|
@@ -217,7 +219,7 @@ function Bt() {
|
|
|
217
219
|
value: !1
|
|
218
220
|
}
|
|
219
221
|
})), ae = null, be = null;
|
|
220
|
-
const
|
|
222
|
+
const G = Object.seal(De(null, {
|
|
221
223
|
tagCheck: {
|
|
222
224
|
writable: !0,
|
|
223
225
|
configurable: !1,
|
|
@@ -231,53 +233,53 @@ function Bt() {
|
|
|
231
233
|
value: null
|
|
232
234
|
}
|
|
233
235
|
}));
|
|
234
|
-
let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ee = !0,
|
|
235
|
-
const
|
|
236
|
+
let ct = !0, Pe = !0, ut = !1, pt = !0, $ = !1, Ee = !0, j = !1, He = !1, Fe = !1, q = !1, Ae = !1, _e = !1, dt = !0, mt = !1;
|
|
237
|
+
const sn = "user-content-";
|
|
236
238
|
let Ue = !0, ie = !1, X = {}, M = 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 Be = null;
|
|
241
243
|
const ht = s({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ye = "http://www.w3.org/1998/Math/MathML", ve = "http://www.w3.org/2000/svg", F = "http://www.w3.org/1999/xhtml";
|
|
242
|
-
let
|
|
243
|
-
const
|
|
244
|
+
let K = F, Ge = !1, We = null;
|
|
245
|
+
const cn = s({}, [ye, ve, F], $e);
|
|
244
246
|
let Se = s({}, ["mi", "mo", "mn", "ms", "mtext"]), xe = s({}, ["annotation-xml"]);
|
|
245
|
-
const
|
|
247
|
+
const un = s({}, ["title", "style", "font", "a", "script"]);
|
|
246
248
|
let le = null;
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
249
|
+
const pn = ["application/xhtml+xml", "text/html"], dn = "text/html";
|
|
250
|
+
let T = 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 = k(e), le = // eslint-disable-next-line unicorn/prefer-includes
|
|
257
|
+
pn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? dn : e.PARSER_MEDIA_TYPE, T = le === "application/xhtml+xml" ? $e : Ce, b = C(e, "ALLOWED_TAGS") ? s({}, e.ALLOWED_TAGS, T) : lt, A = C(e, "ALLOWED_ATTR") ? s({}, e.ALLOWED_ATTR, T) : st, We = C(e, "ALLOWED_NAMESPACES") ? s({}, e.ALLOWED_NAMESPACES, $e) : cn, Be = C(e, "ADD_URI_SAFE_ATTR") ? s(k(ht), e.ADD_URI_SAFE_ATTR, T) : ht, ft = C(e, "ADD_DATA_URI_TAGS") ? s(k(gt), e.ADD_DATA_URI_TAGS, T) : gt, M = C(e, "FORBID_CONTENTS") ? s({}, e.FORBID_CONTENTS, T) : ze, ae = C(e, "FORBID_TAGS") ? s({}, e.FORBID_TAGS, T) : k({}), be = C(e, "FORBID_ATTR") ? s({}, e.FORBID_ATTR, T) : k({}), X = C(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, Ee = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, q = e.RETURN_DOM || !1, Ae = e.RETURN_DOM_FRAGMENT || !1, _e = 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, ie = e.IN_PLACE || !1, it = e.ALLOWED_URI_REGEXP || zt, K = e.NAMESPACE || F, Se = e.MATHML_TEXT_INTEGRATION_POINTS || Se, xe = e.HTML_INTEGRATION_POINTS || xe, f = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (f.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (f.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), $ && (Pe = !1), Ae && (q = !0), X && (b = s({}, Nt), A = De(null), X.html === !0 && (s(b, Ot), s(A, Mt)), X.svg === !0 && (s(b, Xe), s(A, Qe), s(A, Le)), X.svgFilters === !0 && (s(b, Ke), s(A, Qe), s(A, Le)), X.mathMl === !0 && (s(b, Ze), s(A, It), s(A, Le))), C(e, "ADD_TAGS") || (G.tagCheck = null), C(e, "ADD_ATTR") || (G.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? G.tagCheck = e.ADD_TAGS : (b === lt && (b = k(b)), s(b, e.ADD_TAGS, T))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? G.attributeCheck = e.ADD_ATTR : (A === st && (A = k(A)), s(A, e.ADD_ATTR, T))), e.ADD_URI_SAFE_ATTR && s(Be, e.ADD_URI_SAFE_ATTR, T), e.FORBID_CONTENTS && (M === ze && (M = k(M)), s(M, e.FORBID_CONTENTS, T)), e.ADD_FORBID_CONTENTS && (M === ze && (M = k(M)), s(M, e.ADD_FORBID_CONTENTS, T)), Ue && (b["#text"] = !0), j && s(b, ["html", "head", "body"]), b.table && (s(b, ["tbody"]), delete ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
256
258
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
257
259
|
throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
258
260
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
259
261
|
throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
260
262
|
v = e.TRUSTED_TYPES_POLICY, oe = v.createHTML("");
|
|
261
263
|
} else
|
|
262
|
-
v === void 0 && (v =
|
|
263
|
-
R && R(e),
|
|
264
|
+
v === void 0 && (v = Fn(he, c)), v !== null && typeof oe == "string" && (oe = v.createHTML(""));
|
|
265
|
+
R && R(e), Z = e;
|
|
264
266
|
}
|
|
265
|
-
}, bt = s({}, [...Xe, ...
|
|
267
|
+
}, bt = s({}, [...Xe, ...Ke, ...Ln]), Et = s({}, [...Ze, ...Dn]), fn = function(e) {
|
|
266
268
|
let r = Te(e);
|
|
267
269
|
(!r || !r.tagName) && (r = {
|
|
268
|
-
namespaceURI:
|
|
270
|
+
namespaceURI: K,
|
|
269
271
|
tagName: "template"
|
|
270
272
|
});
|
|
271
|
-
const a =
|
|
272
|
-
return We[e.namespaceURI] ? e.namespaceURI === ve ? r.namespaceURI === F ? a === "svg" : r.namespaceURI === ye ? a === "svg" && (u === "annotation-xml" || Se[u]) : !!bt[a] : e.namespaceURI === ye ? r.namespaceURI === F ? a === "math" : r.namespaceURI === ve ? a === "math" && xe[u] : !!Et[a] : e.namespaceURI === F ? r.namespaceURI === ve && !xe[u] || r.namespaceURI === ye && !Se[u] ? !1 : !Et[a] && (
|
|
273
|
-
},
|
|
273
|
+
const a = Ce(e.tagName), u = Ce(r.tagName);
|
|
274
|
+
return We[e.namespaceURI] ? e.namespaceURI === ve ? r.namespaceURI === F ? a === "svg" : r.namespaceURI === ye ? a === "svg" && (u === "annotation-xml" || Se[u]) : !!bt[a] : e.namespaceURI === ye ? r.namespaceURI === F ? a === "math" : r.namespaceURI === ve ? a === "math" && xe[u] : !!Et[a] : e.namespaceURI === F ? r.namespaceURI === ve && !xe[u] || r.namespaceURI === ye && !Se[u] ? !1 : !Et[a] && (un[a] || !bt[a]) : !!(le === "application/xhtml+xml" && We[e.namespaceURI]) : !1;
|
|
275
|
+
}, I = function(e) {
|
|
274
276
|
se(t.removed, {
|
|
275
277
|
element: e
|
|
276
278
|
});
|
|
277
279
|
try {
|
|
278
280
|
Te(e).removeChild(e);
|
|
279
281
|
} catch {
|
|
280
|
-
|
|
282
|
+
Kt(e);
|
|
281
283
|
}
|
|
282
284
|
}, Y = function(e, r) {
|
|
283
285
|
try {
|
|
@@ -294,7 +296,7 @@ function Bt() {
|
|
|
294
296
|
if (r.removeAttribute(e), e === "is")
|
|
295
297
|
if (q || Ae)
|
|
296
298
|
try {
|
|
297
|
-
|
|
299
|
+
I(r);
|
|
298
300
|
} catch {
|
|
299
301
|
}
|
|
300
302
|
else
|
|
@@ -304,95 +306,95 @@ function Bt() {
|
|
|
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
|
-
le === "application/xhtml+xml" &&
|
|
315
|
+
le === "application/xhtml+xml" && K === F && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
314
316
|
const u = v ? v.createHTML(e) : e;
|
|
315
|
-
if (
|
|
317
|
+
if (K === F)
|
|
316
318
|
try {
|
|
317
319
|
r = new Oe().parseFromString(u, le);
|
|
318
320
|
} catch {
|
|
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 = Ge ? oe : u;
|
|
324
326
|
} catch {
|
|
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 === F ? 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
|
+
m.SHOW_ELEMENT | m.SHOW_COMMENT | m.SHOW_TEXT | m.SHOW_PROCESSING_INSTRUCTION | m.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 W) || 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 H == "function" && e instanceof H;
|
|
341
343
|
};
|
|
342
|
-
function
|
|
344
|
+
function U(i, e, r) {
|
|
343
345
|
Re(i, (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 (U(S.beforeSanitizeElements, e, null), je(e))
|
|
352
|
+
return I(e), !0;
|
|
353
|
+
const a = T(e.nodeName);
|
|
354
|
+
if (U(S.uponSanitizeElement, e, {
|
|
353
355
|
tagName: a,
|
|
354
|
-
allowedTags:
|
|
356
|
+
allowedTags: b
|
|
355
357
|
}), Ee && e.hasChildNodes() && !yt(e.firstElementChild) && x(/<[/\w!]/g, e.innerHTML) && x(/<[/\w!]/g, e.textContent) || e.nodeType === de.progressingInstruction || Ee && e.nodeType === de.comment && x(/<[/\w]/g, e.data))
|
|
356
|
-
return
|
|
357
|
-
if (!(
|
|
358
|
-
if (!ae[a] && xt(a) && (
|
|
358
|
+
return I(e), !0;
|
|
359
|
+
if (!(G.tagCheck instanceof Function && G.tagCheck(a)) && (!b[a] || ae[a])) {
|
|
360
|
+
if (!ae[a] && xt(a) && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
|
|
359
361
|
return !1;
|
|
360
362
|
if (Ue && !M[a]) {
|
|
361
|
-
const u = Te(e) || e.parentNode, y =
|
|
363
|
+
const u = Te(e) || e.parentNode, y = Qt(e) || e.childNodes;
|
|
362
364
|
if (y && u) {
|
|
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 z = Xt(y[D], !0);
|
|
368
|
+
z.__removalCount = (e.__removalCount || 0) + 1, u.insertBefore(z, Zt(e));
|
|
367
369
|
}
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
|
-
return
|
|
372
|
+
return I(e), !0;
|
|
371
373
|
}
|
|
372
|
-
return e instanceof
|
|
374
|
+
return e instanceof p && !fn(e) || (a === "noscript" || a === "noembed" || a === "noframes") && x(/<\/no(script|embed|frames)/i, e.innerHTML) ? (I(e), !0) : ($ && e.nodeType === de.text && (r = e.textContent, Re([Me, Ie, ke], (u) => {
|
|
373
375
|
r = ce(r, u, " ");
|
|
374
376
|
}), e.textContent !== r && (se(t.removed, {
|
|
375
377
|
element: e.cloneNode()
|
|
376
|
-
}), e.textContent = r)),
|
|
378
|
+
}), e.textContent = r)), U(S.afterSanitizeElements, e, null), !1);
|
|
377
379
|
}, St = function(e, r, a) {
|
|
378
|
-
if (be[r] || dt && (r === "id" || r === "name") && (a in o || a in
|
|
380
|
+
if (be[r] || dt && (r === "id" || r === "name") && (a in o || a in mn))
|
|
379
381
|
return !1;
|
|
380
|
-
if (!(Pe && !be[r] && x(
|
|
381
|
-
if (!(ct && x(
|
|
382
|
-
if (!(
|
|
382
|
+
if (!(Pe && !be[r] && x(rn, r))) {
|
|
383
|
+
if (!(ct && x(on, r))) {
|
|
384
|
+
if (!(G.attributeCheck instanceof Function && G.attributeCheck(r, e))) {
|
|
383
385
|
if (!A[r] || be[r]) {
|
|
384
386
|
if (
|
|
385
387
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
386
388
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
387
389
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
388
|
-
!(xt(e) && (
|
|
390
|
+
!(xt(e) && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, e) || f.tagNameCheck instanceof Function && f.tagNameCheck(e)) && (f.attributeNameCheck instanceof RegExp && x(f.attributeNameCheck, r) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(r, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
389
391
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
390
|
-
r === "is" &&
|
|
392
|
+
r === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && x(f.tagNameCheck, a) || f.tagNameCheck instanceof Function && f.tagNameCheck(a)))
|
|
391
393
|
) return !1;
|
|
392
394
|
} else if (!Be[r]) {
|
|
393
395
|
if (!x(it, ce(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, ce(a, at, "")))) {
|
|
396
398
|
if (a)
|
|
397
399
|
return !1;
|
|
398
400
|
}
|
|
@@ -404,13 +406,13 @@ function Bt() {
|
|
|
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
|
}, Rt = function(e) {
|
|
409
|
-
|
|
411
|
+
U(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 Bt() {
|
|
|
422
424
|
let u = r.length;
|
|
423
425
|
for (; u--; ) {
|
|
424
426
|
const y = r[u], {
|
|
425
|
-
name:
|
|
427
|
+
name: g,
|
|
426
428
|
namespaceURI: D,
|
|
427
|
-
value:
|
|
428
|
-
} = y, Q = g
|
|
429
|
-
let _ =
|
|
430
|
-
if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0,
|
|
431
|
-
Y(
|
|
429
|
+
value: z
|
|
430
|
+
} = y, Q = T(g), Ye = z;
|
|
431
|
+
let _ = g === "value" ? Ye : Sn(Ye);
|
|
432
|
+
if (a.attrName = Q, a.attrValue = _, a.keepAttr = !0, a.forceKeepAttr = void 0, U(S.uponSanitizeAttribute, e, a), _ = a.attrValue, mt && (Q === "id" || Q === "name") && (Y(g, e), _ = sn + _), Ee && 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
|
_ = ce(_, Dt, " ");
|
|
450
452
|
});
|
|
451
|
-
const Lt =
|
|
453
|
+
const Lt = T(e.nodeName);
|
|
452
454
|
if (!St(Lt, Q, _)) {
|
|
453
|
-
Y(
|
|
455
|
+
Y(g, e);
|
|
454
456
|
continue;
|
|
455
457
|
}
|
|
456
458
|
if (v && typeof he == "object" && typeof he.getAttributeType == "function" && !D)
|
|
@@ -466,18 +468,18 @@ function Bt() {
|
|
|
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) ? I(e) : wt(t.removed);
|
|
470
472
|
} catch {
|
|
471
|
-
Y(
|
|
473
|
+
Y(g, e);
|
|
472
474
|
}
|
|
473
475
|
}
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
+
U(S.afterSanitizeAttributes, e, null);
|
|
477
|
+
}, gn = function i(e) {
|
|
476
478
|
let r = null;
|
|
477
479
|
const a = _t(e);
|
|
478
|
-
for (
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
for (U(S.beforeSanitizeShadowDOM, e, null); r = a.nextNode(); )
|
|
481
|
+
U(S.uponSanitizeShadowNode, r, null), vt(r), Rt(r), r.content instanceof d && i(r.content);
|
|
482
|
+
U(S.afterSanitizeShadowDOM, e, null);
|
|
481
483
|
};
|
|
482
484
|
return t.sanitize = function(i) {
|
|
483
485
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, a = null, u = null, y = null;
|
|
@@ -489,66 +491,66 @@ function Bt() {
|
|
|
489
491
|
throw ue("toString is not a function");
|
|
490
492
|
if (!t.isSupported)
|
|
491
493
|
return i;
|
|
492
|
-
if (
|
|
494
|
+
if (He || Ve(e), t.removed = [], typeof i == "string" && (ie = !1), ie) {
|
|
493
495
|
if (i.nodeName) {
|
|
494
|
-
const
|
|
495
|
-
if (!
|
|
496
|
+
const z = T(i.nodeName);
|
|
497
|
+
if (!b[z] || ae[z])
|
|
496
498
|
throw ue("root node is forbidden and cannot be sanitized in-place");
|
|
497
499
|
}
|
|
498
|
-
} else if (i instanceof
|
|
500
|
+
} else if (i instanceof H)
|
|
499
501
|
r = At("<!---->"), a = r.ownerDocument.importNode(i, !0), a.nodeType === de.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
|
i.indexOf("<") === -1)
|
|
503
505
|
return v && _e ? v.createHTML(i) : i;
|
|
504
506
|
if (r = At(i), !r)
|
|
505
507
|
return q ? null : _e ? oe : "";
|
|
506
508
|
}
|
|
507
|
-
r &&
|
|
508
|
-
const
|
|
509
|
-
for (; u =
|
|
510
|
-
vt(u), Rt(u), u.content instanceof
|
|
509
|
+
r && Fe && I(r.firstChild);
|
|
510
|
+
const g = _t(ie ? i : r);
|
|
511
|
+
for (; u = g.nextNode(); )
|
|
512
|
+
vt(u), Rt(u), u.content instanceof d && gn(u.content);
|
|
511
513
|
if (ie)
|
|
512
514
|
return i;
|
|
513
515
|
if (q) {
|
|
514
516
|
if (Ae)
|
|
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(l, y, !0)), y;
|
|
520
522
|
}
|
|
521
|
-
let D =
|
|
522
|
-
return
|
|
523
|
-
` + D), $ && Re([
|
|
524
|
-
D = ce(D,
|
|
523
|
+
let D = j ? r.outerHTML : r.innerHTML;
|
|
524
|
+
return j && b["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && x(Bt, r.ownerDocument.doctype.name) && (D = "<!DOCTYPE " + r.ownerDocument.doctype.name + `>
|
|
525
|
+
` + D), $ && Re([Me, Ie, ke], (z) => {
|
|
526
|
+
D = ce(D, z, " ");
|
|
525
527
|
}), v && _e ? v.createHTML(D) : D;
|
|
526
528
|
}, t.setConfig = function() {
|
|
527
529
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
528
|
-
|
|
530
|
+
Ve(i), He = !0;
|
|
529
531
|
}, t.clearConfig = function() {
|
|
530
|
-
|
|
532
|
+
Z = null, He = !1;
|
|
531
533
|
}, t.isValidAttribute = function(i, e, r) {
|
|
532
|
-
|
|
533
|
-
const a =
|
|
534
|
+
Z || Ve({});
|
|
535
|
+
const a = T(i), u = T(e);
|
|
534
536
|
return St(a, u, r);
|
|
535
537
|
}, t.addHook = function(i, e) {
|
|
536
538
|
typeof e == "function" && se(S[i], e);
|
|
537
539
|
}, t.removeHook = function(i, e) {
|
|
538
540
|
if (e !== void 0) {
|
|
539
|
-
const r =
|
|
540
|
-
return r === -1 ? void 0 :
|
|
541
|
+
const r = _n(S[i], e);
|
|
542
|
+
return r === -1 ? void 0 : yn(S[i], r, 1)[0];
|
|
541
543
|
}
|
|
542
|
-
return
|
|
544
|
+
return wt(S[i]);
|
|
543
545
|
}, t.removeHooks = function(i) {
|
|
544
546
|
S[i] = [];
|
|
545
547
|
}, t.removeAllHooks = function() {
|
|
546
548
|
S = Pt();
|
|
547
549
|
}, t;
|
|
548
550
|
}
|
|
549
|
-
var
|
|
550
|
-
let
|
|
551
|
-
function
|
|
551
|
+
var Un = Gt();
|
|
552
|
+
let h = null, O = null, J = null, E = null, ee = "", te = "", me = "insert", fe = null, P = null, we = null;
|
|
553
|
+
function Wt(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 Gt(n, t) {
|
|
|
557
559
|
} catch {
|
|
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 Bn = [
|
|
574
576
|
{
|
|
575
577
|
id: "formal-letter",
|
|
576
578
|
name: "Formal Letter",
|
|
@@ -641,55 +643,53 @@ const Hn = [
|
|
|
641
643
|
<h3>Q: What are the requirements?</h3>
|
|
642
644
|
<p>A: [Answer here]</p>`
|
|
643
645
|
}
|
|
644
|
-
]
|
|
645
|
-
let ne = [...Hn];
|
|
646
|
-
const Wt = () => ne, Zn = (n) => ne.filter((t) => t.category === n), jt = () => {
|
|
646
|
+
], ne = [...Bn], Vt = () => ne, nr = (n) => ne.filter((t) => t.category === n), jt = () => {
|
|
647
647
|
const n = new Set(ne.map((t) => t.category));
|
|
648
648
|
return Array.from(n);
|
|
649
|
-
},
|
|
649
|
+
}, Gn = (n) => {
|
|
650
650
|
const t = n.toLowerCase();
|
|
651
651
|
return ne.filter(
|
|
652
652
|
(o) => o.name.toLowerCase().includes(t) || o.description?.toLowerCase().includes(t) || o.tags?.some((l) => l.toLowerCase().includes(t))
|
|
653
653
|
);
|
|
654
|
-
},
|
|
654
|
+
}, Yt = (n) => Un.sanitize(n, {
|
|
655
655
|
ALLOWED_TAGS: ["p", "br", "strong", "em", "u", "h1", "h2", "h3", "h4", "ul", "ol", "li", "blockquote", "table", "thead", "tbody", "tr", "th", "td", "a", "span"],
|
|
656
656
|
ALLOWED_ATTR: ["href", "target", "class", "data-key", "data-category"]
|
|
657
|
-
}),
|
|
658
|
-
function
|
|
659
|
-
|
|
657
|
+
}), rr = (n) => ne.some((t) => t.id === n.id) ? (console.warn(`Template with ID ${n.id} already exists`), !1) : (ne.push(n), !0), or = (n) => !!(n.id && n.name && n.category && n.html && n.html.trim().length > 0);
|
|
658
|
+
function Wn(n) {
|
|
659
|
+
O && B(), O = document.createElement("div"), Tn(O), O.className = "rte-dialog-overlay", Yn(n) && O.classList.add("rte-ui-theme-dark"), O.addEventListener("click", () => B()), h = document.createElement("div"), h.className = "rte-dialog rte-template-dialog", h.addEventListener("click", (o) => o.stopPropagation());
|
|
660
660
|
const t = jt();
|
|
661
|
-
t.length > 0 && !ee && (ee = t[0]), ge(),
|
|
661
|
+
t.length > 0 && !ee && (ee = t[0]), ge(), O.appendChild(h), document.body.appendChild(O), Vn(), Jn();
|
|
662
662
|
}
|
|
663
|
-
function
|
|
664
|
-
|
|
665
|
-
n.key === "Escape" && (!
|
|
663
|
+
function Vn() {
|
|
664
|
+
$t(), fe = (n) => {
|
|
665
|
+
n.key === "Escape" && (!O || !h || (n.preventDefault(), n.stopPropagation(), B()));
|
|
666
666
|
}, document.addEventListener("keydown", fe, !0);
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function $t() {
|
|
669
669
|
fe && (document.removeEventListener("keydown", fe, !0), fe = null);
|
|
670
670
|
}
|
|
671
|
-
const
|
|
671
|
+
const jn = '[data-theme="dark"], .dark, .editora-theme-dark', nt = () => {
|
|
672
672
|
const n = window.getSelection();
|
|
673
673
|
if (!n || n.rangeCount === 0) return null;
|
|
674
674
|
const t = n.anchorNode;
|
|
675
675
|
return (t instanceof HTMLElement ? t : t?.parentElement)?.closest(
|
|
676
676
|
".rte-content, .editora-content"
|
|
677
677
|
) || null;
|
|
678
|
-
},
|
|
678
|
+
}, Yn = (n) => {
|
|
679
679
|
const t = n || nt();
|
|
680
|
-
return t ? !!t.closest(
|
|
680
|
+
return t ? !!t.closest(jn) : !1;
|
|
681
681
|
};
|
|
682
682
|
function rt() {
|
|
683
|
-
const n =
|
|
683
|
+
const n = zn(J);
|
|
684
684
|
if (n) return n;
|
|
685
|
-
if (
|
|
685
|
+
if (we?.isConnected) return we;
|
|
686
686
|
const t = nt();
|
|
687
687
|
return t || document.querySelector(".rte-content, .editora-content");
|
|
688
688
|
}
|
|
689
689
|
function ge() {
|
|
690
|
-
if (!
|
|
690
|
+
if (!h) return;
|
|
691
691
|
const n = jt(), t = ot();
|
|
692
|
-
|
|
692
|
+
h.innerHTML = `
|
|
693
693
|
<div class="rte-dialog-header">
|
|
694
694
|
<h2>Insert Template</h2>
|
|
695
695
|
<button class="rte-dialog-close" aria-label="Close">✕</button>
|
|
@@ -700,7 +700,7 @@ function ge() {
|
|
|
700
700
|
<input
|
|
701
701
|
type="text"
|
|
702
702
|
placeholder="Search templates..."
|
|
703
|
-
value="${te}"
|
|
703
|
+
value="${hn(te)}"
|
|
704
704
|
class="rte-input rte-template-search"
|
|
705
705
|
aria-label="Search templates"
|
|
706
706
|
/>
|
|
@@ -718,7 +718,7 @@ function ge() {
|
|
|
718
718
|
<div class="rte-template-list">
|
|
719
719
|
${t.length > 0 ? t.map((o) => `
|
|
720
720
|
<div
|
|
721
|
-
class="rte-template-item ${
|
|
721
|
+
class="rte-template-item ${E?.id === o.id ? "selected" : ""}"
|
|
722
722
|
data-template-id="${o.id}"
|
|
723
723
|
>
|
|
724
724
|
<div class="template-name">${o.name}</div>
|
|
@@ -728,10 +728,10 @@ function ge() {
|
|
|
728
728
|
</div>
|
|
729
729
|
|
|
730
730
|
<!-- Preview -->
|
|
731
|
-
${
|
|
731
|
+
${E ? `
|
|
732
732
|
<div class="rte-template-preview">
|
|
733
733
|
<strong>Preview:</strong>
|
|
734
|
-
<div class="template-preview-content">${
|
|
734
|
+
<div class="template-preview-content">${E.html}</div>
|
|
735
735
|
</div>
|
|
736
736
|
` : ""}
|
|
737
737
|
|
|
@@ -750,15 +750,15 @@ function ge() {
|
|
|
750
750
|
|
|
751
751
|
<div class="rte-dialog-footer">
|
|
752
752
|
<button class="rte-button-secondary rte-cancel-btn">Cancel</button>
|
|
753
|
-
<button class="rte-button-primary rte-insert-btn" ${
|
|
753
|
+
<button class="rte-button-primary rte-insert-btn" ${E ? "" : "disabled"}>
|
|
754
754
|
${me === "insert" ? "Insert" : "Replace"}
|
|
755
755
|
</button>
|
|
756
756
|
</div>
|
|
757
|
-
`,
|
|
757
|
+
`, qn();
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
if (!
|
|
761
|
-
|
|
759
|
+
function $n() {
|
|
760
|
+
if (!h) return;
|
|
761
|
+
h.innerHTML = `
|
|
762
762
|
<div class="rte-dialog-header">
|
|
763
763
|
<h2>Replace Document?</h2>
|
|
764
764
|
</div>
|
|
@@ -770,65 +770,89 @@ function jn() {
|
|
|
770
770
|
<button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
|
|
771
771
|
</div>
|
|
772
772
|
`;
|
|
773
|
-
const n =
|
|
774
|
-
n?.addEventListener("click", () => ge()), t?.addEventListener("click", () =>
|
|
773
|
+
const n = h.querySelector(".rte-cancel-warning-btn"), t = h.querySelector(".rte-confirm-replace-btn");
|
|
774
|
+
n?.addEventListener("click", () => ge()), t?.addEventListener("click", () => Xn());
|
|
775
775
|
}
|
|
776
776
|
function ot() {
|
|
777
|
-
const n =
|
|
778
|
-
return te.trim() ?
|
|
777
|
+
const n = Vt();
|
|
778
|
+
return te.trim() ? Gn(te) : ee ? n.filter((t) => t.category === ee) : n;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
if (!
|
|
782
|
-
|
|
783
|
-
const l =
|
|
784
|
-
l?.addEventListener("input", (
|
|
785
|
-
|
|
786
|
-
|
|
780
|
+
function qn() {
|
|
781
|
+
if (!h) return;
|
|
782
|
+
h.querySelector(".rte-dialog-close")?.addEventListener("click", () => B()), h.querySelector(".rte-cancel-btn")?.addEventListener("click", () => B()), h.querySelector(".rte-insert-btn")?.addEventListener("click", () => Je());
|
|
783
|
+
const l = h.querySelector(".rte-template-search");
|
|
784
|
+
l?.addEventListener("input", (p) => {
|
|
785
|
+
P !== null && cancelAnimationFrame(P), te = p.target.value, P = requestAnimationFrame(() => {
|
|
786
|
+
P = null, Ht();
|
|
787
787
|
});
|
|
788
|
-
}), l?.addEventListener("keydown", (
|
|
789
|
-
|
|
790
|
-
}),
|
|
791
|
-
const W =
|
|
788
|
+
}), l?.addEventListener("keydown", (p) => {
|
|
789
|
+
p.key === "Enter" && E ? Je() : p.key === "Escape" && B();
|
|
790
|
+
}), h.querySelector(".rte-tabs")?.addEventListener("click", (p) => {
|
|
791
|
+
const W = p.target.closest(".rte-tab");
|
|
792
792
|
if (!W) return;
|
|
793
|
-
const
|
|
794
|
-
|
|
793
|
+
const V = W.getAttribute("data-category");
|
|
794
|
+
V && (ee = V, te = "", P !== null && (cancelAnimationFrame(P), P = null), Ht());
|
|
795
795
|
});
|
|
796
|
-
const
|
|
797
|
-
const W =
|
|
796
|
+
const d = h.querySelector(".rte-template-list"), w = (p) => {
|
|
797
|
+
const W = p.target.closest(".rte-template-item");
|
|
798
798
|
if (!W) return null;
|
|
799
|
-
const
|
|
800
|
-
return
|
|
799
|
+
const V = W.getAttribute("data-template-id");
|
|
800
|
+
return V && Vt().find((Oe) => Oe.id === V) || null;
|
|
801
801
|
};
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
}),
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
}),
|
|
809
|
-
const
|
|
810
|
-
!
|
|
802
|
+
d?.addEventListener("click", (p) => {
|
|
803
|
+
const m = w(p);
|
|
804
|
+
m && (E = m, ge());
|
|
805
|
+
}), d?.addEventListener("dblclick", (p) => {
|
|
806
|
+
const m = w(p);
|
|
807
|
+
m && (E = m, Je());
|
|
808
|
+
}), h.querySelector(".rte-insert-mode")?.addEventListener("change", (p) => {
|
|
809
|
+
const m = p.target;
|
|
810
|
+
!m || m.name !== "insertMode" || (me = m.value, ge());
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Ht() {
|
|
814
814
|
const n = ot();
|
|
815
|
-
n.length > 0 ? (!
|
|
815
|
+
n.length > 0 ? (!E || !n.find((t) => t.id === E.id)) && (E = n[0]) : E = null, ge();
|
|
816
816
|
}
|
|
817
817
|
function Je() {
|
|
818
|
-
if (
|
|
818
|
+
if (E)
|
|
819
819
|
if (me === "replace") {
|
|
820
820
|
if (rt()?.innerHTML?.trim()) {
|
|
821
|
-
|
|
821
|
+
$n();
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
|
-
|
|
824
|
+
qt(E), B();
|
|
825
825
|
} else
|
|
826
|
-
|
|
826
|
+
Zn(E), B();
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
|
|
828
|
+
function Xn() {
|
|
829
|
+
E && (qt(E), B());
|
|
830
830
|
}
|
|
831
|
-
|
|
831
|
+
const Kn = /* @__PURE__ */ new Set([
|
|
832
|
+
"DIV",
|
|
833
|
+
"P",
|
|
834
|
+
"BLOCKQUOTE",
|
|
835
|
+
"PRE",
|
|
836
|
+
"H1",
|
|
837
|
+
"H2",
|
|
838
|
+
"H3",
|
|
839
|
+
"H4",
|
|
840
|
+
"H5",
|
|
841
|
+
"H6",
|
|
842
|
+
"LI",
|
|
843
|
+
"TD",
|
|
844
|
+
"TH"
|
|
845
|
+
]);
|
|
846
|
+
function Ft(n, t) {
|
|
847
|
+
let o = n;
|
|
848
|
+
for (; o && o !== t; ) {
|
|
849
|
+
if (o.nodeType === Node.ELEMENT_NODE && Kn.has(o.tagName))
|
|
850
|
+
return o;
|
|
851
|
+
o = o.parentNode;
|
|
852
|
+
}
|
|
853
|
+
return null;
|
|
854
|
+
}
|
|
855
|
+
function Zn(n) {
|
|
832
856
|
const t = window.getSelection();
|
|
833
857
|
if (!t) return;
|
|
834
858
|
const o = rt();
|
|
@@ -836,34 +860,36 @@ function $n(n) {
|
|
|
836
860
|
if (J)
|
|
837
861
|
t.removeAllRanges(), t.addRange(J);
|
|
838
862
|
else {
|
|
839
|
-
const
|
|
840
|
-
|
|
863
|
+
const m = document.createRange();
|
|
864
|
+
m.selectNodeContents(o), m.collapse(!1), t.removeAllRanges(), t.addRange(m);
|
|
841
865
|
}
|
|
842
866
|
if (t.rangeCount === 0) return;
|
|
843
|
-
const l = t.getRangeAt(0), c = o?.innerHTML ?? "",
|
|
844
|
-
l.deleteContents()
|
|
845
|
-
const w =
|
|
846
|
-
|
|
867
|
+
const l = t.getRangeAt(0), c = o?.innerHTML ?? "", d = document.createRange().createContextualFragment(Yt(n.html));
|
|
868
|
+
l.deleteContents();
|
|
869
|
+
const w = d.lastChild, H = Ft(l.endContainer, o) || Ft(l.startContainer, o);
|
|
870
|
+
H && H.parentNode ? H.parentNode.insertBefore(d, H.nextSibling) : l.insertNode(d);
|
|
871
|
+
const p = document.createRange();
|
|
872
|
+
w ? p.setStartAfter(w) : p.setStartAfter(l.endContainer), p.collapse(!0), t.removeAllRanges(), t.addRange(p), o && (Wt(o, c), o.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
847
873
|
}
|
|
848
|
-
function
|
|
874
|
+
function qt(n) {
|
|
849
875
|
const t = rt();
|
|
850
876
|
if (t) {
|
|
851
877
|
const o = t.innerHTML;
|
|
852
|
-
t.innerHTML =
|
|
878
|
+
t.innerHTML = Yt(n.html), Wt(t, o), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
853
879
|
}
|
|
854
880
|
}
|
|
855
|
-
function
|
|
856
|
-
|
|
881
|
+
function B() {
|
|
882
|
+
$t(), P !== null && (cancelAnimationFrame(P), P = null), O && (O.remove(), O = null), h = null, J = null, te = "", we = null;
|
|
857
883
|
}
|
|
858
|
-
function
|
|
884
|
+
function Qn(n) {
|
|
859
885
|
const t = window.getSelection();
|
|
860
886
|
t && t.rangeCount > 0 ? J = t.getRangeAt(0).cloneRange() : J = null;
|
|
861
887
|
const o = ot();
|
|
862
|
-
o.length > 0 && !
|
|
888
|
+
o.length > 0 && !E && (E = o[0]);
|
|
863
889
|
const l = n?.contentElement instanceof HTMLElement ? n.contentElement : nt();
|
|
864
|
-
|
|
890
|
+
we = l || null, Wn(l);
|
|
865
891
|
}
|
|
866
|
-
function
|
|
892
|
+
function Jn() {
|
|
867
893
|
if (typeof document > "u") return;
|
|
868
894
|
const n = "template-plugin-dialog-styles";
|
|
869
895
|
if (document.getElementById(n)) return;
|
|
@@ -1107,7 +1133,7 @@ function Xn() {
|
|
|
1107
1133
|
}
|
|
1108
1134
|
`, document.head.appendChild(t);
|
|
1109
1135
|
}
|
|
1110
|
-
const
|
|
1136
|
+
const ar = () => ({
|
|
1111
1137
|
name: "template",
|
|
1112
1138
|
toolbar: [
|
|
1113
1139
|
{
|
|
@@ -1117,18 +1143,18 @@ const Jn = () => ({
|
|
|
1117
1143
|
}
|
|
1118
1144
|
],
|
|
1119
1145
|
commands: {
|
|
1120
|
-
insertTemplate: (n, t) => (
|
|
1146
|
+
insertTemplate: (n, t) => (Qn(t), !0)
|
|
1121
1147
|
},
|
|
1122
1148
|
keymap: {}
|
|
1123
1149
|
});
|
|
1124
1150
|
export {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1151
|
+
Bn as PREDEFINED_TEMPLATES,
|
|
1152
|
+
ar as TemplatePlugin,
|
|
1153
|
+
rr as addCustomTemplate,
|
|
1154
|
+
Vt as getAllTemplates,
|
|
1129
1155
|
jt as getTemplateCategories,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1156
|
+
nr as getTemplatesByCategory,
|
|
1157
|
+
Yt as sanitizeTemplate,
|
|
1158
|
+
Gn as searchTemplates,
|
|
1159
|
+
or as validateTemplate
|
|
1134
1160
|
};
|