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,6 +1,10 @@
|
|
|
1
1
|
# Reactive MD theme protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** · [中文](theme-protocol-ch.md)
|
|
4
|
+
|
|
5
|
+
Protocol revision: `reactive-md-theme-1`, introduced in `0.4.0`. The built-in `default` theme uses the product-UI appearance. Every other theme, including a `soft` example that preserves the package's original look, is external and must be registered by the host.
|
|
6
|
+
|
|
7
|
+
The source [extension SDK preview](../integration/extension-sdk-en.md) provides `defineLocalTheme`, `composeLocalTheme` and theme package resource conventions. Its build adapter includes theme CSS, fonts and images in offline exports. The semantic variables and scope rules below still apply. Use a tarball built from the current source for the SDK preview.
|
|
4
8
|
|
|
5
9
|
## Selecting a theme
|
|
6
10
|
|
|
@@ -14,6 +18,8 @@ Place a declaration before the document body:
|
|
|
14
18
|
|
|
15
19
|
`<theme name="default" />` is also accepted. Omission selects `default`. Whitespace, a BOM and comments may precede the declaration. Declare it once, outside components. The static `name` uses lowercase kebab-case, starts with a letter and has at most 64 characters. Expressions and additional attributes are invalid.
|
|
16
20
|
|
|
21
|
+
Only `default` is built in. A document selects any other theme by name only when the host has registered that name, for example `<theme name="soft">` for the original-look example in the product-UI gallery or `<theme name="paper">` for a host design. Registration is described below.
|
|
22
|
+
|
|
17
23
|
The declaration is document metadata, does not count as a component and produces no visible element. Compilation stores `document.theme` and the original declaration's `document.themeRange`. Body nodes retain their original source positions. Fenced code, inline code, comments and escaped examples remain literal.
|
|
18
24
|
|
|
19
25
|
Invalid declarations produce `local.theme.*` warnings and select `default`. Repeated declarations do not change the first selection. Late or nested declarations do not select a theme. Healthy body content and controls remain usable.
|
|
@@ -39,7 +45,7 @@ export function Article({ source }: { source: string }) {
|
|
|
39
45
|
}
|
|
40
46
|
```
|
|
41
47
|
|
|
42
|
-
This demonstrates registration. The repository includes only `default
|
|
48
|
+
This demonstrates registration. The repository includes only `default` as a built-in theme, and a host definition cannot replace it. Everything else is external: the original-look `soft` name and the complete sci-fi reference package both require host registration; `soft` has no separate stylesheet, so the product-UI gallery registers the name with a plain definition while the core baseline CSS supplies its appearance. The repository's `paper` example above has no design or stylesheet; a complete reference package with tokens, component styling, both colour schemes and a live gallery is in [examples/sci-fi-theme](../../examples/sci-fi-theme/README.md).
|
|
43
49
|
|
|
44
50
|
| Field | Requirement |
|
|
45
51
|
| --- | --- |
|
|
@@ -49,7 +55,7 @@ This demonstrates registration. The repository includes only `default`; it does
|
|
|
49
55
|
|
|
50
56
|
The host loads the CSS. Registration does not fetch or inject styles. Documents select a registered name and cannot provide CSS, stylesheet URLs or scripts. Theme CSS is trusted host code; the host reviews its scope and resource references.
|
|
51
57
|
|
|
52
|
-
An unknown name, duplicate selected name, invalid selected registration, unsupported protocol or missing mode produces a renderer warning and falls back to `default`. Core-only hosts can call `resolveLocalTheme(name, themes, range?, source?)` to obtain `{ name, diagnostics }`. Compilation parses declarations independently of host registrations.
|
|
58
|
+
An unknown name, duplicate selected name, invalid selected registration, unsupported protocol or missing mode produces a renderer warning and falls back to `default`. Built-in `default` is always available; selecting `soft` or any other external name without registering it falls back to `default` in the same way. Core-only hosts can call `resolveLocalTheme(name, themes, range?, source?)` to obtain `{ name, diagnostics }`. Compilation parses declarations independently of host registrations.
|
|
53
59
|
|
|
54
60
|
## Color schemes and instance scope
|
|
55
61
|
|
|
@@ -81,21 +87,87 @@ Shared component CSS supplies structure, interaction and defaults. Custom themes
|
|
|
81
87
|
|
|
82
88
|
| Purpose | Public variables |
|
|
83
89
|
| --- | --- |
|
|
84
|
-
| Surfaces | `--paper`, `--surface`, `--document-bg` (defaults to `--surface`), `--surface-subtle`, `--surface-hover`, `--surface-active` |
|
|
90
|
+
| Surfaces | `--paper`, `--surface`, `--document-bg` (defaults to `--surface`), `--surface-subtle`, `--surface-hover`, `--surface-active`, `--image-zoom-backdrop` |
|
|
85
91
|
| Text and borders | `--ink`, `--ink-soft`, `--ink-muted`, `--line`, `--line-strong` |
|
|
86
|
-
| Accent | `--accent`, `--accent-hover`, `--accent-soft`, `--accent-line` |
|
|
92
|
+
| Accent | `--accent`, `--accent-hover`, `--accent-soft`, `--accent-line`, `--accent-ink` (text on accent fills), `--accent-text` (accent used as ink) |
|
|
87
93
|
| Status | `--info`, `--info-soft`, `--success`, `--success-soft`, `--success-line`, `--warning`, `--warning-soft`, `--warning-line`, `--danger`, `--danger-soft`, `--danger-line`, `--neutral-soft` |
|
|
88
94
|
| Focus | `--focus`, `--focus-outline`, `--focus-ring` |
|
|
89
95
|
| Data and code | `--chart-1` through `--chart-8`, `--chart-grid`, `--chart-axis`, `--code-bg`, `--code-bg-deep`, `--code-ink` |
|
|
90
96
|
| Fonts | `--font-sans`, `--font-mono`, `--text-xs` through `--text-xl`, `--text-2xl`, `--text-block-title`, `--text-block-subtitle` |
|
|
91
97
|
| Line height and weight | `--leading-tight`, `--leading-snug`, `--leading-normal`, `--leading-relaxed`, `--weight-regular`, `--weight-medium`, `--weight-semibold`, `--weight-bold` |
|
|
92
98
|
| Spacing | `--space-1` through `--space-7`, `--field-gap` |
|
|
93
|
-
| Radius | `--radius-control`, `--radius-card`, `--radius-panel`, `--radius-pill` |
|
|
94
|
-
| Controls | `--control-height-sm`, `--control-height`, `--control-height-lg`, `--control-padding-x`, `--control-padding-y`, `--disabled-opacity` |
|
|
99
|
+
| Radius | `--radius-control`, `--radius-card`, `--radius-panel`, `--radius-pill`, `--radius-field`, `--radius-field-multiline` |
|
|
100
|
+
| Controls | `--control-height-sm`, `--control-height`, `--control-height-lg`, `--control-padding-x`, `--control-padding-y`, `--control-inset-x`, `--control-selected`, `--control-selected-ink`, `--control-track`, `--control-thumb`, `--disabled-opacity` |
|
|
101
|
+
| Tables | `--table-cell-padding-y`, `--table-cell-padding-x` |
|
|
95
102
|
| Motion and elevation | `--motion-fast`, `--motion-base`, `--motion-slow`, `--ease-standard`, `--shadow-sm`, `--shadow-md` |
|
|
96
103
|
|
|
97
104
|
Existing `--blue`, `--blue-deep`, `--blue-soft` and `--blue-line` remain compatible. New themes should use the accent variables. Explicit component `color` attributes override their corresponding local color; other properties continue to use the theme. Series and status colors retain their semantic roles.
|
|
98
105
|
|
|
106
|
+
## Themed native buttons
|
|
107
|
+
|
|
108
|
+
`reactive-md/styles.css` includes the shared `controls.css` button skin. A component that renders a native `<button>` or an `input` with type `button`, `submit` or `reset` inside `.md-document` receives the current document's secondary appearance:
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<button type="button">Pause</button>
|
|
112
|
+
<button type="button" className="md-button-primary">Start</button>
|
|
113
|
+
<button type="button" className="game-direction">←</button>
|
|
114
|
+
<button type="button" data-rmd-appearance="custom">Custom button</button>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Usage | Appearance responsibility |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| Plain native button or compatible `md-button` class | Secondary by default, with hover, active, focus-visible and disabled states |
|
|
120
|
+
| `md-button-primary`, `md-button-secondary`, `md-button-quiet` | Explicit semantic variant; each class works on its own |
|
|
121
|
+
| Component CSS class | Overrides individual properties; changing width retains shared colors, disabled and focus styles |
|
|
122
|
+
| `data-rmd-appearance="custom"` | The element opts out of the shared button skin; its component owns appearance and interaction states and can still use theme variables |
|
|
123
|
+
|
|
124
|
+
`data-rmd-appearance` is a DOM attribute emitted by the component. It requires no RMD syntax change and does not opt out descendant buttons. Shared rules use `:where()` for zero selector specificity and no `!important`. An ordinary component class overrides its declared properties, including those properties in interaction states. Shared buttons set no margin: containers and component layouts own spacing. `[hidden]` stays hidden. Disabled styling also covers buttons in disabled fieldsets.
|
|
125
|
+
|
|
126
|
+
Themes adjust buttons through `--surface`, `--surface-hover`, `--surface-active`, `--ink`, `--line-strong`, `--accent`, `--accent-hover`, `--accent-ink`, `--control-height`, `--control-inset-x`, `--control-padding-y`, `--radius-field`, `--focus-outline` and the existing typography and motion variables. Component packages own boards, tile colors and game animations. Built-in and external buttons share one implementation.
|
|
127
|
+
|
|
128
|
+
Hosts load shared CSS, theme resources, then component resources. SSR pages load the same `reactive-md/styles.css` for the first paint. Offline HTML includes shared CSS, the selected theme and component CSS. Each document root supplies its own variables; changing themes preserves component runtime state. Compiler-only entries retain no CSS dependency.
|
|
129
|
+
|
|
130
|
+
Automatic matching covers native buttons inside documents. Components style `[role="button"]` themselves. Host navigation and editor toolbars outside documents keep their own appearance. Portal, Shadow DOM and iframe content need separate theme integration. The same automatic approach covers the native controls and component classes below.
|
|
131
|
+
|
|
132
|
+
## Themed native controls
|
|
133
|
+
|
|
134
|
+
The shared stylesheet also skins the native controls below when they appear inside `.md-document`. Matching uses the real element and input type; the skin does not infer a control from a role, a container class or a `div`. Keyboard handling, validation timing, pickers, spinners and platform interaction remain native. Components own labels, ARIA, state and behavior. `data-rmd-appearance="custom"` on a matched element returns its appearance to the component; theme variables remain available.
|
|
135
|
+
|
|
136
|
+
**Fields.** Text-like inputs with an omitted type or `text`, `search`, `email`, `url`, `tel`, `password`, `number`, `date`, `time`, `datetime-local`, `month` or `week`, plus `textarea` and single or multiple `select`, use the theme surface, border, radius and control height. Focus uses `--focus` and `--focus-ring`. `aria-invalid="true"` and the platform `:user-invalid` state show the danger border; the skin ignores bare `:invalid` so validation timing stays with the author. Read-only fields keep their theme and focus behavior; disabled fields use `--disabled-opacity`, including controls in a disabled `fieldset`. Native date and time pickers, number spinners and select arrows stay available. Fields fill the container up to 420px and shrink at 375px.
|
|
137
|
+
|
|
138
|
+
`.md-field` and the compatible `.md-control` group a label, control, hint and error with a vertical gap. `.md-label`, `.md-hint`, `.md-error` and `.md-required` style those parts; native `label` and `legend` receive base typography. Authors set `required` or `aria-required` on the control itself. `.md-text-input` and `.md-select-input` remain compatible hooks with the same skin.
|
|
139
|
+
|
|
140
|
+
**Selection and progress.** Native `input[type="checkbox"]` and `input[type="radio"]` keep their platform shape and use `--control-selected`, falling back to `--accent`, for the checked mark. A native checkbox opts into switch appearance with `.md-switch`, or with `role="switch"` on that same checkbox. `input[type="range"]` themes the track and thumb in WebKit and Firefox while retaining native input semantics. `progress` supports determinate and indeterminate output. `meter` keeps its low, high and optimum semantics with status colors. `.md-progress` and `.md-meter` are optional hooks on the same native elements. Each control type has its own sizing rules.
|
|
141
|
+
|
|
142
|
+
**Disclosure.** Native `details` and `summary` receive basic appearance; the marker, keyboard behavior and closed state stay native, and the skin never sets `display` on a closed element. `.md-disclosure`, `.md-disclosure-title` and `.md-disclosure-panel` are optional appearance hooks for author-owned disclosure markup.
|
|
143
|
+
|
|
144
|
+
**Dialog and popover.** A native `dialog` is styled only while open, and a native `[popover]` only in `:popover-open`. The skin sets no display, position or pointer behavior. `dialog::backdrop` uses `--image-zoom-backdrop` with a neutral fallback. `.md-dialog`, `.md-popover`, `.md-tooltip`, `.md-menu`, `.md-menu-item` and `.md-menu-separator` provide appearance for author-owned markup; the author owns open state, placement, focus, keyboard handling and portalling. The classes never reveal a closed dialog or popover, and size constraints keep them usable at 375px.
|
|
145
|
+
|
|
146
|
+
## Themed component classes
|
|
147
|
+
|
|
148
|
+
Shared classes cover the remaining public UI. They supply appearance; the author supplies semantics, behavior, focus and position.
|
|
149
|
+
|
|
150
|
+
| Area | Public hooks |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| Surfaces | `md-card`, `md-card-title`, `md-card-body`, `md-panel`, `md-panel-title`, `md-panel-body`, `md-group` |
|
|
153
|
+
| Status | `md-badge` and `md-status` with `md-badge-neutral`, `md-badge-success`, `md-badge-warning`, `md-badge-danger`, `md-badge-info` and the matching `md-status-*` variants |
|
|
154
|
+
| Feedback | `md-alert` with `md-alert-success`, `md-alert-warning`, `md-alert-danger`, `md-alert-info`, `md-alert-title`, `md-alert-body`; `md-empty-state`, `md-empty-state-title`, `md-empty-state-description`; `md-spinner`, `md-loading`, `md-skeleton` |
|
|
155
|
+
| Navigation | `md-tabs`, `md-tablist`, `md-tab`, `md-tabpanel`, `md-pagination`, `md-page`, `md-steps`, `md-step` |
|
|
156
|
+
| Content | Document typography for headings, paragraphs, links, lists, quotes, rules, `kbd`, inline code and code blocks; native tables and `md-table` |
|
|
157
|
+
| Charts | `md-chart`, `md-chart-axis`, `md-chart-grid`, `md-chart-legend`, `md-chart-node`, `md-chart-edge`, `md-chart-series-line`, `md-chart-series-area` |
|
|
158
|
+
|
|
159
|
+
Tabs and steps read `aria-selected`, `aria-current`, `aria-expanded` and disabled states for appearance. `aria-current="step"` and `data-state="complete"` mark step progress. Tables add `md-table-striped` for zebra rows and `aria-selected="true"` or `data-state="selected"` for selected rows. Cell padding uses `--table-cell-padding-y` and `--table-cell-padding-x`.
|
|
160
|
+
|
|
161
|
+
A chart series element sets `--series-color`, falling back to `--chart-1`. `data-series="1"` through `"8"` map the existing `--chart-1` to `--chart-8` palette. The author supplies SVG geometry, accessible names and interaction.
|
|
162
|
+
|
|
163
|
+
Document typography uses the shared type, spacing and line-height variables. Inline code and code blocks use `--code-bg`, `--code-bg-deep` and `--code-ink`; `kbd` uses the control surface and border. Native tables and `md-table` share cell padding and borders. Specialized widgets keep their own appearance.
|
|
164
|
+
|
|
165
|
+
Every new skin is scoped to `.md-document`. Base and state selector bodies use `:where()` for zero specificity; pseudo-elements follow that body. The new skins add no `!important`. An ordinary component class overrides any property it declares in either stylesheet order. `[data-rmd-appearance="custom"]` opts out only the element it marks; descendants keep their skin. Hidden elements stay hidden. Print keeps native control values and the existing built-in print summaries.
|
|
166
|
+
|
|
167
|
+
## Density
|
|
168
|
+
|
|
169
|
+
`data-rmd-density="compact"` or `"comfortable"` on the document root or a subtree adjusts control height and table cell padding through the shared variables. Components and themes override individual sizes as usual.
|
|
170
|
+
|
|
99
171
|
## Component CSS and acceptance
|
|
100
172
|
|
|
101
173
|
Themes can supplement variable overrides with existing `.md-*` and `.local-*` component classes. Root classes, component outer classes and semantic state attributes are styling interfaces; internal node ordering is not an extension API. Load scoped theme rules after the shared stylesheet, using sufficiently specific root and component selectors instead of relying on `!important`.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# 严格模式与局部恢复
|
|
2
|
+
|
|
3
|
+
**中文** · [English](tolerance-en.md)
|
|
4
|
+
|
|
5
|
+
`strict` 控制单次编译、旧 `compileLocal`、编辑会话和 Worker 的结构恢复行为。默认值为 `true`;省略和显式 `undefined` 使用相同默认值。其他非布尔值是配置错误。
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createStandardCompiler } from 'reactive-md/compiler/standard';
|
|
9
|
+
|
|
10
|
+
const compiler = createStandardCompiler({ strict: false });
|
|
11
|
+
const result = compiler.compile(`前文。
|
|
12
|
+
|
|
13
|
+
<alert>
|
|
14
|
+
尚未闭合的内容 {{ missing }}。
|
|
15
|
+
|
|
16
|
+
## 后续章节
|
|
17
|
+
|
|
18
|
+
这里的 **Markdown** 继续渲染。
|
|
19
|
+
`);
|
|
20
|
+
|
|
21
|
+
if (result.status === 'recovered') {
|
|
22
|
+
console.log(result.diagnostics, result.recoveries, result.program.nodes);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
宽松模式将 `<alert>` 起到后续同层标题前的片段保留为原始文本。片段中的组件、插值和声明不执行;后面的章节照常编译。源码本身不被改写。
|
|
27
|
+
|
|
28
|
+
恢复遵循以下边界:
|
|
29
|
+
|
|
30
|
+
- 完整配对优先。合法组件可以跨越标题,内部标题不会截断它。
|
|
31
|
+
- 孤立结束标签只降级该标签。外层容器能正常闭合时,未闭合的内层片段降级到外层结束标签之前。
|
|
32
|
+
- 起始标签完整且找不到闭合时,可以在前有空行、处于相同 Markdown 容器的 ATX 标题前继续解析。代码、注释、原始 HTML 文本及未结束引号中的标题不能作为边界。
|
|
33
|
+
- 普通段落、空行和兄弟组件不是同步点。找不到可靠标题或起始标签词法未结束时,降级到可靠外层边界或文件末尾。
|
|
34
|
+
|
|
35
|
+
恢复记录包含 `code`、`causeRange`、`affectedRange`、`action` 和 `boundary`。范围使用原始源码的 UTF-16 半开区间 `[start, end)`;`source.slice(start, end)` 得到实际片段。记录稳定排序并去重。
|
|
36
|
+
|
|
37
|
+
每个最终恢复还在 `causeRange` 上产生至多一个 warning,使用与记录相同的稳定 `code`:`local.recovery.unclosed`、`local.recovery.mismatch`、`local.recovery.stray-close`、`local.html.repair` 或 `local.html.literal`。warning 说明该片段被降级为惰性源文本或经过 HTML 修复,恢复不会静默发生。行号和列号按原始 UTF-16 源码计算;不会逐 token 产生 warning。诊断预算仍生效:预算已满时可以省略 warning,记录仍保留在 `recoveries` 中。恢复不向正文插入错误块。
|
|
38
|
+
|
|
39
|
+
绑定、计算循环、初值、组件必填属性和形态错误仍是 error,并使编译失败;恢复不会全局降级这些错误。版本、配置和预算错误同样保留。正常区域引用已降级片段内的声明时,该引用仍是未知绑定错误。失败结果可保留此前完成的恢复记录、这些恢复的 warning,以及导致失败的其他 error。
|
|
40
|
+
|
|
41
|
+
## HTML 与 details
|
|
42
|
+
|
|
43
|
+
宽松模式在已确定的局部 HTML 片段内使用 parse5 处理省略标签、错配和合成节点。修复继续服从原有元素、属性和 URL 策略,`strict: false` 不授予脚本、CSS 或扩展 HTML 权限。修复后的片段产生一条 `local.html.repair` warning。无法保留混合 RMD 归属和源范围的片段整体显示为文本,并产生一条 `local.html.literal` warning。合成节点带有 `synthetic` 与 `syntheticBoundary`,不会虚构原始标签位置。
|
|
44
|
+
|
|
45
|
+
两种模式均支持以下无空行写法:
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<details>
|
|
49
|
+
<summary>1145</summary>
|
|
50
|
+
1145
|
|
51
|
+
</details>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
它呈现为一个空标题 accordion 内的单个 disclosure:按钮标题为 `1145`,面板正文为 `1145`。默认折叠,点击、Enter 和空格可切换;`open` 属性使初始状态展开,静态呈现显示正文。富文本 summary 和嵌套 details 保留各自内容。
|
|
55
|
+
|
|
56
|
+
## 结果与宿主
|
|
57
|
+
|
|
58
|
+
新工厂的成功结果包含 `status: 'valid' | 'recovered'`、深只读且逐层冻结的 `program`、`diagnostics`、`recoveries` 和可选检查覆盖 `checks`。`valid` 不包含恢复 warning;`recovered` 包含 program 和每个恢复对应的 warning。失败为 `status: 'failed'`,不包含 program;可保留此前完成的恢复记录及其 warning。无法恢复的语义、类型、绑定、选项、版本和预算错误仍为 error。任务 1 的 `ok`、`document` 读取方式继续可用,document 是独立的普通数据副本。
|
|
59
|
+
|
|
60
|
+
旧 `compileLocal` 保留原有返回类型,并在有恢复时附加 `recoveries`。默认严格结果保持既有字段形状。运行时、SSR 和 standalone 接收同一源码对应的编译结果;导出选项保留所选 strict 模式,重新挂载时使用同一模式。
|
|
61
|
+
|
|
62
|
+
编辑会话在宽松模式下使用完整参考路径,避免复用跨越恢复边界的旧块;恢复策略版本 2 与 strict 模式参与配置身份。严格模式保留现有优化。Demo 和编辑器默认仍为严格模式;Demo 的宽松预览默认设置和作者检查面板属于后续宿主阶段。
|
|
63
|
+
|
|
64
|
+
参见[单次编译入口](../integration/compiler-ch.md)和 [HTML 兼容](html-compatibility-ch.md)。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Strict parsing and local recovery
|
|
2
|
+
|
|
3
|
+
**English** · [中文](tolerance-ch.md)
|
|
4
|
+
|
|
5
|
+
The `strict` option controls structural recovery in compiler factories, `compileLocal`, editing sessions and Workers. It defaults to `true`; omission and explicit `undefined` use the same default. Other non-boolean values are configuration errors.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createStandardCompiler } from 'reactive-md/compiler/standard';
|
|
9
|
+
|
|
10
|
+
const compiler = createStandardCompiler({ strict: false });
|
|
11
|
+
const result = compiler.compile(`<alert>
|
|
12
|
+
Unfinished content {{ missing }}.
|
|
13
|
+
|
|
14
|
+
## Next section
|
|
15
|
+
|
|
16
|
+
This **Markdown** still renders.
|
|
17
|
+
`);
|
|
18
|
+
|
|
19
|
+
if (result.status === 'recovered') {
|
|
20
|
+
console.log(result.diagnostics, result.recoveries, result.program.nodes);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Loose mode keeps the damaged region as original source text. Components, expressions and declarations inside it stay inert. Compilation resumes at the next reliable boundary without rewriting the source.
|
|
25
|
+
|
|
26
|
+
Complete pairs take priority, including components whose bodies cross headings. A stray closing tag becomes literal text by itself. An outer closing tag can terminate an intact outer container while its unclosed inner fragment becomes text. An unmatched, lexically complete opener can recover before an ATX heading with a preceding blank line in the same Markdown container. Code, comments, raw HTML text and unfinished attribute quotes do not supply heading boundaries. Ordinary paragraphs, blank lines and sibling components are not synchronization points; without a reliable heading, recovery extends to the outer boundary or end of file.
|
|
27
|
+
|
|
28
|
+
Each recovery records `code`, `causeRange`, `affectedRange`, `action` and `boundary`. Ranges are half-open UTF-16 offsets into the original source. Records are sorted and deduplicated.
|
|
29
|
+
|
|
30
|
+
Each finalized recovery also produces at most one warning at `causeRange`, with the same stable code: `local.recovery.unclosed`, `local.recovery.mismatch`, `local.recovery.stray-close`, `local.html.repair` or `local.html.literal`. The message states what was repaired or kept as literal text, so recovery is never silent. Line and column use the raw UTF-16 source. Warnings are not emitted per token. The existing diagnostics budget applies: when it is full, a warning may be omitted while the recovery record remains in `recoveries`. Recovery inserts no error block in the document body.
|
|
31
|
+
|
|
32
|
+
Binding errors, computation cycles, invalid initial values, required component attributes and component shape errors remain errors and still fail compilation; recovery does not downgrade them globally. Configuration, version and budget errors also remain fatal. References outside a literal region to declarations removed inside it remain unknown bindings. A failed result can retain recoveries completed before the failure, their warnings and the separate error that caused failure.
|
|
33
|
+
|
|
34
|
+
## HTML and details
|
|
35
|
+
|
|
36
|
+
Loose mode repairs omitted or mismatched HTML tags within an isolated fragment using parse5. The existing element, attribute and URL policies still apply; loose mode grants no script, CSS or extended HTML capability. A repaired fragment yields one `local.html.repair` warning. A mixed RMD fragment becomes literal text with one `local.html.literal` warning when ownership and source ranges cannot be preserved. Synthetic nodes carry `synthetic` and `syntheticBoundary` metadata.
|
|
37
|
+
|
|
38
|
+
Both modes support a details element without blank lines:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<details>
|
|
42
|
+
<summary>1145</summary>
|
|
43
|
+
1145
|
|
44
|
+
</details>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
It renders as a single disclosure in an accordion with no group title. The trigger is `1145` and the panel contains `1145`. It starts collapsed; click, Enter and Space toggle it. Boolean `open` starts it expanded, and static output exposes the body. Rich summaries and nested details retain their content.
|
|
48
|
+
|
|
49
|
+
## Results and hosts
|
|
50
|
+
|
|
51
|
+
Factory success results include `status: 'valid' | 'recovered'`, a deeply frozen `program`, diagnostics, recoveries and optional-check coverage in `checks`. A `valid` success has no recovery warning. A `recovered` success includes the program and one warning per recovery. Failures use `status: 'failed'` and contain no program; they may retain recoveries completed before the failure and their warnings. Unrecoverable semantic, type, binding, options, version and budget errors remain errors. Task-one `ok` and `document` aliases remain available; document is a separate plain-data copy.
|
|
52
|
+
|
|
53
|
+
`compileLocal` keeps its existing result type and adds `recoveries` only when present. Strict results retain their historical field shape. Export options preserve the selected mode so standalone replay compiles the same source with that mode.
|
|
54
|
+
|
|
55
|
+
Loose editing sessions use the full reference path to avoid reusing blocks across recovery boundaries. Strict mode keeps its existing optimizations. Configuration identity includes strict mode and recovery strategy version 2. Demo and editor defaults remain strict; Demo preview defaults and author checks belong to a later host phase.
|
|
56
|
+
|
|
57
|
+
See [one-shot compilation](../integration/compiler-en.md) and [HTML compatibility](html-compatibility-en.md).
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.4.0 预览与迁移
|
|
2
2
|
|
|
3
|
+
**中文** · [English](release-0.4.0-en.md)
|
|
4
|
+
|
|
3
5
|
状态:同时提供于 `latest` 和 `next` 渠道的 0.x 预览版。包版本 `0.4.0`,语法修订 `local-draft-2`,组块协议 `component-protocol-1`,主题协议 `reactive-md-theme-1`。这些是彼此独立的版本轴;`local-draft-2`、`component-protocol-1` 和 `reactive-md-theme-1` 都不是包版本。
|
|
4
6
|
|
|
5
7
|
使用 `npm install reactive-md` 安装,或用 `npm install reactive-md@0.4.0` 固定版本。`latest` 和 `next` 均指向 `0.4.0`。
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.4.0 preview and migration
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.4.0-ch.md)
|
|
4
|
+
|
|
3
5
|
Status: 0.x preview available on both `latest` and `next`. Package version `0.4.0`, syntax revision `local-draft-2`, component protocol `component-protocol-1`, theme protocol `reactive-md-theme-1`. These are separate version axes; `local-draft-2`, `component-protocol-1` and `reactive-md-theme-1` are not package versions.
|
|
4
6
|
|
|
5
7
|
Install with `npm install reactive-md`, or pin it with `npm install reactive-md@0.4.0`. Both `latest` and `next` resolve to `0.4.0`.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.5.0 preview release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.5.0-ch.md)
|
|
4
|
+
|
|
3
5
|
`reactive-md@0.5.0` is a 0.x preview that targets the `next` channel. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-1` and theme protocol `reactive-md-theme-1`. Existing 0.4.x imports and documents need no migration. `latest` remains `0.4.0`.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.5.1 preview release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.5.1-ch.md)
|
|
4
|
+
|
|
3
5
|
`reactive-md@0.5.1` is a 0.x preview that targets the `next` channel. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-1` and theme protocol `reactive-md-theme-1`. Existing 0.5.x imports and documents need no migration. `latest` remains `0.4.0`.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.5.2 preview release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.5.2-ch.md)
|
|
4
|
+
|
|
3
5
|
`reactive-md@0.5.2` is a 0.x preview that targets the `next` channel. It keeps syntax revision `local-draft-2` and theme protocol `reactive-md-theme-1`, and raises the component protocol to `component-protocol-2` for the host component extension axis. Existing 0.5.x imports and documents need no migration. `latest` remains `0.4.0`.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.5.3 preview release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.5.3-ch.md)
|
|
4
|
+
|
|
3
5
|
Install with `npm install reactive-md@0.5.3` or `npm install reactive-md@next`. This preview keeps syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1`. The `latest` channel remains `0.4.0`.
|
|
4
6
|
|
|
5
7
|
## Host integration
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.6.0 release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.6.0-ch.md)
|
|
4
|
+
|
|
3
5
|
`reactive-md@0.6.0` is a 0.x preview that updates both `latest` and `next`. It keeps syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1`. Existing imports and documents need no migration.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 0.6.1 release
|
|
2
2
|
|
|
3
|
+
**English** · [中文](release-0.6.1-ch.md)
|
|
4
|
+
|
|
3
5
|
`reactive-md@0.6.1` replaces native MathML formula display with KaTeX. It updates both `latest` and `next`. Syntax revision `local-draft-2`, component protocol `component-protocol-2` and theme protocol `reactive-md-theme-1` stay unchanged.
|
|
4
6
|
|
|
5
7
|
```sh
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# 0.7.0 发布说明
|
|
2
|
+
|
|
3
|
+
**中文** · [English](release-0.7.0-en.md)
|
|
4
|
+
|
|
5
|
+
`reactive-md@0.7.0` 同时更新 `latest` 与 `next`,是首个随包发布公开扩展 SDK、`local-draft-3` 语法修订和 CM6 单一编辑器入口的版本,并包含一轮大规模的编译与渲染性能优化。现有导入继续可用;显式声明旧修订的文档,以及使用已删除编辑器字段的宿主,需要按下文迁移。
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install reactive-md
|
|
9
|
+
# 或固定版本
|
|
10
|
+
npm install reactive-md@0.7.0
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
离线安装可使用 [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.7.0.tgz)。
|
|
14
|
+
|
|
15
|
+
## 语法:local-draft-3
|
|
16
|
+
|
|
17
|
+
本版本只接受 `local-draft-3`。没有修订指令的源码继续按当前修订读取;显式声明 `local-draft-1` 或 `local-draft-2` 会得到 `local.version.*` 诊断,声明旧修订不会选择旧解析器。
|
|
18
|
+
|
|
19
|
+
- 新增 `<external name="..." type="...">` 只读声明。正文、条件、图表和计算可以读取宿主通过 `LocalReactiveDocument` 的 `externalValues` 或 `runtime.setExternalValues()` 提供的值。缺失值只让读取它的表达式失败,不会被转换为 `0`、`false` 或空字符串。
|
|
20
|
+
- `number`、`slider`、`date`、`input` 和 `textarea` 支持动态 `min`、`max` 与 `required`。约束在写入值和显示控件时检查;范围收窄时保留已存值并显示约束错误,不会静默截断。
|
|
21
|
+
- 共享绑定必须声明相同的静态范围和步长;边界为动态时,表达式也必须相同。日期边界和 `required` 遵循同一规则。
|
|
22
|
+
- 可选修订指令仍为一行:`<!-- reactive-md: local-draft-3 -->`。`inspectLocalSourceVersion`、`checkLocalUpgrade` 和 `migrateLocalSource` 在编译器外提供同样的检查,`reactive-md migrate` 负责单份源码的元数据迁移并阻止正文级冲突。
|
|
23
|
+
- 从 `local-draft-2` 迁移时,新激活的 `<external>` 标签会被阻止。迁移前先把字面示例放进代码块;迁移器不改写正文。
|
|
24
|
+
|
|
25
|
+
## 扩展 SDK
|
|
26
|
+
|
|
27
|
+
`0.7.0` 正式发布此前只能从源码 tarball 使用的 SDK 入口:
|
|
28
|
+
|
|
29
|
+
| 入口 | 用途 |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `reactive-md/sdk` | manifest、配置、主题与版本契约 |
|
|
32
|
+
| `reactive-md/vite` | Vite 适配器、虚拟宿主、样式加载与依赖去重 |
|
|
33
|
+
| `reactive-md/react` | 渲染器,以及 `defineReactComponent`、`createReactConfig`、`createReactHost` |
|
|
34
|
+
| `reactive-md/build` | 资源收集与独立包构建 |
|
|
35
|
+
| `reactive-md/testing`、`/testing/react`、`/testing/browser` | manifest、行为、SSR 与浏览器合规工具 |
|
|
36
|
+
| `reactive-md/authoring` | 不含 React 与 CSS 的 schema、目录和编辑器工具 |
|
|
37
|
+
| `reactive-md/export` | 可分享 HTML 与状态恢复 |
|
|
38
|
+
| `reactive-md/react/server` | 严格静态渲染 |
|
|
39
|
+
| `reactive-md/standalone` | 浏览器挂载 API |
|
|
40
|
+
|
|
41
|
+
`defineLocalComponent`、`defineReactComponentPackage`、`createLocalConfig`、`createReactConfig`、`createReactHost`、`defineLocalTheme` 与 `composeLocalTheme` 组成作者路径。Vite 适配器读取一份注册模块,统一配置样式、依赖去重和离线运行时。组件包可以声明样式、作者信息、依赖、能力与资源;编辑器目录、预览和离线导出共用同一份注册。
|
|
42
|
+
|
|
43
|
+
`component-protocol-3` 新增宿主 inline/container 形态与标量绑定。默认预设的 46 个组件与外部组件使用同一个公开校验器和契约。版本范围写 `^0.7.0`,依赖项使用 `{ id, version }`。
|
|
44
|
+
|
|
45
|
+
旧版 `hostComponents`、`hostRenderer` 和 `hostData` 仍可用于迁移。旧注册不能与新配置混用;请按 [SDK 迁移指南](../integration/extension-sdk-ch.md) 迁移后再重建离线包。
|
|
46
|
+
|
|
47
|
+
## 编辑器与作者工具
|
|
48
|
+
|
|
49
|
+
`reactive-md/editor` 现在只使用 CodeMirror 6;`reactive-md/editor/codemirror` 保留为同一组件、样式和运行时的别名。textarea 编辑器及其 `textareaRef`、`getTextarea` 已移除。使用 ref 的 `getSource()`、`getSelection()`、`selectRange()` 和 `getEditorElement()` 访问源码与 DOM。文档中的 `<textarea>` 表单组件继续受支持。
|
|
50
|
+
|
|
51
|
+
作者菜单改为从组件 manifest 派生,外部组件包会带着标题、分类、说明和插入模板进入编辑器目录。本轮还新增预览到源码的定位,并修复输入法提交、换行与选区保留,以及面板滚动同步。
|
|
52
|
+
|
|
53
|
+
## 性能
|
|
54
|
+
|
|
55
|
+
本版本包含 2026-10-29 测量的增量编译与编辑优化:
|
|
56
|
+
|
|
57
|
+
- 块级会话只编译变化的块,其余块复用。
|
|
58
|
+
- 大列表和表格复用行计划与未修改行的节点身份;移位后的 UTF-16 范围保持准确。
|
|
59
|
+
- Worker 在补丁成本高于刷新时直接返回同一修订的完整成功结果,保留协商后的修订链,并为深层结构协商扁平结果格式。
|
|
60
|
+
- 深层容器改用迭代遍历并提前终止预算;超过 100 层的组件和超过 1,000 层的 Markdown 会在重活开始前被拒绝。
|
|
61
|
+
- 600 节文章从完整编译 282 ms 降到增量会话 62 ms,仅编译 1 块、复用 1,799 块。
|
|
62
|
+
- 500 行动态表格从输入到预览 286 ms 降到 134 ms。
|
|
63
|
+
- 1,000 项动态列表连续编辑 500 次后,GC 后堆增长约 0.463 MiB。
|
|
64
|
+
- 100 万字符纯文本文档首次编译 12.26 ms,稳态中位数 5.15 ms。
|
|
65
|
+
|
|
66
|
+
完整的场景矩阵、回归项、内存检查、预算和复现命令见[性能总览](../development/performance-overview-ch.md)。
|
|
67
|
+
|
|
68
|
+
## Demo 与示例包
|
|
69
|
+
|
|
70
|
+
Demo 改为从 `demo/vendor/` 安装 Tetris 与 2048 的 npm tarball,通过公开入口读取实现与 notices,并在生产与开发模式下验证两个包。由于组件名必须以字母开头,2048 使用 `<game-2048>` 标签。仓库同时提供组件包模板、独立接入示例和更新后的插件开发指南。
|
|
71
|
+
|
|
72
|
+
## 兼容性
|
|
73
|
+
|
|
74
|
+
- 包版本:`0.7.0`;`latest` 与 `next` 都指向此版本。
|
|
75
|
+
- 语法修订:`local-draft-3`;组块协议 `component-protocol-3`;主题协议 `reactive-md-theme-1` 保持不变。
|
|
76
|
+
- 显式声明 `local-draft-1` 或 `local-draft-2` 的文档会被拒绝。使用 `reactive-md migrate` 迁移,或继续用旧包版本渲染。
|
|
77
|
+
- 新激活的 `<external>` 标签和动态约束可能改变原本按字面显示的源码。请把字面示例移入行内代码或代码围栏。
|
|
78
|
+
- `LOCAL_SDK_VERSION` 改变配置键。携带旧 `componentConfigKey` 的文档会报告 `local.extension.config-mismatch`,需要用已安装的配置重新编译。
|
|
79
|
+
- 编辑器 textarea ref 字段已移除,请改用上述编辑器 ref API。
|
|
80
|
+
- 持久化原始 `.reactive.md` 源码,不要持久化运行时 AST 或内存状态。迁移会改变源码摘要,迁移后应重新导出 `reactive-md-state/v1` 文件。
|
|
81
|
+
|
|
82
|
+
## 验证与限制
|
|
83
|
+
|
|
84
|
+
本版本使用完整的 `npm run verify:release` 门禁:核心与 Demo 测试、类型检查、构建、第三方 notices、包入口、文档链接、仓库外真实 tarball 消费及浏览器交互。CI 在 Node 22.12 与 24 上运行 Node 门禁;浏览器门禁在 Chromium 上运行完整套件,并在 Firefox/WebKit 上运行核心工作流。本机浏览器检查使用 Microsoft Edge。Firefox 与 WebKit 的完整交互套件,以及导出 HTML 之外的通用 SSR 水合仍未验证。
|
|
85
|
+
|
|
86
|
+
项目仍处于 0.x 预览阶段。安全边界与宿主责任见 [SECURITY.md](../../SECURITY.md)。
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# 0.7.0 release
|
|
2
|
+
|
|
3
|
+
**English** · [中文](release-0.7.0-ch.md)
|
|
4
|
+
|
|
5
|
+
`reactive-md@0.7.0` moves both `latest` and `next` to the first release that ships the public extension SDK, the `local-draft-3` syntax revision and the CM6-only editor. It also includes a large compilation and rendering performance round. Existing imports keep working, but documents with an explicit older revision and host integrations using removed editor fields need the migration steps below.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install reactive-md
|
|
9
|
+
# or pin the version
|
|
10
|
+
npm install reactive-md@0.7.0
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For offline installation, use the [npm tarball](https://registry.npmjs.org/reactive-md/-/reactive-md-0.7.0.tgz).
|
|
14
|
+
|
|
15
|
+
## Syntax: local-draft-3
|
|
16
|
+
|
|
17
|
+
`local-draft-3` is the only accepted revision in this build. Sources without a revision directive keep current-revision behavior. An explicit `local-draft-1` or `local-draft-2` declaration is rejected with a `local.version.*` diagnostic, and an old declaration does not select an old parser.
|
|
18
|
+
|
|
19
|
+
- Add `<external name="..." type="...">` read-only declarations. Text, conditions, charts and calculations may read host values supplied through `externalValues` on `LocalReactiveDocument` or `runtime.setExternalValues()`. A missing value fails only the expressions that read it; it is never converted to `0`, `false` or an empty string.
|
|
20
|
+
- Add dynamic `min`, `max` and `required` constraints on `number`, `slider`, `date`, `input` and `textarea`. Constraints are checked when a value is written and when the control is displayed. Narrowing a range keeps the stored value and shows a constraint error instead of clamping it.
|
|
21
|
+
- Shared bindings must declare the same static range and step and, when a bound is dynamic, the same expression. Date bounds and `required` follow the same rule.
|
|
22
|
+
- The optional prologue directive remains one line: `<!-- reactive-md: local-draft-3 -->`. `inspectLocalSourceVersion`, `checkLocalUpgrade` and `migrateLocalSource` expose the check outside the compiler, and `reactive-md migrate` moves one source's metadata and blocks body-level conflicts.
|
|
23
|
+
- Migration from `local-draft-2` blocks newly active `<external>` tags. Preserve literal examples as code before migrating; the migrator does not rewrite the body.
|
|
24
|
+
|
|
25
|
+
## Extension SDK
|
|
26
|
+
|
|
27
|
+
The `0.7.0` package publishes the SDK entries that were previously available only from a source-built tarball:
|
|
28
|
+
|
|
29
|
+
| Entry | Purpose |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `reactive-md/sdk` | Manifests, configuration, themes and version contracts |
|
|
32
|
+
| `reactive-md/vite` | Vite adapter, virtual host, style loading and deduplication |
|
|
33
|
+
| `reactive-md/react` | Renderer plus `defineReactComponent`, `createReactConfig` and `createReactHost` |
|
|
34
|
+
| `reactive-md/build` | Resource collection and standalone bundle builds |
|
|
35
|
+
| `reactive-md/testing`, `/testing/react`, `/testing/browser` | Manifest, behavior, SSR and browser compliance |
|
|
36
|
+
| `reactive-md/authoring` | Schema, catalog and editor helpers without React or CSS |
|
|
37
|
+
| `reactive-md/export` | Shareable HTML and state restoration |
|
|
38
|
+
| `reactive-md/react/server` | Strict static rendering |
|
|
39
|
+
| `reactive-md/standalone` | Browser mount APIs |
|
|
40
|
+
|
|
41
|
+
`defineLocalComponent`, `defineReactComponentPackage`, `createLocalConfig`, `createReactConfig`, `createReactHost`, `defineLocalTheme` and `composeLocalTheme` form the authoring path. The Vite adapter reads one registration module and configures styles, dependency deduplication and the offline runtime. Component packages can declare styles, authoring metadata, dependencies, capabilities and resources; the editor catalog, preview and offline export consume the same registration.
|
|
42
|
+
|
|
43
|
+
`component-protocol-3` adds host inline and container forms and scalar bindings. The default preset's 46 components use the same public validator and contract as external components. Version ranges name `^0.7.0`; dependencies use `{ id, version }`.
|
|
44
|
+
|
|
45
|
+
Legacy `hostComponents`, `hostRenderer` and `hostData` remain available for migration. Combining legacy registration with the new configuration is rejected. Migrate through the [SDK migration guide](../integration/extension-sdk-en.md) before rebuilding bundles.
|
|
46
|
+
|
|
47
|
+
## Editor and authoring
|
|
48
|
+
|
|
49
|
+
CodeMirror 6 is now the only source editor at `reactive-md/editor`; `reactive-md/editor/codemirror` remains an alias for the same component, stylesheet and runtime. The textarea editor and its `textareaRef` / `getTextarea` fields are removed. Use the ref's `getSource()`, `getSelection()`, `selectRange()` and `getEditorElement()` for source and DOM access. Document `<textarea>` form controls remain supported.
|
|
50
|
+
|
|
51
|
+
Authoring menus now derive from component manifests, so external packages appear in the editor catalog with their titles, categories, descriptions and insertion templates. The round also adds preview-to-source navigation and fixes composition commits, preserved line breaks and selections, and pane scroll synchronization.
|
|
52
|
+
|
|
53
|
+
## Performance
|
|
54
|
+
|
|
55
|
+
This release includes the incremental-compilation and editing work measured on 2026-10-29:
|
|
56
|
+
|
|
57
|
+
- Block-level sessions compile only changed blocks and reuse the rest.
|
|
58
|
+
- Large lists and tables reuse row plans and unchanged node identities; shifted UTF-16 ranges stay accurate.
|
|
59
|
+
- The Worker returns a complete successful result when a patch costs more than a refresh, retains the negotiated revision chain, and negotiates a flat result format for deep trees.
|
|
60
|
+
- Deep containers use iterative traversal and earlier budget termination; component nesting above 100 levels and Markdown above 1,000 levels is rejected before heavy work.
|
|
61
|
+
- A 600-section article drops from 282 ms full compilation to 62 ms incremental session editing, with 1 block compiled and 1,799 reused.
|
|
62
|
+
- A 500-row dynamic table improves from 286 ms to 134 ms input-to-preview.
|
|
63
|
+
- A 1,000-item dynamic list retains about 0.463 MiB of post-GC heap growth after 500 consecutive edits.
|
|
64
|
+
- A 1,000,000-character plain document compiles in 12.26 ms on first call and 5.15 ms steady median.
|
|
65
|
+
|
|
66
|
+
See the [performance overview](../development/performance-overview-en.md) for the full matrix, regressions, memory checks, budgets and reproduction commands.
|
|
67
|
+
|
|
68
|
+
## Demo and example packages
|
|
69
|
+
|
|
70
|
+
The Demo now consumes Tetris and 2048 as installed npm tarballs from `demo/vendor/`, reads implementations and notices through public entries, and verifies both packages in production and development modes. The `2048` package uses the `<game-2048>` tag because component names must start with a letter. The repository also ships the component package template, standalone integration examples and the updated plugin development guides.
|
|
71
|
+
|
|
72
|
+
## Compatibility
|
|
73
|
+
|
|
74
|
+
- Package version: `0.7.0`; `latest` and `next` both point here.
|
|
75
|
+
- Syntax revision: `local-draft-3`; `component-protocol-3`; theme protocol `reactive-md-theme-1` is unchanged.
|
|
76
|
+
- Explicit `local-draft-1` and `local-draft-2` declarations are rejected. Migrate them with `reactive-md migrate` or keep rendering them with the old package version.
|
|
77
|
+
- Newly active `<external>` tags and dynamic constraints may change how previously literal source is parsed. Move literal examples into code spans or fences.
|
|
78
|
+
- `LOCAL_SDK_VERSION` changes the configuration key. Documents that carry an old `componentConfigKey` report `local.extension.config-mismatch` and must be recompiled with the installed configuration.
|
|
79
|
+
- The editor textarea ref fields are removed; use the editor ref APIs above.
|
|
80
|
+
- Persist original `.reactive.md` sources, not runtime ASTs or in-memory state. Migration changes the source digest, so export a fresh `reactive-md-state/v1` file after migrating.
|
|
81
|
+
|
|
82
|
+
## Validation and limits
|
|
83
|
+
|
|
84
|
+
The release uses the full `npm run verify:release` gate: core and Demo tests, type checking, builds, third-party notices, package entries, documentation links, real tarball consumption outside the repository and browser interaction. CI runs the Node gate on Node 22.12 and 24; the browser gate runs the full suite on Chromium and core workflows on Firefox and WebKit. Local browser checks use Microsoft Edge. The full Firefox and WebKit interaction suites and general SSR hydration outside exported HTML remain unverified.
|
|
85
|
+
|
|
86
|
+
The project remains a 0.x preview. Security boundaries and host responsibilities are documented in [SECURITY.md](../../SECURITY.md).
|