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
|
@@ -283,6 +283,10 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
283
283
|
readonly en: 'Chart column "{name}" requires a number in row {row}, but the expression evaluates to {kind}.';
|
|
284
284
|
readonly zh: '图表列“{name}”第 {row} 行需要数字,但表达式结果为 {kind}。';
|
|
285
285
|
};
|
|
286
|
+
readonly 'chart.generatedNumericExpression': {
|
|
287
|
+
readonly en: 'Chart column "{name}" requires a number, but the column expression evaluates to text.';
|
|
288
|
+
readonly zh: '图表列“{name}”需要数字,但列表达式结果为文本。';
|
|
289
|
+
};
|
|
286
290
|
readonly 'timeline.numericExpression': {
|
|
287
291
|
readonly en: 'Timeline column "{name}" requires a number in row {row}, but the expression evaluates to {kind}.';
|
|
288
292
|
readonly zh: '时间线列“{name}”第 {row} 行需要数字,但表达式结果为 {kind}。';
|
|
@@ -487,6 +491,14 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
487
491
|
readonly en: 'Value "{value}" is not among the options: {options}.';
|
|
488
492
|
readonly zh: '值“{value}”不在选项中:{options}。';
|
|
489
493
|
};
|
|
494
|
+
readonly 'runtime.choiceUnavailable': {
|
|
495
|
+
readonly en: 'The available choices cannot be evaluated yet.';
|
|
496
|
+
readonly zh: '目前还无法求值可选项。';
|
|
497
|
+
};
|
|
498
|
+
readonly 'runtime.choiceMember': {
|
|
499
|
+
readonly en: 'The value must match an available choice.';
|
|
500
|
+
readonly zh: '值必须匹配当前可选项。';
|
|
501
|
+
};
|
|
490
502
|
readonly 'runtime.budget': {
|
|
491
503
|
readonly en: 'Parameter "{name}": {detail}';
|
|
492
504
|
readonly zh: '参数“{name}”:{detail}';
|
|
@@ -627,6 +639,34 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
627
639
|
readonly en: 'Check interpolation delimiters and content.';
|
|
628
640
|
readonly zh: '插值格式不正确,请检查分隔符和表达式内容。';
|
|
629
641
|
};
|
|
642
|
+
readonly 'error.local.transform.source': {
|
|
643
|
+
readonly en: 'The source of an array transform must be a string array or a number array.';
|
|
644
|
+
readonly zh: '数组变换的源必须是字符串数组或数字数组。';
|
|
645
|
+
};
|
|
646
|
+
readonly 'error.local.transform.predicate': {
|
|
647
|
+
readonly en: 'A filter condition must evaluate to a boolean.';
|
|
648
|
+
readonly zh: 'filter 条件必须求值为布尔值。';
|
|
649
|
+
};
|
|
650
|
+
readonly 'error.local.transform.projection': {
|
|
651
|
+
readonly en: 'A map projection must produce strings or finite numbers of one kind.';
|
|
652
|
+
readonly zh: 'map 投影必须生成同类的字符串或有限数值。';
|
|
653
|
+
};
|
|
654
|
+
readonly 'error.local.transform.key': {
|
|
655
|
+
readonly en: 'A sortBy key must be a string or finite number, with all keys of one kind.';
|
|
656
|
+
readonly zh: 'sortBy 键必须是字符串或有限数值,且所有键必须同属一类。';
|
|
657
|
+
};
|
|
658
|
+
readonly 'error.local.transform.order': {
|
|
659
|
+
readonly en: 'The sortBy direction must be the string literal "asc" or "desc".';
|
|
660
|
+
readonly zh: 'sortBy 排序方向必须是字符串字面量 "asc" 或 "desc"。';
|
|
661
|
+
};
|
|
662
|
+
readonly 'error.local.transform.depth': {
|
|
663
|
+
readonly en: 'Array transforms are nested deeper than the supported limit.';
|
|
664
|
+
readonly zh: '数组变换的嵌套深度超过上限。';
|
|
665
|
+
};
|
|
666
|
+
readonly 'error.local.budget.transform': {
|
|
667
|
+
readonly en: 'Array transforms exceeded the iteration, work or sort-key budget.';
|
|
668
|
+
readonly zh: '数组变换超过迭代、工作量或临时排序键预算。';
|
|
669
|
+
};
|
|
630
670
|
readonly 'error.latex-budget': {
|
|
631
671
|
readonly en: 'The formula exceeded a resource budget.';
|
|
632
672
|
readonly zh: '公式超过长度、记号、节点、深度或计算步数预算,请简化公式。';
|
|
@@ -780,8 +820,72 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
780
820
|
readonly zh: '此阅读器支持 {supported};请迁移 {declared} 或使用兼容的阅读器。';
|
|
781
821
|
};
|
|
782
822
|
readonly 'local.version.malformed': {
|
|
783
|
-
readonly en: 'Use <!-- reactive-md: local-draft-
|
|
784
|
-
readonly zh: '请在单独一行使用 <!-- reactive-md: local-draft-
|
|
823
|
+
readonly en: 'Use <!-- reactive-md: local-draft-4 --> on one line.';
|
|
824
|
+
readonly zh: '请在单独一行使用 <!-- reactive-md: local-draft-4 -->。';
|
|
825
|
+
};
|
|
826
|
+
readonly 'local.version.feature': {
|
|
827
|
+
readonly en: 'Source feature {feature} is not supported.';
|
|
828
|
+
readonly zh: '当前引擎不支持源码能力 {feature}。';
|
|
829
|
+
};
|
|
830
|
+
readonly 'local.macro.conflict': {
|
|
831
|
+
readonly en: 'The registered component {name} conflicts with the macro syntax.';
|
|
832
|
+
readonly zh: '已注册组件 {name} 与宏语法重名。';
|
|
833
|
+
};
|
|
834
|
+
readonly 'local.macro.definition': {
|
|
835
|
+
readonly en: 'Check the macro definition and its placement.';
|
|
836
|
+
readonly zh: '请检查宏定义的名称、声明和位置。';
|
|
837
|
+
};
|
|
838
|
+
readonly 'local.macro.params': {
|
|
839
|
+
readonly en: 'Use unique lowercase names for macro parameters.';
|
|
840
|
+
readonly zh: '宏参数须使用互不重复的合法小写名称。';
|
|
841
|
+
};
|
|
842
|
+
readonly 'local.macro.outputs': {
|
|
843
|
+
readonly en: 'Each macro output must name a writable local binding.';
|
|
844
|
+
readonly zh: '宏输出须使用互不重复的合法小写名称,并指向宏内可写绑定。';
|
|
845
|
+
};
|
|
846
|
+
readonly 'local.macro.use': {
|
|
847
|
+
readonly en: 'Check the macro name and supplied arguments.';
|
|
848
|
+
readonly zh: '请检查调用的宏名称、必填参数和实参写法。';
|
|
849
|
+
};
|
|
850
|
+
readonly 'local.macro.static': {
|
|
851
|
+
readonly en: 'This attribute requires a static argument of the declared type.';
|
|
852
|
+
readonly zh: '此属性要求提供类型匹配的静态实参。';
|
|
853
|
+
};
|
|
854
|
+
readonly 'local.macro.scope': {
|
|
855
|
+
readonly en: 'This name is outside the macro scope or invalid in this declaration.';
|
|
856
|
+
readonly zh: '此标识符超出宏的作用域或不能用于此声明。';
|
|
857
|
+
};
|
|
858
|
+
readonly 'local.macro.output': {
|
|
859
|
+
readonly en: 'Check the output mapping and shared binding constraints.';
|
|
860
|
+
readonly zh: '请检查宏输出的映射目标和共享绑定约束。';
|
|
861
|
+
};
|
|
862
|
+
readonly 'local.macro.recursion': {
|
|
863
|
+
readonly en: 'Macros cannot call themselves, directly or indirectly.';
|
|
864
|
+
readonly zh: '宏不能直接或间接调用自身。';
|
|
865
|
+
};
|
|
866
|
+
readonly 'local.macro.depth': {
|
|
867
|
+
readonly en: 'Macro expansion exceeds eight nesting levels.';
|
|
868
|
+
readonly zh: '宏展开超过八层嵌套上限。';
|
|
869
|
+
};
|
|
870
|
+
readonly 'local.budget.macro': {
|
|
871
|
+
readonly en: 'Macro expansion exceeds a compilation limit.';
|
|
872
|
+
readonly zh: '宏展开超过编译预算。';
|
|
873
|
+
};
|
|
874
|
+
readonly 'local.state.macro.invalid': {
|
|
875
|
+
readonly en: 'The macro state file is invalid.';
|
|
876
|
+
readonly zh: '宏状态文件无效。';
|
|
877
|
+
};
|
|
878
|
+
readonly 'local.state.macro.source': {
|
|
879
|
+
readonly en: 'The macro state belongs to a different source.';
|
|
880
|
+
readonly zh: '宏状态文件来自不同的源码。';
|
|
881
|
+
};
|
|
882
|
+
readonly 'local.state.macro.config': {
|
|
883
|
+
readonly en: 'The macro state belongs to a different compilation configuration.';
|
|
884
|
+
readonly zh: '宏状态文件与当前编译配置不同。';
|
|
885
|
+
};
|
|
886
|
+
readonly 'local.state.macro.bindings': {
|
|
887
|
+
readonly en: 'The macro state does not match the private bindings of this document.';
|
|
888
|
+
readonly zh: '宏状态文件中的私有绑定与当前文档不一致。';
|
|
785
889
|
};
|
|
786
890
|
readonly 'local.version.duplicate': {
|
|
787
891
|
readonly en: 'Only one source syntax declaration is allowed.';
|
|
@@ -1179,6 +1283,10 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
1179
1283
|
readonly en: 'Component <{component}> is missing required attribute {name}.';
|
|
1180
1284
|
readonly zh: '组件 <{component}> 缺少必需属性 {name}。';
|
|
1181
1285
|
};
|
|
1286
|
+
readonly 'attribute.requiredOneOf': {
|
|
1287
|
+
readonly en: 'Component <{component}> requires at least one of: {attributes}.';
|
|
1288
|
+
readonly zh: '组件 <{component}> 至少需要填写以下一项属性:{attributes}。';
|
|
1289
|
+
};
|
|
1182
1290
|
readonly 'label.requiredMissing': {
|
|
1183
1291
|
readonly en: 'Component <{name}> requires a label.';
|
|
1184
1292
|
readonly zh: '组件 <{name}> 需要 label。';
|
|
@@ -1263,6 +1371,10 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
1263
1371
|
readonly en: 'Attribute {name} must be one of {values}, got "{value}".';
|
|
1264
1372
|
readonly zh: '属性 {name} 必须是 {values} 之一,当前为“{value}”。';
|
|
1265
1373
|
};
|
|
1374
|
+
readonly 'attribute.enumOrPositiveNumber': {
|
|
1375
|
+
readonly en: 'Attribute {name} must be one of {values} or a positive number, got "{value}".';
|
|
1376
|
+
readonly zh: '属性 {name} 必须是 {values} 之一或正数,当前为“{value}”。';
|
|
1377
|
+
};
|
|
1266
1378
|
readonly 'attribute.dateLower': {
|
|
1267
1379
|
readonly en: 'Date lower bound {value} is not a valid YYYY-MM-DD.';
|
|
1268
1380
|
readonly zh: '日期下界 {value} 不是有效的 YYYY-MM-DD。';
|
|
@@ -1331,6 +1443,58 @@ export declare const LOCAL_DIAGNOSTIC_MESSAGES: {
|
|
|
1331
1443
|
readonly en: '<{name}> can only appear directly inside {parents}.';
|
|
1332
1444
|
readonly zh: '<{name}> 只能直接位于 {parents} 内。';
|
|
1333
1445
|
};
|
|
1446
|
+
readonly 'dynamicOptions.conflict': {
|
|
1447
|
+
readonly en: 'Use either <option> children or an options expression, not both.';
|
|
1448
|
+
readonly zh: '请在 <option> 子项和 options 表达式之间二选一,不能同时使用。';
|
|
1449
|
+
};
|
|
1450
|
+
readonly 'dynamicOptions.type': {
|
|
1451
|
+
readonly en: 'The options expression must evaluate to a string array.';
|
|
1452
|
+
readonly zh: 'options 表达式必须求值为字符串数组。';
|
|
1453
|
+
};
|
|
1454
|
+
readonly 'dynamicOptions.cycle': {
|
|
1455
|
+
readonly en: 'The choices for "{binding}" depend on a cycle of selection bindings.';
|
|
1456
|
+
readonly zh: '“{binding}”的选项依赖存在循环的选择绑定。';
|
|
1457
|
+
};
|
|
1458
|
+
readonly 'else.withoutIf': {
|
|
1459
|
+
readonly en: '<else> must directly follow an <if> or a conditional <else> in the same container.';
|
|
1460
|
+
readonly zh: '<else> 必须紧跟在同一容器内的 <if> 之后。';
|
|
1461
|
+
};
|
|
1462
|
+
readonly 'else.duplicate': {
|
|
1463
|
+
readonly en: 'An unconditional <else> must end its branch chain.';
|
|
1464
|
+
readonly zh: '无条件的 <else> 必须位于分支链末尾。';
|
|
1465
|
+
};
|
|
1466
|
+
readonly 'dataset.placement': {
|
|
1467
|
+
readonly en: '<dataset> must be a standalone declaration at the document top level.';
|
|
1468
|
+
readonly zh: '<dataset> 必须独立声明在文档顶层。';
|
|
1469
|
+
};
|
|
1470
|
+
readonly 'dataset.name': {
|
|
1471
|
+
readonly en: 'Dataset name "{name}" must be an identifier of at most 128 characters.';
|
|
1472
|
+
readonly zh: '数据表名称“{name}”必须是最多 128 个字符的标识符。';
|
|
1473
|
+
};
|
|
1474
|
+
readonly 'dataset.duplicate': {
|
|
1475
|
+
readonly en: 'Dataset "{name}" is already declared.';
|
|
1476
|
+
readonly zh: '数据表“{name}”已经声明。';
|
|
1477
|
+
};
|
|
1478
|
+
readonly 'dataset.key': {
|
|
1479
|
+
readonly en: 'The dataset has no key column named "{column}".';
|
|
1480
|
+
readonly zh: '数据表中没有名为“{column}”的键列。';
|
|
1481
|
+
};
|
|
1482
|
+
readonly 'dataset.rowKey': {
|
|
1483
|
+
readonly en: 'Dataset row keys must be nonempty and unique.';
|
|
1484
|
+
readonly zh: '数据表的行键必须非空且唯一。';
|
|
1485
|
+
};
|
|
1486
|
+
readonly 'dataset.cell': {
|
|
1487
|
+
readonly en: 'Dataset cells must contain static text.';
|
|
1488
|
+
readonly zh: '数据表的单元格必须使用静态文本。';
|
|
1489
|
+
};
|
|
1490
|
+
readonly 'dataset.budget': {
|
|
1491
|
+
readonly en: 'The dataset exceeds the expression array or text budget.';
|
|
1492
|
+
readonly zh: '数据表超过表达式数组或文本的大小上限。';
|
|
1493
|
+
};
|
|
1494
|
+
readonly 'dataset.unknown': {
|
|
1495
|
+
readonly en: 'Dataset "{name}" is not declared.';
|
|
1496
|
+
readonly zh: '数据表“{name}”尚未声明。';
|
|
1497
|
+
};
|
|
1334
1498
|
readonly 'structure.noBody': {
|
|
1335
1499
|
readonly en: '<{name}> does not accept body content.';
|
|
1336
1500
|
readonly zh: '<{name}> 不接受正文内容。';
|
|
@@ -1657,6 +1821,11 @@ export declare const LOCAL_DIAGNOSTIC_TEMPLATE_ALIASES: {
|
|
|
1657
1821
|
readonly 'local.selection.key.duplicate': 'selection.keyDuplicate';
|
|
1658
1822
|
readonly 'local.selection.key.initial': 'initial.selectionNotValue';
|
|
1659
1823
|
readonly 'local.structure.parent': 'structure.parent';
|
|
1824
|
+
readonly 'local.dynamic-options.conflict': 'dynamicOptions.conflict';
|
|
1825
|
+
readonly 'local.dynamic-options.type': 'dynamicOptions.type';
|
|
1826
|
+
readonly 'local.dynamic-options.cycle': 'dynamicOptions.cycle';
|
|
1827
|
+
readonly 'local.else.without-if': 'else.withoutIf';
|
|
1828
|
+
readonly 'local.else.duplicate': 'else.duplicate';
|
|
1660
1829
|
readonly 'local.structure.no-body': 'structure.noBody';
|
|
1661
1830
|
readonly 'local.structure.inline-only': 'structure.inlineOnly';
|
|
1662
1831
|
readonly 'local.structure.no-nested-components': 'structure.noNestedComponents';
|
|
@@ -1811,6 +1980,8 @@ export declare const LOCAL_DIAGNOSTIC_TEMPLATE_ALIASES: {
|
|
|
1811
1980
|
readonly 'local.runtime.value.max-items': 'runtime.maxItems';
|
|
1812
1981
|
readonly 'local.runtime.value.unsupported-type': 'runtime.unsupportedType';
|
|
1813
1982
|
readonly 'local.runtime.value.option': 'runtime.option';
|
|
1983
|
+
readonly 'local.runtime.choice.unavailable': 'runtime.choiceUnavailable';
|
|
1984
|
+
readonly 'local.runtime.choice.member': 'runtime.choiceMember';
|
|
1814
1985
|
readonly 'local.runtime.value.budget': 'runtime.budget';
|
|
1815
1986
|
readonly 'local.runtime.value.range-order': 'runtime.rangeOrder';
|
|
1816
1987
|
};
|
|
@@ -276,6 +276,10 @@ export declare const LOCAL_RUNTIME_DIAGNOSTIC_MESSAGES: {
|
|
|
276
276
|
readonly en: 'Chart column "{name}" requires a number in row {row}, but the expression evaluates to {kind}.';
|
|
277
277
|
readonly zh: '图表列“{name}”第 {row} 行需要数字,但表达式结果为 {kind}。';
|
|
278
278
|
};
|
|
279
|
+
readonly 'chart.generatedNumericExpression': {
|
|
280
|
+
readonly en: 'Chart column "{name}" requires a number, but the column expression evaluates to text.';
|
|
281
|
+
readonly zh: '图表列“{name}”需要数字,但列表达式结果为文本。';
|
|
282
|
+
};
|
|
279
283
|
readonly 'timeline.numericExpression': {
|
|
280
284
|
readonly en: 'Timeline column "{name}" requires a number in row {row}, but the expression evaluates to {kind}.';
|
|
281
285
|
readonly zh: '时间线列“{name}”第 {row} 行需要数字,但表达式结果为 {kind}。';
|
|
@@ -480,6 +484,14 @@ export declare const LOCAL_RUNTIME_DIAGNOSTIC_MESSAGES: {
|
|
|
480
484
|
readonly en: 'Value "{value}" is not among the options: {options}.';
|
|
481
485
|
readonly zh: '值“{value}”不在选项中:{options}。';
|
|
482
486
|
};
|
|
487
|
+
readonly 'runtime.choiceUnavailable': {
|
|
488
|
+
readonly en: 'The available choices cannot be evaluated yet.';
|
|
489
|
+
readonly zh: '目前还无法求值可选项。';
|
|
490
|
+
};
|
|
491
|
+
readonly 'runtime.choiceMember': {
|
|
492
|
+
readonly en: 'The value must match an available choice.';
|
|
493
|
+
readonly zh: '值必须匹配当前可选项。';
|
|
494
|
+
};
|
|
483
495
|
readonly 'runtime.budget': {
|
|
484
496
|
readonly en: 'Parameter "{name}": {detail}';
|
|
485
497
|
readonly zh: '参数“{name}”:{detail}';
|
|
@@ -620,6 +632,34 @@ export declare const LOCAL_RUNTIME_DIAGNOSTIC_MESSAGES: {
|
|
|
620
632
|
readonly en: 'Check interpolation delimiters and content.';
|
|
621
633
|
readonly zh: '插值格式不正确,请检查分隔符和表达式内容。';
|
|
622
634
|
};
|
|
635
|
+
readonly 'error.local.transform.source': {
|
|
636
|
+
readonly en: 'The source of an array transform must be a string array or a number array.';
|
|
637
|
+
readonly zh: '数组变换的源必须是字符串数组或数字数组。';
|
|
638
|
+
};
|
|
639
|
+
readonly 'error.local.transform.predicate': {
|
|
640
|
+
readonly en: 'A filter condition must evaluate to a boolean.';
|
|
641
|
+
readonly zh: 'filter 条件必须求值为布尔值。';
|
|
642
|
+
};
|
|
643
|
+
readonly 'error.local.transform.projection': {
|
|
644
|
+
readonly en: 'A map projection must produce strings or finite numbers of one kind.';
|
|
645
|
+
readonly zh: 'map 投影必须生成同类的字符串或有限数值。';
|
|
646
|
+
};
|
|
647
|
+
readonly 'error.local.transform.key': {
|
|
648
|
+
readonly en: 'A sortBy key must be a string or finite number, with all keys of one kind.';
|
|
649
|
+
readonly zh: 'sortBy 键必须是字符串或有限数值,且所有键必须同属一类。';
|
|
650
|
+
};
|
|
651
|
+
readonly 'error.local.transform.order': {
|
|
652
|
+
readonly en: 'The sortBy direction must be the string literal "asc" or "desc".';
|
|
653
|
+
readonly zh: 'sortBy 排序方向必须是字符串字面量 "asc" 或 "desc"。';
|
|
654
|
+
};
|
|
655
|
+
readonly 'error.local.transform.depth': {
|
|
656
|
+
readonly en: 'Array transforms are nested deeper than the supported limit.';
|
|
657
|
+
readonly zh: '数组变换的嵌套深度超过上限。';
|
|
658
|
+
};
|
|
659
|
+
readonly 'error.local.budget.transform': {
|
|
660
|
+
readonly en: 'Array transforms exceeded the iteration, work or sort-key budget.';
|
|
661
|
+
readonly zh: '数组变换超过迭代、工作量或临时排序键预算。';
|
|
662
|
+
};
|
|
623
663
|
readonly 'error.latex-budget': {
|
|
624
664
|
readonly en: 'The formula exceeded a resource budget.';
|
|
625
665
|
readonly zh: '公式超过长度、记号、节点、深度或计算步数预算,请简化公式。';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LocalValue } from '../types.js';
|
|
2
|
+
type ChoiceComponent = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly replaces?: unknown;
|
|
5
|
+
} | undefined;
|
|
6
|
+
export declare function usesDynamicOptions(component: ChoiceComponent): boolean;
|
|
7
|
+
export declare function usesGeneratedChart(component: ChoiceComponent, rows: unknown): boolean;
|
|
8
|
+
export declare function usesGeneratedSelection(component: ChoiceComponent, rows: unknown): boolean;
|
|
9
|
+
/** The same option domain is used for rendering, writes and reconciliation. */
|
|
10
|
+
export declare function optionValues(value: LocalValue): string[] | null;
|
|
11
|
+
/** Keep the original string, including whitespace, in the public binding. */
|
|
12
|
+
export declare function generatedRowKey(value: LocalValue | undefined): string | null;
|
|
13
|
+
export declare function generatedRowLocals(item: LocalValue, index: number, dependencies: readonly string[], read: (name: string) => LocalValue): Record<string, LocalValue>;
|
|
14
|
+
/**
|
|
15
|
+
* Pure selection reconciliation for dynamic option sources. Returns the value
|
|
16
|
+
* the binding must hold, or null when the stored selection is already
|
|
17
|
+
* consistent. Options are deduplicated in source order; empty option values are
|
|
18
|
+
* ignored. A multi-select keeps only stored strings that name a current option,
|
|
19
|
+
* in option order, capped by `maxSelected`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeDynamicSelection(options: readonly string[], stored: LocalValue | readonly string[] | readonly number[], multiple: boolean, maxSelected?: number): string | string[] | null;
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { LocalExpressionError, type LocalExpression } from './expression/compile.js';
|
|
2
|
-
import type { LocalComputation, LocalValue, LocalValueKind } from '../types.js';
|
|
2
|
+
import type { LocalComputation, LocalValue, LocalValueKind, SourceRange } from '../types.js';
|
|
3
|
+
import type { LocalDiagnosticDetails } from '../configuration/diagnostics.js';
|
|
4
|
+
import type { TransformStage } from './expression/transform-budget.js';
|
|
3
5
|
/**
|
|
4
6
|
* Declarations are resolved in one bounded pass: every expression is compiled
|
|
5
7
|
* once, the dependency graph is topologically ordered with an iterative Kahn
|
|
@@ -19,8 +21,12 @@ export interface ComputationInput {
|
|
|
19
21
|
start: number;
|
|
20
22
|
end: number;
|
|
21
23
|
};
|
|
24
|
+
/** Map dataset dependencies to the original attribute text for diagnostics. */
|
|
25
|
+
datasetRange?: (expression: LocalExpression, dependency: string) => SourceRange | undefined;
|
|
26
|
+
/** A dataset's precomputed cell index. */
|
|
27
|
+
value?: string[];
|
|
22
28
|
}
|
|
23
|
-
export type ComputationReport = (code: string, message: string, start: number, end?: number) => void;
|
|
29
|
+
export type ComputationReport = (code: string, message: string | LocalDiagnosticDetails, start: number, end?: number, details?: LocalDiagnosticDetails) => void;
|
|
24
30
|
export interface ResolvedComputations {
|
|
25
31
|
computations: Record<string, LocalComputation>;
|
|
26
32
|
kinds: Record<string, LocalValueKind>;
|
|
@@ -34,7 +40,9 @@ export interface ResolvedComputations {
|
|
|
34
40
|
* uses this to evaluate a hand-built document without trusting declaration
|
|
35
41
|
* order; unresolved names are reported through `cyclic`.
|
|
36
42
|
*/
|
|
37
|
-
export declare function orderComputations(computations: Record<string,
|
|
43
|
+
export declare function orderComputations(computations: Readonly<Record<string, {
|
|
44
|
+
dependencies: readonly string[];
|
|
45
|
+
}>>): {
|
|
38
46
|
order: string[];
|
|
39
47
|
cyclic: string[];
|
|
40
48
|
};
|
|
@@ -44,7 +52,7 @@ export declare function resolveComputationGraph(inputs: ComputationInput[], cont
|
|
|
44
52
|
}): ResolvedComputations;
|
|
45
53
|
export interface ComputationEvaluation {
|
|
46
54
|
values: Record<string, LocalValue>;
|
|
47
|
-
|
|
55
|
+
environment: Record<string, LocalValue>;
|
|
48
56
|
}
|
|
49
57
|
/**
|
|
50
58
|
* Evaluate `computed` declarations against a control snapshot. Constants are
|
|
@@ -53,4 +61,4 @@ export interface ComputationEvaluation {
|
|
|
53
61
|
* the original error only when the failing name is actually read, which keeps
|
|
54
62
|
* short-circuited branches and independent consumers working.
|
|
55
63
|
*/
|
|
56
|
-
export declare function evaluateComputations(computations: Record<string, LocalComputation>, order: string[], expressions: Map<string, LocalExpression>, controls: Record<string, LocalValue>, constValues: Record<string, LocalValue>, unavailable?: ReadonlyMap<string, LocalExpressionError
|
|
64
|
+
export declare function evaluateComputations(computations: Record<string, LocalComputation>, order: string[], expressions: Map<string, LocalExpression>, controls: Record<string, LocalValue>, constValues: Record<string, LocalValue>, unavailable?: ReadonlyMap<string, LocalExpressionError>, transactionStage?: TransformStage): ComputationEvaluation;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A collision-free key for an indexed cell, including Unicode and punctuation. */
|
|
2
|
+
export declare function datasetCellKey(row: string, column: string): string;
|
|
3
|
+
/** Dataset constants store sorted key/value pairs for bounded binary search. */
|
|
4
|
+
export declare function findDatasetCell(values: readonly unknown[], key: string): string | null;
|
|
@@ -2,3 +2,16 @@ export declare function sumNumberArray(values: readonly number[]): number;
|
|
|
2
2
|
export declare function averageNumberArray(values: readonly number[]): number | null;
|
|
3
3
|
export declare function minNumberArray(values: readonly number[]): number | null;
|
|
4
4
|
export declare function maxNumberArray(values: readonly number[]): number | null;
|
|
5
|
+
/**
|
|
6
|
+
* Start-inclusive, end-exclusive numeric range. A positive step walks upward
|
|
7
|
+
* and a negative step walks downward. Candidates are built as
|
|
8
|
+
* `start + index * step` and walked while the represented value is strictly
|
|
9
|
+
* before `end`; counting by division is not reliable because it overestimates
|
|
10
|
+
* when the quotient rounds up (for example `(8.9 - 0) / 0.00089`). The
|
|
11
|
+
* comparison uses the represented values, so a distinct value one ULP below
|
|
12
|
+
* the endpoint is still returned. A step too small to change the current
|
|
13
|
+
* value is a domain error rather than a run of duplicates, and the item limit
|
|
14
|
+
* is enforced on the 10,001st value while exactly MAX_LOCAL_ARRAY_LENGTH
|
|
15
|
+
* values are accepted.
|
|
16
|
+
*/
|
|
17
|
+
export declare function rangeNumbers(start: number, end: number, step: number): number[];
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { LocalValue, LocalValueKind } from '../../types.js';
|
|
2
|
+
import type { TransformStage } from './transform-budget.js';
|
|
2
3
|
export interface LocalExpression {
|
|
3
4
|
readonly source: string;
|
|
4
5
|
readonly dependencies: string[];
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Evaluate against `env`. When a transform stage is passed, filter/map/sortBy
|
|
8
|
+
* work accrues to that shared stage budget.
|
|
9
|
+
*/
|
|
10
|
+
evaluate(env: Record<string, LocalValue>, stage?: TransformStage): LocalValue;
|
|
6
11
|
inferType(env: Record<string, LocalValueKind>): LocalValueKind;
|
|
7
12
|
}
|
|
8
13
|
/**
|
|
@@ -14,17 +19,19 @@ export interface LocalExpression {
|
|
|
14
19
|
export declare function expressionDependencyOffset(expression: LocalExpression, name: string): number | undefined;
|
|
15
20
|
export declare function compileExpression(source: string): LocalExpression;
|
|
16
21
|
/** Render a template to scalar text. Arrays are rejected rather than serialized. */
|
|
17
|
-
export declare function interpolate(template: string, env: Record<string, LocalValue
|
|
22
|
+
export declare function interpolate(template: string, env: Record<string, LocalValue>, stage?: TransformStage): string;
|
|
18
23
|
/**
|
|
19
24
|
* Evaluate a template that is exactly one interpolation, preserving its type.
|
|
20
25
|
* Mixed templates and plain text fall back to text rendering.
|
|
21
26
|
*/
|
|
22
|
-
export declare function expressionValue(template: string, env: Record<string, LocalValue
|
|
27
|
+
export declare function expressionValue(template: string, env: Record<string, LocalValue>, stage?: TransformStage): LocalValue;
|
|
23
28
|
/**
|
|
24
29
|
* Binding keys read by the `{{ }}` expressions of a template, deduplicated in
|
|
25
30
|
* first-occurrence order. Malformed templates or expressions throw; callers
|
|
26
31
|
* that only need a static scan treat a throw as undecidable.
|
|
27
32
|
*/
|
|
28
33
|
export declare function templateDependencies(template: string): string[];
|
|
29
|
-
export { LocalExpressionError, BUILTIN_SET, CONSTANTS, FORBIDDEN_NAMES, VALID_KINDS, RESERVED_NAMES, MAX_AST_NODES, MAX_PARSE_DEPTH, MAX_AST_DEPTH, MAX_EVAL_STEPS, MAX_EVAL_DEPTH, MAX_STRING_LENGTH, arrayValueProblem, localValueBudgetIssue, localValueBudgetError } from "./values.js";
|
|
34
|
+
export { LocalExpressionError, BUILTIN_SET, CONSTANTS, FORBIDDEN_NAMES, VALID_KINDS, RESERVED_NAMES, MAX_AST_NODES, MAX_PARSE_DEPTH, MAX_AST_DEPTH, MAX_EVAL_STEPS, MAX_EVAL_DEPTH, MAX_STRING_LENGTH, MAX_TRANSFORM_DEPTH, MAX_TRANSFORM_ITERATIONS, MAX_TRANSFORM_WORK, MAX_TRANSFORM_STAGE_WORK, arrayValueProblem, localValueBudgetIssue, localValueBudgetError } from "./values.js";
|
|
30
35
|
export type { BuiltinName } from "./values.js";
|
|
36
|
+
export { createTransformStage } from './transform-budget.js';
|
|
37
|
+
export type { TransformStage } from './transform-budget.js';
|
|
@@ -16,7 +16,30 @@ export declare function replaceLiteral(text: string, search: string, replacement
|
|
|
16
16
|
* Negative indexes count from the end and out-of-range indexes are clamped.
|
|
17
17
|
*/
|
|
18
18
|
export declare function sliceCodePoints(text: string, start: number, end: number | undefined): string;
|
|
19
|
+
/**
|
|
20
|
+
* Strict base-10 conversion for `number(text)`. Surrounding whitespace is
|
|
21
|
+
* ignored; thousands separators, hexadecimal, Infinity and NaN are rejected.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseNumberText(text: string): number;
|
|
24
|
+
/**
|
|
25
|
+
* Join one homogeneous string or numeric array with a literal separator.
|
|
26
|
+
* Numeric members use JavaScript number text, never locale formatting.
|
|
27
|
+
*/
|
|
28
|
+
export declare function joinValues(values: readonly (string | number)[], separator: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Split by a literal separator. An empty separator splits into Unicode code
|
|
31
|
+
* points, matching `len()` and `slice()`. Array and member budgets are checked
|
|
32
|
+
* before the full result is constructed.
|
|
33
|
+
*/
|
|
34
|
+
export declare function splitText(text: string, separator: string): string[];
|
|
19
35
|
/** Compare two calendar dates: -1 when `left` is earlier, 0 when equal, 1 later. */
|
|
20
36
|
export declare function compareDates(left: string, right: string): number;
|
|
21
37
|
/** Signed `left - right` difference in the requested unit. */
|
|
22
38
|
export declare function diffDates(left: string, right: string, unit?: string): number;
|
|
39
|
+
/**
|
|
40
|
+
* Add a signed amount in the requested unit and return the resulting UTC
|
|
41
|
+
* calendar date. The result must stay within years 0001-9999.
|
|
42
|
+
*/
|
|
43
|
+
export declare function addDates(date: string, amount: number, unit?: string): string;
|
|
44
|
+
/** Localized medium date text in UTC, using the explicit supported locales. */
|
|
45
|
+
export declare function formatCalendarDate(date: string, locale?: string): string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { TransformStage } from './transform-budget.js';
|
|
1
2
|
import type { LocalValue } from '../../types.js';
|
|
2
3
|
import type { Ast } from './syntax.js';
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function currentMacroArgumentStage(): TransformStage | null;
|
|
5
|
+
export declare function evalAst(ast: Ast, env: Record<string, LocalValue>, stage?: TransformStage): LocalValue;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Internal symbols are emitted by the macro compiler and consumed as one token. */
|
|
2
|
+
export declare const MACRO_SYMBOL_PREFIX = "@macro:";
|
|
3
|
+
export declare const MACRO_NODE_PREFIX = "macro:";
|
|
4
|
+
export declare const MACRO_SYMBOL_PATTERN: RegExp;
|
|
5
|
+
export declare function isMacroSymbol(name: string): boolean;
|
|
6
|
+
export declare function isMacroArgument(name: string): boolean;
|
|
7
|
+
export declare function datasetSymbol(name: string): string;
|
|
8
|
+
export declare function datasetName(symbol: string): string | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BuiltinName } from './values.js';
|
|
2
2
|
import type { LocalValue } from '../../types.js';
|
|
3
|
-
|
|
3
|
+
export declare function rewriteExpressionReferences(source: string, reference: (name: string, start: number) => string): string;
|
|
4
|
+
type BinaryOperator = '+' | '-' | '*' | '/' | '%' | '==' | '!=' | '<' | '<=' | '>' | '>=' | '&&' | '||' | '??';
|
|
4
5
|
export type Ast = {
|
|
5
6
|
kind: 'literal';
|
|
6
7
|
value: LocalValue;
|
|
@@ -41,14 +42,19 @@ export type Ast = {
|
|
|
41
42
|
args: Ast[];
|
|
42
43
|
start: number;
|
|
43
44
|
};
|
|
45
|
+
/** Iteration-scope names bound by a transform's callback argument. */
|
|
46
|
+
export declare const ITERATION_NAMES: ReadonlySet<string>;
|
|
44
47
|
export declare class Parser {
|
|
48
|
+
private readonly onFreeReference?;
|
|
45
49
|
private readonly tokens;
|
|
46
50
|
private position;
|
|
47
51
|
private nodeCount;
|
|
52
|
+
private transformNesting;
|
|
53
|
+
private transformScopeDepth;
|
|
48
54
|
private readonly dependencyNames;
|
|
49
55
|
private readonly dependencySet;
|
|
50
56
|
private readonly dependencyStarts;
|
|
51
|
-
constructor(source: string);
|
|
57
|
+
constructor(source: string, onFreeReference?: ((name: string, offset: number, inIterationScope: boolean) => void) | undefined);
|
|
52
58
|
get dependencies(): string[];
|
|
53
59
|
/** Source offset of the first reference token for each dependency. */
|
|
54
60
|
get dependencyOffsets(): ReadonlyMap<string, number>;
|
|
@@ -59,6 +65,7 @@ export declare class Parser {
|
|
|
59
65
|
private expect;
|
|
60
66
|
private node;
|
|
61
67
|
private parseConditional;
|
|
68
|
+
private parseNullish;
|
|
62
69
|
private parseOr;
|
|
63
70
|
private parseAnd;
|
|
64
71
|
private parseEquality;
|
|
@@ -67,6 +74,16 @@ export declare class Parser {
|
|
|
67
74
|
private parseMultiplicative;
|
|
68
75
|
private parseUnary;
|
|
69
76
|
private parsePrimary;
|
|
77
|
+
private parseArguments;
|
|
78
|
+
private parseLookupArguments;
|
|
79
|
+
private trackReference;
|
|
80
|
+
/**
|
|
81
|
+
* Arguments of `filter`, `map` and `sortBy`. The source argument runs at the
|
|
82
|
+
* current iteration scope; the condition, projection or key runs in a scope
|
|
83
|
+
* that binds `item` and `index`, so those names are local there.
|
|
84
|
+
* Every argument still counts toward the static transform-nesting depth.
|
|
85
|
+
*/
|
|
86
|
+
private parseTransformArguments;
|
|
70
87
|
private parseAtom;
|
|
71
88
|
}
|
|
72
89
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform work shared by one compilation evaluation, runtime transaction or
|
|
3
|
+
* document render. Expressions charge the stage they are evaluated with while
|
|
4
|
+
* a transform call is active; ordinary evaluation never touches it.
|
|
5
|
+
*/
|
|
6
|
+
export interface TransformStage {
|
|
7
|
+
/** Work units accumulated by every transform evaluated in this stage. */
|
|
8
|
+
work: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function createTransformStage(): TransformStage;
|
|
11
|
+
export declare function currentTransformStage(): TransformStage | undefined;
|
|
12
|
+
/** Share a budget during synchronous work, including nested renderer calls. */
|
|
13
|
+
export declare function withTransformStage<T>(stage: TransformStage, run: () => T): T;
|
|
@@ -13,7 +13,7 @@ export declare class LocalExpressionError extends Error {
|
|
|
13
13
|
readonly code: string;
|
|
14
14
|
constructor(code: string, message: string, offset?: number);
|
|
15
15
|
}
|
|
16
|
-
declare const BUILTIN_FUNCTIONS: readonly ['abs', 'sqrt', 'floor', 'ceil', 'round', 'min', 'max', 'pow', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'exp', 'log', 'len', 'contains', 'clamp', 'sum', 'average', 'minOf', 'maxOf', 'formatNumber', 'formatPercent', 'formatScientific', 'formatCurrency', 'trim', 'lower', 'upper', 'startsWith', 'endsWith', 'replace', 'slice', 'dateCompare', 'dateDiff'];
|
|
16
|
+
declare const BUILTIN_FUNCTIONS: readonly ['abs', 'sqrt', 'floor', 'ceil', 'round', 'min', 'max', 'pow', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'exp', 'log', 'len', 'contains', 'clamp', 'number', 'string', 'sum', 'average', 'minOf', 'maxOf', 'range', 'join', 'split', 'formatNumber', 'formatPercent', 'formatScientific', 'formatCurrency', 'trim', 'lower', 'upper', 'startsWith', 'endsWith', 'replace', 'slice', 'ifBlank', 'dateCompare', 'dateDiff', 'dateAdd', 'formatDate', 'filter', 'map', 'sortBy', 'lookup'];
|
|
17
17
|
export type BuiltinName = (typeof BUILTIN_FUNCTIONS)[number];
|
|
18
18
|
export declare const BUILTIN_SET: ReadonlySet<string>;
|
|
19
19
|
export declare const CONSTANTS: ReadonlyMap<string, number>;
|
|
@@ -30,6 +30,14 @@ export declare const MAX_AST_DEPTH = 200;
|
|
|
30
30
|
/** AST node visits and call depth, per evaluation; short-circuited branches are not visited. */
|
|
31
31
|
export declare const MAX_EVAL_STEPS = 10000;
|
|
32
32
|
export declare const MAX_EVAL_DEPTH = 250;
|
|
33
|
+
/** Array-transforms nested at one position, per expression. */
|
|
34
|
+
export declare const MAX_TRANSFORM_DEPTH = 3;
|
|
35
|
+
/** Condition, projection and key evaluations shared by all transforms, per expression. */
|
|
36
|
+
export declare const MAX_TRANSFORM_ITERATIONS = 50000;
|
|
37
|
+
/** Transform work units shared by all transforms, per expression. */
|
|
38
|
+
export declare const MAX_TRANSFORM_WORK = 1000000;
|
|
39
|
+
/** Transform work units per compilation evaluation, runtime transaction or render. */
|
|
40
|
+
export declare const MAX_TRANSFORM_STAGE_WORK = 5000000;
|
|
33
41
|
/** Shared value budgets. `MAX_STRING_LENGTH` also caps concatenation results (UTF-16). */
|
|
34
42
|
export declare const MAX_STRING_LENGTH = 100000;
|
|
35
43
|
interface ArrayValueProblem extends LocalDiagnosticDetails {
|
|
@@ -4,8 +4,8 @@ import type { Diagnostic, LocalValidation, SourceRange } from '../types.js';
|
|
|
4
4
|
*
|
|
5
5
|
* The compiler publishes `LocalDocument.validations` in source order; the
|
|
6
6
|
* runtime evaluates each rule independently against the current revision and
|
|
7
|
-
* reports two stable diagnostic codes.
|
|
8
|
-
*
|
|
7
|
+
* reports two stable diagnostic codes. Diagnostics carry the compiled rule's
|
|
8
|
+
* node ID because macro instances can share the same authored range.
|
|
9
9
|
*/
|
|
10
10
|
/** A rule whose `when` expression evaluated to `false`. */
|
|
11
11
|
export declare const LOCAL_VALIDATION_FAILED_CODE = "local.validation.failed";
|
|
@@ -13,6 +13,10 @@ export declare const LOCAL_VALIDATION_FAILED_CODE = "local.validation.failed";
|
|
|
13
13
|
export declare const LOCAL_VALIDATION_EXPRESSION_CODE = "local.validation.expression";
|
|
14
14
|
/** Visible substitute when the rule message itself cannot be interpolated. */
|
|
15
15
|
export declare const LOCAL_VALIDATION_FALLBACK_MESSAGE = "Validation failed.";
|
|
16
|
+
export declare function validationRangeKey(range: SourceRange): string;
|
|
17
|
+
/** Null marks a range shared by several rules and unusable for legacy diagnostics. */
|
|
18
|
+
export declare function validationRuleIndicesByRange(rules: readonly LocalValidation[]): ReadonlyMap<string, number | null>;
|
|
19
|
+
export declare function validationDiagnosticNodeId(diagnostic: Pick<Diagnostic, 'details'>): string | undefined;
|
|
16
20
|
/** Apply the shared diagnostic message budget with the existing ellipsis style. */
|
|
17
21
|
export declare function boundLocalDiagnosticMessage(message: string): string;
|
|
18
22
|
/** `fields` is a whitespace-separated list of public writable parameter names. */
|
|
@@ -25,8 +29,6 @@ export declare function localLineStarts(source: string): number[];
|
|
|
25
29
|
*/
|
|
26
30
|
export declare function isLocalValidation(rule: unknown): rule is LocalValidation;
|
|
27
31
|
/**
|
|
28
|
-
* Build a runtime diagnostic
|
|
29
|
-
* from the compiled metadata, so renderers can match the diagnostic back to
|
|
30
|
-
* the tag node without any extra field.
|
|
32
|
+
* Build a runtime diagnostic with the authored location and compiled identity.
|
|
31
33
|
*/
|
|
32
|
-
export declare function validationDiagnostic(source: string, lineStarts: readonly number[], range:
|
|
34
|
+
export declare function validationDiagnostic(source: string, lineStarts: readonly number[], { range, nodeId }: Pick<LocalValidation, 'range' | 'nodeId'>, code: string, message: string): Diagnostic;
|