reactive-md 0.9.3 → 0.10.0
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 +34 -0
- package/CHANGELOG.md +34 -0
- package/README-ch.md +7 -7
- package/README-en.md +7 -7
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/cli/help.mjs +6 -4
- package/cli/init.mjs +1 -1
- package/cli/migrate.mjs +1 -1
- package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
- package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
- package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
- package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
- package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
- package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
- package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
- package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
- package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
- package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
- package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
- package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
- package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
- package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
- package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
- package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
- package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
- package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
- package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
- package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
- package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
- package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
- package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
- package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
- package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
- package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
- package/dist-library/reactive-md-authoring.js +277 -269
- package/dist-library/reactive-md-build.js +327 -33
- package/dist-library/reactive-md-compiler-session.js +3 -3
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +4 -4
- package/dist-library/reactive-md-default-packs.js +4 -3
- package/dist-library/reactive-md-default-preset.js +3 -3
- package/dist-library/reactive-md-export.js +6 -6
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +18 -17
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +2 -2
- package/dist-library/reactive-md-pack-style-manifest.js +8 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -9
- 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 +5 -5
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +10 -10
- package/dist-library/reactive-md-plugin-network.js +5 -5
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-react-component-accordion.js +3 -3
- package/dist-library/reactive-md-react-component-alert.js +3 -3
- package/dist-library/reactive-md-react-component-anchor.js +3 -3
- package/dist-library/reactive-md-react-component-badge.js +3 -3
- package/dist-library/reactive-md-react-component-card.js +3 -3
- package/dist-library/reactive-md-react-component-chart.js +2 -2
- package/dist-library/reactive-md-react-component-checkbox.js +2 -2
- package/dist-library/reactive-md-react-component-checklist.js +2 -2
- package/dist-library/reactive-md-react-component-choices.js +2 -2
- package/dist-library/reactive-md-react-component-column.js +1 -1
- package/dist-library/reactive-md-react-component-coordinate.js +2 -2
- package/dist-library/reactive-md-react-component-counter.js +2 -2
- package/dist-library/reactive-md-react-component-data-table.js +2 -2
- package/dist-library/reactive-md-react-component-date.js +2 -2
- package/dist-library/reactive-md-react-component-diagram.js +2 -2
- package/dist-library/reactive-md-react-component-disclosure.js +3 -3
- package/dist-library/reactive-md-react-component-edge.js +1 -1
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
- package/dist-library/reactive-md-react-component-gallery.js +2 -2
- package/dist-library/reactive-md-react-component-grid.js +3 -3
- package/dist-library/reactive-md-react-component-if.js +3 -3
- package/dist-library/reactive-md-react-component-input.js +2 -2
- package/dist-library/reactive-md-react-component-jump.js +3 -3
- package/dist-library/reactive-md-react-component-multi-select.js +2 -2
- package/dist-library/reactive-md-react-component-node.js +2 -2
- package/dist-library/reactive-md-react-component-number.js +2 -2
- package/dist-library/reactive-md-react-component-option.js +1 -1
- package/dist-library/reactive-md-react-component-panel.js +3 -3
- package/dist-library/reactive-md-react-component-plot.js +2 -2
- package/dist-library/reactive-md-react-component-progress.js +2 -2
- package/dist-library/reactive-md-react-component-quiz.js +2 -2
- package/dist-library/reactive-md-react-component-radio-group.js +2 -2
- package/dist-library/reactive-md-react-component-range-slider.js +2 -2
- package/dist-library/reactive-md-react-component-section.js +3 -3
- package/dist-library/reactive-md-react-component-select.js +2 -2
- package/dist-library/reactive-md-react-component-slider.js +2 -2
- package/dist-library/reactive-md-react-component-step.js +3 -3
- package/dist-library/reactive-md-react-component-steps.js +3 -3
- package/dist-library/reactive-md-react-component-tab.js +3 -3
- package/dist-library/reactive-md-react-component-table.js +2 -2
- package/dist-library/reactive-md-react-component-tabs.js +3 -3
- package/dist-library/reactive-md-react-component-text.js +3 -3
- package/dist-library/reactive-md-react-component-textarea.js +2 -2
- package/dist-library/reactive-md-react-component-timeline.js +2 -2
- package/dist-library/reactive-md-react-component-timer.js +2 -2
- package/dist-library/reactive-md-react-component-toggle.js +2 -2
- package/dist-library/reactive-md-react-component-tooltip.js +3 -3
- package/dist-library/reactive-md-react-component-validation.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +4 -4
- package/dist-library/reactive-md-react-pack-data.js +3 -3
- package/dist-library/reactive-md-react-pack-layout.js +25 -24
- package/dist-library/reactive-md-react-pack-visuals.js +2 -2
- package/dist-library/reactive-md-react-packed.js +6 -6
- package/dist-library/reactive-md-react-server.js +37 -36
- package/dist-library/reactive-md-react-static-server.js +2 -2
- package/dist-library/reactive-md-react-static.js +1 -1
- package/dist-library/reactive-md-react-unstyled.js +12 -12
- package/dist-library/reactive-md-react.js +12 -12
- package/dist-library/reactive-md-scan.js +1 -1
- package/dist-library/reactive-md-sdk.js +23 -9
- 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 +6 -6
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +3 -3
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +52 -43
- package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
- package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
- package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
- package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
- package/dist-library/rmd-pack-layout.css +9 -0
- package/dist-library/rmd-pack-resource-layout.css +9 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
- package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
- package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
- package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
- package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +3 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +5 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -1
- package/dist-library/types/components/table/data-table-model.d.ts +95 -2
- package/dist-library/types/components/table/data-table.d.ts +2 -2
- package/dist-library/types/contracts/component-kernel.d.ts +5 -0
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
- package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +4 -3
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -0
- package/dist-library/types/local/types.d.ts +33 -2
- package/dist-library/types/react/component-api.d.ts +21 -2
- package/dist-library/types/react/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- package/dist-library/types/react/package-core.d.ts +3 -0
- package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
- package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
- package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +3 -1
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +6 -0
- package/dist-library/types/sdk/version.d.ts +1 -1
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +4 -1
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
- package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +128 -368
- package/docs/README-ch.md +3 -1
- package/docs/README.md +3 -1
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +15 -15
- package/docs/compatibility/compatibility-en.md +15 -15
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +22 -14
- package/docs/compatibility/source-versioning-en.md +22 -13
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-protocol-ch.md +18 -18
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/guides/local-guide-ch.md +109 -20
- package/docs/guides/local-guide-en.md +109 -20
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +29 -3
- package/docs/integration/extension-sdk-en.md +29 -3
- package/docs/integration/local-integration-ch.md +3 -3
- package/docs/integration/local-integration-en.md +3 -3
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +11 -19
- package/docs/integration/shareable-export-en.md +11 -19
- package/docs/reference/diagnostics-counting-ch.md +24 -1
- package/docs/reference/diagnostics-counting-en.md +24 -1
- package/docs/reference/local-interaction-syntax-ch.md +222 -33
- package/docs/reference/local-interaction-syntax-en.md +220 -31
- package/docs/reference/public-api-ch.md +24 -18
- package/docs/reference/public-api-en.md +24 -18
- package/docs/reference/theme-protocol-ch.md +1 -1
- package/docs/reference/theme-protocol-en.md +1 -1
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/integration/README-ch.md +3 -3
- package/examples/integration/README.md +3 -3
- package/examples/integration/chat-session/package.json +1 -1
- package/examples/local/README-ch.md +1 -1
- package/examples/local/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
- package/dist-library/authoring-B14SsOXZ.js +0 -893
- package/dist-library/compile-D50B5_Ww.js +0 -1249
- package/dist-library/computations-CffoW7Ff.js +0 -340
- package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
- package/dist-library/default-options-DU5dxuU6.js +0 -125
- package/dist-library/layout-BfUzzO2b.js +0 -553
- package/dist-library/runtime-CuJndKqK.js +0 -1289
- package/dist-library/shareable-C6mUerpQ.js +0 -817
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
- package/dist-library/visuals-CoVSjVD8.js +0 -49159
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { b as e, o as t } from "./limits-CFERRrlC.js";
|
|
2
|
-
import { a as n, n as r, s as i, t as a } from "./compile-D50B5_Ww.js";
|
|
3
|
-
import { o } from "./schema-core-4sd1Vu7V.js";
|
|
4
|
-
import { d as s } from "./component-kernel-IG4wOO0i.js";
|
|
5
|
-
// node_modules/devlop/lib/default.js
|
|
6
|
-
function c() {}
|
|
7
|
-
// src/local/html/html-table-names.ts
|
|
8
|
-
var l = /* @__PURE__ */ new Set([
|
|
9
|
-
"table",
|
|
10
|
-
"caption",
|
|
11
|
-
"colgroup",
|
|
12
|
-
"col",
|
|
13
|
-
"thead",
|
|
14
|
-
"tbody",
|
|
15
|
-
"tfoot",
|
|
16
|
-
"tr",
|
|
17
|
-
"th",
|
|
18
|
-
"td"
|
|
19
|
-
]), u = {
|
|
20
|
-
colgroup: /* @__PURE__ */ new Set(["span"]),
|
|
21
|
-
col: /* @__PURE__ */ new Set(["span"]),
|
|
22
|
-
td: /* @__PURE__ */ new Set([
|
|
23
|
-
"colspan",
|
|
24
|
-
"rowspan",
|
|
25
|
-
"headers",
|
|
26
|
-
"align"
|
|
27
|
-
]),
|
|
28
|
-
th: /* @__PURE__ */ new Set([
|
|
29
|
-
"colspan",
|
|
30
|
-
"rowspan",
|
|
31
|
-
"headers",
|
|
32
|
-
"scope",
|
|
33
|
-
"abbr",
|
|
34
|
-
"align"
|
|
35
|
-
])
|
|
36
|
-
};
|
|
37
|
-
function d(e, t) {
|
|
38
|
-
let n = t.trim();
|
|
39
|
-
return [
|
|
40
|
-
"colspan",
|
|
41
|
-
"rowspan",
|
|
42
|
-
"span"
|
|
43
|
-
].includes(e) ? /^\d{1,5}$/.test(n) && Number(n) <= (e === "rowspan" ? 65534 : 1e3) && Number(n) >= (e === "rowspan" ? 0 : 1) : e === "align" ? o(t) !== null : e !== "scope" || [
|
|
44
|
-
"row",
|
|
45
|
-
"col",
|
|
46
|
-
"rowgroup",
|
|
47
|
-
"colgroup"
|
|
48
|
-
].includes(n.toLowerCase());
|
|
49
|
-
}
|
|
50
|
-
// src/local/configuration/capability-policy.ts
|
|
51
|
-
var f = Object.freeze({
|
|
52
|
-
enableCss: !0,
|
|
53
|
-
enableJavaScript: !1,
|
|
54
|
-
enableExtendedHtml: !1
|
|
55
|
-
});
|
|
56
|
-
function p(e, t) {
|
|
57
|
-
return {
|
|
58
|
-
enableCss: e?.enableCss === !0 && (t?.enableCss ?? f.enableCss) === !0,
|
|
59
|
-
enableJavaScript: e?.enableJavaScript === !0 && t?.enableJavaScript === !0,
|
|
60
|
-
enableExtendedHtml: e?.enableExtendedHtml === !0 && t?.enableExtendedHtml === !0
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
// src/local/configuration/kernel-value-rules.ts
|
|
64
|
-
function m(e) {
|
|
65
|
-
let t = {};
|
|
66
|
-
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
67
|
-
return t;
|
|
68
|
-
}
|
|
69
|
-
function h(e) {
|
|
70
|
-
let t = [];
|
|
71
|
-
for (let n of s(e)) switch (n.kind) {
|
|
72
|
-
case "value-date":
|
|
73
|
-
t.push(m({
|
|
74
|
-
kind: "date",
|
|
75
|
-
min: n.min,
|
|
76
|
-
max: n.max,
|
|
77
|
-
required: n.required
|
|
78
|
-
}));
|
|
79
|
-
break;
|
|
80
|
-
case "value-length":
|
|
81
|
-
t.push(m({
|
|
82
|
-
kind: "length",
|
|
83
|
-
min: n.min,
|
|
84
|
-
max: n.max
|
|
85
|
-
})), (n.email !== void 0 || n.emailType !== void 0) && t.push(m({
|
|
86
|
-
kind: "email",
|
|
87
|
-
type: n.email ?? "type",
|
|
88
|
-
value: n.emailType ?? "email"
|
|
89
|
-
}));
|
|
90
|
-
break;
|
|
91
|
-
case "value-email":
|
|
92
|
-
t.push(m({
|
|
93
|
-
kind: "email",
|
|
94
|
-
type: n.type ?? "type",
|
|
95
|
-
value: n.value ?? "email"
|
|
96
|
-
}));
|
|
97
|
-
break;
|
|
98
|
-
case "value-required": t.push({
|
|
99
|
-
kind: "required",
|
|
100
|
-
required: n.required
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return t;
|
|
104
|
-
}
|
|
105
|
-
function g(e) {
|
|
106
|
-
if (!e || typeof e != "object") return;
|
|
107
|
-
let t = e.kernel;
|
|
108
|
-
if (t && typeof t == "object") return t;
|
|
109
|
-
}
|
|
110
|
-
var _ = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
111
|
-
function v(e) {
|
|
112
|
-
return _.test(e);
|
|
113
|
-
}
|
|
114
|
-
function y(e, t, n) {
|
|
115
|
-
let r = [];
|
|
116
|
-
for (let i of e) {
|
|
117
|
-
let e = i.target;
|
|
118
|
-
e ? e.startsWith("#") || /\s/.test(e) ? r.push({
|
|
119
|
-
code: "local.jump.target",
|
|
120
|
-
message: `<${i.name}> target "${e}" must be a bare heading slug or anchor id without "#" or whitespace.`,
|
|
121
|
-
start: i.offset,
|
|
122
|
-
key: "local.jump.bad-target",
|
|
123
|
-
params: { target: e }
|
|
124
|
-
}) : !t.has(e) && !n.has(e) && r.push({
|
|
125
|
-
code: "local.jump.target",
|
|
126
|
-
message: `<${i.name}> target "${e}" does not resolve to a heading or explicit anchor in this document.`,
|
|
127
|
-
start: i.offset,
|
|
128
|
-
key: "local.jump.unresolved",
|
|
129
|
-
params: { target: e }
|
|
130
|
-
}) : r.push({
|
|
131
|
-
code: "local.jump.target",
|
|
132
|
-
message: "<jump> target cannot be empty.",
|
|
133
|
-
start: i.offset,
|
|
134
|
-
key: "local.jump.empty"
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return r;
|
|
138
|
-
}
|
|
139
|
-
Object.freeze({
|
|
140
|
-
arrayLength: t,
|
|
141
|
-
dataTableColumns: 20,
|
|
142
|
-
plotCurves: 16,
|
|
143
|
-
plotPoints: e
|
|
144
|
-
});
|
|
145
|
-
// src/local/evaluation/computations.ts
|
|
146
|
-
function b(e, t, n) {
|
|
147
|
-
let i = t ? r(t, n) : void 0;
|
|
148
|
-
return e.expressionOffset + (i ?? Math.max(0, e.source.indexOf(n)));
|
|
149
|
-
}
|
|
150
|
-
function x(e, t, r, i = "local.expression") {
|
|
151
|
-
t instanceof n ? e(`${i}.${t.code || "invalid"}`, `Expression error: ${t.message}`, r + (Number.isFinite(t.offset) ? t.offset : 0)) : e(`${i}.invalid`, `Expression error: ${t instanceof Error ? t.message : String(t)}`, r);
|
|
152
|
-
}
|
|
153
|
-
function S(e) {
|
|
154
|
-
return e instanceof n ? e : new n("expression-eval", e instanceof Error ? e.message : String(e), 0);
|
|
155
|
-
}
|
|
156
|
-
function C(e, t) {
|
|
157
|
-
let n = new Set(e), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
158
|
-
for (let t of e) r.set(t, 0);
|
|
159
|
-
for (let a of e) for (let e of t(a)) {
|
|
160
|
-
if (!n.has(e)) continue;
|
|
161
|
-
r.set(a, (r.get(a) ?? 0) + 1);
|
|
162
|
-
let t = i.get(e);
|
|
163
|
-
t ? t.push(a) : i.set(e, [a]);
|
|
164
|
-
}
|
|
165
|
-
let a = [];
|
|
166
|
-
for (let t of e) (r.get(t) ?? 0) === 0 && a.push(t);
|
|
167
|
-
let o = [];
|
|
168
|
-
for (let e = 0; e < a.length; e += 1) {
|
|
169
|
-
let t = a[e];
|
|
170
|
-
o.push(t);
|
|
171
|
-
for (let e of i.get(t) ?? []) {
|
|
172
|
-
let t = (r.get(e) ?? 0) - 1;
|
|
173
|
-
r.set(e, t), t === 0 && a.push(e);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
let s = new Set(o);
|
|
177
|
-
return {
|
|
178
|
-
order: o,
|
|
179
|
-
cyclic: e.filter((e) => !s.has(e))
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function w(e) {
|
|
183
|
-
let t = Object.keys(e), n = new Set(t);
|
|
184
|
-
return C(t, (t) => {
|
|
185
|
-
let r = e[t];
|
|
186
|
-
return r ? r.dependencies.filter((e) => n.has(e)) : [];
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function T(e, t, n, r = /* @__PURE__ */ new Set(), o) {
|
|
190
|
-
let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = [], d = /* @__PURE__ */ new Set();
|
|
191
|
-
for (let t of e) l.has(t.name) || (l.set(t.name, t), u.push(t.name));
|
|
192
|
-
let f = new Set(u);
|
|
193
|
-
for (let e of u) {
|
|
194
|
-
let t = l.get(e), r;
|
|
195
|
-
try {
|
|
196
|
-
r = o?.expression(t.source) ?? a(t.source);
|
|
197
|
-
} catch (r) {
|
|
198
|
-
x(n, r, t.expressionOffset), d.add(e);
|
|
199
|
-
continue;
|
|
200
|
-
}
|
|
201
|
-
s.set(e, r), c.set(e, [...r.dependencies]);
|
|
202
|
-
}
|
|
203
|
-
for (let e of u) if (!d.has(e)) {
|
|
204
|
-
for (let r of c.get(e) ?? []) if (!(f.has(r) || Object.hasOwn(t, r))) {
|
|
205
|
-
n("local.computation.unknown", `Reference to undeclared parameter ${r} in computation "${e}".`, b(l.get(e), s.get(e), r)), d.add(e);
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
let p = /* @__PURE__ */ new Set();
|
|
210
|
-
for (let e of u) {
|
|
211
|
-
if (d.has(e)) continue;
|
|
212
|
-
let i = l.get(e);
|
|
213
|
-
if (i.kind === "const") for (let a of c.get(e) ?? []) {
|
|
214
|
-
let o = f.has(a) ? l.get(a).kind : null;
|
|
215
|
-
Object.hasOwn(t, a) ? (n("local.computation.const", `Constant "${e}" cannot depend on ${r.has(a) ? "external data" : "control parameter"} "${a}".`, b(i, s.get(e), a)), p.add(e)) : o === "computed" && (n("local.computation.const", `Constant "${e}" cannot depend on computed value "${a}".`, b(i, s.get(e), a)), p.add(e));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
let { order: m, cyclic: h } = C(u, (e) => c.get(e) ?? []);
|
|
219
|
-
if (h.length > 0) {
|
|
220
|
-
let e = new Set(h), t = [], r = /* @__PURE__ */ new Map(), i = h[0];
|
|
221
|
-
for (; !r.has(i);) {
|
|
222
|
-
r.set(i, t.length), t.push(i);
|
|
223
|
-
let n = (c.get(i) ?? []).find((t) => e.has(t));
|
|
224
|
-
if (n === void 0) break;
|
|
225
|
-
i = n;
|
|
226
|
-
}
|
|
227
|
-
let a = r.has(i) ? t.slice(r.get(i)) : [h[0]], o = a.slice(0, 12).join(" → ") + (a.length > 12 ? " → …" : ` → ${a[0]}`);
|
|
228
|
-
for (let e of a.slice(0, 100)) {
|
|
229
|
-
let t = l.get(e);
|
|
230
|
-
n("local.computation.cycle", `Computation "${e}" is part of a dependency cycle: ${o}.`, t.range.start, t.range.end);
|
|
231
|
-
}
|
|
232
|
-
for (let e of h) d.add(e);
|
|
233
|
-
}
|
|
234
|
-
for (let e of m) if (!d.has(e) && !(l.get(e).kind !== "const" || p.has(e)) && (c.get(e) ?? []).some((e) => f.has(e) ? l.get(e).kind === "const" && p.has(e) : !1)) {
|
|
235
|
-
let t = l.get(e);
|
|
236
|
-
n("local.computation.const", `Constant "${e}" indirectly depends on a value that is not a constant.`, t.expressionOffset), p.add(e);
|
|
237
|
-
}
|
|
238
|
-
let g = {}, _ = { ...t };
|
|
239
|
-
for (let e of m) {
|
|
240
|
-
if (d.has(e)) continue;
|
|
241
|
-
let t = l.get(e);
|
|
242
|
-
if ((c.get(e) ?? []).some((e) => d.has(e))) {
|
|
243
|
-
d.add(e);
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
let r = s.get(e);
|
|
247
|
-
try {
|
|
248
|
-
let t = o ? o.infer(r, _) : r.inferType(_);
|
|
249
|
-
g[e] = t, _[e] = t;
|
|
250
|
-
} catch (r) {
|
|
251
|
-
x(n, r, t.expressionOffset), d.add(e);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
let v = {}, y = {}, w = /* @__PURE__ */ Error("failed constant read"), T = (e) => {
|
|
255
|
-
d.add(e), Object.defineProperty(y, e, {
|
|
256
|
-
enumerable: !0,
|
|
257
|
-
configurable: !0,
|
|
258
|
-
get() {
|
|
259
|
-
throw w;
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
};
|
|
263
|
-
for (let e of m) {
|
|
264
|
-
if (d.has(e) || l.get(e).kind !== "const" || p.has(e)) continue;
|
|
265
|
-
let t = l.get(e), r = s.get(e);
|
|
266
|
-
try {
|
|
267
|
-
let a = r.evaluate(y), o = i(a);
|
|
268
|
-
if (o) {
|
|
269
|
-
n("local.computation.budget", `Constant "${e}": ${o}`, t.expressionOffset), T(e);
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
v[e] = Array.isArray(a) ? a.slice() : a, y[e] = v[e];
|
|
273
|
-
} catch (r) {
|
|
274
|
-
if (r === w) {
|
|
275
|
-
T(e);
|
|
276
|
-
continue;
|
|
277
|
-
}
|
|
278
|
-
let i = S(r);
|
|
279
|
-
n("local.computation.expression", `Constant "${e}" cannot be evaluated: ${i.message}`, t.expressionOffset + (Number.isFinite(i.offset) ? i.offset : 0)), T(e);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
let E = {};
|
|
283
|
-
for (let e of u) {
|
|
284
|
-
let t = l.get(e);
|
|
285
|
-
if (d.has(e) || g[e] === void 0) continue;
|
|
286
|
-
let n = {
|
|
287
|
-
name: e,
|
|
288
|
-
kind: t.kind,
|
|
289
|
-
source: t.source,
|
|
290
|
-
dependencies: [...c.get(e) ?? []],
|
|
291
|
-
type: g[e],
|
|
292
|
-
nodeId: t.nodeId,
|
|
293
|
-
range: { ...t.range }
|
|
294
|
-
};
|
|
295
|
-
t.kind === "const" && Object.hasOwn(v, e) && (n.value = v[e]), E[e] = n;
|
|
296
|
-
}
|
|
297
|
-
return {
|
|
298
|
-
computations: E,
|
|
299
|
-
kinds: g,
|
|
300
|
-
order: m.filter((e) => !d.has(e)),
|
|
301
|
-
expressions: s,
|
|
302
|
-
constValues: v
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
function E(e, t, r, a, o, s = /* @__PURE__ */ new Map()) {
|
|
306
|
-
let c = {}, l = /* @__PURE__ */ new Map(), u = {};
|
|
307
|
-
for (let [e, t] of Object.entries(a)) u[e] = t;
|
|
308
|
-
for (let [e, t] of s) Object.defineProperty(u, e, {
|
|
309
|
-
enumerable: !0,
|
|
310
|
-
configurable: !0,
|
|
311
|
-
get() {
|
|
312
|
-
throw t;
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
for (let [e, t] of Object.entries(o)) c[e] = t, u[e] = t;
|
|
316
|
-
for (let a of t) {
|
|
317
|
-
let t = e[a];
|
|
318
|
-
if (!t || t.kind === "const") continue;
|
|
319
|
-
let o = r.get(a);
|
|
320
|
-
if (o) try {
|
|
321
|
-
let e = o.evaluate(u), t = i(e);
|
|
322
|
-
if (t) throw new n("expression-budget", t, 0);
|
|
323
|
-
c[a] = e, u[a] = e;
|
|
324
|
-
} catch (e) {
|
|
325
|
-
let t = S(e);
|
|
326
|
-
l.set(a, t), Object.defineProperty(u, a, {
|
|
327
|
-
enumerable: !0,
|
|
328
|
-
configurable: !0,
|
|
329
|
-
get() {
|
|
330
|
-
throw t;
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
return {
|
|
336
|
-
values: c,
|
|
337
|
-
errors: l
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
export { g as a, f as c, l as d, d as f, v as i, p as l, w as n, y as o, c as p, T as r, h as s, E as t, u };
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { u as e } from "./limits-CFERRrlC.js";
|
|
2
|
-
import { t } from "./compile-D50B5_Ww.js";
|
|
3
|
-
import { A as n, O as r, j as i } from "./component-utils-eSj5IdG4.js";
|
|
4
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
// src/components/table/data-table-model.ts
|
|
6
|
-
var s = class extends Error {
|
|
7
|
-
failure;
|
|
8
|
-
constructor(e) {
|
|
9
|
-
super(e), this.name = "DataTableFailureError", this.failure = e;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
function c(e) {
|
|
13
|
-
return e === null ? "" : typeof e == "string" ? e : typeof e == "number" ? Number.isFinite(e) ? String(e) : null : typeof e == "boolean" ? e ? "true" : "false" : null;
|
|
14
|
-
}
|
|
15
|
-
function l(e) {
|
|
16
|
-
return typeof e == "string" ? e === "" ? null : `s:${e}` : typeof e == "number" && Number.isFinite(e) ? `n:${e === 0 ? 0 : e}` : null;
|
|
17
|
-
}
|
|
18
|
-
function u(e, t, n) {
|
|
19
|
-
let r = { ...n };
|
|
20
|
-
for (let i of t) Object.hasOwn(n, i) || Object.defineProperty(r, i, {
|
|
21
|
-
enumerable: !0,
|
|
22
|
-
configurable: !0,
|
|
23
|
-
get() {
|
|
24
|
-
return e.evaluate(i);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return r;
|
|
28
|
-
}
|
|
29
|
-
function d(e) {
|
|
30
|
-
if (e.length === 0) return null;
|
|
31
|
-
let t = typeof e[0];
|
|
32
|
-
if (t !== "string" && t !== "number") return "rows";
|
|
33
|
-
for (let n of e) if (typeof n !== t || typeof n == "number" && !Number.isFinite(n)) return "rows";
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
function f(e, n) {
|
|
37
|
-
let r;
|
|
38
|
-
try {
|
|
39
|
-
r = t(n);
|
|
40
|
-
} catch {
|
|
41
|
-
throw new s("rows");
|
|
42
|
-
}
|
|
43
|
-
let i;
|
|
44
|
-
try {
|
|
45
|
-
i = r.evaluate(u(e, r.dependencies, {}));
|
|
46
|
-
} catch {
|
|
47
|
-
throw new s("rows");
|
|
48
|
-
}
|
|
49
|
-
if (!Array.isArray(i)) throw new s("rows");
|
|
50
|
-
let a = d(i);
|
|
51
|
-
if (a) throw new s(a);
|
|
52
|
-
return i;
|
|
53
|
-
}
|
|
54
|
-
function p(e) {
|
|
55
|
-
let { rows: n, columns: r, keyExpression: i, runtime: a } = e, o = e.maxRows ?? 100, f = e.budget ?? 1e5;
|
|
56
|
-
if (!Number.isSafeInteger(o) || o <= 0 || o > 1e3) return {
|
|
57
|
-
ok: !1,
|
|
58
|
-
failure: "max-rows"
|
|
59
|
-
};
|
|
60
|
-
if (r.length < 1 || r.length > 20) return {
|
|
61
|
-
ok: !1,
|
|
62
|
-
failure: "columns"
|
|
63
|
-
};
|
|
64
|
-
let p = d(n);
|
|
65
|
-
if (p) return {
|
|
66
|
-
ok: !1,
|
|
67
|
-
failure: p
|
|
68
|
-
};
|
|
69
|
-
if (n.length > o) return {
|
|
70
|
-
ok: !1,
|
|
71
|
-
failure: "rows-budget"
|
|
72
|
-
};
|
|
73
|
-
let m;
|
|
74
|
-
try {
|
|
75
|
-
m = t(i);
|
|
76
|
-
} catch {
|
|
77
|
-
return {
|
|
78
|
-
ok: !1,
|
|
79
|
-
failure: "key"
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
let h = m.dependencies;
|
|
83
|
-
if (h.length !== 1 || h[0] !== "item") return {
|
|
84
|
-
ok: !1,
|
|
85
|
-
failure: "key"
|
|
86
|
-
};
|
|
87
|
-
let g = r.map((e) => {
|
|
88
|
-
try {
|
|
89
|
-
return {
|
|
90
|
-
spec: e,
|
|
91
|
-
expression: t(e.value)
|
|
92
|
-
};
|
|
93
|
-
} catch {
|
|
94
|
-
return {
|
|
95
|
-
spec: e,
|
|
96
|
-
expression: null
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}), _ = 0;
|
|
100
|
-
for (let e of r) _ += e.label.length;
|
|
101
|
-
if (n.length === 0 && (_ += 7), _ > f) return {
|
|
102
|
-
ok: !1,
|
|
103
|
-
failure: "text-budget"
|
|
104
|
-
};
|
|
105
|
-
let v = (e) => {
|
|
106
|
-
if (_ += e, _ > f) throw new s("text-budget");
|
|
107
|
-
}, y = /* @__PURE__ */ new Set(), b = [];
|
|
108
|
-
try {
|
|
109
|
-
for (let e = 0; e < n.length; e += 1) {
|
|
110
|
-
let t = {
|
|
111
|
-
item: n[e],
|
|
112
|
-
index: e
|
|
113
|
-
}, r = null;
|
|
114
|
-
try {
|
|
115
|
-
r = l(m.evaluate(t));
|
|
116
|
-
} catch {
|
|
117
|
-
return {
|
|
118
|
-
ok: !1,
|
|
119
|
-
failure: "key"
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
if (r === null || y.has(r)) return {
|
|
123
|
-
ok: !1,
|
|
124
|
-
failure: "key"
|
|
125
|
-
};
|
|
126
|
-
v(r.length), y.add(r);
|
|
127
|
-
let i = [];
|
|
128
|
-
for (let e of g) {
|
|
129
|
-
if (!e.expression) {
|
|
130
|
-
v(14), i.push({
|
|
131
|
-
ok: !1,
|
|
132
|
-
text: ""
|
|
133
|
-
});
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
let n = null;
|
|
137
|
-
try {
|
|
138
|
-
n = c(e.expression.evaluate(u(a, e.expression.dependencies, t)));
|
|
139
|
-
} catch {
|
|
140
|
-
n = null;
|
|
141
|
-
}
|
|
142
|
-
n === null ? (v(14), i.push({
|
|
143
|
-
ok: !1,
|
|
144
|
-
text: ""
|
|
145
|
-
})) : (v(n.length), i.push({
|
|
146
|
-
ok: !0,
|
|
147
|
-
text: n
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
b.push({
|
|
151
|
-
key: r,
|
|
152
|
-
cells: i
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
} catch (e) {
|
|
156
|
-
return e instanceof s ? {
|
|
157
|
-
ok: !1,
|
|
158
|
-
failure: e.failure
|
|
159
|
-
} : {
|
|
160
|
-
ok: !1,
|
|
161
|
-
failure: "rows"
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
ok: !0,
|
|
166
|
-
model: {
|
|
167
|
-
columns: r.map((e) => e.label),
|
|
168
|
-
rows: b,
|
|
169
|
-
empty: n.length === 0
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
function m(t, n) {
|
|
174
|
-
switch (n) {
|
|
175
|
-
case "label": return t("Data table requires a label.", "数据表需要标签。");
|
|
176
|
-
case "columns": return t("Data table requires between 1 and 20 column definitions.", "数据表需要 1 到 20 个列定义。");
|
|
177
|
-
case "max-rows": return t(`max-rows must be a positive integer no greater than ${e}.`, `max-rows 必须是 1 到 ${e} 之间的整数。`);
|
|
178
|
-
case "rows": return t("Rows must evaluate to a list.", "行数据必须计算为列表。");
|
|
179
|
-
case "rows-budget": return t("Too many rows for this table.", "此数据表的行数超过上限。");
|
|
180
|
-
case "key": return t("Every row needs a unique, non-empty key.", "每一行都需要唯一且非空的键。");
|
|
181
|
-
case "text-budget": return t("The table content exceeds the text budget.", "数据表内容超过文本上限。");
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
// src/components/table/data-table.tsx
|
|
185
|
-
var h = /^\s*\{\{([\s\S]*)\}\}\s*$/;
|
|
186
|
-
function g(e) {
|
|
187
|
-
if (e === void 0) return null;
|
|
188
|
-
let t = h.exec(e), n = t ? t[1].trim() : "";
|
|
189
|
-
return n === "" ? null : n;
|
|
190
|
-
}
|
|
191
|
-
function _(e) {
|
|
192
|
-
return e.kind === "comment" || e.kind === "text" && e.text.trim() === "" || e.kind === "paragraph" && e.children.length === 0 && e.text.trim() === "";
|
|
193
|
-
}
|
|
194
|
-
function v(e) {
|
|
195
|
-
let t = r(e, "label", "").trim();
|
|
196
|
-
if (t === "") return {
|
|
197
|
-
ok: !1,
|
|
198
|
-
failure: "label"
|
|
199
|
-
};
|
|
200
|
-
let n = g(e.content.attrs.rows);
|
|
201
|
-
if (!n) return {
|
|
202
|
-
ok: !1,
|
|
203
|
-
failure: "rows"
|
|
204
|
-
};
|
|
205
|
-
let i = g(e.content.attrs.key);
|
|
206
|
-
if (!i) return {
|
|
207
|
-
ok: !1,
|
|
208
|
-
failure: "key"
|
|
209
|
-
};
|
|
210
|
-
let a = e.content.attrs["max-rows"], o = 100;
|
|
211
|
-
if (a !== void 0 && (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(a.trim()) || (o = Number(a.trim()), !Number.isSafeInteger(o) || o <= 0 || o > 1e3))) return {
|
|
212
|
-
ok: !1,
|
|
213
|
-
failure: "max-rows"
|
|
214
|
-
};
|
|
215
|
-
let s = e.content.children.filter((e) => !_(e)), c = [];
|
|
216
|
-
for (let e of s) {
|
|
217
|
-
let t = e.children.filter((e) => !_(e));
|
|
218
|
-
if (e.kind !== "component" || e.name !== "column" || t.length > 0) return {
|
|
219
|
-
ok: !1,
|
|
220
|
-
failure: "columns"
|
|
221
|
-
};
|
|
222
|
-
let n = (e.attrs.label ?? "").trim(), r = g(e.attrs.value);
|
|
223
|
-
if (n === "" || !r) return {
|
|
224
|
-
ok: !1,
|
|
225
|
-
failure: "columns"
|
|
226
|
-
};
|
|
227
|
-
c.push({
|
|
228
|
-
label: n,
|
|
229
|
-
value: r
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
return c.length < 1 || c.length > 20 ? {
|
|
233
|
-
ok: !1,
|
|
234
|
-
failure: "columns"
|
|
235
|
-
} : {
|
|
236
|
-
ok: !0,
|
|
237
|
-
table: {
|
|
238
|
-
label: t,
|
|
239
|
-
rows: n,
|
|
240
|
-
key: i,
|
|
241
|
-
maxRows: o,
|
|
242
|
-
columns: c
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
function y(e) {
|
|
247
|
-
let t = n(e), r = i(e), c = v(e);
|
|
248
|
-
if (!c.ok) return /* @__PURE__ */ a("div", {
|
|
249
|
-
...t(),
|
|
250
|
-
className: "local-error local-data-table-error",
|
|
251
|
-
role: "alert",
|
|
252
|
-
children: m(r.t, c.failure)
|
|
253
|
-
});
|
|
254
|
-
let l = { evaluate: (t) => e.runtime.evaluate(t) }, u;
|
|
255
|
-
try {
|
|
256
|
-
u = p({
|
|
257
|
-
rows: f(l, c.table.rows),
|
|
258
|
-
columns: c.table.columns,
|
|
259
|
-
keyExpression: c.table.key,
|
|
260
|
-
maxRows: c.table.maxRows,
|
|
261
|
-
runtime: l
|
|
262
|
-
});
|
|
263
|
-
} catch (e) {
|
|
264
|
-
u = {
|
|
265
|
-
ok: !1,
|
|
266
|
-
failure: e instanceof s ? e.failure : "rows"
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
if (!u.ok) return /* @__PURE__ */ a("div", {
|
|
270
|
-
...t(),
|
|
271
|
-
className: "local-error local-data-table-error",
|
|
272
|
-
role: "alert",
|
|
273
|
-
children: m(r.t, u.failure)
|
|
274
|
-
});
|
|
275
|
-
let { model: d } = u;
|
|
276
|
-
return /* @__PURE__ */ a("div", {
|
|
277
|
-
...t(),
|
|
278
|
-
className: "md-table-scroll local-data-table-scroll",
|
|
279
|
-
"data-local-data-table": "",
|
|
280
|
-
children: /* @__PURE__ */ o("table", {
|
|
281
|
-
className: "md-table local-data-table",
|
|
282
|
-
"aria-label": c.table.label,
|
|
283
|
-
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: d.columns.map((e, t) => /* @__PURE__ */ a("th", {
|
|
284
|
-
scope: "col",
|
|
285
|
-
children: e
|
|
286
|
-
}, `column-${t}`)) }) }), /* @__PURE__ */ a("tbody", { children: d.empty ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", {
|
|
287
|
-
className: "local-data-table-empty",
|
|
288
|
-
colSpan: d.columns.length,
|
|
289
|
-
children: r.t("No rows", "没有数据")
|
|
290
|
-
}) }) : d.rows.map((e) => /* @__PURE__ */ a("tr", { children: e.cells.map((e, t) => /* @__PURE__ */ a("td", { children: e.ok ? e.text : /* @__PURE__ */ a("span", {
|
|
291
|
-
className: "local-error local-data-table-cell-error",
|
|
292
|
-
children: r.t("Cannot compute", "无法计算")
|
|
293
|
-
}) }, `cell-${t}`)) }, e.key)) })]
|
|
294
|
-
})
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
export { y as t };
|