reactive-md 0.9.1 → 0.9.2
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 +333 -319
- package/CHANGELOG.md +334 -320
- package/CONTRIBUTING-ch.md +22 -22
- package/CONTRIBUTING.md +22 -22
- package/README-ch.md +431 -431
- package/README-en.md +431 -431
- package/README.md +429 -429
- package/SECURITY-ch.md +83 -83
- package/SECURITY.md +83 -83
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +263 -263
- package/cli/assets.mjs +395 -395
- package/cli/build.mjs +445 -445
- package/cli/check.mjs +444 -444
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +323 -323
- package/cli/init.mjs +1577 -1577
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +65 -65
- package/cli/migrate.mjs +368 -368
- package/cli/package-loader.mjs +41 -41
- package/cli/package.mjs +211 -211
- package/dist-library/{LocalDocumentView-sthUP0ct.js → LocalDocumentView-BuqgJZEY.js} +11 -11
- package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-DXE0I0Qc.js} +210 -209
- package/dist-library/{LocalReactiveDocumentCore-ZjQSGyHE.js → LocalReactiveDocumentCore-CWBe4Mm5.js} +8 -8
- package/dist-library/{authoring-Dsune4Hy.js → authoring-Ci_KzJ0q.js} +53 -53
- package/dist-library/{compile-wUv8KEge.js → compile-Dx6Uw3D9.js} +11 -11
- package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-DDDdvuLy.js} +883 -818
- package/dist-library/compiler-dxLPB9Ym.js +86 -0
- package/dist-library/{component-state-C52ZFJGl.js → component-state-BRwvTV0d.js} +15 -14
- package/dist-library/component-state-CwKX_SN5.js +763 -0
- package/dist-library/{config-BadfhjdP.js → config-DXLvctiZ.js} +68 -66
- package/dist-library/config-validation-D3D7Dy2J.js +586 -0
- package/dist-library/{controls-CcT6n7k_.js → controls-DoZyLCrV.js} +3 -3
- package/dist-library/{coordinate-CWS9p5q_.js → coordinate-B1VFK9fd.js} +2 -2
- package/dist-library/{data-table-Bgccxd7h.js → data-table-8-3F15Jf.js} +3 -3
- package/dist-library/{default-components-BwQf0oP-.js → default-components-s21NevON.js} +29 -28
- package/dist-library/{display-B-VhqVND.js → display-B_uutKkN.js} +1 -1
- package/dist-library/{config-validation-F47AcE6o.js → document-theme-C8J6UyNO.js} +193 -731
- package/dist-library/{export-BqVmTXm8.js → export-CIAIPBov.js} +35 -34
- package/dist-library/{gallery-CY6mTx8i.js → gallery-Dv1rOvL0.js} +1 -1
- package/dist-library/{html-CNT4KD-2.js → html-Cr4CBwAH.js} +42 -41
- package/dist-library/identity-BUx0Q_-d.js +40 -0
- package/dist-library/{incremental-Dv0FSp_U.js → incremental-9nx92u9c.js} +12 -10
- package/dist-library/{layout-C0YlEPGr.js → layout-BBB2VF0S.js} +1 -1
- package/dist-library/{mount-preset-KxvtKgJb.js → mount-preset-DMZ5wd3t.js} +3 -3
- package/dist-library/observability-4KqXhIEU.js +421 -0
- package/dist-library/observability-core-Bcu7vpnl.js +24 -0
- package/dist-library/{options-1aDLK7JY.js → options-BBp9IcHm.js} +4 -4
- package/dist-library/{package-core-WFK1RhAZ.js → package-core-K5xesGqy.js} +30 -29
- package/dist-library/{parser-standard-Yuf3A_VI.js → parser-standard-CBA1-hdG.js} +352 -352
- package/dist-library/{plugin-packs-B1XPWcFs.js → plugin-packs-Bh1HhLym.js} +3 -2
- package/dist-library/preset-core-DeZPA8IE.js +1298 -0
- package/dist-library/react-0DCh-Mar.js +7 -0
- package/dist-library/reactive-md-authoring.js +19 -19
- package/dist-library/reactive-md-build.js +48 -10
- package/dist-library/reactive-md-compiler-standard.js +6 -6
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-default-packs.js +3 -2
- package/dist-library/reactive-md-default-preset.js +3 -2
- package/dist-library/reactive-md-export.js +4 -4
- package/dist-library/reactive-md-minimal-preset.js +2 -2
- package/dist-library/reactive-md-minimal-react-preset.js +3 -3
- package/dist-library/reactive-md-observability.js +4 -0
- package/dist-library/reactive-md-plugin-chart.js +3 -3
- package/dist-library/reactive-md-plugin-data.js +5 -5
- package/dist-library/reactive-md-plugin-diagram.js +4 -4
- package/dist-library/reactive-md-plugin-forms.js +4 -4
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +3 -3
- package/dist-library/reactive-md-plugin-network.js +4 -3
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-print.css +304 -304
- 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 +11 -11
- package/dist-library/reactive-md-react.js +11 -11
- package/dist-library/reactive-md-runtime-browser.js +2 -1
- package/dist-library/reactive-md-runtime.js +4 -3
- package/dist-library/reactive-md-sdk.js +8 -7
- 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 +5 -5
- package/dist-library/reactive-md.js +556 -367
- package/dist-library/{registry-B9NGct4d.js → registry-D6OGkOcX.js} +3 -3
- package/dist-library/{registry-core-Bbad9Bm2.js → registry-core-C9xOunaw.js} +1 -1
- package/dist-library/{resources-D2GDQS0p.js → resources-B0x_w3s9.js} +71 -46
- package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
- package/dist-library/{runtime-kcA7bG7G.js → runtime-BpQdZmFI.js} +311 -305
- package/dist-library/{schema-BufhKUSM.js → schema-BryM_VRW.js} +14 -14
- package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-ChslheKs.js} +33 -32
- package/dist-library/{session-core-nmJHuR9c.js → session-core-dxQCJBNa.js} +15 -14
- package/dist-library/{shareable-DpbE-59H.js → shareable-B8xMoGEa.js} +179 -176
- package/dist-library/types/build/diagnostics.d.ts +1 -1
- package/dist-library/types/local/index.d.ts +6 -0
- package/dist-library/types/local/observability-codes.d.ts +2 -0
- package/dist-library/types/local/observability-core.d.ts +25 -0
- package/dist-library/types/local/observability-messages.d.ts +6 -0
- package/dist-library/types/local/observability.d.ts +43 -0
- package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
- package/dist-library/types/local/transport/worker.d.ts +52 -1
- package/dist-library/types/local/types.d.ts +8 -0
- package/dist-library/types/observability.d.ts +7 -0
- package/dist-library/{types-BeNtPqdY.js → types-Ib5kSScP.js} +1 -1
- package/dist-library/types-daDo2c_w.js +3 -0
- package/dist-library/{validation-BEBA_HvS.js → validation-B3RI0xOk.js} +251 -249
- package/dist-library/version-DAxuGOG2.js +147 -0
- package/dist-library/{visual-frame-CyV1FXzs.js → visual-frame-_rcd5HUv.js} +1 -1
- package/dist-library/{visuals-BZbZYA7w.js → visuals-DkDhNdEZ.js} +17 -17
- package/dist-standalone/reactive-md-standalone.js +118 -118
- package/docs/README-ch.md +101 -95
- package/docs/README.md +101 -95
- package/docs/compatibility/api-stability-ch.md +25 -0
- package/docs/compatibility/api-stability-en.md +25 -0
- package/docs/compatibility/compatibility-ch.md +146 -129
- package/docs/compatibility/compatibility-en.md +146 -129
- package/docs/compatibility/compatibility-manifest.schema.json +161 -0
- package/docs/compatibility/deprecation-ch.md +21 -0
- package/docs/compatibility/deprecation-en.md +21 -0
- package/docs/compatibility/source-versioning-ch.md +162 -162
- package/docs/compatibility/source-versioning-en.md +162 -162
- package/docs/compatibility/support-matrix-ch.md +108 -0
- package/docs/compatibility/support-matrix-en.md +108 -0
- package/docs/development/component-development-ch.md +66 -66
- package/docs/development/component-development-en.md +66 -66
- package/docs/development/component-development-reference-ch.md +253 -253
- package/docs/development/component-development-reference-en.md +238 -238
- package/docs/development/component-protocol-ch.md +748 -748
- package/docs/development/component-protocol-en.md +750 -750
- package/docs/development/extension-tutorial-ch.md +308 -308
- package/docs/development/extension-tutorial-en.md +308 -308
- package/docs/development/performance-overview-ch.md +422 -422
- package/docs/development/performance-overview-en.md +422 -422
- package/docs/guides/local-guide-ch.md +532 -532
- package/docs/guides/local-guide-en.md +532 -532
- package/docs/integration/author-tools-ch.md +64 -64
- package/docs/integration/author-tools-en.md +64 -64
- package/docs/integration/compiler-ch.md +49 -49
- package/docs/integration/compiler-en.md +36 -36
- package/docs/integration/directory-discovery-en.md +1 -1
- package/docs/integration/editor-ch.md +295 -295
- package/docs/integration/editor-en.md +303 -303
- package/docs/integration/extension-sdk-ch.md +394 -394
- package/docs/integration/extension-sdk-en.md +379 -379
- package/docs/integration/local-integration-ch.md +646 -646
- package/docs/integration/local-integration-en.md +662 -662
- package/docs/integration/shareable-export-ch.md +307 -307
- package/docs/integration/shareable-export-en.md +309 -309
- package/docs/reference/diagnostics-counting-ch.md +104 -104
- package/docs/reference/diagnostics-counting-en.md +104 -104
- package/docs/reference/html-compatibility-ch.md +93 -93
- package/docs/reference/html-compatibility-en.md +95 -95
- package/docs/reference/local-interaction-syntax-ch.md +724 -724
- package/docs/reference/local-interaction-syntax-en.md +722 -722
- package/docs/reference/public-api-ch.md +33 -4
- package/docs/reference/public-api-en.md +33 -4
- package/docs/reference/theme-protocol-ch.md +198 -198
- package/docs/reference/theme-protocol-en.md +217 -217
- package/docs/releases/release-0.4.0-ch.md +91 -91
- package/docs/releases/release-0.4.0-en.md +91 -91
- package/docs/releases/release-0.4.1-ch.md +25 -25
- package/docs/releases/release-0.4.1-en.md +25 -25
- package/docs/releases/release-0.5.0-ch.md +43 -43
- package/docs/releases/release-0.5.0-en.md +43 -43
- package/docs/releases/release-0.5.1-ch.md +41 -41
- package/docs/releases/release-0.5.1-en.md +41 -41
- package/docs/releases/release-0.5.2-ch.md +37 -37
- package/docs/releases/release-0.5.2-en.md +37 -37
- package/docs/releases/release-0.5.3-ch.md +26 -26
- package/docs/releases/release-0.5.3-en.md +26 -26
- package/docs/releases/release-0.6.0-ch.md +59 -59
- package/docs/releases/release-0.6.0-en.md +59 -59
- package/docs/releases/release-0.6.1-ch.md +29 -29
- package/docs/releases/release-0.6.1-en.md +29 -29
- package/docs/releases/release-0.7.0-ch.md +86 -86
- package/docs/releases/release-0.7.0-en.md +86 -86
- package/docs/releases/release-0.9.2-ch.md +33 -0
- package/docs/releases/release-0.9.2-en.md +33 -0
- package/examples/component-package/README-ch.md +101 -101
- package/examples/component-package/README.md +133 -133
- package/examples/conformance/README-ch.md +55 -55
- package/examples/conformance/README.md +55 -55
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/game-2048-package/LICENSE +21 -21
- package/examples/game-2048-package/NOTICES.md +11 -11
- package/examples/game-2048-package/README-ch.md +91 -91
- package/examples/game-2048-package/README.md +98 -98
- package/examples/game-2048-package/package.json +35 -35
- package/examples/game-2048-package/sample/document.reactive.md +17 -17
- package/examples/game-2048-package/scripts/build-export.mjs +44 -44
- package/examples/game-2048-package/scripts/build.mjs +130 -130
- package/examples/game-2048-package/scripts/verify.mjs +180 -180
- package/examples/game-2048-package/src/component.css +161 -161
- package/examples/game-2048-package/src/components.tsx +326 -326
- package/examples/game-2048-package/src/game-engine.ts +228 -228
- package/examples/game-2048-package/src/harness.tsx +34 -34
- package/examples/game-2048-package/src/manifest.ts +85 -85
- package/examples/game-2048-package/src/node-entry.ts +30 -30
- package/examples/game-2048-package/src/sample.ts +4 -4
- package/examples/game-2048-package/tsconfig.json +15 -15
- package/examples/integration/README-ch.md +82 -82
- package/examples/integration/README.md +82 -82
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/extension-sdk/README-ch.md +24 -24
- package/examples/integration/extension-sdk/README.md +24 -24
- package/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README-ch.md +76 -76
- package/examples/local/README.md +76 -76
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README-ch.md +22 -22
- package/examples/local/showcase/README.md +31 -31
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/examples/minimal-extension/README-ch.md +78 -78
- package/examples/minimal-extension/README.md +78 -78
- package/examples/minimal-extension/index.html +15 -15
- package/examples/minimal-extension/package.json +26 -26
- package/examples/minimal-extension/sample/document.reactive.md +10 -10
- package/examples/minimal-extension/scripts/build.mjs +32 -32
- package/examples/minimal-extension/scripts/export.mjs +72 -72
- package/examples/minimal-extension/scripts/test-node.mjs +75 -75
- package/examples/minimal-extension/src/extension.tsx +90 -90
- package/examples/minimal-extension/src/preview.tsx +12 -12
- package/examples/minimal-extension/src/source.ts +4 -4
- package/examples/minimal-extension/tsconfig.json +14 -14
- package/examples/sci-fi-theme/README-ch.md +133 -133
- package/examples/sci-fi-theme/README.md +148 -148
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
- package/examples/sci-fi-theme/demo/demo.css +638 -638
- package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
- package/examples/sci-fi-theme/demo/index.html +13 -13
- package/examples/sci-fi-theme/demo/main.tsx +215 -215
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
- package/examples/sci-fi-theme/docs/design-system.md +474 -474
- package/examples/sci-fi-theme/package.json +28 -28
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
- package/examples/sci-fi-theme/src/components.css +2370 -2370
- package/examples/sci-fi-theme/src/index.ts +6 -6
- package/examples/sci-fi-theme/src/notch.css +142 -142
- package/examples/sci-fi-theme/src/sci-fi.css +7 -7
- package/examples/sci-fi-theme/src/theme.ts +39 -39
- package/examples/sci-fi-theme/tsconfig.json +20 -20
- package/examples/sci-fi-theme/vite.config.ts +24 -24
- package/examples/tetris-package/LICENSE +21 -21
- package/examples/tetris-package/NOTICES.md +11 -11
- package/examples/tetris-package/README-ch.md +91 -91
- package/examples/tetris-package/README.md +95 -95
- package/examples/tetris-package/package.json +35 -35
- package/examples/tetris-package/sample/document.reactive.md +16 -16
- package/examples/tetris-package/scripts/build-export.mjs +44 -44
- package/examples/tetris-package/scripts/build.mjs +130 -130
- package/examples/tetris-package/scripts/verify.mjs +173 -173
- package/examples/tetris-package/src/component.css +145 -145
- package/examples/tetris-package/src/components.tsx +334 -334
- package/examples/tetris-package/src/harness.tsx +34 -34
- package/examples/tetris-package/src/manifests.ts +93 -93
- package/examples/tetris-package/src/node-entry.ts +16 -16
- package/examples/tetris-package/src/sample.ts +4 -4
- package/examples/tetris-package/src/tetris-engine.ts +325 -325
- package/examples/tetris-package/tsconfig.json +15 -15
- package/package.json +7 -1
- package/dist-library/compiler-eOfcinZs.js +0 -62
- package/dist-library/component-state-BoLCGee4.js +0 -801
- package/dist-library/preset-core-CKc5YXSM.js +0 -1443
- package/dist-library/react-D5iGiUdL.js +0 -7
|
@@ -1,121 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
1
|
+
import { D as e, _ as t, g as n, i as r, o as i, r as a, t as o, v as s, w as c, y as l } from "./version-DAxuGOG2.js";
|
|
2
|
+
import { v as u } from "./document-theme-C8J6UyNO.js";
|
|
3
|
+
import { a as d, n as f, s as p, t as m } from "./compile-Dx6Uw3D9.js";
|
|
4
|
+
import { C as h, S as g, _, a as v, c as y, d as b, h as x, i as S, m as C, n as w, o as T, p as ee, r as E, s as te, t as ne, v as re, w as D, x as O, y as ie } from "./config-validation-D3D7Dy2J.js";
|
|
5
|
+
import { A as ae, N as oe, a as se, i as ce, t as le } from "./preset-core-DeZPA8IE.js";
|
|
6
|
+
import { n as ue } from "./props-sJ8vk0cr.js";
|
|
7
|
+
import { p as de, r as fe, x as pe } from "./registry-core-C9xOunaw.js";
|
|
6
8
|
// node_modules/devlop/lib/default.js
|
|
7
|
-
function
|
|
9
|
+
function me() {}
|
|
8
10
|
// node_modules/mdast-util-to-string/lib/index.js
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let n = t ||
|
|
12
|
-
return
|
|
11
|
+
var he = {};
|
|
12
|
+
function ge(e, t) {
|
|
13
|
+
let n = t || he;
|
|
14
|
+
return _e(e, typeof n.includeImageAlt != "boolean" || n.includeImageAlt, typeof n.includeHtml != "boolean" || n.includeHtml);
|
|
13
15
|
}
|
|
14
|
-
function
|
|
15
|
-
if (
|
|
16
|
+
function _e(e, t, n) {
|
|
17
|
+
if (ye(e)) {
|
|
16
18
|
if ("value" in e) return e.type === "html" && !n ? "" : e.value;
|
|
17
19
|
if (t && "alt" in e && e.alt) return e.alt;
|
|
18
|
-
if ("children" in e) return
|
|
20
|
+
if ("children" in e) return ve(e.children, t, n);
|
|
19
21
|
}
|
|
20
|
-
return Array.isArray(e) ?
|
|
22
|
+
return Array.isArray(e) ? ve(e, t, n) : "";
|
|
21
23
|
}
|
|
22
|
-
function
|
|
24
|
+
function ve(e, t, n) {
|
|
23
25
|
let r = [], i = -1;
|
|
24
|
-
for (; ++i < e.length;) r[i] =
|
|
26
|
+
for (; ++i < e.length;) r[i] = _e(e[i], t, n);
|
|
25
27
|
return r.join("");
|
|
26
28
|
}
|
|
27
|
-
function
|
|
29
|
+
function ye(e) {
|
|
28
30
|
return !!(e && typeof e == "object");
|
|
29
31
|
}
|
|
30
32
|
// node_modules/micromark-util-chunked/index.js
|
|
31
|
-
function
|
|
33
|
+
function k(e, t, n, r) {
|
|
32
34
|
let i = e.length, a = 0, o;
|
|
33
35
|
if (t = t < 0 ? -t > i ? 0 : i + t : t > i ? i : t, n = n > 0 ? n : 0, r.length < 1e4) o = Array.from(r), o.unshift(t, n), e.splice(...o);
|
|
34
36
|
else for (n && e.splice(t, n); a < r.length;) o = r.slice(a, a + 1e4), o.unshift(t, 0), e.splice(...o), a += 1e4, t += 1e4;
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
return e.length > 0 ? (
|
|
38
|
+
function be(e, t) {
|
|
39
|
+
return e.length > 0 ? (k(e, e.length, 0, t), e) : t;
|
|
38
40
|
}
|
|
39
41
|
// node_modules/micromark-util-combine-extensions/index.js
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
+
var A = {}.hasOwnProperty;
|
|
43
|
+
function xe(e) {
|
|
42
44
|
let t = {}, n = -1;
|
|
43
|
-
for (; ++n < e.length;)
|
|
45
|
+
for (; ++n < e.length;) Se(t, e[n]);
|
|
44
46
|
return t;
|
|
45
47
|
}
|
|
46
|
-
function
|
|
48
|
+
function Se(e, t) {
|
|
47
49
|
let n;
|
|
48
50
|
for (n in t) {
|
|
49
|
-
let r = (
|
|
51
|
+
let r = (A.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n], a;
|
|
50
52
|
if (i) for (a in i) {
|
|
51
|
-
|
|
53
|
+
A.call(r, a) || (r[a] = []);
|
|
52
54
|
let e = i[a];
|
|
53
|
-
|
|
55
|
+
Ce(r[a], Array.isArray(e) ? e : e ? [e] : []);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
|
-
function
|
|
59
|
+
function Ce(e, t) {
|
|
58
60
|
let n = -1, r = [];
|
|
59
61
|
for (; ++n < t.length;) (t[n].add === "after" ? e : r).push(t[n]);
|
|
60
|
-
|
|
62
|
+
k(e, 0, 0, r);
|
|
61
63
|
}
|
|
62
64
|
// node_modules/micromark-util-normalize-identifier/index.js
|
|
63
|
-
function
|
|
65
|
+
function we(e) {
|
|
64
66
|
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
65
67
|
}
|
|
66
68
|
// node_modules/micromark-util-character/index.js
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
+
var Te = I(/[A-Za-z]/), Ee = I(/[\dA-Za-z]/), De = I(/[#-'*+\--9=?A-Z^-~]/);
|
|
70
|
+
function Oe(e) {
|
|
69
71
|
return e !== null && (e < 32 || e === 127);
|
|
70
72
|
}
|
|
71
|
-
var
|
|
72
|
-
function
|
|
73
|
+
var ke = I(/\d/), Ae = I(/[\dA-Fa-f]/), je = I(/[!-/:-@[-`{-~]/);
|
|
74
|
+
function j(e) {
|
|
73
75
|
return e !== null && e < -2;
|
|
74
76
|
}
|
|
75
|
-
function
|
|
77
|
+
function M(e) {
|
|
76
78
|
return e !== null && (e < 0 || e === 32);
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function N(e) {
|
|
79
81
|
return e === -2 || e === -1 || e === 32;
|
|
80
82
|
}
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
+
var P = I(/\p{P}|\p{S}/u), F = I(/\s/);
|
|
84
|
+
function I(e) {
|
|
83
85
|
return t;
|
|
84
86
|
function t(t) {
|
|
85
87
|
return t !== null && t > -1 && e.test(String.fromCharCode(t));
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
// node_modules/micromark-factory-space/index.js
|
|
89
|
-
function
|
|
91
|
+
function L(e, t, n, r) {
|
|
90
92
|
let i = r ? r - 1 : Infinity, a = 0;
|
|
91
93
|
return o;
|
|
92
94
|
function o(r) {
|
|
93
|
-
return
|
|
95
|
+
return N(r) ? (e.enter(n), s(r)) : t(r);
|
|
94
96
|
}
|
|
95
97
|
function s(r) {
|
|
96
|
-
return
|
|
98
|
+
return N(r) && a++ < i ? (e.consume(r), s) : (e.exit(n), t(r));
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
|
-
function
|
|
101
|
+
function Me(e, t, n, r, i, a) {
|
|
100
102
|
let o = 0;
|
|
101
103
|
return s;
|
|
102
104
|
function s(t) {
|
|
103
|
-
return a > 0 &&
|
|
105
|
+
return a > 0 && N(t) ? (e.enter(r), c(t)) : l(t);
|
|
104
106
|
}
|
|
105
107
|
function c(t) {
|
|
106
|
-
return
|
|
108
|
+
return N(t) && o < a ? (e.consume(t), o++, c) : (e.exit(r), l(t));
|
|
107
109
|
}
|
|
108
110
|
function l(e) {
|
|
109
111
|
return o >= i ? t(e) : n(e);
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
// node_modules/micromark-util-classify-character/index.js
|
|
113
|
-
function
|
|
114
|
-
if (e === null ||
|
|
115
|
-
if (
|
|
115
|
+
function Ne(e) {
|
|
116
|
+
if (e === null || M(e) || F(e)) return 1;
|
|
117
|
+
if (P(e)) return 2;
|
|
116
118
|
}
|
|
117
119
|
// node_modules/micromark-util-resolve-all/index.js
|
|
118
|
-
function
|
|
120
|
+
function Pe(e, t, n) {
|
|
119
121
|
let r = [], i = -1;
|
|
120
122
|
for (; ++i < e.length;) {
|
|
121
123
|
let a = e[i].resolveAll;
|
|
@@ -124,21 +126,21 @@ function Ne(e, t, n) {
|
|
|
124
126
|
return t;
|
|
125
127
|
}
|
|
126
128
|
// node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
127
|
-
var
|
|
129
|
+
var Fe = {
|
|
128
130
|
partial: !0,
|
|
129
|
-
tokenize:
|
|
131
|
+
tokenize: Ie
|
|
130
132
|
};
|
|
131
|
-
function
|
|
133
|
+
function Ie(e, t, n) {
|
|
132
134
|
return r;
|
|
133
135
|
function r(t) {
|
|
134
|
-
return
|
|
136
|
+
return N(t) ? L(e, i, "linePrefix")(t) : i(t);
|
|
135
137
|
}
|
|
136
138
|
function i(e) {
|
|
137
|
-
return e === null ||
|
|
139
|
+
return e === null || j(e) ? t(e) : n(e);
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
// src/local/html/html-table-names.ts
|
|
141
|
-
var
|
|
143
|
+
var Le = /* @__PURE__ */ new Set([
|
|
142
144
|
"table",
|
|
143
145
|
"caption",
|
|
144
146
|
"colgroup",
|
|
@@ -149,7 +151,7 @@ var Ie = /* @__PURE__ */ new Set([
|
|
|
149
151
|
"tr",
|
|
150
152
|
"th",
|
|
151
153
|
"td"
|
|
152
|
-
]),
|
|
154
|
+
]), R = {
|
|
153
155
|
colgroup: /* @__PURE__ */ new Set(["span"]),
|
|
154
156
|
col: /* @__PURE__ */ new Set(["span"]),
|
|
155
157
|
td: /* @__PURE__ */ new Set([
|
|
@@ -167,13 +169,13 @@ var Ie = /* @__PURE__ */ new Set([
|
|
|
167
169
|
"align"
|
|
168
170
|
])
|
|
169
171
|
};
|
|
170
|
-
function
|
|
172
|
+
function z(e, t) {
|
|
171
173
|
let n = t.trim();
|
|
172
174
|
return [
|
|
173
175
|
"colspan",
|
|
174
176
|
"rowspan",
|
|
175
177
|
"span"
|
|
176
|
-
].includes(e) ? /^\d{1,5}$/.test(n) && Number(n) <= (e === "rowspan" ? 65534 : 1e3) && Number(n) >= (e === "rowspan" ? 0 : 1) : e === "align" ?
|
|
178
|
+
].includes(e) ? /^\d{1,5}$/.test(n) && Number(n) <= (e === "rowspan" ? 65534 : 1e3) && Number(n) >= (e === "rowspan" ? 0 : 1) : e === "align" ? D(t) !== null : e !== "scope" || [
|
|
177
179
|
"row",
|
|
178
180
|
"col",
|
|
179
181
|
"rowgroup",
|
|
@@ -181,7 +183,7 @@ function B(e, t) {
|
|
|
181
183
|
].includes(n.toLowerCase());
|
|
182
184
|
}
|
|
183
185
|
// src/local/html/html-policy.ts
|
|
184
|
-
var
|
|
186
|
+
var Re = {
|
|
185
187
|
b: "strong",
|
|
186
188
|
strong: "strong",
|
|
187
189
|
i: "emphasis",
|
|
@@ -192,12 +194,12 @@ var Le = {
|
|
|
192
194
|
mark: "mark",
|
|
193
195
|
sup: "sup",
|
|
194
196
|
sub: "sub"
|
|
195
|
-
},
|
|
197
|
+
}, ze = /* @__PURE__ */ new Set([
|
|
196
198
|
"br",
|
|
197
199
|
"hr",
|
|
198
200
|
"img",
|
|
199
201
|
"col"
|
|
200
|
-
]),
|
|
202
|
+
]), Be = /* @__PURE__ */ new Set([
|
|
201
203
|
"pre",
|
|
202
204
|
"code",
|
|
203
205
|
"script",
|
|
@@ -209,12 +211,12 @@ var Le = {
|
|
|
209
211
|
"noembed",
|
|
210
212
|
"noframes",
|
|
211
213
|
"plaintext"
|
|
212
|
-
]),
|
|
214
|
+
]), Ve = /* @__PURE__ */ new Set([
|
|
213
215
|
"id",
|
|
214
216
|
"title",
|
|
215
217
|
"lang",
|
|
216
218
|
"dir"
|
|
217
|
-
]),
|
|
219
|
+
]), He = {
|
|
218
220
|
a: g,
|
|
219
221
|
img: /* @__PURE__ */ new Set([
|
|
220
222
|
"src",
|
|
@@ -224,9 +226,9 @@ var Le = {
|
|
|
224
226
|
]),
|
|
225
227
|
ol: /* @__PURE__ */ new Set(["start"]),
|
|
226
228
|
details: /* @__PURE__ */ new Set(["open"]),
|
|
227
|
-
...
|
|
229
|
+
...R
|
|
228
230
|
};
|
|
229
|
-
function
|
|
231
|
+
function Ue(e, t, n) {
|
|
230
232
|
let r = "";
|
|
231
233
|
for (let i = t; i < n; i += 1) {
|
|
232
234
|
let t = e[i];
|
|
@@ -236,36 +238,36 @@ function He(e, t, n) {
|
|
|
236
238
|
}
|
|
237
239
|
return -1;
|
|
238
240
|
}
|
|
239
|
-
function
|
|
241
|
+
function We(e, t, n) {
|
|
240
242
|
if (e.startsWith("<!-->", t)) return Math.min(n, t + 5);
|
|
241
243
|
if (e.startsWith("<!--->", t)) return Math.min(n, t + 6);
|
|
242
244
|
let r = e.indexOf("-->", t + 4);
|
|
243
245
|
return r < 0 || r + 3 > n ? n : r + 3;
|
|
244
246
|
}
|
|
245
|
-
function
|
|
247
|
+
function Ge(e) {
|
|
246
248
|
return e.trim().replace(/[\u0000- ]+/g, "");
|
|
247
249
|
}
|
|
248
|
-
function
|
|
249
|
-
let n = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
250
|
+
function B(e, t) {
|
|
251
|
+
let n = /^([a-z][a-z0-9+.-]*):/i.exec(Ge(e));
|
|
250
252
|
if (!n) return !1;
|
|
251
253
|
let r = n[1].toLowerCase();
|
|
252
254
|
return t === "image" ? r !== "http" && r !== "https" : r !== "http" && r !== "https" && r !== "mailto" && r !== "tel";
|
|
253
255
|
}
|
|
254
|
-
function Ge(e, t) {
|
|
255
|
-
return t === "class" || t === "style" || /^on[a-z]/i.test(t) ? !1 : t === "align" && v.has(e) || Be.has(t) || /^aria-[a-z0-9_.-]+$/.test(t) || /^data-[a-z0-9_.-]+$/.test(t) ? !0 : Ve[e]?.has(t) ?? !1;
|
|
256
|
-
}
|
|
257
256
|
function Ke(e, t) {
|
|
257
|
+
return t === "class" || t === "style" || /^on[a-z]/i.test(t) ? !1 : t === "align" && O.has(e) || Ve.has(t) || /^aria-[a-z0-9_.-]+$/.test(t) || /^data-[a-z0-9_.-]+$/.test(t) ? !0 : He[e]?.has(t) ?? !1;
|
|
258
|
+
}
|
|
259
|
+
function qe(e, t) {
|
|
258
260
|
return !(e === "dir" && ![
|
|
259
261
|
"ltr",
|
|
260
262
|
"rtl",
|
|
261
263
|
"auto"
|
|
262
|
-
].includes(t.trim().toLowerCase()) || e === "id" && t.trim() === "" || (e === "width" || e === "height") && !/^\d{1,6}$/.test(t.trim()) || e === "start" && !/^-?\d{1,9}$/.test(t.trim()) || !
|
|
264
|
+
].includes(t.trim().toLowerCase()) || e === "id" && t.trim() === "" || (e === "width" || e === "height") && !/^\d{1,6}$/.test(t.trim()) || e === "start" && !/^-?\d{1,9}$/.test(t.trim()) || !z(e, t) || e === "href" && B(t, "link") || e === "src" && B(t, "image"));
|
|
263
265
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
266
|
+
function Je(e, t) {
|
|
267
|
+
return O.has(e) ? D(t) : null;
|
|
266
268
|
}
|
|
267
|
-
// src/local/
|
|
268
|
-
var
|
|
269
|
+
// src/local/parsing/parser-capabilities.ts
|
|
270
|
+
var Ye = Object.freeze({}), Xe = Object.freeze([
|
|
269
271
|
"anchor",
|
|
270
272
|
"checkbox",
|
|
271
273
|
"column",
|
|
@@ -283,80 +285,80 @@ var Je = (e) => e.attrs?.bind ?? `@${e.id}`, Ye = "local-draft-3", Xe = Object.f
|
|
|
283
285
|
"toggle",
|
|
284
286
|
"validation"
|
|
285
287
|
]);
|
|
286
|
-
function
|
|
288
|
+
function Ze(e) {
|
|
287
289
|
let t = /* @__PURE__ */ new Set();
|
|
288
|
-
for (let n of
|
|
290
|
+
for (let n of Xe) e(n) || t.add(n);
|
|
289
291
|
return t;
|
|
290
292
|
}
|
|
291
293
|
// src/sdk/compiler-config.ts
|
|
292
|
-
var
|
|
293
|
-
id:
|
|
294
|
-
version:
|
|
295
|
-
}),
|
|
296
|
-
function
|
|
294
|
+
var V = Object.freeze({
|
|
295
|
+
id: ce,
|
|
296
|
+
version: se
|
|
297
|
+
}), H = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap();
|
|
298
|
+
function W(e, t = V) {
|
|
297
299
|
if (e.length === 0) return;
|
|
298
|
-
let n = t.id ===
|
|
300
|
+
let n = t.id === V.id && t.version === V.version;
|
|
299
301
|
if (n) {
|
|
300
|
-
let t =
|
|
302
|
+
let t = H.get(e);
|
|
301
303
|
if (t) return t;
|
|
302
304
|
}
|
|
303
|
-
let r =
|
|
304
|
-
protocol:
|
|
305
|
+
let r = le({
|
|
306
|
+
protocol: i,
|
|
305
307
|
id: t.id,
|
|
306
308
|
version: t.version,
|
|
307
309
|
components: e
|
|
308
310
|
});
|
|
309
|
-
return n &&
|
|
311
|
+
return n && H.set(e, r), r;
|
|
310
312
|
}
|
|
311
|
-
function
|
|
312
|
-
let a =
|
|
313
|
+
function G(e, t, n, r, i = "reactive-md-config/v1") {
|
|
314
|
+
let a = x(e, { legacyProfiles: t.length > 0 ? n : [] }), o = [...a.legacyKeys, ...r !== void 0 && !a.legacyKeys.some((e) => e.key === r) ? [Object.freeze({
|
|
313
315
|
profile: i,
|
|
314
316
|
key: r
|
|
315
317
|
})] : []];
|
|
316
|
-
return
|
|
318
|
+
return b(e, a, o);
|
|
317
319
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
320
|
+
function Qe(e) {
|
|
321
|
+
return v(e) || S("assembly", "must be an object."), E(e, /* @__PURE__ */ new Set([
|
|
320
322
|
"protocol",
|
|
321
323
|
"presets",
|
|
322
324
|
"components",
|
|
323
325
|
"replacementPolicy",
|
|
324
326
|
"themes"
|
|
325
|
-
]), "assembly"), e.protocol !== "reactive-md-assembly/v1" &&
|
|
327
|
+
]), "assembly"), e.protocol !== "reactive-md-assembly/v1" && S("assembly.protocol", `must be "${o}".`), C(e);
|
|
326
328
|
}
|
|
327
|
-
function
|
|
328
|
-
let
|
|
329
|
-
if (
|
|
330
|
-
let n =
|
|
331
|
-
return
|
|
329
|
+
function $e(e, t = [], n = []) {
|
|
330
|
+
let i = re(n);
|
|
331
|
+
if (v(e) || S("config", "must be an object."), E(e, ne, "config"), e.protocol === "reactive-md-config/v2") {
|
|
332
|
+
let n = Qe(e.assembly), r = G(n, t, i);
|
|
333
|
+
return ae(n) > 16777216 && S("config", `serialized size exceeds the ${w}-byte budget.`), r;
|
|
332
334
|
}
|
|
333
|
-
e.protocol !== "reactive-md-config/v1" &&
|
|
334
|
-
let
|
|
335
|
-
|
|
336
|
-
let
|
|
337
|
-
|
|
338
|
-
let
|
|
339
|
-
|
|
340
|
-
let
|
|
341
|
-
protocol:
|
|
342
|
-
presets: Object.freeze(
|
|
343
|
-
components:
|
|
335
|
+
e.protocol !== "reactive-md-config/v1" && S("config.protocol", `must be "${r}" (or legacy "${a}").`);
|
|
336
|
+
let s = te(e.presets, V, i)[0] ?? V, c = _(s, i);
|
|
337
|
+
c === void 0 && S("presets", `local.config.migration-unsupported: no compatibility profile matches preset "${s.id}" ${s.version}.`);
|
|
338
|
+
let l = c.legacyKeys[0];
|
|
339
|
+
l === void 0 && S("presets", `local.config.migration-unsupported: profile "${c.name}" has no legacy key mapping.`), y(c, t);
|
|
340
|
+
let u = T(e.components, t);
|
|
341
|
+
u.some((e) => e.replaces !== void 0) && S("config", "replaces is not supported by reactive-md-config/v1.");
|
|
342
|
+
let d = W(t, c.preset), f = Object.freeze({
|
|
343
|
+
protocol: o,
|
|
344
|
+
presets: Object.freeze(d ? [d] : []),
|
|
345
|
+
components: u,
|
|
344
346
|
replacementPolicy: "forbid",
|
|
345
347
|
themes: Object.freeze([])
|
|
346
|
-
}),
|
|
347
|
-
return
|
|
348
|
+
}), p = G(f, t, i, t.length > 0 ? ee(c.preset, u) : void 0, l.profile);
|
|
349
|
+
return ae(f) > 16777216 && S("config", `serialized size exceeds the ${w}-byte budget.`), p;
|
|
348
350
|
}
|
|
349
|
-
function
|
|
350
|
-
let t =
|
|
351
|
+
function et(e) {
|
|
352
|
+
let t = U.get(e);
|
|
351
353
|
if (t !== void 0) return t;
|
|
352
|
-
let n =
|
|
353
|
-
protocol:
|
|
354
|
+
let n = W(e), r = Object.freeze({
|
|
355
|
+
protocol: o,
|
|
354
356
|
presets: Object.freeze(n ? [n] : []),
|
|
355
357
|
components: Object.freeze([]),
|
|
356
358
|
replacementPolicy: "forbid",
|
|
357
359
|
themes: Object.freeze([])
|
|
358
|
-
}),
|
|
359
|
-
return
|
|
360
|
+
}), i = x(r).key;
|
|
361
|
+
return U.set(e, i), i;
|
|
360
362
|
}
|
|
361
363
|
// src/local/configuration/capability-policy.ts
|
|
362
364
|
var K = Object.freeze({
|
|
@@ -364,7 +366,7 @@ var K = Object.freeze({
|
|
|
364
366
|
enableJavaScript: !1,
|
|
365
367
|
enableExtendedHtml: !1
|
|
366
368
|
});
|
|
367
|
-
function
|
|
369
|
+
function tt(e, t) {
|
|
368
370
|
return {
|
|
369
371
|
enableCss: e?.enableCss === !0 && (t?.enableCss ?? K.enableCss) === !0,
|
|
370
372
|
enableJavaScript: e?.enableJavaScript === !0 && t?.enableJavaScript === !0,
|
|
@@ -372,32 +374,32 @@ function rt(e, t) {
|
|
|
372
374
|
};
|
|
373
375
|
}
|
|
374
376
|
// src/local/configuration/options-core.ts
|
|
375
|
-
var
|
|
377
|
+
var nt = [
|
|
376
378
|
"enableCss",
|
|
377
379
|
"enableJavaScript",
|
|
378
380
|
"enableExtendedHtml"
|
|
379
|
-
],
|
|
381
|
+
], rt = V;
|
|
380
382
|
function q(e) {
|
|
381
383
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
382
384
|
}
|
|
383
|
-
var
|
|
385
|
+
var it = "local.options.invalid.host-components", at = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, ot = /* @__PURE__ */ new Set([
|
|
384
386
|
"string",
|
|
385
387
|
"number",
|
|
386
388
|
"boolean",
|
|
387
389
|
"enum"
|
|
388
|
-
]),
|
|
390
|
+
]), st = /* @__PURE__ */ new Set([
|
|
389
391
|
"leaf",
|
|
390
392
|
"inline",
|
|
391
393
|
"container"
|
|
392
|
-
]),
|
|
394
|
+
]), ct = /* @__PURE__ */ new Set([
|
|
393
395
|
"string",
|
|
394
396
|
"number",
|
|
395
397
|
"boolean"
|
|
396
|
-
]),
|
|
398
|
+
]), lt = /* @__PURE__ */ new Set([
|
|
397
399
|
"bind",
|
|
398
400
|
"initial",
|
|
399
401
|
"disabled"
|
|
400
|
-
]),
|
|
402
|
+
]), ut = /* @__PURE__ */ new Set([
|
|
401
403
|
"maxSyntaxNodes",
|
|
402
404
|
"maxParseWork",
|
|
403
405
|
"maxMarkdownDepth"
|
|
@@ -429,11 +431,11 @@ function Y(e) {
|
|
|
429
431
|
return {
|
|
430
432
|
ok: !1,
|
|
431
433
|
message: `Compile option hostComponents is invalid: ${e}`,
|
|
432
|
-
key:
|
|
434
|
+
key: it,
|
|
433
435
|
detail: e
|
|
434
436
|
};
|
|
435
437
|
}
|
|
436
|
-
function
|
|
438
|
+
function dt(e, t) {
|
|
437
439
|
if (e === void 0) return {
|
|
438
440
|
ok: !0,
|
|
439
441
|
binding: void 0
|
|
@@ -449,7 +451,7 @@ function pt(e, t) {
|
|
|
449
451
|
"exclusive"
|
|
450
452
|
].includes(n)) return Y(`${t} "binding" has unknown field "${n}".`);
|
|
451
453
|
let n = e.kind;
|
|
452
|
-
if (typeof n != "string" || !
|
|
454
|
+
if (typeof n != "string" || !ct.has(n)) return Y(`${t} "binding.kind" has unsupported kind ${typeof n == "string" ? `"${n}"` : String(n)}.`);
|
|
453
455
|
let r = { kind: n };
|
|
454
456
|
if (Object.hasOwn(e, "exclusive") && e.exclusive !== void 0) {
|
|
455
457
|
if (typeof e.exclusive != "boolean") return Y(`${t} "binding.exclusive" must be a boolean.`);
|
|
@@ -512,7 +514,7 @@ function pt(e, t) {
|
|
|
512
514
|
binding: r
|
|
513
515
|
};
|
|
514
516
|
}
|
|
515
|
-
function
|
|
517
|
+
function ft(e, t) {
|
|
516
518
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
517
519
|
if (e === void 0) return {
|
|
518
520
|
ok: !0,
|
|
@@ -523,7 +525,7 @@ function mt(e, t) {
|
|
|
523
525
|
if (e.length > 32) return Y("accepts at most 32 components.");
|
|
524
526
|
let i = /* @__PURE__ */ new Set();
|
|
525
527
|
for (let e of t) i.add(e.name.toLowerCase());
|
|
526
|
-
for (let e of
|
|
528
|
+
for (let e of ie) i.add(e.name.toLowerCase());
|
|
527
529
|
for (let e of h) i.add(e.toLowerCase());
|
|
528
530
|
i.add("theme");
|
|
529
531
|
for (let t = 0; t < e.length; t += 1) {
|
|
@@ -532,22 +534,22 @@ function mt(e, t) {
|
|
|
532
534
|
let s = a.name;
|
|
533
535
|
if (typeof s != "string") return Y(`${o} "name" must be a string.`);
|
|
534
536
|
if (s.length > 128) return Y(`${o} "name" exceeds the 128-character limit.`);
|
|
535
|
-
if (!
|
|
537
|
+
if (!at.test(s)) return Y(`${o} "name" ${s} must use lowercase kebab-case.`);
|
|
536
538
|
if (i.has(s.toLowerCase())) return Y(`${o} "name" ${s} conflicts with a built-in component, HTML tag or theme.`);
|
|
537
539
|
if (r.has(s.toLowerCase())) return Y(`${o} "name" ${s} is declared more than once.`);
|
|
538
|
-
if (typeof a.form != "string" || !
|
|
539
|
-
let c = a.form, l =
|
|
540
|
+
if (typeof a.form != "string" || !st.has(a.form)) return Y(`${o} "form" must be "leaf", "inline" or "container".`);
|
|
541
|
+
let c = a.form, l = dt(a.binding, o);
|
|
540
542
|
if (!l.ok) return l;
|
|
541
543
|
let u = l.binding, d = a.props;
|
|
542
544
|
if (!q(d)) return Y(`${o} "props" must be an object.`);
|
|
543
|
-
let
|
|
545
|
+
let f = {};
|
|
544
546
|
for (let e of Object.keys(d)) {
|
|
545
|
-
if (!
|
|
546
|
-
if (u &&
|
|
547
|
+
if (!at.test(e)) return Y(`${o} property "${e}" must use lowercase kebab-case.`);
|
|
548
|
+
if (u && lt.has(e)) return Y(`${o} property "${e}" is reserved by the host binding.`);
|
|
547
549
|
let t = d[e];
|
|
548
550
|
if (!q(t)) return Y(`${o} property "${e}" must be an object.`);
|
|
549
551
|
let n = t.kind;
|
|
550
|
-
if (typeof n != "string" || !
|
|
552
|
+
if (typeof n != "string" || !ot.has(n)) return Y(`property "${e}" has unsupported kind ${typeof n == "string" ? `"${n}"` : String(n)}.`);
|
|
551
553
|
let r = { kind: n };
|
|
552
554
|
for (let n of ["required", "static"]) if (Object.hasOwn(t, n) && t[n] !== void 0) {
|
|
553
555
|
if (typeof t[n] != "boolean") return Y(`${o} property "${e}" "${n}" must be a boolean.`);
|
|
@@ -581,18 +583,18 @@ function mt(e, t) {
|
|
|
581
583
|
} catch {
|
|
582
584
|
return Y(`${o} property "${e}" "pattern" is not a valid regular expression.`);
|
|
583
585
|
}
|
|
584
|
-
if (!
|
|
586
|
+
if (!oe(n)) return Y(`${o} property "${e}" "pattern" uses unsupported regex syntax; nested quantifiers, quantified alternation, backreferences and lookarounds are rejected.`);
|
|
585
587
|
r.pattern = n;
|
|
586
588
|
}
|
|
587
|
-
|
|
589
|
+
f[e] = r;
|
|
588
590
|
}
|
|
589
|
-
let
|
|
591
|
+
let p = {
|
|
590
592
|
name: s,
|
|
591
593
|
form: c,
|
|
592
|
-
props:
|
|
594
|
+
props: f,
|
|
593
595
|
...u ? { binding: u } : {}
|
|
594
596
|
};
|
|
595
|
-
n.push(
|
|
597
|
+
n.push(p), r.set(s, p);
|
|
596
598
|
}
|
|
597
599
|
return {
|
|
598
600
|
ok: !0,
|
|
@@ -600,13 +602,13 @@ function mt(e, t) {
|
|
|
600
602
|
hostByName: r
|
|
601
603
|
};
|
|
602
604
|
}
|
|
603
|
-
function
|
|
605
|
+
function pt(e) {
|
|
604
606
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
605
607
|
}
|
|
606
|
-
function
|
|
608
|
+
function mt(e) {
|
|
607
609
|
let t = e.static === !0 || e.dynamic === !1;
|
|
608
610
|
if (e.kind === "enum") {
|
|
609
|
-
let n = `^(?:${(e.enum ?? []).map(
|
|
611
|
+
let n = `^(?:${(e.enum ?? []).map(pt).join("|")})$`;
|
|
610
612
|
if (n.length <= 512) return {
|
|
611
613
|
kind: "string",
|
|
612
614
|
...e.required === !0 ? { required: !0 } : {},
|
|
@@ -617,12 +619,12 @@ function gt(e) {
|
|
|
617
619
|
let n = { kind: e.kind };
|
|
618
620
|
return e.required === !0 && e.default === void 0 && (n.required = !0), t && (n.static = !0), e.enum && (n.enum = [...e.enum]), e.pattern !== void 0 && (n.pattern = e.pattern), n;
|
|
619
621
|
}
|
|
620
|
-
function
|
|
622
|
+
function ht(e) {
|
|
621
623
|
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
622
624
|
for (let i of e.components) {
|
|
623
625
|
let e = {};
|
|
624
|
-
for (let t of Object.keys(i.props)) e[t] =
|
|
625
|
-
let a =
|
|
626
|
+
for (let t of Object.keys(i.props)) e[t] = mt(i.props[t]);
|
|
627
|
+
let a = ue(i), o = {
|
|
626
628
|
name: i.name,
|
|
627
629
|
form: i.form,
|
|
628
630
|
props: e,
|
|
@@ -641,7 +643,7 @@ function X(e, t) {
|
|
|
641
643
|
for (let t of e) n.set(t.name, t);
|
|
642
644
|
let r = /* @__PURE__ */ new Map();
|
|
643
645
|
for (let e of t.values()) r.set(e.name, e);
|
|
644
|
-
for (let e of
|
|
646
|
+
for (let e of ie) r.has(e.name) || r.set(e.name, pe(e));
|
|
645
647
|
return {
|
|
646
648
|
componentByName: n,
|
|
647
649
|
schemaByName: r
|
|
@@ -649,32 +651,32 @@ function X(e, t) {
|
|
|
649
651
|
}
|
|
650
652
|
function Z(e) {
|
|
651
653
|
let t = /* @__PURE__ */ new Map();
|
|
652
|
-
for (let n of e) t.set(n.name,
|
|
654
|
+
for (let n of e) t.set(n.name, fe(n));
|
|
653
655
|
return t;
|
|
654
656
|
}
|
|
655
|
-
function
|
|
656
|
-
let
|
|
657
|
+
function gt(e, r) {
|
|
658
|
+
let i = r.defaults, a = new Set(i.map((e) => e.name));
|
|
657
659
|
if (e !== void 0 && !q(e)) return {
|
|
658
660
|
ok: !1,
|
|
659
661
|
message: "Compile options must be an object.",
|
|
660
662
|
key: "local.options.invalid.object"
|
|
661
663
|
};
|
|
662
|
-
let
|
|
663
|
-
for (let e of
|
|
664
|
-
if (!Object.hasOwn(
|
|
665
|
-
let t =
|
|
664
|
+
let o = e ?? {}, c = { ...K };
|
|
665
|
+
for (let e of nt) {
|
|
666
|
+
if (!Object.hasOwn(o, e)) continue;
|
|
667
|
+
let t = o[e];
|
|
666
668
|
if (t !== void 0) {
|
|
667
669
|
if (typeof t != "boolean") return {
|
|
668
670
|
ok: !1,
|
|
669
671
|
message: `Compile option ${e} must be a boolean.`,
|
|
670
672
|
key: "local.options.invalid.html-flag"
|
|
671
673
|
};
|
|
672
|
-
|
|
674
|
+
c[e] = t;
|
|
673
675
|
}
|
|
674
676
|
}
|
|
675
677
|
let l = !1;
|
|
676
|
-
if (Object.hasOwn(
|
|
677
|
-
let e =
|
|
678
|
+
if (Object.hasOwn(o, "markdownBreaks")) {
|
|
679
|
+
let e = o.markdownBreaks;
|
|
678
680
|
if (e !== void 0) {
|
|
679
681
|
if (typeof e != "boolean") return {
|
|
680
682
|
ok: !1,
|
|
@@ -685,8 +687,8 @@ function vt(e, t) {
|
|
|
685
687
|
}
|
|
686
688
|
}
|
|
687
689
|
let u = !0;
|
|
688
|
-
if (Object.hasOwn(
|
|
689
|
-
let e =
|
|
690
|
+
if (Object.hasOwn(o, "strict")) {
|
|
691
|
+
let e = o.strict;
|
|
690
692
|
if (e !== void 0) {
|
|
691
693
|
if (typeof e != "boolean") return {
|
|
692
694
|
ok: !1,
|
|
@@ -696,22 +698,22 @@ function vt(e, t) {
|
|
|
696
698
|
u = e;
|
|
697
699
|
}
|
|
698
700
|
}
|
|
699
|
-
if (Object.hasOwn(
|
|
700
|
-
let e =
|
|
701
|
+
if (Object.hasOwn(o, "sourcePhase")) {
|
|
702
|
+
let e = o.sourcePhase;
|
|
701
703
|
if (e !== void 0 && e !== "streaming" && e !== "final") return {
|
|
702
704
|
ok: !1,
|
|
703
705
|
message: "Compile option sourcePhase must be \"streaming\" or \"final\".",
|
|
704
706
|
key: "local.options.invalid.source-phase"
|
|
705
707
|
};
|
|
706
708
|
}
|
|
707
|
-
let d =
|
|
709
|
+
let d = o.limits, f = s, p = t, m = n;
|
|
708
710
|
if (d !== void 0) {
|
|
709
711
|
if (!q(d)) return {
|
|
710
712
|
ok: !1,
|
|
711
713
|
message: "Compile option limits must be an object.",
|
|
712
714
|
key: "local.options.invalid.limits"
|
|
713
715
|
};
|
|
714
|
-
for (let e of Object.keys(d)) if (!
|
|
716
|
+
for (let e of Object.keys(d)) if (!ut.has(e) && d[e] !== void 0) return {
|
|
715
717
|
ok: !1,
|
|
716
718
|
message: `Compile option limits.${e} is not supported.`,
|
|
717
719
|
key: "local.options.invalid.limits-unknown",
|
|
@@ -727,7 +729,7 @@ function vt(e, t) {
|
|
|
727
729
|
if (!n.ok) return n;
|
|
728
730
|
m = n.value;
|
|
729
731
|
}
|
|
730
|
-
let h = Object.hasOwn(
|
|
732
|
+
let h = Object.hasOwn(o, "config") && o.config !== void 0, g = Object.hasOwn(o, "hostComponents") && o.hostComponents !== void 0;
|
|
731
733
|
if (h && g) return {
|
|
732
734
|
ok: !1,
|
|
733
735
|
message: "Compile option config cannot be combined with hostComponents.",
|
|
@@ -736,7 +738,7 @@ function vt(e, t) {
|
|
|
736
738
|
let _, v, y, b, x, S, C, w, T;
|
|
737
739
|
if (h) {
|
|
738
740
|
try {
|
|
739
|
-
_ =
|
|
741
|
+
_ = r.readConfig(o.config, i);
|
|
740
742
|
} catch (e) {
|
|
741
743
|
let t = e instanceof Error ? e.message : String(e);
|
|
742
744
|
return {
|
|
@@ -746,24 +748,24 @@ function vt(e, t) {
|
|
|
746
748
|
detail: t
|
|
747
749
|
};
|
|
748
750
|
}
|
|
749
|
-
let e =
|
|
751
|
+
let e = ht(_);
|
|
750
752
|
v = e.hostComponents, y = e.hostByName, b = e.sdkByName, x = _.registry;
|
|
751
|
-
let
|
|
752
|
-
S =
|
|
753
|
+
let t = X(x, Z(x));
|
|
754
|
+
S = t.schemaByName, C = t.componentByName, w = new Set(_.components.map((e) => e.name)), T = /* @__PURE__ */ new Set();
|
|
753
755
|
} else if (g) {
|
|
754
|
-
let e =
|
|
756
|
+
let e = ft(o.hostComponents, i);
|
|
755
757
|
if (!e.ok) return e;
|
|
756
|
-
v = e.hostComponents, y = e.hostByName, b = /* @__PURE__ */ new Map(), x =
|
|
757
|
-
let t = Z(
|
|
758
|
-
for (let [n, r] of e.hostByName) t.set(n,
|
|
758
|
+
v = e.hostComponents, y = e.hostByName, b = /* @__PURE__ */ new Map(), x = i;
|
|
759
|
+
let t = Z(i);
|
|
760
|
+
for (let [n, r] of e.hostByName) t.set(n, pe({
|
|
759
761
|
...r,
|
|
760
762
|
legacyHost: !0
|
|
761
763
|
}));
|
|
762
|
-
let
|
|
763
|
-
S =
|
|
764
|
+
let n = X(i, t);
|
|
765
|
+
S = n.schemaByName, C = n.componentByName, w = new Set(e.hostByName.keys()), T = new Set(e.hostByName.keys());
|
|
764
766
|
} else {
|
|
765
|
-
v = [], y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), x =
|
|
766
|
-
let e = X(
|
|
767
|
+
v = [], y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), x = i;
|
|
768
|
+
let e = X(i, Z(i));
|
|
767
769
|
S = e.schemaByName, C = e.componentByName, w = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();
|
|
768
770
|
}
|
|
769
771
|
return {
|
|
@@ -771,7 +773,7 @@ function vt(e, t) {
|
|
|
771
773
|
maxSyntaxNodes: f,
|
|
772
774
|
maxParseWork: p,
|
|
773
775
|
maxMarkdownDepth: m,
|
|
774
|
-
html:
|
|
776
|
+
html: c,
|
|
775
777
|
markdownBreaks: l,
|
|
776
778
|
strict: u,
|
|
777
779
|
hostComponents: v,
|
|
@@ -781,27 +783,27 @@ function vt(e, t) {
|
|
|
781
783
|
registry: x,
|
|
782
784
|
componentByName: C,
|
|
783
785
|
schemaByName: S,
|
|
784
|
-
defaultComponentNames:
|
|
785
|
-
unmountedLeafNames: _?.presets.some((e) => e.id === "reactive-md/minimal") ?
|
|
786
|
+
defaultComponentNames: a,
|
|
787
|
+
unmountedLeafNames: _?.presets.some((e) => e.id === "reactive-md/minimal") ? Ze((e) => S.has(e)) : /* @__PURE__ */ new Set(),
|
|
786
788
|
externalComponentNames: w,
|
|
787
789
|
legacyHostNames: T,
|
|
788
|
-
componentConfigKey: _ ?
|
|
789
|
-
capabilities:
|
|
790
|
-
...
|
|
790
|
+
componentConfigKey: _ ? r.configKey(_) : r.defaultConfigKey,
|
|
791
|
+
capabilities: r.capabilities ?? Ye,
|
|
792
|
+
...r.preset ? { preset: r.preset } : {}
|
|
791
793
|
};
|
|
792
794
|
}
|
|
793
|
-
function
|
|
794
|
-
let r = t.length > 0 ?
|
|
795
|
-
return
|
|
795
|
+
function _t(e, t = [], n) {
|
|
796
|
+
let r = t.length > 0 ? rt : void 0;
|
|
797
|
+
return gt(e, {
|
|
796
798
|
defaults: t,
|
|
797
799
|
...r ? { preset: r } : {},
|
|
798
|
-
defaultConfigKey:
|
|
799
|
-
readConfig:
|
|
800
|
+
defaultConfigKey: et(t),
|
|
801
|
+
readConfig: $e,
|
|
800
802
|
configKey: (e) => e.key,
|
|
801
803
|
...n ? { capabilities: n } : {}
|
|
802
804
|
});
|
|
803
805
|
}
|
|
804
|
-
function
|
|
806
|
+
function vt(e) {
|
|
805
807
|
return e.componentConfigKey;
|
|
806
808
|
}
|
|
807
809
|
// src/local/configuration/kernel-value-rules.ts
|
|
@@ -810,9 +812,9 @@ function Q(e) {
|
|
|
810
812
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
811
813
|
return t;
|
|
812
814
|
}
|
|
813
|
-
function
|
|
815
|
+
function yt(e) {
|
|
814
816
|
let t = [];
|
|
815
|
-
for (let n of
|
|
817
|
+
for (let n of de(e)) switch (n.kind) {
|
|
816
818
|
case "value-date":
|
|
817
819
|
t.push(Q({
|
|
818
820
|
kind: "date",
|
|
@@ -846,16 +848,16 @@ function xt(e) {
|
|
|
846
848
|
}
|
|
847
849
|
return t;
|
|
848
850
|
}
|
|
849
|
-
function
|
|
851
|
+
function bt(e) {
|
|
850
852
|
if (!e || typeof e != "object") return;
|
|
851
853
|
let t = e.kernel;
|
|
852
854
|
if (t && typeof t == "object") return t;
|
|
853
855
|
}
|
|
854
|
-
var
|
|
855
|
-
function
|
|
856
|
-
return
|
|
856
|
+
var xt = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
857
|
+
function St(e) {
|
|
858
|
+
return xt.test(e);
|
|
857
859
|
}
|
|
858
|
-
function
|
|
860
|
+
function Ct(e, t, n) {
|
|
859
861
|
let r = [];
|
|
860
862
|
for (let i of e) {
|
|
861
863
|
let e = i.target;
|
|
@@ -881,23 +883,23 @@ function Tt(e, t, n) {
|
|
|
881
883
|
return r;
|
|
882
884
|
}
|
|
883
885
|
Object.freeze({
|
|
884
|
-
arrayLength:
|
|
886
|
+
arrayLength: l,
|
|
885
887
|
dataTableColumns: 20,
|
|
886
888
|
plotCurves: 16,
|
|
887
|
-
plotPoints:
|
|
889
|
+
plotPoints: e
|
|
888
890
|
});
|
|
889
891
|
// src/local/evaluation/computations.ts
|
|
890
892
|
function $(e, t, n) {
|
|
891
|
-
let r = t ?
|
|
893
|
+
let r = t ? f(t, n) : void 0;
|
|
892
894
|
return e.expressionOffset + (r ?? Math.max(0, e.source.indexOf(n)));
|
|
893
895
|
}
|
|
894
|
-
function
|
|
895
|
-
t instanceof
|
|
896
|
+
function wt(e, t, n, r = "local.expression") {
|
|
897
|
+
t instanceof d ? e(`${r}.${t.code || "invalid"}`, `Expression error: ${t.message}`, n + (Number.isFinite(t.offset) ? t.offset : 0)) : e(`${r}.invalid`, `Expression error: ${t instanceof Error ? t.message : String(t)}`, n);
|
|
896
898
|
}
|
|
897
|
-
function
|
|
898
|
-
return e instanceof
|
|
899
|
+
function Tt(e) {
|
|
900
|
+
return e instanceof d ? e : new d("expression-eval", e instanceof Error ? e.message : String(e), 0);
|
|
899
901
|
}
|
|
900
|
-
function
|
|
902
|
+
function Et(e, t) {
|
|
901
903
|
let n = new Set(e), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
902
904
|
for (let t of e) r.set(t, 0);
|
|
903
905
|
for (let a of e) for (let e of t(a)) {
|
|
@@ -923,23 +925,23 @@ function Ot(e, t) {
|
|
|
923
925
|
cyclic: e.filter((e) => !s.has(e))
|
|
924
926
|
};
|
|
925
927
|
}
|
|
926
|
-
function
|
|
928
|
+
function Dt(e) {
|
|
927
929
|
let t = Object.keys(e), n = new Set(t);
|
|
928
|
-
return
|
|
930
|
+
return Et(t, (t) => {
|
|
929
931
|
let r = e[t];
|
|
930
932
|
return r ? r.dependencies.filter((e) => n.has(e)) : [];
|
|
931
933
|
});
|
|
932
934
|
}
|
|
933
|
-
function
|
|
935
|
+
function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
934
936
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = [], l = /* @__PURE__ */ new Set();
|
|
935
937
|
for (let t of e) s.has(t.name) || (s.set(t.name, t), c.push(t.name));
|
|
936
938
|
let u = new Set(c);
|
|
937
939
|
for (let e of c) {
|
|
938
940
|
let t = s.get(e), r;
|
|
939
941
|
try {
|
|
940
|
-
r = i?.expression(t.source) ??
|
|
942
|
+
r = i?.expression(t.source) ?? m(t.source);
|
|
941
943
|
} catch (r) {
|
|
942
|
-
|
|
944
|
+
wt(n, r, t.expressionOffset), l.add(e);
|
|
943
945
|
continue;
|
|
944
946
|
}
|
|
945
947
|
a.set(e, r), o.set(e, [...r.dependencies]);
|
|
@@ -959,27 +961,27 @@ function At(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
959
961
|
Object.hasOwn(t, c) ? (n("local.computation.const", `Constant "${e}" cannot depend on ${r.has(c) ? "external data" : "control parameter"} "${c}".`, $(i, a.get(e), c)), d.add(e)) : o === "computed" && (n("local.computation.const", `Constant "${e}" cannot depend on computed value "${c}".`, $(i, a.get(e), c)), d.add(e));
|
|
960
962
|
}
|
|
961
963
|
}
|
|
962
|
-
let { order: f, cyclic:
|
|
963
|
-
if (
|
|
964
|
-
let e = new Set(
|
|
964
|
+
let { order: f, cyclic: h } = Et(c, (e) => o.get(e) ?? []);
|
|
965
|
+
if (h.length > 0) {
|
|
966
|
+
let e = new Set(h), t = [], r = /* @__PURE__ */ new Map(), i = h[0];
|
|
965
967
|
for (; !r.has(i);) {
|
|
966
968
|
r.set(i, t.length), t.push(i);
|
|
967
969
|
let n = (o.get(i) ?? []).find((t) => e.has(t));
|
|
968
970
|
if (n === void 0) break;
|
|
969
971
|
i = n;
|
|
970
972
|
}
|
|
971
|
-
let a = r.has(i) ? t.slice(r.get(i)) : [
|
|
973
|
+
let a = r.has(i) ? t.slice(r.get(i)) : [h[0]], c = a.slice(0, 12).join(" → ") + (a.length > 12 ? " → …" : ` → ${a[0]}`);
|
|
972
974
|
for (let e of a.slice(0, 100)) {
|
|
973
975
|
let t = s.get(e);
|
|
974
976
|
n("local.computation.cycle", `Computation "${e}" is part of a dependency cycle: ${c}.`, t.range.start, t.range.end);
|
|
975
977
|
}
|
|
976
|
-
for (let e of
|
|
978
|
+
for (let e of h) l.add(e);
|
|
977
979
|
}
|
|
978
980
|
for (let e of f) if (!l.has(e) && !(s.get(e).kind !== "const" || d.has(e)) && (o.get(e) ?? []).some((e) => u.has(e) ? s.get(e).kind === "const" && d.has(e) : !1)) {
|
|
979
981
|
let t = s.get(e);
|
|
980
982
|
n("local.computation.const", `Constant "${e}" indirectly depends on a value that is not a constant.`, t.expressionOffset), d.add(e);
|
|
981
983
|
}
|
|
982
|
-
let
|
|
984
|
+
let g = {}, _ = { ...t };
|
|
983
985
|
for (let e of f) {
|
|
984
986
|
if (l.has(e)) continue;
|
|
985
987
|
let t = s.get(e);
|
|
@@ -989,18 +991,18 @@ function At(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
989
991
|
}
|
|
990
992
|
let r = a.get(e);
|
|
991
993
|
try {
|
|
992
|
-
let t = i ? i.infer(r,
|
|
993
|
-
|
|
994
|
+
let t = i ? i.infer(r, _) : r.inferType(_);
|
|
995
|
+
g[e] = t, _[e] = t;
|
|
994
996
|
} catch (r) {
|
|
995
|
-
|
|
997
|
+
wt(n, r, t.expressionOffset), l.add(e);
|
|
996
998
|
}
|
|
997
999
|
}
|
|
998
|
-
let
|
|
999
|
-
l.add(e), Object.defineProperty(
|
|
1000
|
+
let v = {}, y = {}, b = /* @__PURE__ */ Error("failed constant read"), x = (e) => {
|
|
1001
|
+
l.add(e), Object.defineProperty(y, e, {
|
|
1000
1002
|
enumerable: !0,
|
|
1001
1003
|
configurable: !0,
|
|
1002
1004
|
get() {
|
|
1003
|
-
throw
|
|
1005
|
+
throw b;
|
|
1004
1006
|
}
|
|
1005
1007
|
});
|
|
1006
1008
|
};
|
|
@@ -1008,45 +1010,45 @@ function At(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
1008
1010
|
if (l.has(e) || s.get(e).kind !== "const" || d.has(e)) continue;
|
|
1009
1011
|
let t = s.get(e), r = a.get(e);
|
|
1010
1012
|
try {
|
|
1011
|
-
let i = r.evaluate(
|
|
1013
|
+
let i = r.evaluate(y), a = p(i);
|
|
1012
1014
|
if (a) {
|
|
1013
|
-
n("local.computation.budget", `Constant "${e}": ${a}`, t.expressionOffset),
|
|
1015
|
+
n("local.computation.budget", `Constant "${e}": ${a}`, t.expressionOffset), x(e);
|
|
1014
1016
|
continue;
|
|
1015
1017
|
}
|
|
1016
|
-
|
|
1018
|
+
v[e] = Array.isArray(i) ? i.slice() : i, y[e] = v[e];
|
|
1017
1019
|
} catch (r) {
|
|
1018
|
-
if (r ===
|
|
1019
|
-
|
|
1020
|
+
if (r === b) {
|
|
1021
|
+
x(e);
|
|
1020
1022
|
continue;
|
|
1021
1023
|
}
|
|
1022
|
-
let i =
|
|
1023
|
-
n("local.computation.expression", `Constant "${e}" cannot be evaluated: ${i.message}`, t.expressionOffset + (Number.isFinite(i.offset) ? i.offset : 0)),
|
|
1024
|
+
let i = Tt(r);
|
|
1025
|
+
n("local.computation.expression", `Constant "${e}" cannot be evaluated: ${i.message}`, t.expressionOffset + (Number.isFinite(i.offset) ? i.offset : 0)), x(e);
|
|
1024
1026
|
}
|
|
1025
1027
|
}
|
|
1026
|
-
let
|
|
1028
|
+
let S = {};
|
|
1027
1029
|
for (let e of c) {
|
|
1028
1030
|
let t = s.get(e);
|
|
1029
|
-
if (l.has(e) ||
|
|
1031
|
+
if (l.has(e) || g[e] === void 0) continue;
|
|
1030
1032
|
let n = {
|
|
1031
1033
|
name: e,
|
|
1032
1034
|
kind: t.kind,
|
|
1033
1035
|
source: t.source,
|
|
1034
1036
|
dependencies: [...o.get(e) ?? []],
|
|
1035
|
-
type:
|
|
1037
|
+
type: g[e],
|
|
1036
1038
|
nodeId: t.nodeId,
|
|
1037
1039
|
range: { ...t.range }
|
|
1038
1040
|
};
|
|
1039
|
-
t.kind === "const" && Object.hasOwn(
|
|
1041
|
+
t.kind === "const" && Object.hasOwn(v, e) && (n.value = v[e]), S[e] = n;
|
|
1040
1042
|
}
|
|
1041
1043
|
return {
|
|
1042
|
-
computations:
|
|
1043
|
-
kinds:
|
|
1044
|
+
computations: S,
|
|
1045
|
+
kinds: g,
|
|
1044
1046
|
order: f.filter((e) => !l.has(e)),
|
|
1045
1047
|
expressions: a,
|
|
1046
|
-
constValues:
|
|
1048
|
+
constValues: v
|
|
1047
1049
|
};
|
|
1048
1050
|
}
|
|
1049
|
-
function
|
|
1051
|
+
function kt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
1050
1052
|
let o = {}, s = /* @__PURE__ */ new Map(), c = {};
|
|
1051
1053
|
for (let [e, t] of Object.entries(r)) c[e] = t;
|
|
1052
1054
|
for (let [e, t] of a) Object.defineProperty(c, e, {
|
|
@@ -1062,11 +1064,11 @@ function jt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
|
1062
1064
|
if (!t || t.kind === "const") continue;
|
|
1063
1065
|
let i = n.get(r);
|
|
1064
1066
|
if (i) try {
|
|
1065
|
-
let e = i.evaluate(c), t =
|
|
1066
|
-
if (t) throw new
|
|
1067
|
+
let e = i.evaluate(c), t = p(e);
|
|
1068
|
+
if (t) throw new d("expression-budget", t, 0);
|
|
1067
1069
|
o[r] = e, c[r] = e;
|
|
1068
1070
|
} catch (e) {
|
|
1069
|
-
let t =
|
|
1071
|
+
let t = Tt(e);
|
|
1070
1072
|
s.set(r, t), Object.defineProperty(c, r, {
|
|
1071
1073
|
enumerable: !0,
|
|
1072
1074
|
configurable: !0,
|
|
@@ -1082,25 +1084,25 @@ function jt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
|
1082
1084
|
};
|
|
1083
1085
|
}
|
|
1084
1086
|
// src/local/evaluation/validation.ts
|
|
1085
|
-
var
|
|
1086
|
-
function
|
|
1087
|
-
return e.length > 2e3 ? `${
|
|
1087
|
+
var At = "local.validation.failed", jt = "local.validation.expression", Mt = "Validation failed.";
|
|
1088
|
+
function Nt(e) {
|
|
1089
|
+
return e.length > 2e3 ? `${u(e, c - 1)}…` : e;
|
|
1088
1090
|
}
|
|
1089
|
-
function
|
|
1091
|
+
function Pt(e) {
|
|
1090
1092
|
let t = e.trim();
|
|
1091
1093
|
return t ? t.split(/\s+/) : [];
|
|
1092
1094
|
}
|
|
1093
|
-
function
|
|
1095
|
+
function Ft(e) {
|
|
1094
1096
|
let t = [0];
|
|
1095
1097
|
for (let n = 0; n < e.length; n += 1) e[n] === "\n" && t.push(n + 1);
|
|
1096
1098
|
return t;
|
|
1097
1099
|
}
|
|
1098
|
-
function
|
|
1100
|
+
function It(e) {
|
|
1099
1101
|
if (!e || typeof e != "object") return !1;
|
|
1100
1102
|
let t = e, n = t.range;
|
|
1101
1103
|
return typeof t.expression == "string" && typeof t.message == "string" && Array.isArray(t.fields) && !!n && Number.isFinite(n.start) && Number.isFinite(n.end);
|
|
1102
1104
|
}
|
|
1103
|
-
function
|
|
1105
|
+
function Lt(e, t, n, r, i) {
|
|
1104
1106
|
let a = e.length, o = Math.max(0, Math.min(a, Math.trunc(n.start))), s = Math.max(o + 1, Math.min(a, Math.trunc(n.end))), c = 0, l = Math.max(0, t.length - 1);
|
|
1105
1107
|
for (; c < l;) {
|
|
1106
1108
|
let e = Math.ceil((c + l) / 2);
|
|
@@ -1118,4 +1120,4 @@ function zt(e, t, n, r, i) {
|
|
|
1118
1120
|
column: o - t[c] + 1
|
|
1119
1121
|
};
|
|
1120
1122
|
}
|
|
1121
|
-
export {
|
|
1123
|
+
export { k as $, R as A, De as B, Be as C, Ue as D, We as E, Ne as F, j as G, ke as H, L as I, P as J, M as K, Me as L, z as M, Fe as N, Ke as O, Pe as P, be as Q, Te as R, Re as S, Je as T, Ae as U, Oe as V, je as W, we as X, F as Y, xe as Z, vt as _, It as a, K as b, Lt as c, Ot as d, ge as et, St as f, nt as g, yt as h, Nt as i, Le as j, qe as k, kt as l, Ct as m, At as n, Ft as o, bt as p, N as q, Mt as r, Pt as s, jt as t, me as tt, Dt as u, _t as v, ze as w, tt as x, gt as y, Ee as z };
|