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,6 +1,6 @@
|
|
|
1
1
|
import { $ as e, A as t, F as n, I as r, N as i, Q as a, R as o, X as s, Z as c, a as l, i as u, it as d, q as f, st as p, t as m } from "./preset-core-CKc5YXSM.js";
|
|
2
|
-
import { D as h, E as g, O as _, T as v, V as y, _ as b, a as x, c as S, d as C, h as w, i as T, m as ee, n as E, o as te, p as ne, r as D, s as re, t as ie, v as ae, y as O } from "./config-validation-
|
|
3
|
-
import { a as k, n as oe, s as se, t as ce } from "./compile-
|
|
2
|
+
import { D as h, E as g, O as _, T as v, V as y, _ as b, a as x, c as S, d as C, h as w, i as T, m as ee, n as E, o as te, p as ne, r as D, s as re, t as ie, v as ae, y as O } from "./config-validation-F47AcE6o.js";
|
|
3
|
+
import { a as k, n as oe, s as se, t as ce } from "./compile-wUv8KEge.js";
|
|
4
4
|
import { n as le } from "./props-sJ8vk0cr.js";
|
|
5
5
|
import { p as ue, r as de, x as fe } from "./registry-core-Bbad9Bm2.js";
|
|
6
6
|
// node_modules/devlop/lib/default.js
|
|
@@ -308,14 +308,14 @@ function G(e, t = H) {
|
|
|
308
308
|
});
|
|
309
309
|
return n && U.set(e, r), r;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function $e(e, t, n, r, i = "reactive-md-config/v1") {
|
|
312
312
|
let a = w(e, { legacyProfiles: t.length > 0 ? n : [] }), o = [...a.legacyKeys, ...r !== void 0 && !a.legacyKeys.some((e) => e.key === r) ? [Object.freeze({
|
|
313
313
|
profile: i,
|
|
314
314
|
key: r
|
|
315
315
|
})] : []];
|
|
316
316
|
return C(e, a, o);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function et(e) {
|
|
319
319
|
return x(e) || T("assembly", "must be an object."), D(e, /* @__PURE__ */ new Set([
|
|
320
320
|
"protocol",
|
|
321
321
|
"presets",
|
|
@@ -324,10 +324,10 @@ function $e(e) {
|
|
|
324
324
|
"themes"
|
|
325
325
|
]), "assembly"), e.protocol !== "reactive-md-assembly/v1" && T("assembly.protocol", `must be "${i}".`), ee(e);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function tt(e, a = [], o = []) {
|
|
328
328
|
let s = ae(o);
|
|
329
329
|
if (x(e) || T("config", "must be an object."), D(e, ie, "config"), e.protocol === "reactive-md-config/v2") {
|
|
330
|
-
let n =
|
|
330
|
+
let n = et(e.assembly), r = $e(n, a, s);
|
|
331
331
|
return t(n) > 16777216 && T("config", `serialized size exceeds the ${E}-byte budget.`), r;
|
|
332
332
|
}
|
|
333
333
|
e.protocol !== "reactive-md-config/v1" && T("config.protocol", `must be "${r}" (or legacy "${n}").`);
|
|
@@ -343,10 +343,10 @@ function et(e, a = [], o = []) {
|
|
|
343
343
|
components: d,
|
|
344
344
|
replacementPolicy: "forbid",
|
|
345
345
|
themes: Object.freeze([])
|
|
346
|
-
}), m =
|
|
346
|
+
}), m = $e(p, a, s, a.length > 0 ? ne(l.preset, d) : void 0, u.profile);
|
|
347
347
|
return t(p) > 16777216 && T("config", `serialized size exceeds the ${E}-byte budget.`), m;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function nt(e) {
|
|
350
350
|
let t = W.get(e);
|
|
351
351
|
if (t !== void 0) return t;
|
|
352
352
|
let n = G(e), r = Object.freeze({
|
|
@@ -358,33 +358,46 @@ function tt(e) {
|
|
|
358
358
|
}), a = w(r).key;
|
|
359
359
|
return W.set(e, a), a;
|
|
360
360
|
}
|
|
361
|
+
// src/local/configuration/capability-policy.ts
|
|
362
|
+
var K = Object.freeze({
|
|
363
|
+
enableCss: !0,
|
|
364
|
+
enableJavaScript: !1,
|
|
365
|
+
enableExtendedHtml: !1
|
|
366
|
+
});
|
|
367
|
+
function rt(e, t) {
|
|
368
|
+
return {
|
|
369
|
+
enableCss: e?.enableCss === !0 && (t?.enableCss ?? K.enableCss) === !0,
|
|
370
|
+
enableJavaScript: e?.enableJavaScript === !0 && t?.enableJavaScript === !0,
|
|
371
|
+
enableExtendedHtml: e?.enableExtendedHtml === !0 && t?.enableExtendedHtml === !0
|
|
372
|
+
};
|
|
373
|
+
}
|
|
361
374
|
// src/local/configuration/options-core.ts
|
|
362
|
-
var
|
|
375
|
+
var it = [
|
|
363
376
|
"enableCss",
|
|
364
377
|
"enableJavaScript",
|
|
365
378
|
"enableExtendedHtml"
|
|
366
|
-
],
|
|
379
|
+
], at = H;
|
|
367
380
|
function q(e) {
|
|
368
381
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
369
382
|
}
|
|
370
|
-
var
|
|
383
|
+
var ot = "local.options.invalid.host-components", st = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, ct = /* @__PURE__ */ new Set([
|
|
371
384
|
"string",
|
|
372
385
|
"number",
|
|
373
386
|
"boolean",
|
|
374
387
|
"enum"
|
|
375
|
-
]),
|
|
388
|
+
]), lt = /* @__PURE__ */ new Set([
|
|
376
389
|
"leaf",
|
|
377
390
|
"inline",
|
|
378
391
|
"container"
|
|
379
|
-
]),
|
|
392
|
+
]), ut = /* @__PURE__ */ new Set([
|
|
380
393
|
"string",
|
|
381
394
|
"number",
|
|
382
395
|
"boolean"
|
|
383
|
-
]),
|
|
396
|
+
]), dt = /* @__PURE__ */ new Set([
|
|
384
397
|
"bind",
|
|
385
398
|
"initial",
|
|
386
399
|
"disabled"
|
|
387
|
-
]),
|
|
400
|
+
]), ft = /* @__PURE__ */ new Set([
|
|
388
401
|
"maxSyntaxNodes",
|
|
389
402
|
"maxParseWork",
|
|
390
403
|
"maxMarkdownDepth"
|
|
@@ -416,11 +429,11 @@ function Y(e) {
|
|
|
416
429
|
return {
|
|
417
430
|
ok: !1,
|
|
418
431
|
message: `Compile option hostComponents is invalid: ${e}`,
|
|
419
|
-
key:
|
|
432
|
+
key: ot,
|
|
420
433
|
detail: e
|
|
421
434
|
};
|
|
422
435
|
}
|
|
423
|
-
function
|
|
436
|
+
function pt(e, t) {
|
|
424
437
|
if (e === void 0) return {
|
|
425
438
|
ok: !0,
|
|
426
439
|
binding: void 0
|
|
@@ -436,7 +449,7 @@ function dt(e, t) {
|
|
|
436
449
|
"exclusive"
|
|
437
450
|
].includes(n)) return Y(`${t} "binding" has unknown field "${n}".`);
|
|
438
451
|
let n = e.kind;
|
|
439
|
-
if (typeof n != "string" || !
|
|
452
|
+
if (typeof n != "string" || !ut.has(n)) return Y(`${t} "binding.kind" has unsupported kind ${typeof n == "string" ? `"${n}"` : String(n)}.`);
|
|
440
453
|
let r = { kind: n };
|
|
441
454
|
if (Object.hasOwn(e, "exclusive") && e.exclusive !== void 0) {
|
|
442
455
|
if (typeof e.exclusive != "boolean") return Y(`${t} "binding.exclusive" must be a boolean.`);
|
|
@@ -499,7 +512,7 @@ function dt(e, t) {
|
|
|
499
512
|
binding: r
|
|
500
513
|
};
|
|
501
514
|
}
|
|
502
|
-
function
|
|
515
|
+
function mt(e, t) {
|
|
503
516
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
504
517
|
if (e === void 0) return {
|
|
505
518
|
ok: !0,
|
|
@@ -519,22 +532,22 @@ function ft(e, t) {
|
|
|
519
532
|
let s = a.name;
|
|
520
533
|
if (typeof s != "string") return Y(`${o} "name" must be a string.`);
|
|
521
534
|
if (s.length > 128) return Y(`${o} "name" exceeds the 128-character limit.`);
|
|
522
|
-
if (!
|
|
535
|
+
if (!st.test(s)) return Y(`${o} "name" ${s} must use lowercase kebab-case.`);
|
|
523
536
|
if (i.has(s.toLowerCase())) return Y(`${o} "name" ${s} conflicts with a built-in component, HTML tag or theme.`);
|
|
524
537
|
if (r.has(s.toLowerCase())) return Y(`${o} "name" ${s} is declared more than once.`);
|
|
525
|
-
if (typeof a.form != "string" || !
|
|
526
|
-
let c = a.form, l =
|
|
538
|
+
if (typeof a.form != "string" || !lt.has(a.form)) return Y(`${o} "form" must be "leaf", "inline" or "container".`);
|
|
539
|
+
let c = a.form, l = pt(a.binding, o);
|
|
527
540
|
if (!l.ok) return l;
|
|
528
541
|
let u = l.binding, d = a.props;
|
|
529
542
|
if (!q(d)) return Y(`${o} "props" must be an object.`);
|
|
530
543
|
let p = {};
|
|
531
544
|
for (let e of Object.keys(d)) {
|
|
532
|
-
if (!
|
|
533
|
-
if (u &&
|
|
545
|
+
if (!st.test(e)) return Y(`${o} property "${e}" must use lowercase kebab-case.`);
|
|
546
|
+
if (u && dt.has(e)) return Y(`${o} property "${e}" is reserved by the host binding.`);
|
|
534
547
|
let t = d[e];
|
|
535
548
|
if (!q(t)) return Y(`${o} property "${e}" must be an object.`);
|
|
536
549
|
let n = t.kind;
|
|
537
|
-
if (typeof n != "string" || !
|
|
550
|
+
if (typeof n != "string" || !ct.has(n)) return Y(`property "${e}" has unsupported kind ${typeof n == "string" ? `"${n}"` : String(n)}.`);
|
|
538
551
|
let r = { kind: n };
|
|
539
552
|
for (let n of ["required", "static"]) if (Object.hasOwn(t, n) && t[n] !== void 0) {
|
|
540
553
|
if (typeof t[n] != "boolean") return Y(`${o} property "${e}" "${n}" must be a boolean.`);
|
|
@@ -587,13 +600,13 @@ function ft(e, t) {
|
|
|
587
600
|
hostByName: r
|
|
588
601
|
};
|
|
589
602
|
}
|
|
590
|
-
function
|
|
603
|
+
function ht(e) {
|
|
591
604
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
592
605
|
}
|
|
593
|
-
function
|
|
606
|
+
function gt(e) {
|
|
594
607
|
let t = e.static === !0 || e.dynamic === !1;
|
|
595
608
|
if (e.kind === "enum") {
|
|
596
|
-
let n = `^(?:${(e.enum ?? []).map(
|
|
609
|
+
let n = `^(?:${(e.enum ?? []).map(ht).join("|")})$`;
|
|
597
610
|
if (n.length <= 512) return {
|
|
598
611
|
kind: "string",
|
|
599
612
|
...e.required === !0 ? { required: !0 } : {},
|
|
@@ -604,11 +617,11 @@ function mt(e) {
|
|
|
604
617
|
let n = { kind: e.kind };
|
|
605
618
|
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;
|
|
606
619
|
}
|
|
607
|
-
function
|
|
620
|
+
function _t(e) {
|
|
608
621
|
let t = [], n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
609
622
|
for (let i of e.components) {
|
|
610
623
|
let e = {};
|
|
611
|
-
for (let t of Object.keys(i.props)) e[t] =
|
|
624
|
+
for (let t of Object.keys(i.props)) e[t] = gt(i.props[t]);
|
|
612
625
|
let a = le(i), o = {
|
|
613
626
|
name: i.name,
|
|
614
627
|
form: i.form,
|
|
@@ -639,19 +652,15 @@ function Z(e) {
|
|
|
639
652
|
for (let n of e) t.set(n.name, de(n));
|
|
640
653
|
return t;
|
|
641
654
|
}
|
|
642
|
-
function
|
|
655
|
+
function vt(e, t) {
|
|
643
656
|
let n = t.defaults, r = new Set(n.map((e) => e.name));
|
|
644
657
|
if (e !== void 0 && !q(e)) return {
|
|
645
658
|
ok: !1,
|
|
646
659
|
message: "Compile options must be an object.",
|
|
647
660
|
key: "local.options.invalid.object"
|
|
648
661
|
};
|
|
649
|
-
let i = e ?? {}, o = {
|
|
650
|
-
|
|
651
|
-
enableJavaScript: !1,
|
|
652
|
-
enableExtendedHtml: !1
|
|
653
|
-
};
|
|
654
|
-
for (let e of nt) {
|
|
662
|
+
let i = e ?? {}, o = { ...K };
|
|
663
|
+
for (let e of it) {
|
|
655
664
|
if (!Object.hasOwn(i, e)) continue;
|
|
656
665
|
let t = i[e];
|
|
657
666
|
if (t !== void 0) {
|
|
@@ -687,6 +696,14 @@ function gt(e, t) {
|
|
|
687
696
|
u = e;
|
|
688
697
|
}
|
|
689
698
|
}
|
|
699
|
+
if (Object.hasOwn(i, "sourcePhase")) {
|
|
700
|
+
let e = i.sourcePhase;
|
|
701
|
+
if (e !== void 0 && e !== "streaming" && e !== "final") return {
|
|
702
|
+
ok: !1,
|
|
703
|
+
message: "Compile option sourcePhase must be \"streaming\" or \"final\".",
|
|
704
|
+
key: "local.options.invalid.source-phase"
|
|
705
|
+
};
|
|
706
|
+
}
|
|
690
707
|
let d = i.limits, f = a, p = c, m = s;
|
|
691
708
|
if (d !== void 0) {
|
|
692
709
|
if (!q(d)) return {
|
|
@@ -694,7 +711,7 @@ function gt(e, t) {
|
|
|
694
711
|
message: "Compile option limits must be an object.",
|
|
695
712
|
key: "local.options.invalid.limits"
|
|
696
713
|
};
|
|
697
|
-
for (let e of Object.keys(d)) if (!
|
|
714
|
+
for (let e of Object.keys(d)) if (!ft.has(e) && d[e] !== void 0) return {
|
|
698
715
|
ok: !1,
|
|
699
716
|
message: `Compile option limits.${e} is not supported.`,
|
|
700
717
|
key: "local.options.invalid.limits-unknown",
|
|
@@ -729,12 +746,12 @@ function gt(e, t) {
|
|
|
729
746
|
detail: t
|
|
730
747
|
};
|
|
731
748
|
}
|
|
732
|
-
let e =
|
|
749
|
+
let e = _t(_);
|
|
733
750
|
v = e.hostComponents, y = e.hostByName, b = e.sdkByName, x = _.registry;
|
|
734
751
|
let r = X(x, Z(x));
|
|
735
752
|
S = r.schemaByName, C = r.componentByName, w = new Set(_.components.map((e) => e.name)), T = /* @__PURE__ */ new Set();
|
|
736
753
|
} else if (g) {
|
|
737
|
-
let e =
|
|
754
|
+
let e = mt(i.hostComponents, n);
|
|
738
755
|
if (!e.ok) return e;
|
|
739
756
|
v = e.hostComponents, y = e.hostByName, b = /* @__PURE__ */ new Map(), x = n;
|
|
740
757
|
let t = Z(n);
|
|
@@ -755,7 +772,6 @@ function gt(e, t) {
|
|
|
755
772
|
maxParseWork: p,
|
|
756
773
|
maxMarkdownDepth: m,
|
|
757
774
|
html: o,
|
|
758
|
-
htmlActive: o.enableCss || o.enableJavaScript || o.enableExtendedHtml,
|
|
759
775
|
markdownBreaks: l,
|
|
760
776
|
strict: u,
|
|
761
777
|
hostComponents: v,
|
|
@@ -774,18 +790,18 @@ function gt(e, t) {
|
|
|
774
790
|
...t.preset ? { preset: t.preset } : {}
|
|
775
791
|
};
|
|
776
792
|
}
|
|
777
|
-
function
|
|
778
|
-
let r = t.length > 0 ?
|
|
779
|
-
return
|
|
793
|
+
function yt(e, t = [], n) {
|
|
794
|
+
let r = t.length > 0 ? at : void 0;
|
|
795
|
+
return vt(e, {
|
|
780
796
|
defaults: t,
|
|
781
797
|
...r ? { preset: r } : {},
|
|
782
|
-
defaultConfigKey:
|
|
783
|
-
readConfig:
|
|
798
|
+
defaultConfigKey: nt(t),
|
|
799
|
+
readConfig: tt,
|
|
784
800
|
configKey: (e) => e.key,
|
|
785
801
|
...n ? { capabilities: n } : {}
|
|
786
802
|
});
|
|
787
803
|
}
|
|
788
|
-
function
|
|
804
|
+
function bt(e) {
|
|
789
805
|
return e.componentConfigKey;
|
|
790
806
|
}
|
|
791
807
|
// src/local/configuration/kernel-value-rules.ts
|
|
@@ -794,7 +810,7 @@ function Q(e) {
|
|
|
794
810
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
795
811
|
return t;
|
|
796
812
|
}
|
|
797
|
-
function
|
|
813
|
+
function xt(e) {
|
|
798
814
|
let t = [];
|
|
799
815
|
for (let n of ue(e)) switch (n.kind) {
|
|
800
816
|
case "value-date":
|
|
@@ -830,16 +846,16 @@ function yt(e) {
|
|
|
830
846
|
}
|
|
831
847
|
return t;
|
|
832
848
|
}
|
|
833
|
-
function
|
|
849
|
+
function St(e) {
|
|
834
850
|
if (!e || typeof e != "object") return;
|
|
835
851
|
let t = e.kernel;
|
|
836
852
|
if (t && typeof t == "object") return t;
|
|
837
853
|
}
|
|
838
|
-
var
|
|
839
|
-
function
|
|
840
|
-
return
|
|
854
|
+
var Ct = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
855
|
+
function wt(e) {
|
|
856
|
+
return Ct.test(e);
|
|
841
857
|
}
|
|
842
|
-
function
|
|
858
|
+
function Tt(e, t, n) {
|
|
843
859
|
let r = [];
|
|
844
860
|
for (let i of e) {
|
|
845
861
|
let e = i.target;
|
|
@@ -875,13 +891,13 @@ function $(e, t, n) {
|
|
|
875
891
|
let r = t ? oe(t, n) : void 0;
|
|
876
892
|
return e.expressionOffset + (r ?? Math.max(0, e.source.indexOf(n)));
|
|
877
893
|
}
|
|
878
|
-
function
|
|
894
|
+
function Et(e, t, n, r = "local.expression") {
|
|
879
895
|
t instanceof k ? 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);
|
|
880
896
|
}
|
|
881
|
-
function
|
|
897
|
+
function Dt(e) {
|
|
882
898
|
return e instanceof k ? e : new k("expression-eval", e instanceof Error ? e.message : String(e), 0);
|
|
883
899
|
}
|
|
884
|
-
function
|
|
900
|
+
function Ot(e, t) {
|
|
885
901
|
let n = new Set(e), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
886
902
|
for (let t of e) r.set(t, 0);
|
|
887
903
|
for (let a of e) for (let e of t(a)) {
|
|
@@ -907,14 +923,14 @@ function Et(e, t) {
|
|
|
907
923
|
cyclic: e.filter((e) => !s.has(e))
|
|
908
924
|
};
|
|
909
925
|
}
|
|
910
|
-
function
|
|
926
|
+
function kt(e) {
|
|
911
927
|
let t = Object.keys(e), n = new Set(t);
|
|
912
|
-
return
|
|
928
|
+
return Ot(t, (t) => {
|
|
913
929
|
let r = e[t];
|
|
914
930
|
return r ? r.dependencies.filter((e) => n.has(e)) : [];
|
|
915
931
|
});
|
|
916
932
|
}
|
|
917
|
-
function
|
|
933
|
+
function At(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
918
934
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = [], l = /* @__PURE__ */ new Set();
|
|
919
935
|
for (let t of e) s.has(t.name) || (s.set(t.name, t), c.push(t.name));
|
|
920
936
|
let u = new Set(c);
|
|
@@ -923,7 +939,7 @@ function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
923
939
|
try {
|
|
924
940
|
r = i?.expression(t.source) ?? ce(t.source);
|
|
925
941
|
} catch (r) {
|
|
926
|
-
|
|
942
|
+
Et(n, r, t.expressionOffset), l.add(e);
|
|
927
943
|
continue;
|
|
928
944
|
}
|
|
929
945
|
a.set(e, r), o.set(e, [...r.dependencies]);
|
|
@@ -943,7 +959,7 @@ function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
943
959
|
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));
|
|
944
960
|
}
|
|
945
961
|
}
|
|
946
|
-
let { order: f, cyclic: p } =
|
|
962
|
+
let { order: f, cyclic: p } = Ot(c, (e) => o.get(e) ?? []);
|
|
947
963
|
if (p.length > 0) {
|
|
948
964
|
let e = new Set(p), t = [], r = /* @__PURE__ */ new Map(), i = p[0];
|
|
949
965
|
for (; !r.has(i);) {
|
|
@@ -976,7 +992,7 @@ function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
976
992
|
let t = i ? i.infer(r, h) : r.inferType(h);
|
|
977
993
|
m[e] = t, h[e] = t;
|
|
978
994
|
} catch (r) {
|
|
979
|
-
|
|
995
|
+
Et(n, r, t.expressionOffset), l.add(e);
|
|
980
996
|
}
|
|
981
997
|
}
|
|
982
998
|
let g = {}, _ = {}, v = /* @__PURE__ */ Error("failed constant read"), y = (e) => {
|
|
@@ -1003,7 +1019,7 @@ function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
1003
1019
|
y(e);
|
|
1004
1020
|
continue;
|
|
1005
1021
|
}
|
|
1006
|
-
let i =
|
|
1022
|
+
let i = Dt(r);
|
|
1007
1023
|
n("local.computation.expression", `Constant "${e}" cannot be evaluated: ${i.message}`, t.expressionOffset + (Number.isFinite(i.offset) ? i.offset : 0)), y(e);
|
|
1008
1024
|
}
|
|
1009
1025
|
}
|
|
@@ -1030,7 +1046,7 @@ function Ot(e, t, n, r = /* @__PURE__ */ new Set(), i) {
|
|
|
1030
1046
|
constValues: g
|
|
1031
1047
|
};
|
|
1032
1048
|
}
|
|
1033
|
-
function
|
|
1049
|
+
function jt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
1034
1050
|
let o = {}, s = /* @__PURE__ */ new Map(), c = {};
|
|
1035
1051
|
for (let [e, t] of Object.entries(r)) c[e] = t;
|
|
1036
1052
|
for (let [e, t] of a) Object.defineProperty(c, e, {
|
|
@@ -1050,7 +1066,7 @@ function kt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
|
1050
1066
|
if (t) throw new k("expression-budget", t, 0);
|
|
1051
1067
|
o[r] = e, c[r] = e;
|
|
1052
1068
|
} catch (e) {
|
|
1053
|
-
let t =
|
|
1069
|
+
let t = Dt(e);
|
|
1054
1070
|
s.set(r, t), Object.defineProperty(c, r, {
|
|
1055
1071
|
enumerable: !0,
|
|
1056
1072
|
configurable: !0,
|
|
@@ -1066,25 +1082,25 @@ function kt(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
|
1066
1082
|
};
|
|
1067
1083
|
}
|
|
1068
1084
|
// src/local/evaluation/validation.ts
|
|
1069
|
-
var
|
|
1070
|
-
function
|
|
1085
|
+
var Mt = "local.validation.failed", Nt = "local.validation.expression", Pt = "Validation failed.";
|
|
1086
|
+
function Ft(e) {
|
|
1071
1087
|
return e.length > 2e3 ? `${y(e, d - 1)}…` : e;
|
|
1072
1088
|
}
|
|
1073
|
-
function
|
|
1089
|
+
function It(e) {
|
|
1074
1090
|
let t = e.trim();
|
|
1075
1091
|
return t ? t.split(/\s+/) : [];
|
|
1076
1092
|
}
|
|
1077
|
-
function
|
|
1093
|
+
function Lt(e) {
|
|
1078
1094
|
let t = [0];
|
|
1079
1095
|
for (let n = 0; n < e.length; n += 1) e[n] === "\n" && t.push(n + 1);
|
|
1080
1096
|
return t;
|
|
1081
1097
|
}
|
|
1082
|
-
function
|
|
1098
|
+
function Rt(e) {
|
|
1083
1099
|
if (!e || typeof e != "object") return !1;
|
|
1084
1100
|
let t = e, n = t.range;
|
|
1085
1101
|
return typeof t.expression == "string" && typeof t.message == "string" && Array.isArray(t.fields) && !!n && Number.isFinite(n.start) && Number.isFinite(n.end);
|
|
1086
1102
|
}
|
|
1087
|
-
function
|
|
1103
|
+
function zt(e, t, n, r, i) {
|
|
1088
1104
|
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);
|
|
1089
1105
|
for (; c < l;) {
|
|
1090
1106
|
let e = Math.ceil((c + l) / 2);
|
|
@@ -1102,4 +1118,4 @@ function Lt(e, t, n, r, i) {
|
|
|
1102
1118
|
column: o - t[c] + 1
|
|
1103
1119
|
};
|
|
1104
1120
|
}
|
|
1105
|
-
export {
|
|
1121
|
+
export { be as $, Ge as A, we as B, Je as C, qe as D, Re as E, Pe as F, ke as G, Ee as H, Ne as I, N as J, Ae as K, Me as L, z as M, Ie as N, Ue as O, B as P, Ce as Q, R, Ye as S, ze as T, De as U, Te as V, Oe as W, F as X, P as Y, I as Z, bt as _, Rt as a, K as b, zt as c, At as d, ye as et, wt as f, it as g, xt as h, Ft as i, Ke as j, He as k, jt as l, Tt as m, Mt as n, he as nt, Lt as o, St as p, M as q, Pt as r, pe as rt, It as s, Nt as t, A as tt, kt as u, yt as v, Le as w, rt as x, vt as y, je as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e, t } from "./display-
|
|
1
|
+
import { r as e, t } from "./display-B-VhqVND.js";
|
|
2
2
|
import { createElement as n, useId as r } from "react";
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
4
|
// src/local/rendering/math-view.tsx
|
|
@@ -30,14 +30,15 @@ function c({ children: e, className: t = "", scrollClassName: n = "", tableProps
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
// src/components/shared/visual-frame.tsx
|
|
33
|
-
function l({ className: e, label: t, children: n, component: o }) {
|
|
34
|
-
let
|
|
33
|
+
function l({ className: e, label: t, children: n, component: o, authorRoot: s }) {
|
|
34
|
+
let c = r();
|
|
35
35
|
return /* @__PURE__ */ a("figure", {
|
|
36
|
+
...s,
|
|
36
37
|
className: `local-visual ${e}`,
|
|
37
|
-
"aria-labelledby":
|
|
38
|
+
"aria-labelledby": c,
|
|
38
39
|
"data-rmd-component": o,
|
|
39
40
|
children: [/* @__PURE__ */ i("figcaption", {
|
|
40
|
-
id:
|
|
41
|
+
id: c,
|
|
41
42
|
className: "local-visual-title",
|
|
42
43
|
"data-rmd-part": "title",
|
|
43
44
|
children: t
|