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,50 @@
|
|
|
1
|
+
import type { LocalComponentAuthoring, LocalComponentText } from '../sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Authoring metadata for the default preset.
|
|
4
|
+
*
|
|
5
|
+
* This is the single home for default component titles, descriptions,
|
|
6
|
+
* categories, keywords and insertion templates. The default manifests in
|
|
7
|
+
* `default-components.ts` carry the canonical English forms, while the editor
|
|
8
|
+
* catalog reads this module directly so localized templates and search
|
|
9
|
+
* keywords do not need a second hand-maintained catalog.
|
|
10
|
+
*
|
|
11
|
+
* Everything here is bounded JSON data: no functions, React or DOM access.
|
|
12
|
+
*/
|
|
13
|
+
export type DefaultAuthoringGroupId = 'input' | 'action' | 'layout' | 'data' | 'hint';
|
|
14
|
+
export type DefaultAuthoringLocale = 'en' | 'zh';
|
|
15
|
+
export interface DefaultAuthoringGroup {
|
|
16
|
+
readonly id: DefaultAuthoringGroupId;
|
|
17
|
+
readonly title: LocalComponentText;
|
|
18
|
+
}
|
|
19
|
+
/** One default component's localized authoring data. */
|
|
20
|
+
export interface DefaultComponentAuthoring {
|
|
21
|
+
readonly title: LocalComponentText;
|
|
22
|
+
readonly description: LocalComponentText;
|
|
23
|
+
readonly category: DefaultAuthoringGroupId;
|
|
24
|
+
/** Locale-keyed insertion templates; `<default>` is not used. */
|
|
25
|
+
readonly insertText: LocalComponentText;
|
|
26
|
+
readonly keywords: Readonly<Record<DefaultAuthoringLocale, readonly string[]>>;
|
|
27
|
+
/** Inline components are inserted without block padding. */
|
|
28
|
+
readonly inline?: boolean;
|
|
29
|
+
/** Part of the legacy extended catalog retained for compatibility. */
|
|
30
|
+
readonly extended?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const DEFAULT_AUTHORING_GROUPS: readonly DefaultAuthoringGroup[];
|
|
33
|
+
export declare const DEFAULT_COMPONENT_AUTHORING: Readonly<Record<string, DefaultComponentAuthoring>>;
|
|
34
|
+
/** Catalog order derived from the data record's insertion order. */
|
|
35
|
+
export declare const DEFAULT_AUTHORING_ORDER: readonly string[];
|
|
36
|
+
export declare function defaultComponentAuthoring(name: string): DefaultComponentAuthoring | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Explicit fallback order for authoring copy: requested locale, then English,
|
|
39
|
+
* then Chinese, then the first declared value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function pickDefaultAuthoringText(value: LocalComponentText | undefined, locale: string, fallback?: string): string;
|
|
42
|
+
export declare function defaultAuthoringGroupLabel(category: string, locale: string): string;
|
|
43
|
+
/** Search terms from both languages, deduplicated case-insensitively. */
|
|
44
|
+
export declare function defaultAuthoringKeywords(name: string): readonly string[] | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Canonical manifest authoring metadata: English titles and templates are the
|
|
47
|
+
* portable form carried by `defaultPreset.components`. Localized templates stay
|
|
48
|
+
* in this module and are consumed by the editor catalog directly.
|
|
49
|
+
*/
|
|
50
|
+
export declare function defaultManifestAuthoring(name: string): LocalComponentAuthoring | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type LocalComponentDefinition } from '../sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The rendered/structural components of the default preset, in declaration
|
|
4
|
+
* order. `computed`, `const` and `external` stay kernel grammar
|
|
5
|
+
* metadata in `src/local/configuration/schema.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_SEMANTIC_COMPONENTS: readonly LocalComponentDefinition[];
|
|
8
|
+
export declare const DEFAULT_COMPONENT_NAMES: readonly string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LocalPresetPackage } from '../sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The default component preset. Its components are ordinary public SDK
|
|
4
|
+
* manifests, validated by `defineLocalComponent` at construction. Language
|
|
5
|
+
* declarations (`theme`, `computed`, `const`, `external`) remain kernel grammar
|
|
6
|
+
* metadata and are not preset components.
|
|
7
|
+
*/
|
|
8
|
+
export interface LocalDefaultPreset extends LocalPresetPackage {
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultPreset: LocalDefaultPreset;
|
|
11
|
+
export default defaultPreset;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared identity of the built-in default preset. Keeping the identity in one
|
|
3
|
+
* plain-data module lets the minimal compiler validate preset references
|
|
4
|
+
* without importing the preset implementation or its component table.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_PRESET_ID = "reactive-md/default";
|
|
7
|
+
export declare const DEFAULT_PRESET_VERSION: "0.7.0";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const controlsPack: import("../sdk/index.js").LocalPresetPackage;
|
|
2
|
+
export declare const layoutPack: import("../sdk/index.js").LocalPresetPackage;
|
|
3
|
+
export declare const dataPack: import("../sdk/index.js").LocalPresetPackage;
|
|
4
|
+
export declare const visualsPack: import("../sdk/index.js").LocalPresetPackage;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
2
|
+
import type { Diagnostic, LocalNode, LocalRuntime, LocalSnapshot, LocalValue, SourceRange } from '../local/contracts/types.js';
|
|
3
|
+
import type { LocalRenderMode, LocalSourceTarget } from '../local/rendering/render-types.js';
|
|
4
|
+
import type { LocalUrlPolicy } from '../local/rendering/LocalDocumentView.js';
|
|
5
|
+
import type { LocalLocale } from '../local/theme/i18n.js';
|
|
6
|
+
import type { LocalComponentDefinition, LocalComponentRequirement } from '../sdk/types.js';
|
|
7
|
+
import type { LocalExtensionRequirements } from '../sdk/types.js';
|
|
8
|
+
import type { LocalRuntimeServices } from '../runtime-services/runtime.js';
|
|
9
|
+
import type { LocalComponentStateHandle } from '../runtime-services/component-state.js';
|
|
10
|
+
import type { LocalClock, LocalScheduler } from '../runtime-services/scheduler.js';
|
|
11
|
+
/** A public component value. Arrays are the immutable collection form. */
|
|
12
|
+
export type LocalComponentValue = string | number | boolean | null | readonly string[] | readonly number[];
|
|
13
|
+
/** @deprecated phase-one alias; scalar-only views can keep using it. */
|
|
14
|
+
export type LocalComponentPropValue = string | number | boolean | null;
|
|
15
|
+
export interface LocalComponentSetResult {
|
|
16
|
+
readonly ok: boolean;
|
|
17
|
+
readonly diagnostics: Diagnostic[];
|
|
18
|
+
}
|
|
19
|
+
export interface LocalComponentBindingHandle {
|
|
20
|
+
get(): LocalComponentValue;
|
|
21
|
+
set(next: LocalComponentValue): LocalComponentSetResult;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Normalized content projection handed to builtin and external components.
|
|
25
|
+
*
|
|
26
|
+
* This is deliberately not `LocalNode`: it carries only identity, the
|
|
27
|
+
* component name, resolved props, explicitly requested raw attributes, plain
|
|
28
|
+
* text/format and projected children. The adapter keeps the internal node
|
|
29
|
+
* behind an opaque symbol that no component implementation can read.
|
|
30
|
+
*/
|
|
31
|
+
export interface LocalComponentContent {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
/** `'component'` or the Markdown/content kind (text, table, list, math, ...). */
|
|
34
|
+
readonly kind: string;
|
|
35
|
+
/** Component tag name for `kind: 'component'`, otherwise an empty string. */
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly form?: 'leaf' | 'inline' | 'container';
|
|
38
|
+
readonly props: Readonly<Record<string, LocalComponentValue>>;
|
|
39
|
+
/** Raw authored attributes, available only when a view explicitly asks. */
|
|
40
|
+
readonly attrs: Readonly<Record<string, string>>;
|
|
41
|
+
/** Current binding value of this node (null when it owns no binding). */
|
|
42
|
+
readonly value: LocalComponentValue;
|
|
43
|
+
/** Plain text for Markdown text/leaf nodes and math source. */
|
|
44
|
+
readonly text: string;
|
|
45
|
+
/** Markdown/content format marker (`math`, `inlineMath`, code language, ...). */
|
|
46
|
+
readonly format?: string;
|
|
47
|
+
readonly visible: boolean;
|
|
48
|
+
readonly children: readonly LocalComponentContent[];
|
|
49
|
+
readonly range: Readonly<SourceRange>;
|
|
50
|
+
}
|
|
51
|
+
export declare function readContentNode(content: LocalComponentContent): LocalNode;
|
|
52
|
+
export type LocalComponentTableCellKind = 'number' | 'string' | 'boolean' | 'null' | 'array' | 'empty' | 'error';
|
|
53
|
+
export interface LocalComponentTableCell {
|
|
54
|
+
readonly text: string;
|
|
55
|
+
readonly value: LocalValue | undefined;
|
|
56
|
+
readonly kind: LocalComponentTableCellKind;
|
|
57
|
+
readonly numeric: number | null;
|
|
58
|
+
readonly error: string | null;
|
|
59
|
+
readonly render: () => ReactNode;
|
|
60
|
+
}
|
|
61
|
+
export interface LocalComponentTableProjection {
|
|
62
|
+
readonly header: readonly LocalComponentTableCell[];
|
|
63
|
+
readonly headerText: readonly string[];
|
|
64
|
+
readonly rows: readonly {
|
|
65
|
+
readonly index: number;
|
|
66
|
+
readonly cells: readonly LocalComponentTableCell[];
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
export interface LocalComponentOption {
|
|
70
|
+
readonly value: string;
|
|
71
|
+
readonly content: LocalComponentContent;
|
|
72
|
+
readonly label: string;
|
|
73
|
+
render(): ReactNode;
|
|
74
|
+
}
|
|
75
|
+
export interface LocalComponentField {
|
|
76
|
+
readonly describedBy?: string;
|
|
77
|
+
readonly invalid: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface LocalComponentHint {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly failed: boolean;
|
|
82
|
+
readonly error: boolean;
|
|
83
|
+
readonly message: string;
|
|
84
|
+
}
|
|
85
|
+
export interface LocalComponentRuntime {
|
|
86
|
+
/** Opaque identity shared by components using the same document runtime. */
|
|
87
|
+
readonly identity: object;
|
|
88
|
+
get(item: LocalComponentContent, slot?: string): LocalComponentValue;
|
|
89
|
+
set(item: LocalComponentContent, next: LocalComponentValue, slot?: string): Diagnostic[];
|
|
90
|
+
setMany(item: LocalComponentContent, values: Readonly<Record<string, LocalComponentValue>>): Diagnostic[];
|
|
91
|
+
reset(item: LocalComponentContent): void;
|
|
92
|
+
resetToken(item: LocalComponentContent): number;
|
|
93
|
+
evaluate(expression: string): LocalComponentValue;
|
|
94
|
+
snapshot(): LocalSnapshot;
|
|
95
|
+
validate(): Diagnostic[];
|
|
96
|
+
text(template: string): string;
|
|
97
|
+
}
|
|
98
|
+
export interface LocalComponentChildrenApi {
|
|
99
|
+
render(): ReactNode;
|
|
100
|
+
inline(): ReactNode;
|
|
101
|
+
text(): string;
|
|
102
|
+
items(): readonly LocalComponentContent[];
|
|
103
|
+
/** Render a projected child list as blocks. */
|
|
104
|
+
renderItems(items: readonly LocalComponentContent[], visible?: boolean): ReactNode;
|
|
105
|
+
/** Render a projected child list as inline content. */
|
|
106
|
+
renderInlineItems(items: readonly LocalComponentContent[], visible?: boolean): ReactNode;
|
|
107
|
+
/** Plain text of a projected child list (interpolations evaluated). */
|
|
108
|
+
textOf(items: readonly LocalComponentContent[]): string;
|
|
109
|
+
options(): readonly LocalComponentOption[];
|
|
110
|
+
table(): LocalComponentTableProjection | null;
|
|
111
|
+
math(): readonly LocalComponentContent[];
|
|
112
|
+
}
|
|
113
|
+
export interface LocalComponentNavigationApi {
|
|
114
|
+
targetId(to: string): string | undefined;
|
|
115
|
+
anchorId(): string | undefined;
|
|
116
|
+
/** Host URL policy check for an internal jump target. */
|
|
117
|
+
allowed(to: string): boolean;
|
|
118
|
+
/** Focus and scroll to an anchor; returns why it failed otherwise. */
|
|
119
|
+
jump(to: string): 'ok' | 'missing' | 'hidden';
|
|
120
|
+
}
|
|
121
|
+
export interface LocalComponentUrlApi {
|
|
122
|
+
resolve(raw: string | undefined, kind: 'image' | 'link'): string | null;
|
|
123
|
+
image(raw: string | undefined): string | null;
|
|
124
|
+
}
|
|
125
|
+
export interface LocalComponentLocaleApi {
|
|
126
|
+
readonly locale: LocalLocale;
|
|
127
|
+
t(en: string, zh: string): string;
|
|
128
|
+
formatNumber(value: number): string;
|
|
129
|
+
}
|
|
130
|
+
export interface LocalRandomService {
|
|
131
|
+
/** Resolved seed for this component instance. */
|
|
132
|
+
readonly seed: number;
|
|
133
|
+
/** Derive an independent stream seed from this component seed. */
|
|
134
|
+
derive(label: string): number;
|
|
135
|
+
}
|
|
136
|
+
/** Per-instance runtime services exposed to component implementations. */
|
|
137
|
+
export interface LocalComponentServices {
|
|
138
|
+
readonly random: LocalRandomService;
|
|
139
|
+
readonly clock: LocalClock;
|
|
140
|
+
readonly scheduler: LocalScheduler;
|
|
141
|
+
readonly state: LocalComponentStateHandle;
|
|
142
|
+
}
|
|
143
|
+
/** Context passed to every SDK component. It contains no AST. */
|
|
144
|
+
export interface LocalComponentContext {
|
|
145
|
+
readonly props: Readonly<Record<string, LocalComponentValue>>;
|
|
146
|
+
readonly content: LocalComponentContent;
|
|
147
|
+
readonly services: LocalComponentServices;
|
|
148
|
+
readonly bindings: {
|
|
149
|
+
readonly value: LocalComponentBindingHandle;
|
|
150
|
+
readonly slots: Readonly<Record<string, LocalComponentBindingHandle>>;
|
|
151
|
+
readonly isReadOnly: boolean;
|
|
152
|
+
get(name?: string): LocalComponentValue;
|
|
153
|
+
set(name: string, next: LocalComponentValue): LocalComponentSetResult;
|
|
154
|
+
setMany(values: Readonly<Record<string, LocalComponentValue>>): LocalComponentSetResult;
|
|
155
|
+
};
|
|
156
|
+
readonly children: LocalComponentChildrenApi;
|
|
157
|
+
readonly runtime: LocalComponentRuntime;
|
|
158
|
+
readonly instance: LocalComponentInstance;
|
|
159
|
+
readonly mode: LocalRenderMode;
|
|
160
|
+
readonly visible: boolean;
|
|
161
|
+
readonly disabled: boolean;
|
|
162
|
+
readonly disabledInvalid: boolean;
|
|
163
|
+
readonly resetToken: number;
|
|
164
|
+
readonly validation: {
|
|
165
|
+
fieldFor(item: LocalComponentContent): LocalComponentField;
|
|
166
|
+
hintFor(item: LocalComponentContent): LocalComponentHint | null;
|
|
167
|
+
};
|
|
168
|
+
readonly source: {
|
|
169
|
+
attributes(item?: LocalComponentContent): Record<string, string>;
|
|
170
|
+
};
|
|
171
|
+
readonly navigation: LocalComponentNavigationApi;
|
|
172
|
+
readonly url: LocalComponentUrlApi;
|
|
173
|
+
readonly locale: LocalComponentLocaleApi;
|
|
174
|
+
report(diagnostics: Diagnostic[]): void;
|
|
175
|
+
}
|
|
176
|
+
export interface LocalComponentInstance {
|
|
177
|
+
readonly id: string;
|
|
178
|
+
readonly componentId: string;
|
|
179
|
+
readonly range: Readonly<SourceRange>;
|
|
180
|
+
}
|
|
181
|
+
export type LocalComponentRender = ComponentType<LocalComponentContext>;
|
|
182
|
+
export interface LocalReactComponentImplementation {
|
|
183
|
+
render: LocalComponentRender;
|
|
184
|
+
renderStatic?: LocalComponentRender;
|
|
185
|
+
}
|
|
186
|
+
export interface LocalReactComponent extends LocalReactComponentImplementation {
|
|
187
|
+
readonly definition: LocalComponentDefinition;
|
|
188
|
+
readonly digest: string;
|
|
189
|
+
}
|
|
190
|
+
export interface LocalReactPreset {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly version: string;
|
|
193
|
+
readonly components: readonly LocalReactComponent[];
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Host surface used by the adapter to construct public contexts. It exposes
|
|
197
|
+
* internal nodes only to `component-api`, never to component implementations.
|
|
198
|
+
*/
|
|
199
|
+
export interface LocalComponentAdapterEnvironment {
|
|
200
|
+
readonly runtime: LocalRuntime;
|
|
201
|
+
/** Optional runtime-scoped services. Falls back to detached services. */
|
|
202
|
+
readonly services?: LocalRuntimeServices;
|
|
203
|
+
readonly mode: LocalRenderMode;
|
|
204
|
+
readonly locale: LocalLocale;
|
|
205
|
+
readonly visible: boolean;
|
|
206
|
+
readonly disabled: boolean;
|
|
207
|
+
readonly disabledInvalid: boolean;
|
|
208
|
+
readonly resetToken: number;
|
|
209
|
+
readonly definitionFor: (name: string) => LocalComponentDefinition | undefined;
|
|
210
|
+
readonly validationFieldFor: (node: LocalNode) => LocalComponentField;
|
|
211
|
+
readonly validationHintFor: (node: LocalNode) => LocalComponentHint | null;
|
|
212
|
+
readonly sourceAttributes: (node: LocalNode, componentName?: string) => Record<string, string>;
|
|
213
|
+
readonly renderChildren: (nodes: LocalNode[] | undefined, visible: boolean, block?: boolean) => ReactNode;
|
|
214
|
+
readonly renderInline: (nodes: LocalNode[] | undefined, visible: boolean) => ReactNode;
|
|
215
|
+
readonly renderToText: (nodes: LocalNode[] | undefined) => string;
|
|
216
|
+
readonly report: (diagnostics: Diagnostic[]) => void;
|
|
217
|
+
/** Optional source position for adapter-owned diagnostics. */
|
|
218
|
+
readonly positionOf?: (offset: number) => {
|
|
219
|
+
line: number;
|
|
220
|
+
column: number;
|
|
221
|
+
};
|
|
222
|
+
readonly targetId: (to: string) => string | undefined;
|
|
223
|
+
readonly anchorId: (node: LocalNode) => string | undefined;
|
|
224
|
+
readonly jumpAllowed: (to: string) => boolean;
|
|
225
|
+
readonly jumpTo: (target: string) => 'ok' | 'missing' | 'hidden';
|
|
226
|
+
readonly urlPolicy?: LocalUrlPolicy;
|
|
227
|
+
readonly imageResolver?: (url: string) => string | null;
|
|
228
|
+
}
|
|
229
|
+
export declare function formatComponentNumber(value: number): string;
|
|
230
|
+
/** Public values are immutable; kernel arrays are copied on the way out. */
|
|
231
|
+
export declare function publicComponentValue(value: LocalValue | undefined): LocalComponentValue;
|
|
232
|
+
export interface PropFailureSink {
|
|
233
|
+
readonly environment: LocalComponentAdapterEnvironment;
|
|
234
|
+
/** Minimal adapter-side identity; not an AST handle. */
|
|
235
|
+
readonly node: {
|
|
236
|
+
readonly id: string;
|
|
237
|
+
readonly name?: string;
|
|
238
|
+
readonly range: SourceRange;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Start one document render pass. Static rendering clears its per-pass prop
|
|
243
|
+
* diagnostic memory so a later independent render still reports, while
|
|
244
|
+
* nested contexts in the same pass do not duplicate the same failure.
|
|
245
|
+
*/
|
|
246
|
+
export declare function beginLocalComponentRender(runtime: LocalRuntime): void;
|
|
247
|
+
export declare function resolveComponentProps(definition: LocalComponentDefinition | undefined, attrs: Readonly<Record<string, string>> | undefined, runtime: LocalRuntime, failure?: PropFailureSink): Record<string, LocalComponentValue>;
|
|
248
|
+
/**
|
|
249
|
+
* Build the public context for one component node. Called by the renderer;
|
|
250
|
+
* external implementations receive exactly this object.
|
|
251
|
+
*/
|
|
252
|
+
export declare function createLocalComponentContext(node: LocalNode, environment: LocalComponentAdapterEnvironment): LocalComponentContext;
|
|
253
|
+
/**
|
|
254
|
+
* Bind a React implementation to a validated manifest. The digest is captured
|
|
255
|
+
* here and rechecked when the config is assembled.
|
|
256
|
+
*/
|
|
257
|
+
export declare function defineReactComponent(definition: LocalComponentDefinition, implementation: LocalReactComponentImplementation): LocalReactComponent;
|
|
258
|
+
export interface LocalExtensionRequirementsLike extends LocalExtensionRequirements {
|
|
259
|
+
}
|
|
260
|
+
export type { LocalComponentDefinition, LocalComponentRequirement, LocalSourceTarget };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable public adapter primitives for component implementations.
|
|
3
|
+
*
|
|
4
|
+
* These are canonical kernel/rendering utilities re-exported behind a public
|
|
5
|
+
* entry so builtin and external components can share the same limits, text
|
|
6
|
+
* length, expression, math, table surface and diagram layout behaviour. The
|
|
7
|
+
* implementations are not copied: they remain the kernel modules.
|
|
8
|
+
*/
|
|
9
|
+
export { DEFAULT_LOCAL_DATA_TABLE_ROWS, MAX_LOCAL_ARRAY_LENGTH, MAX_LOCAL_DATA_TABLE_COLUMNS, MAX_LOCAL_DATA_TABLE_ROWS, MAX_LOCAL_PLOT_CURVES, MAX_LOCAL_PLOT_POINTS, MAX_LOCAL_PLOT_STEPS, MAX_LOCAL_STRING_LENGTH, MAX_LOCAL_VALUE_CHARACTERS, isLocalEmail, } from '../local/configuration/limits.js';
|
|
10
|
+
export { countLocalCodePoints } from '../local/source/text-length.js';
|
|
11
|
+
export { formatLocalDiagnostic } from '../local/configuration/diagnostics.js';
|
|
12
|
+
export { compileExpression, type LocalExpression } from '../local/evaluation/expression.js';
|
|
13
|
+
export { compileLatex, compilePlotFormula, implicitGridSize, LatexError, MAX_IMPLICIT_GRID, MIN_IMPLICIT_GRID, plotFormulaKind, type CompiledPlotFormula, type LatexEvaluationBudget, type PlotFormulaKind, type PlotPoint, type PlotSample, } from '../local/evaluation/math.js';
|
|
14
|
+
export { sampleImplicit, sampleParametric, samplePlot } from '../local/evaluation/math-sample.js';
|
|
15
|
+
export { LatexView } from '../local/widgets/math-view.js';
|
|
16
|
+
export { TableSurface } from '../local/widgets/table-surface.js';
|
|
17
|
+
export { createDiagramLayoutFallback, diagramEdgePath, diagramLayoutKey, layoutDiagram, type DiagramLayoutInput, type DiagramLayoutResult, } from '../local/widgets/diagram-layout.js';
|
|
18
|
+
export { isLocalColor } from '../local/theme/colors.js';
|
|
19
|
+
export type { Diagnostic, LocalValue } from '../local/contracts/types.js';
|
|
20
|
+
export type { LocalRenderMode } from '../local/rendering/render-types.js';
|
|
21
|
+
export type { LocalLocale, Localize } from '../local/theme/i18n.js';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import type { Diagnostic, LocalValue } from './component-primitives.js';
|
|
3
|
+
import type { LocalLocale, Localize } from './component-primitives.js';
|
|
4
|
+
import type { LocalComponentContext, LocalComponentContent, LocalComponentHint, LocalComponentValue } from './component-api.js';
|
|
5
|
+
/**
|
|
6
|
+
* Builtin modules import these from this public React entry instead of
|
|
7
|
+
* reaching into kernel/local internals. The evaluators themselves stay
|
|
8
|
+
* canonical kernel code; nothing is copied here.
|
|
9
|
+
*/
|
|
10
|
+
export * from './component-primitives.js';
|
|
11
|
+
/** Convenience view over one public component context. */
|
|
12
|
+
export interface LocalComponentView {
|
|
13
|
+
readonly context: LocalComponentContext;
|
|
14
|
+
readonly content: LocalComponentContent;
|
|
15
|
+
readonly props: Readonly<Record<string, LocalComponentValue>>;
|
|
16
|
+
readonly runtime: LocalComponentContext['runtime'];
|
|
17
|
+
readonly bindings: LocalComponentContext['bindings'];
|
|
18
|
+
readonly children: LocalComponentContext['children'];
|
|
19
|
+
readonly mode: LocalComponentContext['mode'];
|
|
20
|
+
readonly visible: boolean;
|
|
21
|
+
readonly disabled: boolean;
|
|
22
|
+
readonly disabledInvalid: boolean;
|
|
23
|
+
readonly resetToken: number;
|
|
24
|
+
readonly t: Localize;
|
|
25
|
+
readonly locale: LocalLocale;
|
|
26
|
+
readonly validation: LocalComponentContext['validation'];
|
|
27
|
+
readonly source: LocalComponentContext['source'];
|
|
28
|
+
readonly navigation: LocalComponentContext['navigation'];
|
|
29
|
+
readonly url: LocalComponentContext['url'];
|
|
30
|
+
readonly report: (diagnostics: Diagnostic[]) => void;
|
|
31
|
+
render(items?: readonly LocalComponentContent[], visible?: boolean): ReactNode;
|
|
32
|
+
renderInline(items?: readonly LocalComponentContent[], visible?: boolean): ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export declare function useComponentView(context: LocalComponentContext): LocalComponentView;
|
|
35
|
+
export declare function useWriter(context: LocalComponentContext): {
|
|
36
|
+
write: (value: LocalValue, slot?: string) => boolean;
|
|
37
|
+
writeMany: (values: Readonly<Record<string, LocalValue>>) => boolean;
|
|
38
|
+
error: string | null;
|
|
39
|
+
setError: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
40
|
+
};
|
|
41
|
+
export declare function useDisabled(context: LocalComponentContext): {
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
invalid: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare function useValidationField(context: LocalComponentContext, item?: LocalComponentContent): import("./component-api.js").LocalComponentField;
|
|
46
|
+
export declare function useValidationHint(context: LocalComponentContext, item?: LocalComponentContent): LocalComponentHint | null;
|
|
47
|
+
export declare function useSourceAttributes(context: LocalComponentContext, item?: LocalComponentContent): Record<string, string>;
|
|
48
|
+
export declare function useResetToken(context: LocalComponentContext, onReset: () => void): void;
|
|
49
|
+
export declare function rawAttr(content: LocalComponentContent, name: string): string | undefined;
|
|
50
|
+
export declare function componentProp(context: LocalComponentContext, name: string): LocalComponentValue;
|
|
51
|
+
/** Resolved text prop with the legacy fallback and failure marker. */
|
|
52
|
+
export declare function textAttr(context: LocalComponentContext, name: string, fallback?: string): string;
|
|
53
|
+
export declare function numberAttr(context: LocalComponentContext, name: string, fallback: number): number;
|
|
54
|
+
/** Text prop of a projected child component (e.g. tab/step/option labels). */
|
|
55
|
+
export declare function itemText(context: LocalComponentContext, item: LocalComponentContent, name: string, fallback?: string): string;
|
|
56
|
+
/** Boolean prop of a projected child component. */
|
|
57
|
+
export declare function itemBool(_context: LocalComponentContext, item: LocalComponentContent, name: string, fallback?: boolean): boolean;
|
|
58
|
+
export type ConstraintRead<T> = {
|
|
59
|
+
present: false;
|
|
60
|
+
error: false;
|
|
61
|
+
} | {
|
|
62
|
+
present: true;
|
|
63
|
+
error: true;
|
|
64
|
+
} | {
|
|
65
|
+
present: true;
|
|
66
|
+
error: false;
|
|
67
|
+
value: T;
|
|
68
|
+
};
|
|
69
|
+
export declare function numberConstraint(context: LocalComponentContext, name: string): ConstraintRead<number>;
|
|
70
|
+
export declare function dateConstraint(context: LocalComponentContext, name: string): ConstraintRead<string>;
|
|
71
|
+
export declare function readBooleanAttr(context: LocalComponentContext, name: string, fallback: boolean): {
|
|
72
|
+
ok: true;
|
|
73
|
+
value: boolean;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
};
|
|
77
|
+
export declare function boolAttr(context: LocalComponentContext, name: string, fallback?: boolean): boolean;
|
|
78
|
+
export declare function toneAttr<T extends string>(context: LocalComponentContext, name: string, values: readonly T[], fallback: T): {
|
|
79
|
+
tone: T;
|
|
80
|
+
error: boolean;
|
|
81
|
+
};
|
|
82
|
+
export declare function localColor(content: LocalComponentContent): string | undefined;
|
|
83
|
+
export declare function accentStyle(color: string | undefined): CSSProperties | undefined;
|
|
84
|
+
export declare function scalarText(value: LocalValue | LocalComponentValue): string | null;
|
|
85
|
+
export declare function displayValue(value: LocalComponentValue): string;
|
|
86
|
+
export declare function currentValue(context: LocalComponentContext): LocalComponentValue;
|
|
87
|
+
export declare function slotNumber(context: LocalComponentContext, slot: string, fallback: number): number;
|
|
88
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
89
|
+
export declare function snapToStep(value: number, min: number, max: number, step: number): number;
|
|
90
|
+
export declare function numericRange(context: LocalComponentContext, minName: string, maxName: string, minFallback: number, maxFallback: number, stepFallback?: number): {
|
|
91
|
+
min: number;
|
|
92
|
+
max: number;
|
|
93
|
+
step: number;
|
|
94
|
+
};
|
|
95
|
+
export declare const EMPTY_STATIC_VALUE = "\u2014";
|
|
96
|
+
export declare function staticText(value: string): string;
|
|
97
|
+
export declare function StaticValue({ label, value, hint, className, multiline, }: {
|
|
98
|
+
label: string;
|
|
99
|
+
value: ReactNode;
|
|
100
|
+
hint?: ReactNode;
|
|
101
|
+
className?: string;
|
|
102
|
+
multiline?: boolean;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
export declare function PrintValue({ value, block }: {
|
|
105
|
+
value: ReactNode;
|
|
106
|
+
block?: boolean;
|
|
107
|
+
}): import("react").JSX.Element;
|
|
108
|
+
export declare function FieldError({ message, id }: {
|
|
109
|
+
message: string | null;
|
|
110
|
+
id?: string;
|
|
111
|
+
}): import("react").JSX.Element | null;
|
|
112
|
+
export declare function LocalError({ message }: {
|
|
113
|
+
message?: string;
|
|
114
|
+
}): import("react").JSX.Element;
|
|
115
|
+
export declare function ToneProblem({ message }: {
|
|
116
|
+
message: string;
|
|
117
|
+
}): import("react").JSX.Element;
|
|
118
|
+
export declare function formatSeconds(seconds: number, t: Localize): string;
|
|
119
|
+
export declare function formatNumber(value: number): string;
|
|
120
|
+
/** Plain text of a projected inline child list (interpolations evaluated). */
|
|
121
|
+
export declare function inlinePlainText(context: LocalComponentContext, items: readonly LocalComponentContent[] | undefined, seen?: number): string;
|
|
122
|
+
export declare function optionLabel(context: LocalComponentContext, option: {
|
|
123
|
+
content: LocalComponentContent;
|
|
124
|
+
}): string;
|
|
125
|
+
export declare function renderInlineNodes(view: LocalComponentView, items: readonly LocalComponentContent[] | undefined, visible?: boolean): ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure text-field validation shared by the built-in controls and the document
|
|
3
|
+
* renderer. It contains no component state and no localization lookup; callers
|
|
4
|
+
* pass the message table they already use.
|
|
5
|
+
*/
|
|
6
|
+
export declare function textProblem(value: string, options: {
|
|
7
|
+
required: boolean;
|
|
8
|
+
minLength?: number;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
email?: boolean;
|
|
11
|
+
}, t: (en: string, zh: string) => string): string | null;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
export { LocalDocumentView, LocalReactiveDocument } from '../local/LocalDocumentView.js';
|
|
2
|
-
export type { LocalDocumentViewProps, LocalReactiveDocumentProps, LocalUrlPolicy, LocalImageResolver, } from '../local/LocalDocumentView.js';
|
|
3
|
-
export type { LocalRenderMode, LocalRenderContext, LocalHostData, LocalHostRenderer } from '../local/render-types.js';
|
|
4
|
-
export type { LocalLocale } from '../local/locale.js';
|
|
5
|
-
export type { LocalColorScheme, LocalThemeDefinition } from '../local/theme.js';
|
|
1
|
+
export { LocalDocumentView, LocalReactiveDocument } from '../local/rendering/LocalDocumentView.js';
|
|
2
|
+
export type { LocalDocumentViewProps, LocalReactiveDocumentProps, LocalUrlPolicy, LocalImageResolver, } from '../local/rendering/LocalDocumentView.js';
|
|
3
|
+
export type { LocalRenderMode, LocalRenderContext, LocalHostData, LocalHostRenderer, LocalHostComponentContext, LocalHostPropValue, LocalSourceTarget, } from '../local/rendering/render-types.js';
|
|
4
|
+
export type { LocalLocale } from '../local/contracts/locale.js';
|
|
5
|
+
export type { LocalColorScheme, LocalThemeDefinition } from '../local/theme/theme.js';
|
|
6
|
+
export { defineReactComponentPackage, createReactHost, defineReactPreset, defaultReactPresetPackage } from './package.js';
|
|
7
|
+
export type { LocalReactComponentPackageInput, LocalReactComponentPackage, LocalReactPackage, LocalReactPresetPackage, LocalReactHostInput, LocalReactHost, LocalPackageNotice } from './package.js';
|
|
8
|
+
export { LocalReactExtensionMissingError, createReactConfig, defineReactComponent, localReactExtensionRenderer, reportLocalComponentError, safeLocalComponentEvent, validateLocalReactExtensions, } from './sdk.js';
|
|
9
|
+
export type { CreateLocalReactConfigOptions, LocalComponentBindingHandle, LocalComponentContext, LocalComponentInstance, LocalComponentPropValue, LocalComponentRender, LocalComponentSetResult, LocalReactComponent, LocalReactComponentImplementation, LocalReactConfig, LocalReactExtensionRenderer, LocalReactPreset, LocalReactRenderEnvironment, } from './sdk.js';
|
|
10
|
+
export type { LocalComponentChildrenApi, LocalComponentContent, LocalComponentField, LocalComponentHint, LocalComponentLocaleApi, LocalComponentNavigationApi, LocalComponentOption, LocalComponentRuntime, LocalComponentServices, LocalComponentSetResult as LocalComponentWriteResult, LocalComponentTableCell, LocalComponentTableCellKind, LocalComponentTableProjection, LocalComponentUrlApi, LocalComponentValue, LocalRandomService, } from './component-api.js';
|
|
11
|
+
export type { LocalComponentDefinition, LocalComponentProp, LocalConfig, LocalExtensionRequirements, } from '../sdk/types.js';
|
|
12
|
+
export type { LocalComponentStateDocument, LocalComponentStateRecord, LocalComponentStateSaveResult, } from '../runtime-services/component-state.js';
|
|
13
|
+
export type { LocalRuntimeServices } from '../runtime-services/runtime.js';
|
|
14
|
+
export { DEFAULT_LOCAL_DATA_TABLE_ROWS, LatexError, LatexView, MAX_LOCAL_ARRAY_LENGTH, MAX_LOCAL_DATA_TABLE_COLUMNS, MAX_LOCAL_DATA_TABLE_ROWS, MAX_LOCAL_PLOT_CURVES, MAX_LOCAL_PLOT_POINTS, MAX_LOCAL_PLOT_STEPS, MAX_LOCAL_STRING_LENGTH, MAX_LOCAL_VALUE_CHARACTERS, MAX_IMPLICIT_GRID, MIN_IMPLICIT_GRID, TableSurface, compileExpression, compileLatex, compilePlotFormula, countLocalCodePoints, createDiagramLayoutFallback, diagramEdgePath, diagramLayoutKey, formatLocalDiagnostic, implicitGridSize, isLocalColor, isLocalEmail, layoutDiagram, plotFormulaKind, sampleImplicit, sampleParametric, samplePlot, } from './component-primitives.js';
|
|
15
|
+
export type { CompiledPlotFormula, DiagramLayoutInput, DiagramLayoutResult, LatexEvaluationBudget, LocalExpression, LocalValue, PlotFormulaKind, PlotPoint, PlotSample, } from './component-primitives.js';
|
|
16
|
+
export { FieldError, LocalError, PrintValue, StaticValue, ToneProblem, accentStyle, boolAttr, clamp, currentValue, dateConstraint, displayValue, formatNumber, formatSeconds, inlinePlainText, itemBool, itemText, localColor, numberAttr, numberConstraint, numericRange, optionLabel, rawAttr, readBooleanAttr, scalarText, slotNumber, snapToStep, staticText, textAttr, toneAttr, useComponentView, useDisabled, useResetToken, useSourceAttributes, useValidationField, useValidationHint, useWriter, } from './component-utils.js';
|
|
17
|
+
export type { ConstraintRead, LocalComponentView, } from './component-utils.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** One delegated tooltip per default document, shared by all clipped labels. */
|
|
3
|
+
export declare function OverflowTextTooltip({ rootRef, enabled }: {
|
|
4
|
+
rootRef: RefObject<HTMLElement | null>;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LOCAL_REACT_PRESET_PROTOCOL, type LocalComponentDefinition, type LocalPresetPackage } from '../sdk/types.js';
|
|
2
|
+
import type { LocalStyleResource, LocalThemePackage } from '../sdk/theme.js';
|
|
3
|
+
import { type LocalReactConfig } from './sdk.js';
|
|
4
|
+
import { type LocalReactComponent, type LocalReactComponentImplementation } from './component-api.js';
|
|
5
|
+
export interface LocalPackageNotice {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly name?: string;
|
|
8
|
+
readonly version?: string;
|
|
9
|
+
readonly license?: string;
|
|
10
|
+
readonly url?: string;
|
|
11
|
+
readonly text?: string;
|
|
12
|
+
}
|
|
13
|
+
export type LocalReactComponentPackageInput = Omit<LocalComponentDefinition, 'protocol' | 'form' | 'props'> & Partial<Pick<LocalComponentDefinition, 'protocol' | 'form' | 'props'>> & LocalReactComponentImplementation & {
|
|
14
|
+
readonly css?: string;
|
|
15
|
+
readonly resources?: readonly LocalStyleResource[];
|
|
16
|
+
};
|
|
17
|
+
export interface LocalReactPackage {
|
|
18
|
+
readonly components: readonly LocalReactComponent[];
|
|
19
|
+
readonly resources?: readonly LocalStyleResource[];
|
|
20
|
+
readonly themes?: readonly LocalThemePackage[];
|
|
21
|
+
readonly notices?: readonly LocalPackageNotice[];
|
|
22
|
+
}
|
|
23
|
+
export interface LocalReactComponentPackage extends LocalReactPackage {
|
|
24
|
+
readonly definition: LocalComponentDefinition;
|
|
25
|
+
readonly resources: readonly LocalStyleResource[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Pairs one semantic preset with the React implementations and resources the
|
|
29
|
+
* host installs for it. The pairing is validated by manifest identity, not by
|
|
30
|
+
* array position or preset version alone.
|
|
31
|
+
*/
|
|
32
|
+
export interface LocalReactPresetPackage {
|
|
33
|
+
readonly protocol: typeof LOCAL_REACT_PRESET_PROTOCOL;
|
|
34
|
+
readonly preset: LocalPresetPackage;
|
|
35
|
+
readonly components: readonly LocalReactComponent[];
|
|
36
|
+
readonly resources?: readonly LocalStyleResource[];
|
|
37
|
+
readonly notices?: readonly LocalPackageNotice[];
|
|
38
|
+
}
|
|
39
|
+
/** Validate a semantic preset and its React pairing. */
|
|
40
|
+
export declare function defineReactPreset(input: LocalReactPresetPackage): LocalReactPresetPackage;
|
|
41
|
+
/** Default semantic preset paired with the built-in React implementation table. */
|
|
42
|
+
export declare const defaultReactPresetPackage: LocalReactPresetPackage;
|
|
43
|
+
/** One authoring declaration; its manifest stays plain data for Worker use. */
|
|
44
|
+
export declare function defineReactComponentPackage(input: LocalReactComponentPackageInput): LocalReactComponentPackage;
|
|
45
|
+
export interface LocalReactHostInput {
|
|
46
|
+
/**
|
|
47
|
+
* React preset packages. Omitted keeps the default preset; `[]` installs no
|
|
48
|
+
* preset. Explicit packages/components never restore the default silently.
|
|
49
|
+
*/
|
|
50
|
+
readonly presets?: readonly (LocalReactPresetPackage | 'default')[];
|
|
51
|
+
readonly replacements?: 'allow' | 'forbid';
|
|
52
|
+
readonly packages?: readonly LocalReactPackage[];
|
|
53
|
+
readonly components?: readonly LocalReactComponent[];
|
|
54
|
+
readonly themes?: readonly LocalThemePackage[];
|
|
55
|
+
readonly resources?: readonly LocalStyleResource[];
|
|
56
|
+
readonly notices?: readonly LocalPackageNotice[];
|
|
57
|
+
}
|
|
58
|
+
export interface LocalReactHost {
|
|
59
|
+
readonly config: LocalReactConfig['config'];
|
|
60
|
+
readonly reactConfig: LocalReactConfig;
|
|
61
|
+
readonly compileOptions: Readonly<{
|
|
62
|
+
config: LocalReactConfig['config'];
|
|
63
|
+
}>;
|
|
64
|
+
readonly resources: readonly LocalStyleResource[];
|
|
65
|
+
readonly css: string;
|
|
66
|
+
readonly notices: readonly LocalPackageNotice[];
|
|
67
|
+
}
|
|
68
|
+
/** Compose packages once for compiler, renderer, authoring and export. */
|
|
69
|
+
export declare function createReactHost(input?: LocalReactHostInput): LocalReactHost;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Diagnostic } from '../../local/contracts/types.js';
|
|
2
|
+
import type { LocalComponentContext } from '../component-api.js';
|
|
3
|
+
export declare function componentDiagnostic(context: LocalComponentContext, code: string, message: string): Diagnostic;
|
|
4
|
+
export declare function reportError(context: LocalComponentContext, code: string, error: unknown): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { useTicker, useFrame } from './useTicker.js';
|
|
2
|
+
export type { UseTickerOptions } from './useTicker.js';
|
|
3
|
+
export { classifySwipe, useSwipe } from './useSwipe.js';
|
|
4
|
+
export type { LocalSwipeAxis, LocalSwipeDirection, LocalSwipeHandlers, LocalSwipeOptions, } from './useSwipe.js';
|
|
5
|
+
export { isEditableTarget, useKeys } from './useKeys.js';
|
|
6
|
+
export type { LocalKeyBindings, LocalKeyOptions } from './useKeys.js';
|
|
7
|
+
export { useComponentState } from './useComponentState.js';
|
|
8
|
+
export type { UseComponentStateOptions, UseComponentStateResult, } from './useComponentState.js';
|