reactive-md 0.6.1 → 0.8.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 +66 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING-ch.md +6 -62
- package/CONTRIBUTING.md +5 -63
- package/README-ch.md +232 -67
- package/README-en.md +209 -71
- package/README.md +209 -71
- package/SECURITY-ch.md +3 -1
- package/SECURITY.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1909 -87
- package/cli/args.mjs +33 -1
- package/cli/build.mjs +62 -1
- package/cli/check.mjs +444 -0
- package/cli/help.mjs +181 -3
- package/cli/init.mjs +1577 -0
- package/cli/main.mjs +11 -1
- package/cli/package-loader.mjs +41 -0
- package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
- package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
- package/dist-library/compiler--ea2CKQF.js +61 -0
- package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
- package/dist-library/component-state-Cq2K5gkS.js +490 -0
- package/dist-library/component-state-D_cw_EHe.js +54 -0
- package/dist-library/config-validation-DXTynAw7.js +3005 -0
- package/dist-library/default-components-Z_YMio5P.js +2346 -0
- package/dist-library/identity-MYJXKSkB.js +1443 -0
- package/dist-library/math-display-BJz4gbFc.js +24000 -0
- package/dist-library/math-sample-BGEW49zY.js +1124 -0
- package/dist-library/options-CX5m5n-J.js +115 -0
- package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
- package/dist-library/props-DGlBk0e5.js +183 -0
- package/dist-library/react-ByOHunUW.js +122 -0
- package/dist-library/reactive-md-authoring.js +712 -1077
- package/dist-library/reactive-md-build.js +7966 -0
- package/dist-library/reactive-md-compiler-standard.js +33 -0
- package/dist-library/reactive-md-compiler.js +22 -0
- package/dist-library/reactive-md-default-packs.js +71 -0
- package/dist-library/reactive-md-default-preset.js +10 -0
- package/dist-library/reactive-md-export.js +111 -0
- package/dist-library/reactive-md-print.css +18 -3
- package/dist-library/reactive-md-react-runtime.js +251 -0
- package/dist-library/reactive-md-react-server.js +55 -0
- package/dist-library/reactive-md-react-unstyled.js +9 -1
- package/dist-library/reactive-md-react.js +9 -1
- package/dist-library/reactive-md-runtime-browser.js +51 -0
- package/dist-library/reactive-md-runtime.js +3 -0
- package/dist-library/reactive-md-sdk.js +6 -0
- package/dist-library/reactive-md-standalone-host.js +442 -0
- package/dist-library/reactive-md-testing-browser.js +523 -0
- package/dist-library/reactive-md-testing-react.js +221 -0
- package/dist-library/reactive-md-testing.js +638 -0
- package/dist-library/reactive-md-vite.js +959 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1080 -795
- package/dist-library/registry-B9Jc3FVe.js +1174 -0
- package/dist-library/resources-BGt8mpDA.js +204 -0
- package/dist-library/runtime-C-sbfpOX.js +1157 -0
- package/dist-library/runtime-Dkq7ldyg.js +172 -0
- package/dist-library/schema-ZFufO8V0.js +39 -0
- package/dist-library/shareable-DDVL4Fi9.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +168 -0
- package/dist-library/types/authoring/conformance.d.ts +24 -0
- package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
- package/dist-library/types/authoring/extensions.d.ts +13 -0
- package/dist-library/types/authoring/index.d.ts +14 -11
- package/dist-library/types/authoring/insert.d.ts +16 -0
- package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
- package/dist-library/types/authoring/templates.d.ts +65 -0
- package/dist-library/types/build/diagnostics.d.ts +8 -0
- package/dist-library/types/build/digest.d.ts +5 -0
- package/dist-library/types/build/entry.d.ts +9 -0
- package/dist-library/types/build/host.d.ts +36 -0
- package/dist-library/types/build/index.d.ts +99 -0
- package/dist-library/types/build/notices.d.ts +29 -0
- package/dist-library/types/build/resources.d.ts +60 -0
- package/dist-library/types/build/vite.d.ts +15 -0
- package/dist-library/types/compiler/index.d.ts +22 -0
- package/dist-library/types/compiler/result.d.ts +30 -0
- package/dist-library/types/compiler/standard.d.ts +16 -0
- package/dist-library/types/compiler/types.d.ts +69 -0
- package/dist-library/types/components/chart-motion.d.ts +12 -0
- package/dist-library/types/components/controls.d.ts +21 -0
- package/dist-library/types/{local → components}/data-table.d.ts +10 -24
- package/dist-library/types/components/default-chart-types.d.ts +22 -0
- package/dist-library/types/components/default-chart.d.ts +2 -0
- package/dist-library/types/components/default-preset.d.ts +10 -0
- package/dist-library/types/components/diagram-inspector.d.ts +24 -0
- package/dist-library/types/components/gallery.d.ts +6 -0
- package/dist-library/types/components/layout.d.ts +23 -0
- package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
- package/dist-library/types/components/mafs-visuals.d.ts +40 -0
- package/dist-library/types/components/numeric-sliders.d.ts +3 -0
- package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
- package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
- package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
- package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
- package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
- package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
- package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
- package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
- package/dist-library/types/components/use-hydrated.d.ts +6 -0
- package/dist-library/types/components/visuals.d.ts +13 -0
- package/dist-library/types/export/component-state.d.ts +39 -0
- package/dist-library/types/export/index.d.ts +47 -0
- package/dist-library/types/export/requirements.d.ts +23 -0
- package/dist-library/types/export/resources.d.ts +8 -0
- package/dist-library/types/export/restoration.d.ts +52 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
- package/dist-library/types/local/compilation/compiler.d.ts +34 -0
- package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
- package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
- package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
- package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
- package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
- package/dist-library/types/local/configuration/options-core.d.ts +120 -0
- package/dist-library/types/local/configuration/options.d.ts +17 -0
- package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
- package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
- package/dist-library/types/local/configuration/schema.d.ts +12 -0
- package/dist-library/types/local/contracts/types.d.ts +519 -0
- package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
- package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
- package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
- package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
- package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
- package/dist-library/types/local/evaluation/math.d.ts +73 -0
- package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
- package/dist-library/types/local/html/html-details.d.ts +16 -0
- package/dist-library/types/local/html/html-entities.d.ts +7 -0
- package/dist-library/types/local/html/html-policy.d.ts +43 -0
- package/dist-library/types/local/html/html-recovery.d.ts +16 -0
- package/dist-library/types/local/html/html-table-names.d.ts +9 -0
- package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
- package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
- package/dist-library/types/local/index.d.ts +31 -24
- package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
- package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
- package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
- package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
- package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
- package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
- package/dist-library/types/local/parsing/lexical.d.ts +21 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
- package/dist-library/types/local/parsing/parser.d.ts +16 -0
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
- package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
- package/dist-library/types/local/rendering/render-types.d.ts +57 -0
- package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
- package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
- package/dist-library/types/local/runtime/runtime.d.ts +34 -0
- package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
- package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
- package/dist-library/types/local/session/incremental.d.ts +48 -0
- package/dist-library/types/local/session/parse-session.d.ts +62 -0
- package/dist-library/types/local/session/row-reuse.d.ts +46 -0
- package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
- package/dist-library/types/local/source/node-walk.d.ts +3 -0
- package/dist-library/types/local/source/source-context.d.ts +63 -0
- package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
- package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
- package/dist-library/types/local/theme/theme-name.d.ts +3 -0
- package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
- package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
- package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
- package/dist-library/types/local/transport/shared-data.d.ts +10 -0
- package/dist-library/types/local/transport/worker.d.ts +265 -0
- package/dist-library/types/local/widgets/visuals.d.ts +25 -0
- package/dist-library/types/presets/default-authoring.d.ts +50 -0
- package/dist-library/types/presets/default-components.d.ts +4 -0
- package/dist-library/types/presets/default-semantics.d.ts +8 -0
- package/dist-library/types/presets/default.d.ts +11 -0
- package/dist-library/types/presets/identity.d.ts +7 -0
- package/dist-library/types/presets/packs.d.ts +4 -0
- package/dist-library/types/react/component-api.d.ts +260 -0
- package/dist-library/types/react/component-primitives.d.ts +21 -0
- package/dist-library/types/react/component-utils.d.ts +125 -0
- package/dist-library/types/react/default-theme.d.ts +6 -0
- package/dist-library/types/react/field-validation.d.ts +11 -0
- package/dist-library/types/react/index.d.ts +17 -5
- package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
- package/dist-library/types/react/package.d.ts +69 -0
- package/dist-library/types/react/runtime/common.d.ts +4 -0
- package/dist-library/types/react/runtime/index.d.ts +8 -0
- package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
- package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
- package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
- package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
- package/dist-library/types/react/sdk.d.ts +110 -0
- package/dist-library/types/react/server.d.ts +15 -0
- package/dist-library/types/react/tooltip-layer.d.ts +10 -0
- package/dist-library/types/react/use-draft-field.d.ts +17 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
- package/dist-library/types/runtime-services/component-state.d.ts +152 -0
- package/dist-library/types/runtime-services/identity.d.ts +41 -0
- package/dist-library/types/runtime-services/index.d.ts +10 -0
- package/dist-library/types/runtime-services/random.d.ts +42 -0
- package/dist-library/types/runtime-services/runtime.d.ts +51 -0
- package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
- package/dist-library/types/sdk/assembly.d.ts +73 -0
- package/dist-library/types/sdk/compat-profile.d.ts +57 -0
- package/dist-library/types/sdk/compiler-config.d.ts +33 -0
- package/dist-library/types/sdk/config-validation.d.ts +33 -0
- package/dist-library/types/sdk/config.d.ts +35 -0
- package/dist-library/types/sdk/hash.d.ts +9 -0
- package/dist-library/types/sdk/index.d.ts +10 -0
- package/dist-library/types/sdk/manifest.d.ts +49 -0
- package/dist-library/types/sdk/pattern.d.ts +11 -0
- package/dist-library/types/sdk/preset-core.d.ts +11 -0
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +33 -0
- package/dist-library/types/sdk/registry-core.d.ts +16 -0
- package/dist-library/types/sdk/registry.d.ts +18 -0
- package/dist-library/types/sdk/theme.d.ts +73 -0
- package/dist-library/types/sdk/types.d.ts +221 -0
- package/dist-library/types/sdk/version.d.ts +49 -0
- package/dist-library/types/shareable.d.ts +29 -3
- package/dist-library/types/standalone/diagnostics.d.ts +16 -0
- package/dist-library/types/standalone/events.d.ts +4 -0
- package/dist-library/types/standalone/library.d.ts +6 -0
- package/dist-library/types/standalone/payload.d.ts +15 -0
- package/dist-library/types/standalone/prepare.d.ts +21 -0
- package/dist-library/types/standalone/session.d.ts +68 -0
- package/dist-library/types/standalone/version.d.ts +7 -0
- package/dist-library/types/testing/behavior.d.ts +19 -0
- package/dist-library/types/testing/browser.d.ts +126 -0
- package/dist-library/types/testing/cases.d.ts +16 -0
- package/dist-library/types/testing/index.d.ts +13 -0
- package/dist-library/types/testing/manifest.d.ts +10 -0
- package/dist-library/types/testing/react.d.ts +45 -0
- package/dist-library/types/testing/report.d.ts +20 -0
- package/dist-library/types/testing/types.d.ts +125 -0
- package/dist-library/types/testing/values.d.ts +22 -0
- package/dist-library/types/vite/client.d.ts +36 -0
- package/dist-library/types/vite/discovery.d.ts +51 -0
- package/dist-library/types/vite/index.d.ts +31 -0
- package/dist-library/types/vite/registration.d.ts +109 -0
- package/dist-library/types-BFCrMrg0.js +52 -0
- package/dist-library/validation-W-bmny-x.js +2253 -0
- package/dist-library/values-CIt8AjiU.js +134 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +591 -95
- package/docs/README-ch.md +90 -0
- package/docs/README.md +87 -81
- package/docs/compatibility/compatibility-ch.md +22 -14
- package/docs/compatibility/compatibility-en.md +22 -14
- package/docs/compatibility/source-versioning-ch.md +15 -12
- package/docs/compatibility/source-versioning-en.md +16 -13
- package/docs/development/component-development-ch.md +51 -195
- package/docs/development/component-development-en.md +51 -195
- package/docs/development/component-development-reference-ch.md +253 -0
- package/docs/development/component-development-reference-en.md +238 -0
- package/docs/development/component-protocol-ch.md +51 -50
- package/docs/development/component-protocol-en.md +52 -49
- package/docs/development/local-module-layout-ch.md +59 -0
- package/docs/development/local-module-layout-en.md +59 -0
- package/docs/development/performance-overview-ch.md +402 -0
- package/docs/development/performance-overview-en.md +402 -0
- package/docs/development/releasing-ch.md +8 -104
- package/docs/development/releasing-en.md +8 -104
- package/docs/guides/local-guide-ch.md +28 -9
- package/docs/guides/local-guide-en.md +31 -12
- package/docs/integration/author-tools-ch.md +4 -2
- package/docs/integration/author-tools-en.md +4 -2
- package/docs/integration/codemirror-ch.md +52 -0
- package/docs/integration/codemirror-en.md +29 -0
- package/docs/integration/compiler-ch.md +47 -0
- package/docs/integration/compiler-en.md +34 -0
- package/docs/integration/directory-discovery-ch.md +53 -0
- package/docs/integration/directory-discovery-en.md +31 -0
- package/docs/integration/editor-ch.md +48 -21
- package/docs/integration/editor-en.md +48 -21
- package/docs/integration/extension-sdk-ch.md +392 -0
- package/docs/integration/extension-sdk-en.md +377 -0
- package/docs/integration/local-integration-ch.md +63 -9
- package/docs/integration/local-integration-en.md +89 -13
- package/docs/integration/repository-split-ch.md +40 -0
- package/docs/integration/repository-split-en.md +23 -0
- package/docs/integration/shareable-export-ch.md +46 -2
- package/docs/integration/shareable-export-en.md +46 -2
- package/docs/reference/computations-formatting-ch.md +4 -2
- package/docs/reference/computations-formatting-en.md +4 -2
- package/docs/reference/constraints-collections-ch.md +21 -1
- package/docs/reference/constraints-collections-en.md +21 -1
- package/docs/reference/diagnostics-counting-ch.md +1 -1
- package/docs/reference/diagnostics-counting-en.md +1 -1
- package/docs/reference/html-compatibility-ch.md +4 -0
- package/docs/reference/html-compatibility-en.md +4 -0
- package/docs/reference/local-components-v2-ch.md +2 -0
- package/docs/reference/local-components-v2-en.md +2 -0
- package/docs/reference/local-interaction-syntax-ch.md +51 -15
- package/docs/reference/local-interaction-syntax-en.md +58 -14
- package/docs/reference/theme-protocol-ch.md +79 -7
- package/docs/reference/theme-protocol-en.md +79 -7
- package/docs/reference/tolerance-ch.md +64 -0
- package/docs/reference/tolerance-en.md +57 -0
- package/docs/releases/release-0.4.0-ch.md +2 -0
- package/docs/releases/release-0.4.0-en.md +2 -0
- package/docs/releases/release-0.4.1-ch.md +2 -0
- package/docs/releases/release-0.4.1-en.md +2 -0
- package/docs/releases/release-0.5.0-ch.md +2 -0
- package/docs/releases/release-0.5.0-en.md +2 -0
- package/docs/releases/release-0.5.1-ch.md +2 -0
- package/docs/releases/release-0.5.1-en.md +2 -0
- package/docs/releases/release-0.5.2-ch.md +2 -0
- package/docs/releases/release-0.5.2-en.md +2 -0
- package/docs/releases/release-0.5.3-ch.md +2 -0
- package/docs/releases/release-0.5.3-en.md +2 -0
- package/docs/releases/release-0.6.0-ch.md +2 -0
- package/docs/releases/release-0.6.0-en.md +2 -0
- package/docs/releases/release-0.6.1-ch.md +2 -0
- package/docs/releases/release-0.6.1-en.md +2 -0
- package/docs/releases/release-0.7.0-ch.md +86 -0
- package/docs/releases/release-0.7.0-en.md +86 -0
- package/docs/releases/release-0.8.0-ch.md +126 -0
- package/docs/releases/release-0.8.0-en.md +126 -0
- package/examples/component-package/LICENSE +21 -0
- package/examples/component-package/NOTICES.md +12 -0
- package/examples/component-package/README-ch.md +101 -0
- package/examples/component-package/README.md +133 -0
- package/examples/component-package/package.json +35 -0
- package/examples/component-package/sample/document.reactive.md +14 -0
- package/examples/component-package/scripts/build-export.mjs +44 -0
- package/examples/component-package/scripts/build.mjs +130 -0
- package/examples/component-package/scripts/verify.mjs +257 -0
- package/examples/component-package/src/assets/notice.svg +4 -0
- package/examples/component-package/src/component.css +40 -0
- package/examples/component-package/src/components.tsx +105 -0
- package/examples/component-package/src/harness.tsx +34 -0
- package/examples/component-package/src/manifests.ts +71 -0
- package/examples/component-package/src/node-entry.ts +18 -0
- package/examples/component-package/src/sample.ts +4 -0
- package/examples/component-package/src/theme.css +44 -0
- package/examples/component-package/src/theme.ts +22 -0
- package/examples/component-package/tsconfig.json +15 -0
- package/examples/conformance/README-ch.md +55 -0
- package/examples/conformance/README.md +2 -0
- package/examples/conformance/local-draft-3.json +296 -0
- package/examples/game-2048-package/LICENSE +21 -0
- package/examples/game-2048-package/NOTICES.md +11 -0
- package/examples/game-2048-package/README-ch.md +97 -0
- package/examples/game-2048-package/README.md +102 -0
- package/examples/game-2048-package/package.json +35 -0
- package/examples/game-2048-package/sample/document.reactive.md +17 -0
- package/examples/game-2048-package/scripts/build-export.mjs +44 -0
- package/examples/game-2048-package/scripts/build.mjs +130 -0
- package/examples/game-2048-package/scripts/verify.mjs +180 -0
- package/examples/game-2048-package/src/component.css +161 -0
- package/examples/game-2048-package/src/components.tsx +326 -0
- package/examples/game-2048-package/src/game-engine.ts +228 -0
- package/examples/game-2048-package/src/harness.tsx +34 -0
- package/examples/game-2048-package/src/manifest.ts +85 -0
- package/examples/game-2048-package/src/node-entry.ts +30 -0
- package/examples/game-2048-package/src/sample.ts +4 -0
- package/examples/game-2048-package/tsconfig.json +15 -0
- package/examples/integration/README-ch.md +63 -0
- package/examples/integration/README.md +17 -1
- package/examples/integration/extension-sdk/README-ch.md +24 -0
- package/examples/integration/extension-sdk/README.md +24 -0
- package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
- package/examples/integration/extension-sdk/advanced.tsx +101 -0
- package/examples/integration/extension-sdk/env.d.ts +2 -0
- package/examples/integration/extension-sdk/extensions.tsx +97 -0
- package/examples/integration/extension-sdk/index.html +3 -0
- package/examples/integration/extension-sdk/main.tsx +10 -0
- package/examples/integration/extension-sdk/package.json +6 -0
- package/examples/integration/extension-sdk/standalone.ts +7 -0
- package/examples/integration/extension-sdk/tsconfig.json +8 -0
- package/examples/integration/react-comprehensive/index.html +12 -0
- package/examples/integration/react-comprehensive/main.jsx +123 -0
- package/examples/integration/react-comprehensive/package.json +18 -0
- package/examples/local/README-ch.md +76 -0
- package/examples/local/README.md +4 -2
- package/examples/local/scenarios/blog-zh.reactive.md +71 -0
- package/examples/local/scenarios/blog.reactive.md +71 -0
- package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
- package/examples/local/scenarios/classroom.reactive.md +97 -0
- package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
- package/examples/local/scenarios/proposal.reactive.md +79 -0
- package/examples/local/scenarios/survey-zh.reactive.md +74 -0
- package/examples/local/scenarios/survey.reactive.md +74 -0
- package/examples/local/showcase/README-ch.md +22 -0
- package/examples/local/showcase/README.md +9 -3
- package/examples/local/showcase/features.reactive.md +637 -0
- package/examples/local/showcase/zh/features.reactive.md +637 -0
- package/examples/sci-fi-theme/README-ch.md +131 -0
- package/examples/sci-fi-theme/README.md +146 -0
- package/examples/sci-fi-theme/demo/demo.css +532 -0
- package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
- package/examples/sci-fi-theme/demo/index.html +13 -0
- package/examples/sci-fi-theme/demo/main.tsx +180 -0
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
- package/examples/sci-fi-theme/docs/design-system.md +474 -0
- package/examples/sci-fi-theme/package.json +27 -0
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
- package/examples/sci-fi-theme/src/components.css +1460 -0
- package/examples/sci-fi-theme/src/index.ts +6 -0
- package/examples/sci-fi-theme/src/sci-fi.css +5 -0
- package/examples/sci-fi-theme/src/theme.ts +37 -0
- package/examples/sci-fi-theme/src/tokens.css +408 -0
- package/examples/sci-fi-theme/tsconfig.json +20 -0
- package/examples/sci-fi-theme/vite.config.ts +24 -0
- package/examples/tetris-package/LICENSE +21 -0
- package/examples/tetris-package/NOTICES.md +11 -0
- package/examples/tetris-package/README-ch.md +91 -0
- package/examples/tetris-package/README.md +95 -0
- package/examples/tetris-package/package.json +35 -0
- package/examples/tetris-package/sample/document.reactive.md +16 -0
- package/examples/tetris-package/scripts/build-export.mjs +44 -0
- package/examples/tetris-package/scripts/build.mjs +130 -0
- package/examples/tetris-package/scripts/verify.mjs +173 -0
- package/examples/tetris-package/src/component.css +145 -0
- package/examples/tetris-package/src/components.tsx +334 -0
- package/examples/tetris-package/src/harness.tsx +34 -0
- package/examples/tetris-package/src/manifests.ts +93 -0
- package/examples/tetris-package/src/node-entry.ts +16 -0
- package/examples/tetris-package/src/sample.ts +4 -0
- package/examples/tetris-package/src/tetris-engine.ts +325 -0
- package/examples/tetris-package/tsconfig.json +15 -0
- package/package.json +98 -44
- package/dist-library/compiler-Cm3ppMxG.js +0 -46044
- package/dist-library/react-Bh7_oxZp.js +0 -59655
- package/dist-library/reactive-md-editor.css +0 -2
- package/dist-library/reactive-md-editor.js +0 -3853
- package/dist-library/runtime-DlFYQ4s_.js +0 -498
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
- package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
- package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
- package/dist-library/types/editor/extended-native-components.d.ts +0 -58
- package/dist-library/types/editor/index.d.ts +0 -9
- package/dist-library/types/editor/locale.d.ts +0 -13
- package/dist-library/types/editor/source-authoring.d.ts +0 -59
- package/dist-library/types/editor/types.d.ts +0 -48
- package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
- package/dist-library/types/editor/use-source-history.d.ts +0 -16
- package/dist-library/types/local/compiler.d.ts +0 -4
- package/dist-library/types/local/math.d.ts +0 -48
- package/dist-library/types/local/options.d.ts +0 -36
- package/dist-library/types/local/parser.d.ts +0 -13
- package/dist-library/types/local/render-types.d.ts +0 -27
- package/dist-library/types/local/runtime.d.ts +0 -2
- package/dist-library/types/local/schema.d.ts +0 -77
- package/dist-library/types/local/types.d.ts +0 -263
- package/dist-library/types/local/visuals.d.ts +0 -12
- package/dist-library/types/local/worker.d.ts +0 -98
- package/docs/development/performance-ch.md +0 -76
- package/docs/development/performance-en.md +0 -76
- /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
- /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
- /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
- /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
- /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
- /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
- /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
- /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
- /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
- /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
- /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
- /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
import type { LocalConfig } from '../sdk/types.js';
|
|
3
|
+
/** Bound every resource read, inline expansion and output stylesheet. */
|
|
4
|
+
export interface LocalBuildBudgets {
|
|
5
|
+
readonly maxResources: number;
|
|
6
|
+
readonly maxCssBytes: number;
|
|
7
|
+
readonly maxFileBytes: number;
|
|
8
|
+
readonly maxInlinedBytes: number;
|
|
9
|
+
readonly maxFiles: number;
|
|
10
|
+
readonly maxImportDepth: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_LOCAL_BUILD_BUDGETS: LocalBuildBudgets;
|
|
13
|
+
export interface LocalStyleResourceInput {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/** Inline CSS. Relative references need an explicit `base`. */
|
|
16
|
+
readonly css?: string;
|
|
17
|
+
/** Root-relative CSS file. Its directory is the base for relative references. */
|
|
18
|
+
readonly path?: string;
|
|
19
|
+
/** Root-relative directory for relative references in inline CSS. */
|
|
20
|
+
readonly base?: string;
|
|
21
|
+
}
|
|
22
|
+
export type LocalResourceOrigin = 'component' | 'resource' | 'theme';
|
|
23
|
+
export interface LocalBuildResource {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly css: string;
|
|
26
|
+
readonly digest: string;
|
|
27
|
+
readonly bytes: number;
|
|
28
|
+
readonly origin: LocalResourceOrigin;
|
|
29
|
+
}
|
|
30
|
+
export interface LocalBuildAsset {
|
|
31
|
+
/** Root-relative POSIX path of an inlined CSS, font or image file. */
|
|
32
|
+
readonly path: string;
|
|
33
|
+
readonly digest: string;
|
|
34
|
+
readonly bytes: number;
|
|
35
|
+
readonly mime: string;
|
|
36
|
+
}
|
|
37
|
+
export interface CollectedLocalResources {
|
|
38
|
+
readonly resources: readonly LocalBuildResource[];
|
|
39
|
+
readonly assets: readonly LocalBuildAsset[];
|
|
40
|
+
readonly css: string;
|
|
41
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
42
|
+
}
|
|
43
|
+
export interface ResourceCollectionInput {
|
|
44
|
+
readonly config: LocalConfig;
|
|
45
|
+
readonly declared: readonly LocalStyleResourceInput[];
|
|
46
|
+
/** Theme names to include; defaults to every installed theme. */
|
|
47
|
+
readonly themes?: readonly string[];
|
|
48
|
+
readonly root: string;
|
|
49
|
+
readonly allowlist: readonly string[];
|
|
50
|
+
readonly budgets: LocalBuildBudgets;
|
|
51
|
+
}
|
|
52
|
+
/** Read host-supplied budget overrides; invalid entries fall back individually. */
|
|
53
|
+
export declare function readLocalBuildBudgets(value: unknown, diagnostics: Diagnostic[]): LocalBuildBudgets;
|
|
54
|
+
/** Validate explicit { id, css | path } resource declarations. */
|
|
55
|
+
export declare function readLocalStyleResourceInputs(value: unknown, path: string, diagnostics: Diagnostic[]): LocalStyleResourceInput[];
|
|
56
|
+
/**
|
|
57
|
+
* Collect explicit component CSS, extra host resources and selected theme CSS.
|
|
58
|
+
* Order is deterministic: component style ids, extra declarations, themes.
|
|
59
|
+
*/
|
|
60
|
+
export declare function collectLocalBuildResources(input: ResourceCollectionInput): Promise<CollectedLocalResources>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
/** Minimal Vite peer surface; Vite's own types never enter the public SDK. */
|
|
3
|
+
export interface LocalViteApi {
|
|
4
|
+
build(config: unknown): Promise<unknown>;
|
|
5
|
+
}
|
|
6
|
+
export type LocalViteSource = LocalViteApi | (() => Promise<LocalViteApi>);
|
|
7
|
+
/** Load the optional Vite peer through a dynamic import, or accept an injected facade. */
|
|
8
|
+
export declare function resolveLocalVite(source: LocalViteSource | undefined, diagnostics: Diagnostic[]): Promise<LocalViteApi | null>;
|
|
9
|
+
export interface BuildStandaloneScriptInput {
|
|
10
|
+
readonly root: string;
|
|
11
|
+
readonly hostEntry: string;
|
|
12
|
+
readonly configKey: string;
|
|
13
|
+
}
|
|
14
|
+
/** Bundle the explicit host entry into one IIFE script with no chunks or assets. */
|
|
15
|
+
export declare function buildLocalStandaloneScript(input: BuildStandaloneScriptInput, vite: LocalViteApi, diagnostics: Diagnostic[]): Promise<string | null>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal single-pass compiler entry.
|
|
3
|
+
*
|
|
4
|
+
* The minimal factory installs no default component preset: only the kernel
|
|
5
|
+
* language declarations (theme/computed/const/external), CommonMark/RMD body,
|
|
6
|
+
* semantic checks and budgets remain. GFM syntax, native HTML parsing and
|
|
7
|
+
* repair, Lezer block planning, the KaTeX display precheck, plot formula
|
|
8
|
+
* semantics and the whole-document HTML branch are standard-assembly
|
|
9
|
+
* capabilities; requesting one here produces an explicit capability
|
|
10
|
+
* diagnostic. `compiler/standard` keeps the full experience.
|
|
11
|
+
*
|
|
12
|
+
* The factory validates options once and snapshots them. `compile` performs
|
|
13
|
+
* only the semantic pass: it creates no runtime, session, worker, timer or
|
|
14
|
+
* cross-source cache.
|
|
15
|
+
*/
|
|
16
|
+
import type { LocalCompileOptions } from '../local/contracts/types.js';
|
|
17
|
+
import { type Compiler } from './types.js';
|
|
18
|
+
export { CompilerConfigurationError } from './types.js';
|
|
19
|
+
export type { CheckCoverage, CompileFailure, CompileResult, CompileSuccess, Compiler, CompilerConfigurationErrorOptions, OptionalCheck, Program, } from './types.js';
|
|
20
|
+
export type { DeepReadonly } from './types.js';
|
|
21
|
+
export type { LocalCompileOptions, LocalCompileResult, LocalRecovery } from '../local/contracts/types.js';
|
|
22
|
+
export declare function createCompiler(options?: LocalCompileOptions): Compiler;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result adaptation for the single-pass compiler entries.
|
|
3
|
+
*
|
|
4
|
+
* The semantic pass still produces `LocalCompileResult`. This module is the
|
|
5
|
+
* only place that maps it to the public `CompileResult` union: it determines
|
|
6
|
+
* `valid` / `recovered` / `failed`, keeps the task-one `ok` and `document`
|
|
7
|
+
* aliases, and publishes the program as an independent, iteratively frozen
|
|
8
|
+
* plain-data snapshot. It never creates a runtime, session, worker, timer or
|
|
9
|
+
* cache.
|
|
10
|
+
*/
|
|
11
|
+
import type { LocalCompileResult } from '../local/contracts/types.js';
|
|
12
|
+
import type { CheckCoverage, CompileResult } from './types.js';
|
|
13
|
+
/** Optional-check coverage used by the minimal compiler. */
|
|
14
|
+
export declare const MINIMAL_CHECKS: CheckCoverage;
|
|
15
|
+
/** Optional-check coverage used by the standard compiler. */
|
|
16
|
+
export declare const STANDARD_CHECKS: CheckCoverage;
|
|
17
|
+
/**
|
|
18
|
+
* Freeze a plain compiler value without recursion. The stack is explicit so a
|
|
19
|
+
* deeply nested document cannot exhaust the call stack, and a `Set` guards
|
|
20
|
+
* against accidental cycles.
|
|
21
|
+
*/
|
|
22
|
+
export declare function freezeProgram<T>(value: T): T;
|
|
23
|
+
/**
|
|
24
|
+
* Adapt one semantic-pass result. Author-source errors become `failed`; a
|
|
25
|
+
* successful pass is `recovered` only when the parser actually recorded a
|
|
26
|
+
* repair. Recoveries never upgrade a failure, so unrelated semantic errors
|
|
27
|
+
* keep their `failed` status. Internal exceptions are not caught here and
|
|
28
|
+
* cannot be reported as recoveries by construction.
|
|
29
|
+
*/
|
|
30
|
+
export declare function toCompileResult(result: LocalCompileResult, checks: CheckCoverage): CompileResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard single-pass compiler entry.
|
|
3
|
+
*
|
|
4
|
+
* Same result contract as the minimal factory, but wired to the full
|
|
5
|
+
* experience: the default component preset, GFM syntax, native HTML support,
|
|
6
|
+
* Lezer block planning, the KaTeX display precheck and plot formula semantics
|
|
7
|
+
* are supplied explicitly. It is the single-pass counterpart of the legacy
|
|
8
|
+
* `compileLocal` without sessions, workers, React or theme loading.
|
|
9
|
+
*/
|
|
10
|
+
import type { LocalCompileOptions } from '../local/contracts/types.js';
|
|
11
|
+
import { type Compiler } from './types.js';
|
|
12
|
+
export { CompilerConfigurationError } from './types.js';
|
|
13
|
+
export type { CheckCoverage, CompileFailure, CompileResult, CompileSuccess, Compiler, CompilerConfigurationErrorOptions, OptionalCheck, Program, } from './types.js';
|
|
14
|
+
export type { DeepReadonly } from './types.js';
|
|
15
|
+
export type { LocalCompileOptions, LocalCompileResult, LocalRecovery } from '../local/contracts/types.js';
|
|
16
|
+
export declare function createStandardCompiler(options?: LocalCompileOptions): Compiler;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types for the standalone single-pass compiler entry points.
|
|
3
|
+
*
|
|
4
|
+
* Factories validate options once; invalid options throw
|
|
5
|
+
* `CompilerConfigurationError`. Author-source problems and structural
|
|
6
|
+
* recoveries are reported through the result instead. The result keeps the
|
|
7
|
+
* task-one `ok` / `document` aliases so existing consumers can migrate without
|
|
8
|
+
* changing their read path, and adds the strict/recovery contract from the
|
|
9
|
+
* roadmap.
|
|
10
|
+
*/
|
|
11
|
+
import type { Diagnostic, LocalCompileResult, LocalDocument, LocalRecovery } from '../local/contracts/types.js';
|
|
12
|
+
/** Structural, recursively read-only projection of plain compiler data. */
|
|
13
|
+
export type DeepReadonly<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? {
|
|
14
|
+
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
|
15
|
+
} : T;
|
|
16
|
+
/**
|
|
17
|
+
* The compiled program. The first round reuses the existing document model as
|
|
18
|
+
* a deep-read-only snapshot; internal node layout is not a long-term format.
|
|
19
|
+
*/
|
|
20
|
+
export type Program = DeepReadonly<LocalDocument>;
|
|
21
|
+
/** One optional check that ran, with its protocol version. */
|
|
22
|
+
export interface OptionalCheck {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly version: string;
|
|
25
|
+
}
|
|
26
|
+
/** Optional-check coverage for one successful compilation. */
|
|
27
|
+
export interface CheckCoverage {
|
|
28
|
+
readonly optional: readonly OptionalCheck[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A successful pass is `valid` when nothing was repaired and `recovered` when
|
|
32
|
+
* at least one structural recovery produced a still-executable program.
|
|
33
|
+
*/
|
|
34
|
+
export interface CompileSuccess {
|
|
35
|
+
readonly ok: true;
|
|
36
|
+
readonly status: 'valid' | 'recovered';
|
|
37
|
+
/** Plain document alias kept for task-one consumers; never frozen. */
|
|
38
|
+
readonly document: LocalDocument;
|
|
39
|
+
/** Independent, deeply frozen snapshot of `document`. */
|
|
40
|
+
readonly program: Program;
|
|
41
|
+
readonly diagnostics: Diagnostic[];
|
|
42
|
+
readonly recoveries: readonly LocalRecovery[];
|
|
43
|
+
readonly checks: CheckCoverage;
|
|
44
|
+
}
|
|
45
|
+
/** A failed pass has no program; recoveries completed before the failure stay visible. */
|
|
46
|
+
export interface CompileFailure {
|
|
47
|
+
readonly ok: false;
|
|
48
|
+
readonly status: 'failed';
|
|
49
|
+
readonly diagnostics: Diagnostic[];
|
|
50
|
+
readonly recoveries: readonly LocalRecovery[];
|
|
51
|
+
}
|
|
52
|
+
export type CompileResult = CompileSuccess | CompileFailure;
|
|
53
|
+
/** One reusable, already-validated compiler instance. */
|
|
54
|
+
export interface Compiler {
|
|
55
|
+
/** Compile one source revision. Never throws for author-source errors. */
|
|
56
|
+
compile(source: string): CompileResult;
|
|
57
|
+
}
|
|
58
|
+
export interface CompilerConfigurationErrorOptions {
|
|
59
|
+
/** Stable option-diagnostic key, e.g. `local.options.invalid.limits`. */
|
|
60
|
+
readonly code?: string;
|
|
61
|
+
readonly detail?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Invalid factory options; author-source errors stay in the result. */
|
|
64
|
+
export declare class CompilerConfigurationError extends Error {
|
|
65
|
+
readonly code: string;
|
|
66
|
+
readonly detail?: string;
|
|
67
|
+
constructor(message: string, options?: CompilerConfigurationErrorOptions);
|
|
68
|
+
}
|
|
69
|
+
export type { LocalCompileResult, LocalRecovery };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export declare function ChartMotionPath(props: React.SVGProps<SVGPathElement>): React.JSX.Element;
|
|
3
|
+
export declare function ChartMotionRect(props: React.SVGProps<SVGRectElement>): React.JSX.Element;
|
|
4
|
+
export declare function ChartMotionCircle(props: React.SVGProps<SVGCircleElement>): React.JSX.Element;
|
|
5
|
+
export declare function ChartMotionArc(props: React.SVGProps<SVGPathElement> & {
|
|
6
|
+
cx: number;
|
|
7
|
+
cy: number;
|
|
8
|
+
outerRadius: number;
|
|
9
|
+
innerRadius: number;
|
|
10
|
+
startAngle: number;
|
|
11
|
+
endAngle: number;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LocalComponentContext } from '../react/component-api.js';
|
|
2
|
+
import { textProblem } from '../react/field-validation.js';
|
|
3
|
+
/** Re-exported for compatibility; the pure validation lives in the React layer. */
|
|
4
|
+
export { textProblem };
|
|
5
|
+
export declare function InputView(context: LocalComponentContext): import("react").JSX.Element;
|
|
6
|
+
export declare function TextareaView(context: LocalComponentContext): import("react").JSX.Element;
|
|
7
|
+
export declare function NumberView(context: LocalComponentContext): import("react").JSX.Element;
|
|
8
|
+
export { SliderView, RangeSliderView } from './numeric-sliders.js';
|
|
9
|
+
export declare function ToggleView(context: LocalComponentContext): import("react").JSX.Element;
|
|
10
|
+
export declare function CheckboxView(context: LocalComponentContext): import("react").JSX.Element;
|
|
11
|
+
export declare function DateView(context: LocalComponentContext): import("react").JSX.Element;
|
|
12
|
+
export declare function SelectView(context: LocalComponentContext): import("react").JSX.Element;
|
|
13
|
+
export declare function ChoicesView(context: LocalComponentContext): import("react").JSX.Element;
|
|
14
|
+
export declare function RadioGroupView(context: LocalComponentContext): import("react").JSX.Element;
|
|
15
|
+
export declare function ChecklistView(context: LocalComponentContext): import("react").JSX.Element;
|
|
16
|
+
export declare function CounterView(context: LocalComponentContext): import("react").JSX.Element;
|
|
17
|
+
export declare function TimerView(context: LocalComponentContext): import("react").JSX.Element;
|
|
18
|
+
export declare function ProgressView(context: LocalComponentContext): import("react").JSX.Element;
|
|
19
|
+
export declare function MultiSelectView(context: LocalComponentContext): import("react").JSX.Element;
|
|
20
|
+
export declare function CoordinateView(context: LocalComponentContext): import("react").JSX.Element;
|
|
21
|
+
export declare function QuizView(context: LocalComponentContext): import("react").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
2
|
+
import type { LocalComponentContext } from '../react/component-api.js';
|
|
3
|
+
import { type LocalValue, type Localize } from '../react/component-utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* `<data-table>` renders generated rows from a list expression. Everything in
|
|
6
6
|
* this module is deterministic and renderer-only: rows come from the runtime,
|
|
7
7
|
* the row scope exposes `item`/`index`, and keys are validated before any row
|
|
8
|
-
* markup is allocated.
|
|
8
|
+
* markup is allocated.
|
|
9
9
|
*/
|
|
10
10
|
export type DataTableFailure = 'label' | 'columns' | 'max-rows' | 'rows' | 'rows-budget' | 'key' | 'text-budget';
|
|
11
11
|
export interface DataTableCell {
|
|
@@ -13,13 +13,11 @@ export interface DataTableCell {
|
|
|
13
13
|
text: string;
|
|
14
14
|
}
|
|
15
15
|
export interface DataTableRow {
|
|
16
|
-
/** Encoded primitive identity; React never sees a positional key. */
|
|
17
16
|
key: string;
|
|
18
17
|
cells: DataTableCell[];
|
|
19
18
|
}
|
|
20
19
|
export interface DataTableColumnSpec {
|
|
21
20
|
label: string;
|
|
22
|
-
/** Full expression source (the part between `{{` and `}}`). */
|
|
23
21
|
value: string;
|
|
24
22
|
}
|
|
25
23
|
export interface DataTableModel {
|
|
@@ -38,28 +36,16 @@ export interface DataTableBuildOptions {
|
|
|
38
36
|
readonly rows: readonly LocalValue[];
|
|
39
37
|
readonly columns: readonly DataTableColumnSpec[];
|
|
40
38
|
readonly keyExpression: string;
|
|
41
|
-
readonly runtime:
|
|
39
|
+
readonly runtime: {
|
|
40
|
+
evaluate(expression: string): LocalValue;
|
|
41
|
+
};
|
|
42
42
|
readonly maxRows?: number;
|
|
43
43
|
readonly budget?: number;
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Encode a primitive key with its type so numeric `1` and string `"1"` remain
|
|
47
|
-
* distinct. `-0` and `0` share one identity. `null` marks an invalid key.
|
|
48
|
-
*/
|
|
49
45
|
export declare function encodeDataTableKey(value: LocalValue): string | null;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* Build row keys and cell text before rendering. Row count, column count and
|
|
54
|
-
* the cumulative text budget are enforced up front; any breach returns a
|
|
55
|
-
* whole-table failure instead of a partial model.
|
|
56
|
-
*/
|
|
46
|
+
export declare function evaluateDataTableRows(runtime: {
|
|
47
|
+
evaluate(expression: string): LocalValue;
|
|
48
|
+
}, expression: string): LocalValue[];
|
|
57
49
|
export declare function buildDataTableModel(options: DataTableBuildOptions): DataTableBuildResult;
|
|
58
50
|
export declare function dataTableFailureMessage(t: Localize, failure: DataTableFailure): string;
|
|
59
|
-
export
|
|
60
|
-
node: LocalNode;
|
|
61
|
-
visible: boolean;
|
|
62
|
-
runtime: Pick<LocalRuntime, 'evaluate'>;
|
|
63
|
-
t: Localize;
|
|
64
|
-
}
|
|
65
|
-
export declare function DataTableView({ node, runtime, t }: DataTableViewProps): ReactNode;
|
|
51
|
+
export declare function DataTableView(context: LocalComponentContext): ReactNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Private view contract; compilation, validation and selection writes stay in ChartView. */
|
|
2
|
+
export interface DefaultChartRow {
|
|
3
|
+
index: number;
|
|
4
|
+
label: string;
|
|
5
|
+
xValue: number | null;
|
|
6
|
+
values: (number | null)[];
|
|
7
|
+
keyValue: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DefaultChartProps {
|
|
10
|
+
kind: 'bar' | 'line' | 'area' | 'scatter' | 'donut' | 'pie';
|
|
11
|
+
title: string;
|
|
12
|
+
xLabel: string;
|
|
13
|
+
yLabel: string;
|
|
14
|
+
rows: readonly DefaultChartRow[];
|
|
15
|
+
seriesNames: readonly string[];
|
|
16
|
+
numericX: boolean;
|
|
17
|
+
selectionEnabled: boolean;
|
|
18
|
+
selectedRowKey: string;
|
|
19
|
+
onSelect(key: string): void;
|
|
20
|
+
resetToken: number;
|
|
21
|
+
t(en: string, zh: string): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LocalComponentRender, LocalReactPreset } from '../react/component-api.js';
|
|
2
|
+
/** Public implementation table for the builtin preset, keyed by tag name. */
|
|
3
|
+
export declare const DEFAULT_COMPONENT_VIEWS: Readonly<Record<string, LocalComponentRender>>;
|
|
4
|
+
/**
|
|
5
|
+
* Assemble the builtin React preset from the same public manifests the kernel
|
|
6
|
+
* uses. Every builtin is bound with `defineReactComponent`; there is no
|
|
7
|
+
* separate dispatch table or private default callback.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDefaultReactPreset(): LocalReactPreset;
|
|
10
|
+
export declare const defaultReactPreset: LocalReactPreset;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface Anchor {
|
|
3
|
+
id: string;
|
|
4
|
+
element: SVGElement;
|
|
5
|
+
pinned: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Keeps transient inspection separate from the diagram's persistent selection. */
|
|
8
|
+
export declare function useDiagramInspector(enabled: boolean, resetToken: number): {
|
|
9
|
+
active: Anchor | null;
|
|
10
|
+
tooltipRef: import("react").RefObject<HTMLDivElement | null>;
|
|
11
|
+
show: (id: string, element: SVGElement, source: 'pointer' | 'focus' | 'click') => void;
|
|
12
|
+
leave: (source?: 'pointer' | 'focus') => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
cancel: () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function DiagramInspector({ inspector, id, title, tone, children, closeLabel }: {
|
|
17
|
+
inspector: ReturnType<typeof useDiagramInspector>;
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
tone: string;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
closeLabel: string;
|
|
23
|
+
}): import("react").ReactPortal | null;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LocalComponentContext } from '../react/component-api.js';
|
|
2
|
+
export declare function Gallery(context: LocalComponentContext): import("react").JSX.Element;
|
|
3
|
+
export declare function GalleryStatic(context: LocalComponentContext): import("react").JSX.Element;
|
|
4
|
+
export declare function GalleryItemView(context: LocalComponentContext): import("react").JSX.Element;
|
|
5
|
+
/** Render every item in static documents without interactive controls. */
|
|
6
|
+
export declare function GalleryView(context: LocalComponentContext): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LocalComponentContext } from '../react/component-api.js';
|
|
2
|
+
export declare function PanelView(context: LocalComponentContext): import("react").JSX.Element;
|
|
3
|
+
export declare function CardView(context: LocalComponentContext): import("react").JSX.Element;
|
|
4
|
+
export declare function GridView(context: LocalComponentContext): import("react").JSX.Element;
|
|
5
|
+
export declare function TabView(context: LocalComponentContext): import("react").JSX.Element;
|
|
6
|
+
export declare function StepsTabView(context: LocalComponentContext): import("react").JSX.Element;
|
|
7
|
+
export declare function OptionView(): null;
|
|
8
|
+
export declare function ColumnView(): null;
|
|
9
|
+
export declare function EdgeView(): null;
|
|
10
|
+
export declare function TabsView(context: LocalComponentContext): import("react").JSX.Element;
|
|
11
|
+
export declare function StepsView(context: LocalComponentContext): import("react").JSX.Element;
|
|
12
|
+
export declare function StepView(): null;
|
|
13
|
+
export declare function AccordionView(context: LocalComponentContext): import("react").JSX.Element;
|
|
14
|
+
export declare function DisclosureView(context: LocalComponentContext): import("react").JSX.Element;
|
|
15
|
+
export declare function IfView(context: LocalComponentContext): import("react").JSX.Element;
|
|
16
|
+
export declare function AlertView(context: LocalComponentContext): import("react").JSX.Element;
|
|
17
|
+
export declare function BadgeView(context: LocalComponentContext): import("react").JSX.Element;
|
|
18
|
+
export declare function TooltipView(context: LocalComponentContext): import("react").JSX.Element;
|
|
19
|
+
export declare function JumpView(context: LocalComponentContext): import("react").JSX.Element;
|
|
20
|
+
export declare function AnchorView(context: LocalComponentContext): import("react").JSX.Element | null;
|
|
21
|
+
export declare function TextView(context: LocalComponentContext): import("react").JSX.Element;
|
|
22
|
+
export declare function SectionView(context: LocalComponentContext): import("react").JSX.Element;
|
|
23
|
+
export declare function ValidationView(context: LocalComponentContext): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure layout math for the Mafs-backed function plot.
|
|
3
|
+
*
|
|
4
|
+
* Mafs normally keeps one pixel-per-unit scale for both axes. A function plot
|
|
5
|
+
* cannot do that when x and y live on wildly different magnitudes (for
|
|
6
|
+
* example x = 0..20 and y = 50000..300000): either the curve collapses into a
|
|
7
|
+
* line or one axis is padded by the other axis' span. Rendering with
|
|
8
|
+
* `preserveAspectRatio={false}` lets each axis use its own scale, and this
|
|
9
|
+
* module supplies one grid spacing per axis plus the visible ranges that make
|
|
10
|
+
* every on-screen grid cell square again.
|
|
11
|
+
*
|
|
12
|
+
* The trick is that both spacings come from the same ladder of "nice" numbers
|
|
13
|
+
* (1, 2, 2.5, 4, 5 x 10^k). Picking a pair whose cell sizes are already close
|
|
14
|
+
* and then expanding the axis with the larger cell by a fraction of a cell
|
|
15
|
+
* yields exactly square cells while the data stays tightly framed.
|
|
16
|
+
*/
|
|
17
|
+
export interface MafsGridRange {
|
|
18
|
+
min: number;
|
|
19
|
+
max: number;
|
|
20
|
+
}
|
|
21
|
+
export interface PlotGridLayoutInput {
|
|
22
|
+
xDomain: MafsGridRange;
|
|
23
|
+
yDomain: MafsGridRange;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
/** Fraction of each axis span added as breathing room around the data. */
|
|
27
|
+
padding?: number;
|
|
28
|
+
/** Preferred on-screen size of one grid cell, in CSS pixels. */
|
|
29
|
+
targetCellPx?: number;
|
|
30
|
+
/** Smallest sensible grid cell used when choosing a nice spacing. */
|
|
31
|
+
minCellPx?: number;
|
|
32
|
+
/** Largest sensible grid cell used when choosing a nice spacing. */
|
|
33
|
+
maxCellPx?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface PlotGridLayout {
|
|
36
|
+
/** Grid spacing in x-axis units. */
|
|
37
|
+
xLines: number;
|
|
38
|
+
/** Grid spacing in y-axis units. */
|
|
39
|
+
yLines: number;
|
|
40
|
+
/** Visible x range, including padding and any square-cell correction. */
|
|
41
|
+
xRange: MafsGridRange;
|
|
42
|
+
/** Visible y range, including padding and any square-cell correction. */
|
|
43
|
+
yRange: MafsGridRange;
|
|
44
|
+
/** Resulting on-screen cell size, identical on both axes. */
|
|
45
|
+
cellPx: number;
|
|
46
|
+
}
|
|
47
|
+
/** Return a finite, ordered range; degenerate inputs get a modest span. */
|
|
48
|
+
export declare function normalizeGridRange(range: MafsGridRange): MafsGridRange;
|
|
49
|
+
/** Largest "nice" number (1, 2, 2.5, 4 or 5 x 10^k) not above `value`. */
|
|
50
|
+
export declare function niceGridStep(value: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* Choose per-axis grid spacings and visible ranges so that:
|
|
53
|
+
* - each axis frames its own data (small relative padding, never cropped);
|
|
54
|
+
* - both axes use readable "nice" spacings;
|
|
55
|
+
* - one grid cell renders as a square regardless of the axis magnitudes.
|
|
56
|
+
*/
|
|
57
|
+
export declare function plotGridLayout(input: PlotGridLayoutInput): PlotGridLayout;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
2
|
+
export interface MafsRange {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PlotSurfacePoint {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PlotSurfaceSegment {
|
|
11
|
+
curve: number;
|
|
12
|
+
points: PlotSurfacePoint[];
|
|
13
|
+
}
|
|
14
|
+
export interface MafsCoordinatePlaneProps {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
xRange: MafsRange;
|
|
18
|
+
yRange: MafsRange;
|
|
19
|
+
step: number;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
accent: string;
|
|
22
|
+
onMove: (x: number, y: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function MafsCoordinatePlane({ x, y, xRange, yRange, step, disabled, accent, onMove, }: MafsCoordinatePlaneProps): import("react").JSX.Element;
|
|
25
|
+
export interface MafsPlotSurfaceProps {
|
|
26
|
+
label: string;
|
|
27
|
+
readoutId?: string;
|
|
28
|
+
xDomain: MafsRange;
|
|
29
|
+
yDomain: MafsRange;
|
|
30
|
+
segments: PlotSurfaceSegment[];
|
|
31
|
+
colors: readonly string[];
|
|
32
|
+
focused: number | null;
|
|
33
|
+
onFocusedChange: (curve: number | null) => void;
|
|
34
|
+
onActiveXChange: (x: number | null) => void;
|
|
35
|
+
curvePointAt: (curve: number, x: number) => PlotSurfacePoint | null;
|
|
36
|
+
onKeyDown?: (event: ReactKeyboardEvent<Element>) => void;
|
|
37
|
+
onFocus?: () => void;
|
|
38
|
+
onBlur?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function MafsPlotSurface({ label, readoutId, xDomain, yDomain, segments, colors, focused, onFocusedChange, onActiveXChange, curvePointAt, onKeyDown, onFocus, onBlur, }: MafsPlotSurfaceProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type CalendarDateMatcher = (date: Date) => boolean;
|
|
2
|
+
export interface CalendarProps {
|
|
3
|
+
value?: Date;
|
|
4
|
+
onChange?: (date: Date) => void;
|
|
5
|
+
month?: Date;
|
|
6
|
+
onMonthChange?: (month: Date) => void;
|
|
7
|
+
minDate?: Date;
|
|
8
|
+
maxDate?: Date;
|
|
9
|
+
disabledDates?: CalendarDateMatcher;
|
|
10
|
+
locale?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Adds a Today button that slides back to the current month and selects today when it is available. */
|
|
13
|
+
showToday?: boolean;
|
|
14
|
+
/** Localized names for the header controls and the Today button. */
|
|
15
|
+
todayLabel?: string;
|
|
16
|
+
previousMonthLabel?: string;
|
|
17
|
+
nextMonthLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const startOfDay: (date: Date) => Date;
|
|
20
|
+
declare const sameDay: (a?: Date, b?: Date) => boolean;
|
|
21
|
+
declare const addDays: (date: Date, amount: number) => Date;
|
|
22
|
+
declare const addMonths: (date: Date, amount: number) => Date;
|
|
23
|
+
/** The viewer's local date (lib/use-today.ts, shared with date-range-picker). Re-exported so existing imports from calendar keep working. */
|
|
24
|
+
export { useToday } from "../lib/use-today.js";
|
|
25
|
+
export declare function Calendar({ value, onChange, month: controlledMonth, onMonthChange, minDate, maxDate, disabledDates, locale, className, showToday, todayLabel, previousMonthLabel, nextMonthLabel, }: CalendarProps): import("react").JSX.Element;
|
|
26
|
+
export { addDays, addMonths, sameDay, startOfDay };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes } from "react";
|
|
2
|
+
import { type CalendarDateMatcher } from "../calendar/calendar.js";
|
|
3
|
+
export interface DatePickerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange"> {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: Date;
|
|
6
|
+
onChange?: (date: Date | undefined) => void;
|
|
7
|
+
description?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
minDate?: Date;
|
|
10
|
+
maxDate?: Date;
|
|
11
|
+
disabledDates?: CalendarDateMatcher;
|
|
12
|
+
locale?: string;
|
|
13
|
+
format?: Intl.DateTimeFormatOptions;
|
|
14
|
+
/** Adds a Today button to the calendar header. */
|
|
15
|
+
showToday?: boolean;
|
|
16
|
+
/** Marks the trigger invalid so the surrounding field can announce it. */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
/** Ids of hints or errors that describe the trigger. */
|
|
19
|
+
describedBy?: string;
|
|
20
|
+
/** Localized calendar and footer labels. */
|
|
21
|
+
todayLabel?: string;
|
|
22
|
+
previousMonthLabel?: string;
|
|
23
|
+
nextMonthLabel?: string;
|
|
24
|
+
clearLabel?: string;
|
|
25
|
+
calendarLabel?: string;
|
|
26
|
+
/** Builds the footer status from the formatted value, or from null when empty. */
|
|
27
|
+
statusLabel?: (formatted: string | null) => string;
|
|
28
|
+
}
|
|
29
|
+
export declare function DatePicker({ label, value, onChange, description, placeholder, minDate, maxDate, disabledDates, locale, format, showToday, invalid, describedBy, todayLabel, previousMonthLabel, nextMonthLabel, clearLabel, calendarLabel, statusLabel, id, className, disabled, ...buttonProps }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Motion presets are shared by the gallery and future registry consumers. */
|
|
2
|
+
export declare const motionTokens: {
|
|
3
|
+
readonly duration: {
|
|
4
|
+
readonly instant: 0.12;
|
|
5
|
+
readonly fast: 0.16;
|
|
6
|
+
readonly exit: 0.18;
|
|
7
|
+
readonly standard: 0.24;
|
|
8
|
+
readonly considered: 0.48;
|
|
9
|
+
};
|
|
10
|
+
readonly ease: {
|
|
11
|
+
readonly enter: readonly [0.16, 1, 0.3, 1];
|
|
12
|
+
readonly exit: readonly [0.7, 0, 0.84, 0];
|
|
13
|
+
readonly standard: readonly [0.22, 1, 0.36, 1];
|
|
14
|
+
/** For elements that move while already on screen. */
|
|
15
|
+
readonly inOut: readonly [0.65, 0, 0.35, 1];
|
|
16
|
+
};
|
|
17
|
+
readonly spring: {
|
|
18
|
+
readonly responsive: {
|
|
19
|
+
readonly type: "spring";
|
|
20
|
+
readonly stiffness: 520;
|
|
21
|
+
readonly damping: 44;
|
|
22
|
+
};
|
|
23
|
+
readonly gentle: {
|
|
24
|
+
readonly type: "spring";
|
|
25
|
+
readonly stiffness: 340;
|
|
26
|
+
readonly damping: 34;
|
|
27
|
+
};
|
|
28
|
+
/** Presses, toggles, thumbs, and small indicators. Settles fast and never overshoots, so nothing jitters. */
|
|
29
|
+
readonly snappy: {
|
|
30
|
+
readonly type: "spring";
|
|
31
|
+
readonly visualDuration: 0.26;
|
|
32
|
+
readonly bounce: 0;
|
|
33
|
+
};
|
|
34
|
+
/** Panels, height changes, and layout shifts. Critically damped, never overshoots. */
|
|
35
|
+
readonly smooth: {
|
|
36
|
+
readonly type: "spring";
|
|
37
|
+
readonly visualDuration: 0.4;
|
|
38
|
+
readonly bounce: 0;
|
|
39
|
+
};
|
|
40
|
+
/** Shape morphs, shared layout highlights, and width changes that follow new content. No bounce: sizes and positions settle without overshoot. */
|
|
41
|
+
readonly morph: {
|
|
42
|
+
readonly type: "spring";
|
|
43
|
+
readonly visualDuration: 0.42;
|
|
44
|
+
readonly bounce: 0;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/** Stagger steps in seconds. Keep total stagger under roughly 0.4s. */
|
|
48
|
+
readonly stagger: {
|
|
49
|
+
readonly char: 0.016;
|
|
50
|
+
readonly word: 0.04;
|
|
51
|
+
readonly line: 0.08;
|
|
52
|
+
readonly item: 0.035;
|
|
53
|
+
};
|
|
54
|
+
/** Blur radii in px for text and content crossfades. Keep blur small and brief. */
|
|
55
|
+
readonly blur: {
|
|
56
|
+
readonly subtle: 2;
|
|
57
|
+
readonly soft: 4;
|
|
58
|
+
readonly text: 8;
|
|
59
|
+
};
|
|
60
|
+
};
|