reactive-md 0.9.0 → 0.9.1
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/CHANGELOG-ch.md +13 -0
- package/CHANGELOG.md +13 -0
- package/README-ch.md +6 -6
- package/README-en.md +6 -6
- package/README.md +6 -6
- package/SECURITY-ch.md +3 -3
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +111 -1
- package/cli/build.mjs +1 -0
- package/cli/init.mjs +1 -1
- package/dist-library/{LocalDocumentView-K7Y-2bRJ.js → LocalDocumentView-sthUP0ct.js} +10 -10
- package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
- package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
- package/dist-library/{authoring-Co_TiE-P.js → authoring-Dsune4Hy.js} +40 -20
- package/dist-library/{compile-LhpTKqCR.js → compile-wUv8KEge.js} +1 -1
- package/dist-library/{compiler-core-DTxY-qYz.js → compiler-core-As_m-MNm.js} +2449 -1742
- package/dist-library/{compiler-DfGbQhyD.js → compiler-eOfcinZs.js} +19 -19
- package/dist-library/{component-state-BBJ08vML.js → component-state-C52ZFJGl.js} +1 -1
- package/dist-library/{config-BUo-8O5C.js → config-BadfhjdP.js} +1 -1
- package/dist-library/{config-validation-C5kJYk-J.js → config-validation-F47AcE6o.js} +49 -1
- package/dist-library/{controls-BWiLLtBO.js → controls-CcT6n7k_.js} +2433 -2409
- package/dist-library/{coordinate-BSl6enWV.js → coordinate-CWS9p5q_.js} +108 -107
- package/dist-library/{data-table-DfvytZKQ.js → data-table-Bgccxd7h.js} +68 -65
- package/dist-library/{display-lw3BT1TA.js → display-B-VhqVND.js} +1 -1
- package/dist-library/{export-C7IDW9ul.js → export-BqVmTXm8.js} +145 -87
- package/dist-library/{gallery-B8kSt1oI.js → gallery-CY6mTx8i.js} +151 -147
- package/dist-library/html-CNT4KD-2.js +757 -0
- package/dist-library/{incremental-D_6vwAAE.js → incremental-Dv0FSp_U.js} +404 -142
- package/dist-library/layout-C0YlEPGr.js +562 -0
- package/dist-library/{mount-preset-C5s9ebEH.js → mount-preset-KxvtKgJb.js} +2 -2
- package/dist-library/options-1aDLK7JY.js +121 -0
- package/dist-library/{package-core-D0POW4Gd.js → package-core-WFK1RhAZ.js} +3 -3
- package/dist-library/{parser-standard-OToYcOBL.js → parser-standard-Yuf3A_VI.js} +3270 -3778
- package/dist-library/react-D5iGiUdL.js +7 -0
- package/dist-library/reactive-md-authoring.js +16 -18
- package/dist-library/reactive-md-build.js +51 -51
- package/dist-library/reactive-md-compiler-standard.js +10 -9
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-export.js +4 -4
- package/dist-library/reactive-md-minimal-react-preset.js +3 -3
- package/dist-library/reactive-md-pdf.js +127 -3
- package/dist-library/reactive-md-plugin-chart.js +2 -2
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +2 -2
- package/dist-library/reactive-md-plugin-gallery.js +2 -2
- package/dist-library/reactive-md-plugin-navigation.js +2 -2
- package/dist-library/reactive-md-plugin-network.js +117 -115
- package/dist-library/reactive-md-plugin-plot.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-server.js +6 -6
- package/dist-library/reactive-md-react-unstyled.js +10 -11
- package/dist-library/reactive-md-react.js +10 -11
- package/dist-library/reactive-md-sdk.js +3 -3
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +4 -4
- package/dist-library/reactive-md.js +280 -193
- package/dist-library/{registry-05JiqmEp.js → registry-B9NGct4d.js} +1 -1
- package/dist-library/{resources-IeJomeUT.js → resources-D2GDQS0p.js} +1 -1
- package/dist-library/{runtime-CuOyRe9f.js → runtime-kcA7bG7G.js} +341 -341
- package/dist-library/{schema-C-AeByPp.js → schema-BufhKUSM.js} +5 -5
- package/dist-library/{sdk-core-BJLJaVR5.js → sdk-core-BoJT1SIt.js} +490 -150
- package/dist-library/{session-core-BGka5D1J.js → session-core-nmJHuR9c.js} +170 -156
- package/dist-library/{shareable-jkGi2g6y.js → shareable-DpbE-59H.js} +207 -242
- package/dist-library/types/authoring/catalog.d.ts +1 -2
- package/dist-library/types/components/shared/visual-frame.d.ts +6 -2
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
- package/dist-library/types/local/compilation/compiler-services.d.ts +8 -4
- package/dist-library/types/local/compilation/compiler.d.ts +3 -3
- package/dist-library/types/local/compilation/session/incremental.d.ts +20 -5
- package/dist-library/types/local/compilation/streaming.d.ts +27 -0
- package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +48 -0
- package/dist-library/types/local/configuration/options-core.d.ts +1 -2
- package/dist-library/types/local/configuration/options.d.ts +1 -0
- package/dist-library/types/local/css/author-css.d.ts +66 -0
- package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
- package/dist-library/types/local/html/html.d.ts +39 -3
- package/dist-library/types/local/index.d.ts +1 -1
- package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
- package/dist-library/types/local/parsing/parse-session.d.ts +2 -2
- package/dist-library/types/local/parsing/parser-convert.d.ts +2 -1
- package/dist-library/types/local/parsing/parser-core.d.ts +8 -1
- package/dist-library/types/local/parsing/parser.d.ts +2 -2
- package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
- package/dist-library/types/local/rendering/document/LocalDocumentViewCore.d.ts +25 -1
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +1 -1
- package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
- package/dist-library/types/local/rendering/document/view-render-context.d.ts +11 -1
- package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
- package/dist-library/types/local/transport/worker.d.ts +27 -4
- package/dist-library/types/local/types.d.ts +52 -16
- package/dist-library/types/react/component-api.d.ts +10 -1
- package/dist-library/types/react/component-utils.d.ts +9 -1
- package/dist-library/types/react/sdk-core.d.ts +4 -1
- package/dist-library/types/shareable.d.ts +5 -4
- package/dist-library/types/standalone/prepare.d.ts +1 -1
- package/dist-library/types/standalone/session-core.d.ts +3 -2
- package/dist-library/{types-BFC5rzC4.js → types-BeNtPqdY.js} +1 -1
- package/dist-library/{validation-BlDL2uD9.js → validation-BEBA_HvS.js} +88 -72
- package/dist-library/{visual-frame-G8PHoj1e.js → visual-frame-CyV1FXzs.js} +6 -5
- package/dist-library/{visuals-BkYRmYGO.js → visuals-BZbZYA7w.js} +24181 -24180
- package/dist-standalone/reactive-md-standalone.js +124 -117
- package/docs/README-ch.md +2 -1
- package/docs/README.md +2 -1
- package/docs/compatibility/compatibility-ch.md +6 -6
- package/docs/compatibility/compatibility-en.md +6 -6
- package/docs/compatibility/source-versioning-ch.md +1 -1
- package/docs/compatibility/source-versioning-en.md +1 -1
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-development-reference-ch.md +2 -2
- package/docs/development/component-development-reference-en.md +2 -2
- package/docs/development/component-protocol-ch.md +2 -2
- package/docs/development/component-protocol-en.md +2 -2
- package/docs/development/extension-tutorial-ch.md +3 -3
- package/docs/development/extension-tutorial-en.md +3 -3
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/compiler-ch.md +3 -1
- package/docs/integration/compiler-en.md +3 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +2 -2
- package/docs/integration/extension-sdk-en.md +2 -2
- package/docs/integration/local-integration-ch.md +130 -8
- package/docs/integration/local-integration-en.md +130 -8
- package/docs/integration/shareable-export-ch.md +4 -2
- package/docs/integration/shareable-export-en.md +4 -2
- package/docs/reference/html-compatibility-ch.md +20 -67
- package/docs/reference/html-compatibility-en.md +19 -64
- package/docs/reference/public-api-ch.md +10 -7
- package/docs/reference/public-api-en.md +10 -7
- package/docs/releases/release-0.9.1-ch.md +29 -0
- package/docs/releases/release-0.9.1-en.md +29 -0
- package/examples/component-package/README-ch.md +1 -1
- package/examples/component-package/README.md +1 -1
- package/examples/game-2048-package/README-ch.md +1 -1
- package/examples/game-2048-package/README.md +1 -1
- package/examples/integration/README-ch.md +21 -2
- package/examples/integration/README.md +21 -2
- package/examples/integration/extension-sdk/README-ch.md +1 -1
- package/examples/integration/extension-sdk/README.md +1 -1
- package/examples/integration/streaming/index.html +48 -0
- package/examples/integration/streaming/main.js +175 -0
- package/examples/integration/streaming/package.json +13 -0
- package/examples/integration/streaming/worker.js +3 -0
- package/examples/minimal-extension/README-ch.md +3 -3
- package/examples/minimal-extension/README.md +3 -3
- package/examples/tetris-package/README-ch.md +1 -1
- package/examples/tetris-package/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalDocumentViewCore-BLG4hMuO.js +0 -9535
- package/dist-library/LocalReactiveDocumentCore-DVQ6WA9G.js +0 -259
- package/dist-library/component-utils-BvHL8VGt.js +0 -298
- package/dist-library/layout-C22VjZh0.js +0 -542
- package/dist-library/options-CdSKOi7p.js +0 -116
- package/dist-library/react-LY5qsVeP.js +0 -7
|
@@ -1,73 +1,82 @@
|
|
|
1
1
|
import { O as e } from "./preset-core-CKc5YXSM.js";
|
|
2
|
-
import { f as t, l as n, u as r } from "./config-validation-
|
|
3
|
-
import {
|
|
4
|
-
import { l as c, s as l, y as u } from "./config-
|
|
5
|
-
import { n as d } from "./registry-
|
|
6
|
-
import { _ as f, c as p, i as m, l as h, o as g, r as _, s as v } from "./shareable-
|
|
7
|
-
import { i as y, n as b, r as x, t as S } from "./resources-
|
|
2
|
+
import { f as t, l as n, u as r } from "./config-validation-F47AcE6o.js";
|
|
3
|
+
import { a as i, l as a, o, s } from "./parser-standard-Yuf3A_VI.js";
|
|
4
|
+
import { l as c, s as l, y as u } from "./config-BadfhjdP.js";
|
|
5
|
+
import { n as d } from "./registry-B9NGct4d.js";
|
|
6
|
+
import { _ as f, c as p, i as m, l as h, o as g, r as _, s as v } from "./shareable-DpbE-59H.js";
|
|
7
|
+
import { i as y, n as b, r as x, t as S } from "./resources-D2GDQS0p.js";
|
|
8
8
|
// src/export/render-markup.ts
|
|
9
|
-
var C = "data-rmd-extension-error",
|
|
10
|
-
function
|
|
9
|
+
var C = "data-rmd-extension-error", ee = "data-local-extension-error", te = "data-local-host-component", ne = "local-sdk-unavailable", w = 300, T = /(?:data-rmd-extension-error|data-local-extension-error|local-sdk-unavailable)/i;
|
|
10
|
+
function E(e, t) {
|
|
11
11
|
for (let n of e.attrs) if (n.name.toLowerCase() === t) return n.value;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
let n =
|
|
13
|
+
function D(e, t) {
|
|
14
|
+
let n = E(e, "class");
|
|
15
15
|
return n !== void 0 && n.split(/\s+/).includes(t);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function O(e) {
|
|
18
18
|
let t = e?.replace(/\s+/g, " ").trim();
|
|
19
|
-
if (t) return t.length >
|
|
19
|
+
if (t) return t.length > w ? `${t.slice(0, w)}…` : t;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let t =
|
|
21
|
+
function k(e) {
|
|
22
|
+
let t = E(e, C);
|
|
23
23
|
if (t !== void 0) {
|
|
24
|
-
let e =
|
|
24
|
+
let e = O(t);
|
|
25
25
|
return {
|
|
26
26
|
reason: "extension-error",
|
|
27
27
|
...e === void 0 ? {} : { detail: e }
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
31
|
-
let n =
|
|
32
|
-
if (n !== void 0 &&
|
|
33
|
-
let e =
|
|
30
|
+
if (E(e, ee) !== void 0) return { reason: "extension-error" };
|
|
31
|
+
let n = E(e, te);
|
|
32
|
+
if (n !== void 0 && D(e, ne)) {
|
|
33
|
+
let e = O(n);
|
|
34
34
|
return {
|
|
35
35
|
reason: "sdk-unavailable",
|
|
36
36
|
...e === void 0 ? {} : { component: e }
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (typeof e != "string" || e.trim() === "" || !
|
|
40
|
+
function A(e) {
|
|
41
|
+
if (typeof e != "string" || e.trim() === "" || !T.test(e)) return null;
|
|
42
42
|
let t;
|
|
43
43
|
try {
|
|
44
|
-
t =
|
|
44
|
+
t = o(e, { scriptingEnabled: !1 });
|
|
45
45
|
} catch {
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
let n = [];
|
|
49
|
-
for (
|
|
49
|
+
for (j(t, n); n.length > 0;) {
|
|
50
50
|
let e = n.pop();
|
|
51
51
|
if (!a.isElementNode(e)) continue;
|
|
52
|
-
let t =
|
|
52
|
+
let t = k(e);
|
|
53
53
|
if (t) return t;
|
|
54
54
|
let r = e.tagName.toLowerCase() === "template" ? a.getTemplateContent(e).childNodes : e.childNodes;
|
|
55
55
|
for (let e = r.length - 1; e >= 0; --e) n.push(r[e]);
|
|
56
56
|
}
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function j(e, t) {
|
|
60
60
|
for (let n = e.childNodes.length - 1; n >= 0; --n) t.push(e.childNodes[n]);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function M(e) {
|
|
63
63
|
return e.reason === "sdk-unavailable" ? e.component ? `Rendered output leaves host component <${e.component}> unavailable.` : "Rendered output leaves a host component unavailable." : e.detail ? `Rendered output contains an unavailable extension component: ${e.detail}` : "Rendered output contains an unavailable extension component.";
|
|
64
64
|
}
|
|
65
65
|
// src/export/print-document.ts
|
|
66
|
-
var
|
|
66
|
+
var N = "reactive-md-native-document", P = "reactive-md-native-frame", F = "reactive-md-export-root", I = "local-extended-fragment-frame", re = "http://www.w3.org/1999/xhtml", ie = /* @__PURE__ */ new Set(/* @__PURE__ */ "article.section.header.footer.div.p.span.figure.figcaption.h1.h2.h3.h4.h5.h6.blockquote.pre.code.br.hr.b.strong.i.em.u.s.del.mark.sub.sup.img.dl.dd.dt.ol.ul.li.table.caption.colgroup.col.thead.tbody.tfoot.tr.th.td".split(".")), ae = /* @__PURE__ */ new Set([
|
|
67
|
+
"alt",
|
|
68
|
+
"title",
|
|
69
|
+
"dir",
|
|
70
|
+
"lang",
|
|
71
|
+
"start",
|
|
72
|
+
"colspan",
|
|
73
|
+
"rowspan",
|
|
74
|
+
"scope"
|
|
75
|
+
]), oe = /^data:image\/(?:png|jpeg|gif|webp);base64,[a-z0-9+/]+=*$/i, se = /^reactive-md-html\/v[0-9]+$/, ce = /^\s*<!doctype html>/i, L = /* @__PURE__ */ new Set([
|
|
67
76
|
"script",
|
|
68
77
|
"base",
|
|
69
78
|
"link"
|
|
70
|
-
]),
|
|
79
|
+
]), R = /* @__PURE__ */ new Set([
|
|
71
80
|
"src",
|
|
72
81
|
"srcset",
|
|
73
82
|
"poster",
|
|
@@ -75,54 +84,54 @@ var P = "reactive-md-native-document", F = "reactive-md-native-frame", I = "reac
|
|
|
75
84
|
"xlink:href",
|
|
76
85
|
"background"
|
|
77
86
|
]);
|
|
78
|
-
function
|
|
87
|
+
function z(e) {
|
|
79
88
|
return a.isElementNode(e);
|
|
80
89
|
}
|
|
81
|
-
function
|
|
90
|
+
function B(e) {
|
|
82
91
|
return a.isTextNode(e);
|
|
83
92
|
}
|
|
84
|
-
function
|
|
93
|
+
function V(e) {
|
|
85
94
|
return a.getTemplateContent(e);
|
|
86
95
|
}
|
|
87
|
-
function
|
|
96
|
+
function H(e, t) {
|
|
88
97
|
return e.attrs.find((e) => e.name.toLowerCase() === t)?.value;
|
|
89
98
|
}
|
|
90
|
-
function
|
|
91
|
-
let t =
|
|
99
|
+
function U(e) {
|
|
100
|
+
let t = H(e, "class");
|
|
92
101
|
return t === void 0 ? [] : t.split(/\s+/).filter(Boolean);
|
|
93
102
|
}
|
|
94
|
-
function
|
|
95
|
-
return
|
|
103
|
+
function W(e, t) {
|
|
104
|
+
return U(e).includes(t);
|
|
96
105
|
}
|
|
97
|
-
function
|
|
98
|
-
for (let n of e.childNodes) if (
|
|
106
|
+
function G(e, t) {
|
|
107
|
+
for (let n of e.childNodes) if (z(n) && n.tagName.toLowerCase() === t) return n;
|
|
99
108
|
return null;
|
|
100
109
|
}
|
|
101
|
-
function
|
|
102
|
-
for (let n of e.childNodes) if (
|
|
110
|
+
function K(e, t) {
|
|
111
|
+
for (let n of e.childNodes) if (z(n) && n.tagName === "meta" && H(n, "name")?.trim().toLowerCase() === t) return H(n, "content");
|
|
103
112
|
}
|
|
104
|
-
function
|
|
105
|
-
let t =
|
|
106
|
-
return t !== void 0 &&
|
|
113
|
+
function le(e) {
|
|
114
|
+
let t = K(e, "reactive-md-html-format");
|
|
115
|
+
return t !== void 0 && se.test(t.trim()) && K(e, "reactive-md-output")?.trim().toLowerCase() === "static";
|
|
107
116
|
}
|
|
108
|
-
function
|
|
109
|
-
let t = e.childNodes.filter((e) => !(
|
|
110
|
-
return t.length === 1 &&
|
|
117
|
+
function q(e) {
|
|
118
|
+
let t = e.childNodes.filter((e) => !(B(e) && e.value.trim() === ""));
|
|
119
|
+
return t.length === 1 && z(t[0]) ? t[0] : null;
|
|
111
120
|
}
|
|
112
|
-
function
|
|
113
|
-
let t = e.childNodes.find((e) =>
|
|
114
|
-
if (!t || !
|
|
115
|
-
let n =
|
|
116
|
-
if (!n || !
|
|
117
|
-
let r =
|
|
118
|
-
if (!r || r.tagName !== "iframe" || !
|
|
119
|
-
let i =
|
|
120
|
-
if (!(i === void 0 || /\ballow-(?:same-origin|scripts)\b/i.test(i))) return
|
|
121
|
+
function ue(e) {
|
|
122
|
+
let t = e.childNodes.find((e) => z(e) && W(e, F));
|
|
123
|
+
if (!t || !z(t)) return;
|
|
124
|
+
let n = q(t);
|
|
125
|
+
if (!n || !W(n, N)) return;
|
|
126
|
+
let r = q(n);
|
|
127
|
+
if (!r || r.tagName !== "iframe" || !W(r, P)) return;
|
|
128
|
+
let i = H(r, "sandbox");
|
|
129
|
+
if (!(i === void 0 || /\ballow-(?:same-origin|scripts)\b/i.test(i))) return H(r, "srcdoc");
|
|
121
130
|
}
|
|
122
|
-
function
|
|
123
|
-
return e.childNodes.some((e) =>
|
|
131
|
+
function J(e) {
|
|
132
|
+
return e.childNodes.some((e) => z(e) && e.tagName === "meta" && H(e, "http-equiv")?.trim().toLowerCase() === "content-security-policy");
|
|
124
133
|
}
|
|
125
|
-
function
|
|
134
|
+
function de(e) {
|
|
126
135
|
return e.split(/[\s,]+/).some((e) => {
|
|
127
136
|
let t = e.trim();
|
|
128
137
|
if (t === "" || t.startsWith("#") || t.startsWith("//")) return t.startsWith("//");
|
|
@@ -130,50 +139,99 @@ function re(e) {
|
|
|
130
139
|
return n !== void 0 && n !== "data" && n !== "about";
|
|
131
140
|
});
|
|
132
141
|
}
|
|
133
|
-
function
|
|
142
|
+
function Y(e) {
|
|
134
143
|
let t = [];
|
|
135
144
|
for (let n of e) {
|
|
136
|
-
if (!
|
|
145
|
+
if (!z(n)) {
|
|
137
146
|
t.push(n);
|
|
138
147
|
continue;
|
|
139
148
|
}
|
|
140
149
|
let e = n.tagName.toLowerCase();
|
|
141
|
-
if (!(
|
|
150
|
+
if (!(L.has(e) || e === "meta" && H(n, "http-equiv") !== void 0)) {
|
|
142
151
|
if (n.attrs = n.attrs.filter((e) => {
|
|
143
152
|
let t = e.name.toLowerCase();
|
|
144
|
-
return t.startsWith("on") ? !1 : !
|
|
153
|
+
return t.startsWith("on") ? !1 : !R.has(t) || !de(e.value);
|
|
145
154
|
}), e === "template") {
|
|
146
|
-
let e =
|
|
147
|
-
e.childNodes =
|
|
155
|
+
let e = V(n);
|
|
156
|
+
e.childNodes = Y(e.childNodes);
|
|
148
157
|
}
|
|
149
|
-
n.childNodes =
|
|
158
|
+
n.childNodes = Y(n.childNodes), t.push(n);
|
|
150
159
|
}
|
|
151
160
|
}
|
|
152
161
|
return t;
|
|
153
162
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
let
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
function X(e, t) {
|
|
164
|
+
let n = H(e, "srcdoc"), r = H(e, "sandbox");
|
|
165
|
+
if (n && r !== void 0 && !/\ballow-(?:same-origin|scripts)\b/i.test(r) && t < 5) {
|
|
166
|
+
let e = G(i(n, { scriptingEnabled: !1 }), "html"), r = e && G(e, "head"), a = e && G(e, "body");
|
|
167
|
+
if (r && a && J(r)) return Z(a.childNodes, t + 1);
|
|
168
|
+
}
|
|
169
|
+
let a = H(e, "title");
|
|
170
|
+
return a ? [{
|
|
171
|
+
nodeName: "#text",
|
|
172
|
+
value: a,
|
|
173
|
+
parentNode: null
|
|
174
|
+
}] : [];
|
|
175
|
+
}
|
|
176
|
+
function Z(e, t) {
|
|
177
|
+
let n = [];
|
|
178
|
+
for (let r of e) {
|
|
179
|
+
if (B(r)) {
|
|
180
|
+
n.push(r);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (!z(r) || r.namespaceURI !== re) continue;
|
|
184
|
+
if (r.tagName === "iframe") {
|
|
185
|
+
let e = a.createElement("div", r.namespaceURI, []);
|
|
186
|
+
for (let n of X(r, t)) a.appendChild(e, n);
|
|
187
|
+
n.push(e);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (L.has(r.tagName) || r.tagName === "style" || r.tagName === "template") continue;
|
|
191
|
+
let e = Z(r.childNodes, t);
|
|
192
|
+
ie.has(r.tagName) ? (r.attrs = r.attrs.filter(({ name: e, value: t, namespace: n }) => !n && (ae.has(e) || r.tagName === "img" && e === "src" && oe.test(t))), r.childNodes = e, n.push(r)) : n.push(...e);
|
|
193
|
+
}
|
|
194
|
+
return n;
|
|
195
|
+
}
|
|
196
|
+
function Q(e) {
|
|
197
|
+
let t = !1;
|
|
198
|
+
for (let n of e.childNodes) {
|
|
199
|
+
if (!z(n)) continue;
|
|
200
|
+
if (H(n, "data-extended-html") !== "sandbox") {
|
|
201
|
+
Q(n) && (t = !0);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
let e = q(n);
|
|
205
|
+
e && e.tagName === "iframe" && W(e, I) && (n.childNodes = X(e, 0), t = !0);
|
|
206
|
+
}
|
|
207
|
+
return t;
|
|
208
|
+
}
|
|
209
|
+
function fe(e) {
|
|
210
|
+
if (!(e.includes(N) && e.includes(P)) && !e.includes(I)) return e;
|
|
211
|
+
let t = i(e, { scriptingEnabled: !1 }), n = G(t, "html"), r = n && G(n, "head"), o = n && G(n, "body");
|
|
212
|
+
if (!r || !o || !le(r)) return e;
|
|
213
|
+
let c = ue(o);
|
|
214
|
+
if (!c || !ce.test(c)) {
|
|
215
|
+
let n = o.childNodes.find((e) => z(e) && W(e, F));
|
|
216
|
+
return n && z(n) && Q(n) ? s(t, { scriptingEnabled: !1 }) : e;
|
|
217
|
+
}
|
|
218
|
+
let l = i(c, { scriptingEnabled: !1 }), u = G(l, "html"), d = u && G(u, "head"), f = u && G(u, "body");
|
|
219
|
+
if (!d || !f || !J(d)) return e;
|
|
220
|
+
let p = a.createElement("meta", r.namespaceURI, [{
|
|
163
221
|
name: "http-equiv",
|
|
164
222
|
value: "Content-Security-Policy"
|
|
165
223
|
}, {
|
|
166
224
|
name: "content",
|
|
167
225
|
value: "default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; frame-src about: data: blob:; base-uri 'none'; form-action 'none'"
|
|
168
|
-
}]),
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
...
|
|
172
|
-
...
|
|
173
|
-
...
|
|
174
|
-
],
|
|
226
|
+
}]), m = r.childNodes.filter((e) => z(e) && e.tagName === "style"), h = d.childNodes.filter((e) => z(e) && e.tagName === "style");
|
|
227
|
+
return d.childNodes = [
|
|
228
|
+
p,
|
|
229
|
+
...r.childNodes.filter((e) => z(e) && (e.tagName === "meta" || e.tagName === "title") && H(e, "http-equiv")?.toLowerCase() !== "refresh"),
|
|
230
|
+
...m,
|
|
231
|
+
...Y(h)
|
|
232
|
+
], f.childNodes = Y(f.childNodes), s(l, { scriptingEnabled: !1 });
|
|
175
233
|
}
|
|
176
|
-
async function
|
|
234
|
+
async function pe(e) {
|
|
177
235
|
let t = /[\u0000-\u001f\u007f-\u009f]/g, n = (e, n) => {
|
|
178
236
|
let r = typeof e.alt == "string" ? e.alt.replace(t, " ").trim() : "", i = r === "" || /^[a-z][a-z0-9+.-]*:/i.test(r) || r.startsWith("//") ? "" : r, a = i === "" ? `#${n + 1}` : i;
|
|
179
237
|
return a.length > 120 ? `${a.slice(0, 117)}...` : a;
|
|
@@ -204,7 +262,7 @@ async function ae(e) {
|
|
|
204
262
|
}), s;
|
|
205
263
|
}
|
|
206
264
|
// src/export/index.ts
|
|
207
|
-
function
|
|
265
|
+
function me(t, n) {
|
|
208
266
|
let r = l(n);
|
|
209
267
|
if (typeof t != "string" || !t.trim() || t.length > 33554432) throw TypeError("A standalone bundle must contain a nonempty script of at most 32 MiB.");
|
|
210
268
|
return Object.freeze({
|
|
@@ -280,7 +338,7 @@ function $(e) {
|
|
|
280
338
|
ok: o.length === 0
|
|
281
339
|
});
|
|
282
340
|
}
|
|
283
|
-
function
|
|
341
|
+
function he(e) {
|
|
284
342
|
if (e.document.source !== e.source) throw TypeError("The compiled document does not belong to this source.");
|
|
285
343
|
let t = f(e.state);
|
|
286
344
|
if (!t.ok) throw TypeError(t.diagnostics.map((e) => `[${e.code}] ${e.message}`).join("\n"));
|
|
@@ -293,8 +351,8 @@ function se(e) {
|
|
|
293
351
|
target: e.mode === "static" ? "static" : "offline"
|
|
294
352
|
});
|
|
295
353
|
if (!i.ok) throw TypeError(i.diagnostics.map((e) => `[${e.code}] ${e.message}`).join("\n"));
|
|
296
|
-
let a =
|
|
297
|
-
if (a) throw TypeError(
|
|
354
|
+
let a = A(e.staticMarkup);
|
|
355
|
+
if (a) throw TypeError(M(a));
|
|
298
356
|
return _({
|
|
299
357
|
...e,
|
|
300
358
|
compileOptions: {
|
|
@@ -308,4 +366,4 @@ function se(e) {
|
|
|
308
366
|
css: `${e.css}\n${i.css}`
|
|
309
367
|
});
|
|
310
368
|
}
|
|
311
|
-
export {
|
|
369
|
+
export { pe as a, fe as i, he as n, A as o, me as r, M as s, $ as t };
|