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
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
2
|
-
import type { Diagnostic, LocalCompileOptions, LocalDocument, SourceRange } from '../local/types.js';
|
|
3
|
-
import type { EditorLocale, EditorSelection } from './command-types.js';
|
|
4
|
-
export type { EditorLocale, EditorSelection, EditorEdit } from './command-types.js';
|
|
5
|
-
export type EditorTheme = 'light' | 'dark' | 'auto';
|
|
6
|
-
export type EditorViewMode = 'edit' | 'split' | 'preview';
|
|
7
|
-
export interface ReactiveMarkdownEditorProps {
|
|
8
|
-
value: string;
|
|
9
|
-
onChange(value: string): void;
|
|
10
|
-
locale?: EditorLocale;
|
|
11
|
-
theme?: EditorTheme;
|
|
12
|
-
/** Preview content rendered inside the editor frame. Enables view switching. */
|
|
13
|
-
preview?: ReactNode;
|
|
14
|
-
/** Controlled view mode; omit to let the editor manage its own mode. */
|
|
15
|
-
viewMode?: EditorViewMode;
|
|
16
|
-
defaultViewMode?: EditorViewMode;
|
|
17
|
-
onViewModeChange?(mode: EditorViewMode): void;
|
|
18
|
-
id?: string;
|
|
19
|
-
className?: string;
|
|
20
|
-
style?: CSSProperties;
|
|
21
|
-
height?: number | string;
|
|
22
|
-
minHeight?: number | string;
|
|
23
|
-
placeholder?: string;
|
|
24
|
-
ariaLabel?: string;
|
|
25
|
-
readOnly?: boolean;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Reset history, selection and scroll when switching source documents. */
|
|
28
|
-
documentKey?: string | number;
|
|
29
|
-
diagnostics?: readonly Diagnostic[];
|
|
30
|
-
/** Compile options used by the host preview; authoring analyses follow them. */
|
|
31
|
-
compileOptions?: LocalCompileOptions;
|
|
32
|
-
/** Optional compiled document for the binding inspector's value types. */
|
|
33
|
-
document?: LocalDocument | null;
|
|
34
|
-
toolbar?: boolean;
|
|
35
|
-
authoring?: boolean;
|
|
36
|
-
onExport?(): void;
|
|
37
|
-
textareaRef?: RefObject<HTMLTextAreaElement | null>;
|
|
38
|
-
}
|
|
39
|
-
export interface ReactiveMarkdownEditorHandle {
|
|
40
|
-
focus(selection?: EditorSelection): void;
|
|
41
|
-
selectRange(range: SourceRange): void;
|
|
42
|
-
getSelection(): EditorSelection;
|
|
43
|
-
getTextarea(): HTMLTextAreaElement | null;
|
|
44
|
-
/** Replace the current selection and record one undoable host edit. */
|
|
45
|
-
insertText(text: string): void;
|
|
46
|
-
undo(): void;
|
|
47
|
-
redo(): void;
|
|
48
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { EditorSelection } from './types.js';
|
|
2
|
-
export interface HistoryEntry {
|
|
3
|
-
value: string;
|
|
4
|
-
selection: EditorSelection;
|
|
5
|
-
}
|
|
6
|
-
export interface SourceHistoryStore {
|
|
7
|
-
readonly canUndo: boolean;
|
|
8
|
-
readonly canRedo: boolean;
|
|
9
|
-
record(value: string, selection: EditorSelection, mode?: 'merge' | 'separate'): void;
|
|
10
|
-
undo(): HistoryEntry | null;
|
|
11
|
-
redo(): HistoryEntry | null;
|
|
12
|
-
reset(value: string, selection?: EditorSelection): void;
|
|
13
|
-
}
|
|
14
|
-
export type SourceHistory = SourceHistoryStore;
|
|
15
|
-
export declare function createSourceHistory(initialValue: string, initialSelection?: EditorSelection, now?: () => number): SourceHistoryStore;
|
|
16
|
-
export declare function useSourceHistory(initialValue: string, initialSelection?: EditorSelection): SourceHistory;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { LocalCompileOptions, LocalCompileResult } from './types.js';
|
|
2
|
-
/** Compile to plain data that can cross a React Server Component boundary. */
|
|
3
|
-
export declare function compileLocal(source: string, options?: LocalCompileOptions): LocalCompileResult;
|
|
4
|
-
export declare function compileLocalDocument(source: string, options?: LocalCompileOptions): LocalCompileResult;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { LocalValue, SourceRange } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Computable LaTeX for local plots.
|
|
4
|
-
*
|
|
5
|
-
* The parser builds an explicit AST; evaluation never uses eval/Function and
|
|
6
|
-
* only reads the independent variable x plus numeric bindings from the
|
|
7
|
-
* document. Unsupported structures (integrals, matrices, macros, ...) are
|
|
8
|
-
* rejected at compile time with an offset into the LaTeX source.
|
|
9
|
-
*/
|
|
10
|
-
export declare class LatexError extends Error {
|
|
11
|
-
readonly code: string;
|
|
12
|
-
readonly offset: number;
|
|
13
|
-
constructor(code: string, message: string, offset?: number);
|
|
14
|
-
}
|
|
15
|
-
export interface LatexExpression {
|
|
16
|
-
readonly source: string;
|
|
17
|
-
dependencies: string[];
|
|
18
|
-
evaluate(x: number, env: Record<string, LocalValue>, budget?: LatexEvaluationBudget): number;
|
|
19
|
-
}
|
|
20
|
-
/** Shared step budget used by samplePlot so the whole curve has one bound. */
|
|
21
|
-
export interface LatexEvaluationBudget {
|
|
22
|
-
steps: number;
|
|
23
|
-
limit: number;
|
|
24
|
-
}
|
|
25
|
-
export interface PlotPoint {
|
|
26
|
-
x: number;
|
|
27
|
-
y: number | null;
|
|
28
|
-
}
|
|
29
|
-
export interface PlotSample {
|
|
30
|
-
points: PlotPoint[];
|
|
31
|
-
endpoint: number | null;
|
|
32
|
-
}
|
|
33
|
-
/** Internal authoring support: only AST variable nodes represent plot reads. */
|
|
34
|
-
export declare function localLatexReferences(source: string): {
|
|
35
|
-
name: string;
|
|
36
|
-
range: SourceRange;
|
|
37
|
-
}[];
|
|
38
|
-
export declare function compileLatex(source: string): LatexExpression;
|
|
39
|
-
/**
|
|
40
|
-
* Samples y(x) across [min, max]. Undefined points and the sample after a
|
|
41
|
-
* detected break become null so a renderer cannot join the two sides of an
|
|
42
|
-
* asymptote. The array always has exactly `samples` points.
|
|
43
|
-
*
|
|
44
|
-
* The optional final budget is shared by every curve/plot in a document. Each
|
|
45
|
-
* evaluation is limited by whatever remains of both that shared budget and the
|
|
46
|
-
* per-curve budget, and a `latex-budget` error aborts the whole sampling pass.
|
|
47
|
-
*/
|
|
48
|
-
export declare function samplePlot(expression: LatexExpression, env: Record<string, LocalValue>, min: number, max: number, samples?: number, sharedBudget?: LatexEvaluationBudget): PlotSample;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { LocalCompileOptions, LocalHostComponentSchema, LocalHtmlPolicy } from './types.js';
|
|
2
|
-
/** Capability flags that select the temporary whole-document HTML branch. */
|
|
3
|
-
export declare const LOCAL_HTML_FLAGS: readonly ['enableCss', 'enableJavaScript', 'enableExtendedHtml'];
|
|
4
|
-
export type LocalHtmlFlag = (typeof LOCAL_HTML_FLAGS)[number];
|
|
5
|
-
export type LocalOptionCheck = {
|
|
6
|
-
ok: true;
|
|
7
|
-
/** Validated syntax-node budget for this compilation. */
|
|
8
|
-
maxSyntaxNodes: number;
|
|
9
|
-
/** Effective HTML policy; every flag is false by default. */
|
|
10
|
-
html: LocalHtmlPolicy;
|
|
11
|
-
/** True when at least one capability flag is enabled. */
|
|
12
|
-
htmlActive: boolean;
|
|
13
|
-
/** Render ordinary Markdown soft line breaks as `break` nodes. */
|
|
14
|
-
markdownBreaks: boolean;
|
|
15
|
-
/** Validated host component schemas; empty when the option is absent. */
|
|
16
|
-
hostComponents: readonly LocalHostComponentSchema[];
|
|
17
|
-
/** Host tag name lookup; names are already lowercase kebab-case. */
|
|
18
|
-
hostByName: ReadonlyMap<string, LocalHostComponentSchema>;
|
|
19
|
-
} | {
|
|
20
|
-
ok: false;
|
|
21
|
-
message: string;
|
|
22
|
-
key: string;
|
|
23
|
-
detail?: string;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Read and validate host compile options once. Every call site (Markdown
|
|
27
|
-
* parser, HTML compiler, worker and React component) uses the same rules so a
|
|
28
|
-
* malformed flag can never silently fall back to the Markdown pipeline.
|
|
29
|
-
*/
|
|
30
|
-
export declare function readLocalCompileOptions(options: LocalCompileOptions | undefined): LocalOptionCheck;
|
|
31
|
-
/**
|
|
32
|
-
* Stable signature of the option values that affect compilation. Used to
|
|
33
|
-
* recompile on flag/limit changes and to keep worker races keyed by more than
|
|
34
|
-
* the source text. Unknown keys are deliberately ignored.
|
|
35
|
-
*/
|
|
36
|
-
export declare function localCompileOptionsKey(options?: LocalCompileOptions): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Diagnostic } from './types.js';
|
|
2
|
-
import type { LocalCompileOptions, LocalNode, LocalVersionDeclaration, SourceRange } from './types.js';
|
|
3
|
-
export interface ParsedLocal {
|
|
4
|
-
nodes: LocalNode[];
|
|
5
|
-
diagnostics: Diagnostic[];
|
|
6
|
-
versionDeclaration?: LocalVersionDeclaration;
|
|
7
|
-
/** Declared theme name, when the leading declaration is valid. */
|
|
8
|
-
theme?: string;
|
|
9
|
-
/** Source range of the first leading theme declaration, valid or not. */
|
|
10
|
-
themeRange?: SourceRange;
|
|
11
|
-
}
|
|
12
|
-
/** A lexical pass shields code before recognizing local tags, interpolation and math. */
|
|
13
|
-
export declare function parseLocal(source: string, options?: LocalCompileOptions): ParsedLocal;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { LocalNode, LocalRuntime } from './types.js';
|
|
3
|
-
/** Rendering contract shared by the React views. Kept out of types.ts so the
|
|
4
|
-
* core compiler and runtime types never depend on React. */
|
|
5
|
-
export type LocalRenderMode = 'interactive' | 'static';
|
|
6
|
-
export interface LocalRenderContext {
|
|
7
|
-
runtime: LocalRuntime;
|
|
8
|
-
render(nodes?: LocalNode[], visible?: boolean): ReactNode;
|
|
9
|
-
visible: boolean;
|
|
10
|
-
mode: LocalRenderMode;
|
|
11
|
-
}
|
|
12
|
-
export interface LocalVisualProps extends Omit<LocalRenderContext, 'mode'> {
|
|
13
|
-
node: LocalNode;
|
|
14
|
-
/** Defaults to interactive so hand-built visual fixtures stay compatible. */
|
|
15
|
-
mode?: LocalRenderMode;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* JSON-safe host data indexed by `${kind}:${ref}` for `hostComponent` nodes.
|
|
19
|
-
* It is read only by the client renderer and never enters the worker.
|
|
20
|
-
*/
|
|
21
|
-
export type LocalHostData = Readonly<Record<string, unknown>>;
|
|
22
|
-
/**
|
|
23
|
-
* Client-only renderer for `hostComponent` nodes. Receiving `unknown` keeps the
|
|
24
|
-
* contract loose; a synchronous throw falls back to the inert placeholder, so
|
|
25
|
-
* a bad renderer never blanks the whole document.
|
|
26
|
-
*/
|
|
27
|
-
export type LocalHostRenderer = (node: LocalNode, data: unknown, ctx: LocalRenderContext) => ReactNode;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { LocalValue, LocalValueKind } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Static description of the `local-draft-1` component set. The compiler reads
|
|
4
|
-
* attribute types and defaults from here; the renderer may use the same table
|
|
5
|
-
* to know which props are dynamic and which controls own public state.
|
|
6
|
-
*/
|
|
7
|
-
export type LocalComponentForm = 'leaf' | 'inline' | 'container';
|
|
8
|
-
export type LocalChildRule = 'none' | 'any' | 'inline' | 'options' | 'tabs' | 'disclosures' | 'cards' | 'diagram' | 'table' | 'plot' | 'content' | 'steps' | 'quiz' | 'columns';
|
|
9
|
-
export type LocalPropKind = 'string' | 'number' | 'boolean' | 'enum';
|
|
10
|
-
export interface LocalPropSchema {
|
|
11
|
-
kind: LocalPropKind;
|
|
12
|
-
required?: boolean;
|
|
13
|
-
/** Reject `{{ ... }}` in this property. Used for names, ids and enums. */
|
|
14
|
-
static?: boolean;
|
|
15
|
-
/** Accept exactly one typed interpolation in place of a literal. */
|
|
16
|
-
dynamic?: boolean;
|
|
17
|
-
values?: readonly string[];
|
|
18
|
-
default?: LocalValue;
|
|
19
|
-
integer?: boolean;
|
|
20
|
-
positive?: boolean;
|
|
21
|
-
min?: number;
|
|
22
|
-
max?: number;
|
|
23
|
-
/** Reject anything but a bounded named CSS color or #RGB/#RRGGBB. */
|
|
24
|
-
color?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export type LocalBindingFamily = 'text' | 'number' | 'boolean' | 'choice' | 'date' | 'timer' | 'checklist' | 'tabs' | 'diagram' | 'multi-select' | 'selection' | 'steps';
|
|
27
|
-
export interface LocalBindingSchema {
|
|
28
|
-
kind: LocalValueKind;
|
|
29
|
-
required: boolean;
|
|
30
|
-
family: LocalBindingFamily;
|
|
31
|
-
/** Only one component may own this binding, and its state cannot be shared. */
|
|
32
|
-
exclusive?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* One independently bound value of a multi-slot component. Each slot has its
|
|
36
|
-
* own public binding name (or an internal `@node:slot` key) and is exclusive in
|
|
37
|
-
* the first revision of the slot API.
|
|
38
|
-
*/
|
|
39
|
-
export interface LocalBindingSlotSchema {
|
|
40
|
-
name: string;
|
|
41
|
-
/** Attribute that names the public binding, e.g. `bind-start`. */
|
|
42
|
-
bind: string;
|
|
43
|
-
/** Attribute that provides an explicit initial value, e.g. `initial-start`. */
|
|
44
|
-
initial: string;
|
|
45
|
-
kind: LocalValueKind;
|
|
46
|
-
family: LocalBindingFamily;
|
|
47
|
-
exclusive: boolean;
|
|
48
|
-
initialRule: 'min' | 'max-step' | 'nearest-zero';
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* `default` is the schema default for an ordinary property. `initialRule`
|
|
52
|
-
* describes how a component produces the value of a binding when the author
|
|
53
|
-
* omits `initial`.
|
|
54
|
-
*/
|
|
55
|
-
export type LocalInitialRule = 'empty' | 'false' | 'min' | 'nearest-zero' | 'first-option' | 'first-tab' | 'first-step' | 'first-node' | 'checked' | 'duration' | 'empty-array' | 'none';
|
|
56
|
-
export interface LocalComponentSchema {
|
|
57
|
-
name: string;
|
|
58
|
-
form: LocalComponentForm;
|
|
59
|
-
childRule: LocalChildRule;
|
|
60
|
-
label: 'none' | 'required' | 'optional';
|
|
61
|
-
/** Parent component names that may directly contain this structural child. */
|
|
62
|
-
parent?: readonly string[];
|
|
63
|
-
props: Record<string, LocalPropSchema>;
|
|
64
|
-
binding?: LocalBindingSchema;
|
|
65
|
-
/** Independent bindings owned by a leaf component (range-slider, coordinate). */
|
|
66
|
-
slots?: readonly LocalBindingSlotSchema[];
|
|
67
|
-
initialRule?: LocalInitialRule;
|
|
68
|
-
}
|
|
69
|
-
export declare const LOCAL_COMPONENTS: Readonly<Record<string, LocalComponentSchema>>;
|
|
70
|
-
export declare const LOCAL_COMPONENT_NAMES: readonly string[];
|
|
71
|
-
/** Component names with the given tag shape, in declaration order. */
|
|
72
|
-
export declare function localComponentNames(form: LocalComponentForm): readonly string[];
|
|
73
|
-
export declare function getLocalComponent(name: string): LocalComponentSchema | undefined;
|
|
74
|
-
export declare function getPropDefault(component: LocalComponentSchema, prop: string): LocalValue | undefined;
|
|
75
|
-
export declare function closestName(name: string, candidates: readonly string[]): string | undefined;
|
|
76
|
-
export declare function suggestComponent(name: string): string | undefined;
|
|
77
|
-
export declare function suggestAttribute(component: LocalComponentSchema, name: string): string | undefined;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
export interface SourceRange {
|
|
2
|
-
start: number;
|
|
3
|
-
end: number;
|
|
4
|
-
}
|
|
5
|
-
/** A source-level syntax declaration; offsets use original UTF-16 units. */
|
|
6
|
-
export interface LocalVersionDeclaration {
|
|
7
|
-
version: string;
|
|
8
|
-
range: SourceRange;
|
|
9
|
-
}
|
|
10
|
-
/** A scalar, JSON/structured-clone-safe diagnostic template parameter. */
|
|
11
|
-
export type LocalDiagnosticParam = string | number | boolean | null;
|
|
12
|
-
export type LocalDiagnosticParams = Readonly<Record<string, LocalDiagnosticParam>>;
|
|
13
|
-
export interface Diagnostic {
|
|
14
|
-
code: string;
|
|
15
|
-
message: string;
|
|
16
|
-
severity: 'error' | 'warning';
|
|
17
|
-
range: SourceRange;
|
|
18
|
-
line: number;
|
|
19
|
-
column: number;
|
|
20
|
-
/**
|
|
21
|
-
* Stable template key for a built-in message. Omitted for host-owned
|
|
22
|
-
* diagnostics, whose `message` is preserved verbatim by display code.
|
|
23
|
-
*/
|
|
24
|
-
messageKey?: string;
|
|
25
|
-
/** Bounded scalar parameters for `messageKey`. */
|
|
26
|
-
params?: LocalDiagnosticParams;
|
|
27
|
-
}
|
|
28
|
-
export type LocalValue = string | number | boolean | null | string[] | number[];
|
|
29
|
-
/** `array` retains its existing meaning: a homogeneous string array. */
|
|
30
|
-
export type LocalValueKind = 'string' | 'number' | 'boolean' | 'null' | 'array' | 'number-array';
|
|
31
|
-
/** Markdown nodes retain their original source ranges; component attributes remain raw decoded strings. */
|
|
32
|
-
export interface LocalNode {
|
|
33
|
-
type: string;
|
|
34
|
-
id: string;
|
|
35
|
-
range: SourceRange;
|
|
36
|
-
children?: LocalNode[];
|
|
37
|
-
name?: string;
|
|
38
|
-
attrs?: Record<string, string>;
|
|
39
|
-
value?: string;
|
|
40
|
-
depth?: number;
|
|
41
|
-
ordered?: boolean;
|
|
42
|
-
start?: number;
|
|
43
|
-
checked?: boolean | null;
|
|
44
|
-
url?: string;
|
|
45
|
-
title?: string | null;
|
|
46
|
-
alt?: string;
|
|
47
|
-
/** Rendered width of an HTML `<img>`, in CSS pixels. */
|
|
48
|
-
width?: number;
|
|
49
|
-
/** Rendered height of an HTML `<img>`, in CSS pixels. */
|
|
50
|
-
height?: number;
|
|
51
|
-
lang?: string;
|
|
52
|
-
align?: ('left' | 'center' | 'right' | null)[];
|
|
53
|
-
/**
|
|
54
|
-
* Normalized footnote identifier shared by `footnoteReference` and
|
|
55
|
-
* `footnoteDefinition` nodes (whitespace collapsed, lowercased).
|
|
56
|
-
*/
|
|
57
|
-
identifier?: string;
|
|
58
|
-
/** Original footnote label as written, preserved for display. */
|
|
59
|
-
label?: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* One read-only document value declared by a top-level `<computed>` or
|
|
63
|
-
* `<const>` tag. The record is plain, serializable metadata: the declaring
|
|
64
|
-
* node is not part of the rendered tree and owns no writable binding.
|
|
65
|
-
*/
|
|
66
|
-
export interface LocalComputation {
|
|
67
|
-
name: string;
|
|
68
|
-
kind: 'computed' | 'const';
|
|
69
|
-
/** Expression source between `{{` and `}}`, trimmed. */
|
|
70
|
-
source: string;
|
|
71
|
-
/** Names read by the expression, in first-use order. */
|
|
72
|
-
dependencies: string[];
|
|
73
|
-
type: LocalValueKind;
|
|
74
|
-
/** Canonical id of the declaration node, retained for host diagnostics. */
|
|
75
|
-
nodeId: string;
|
|
76
|
-
/** Source range of the declaration tag. */
|
|
77
|
-
range: SourceRange;
|
|
78
|
-
/**
|
|
79
|
-
* Statically evaluated value. Present only for `const`, whose expression
|
|
80
|
-
* cannot depend on controls or computed values.
|
|
81
|
-
*/
|
|
82
|
-
value?: LocalValue;
|
|
83
|
-
}
|
|
84
|
-
export interface LocalBinding {
|
|
85
|
-
name: string;
|
|
86
|
-
nodeIds: string[];
|
|
87
|
-
type: LocalValueKind;
|
|
88
|
-
initial: LocalValue;
|
|
89
|
-
min?: number;
|
|
90
|
-
max?: number;
|
|
91
|
-
step?: number;
|
|
92
|
-
options?: string[];
|
|
93
|
-
/** Upper bound for array selections such as `multi-select`. */
|
|
94
|
-
maxItems?: number;
|
|
95
|
-
owner?: string;
|
|
96
|
-
}
|
|
97
|
-
/** Advisory cross-field rule; an invalid rule keeps its fields editable. */
|
|
98
|
-
export interface LocalValidation {
|
|
99
|
-
nodeId: string;
|
|
100
|
-
expression: string;
|
|
101
|
-
dependencies: string[];
|
|
102
|
-
message: string;
|
|
103
|
-
fields: string[];
|
|
104
|
-
range: SourceRange;
|
|
105
|
-
}
|
|
106
|
-
/** Compiler-produced documents contain only plain records, arrays and primitives. */
|
|
107
|
-
export interface LocalDocument {
|
|
108
|
-
syntax: 'local';
|
|
109
|
-
source: string;
|
|
110
|
-
/** Effective syntax revision; absent on older hand-built runtime documents. */
|
|
111
|
-
syntaxVersion?: 'local-draft-2';
|
|
112
|
-
/**
|
|
113
|
-
* Present only when at least one HTML capability flag was enabled. Its
|
|
114
|
-
* presence routes rendering to the isolated native-HTML branch; the
|
|
115
|
-
* original source is preserved and `nodes` carries one `htmlDocument` node
|
|
116
|
-
* whose `value` is the sanitized, complete iframe document.
|
|
117
|
-
*/
|
|
118
|
-
html?: LocalHtmlPolicy;
|
|
119
|
-
versionDeclaration?: LocalVersionDeclaration;
|
|
120
|
-
nodes: LocalNode[];
|
|
121
|
-
initialState: Record<string, LocalValue>;
|
|
122
|
-
bindings: Record<string, LocalBinding>;
|
|
123
|
-
/**
|
|
124
|
-
* Selected theme name. Themes are document metadata, not components: the
|
|
125
|
-
* compiler always supplies the built-in `default` when no declaration is
|
|
126
|
-
* present, and the renderer resolves the name against host-supplied CSS.
|
|
127
|
-
*/
|
|
128
|
-
theme?: string;
|
|
129
|
-
/** Original source range of the leading `<theme ...>` declaration. */
|
|
130
|
-
themeRange?: SourceRange;
|
|
131
|
-
/**
|
|
132
|
-
* Canonical node id -> slot -> binding key for multi-slot components such as
|
|
133
|
-
* `range-slider` (`start`/`end`) and `coordinate` (`x`/`y`). Renderers use
|
|
134
|
-
* runtime `get`/`set`/`setMany` with slot names instead of reading this map.
|
|
135
|
-
*/
|
|
136
|
-
bindingSlots?: Record<string, Record<string, string>>;
|
|
137
|
-
/**
|
|
138
|
-
* Read-only values declared with top-level `<computed>` / `<const>` tags,
|
|
139
|
-
* keyed by name. These are document metadata, not components: declaration
|
|
140
|
-
* nodes are removed from `nodes` before publication and never own bindings.
|
|
141
|
-
*/
|
|
142
|
-
computations?: Record<string, LocalComputation>;
|
|
143
|
-
/** Cross-field constraints in source order; evaluated against each revision. */
|
|
144
|
-
validations?: LocalValidation[];
|
|
145
|
-
/**
|
|
146
|
-
* Node id -> subtree binding dependencies, produced by the compiler. `null`
|
|
147
|
-
* marks subtrees whose reads cannot be decided statically. Internal shape:
|
|
148
|
-
* consumers should read it through the package runtime rather than depend on
|
|
149
|
-
* the serialized form.
|
|
150
|
-
*/
|
|
151
|
-
dependencies?: Readonly<Record<string, readonly string[] | null>>;
|
|
152
|
-
/**
|
|
153
|
-
* Node id -> table structure for `<table>`, `<chart>` and `<timeline>`
|
|
154
|
-
* contents, produced by the compiler. Header cells are plain text and data
|
|
155
|
-
* rows list the ids of their cell nodes. Frozen and serializable: it holds no
|
|
156
|
-
* node references. Internal shape; readers should tolerate its absence.
|
|
157
|
-
*/
|
|
158
|
-
tableShapes?: Readonly<Record<string, {
|
|
159
|
-
readonly header: readonly string[];
|
|
160
|
-
readonly rowIds: readonly (readonly string[])[];
|
|
161
|
-
}>>;
|
|
162
|
-
}
|
|
163
|
-
/** Host-owned budgets for a single compilation. */
|
|
164
|
-
export interface LocalCompileLimits {
|
|
165
|
-
/** Positive safe integer; defaults to 10,000 cumulative LocalNode creations. */
|
|
166
|
-
readonly maxSyntaxNodes?: number;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Host-owned capability flags for the temporary whole-document HTML mode.
|
|
170
|
-
*
|
|
171
|
-
* All flags default to `false`. When every flag is false the existing
|
|
172
|
-
* Markdown/ReactiveMD pipeline runs unchanged. When any flag is true the whole
|
|
173
|
-
* source is interpreted as native HTML and rendered inside a sandboxed iframe;
|
|
174
|
-
* Markdown, interpolation, bindings, formulas and ReactiveMD components are not
|
|
175
|
-
* interpreted in that mode.
|
|
176
|
-
*/
|
|
177
|
-
export interface LocalHtmlOptions {
|
|
178
|
-
/** Allow authored CSS; external resources remain subject to the native CSP. */
|
|
179
|
-
readonly enableCss?: boolean;
|
|
180
|
-
/** Allow authored scripts and inline event handlers. */
|
|
181
|
-
readonly enableJavaScript?: boolean;
|
|
182
|
-
/** Allow HTML beyond the safe P0 subset (tables, forms, SVG/MathML, ...). */
|
|
183
|
-
readonly enableExtendedHtml?: boolean;
|
|
184
|
-
}
|
|
185
|
-
/** Effective, non-optional policy recorded on a compiled HTML-branch document. */
|
|
186
|
-
export interface LocalHtmlPolicy {
|
|
187
|
-
readonly enableCss: boolean;
|
|
188
|
-
readonly enableJavaScript: boolean;
|
|
189
|
-
readonly enableExtendedHtml: boolean;
|
|
190
|
-
}
|
|
191
|
-
export type LocalHostPropKind = 'string' | 'number' | 'boolean' | 'enum';
|
|
192
|
-
export interface LocalHostPropSchema {
|
|
193
|
-
readonly kind: LocalHostPropKind;
|
|
194
|
-
readonly required?: boolean;
|
|
195
|
-
/** Reject `{{ ... }}` in this property. */
|
|
196
|
-
readonly static?: boolean;
|
|
197
|
-
/** Allowed literals for kind 'enum'; required and non-empty for enums. */
|
|
198
|
-
readonly enum?: readonly string[];
|
|
199
|
-
/** RegExp source applied to literal string values; restricted to a linear-time-safe subset. */
|
|
200
|
-
readonly pattern?: string;
|
|
201
|
-
}
|
|
202
|
-
export interface LocalHostComponentSchema {
|
|
203
|
-
readonly name: string;
|
|
204
|
-
readonly form: 'leaf';
|
|
205
|
-
readonly props: Readonly<Record<string, LocalHostPropSchema>>;
|
|
206
|
-
}
|
|
207
|
-
export interface LocalCompileOptions extends LocalHtmlOptions {
|
|
208
|
-
readonly limits?: LocalCompileLimits;
|
|
209
|
-
/**
|
|
210
|
-
* Render ordinary Markdown soft line breaks as `<br>`.
|
|
211
|
-
*
|
|
212
|
-
* Defaults to `false`, which keeps the historical behavior where a soft
|
|
213
|
-
* break is ordinary collapsible whitespace. When `true`, each source soft
|
|
214
|
-
* break becomes a `break` node; explicit hard breaks, code, formulas and
|
|
215
|
-
* native HTML are left untouched. The source text is never rewritten, so
|
|
216
|
-
* every node keeps its original offsets.
|
|
217
|
-
*/
|
|
218
|
-
readonly markdownBreaks?: boolean;
|
|
219
|
-
/** Host-defined leaf components recognized alongside the built-in schema. */
|
|
220
|
-
readonly hostComponents?: readonly LocalHostComponentSchema[];
|
|
221
|
-
}
|
|
222
|
-
/** Public compiler output is plain data, including nested attributes and dependencies. */
|
|
223
|
-
export type LocalCompileResult = {
|
|
224
|
-
ok: true;
|
|
225
|
-
document: LocalDocument;
|
|
226
|
-
diagnostics: Diagnostic[];
|
|
227
|
-
} | {
|
|
228
|
-
ok: false;
|
|
229
|
-
diagnostics: Diagnostic[];
|
|
230
|
-
};
|
|
231
|
-
export interface LocalSnapshot {
|
|
232
|
-
revision: number;
|
|
233
|
-
state: Readonly<Record<string, LocalValue>>;
|
|
234
|
-
}
|
|
235
|
-
export interface LocalRuntime {
|
|
236
|
-
document: LocalDocument;
|
|
237
|
-
snapshot(): LocalSnapshot;
|
|
238
|
-
/** Read a control value; `slot` is required for multi-slot components. */
|
|
239
|
-
get(node: LocalNode, slot?: string): LocalValue;
|
|
240
|
-
/** Write one control value; `slot` selects `start`/`end` or `x`/`y`. */
|
|
241
|
-
set(node: LocalNode, value: LocalValue, slot?: string): Diagnostic[];
|
|
242
|
-
/** Atomically write multiple slots of one multi-slot component. */
|
|
243
|
-
setMany(node: LocalNode, values: Readonly<Record<string, LocalValue>>): Diagnostic[];
|
|
244
|
-
/** Sorted public binding names; internal @... bindings are excluded. */
|
|
245
|
-
parameterNames(): readonly string[];
|
|
246
|
-
/** Read a public parameter by binding name. Returns undefined for unknown/internal names. */
|
|
247
|
-
getParameter(name: string): LocalValue | undefined;
|
|
248
|
-
/** Snapshot of all public parameters; internal @... bindings are excluded. */
|
|
249
|
-
getParameters(): Readonly<Record<string, LocalValue>>;
|
|
250
|
-
/** Validate and atomically write one public parameter. */
|
|
251
|
-
setParameter(name: string, value: LocalValue): Diagnostic[];
|
|
252
|
-
/** Validate and atomically write one or more public parameters. */
|
|
253
|
-
setParameters(values: Readonly<Record<string, LocalValue>>): Diagnostic[];
|
|
254
|
-
evaluate(expression: string): LocalValue;
|
|
255
|
-
/** Current advisory constraint failures; never changes or rejects field state. */
|
|
256
|
-
validate(): Diagnostic[];
|
|
257
|
-
text(template: string): string;
|
|
258
|
-
reset(node: LocalNode): void;
|
|
259
|
-
resetToken(node: LocalNode): number;
|
|
260
|
-
subscribe(listener: () => void): () => void;
|
|
261
|
-
dispose(): void;
|
|
262
|
-
}
|
|
263
|
-
export declare const localKey: (node: LocalNode) => string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { LocalNode, LocalRuntime } from './types.js';
|
|
3
|
-
import type { LocalVisualProps } from './render-types.js';
|
|
4
|
-
import { type Localize } from './i18n.js';
|
|
5
|
-
/** Shared scalar classification for plain native cells and Markdown cells. */
|
|
6
|
-
export declare function tableNumericColumns(rows: readonly LocalNode[][], runtime: LocalRuntime, t: Localize): boolean[];
|
|
7
|
-
export declare function VisualFrame({ className, label, children, }: {
|
|
8
|
-
className: string;
|
|
9
|
-
label: ReactNode;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}): import("react").JSX.Element;
|
|
12
|
-
export declare function LocalVisual(props: LocalVisualProps): ReactNode;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { Diagnostic, LocalCompileOptions, LocalCompileResult } from './types.js';
|
|
2
|
-
/** Editors are coalesced for this long before a compile is dispatched. */
|
|
3
|
-
export declare const LOCAL_COMPILE_DELAY_MS = 150;
|
|
4
|
-
export interface LocalCompileRequest {
|
|
5
|
-
id: number;
|
|
6
|
-
source: string;
|
|
7
|
-
/**
|
|
8
|
-
* Capability flags, Markdown break handling, limits and host component
|
|
9
|
-
* schemas for this compile. `hostComponents` selects the host leaf tags the
|
|
10
|
-
* parser may build; `markdownBreaks` turns soft breaks into `break` nodes.
|
|
11
|
-
*/
|
|
12
|
-
options?: LocalCompileOptions;
|
|
13
|
-
}
|
|
14
|
-
export type LocalCompileResponse = {
|
|
15
|
-
id: number;
|
|
16
|
-
ok: true;
|
|
17
|
-
result: LocalCompileResult;
|
|
18
|
-
duration: number;
|
|
19
|
-
} | {
|
|
20
|
-
id: number;
|
|
21
|
-
ok: false;
|
|
22
|
-
message: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* The small surface the scheduler needs from a Worker. Events stay untyped so
|
|
26
|
-
* the core declarations compile without the DOM library.
|
|
27
|
-
*/
|
|
28
|
-
export interface LocalCompileWorker {
|
|
29
|
-
postMessage(message: LocalCompileRequest): void;
|
|
30
|
-
terminate(): void;
|
|
31
|
-
onmessage: ((event: any) => void) | null;
|
|
32
|
-
onerror: ((event: any) => void) | null;
|
|
33
|
-
onmessageerror: ((event: any) => void) | null;
|
|
34
|
-
}
|
|
35
|
-
export type LocalCompileMode = 'worker' | 'fallback';
|
|
36
|
-
export interface LocalCompileOutcome {
|
|
37
|
-
source: string;
|
|
38
|
-
result: LocalCompileResult;
|
|
39
|
-
duration: number;
|
|
40
|
-
mode: LocalCompileMode;
|
|
41
|
-
/** Snapshot of the options this result was compiled with, when supplied. */
|
|
42
|
-
options?: LocalCompileOptions;
|
|
43
|
-
}
|
|
44
|
-
export interface LocalCompileSchedulerOptions {
|
|
45
|
-
createWorker(): LocalCompileWorker;
|
|
46
|
-
/**
|
|
47
|
-
* Defaults to compileLocal. Runs on the main thread only when the worker is
|
|
48
|
-
* unavailable or failed. One-argument callbacks remain supported.
|
|
49
|
-
*/
|
|
50
|
-
fallbackCompile?(source: string, options?: LocalCompileOptions): LocalCompileResult;
|
|
51
|
-
onResult(outcome: LocalCompileOutcome): void;
|
|
52
|
-
onPendingChange?(pending: boolean): void;
|
|
53
|
-
onModeChange?(mode: LocalCompileMode, detail?: string): void;
|
|
54
|
-
delay?: number;
|
|
55
|
-
}
|
|
56
|
-
export declare function compileFailureDiagnostic(error: unknown): Diagnostic;
|
|
57
|
-
/**
|
|
58
|
-
* Debounces edits, keeps at most one compile in flight plus the latest source
|
|
59
|
-
* waiting, and drops results that a newer edit has already superseded.
|
|
60
|
-
*/
|
|
61
|
-
export declare class LocalCompileScheduler {
|
|
62
|
-
private readonly options;
|
|
63
|
-
private readonly delay;
|
|
64
|
-
private worker;
|
|
65
|
-
private timer;
|
|
66
|
-
private queued;
|
|
67
|
-
private inFlight;
|
|
68
|
-
private nextId;
|
|
69
|
-
private pending;
|
|
70
|
-
private disposed;
|
|
71
|
-
constructor(options: LocalCompileSchedulerOptions);
|
|
72
|
-
/**
|
|
73
|
-
* Queue the newest source and its compile options; the previous timer, if
|
|
74
|
-
* any, is replaced. Options are copied so a later mutation cannot change the
|
|
75
|
-
* permissions of an in-flight compile. An options-only edit still supersedes
|
|
76
|
-
* an older result for the same source.
|
|
77
|
-
*/
|
|
78
|
-
schedule(source: string, options?: LocalCompileOptions): void;
|
|
79
|
-
/** Stop the timer and terminate the worker. No callbacks fire afterwards. */
|
|
80
|
-
dispose(): void;
|
|
81
|
-
private drain;
|
|
82
|
-
private compile;
|
|
83
|
-
private compileFallback;
|
|
84
|
-
private receive;
|
|
85
|
-
private handleWorkerFailure;
|
|
86
|
-
/** Permanently switch to the fallback; a crashed worker is never restarted. */
|
|
87
|
-
private degrade;
|
|
88
|
-
private finishRun;
|
|
89
|
-
private deliver;
|
|
90
|
-
private setPending;
|
|
91
|
-
private clearTimer;
|
|
92
|
-
}
|
|
93
|
-
export interface LocalCompileWorkerScope {
|
|
94
|
-
onmessage: ((event: any) => void) | null;
|
|
95
|
-
postMessage(message: LocalCompileResponse): void;
|
|
96
|
-
}
|
|
97
|
-
/** Install the worker-side compile handler on a DedicatedWorkerGlobalScope-like object. */
|
|
98
|
-
export declare function startLocalCompileWorker(scope?: LocalCompileWorkerScope): void;
|