reactive-md 0.8.0 → 0.9.1
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 +54 -4
- package/CHANGELOG.md +55 -4
- package/CONTRIBUTING-ch.md +13 -2
- package/CONTRIBUTING.md +13 -2
- package/README-ch.md +132 -23
- package/README-en.md +130 -21
- package/README.md +128 -21
- package/SECURITY-ch.md +3 -3
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +111 -1
- package/cli/args.mjs +51 -1
- package/cli/assets.mjs +6 -1
- package/cli/build.mjs +125 -9
- package/cli/fs-utils.mjs +3 -3
- package/cli/help.mjs +12 -5
- package/cli/init.mjs +1 -1
- package/cli/package.mjs +1 -0
- package/dist-library/LocalDocumentView-sthUP0ct.js +109 -0
- package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
- package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
- package/dist-library/{authoring-BsfSwQRm.js → authoring-Dsune4Hy.js} +240 -218
- package/dist-library/compile-wUv8KEge.js +1249 -0
- package/dist-library/{compiler-core-kPiH-gOV.js → compiler-core-As_m-MNm.js} +5372 -5559
- package/dist-library/compiler-eOfcinZs.js +62 -0
- package/dist-library/component-state-BoLCGee4.js +801 -0
- package/dist-library/{component-state-D_cw_EHe.js → component-state-C52ZFJGl.js} +2 -2
- package/dist-library/{registry-B9Jc3FVe.js → config-BadfhjdP.js} +374 -457
- package/dist-library/{config-validation-DXTynAw7.js → config-validation-F47AcE6o.js} +549 -751
- package/dist-library/controls-CcT6n7k_.js +6740 -0
- package/dist-library/coordinate-CWS9p5q_.js +293 -0
- package/dist-library/data-table-Bgccxd7h.js +296 -0
- package/dist-library/{default-components-Z_YMio5P.js → default-components-BwQf0oP-.js} +344 -334
- package/dist-library/{math-display-BJz4gbFc.js → display-B-VhqVND.js} +1299 -1299
- package/dist-library/export-BqVmTXm8.js +369 -0
- package/dist-library/gallery-CY6mTx8i.js +360 -0
- package/dist-library/html-CNT4KD-2.js +757 -0
- package/dist-library/{math-sample-BGEW49zY.js → incremental-Dv0FSp_U.js} +476 -394
- package/dist-library/latex-1w7aQgD5.js +928 -0
- package/dist-library/layout-C0YlEPGr.js +562 -0
- package/dist-library/mount-preset-KxvtKgJb.js +13 -0
- package/dist-library/options-1aDLK7JY.js +121 -0
- package/dist-library/{react-ByOHunUW.js → package-core-WFK1RhAZ.js} +49 -55
- package/dist-library/{parser-standard-DlCk7sLo.js → parser-standard-Yuf3A_VI.js} +6605 -7097
- package/dist-library/plugin-packs-B1XPWcFs.js +18 -0
- package/dist-library/{identity-MYJXKSkB.js → preset-core-CKc5YXSM.js} +31 -31
- package/dist-library/{props-DGlBk0e5.js → props-sJ8vk0cr.js} +1 -1
- package/dist-library/react-BbyAgeXc.js +6070 -0
- package/dist-library/react-D5iGiUdL.js +7 -0
- package/dist-library/reactive-md-authoring.js +222 -223
- package/dist-library/reactive-md-build.js +126 -72
- package/dist-library/reactive-md-compiler-standard.js +12 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-default-packs.js +2 -2
- package/dist-library/reactive-md-default-preset.js +4 -4
- package/dist-library/reactive-md-export-assets.js +57 -0
- package/dist-library/reactive-md-export.js +5 -111
- package/dist-library/reactive-md-minimal-preset.js +24 -0
- package/dist-library/reactive-md-minimal-react-preset.js +26 -0
- package/dist-library/reactive-md-minimal-styles.js +80 -0
- package/dist-library/reactive-md-minimal.css +2 -0
- package/dist-library/reactive-md-pdf.js +7582 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -0
- package/dist-library/reactive-md-plugin-data.js +17 -0
- package/dist-library/reactive-md-plugin-diagram.js +18 -0
- package/dist-library/reactive-md-plugin-forms.js +18 -0
- package/dist-library/reactive-md-plugin-gallery.js +12 -0
- package/dist-library/reactive-md-plugin-navigation.js +15 -0
- package/dist-library/reactive-md-plugin-network.js +222 -0
- package/dist-library/reactive-md-plugin-plot.js +24 -0
- package/dist-library/reactive-md-print.css +5 -0
- package/dist-library/reactive-md-react-minimal.js +28 -0
- package/dist-library/reactive-md-react-server.js +34 -32
- package/dist-library/reactive-md-react-unstyled.js +14 -9
- package/dist-library/reactive-md-react.js +14 -9
- package/dist-library/reactive-md-runtime-browser.js +847 -15
- package/dist-library/reactive-md-runtime.js +3 -3
- package/dist-library/reactive-md-sdk.js +8 -6
- package/dist-library/reactive-md-standalone-configured.js +16 -0
- package/dist-library/reactive-md-standalone-host.js +9 -438
- package/dist-library/reactive-md-testing-browser.js +5 -4
- package/dist-library/reactive-md-testing-react.js +46 -44
- package/dist-library/reactive-md-testing.js +45 -44
- package/dist-library/reactive-md-vite.js +135 -37
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +590 -498
- package/dist-library/registry-B9NGct4d.js +20 -0
- package/dist-library/registry-core-Bbad9Bm2.js +479 -0
- package/dist-library/{resources-BGt8mpDA.js → resources-D2GDQS0p.js} +45 -45
- package/dist-library/{runtime-Dkq7ldyg.js → runtime-B2fxeveq.js} +1 -1
- package/dist-library/runtime-kcA7bG7G.js +1282 -0
- package/dist-library/sample-bP4zHB3L.js +289 -0
- package/dist-library/{schema-ZFufO8V0.js → schema-BufhKUSM.js} +12 -11
- package/dist-library/sdk-core-BoJT1SIt.js +1166 -0
- package/dist-library/session-core-nmJHuR9c.js +452 -0
- package/dist-library/{shareable-DDVL4Fi9.js → shareable-DpbE-59H.js} +250 -283
- package/dist-library/tooltip-layer-HDLrSWs0.js +28 -0
- package/dist-library/types/authoring/catalog.d.ts +2 -3
- package/dist-library/types/authoring/editor-i18n.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/authoring/insert.d.ts +1 -1
- package/dist-library/types/authoring/templates.d.ts +2 -2
- package/dist-library/types/build/diagnostics.d.ts +1 -1
- package/dist-library/types/build/host.d.ts +1 -1
- package/dist-library/types/build/index.d.ts +1 -1
- package/dist-library/types/build/notices.d.ts +1 -1
- package/dist-library/types/build/resources.d.ts +1 -1
- package/dist-library/types/build/vite.d.ts +1 -1
- package/dist-library/types/compiler/index.d.ts +2 -2
- package/dist-library/types/compiler/result.d.ts +1 -1
- package/dist-library/types/compiler/standard.d.ts +2 -2
- package/dist-library/types/compiler/types.d.ts +1 -1
- package/dist-library/types/components/{controls.d.ts → controls/controls.d.ts} +2 -3
- package/dist-library/types/components/{numeric-sliders.d.ts → controls/numeric-sliders.d.ts} +1 -1
- package/dist-library/types/components/{gallery.d.ts → gallery/gallery.d.ts} +1 -1
- package/dist-library/types/components/{layout.d.ts → layout/layout.d.ts} +1 -1
- package/dist-library/types/components/minimal-preset.d.ts +2 -0
- package/dist-library/types/components/mount-preset.d.ts +4 -0
- package/dist-library/types/components/network/submit-button.d.ts +10 -0
- package/dist-library/types/components/plot/coordinate.d.ts +2 -0
- package/dist-library/types/components/plugins/chart.d.ts +2 -0
- package/dist-library/types/components/plugins/data.d.ts +2 -0
- package/dist-library/types/components/plugins/diagram.d.ts +2 -0
- package/dist-library/types/components/plugins/forms.d.ts +2 -0
- package/dist-library/types/components/plugins/gallery.d.ts +2 -0
- package/dist-library/types/components/plugins/navigation.d.ts +2 -0
- package/dist-library/types/components/plugins/network.d.ts +2 -0
- package/dist-library/types/components/plugins/plot.d.ts +2 -0
- package/dist-library/types/components/shared/visual-frame.d.ts +12 -0
- package/dist-library/types/components/{visuals.d.ts → shared/visuals.d.ts} +1 -7
- package/dist-library/types/components/{data-table.d.ts → table/data-table.d.ts} +2 -2
- package/dist-library/types/export/component-state.d.ts +1 -1
- package/dist-library/types/export/index.d.ts +2 -1
- package/dist-library/types/export/print-document.d.ts +18 -0
- package/dist-library/types/export/render-markup.d.ts +23 -0
- package/dist-library/types/export/requirements.d.ts +1 -1
- package/dist-library/types/export/resources.d.ts +1 -1
- package/dist-library/types/export/restoration.d.ts +1 -1
- package/dist-library/types/export-assets/index.d.ts +25 -0
- package/dist-library/types/local/compilation/compiler-attributes.d.ts +8 -0
- package/dist-library/types/local/compilation/compiler-bindings.d.ts +19 -0
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +32 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +32 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +62 -16
- package/dist-library/types/local/compilation/compiler-structure.d.ts +38 -3
- package/dist-library/types/local/compilation/compiler-tables.d.ts +30 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +15 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +39 -1
- package/dist-library/types/local/compilation/compiler.d.ts +7 -14
- package/dist-library/types/local/compilation/dependencies.d.ts +1 -1
- package/dist-library/types/local/compilation/session/incremental.d.ts +75 -0
- package/dist-library/types/local/{session → compilation/session}/row-reuse.d.ts +1 -1
- package/dist-library/types/local/{session/compiler-cache.d.ts → compilation/session/semantic-cache.d.ts} +5 -19
- package/dist-library/types/local/compilation/streaming.d.ts +27 -0
- package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
- package/dist-library/types/local/{compilation → configuration}/component-kernel.d.ts +3 -79
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +1104 -1056
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +731 -0
- package/dist-library/types/local/configuration/diagnostics.d.ts +1 -1
- package/dist-library/types/local/configuration/kernel-value-rules.d.ts +66 -0
- package/dist-library/types/local/configuration/official-leaf-syntax.d.ts +24 -0
- package/dist-library/types/local/configuration/options-core.d.ts +5 -4
- package/dist-library/types/local/configuration/options.d.ts +2 -1
- package/dist-library/types/local/configuration/portable-options.d.ts +1 -1
- package/dist-library/types/local/configuration/schema-core.d.ts +1 -1
- package/dist-library/types/local/configuration/schema.d.ts +1 -1
- package/dist-library/types/local/css/author-css.d.ts +66 -0
- package/dist-library/types/local/evaluation/computations.d.ts +2 -2
- package/dist-library/types/local/evaluation/expression/compile.d.ts +30 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -0
- package/dist-library/types/local/evaluation/expression/inference.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +72 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +56 -0
- package/dist-library/types/local/evaluation/{math-display.d.ts → math/display.d.ts} +2 -2
- package/dist-library/types/local/evaluation/math/evaluation.d.ts +10 -0
- package/dist-library/types/local/evaluation/{math.d.ts → math/latex.d.ts} +58 -17
- package/dist-library/types/local/evaluation/{math-sample.d.ts → math/sample.d.ts} +4 -2
- package/dist-library/types/local/evaluation/math/syntax.d.ts +72 -0
- package/dist-library/types/local/evaluation/validation.d.ts +1 -1
- package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
- package/dist-library/types/local/html/html-details.d.ts +1 -1
- package/dist-library/types/local/html/html-entities.d.ts +11 -2
- package/dist-library/types/local/html/html-recovery.d.ts +1 -1
- package/dist-library/types/local/html/html-table.d.ts +1 -1
- package/dist-library/types/local/html/html.d.ts +40 -4
- package/dist-library/types/local/index.d.ts +14 -13
- package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
- package/dist-library/types/local/{markdown → parsing}/fast-markdown.d.ts +1 -1
- package/dist-library/types/local/{markdown → parsing}/footnotes.d.ts +1 -1
- package/dist-library/types/local/{markdown → parsing}/heading-anchors.d.ts +1 -1
- package/dist-library/types/local/parsing/html-attributes.d.ts +14 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +1 -1
- package/dist-library/types/local/{session → parsing}/parse-session.d.ts +5 -5
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +7 -2
- package/dist-library/types/local/parsing/parser-convert.d.ts +26 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +10 -4
- package/dist-library/types/local/parsing/parser-internals.d.ts +54 -0
- package/dist-library/types/local/parsing/parser-region.d.ts +46 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +3 -0
- package/dist-library/types/local/parsing/parser-tags.d.ts +108 -0
- package/dist-library/types/local/parsing/parser.d.ts +3 -3
- package/dist-library/types/local/{markdown → parsing}/plain-paragraphs.d.ts +1 -1
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +1 -1
- package/dist-library/types/local/parsing/theme-declaration.d.ts +22 -0
- package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
- package/dist-library/types/local/rendering/document/LocalDocumentView.d.ts +5 -0
- package/dist-library/types/local/rendering/{LocalDocumentView.d.ts → document/LocalDocumentViewCore.d.ts} +48 -9
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
- package/dist-library/types/local/rendering/document/render-nodes.d.ts +24 -0
- package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
- package/dist-library/types/local/rendering/document/use-color-scheme.d.ts +10 -0
- package/dist-library/types/local/rendering/document/validation-state.d.ts +31 -0
- package/dist-library/types/local/rendering/document/view-render-context.d.ts +146 -0
- package/dist-library/types/local/rendering/{view-revision.d.ts → document/view-revision.d.ts} +31 -4
- package/dist-library/types/local/rendering/render-types.d.ts +1 -1
- package/dist-library/types/local/{widgets/table-surface.d.ts → rendering/table/data-table.d.ts} +3 -0
- package/dist-library/types/local/rendering/table/table-numeric-columns.d.ts +7 -0
- package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
- package/dist-library/types/local/runtime/retention.d.ts +1 -1
- package/dist-library/types/local/runtime/runtime-document.d.ts +71 -0
- package/dist-library/types/local/runtime/runtime-migration.d.ts +19 -0
- package/dist-library/types/local/runtime/runtime-values.d.ts +39 -0
- package/dist-library/types/local/runtime/runtime.d.ts +4 -2
- package/dist-library/types/local/runtime/state.d.ts +1 -1
- package/dist-library/types/local/source/authoring-syntax.d.ts +48 -0
- package/dist-library/types/local/source/authoring.d.ts +1 -1
- package/dist-library/types/local/source/source-context.d.ts +23 -0
- package/dist-library/types/local/source/source-migration.d.ts +2 -2
- package/dist-library/types/local/transport/compile-patch.d.ts +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +1 -1
- package/dist-library/types/local/transport/shared-data.d.ts +1 -1
- package/dist-library/types/local/transport/worker-handler.d.ts +30 -0
- package/dist-library/types/local/transport/worker-job.d.ts +28 -0
- package/dist-library/types/local/transport/worker.d.ts +32 -46
- package/dist-library/types/local/{contracts/types.d.ts → types.d.ts} +78 -21
- package/dist-library/types/pdf.d.ts +22 -0
- package/dist-library/types/presets/identity.d.ts +1 -0
- package/dist-library/types/presets/minimal.d.ts +2 -0
- package/dist-library/types/presets/plugin-packs.d.ts +1 -0
- package/dist-library/types/react/component-api.d.ts +20 -4
- package/dist-library/types/react/component-primitives.d.ts +10 -10
- package/dist-library/types/react/component-utils.d.ts +9 -1
- package/dist-library/types/react/index.d.ts +6 -5
- package/dist-library/types/{local/theme/i18n.d.ts → react/localization.d.ts} +2 -2
- package/dist-library/types/react/minimal.d.ts +13 -0
- package/dist-library/types/react/package-core.d.ts +67 -0
- package/dist-library/types/react/package.d.ts +3 -67
- package/dist-library/types/react/runtime/common.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +115 -0
- package/dist-library/types/react/sdk.d.ts +4 -110
- package/dist-library/types/react/server.d.ts +2 -2
- package/dist-library/types/react/use-draft-field.d.ts +5 -1
- package/dist-library/types/runtime-services/browser/duplex.d.ts +163 -0
- package/dist-library/types/runtime-services/browser/http-sse.d.ts +117 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +2 -1
- package/dist-library/types/runtime-services/component-state.d.ts +1 -1
- package/dist-library/types/runtime-services/index.d.ts +2 -0
- package/dist-library/types/runtime-services/network.d.ts +86 -0
- package/dist-library/types/runtime-services/runtime.d.ts +1 -1
- package/dist-library/types/sdk/config.d.ts +1 -1
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/props.d.ts +1 -1
- package/dist-library/types/sdk/registry-core.d.ts +1 -1
- package/dist-library/types/sdk/theme.d.ts +5 -4
- package/dist-library/types/sdk/types.d.ts +2 -2
- package/dist-library/types/shareable.d.ts +6 -5
- package/dist-library/types/standalone/diagnostics.d.ts +1 -1
- package/dist-library/types/standalone/host.d.ts +5 -0
- package/dist-library/types/standalone/payload.d.ts +1 -1
- package/dist-library/types/standalone/prepare.d.ts +2 -2
- package/dist-library/types/standalone/session-core.d.ts +68 -0
- package/dist-library/types/standalone/session.d.ts +6 -68
- package/dist-library/types/themes/contract.d.ts +7 -0
- package/dist-library/types/{local/theme/theme.d.ts → themes/document-theme.d.ts} +4 -3
- package/dist-library/types/vite/client.d.ts +19 -0
- package/dist-library/types/vite/index.d.ts +18 -3
- package/dist-library/types/vite/registration.d.ts +2 -2
- package/dist-library/{types-BFCrMrg0.js → types-BeNtPqdY.js} +1 -1
- package/dist-library/validation-BEBA_HvS.js +1121 -0
- package/dist-library/visual-frame-CyV1FXzs.js +48 -0
- package/dist-library/visuals-B5KSafVk.js +3 -0
- package/dist-library/visuals-BZbZYA7w.js +72572 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +146 -137
- package/docs/README-ch.md +16 -11
- package/docs/README.md +16 -11
- package/docs/compatibility/compatibility-ch.md +8 -8
- package/docs/compatibility/compatibility-en.md +8 -8
- package/docs/compatibility/source-versioning-ch.md +1 -1
- package/docs/compatibility/source-versioning-en.md +1 -1
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-development-reference-ch.md +4 -4
- package/docs/development/component-development-reference-en.md +4 -4
- package/docs/development/component-protocol-ch.md +14 -14
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/development/extension-tutorial-ch.md +308 -0
- package/docs/development/extension-tutorial-en.md +308 -0
- package/docs/development/local-module-layout-ch.md +10 -50
- package/docs/development/local-module-layout-en.md +9 -49
- package/docs/development/performance-overview-ch.md +174 -154
- package/docs/development/performance-overview-en.md +174 -154
- package/docs/guides/local-guide-ch.md +2 -2
- package/docs/guides/local-guide-en.md +2 -2
- package/docs/integration/author-tools-ch.md +2 -2
- package/docs/integration/author-tools-en.md +2 -2
- package/docs/integration/compiler-ch.md +4 -2
- package/docs/integration/compiler-en.md +4 -2
- package/docs/integration/directory-discovery-ch.md +5 -1
- package/docs/integration/directory-discovery-en.md +5 -1
- package/docs/integration/editor-ch.md +35 -5
- package/docs/integration/editor-en.md +42 -4
- package/docs/integration/extension-sdk-ch.md +6 -4
- package/docs/integration/extension-sdk-en.md +6 -4
- package/docs/integration/local-integration-ch.md +201 -19
- package/docs/integration/local-integration-en.md +194 -18
- package/docs/integration/network-host-ch.md +75 -0
- package/docs/integration/network-host-en.md +75 -0
- package/docs/integration/shareable-export-ch.md +58 -16
- package/docs/integration/shareable-export-en.md +57 -15
- package/docs/reference/html-compatibility-ch.md +20 -67
- package/docs/reference/html-compatibility-en.md +19 -64
- package/docs/reference/local-interaction-syntax-ch.md +199 -26
- package/docs/reference/local-interaction-syntax-en.md +194 -27
- package/docs/reference/public-api-ch.md +416 -0
- package/docs/reference/public-api-en.md +416 -0
- package/docs/reference/theme-protocol-ch.md +27 -8
- package/docs/reference/theme-protocol-en.md +46 -8
- package/docs/releases/release-0.4.0-ch.md +2 -2
- package/docs/releases/release-0.4.0-en.md +2 -2
- package/docs/releases/release-0.8.0-ch.md +19 -3
- package/docs/releases/release-0.8.0-en.md +19 -3
- package/docs/releases/release-0.9.0-ch.md +44 -0
- package/docs/releases/release-0.9.0-en.md +44 -0
- package/docs/releases/release-0.9.1-ch.md +29 -0
- package/docs/releases/release-0.9.1-en.md +29 -0
- package/examples/component-package/README-ch.md +1 -1
- package/examples/component-package/README.md +1 -1
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/game-2048-package/README-ch.md +3 -9
- package/examples/game-2048-package/README.md +8 -12
- package/examples/integration/README-ch.md +21 -2
- package/examples/integration/README.md +21 -2
- package/examples/integration/extension-sdk/README-ch.md +1 -1
- package/examples/integration/extension-sdk/README.md +1 -1
- package/examples/integration/streaming/index.html +48 -0
- package/examples/integration/streaming/main.js +175 -0
- package/examples/integration/streaming/package.json +13 -0
- package/examples/integration/streaming/worker.js +3 -0
- package/examples/local/README-ch.md +3 -3
- package/examples/local/README.md +2 -2
- package/examples/local/minimal-budget.reactive.md +48 -0
- package/examples/minimal-extension/README-ch.md +78 -0
- package/examples/minimal-extension/README.md +78 -0
- package/examples/minimal-extension/index.html +15 -0
- package/examples/minimal-extension/package.json +26 -0
- package/examples/minimal-extension/sample/document.reactive.md +10 -0
- package/examples/minimal-extension/scripts/build.mjs +32 -0
- package/examples/minimal-extension/scripts/export.mjs +72 -0
- package/examples/minimal-extension/scripts/test-node.mjs +75 -0
- package/examples/minimal-extension/src/extension.tsx +90 -0
- package/examples/minimal-extension/src/preview.tsx +12 -0
- package/examples/minimal-extension/src/source.ts +4 -0
- package/examples/minimal-extension/tsconfig.json +14 -0
- package/examples/network-survey/README.md +200 -0
- package/examples/network-survey/index.html +49 -0
- package/examples/network-survey/package.json +26 -0
- package/examples/network-survey/sample/document.reactive.md +51 -0
- package/examples/network-survey/src/components.tsx +325 -0
- package/examples/network-survey/src/host.ts +316 -0
- package/examples/network-survey/src/main.tsx +91 -0
- package/examples/network-survey/src/source.ts +1 -0
- package/examples/network-survey/tsconfig.json +26 -0
- package/examples/network-survey/vite.config.ts +227 -0
- package/examples/sci-fi-theme/README-ch.md +4 -2
- package/examples/sci-fi-theme/README.md +4 -2
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -0
- package/examples/sci-fi-theme/demo/demo.css +129 -23
- package/examples/sci-fi-theme/demo/document.reactive.md +27 -6
- package/examples/sci-fi-theme/demo/main.tsx +45 -10
- package/examples/sci-fi-theme/docs/design-system-ch.md +6 -6
- package/examples/sci-fi-theme/package.json +2 -1
- package/examples/sci-fi-theme/src/components.css +1064 -154
- package/examples/sci-fi-theme/src/notch.css +142 -0
- package/examples/sci-fi-theme/src/sci-fi.css +3 -1
- package/examples/sci-fi-theme/src/theme.ts +2 -0
- package/examples/sci-fi-theme/src/tokens.css +512 -408
- package/examples/tetris-package/README-ch.md +4 -4
- package/examples/tetris-package/README.md +4 -4
- package/package.json +70 -3
- package/dist-library/LocalDocumentView-6trX7xJc.js +0 -97920
- package/dist-library/compiler--ea2CKQF.js +0 -61
- package/dist-library/component-state-Cq2K5gkS.js +0 -490
- package/dist-library/options-CX5m5n-J.js +0 -115
- package/dist-library/runtime-C-sbfpOX.js +0 -1157
- package/dist-library/types/local/contracts/locale.d.ts +0 -1
- package/dist-library/types/local/contracts/version.d.ts +0 -2
- package/dist-library/types/local/evaluation/dates.d.ts +0 -2
- package/dist-library/types/local/evaluation/expression.d.ts +0 -47
- package/dist-library/types/local/markdown/markdown-structure.d.ts +0 -3
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +0 -36
- package/dist-library/types/local/session/incremental.d.ts +0 -48
- package/dist-library/types/local/source/node-walk.d.ts +0 -3
- package/dist-library/types/local/source/text-length.d.ts +0 -13
- package/dist-library/types/local/theme/theme-name.d.ts +0 -3
- package/dist-library/types/local/widgets/visuals.d.ts +0 -25
- package/dist-library/types/react/default-theme.d.ts +0 -6
- package/dist-library/validation-W-bmny-x.js +0 -2253
- package/docs/development/releasing-ch.md +0 -12
- package/docs/development/releasing-en.md +0 -12
- package/docs/integration/codemirror-ch.md +0 -52
- package/docs/integration/codemirror-en.md +0 -29
- package/docs/integration/repository-split-ch.md +0 -40
- package/docs/integration/repository-split-en.md +0 -23
- package/docs/reference/computations-formatting-ch.md +0 -89
- package/docs/reference/computations-formatting-en.md +0 -89
- package/docs/reference/constraints-collections-ch.md +0 -104
- package/docs/reference/constraints-collections-en.md +0 -104
- package/docs/reference/local-components-v2-ch.md +0 -140
- package/docs/reference/local-components-v2-en.md +0 -106
- package/docs/reference/tolerance-ch.md +0 -64
- package/docs/reference/tolerance-en.md +0 -57
- /package/dist-library/types/components/{chart-motion.d.ts → chart/chart-motion.d.ts} +0 -0
- /package/dist-library/types/components/{default-chart-types.d.ts → chart/default-chart-types.d.ts} +0 -0
- /package/dist-library/types/components/{default-chart.d.ts → chart/default-chart.d.ts} +0 -0
- /package/dist-library/types/components/{diagram-inspector.d.ts → diagram/diagram-inspector.d.ts} +0 -0
- /package/dist-library/types/{local/widgets/diagram-layout.d.ts → components/diagram/layout.d.ts} +0 -0
- /package/dist-library/types/components/{mafs-plot-grid.d.ts → plot/mafs-plot-grid.d.ts} +0 -0
- /package/dist-library/types/components/{mafs-visuals.d.ts → plot/mafs-visuals.d.ts} +0 -0
- /package/dist-library/types/components/{use-hydrated.d.ts → shared/use-hydrated.d.ts} +0 -0
- /package/dist-library/types/local/{theme/colors.d.ts → configuration/color-values.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{collection-functions.d.ts → expression/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{data-functions.d.ts → expression/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{formatting.d.ts → expression/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{markdown → parsing}/markdown-blocks.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/code}/code-block.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/code}/code-languages.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/image}/image-view.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering}/math-view.d.ts +0 -0
package/CHANGELOG-ch.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
**中文** · [English](CHANGELOG.md)
|
|
4
4
|
|
|
5
|
+
## 0.9.1(2026-11-22,latest 渠道)
|
|
6
|
+
|
|
7
|
+
优化流式源码编译、文档内跳转滚动,以及更严格的源码阶段校验。
|
|
8
|
+
|
|
9
|
+
### 变更
|
|
10
|
+
|
|
11
|
+
- 优化流式源码编译。编译会话、`LocalCompileScheduler`、Worker 和 `LocalReactiveDocument` 现在接受显式的 `streaming` 或 `final` 源码阶段;未完成区域以原文呈现,可修复问题进入 `transientDiagnostics`,确定性错误与最终严格/恢复语义保持不变。编辑器侧的对应快照处理随单独的编辑器版本发布。
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
|
|
15
|
+
- 将 `<jump>` 跳转限制在渲染文档外层最近的主机滚动容器内;嵌入预览只滚动自身视口,不再带动外层页面。
|
|
16
|
+
- 拒绝运行时不受支持的 `sourcePhase` 值,不再回退到可交互的最终渲染。
|
|
17
|
+
|
|
18
|
+
## 0.9.0(2026-11-20,latest 渠道)
|
|
19
|
+
|
|
20
|
+
主题层叠与控件、18 个组件的精简预设、静态 PDF 导出、具名宿主网络通道,以及解析器、状态恢复和增量编辑修复。
|
|
21
|
+
|
|
22
|
+
### 新增
|
|
23
|
+
|
|
24
|
+
- 新增由宿主管理的具名网络通道,支持经过校验的提交与订阅、有界 JSON 负载、取消、幂等键、共享通道生命周期、外部变量映射,以及 HTTP、SSE、WebSocket 和 WebRTC 适配器。
|
|
25
|
+
- 通过 `reactive-md/pdf` 和 CLI 新增静态 PDF 导出,使用 Chromium 将静态 HTML 排版为 PDF。
|
|
26
|
+
- `<alert tone="error">` 使用红色危险色调并带有 `role="alert"`;动态 tone 表达式也接受 `error`。
|
|
27
|
+
- 新增 `reactive-md/presets/minimal` 与 `reactive-md/react/minimal`,提供包含 18 个组件的精简预设。可通过扩展 SDK 按需增加组件。
|
|
28
|
+
- 新增语义主题 token 和层叠层,使宿主与扩展样式可和默认主题组合,并增加 h5、h6 标题级别。
|
|
29
|
+
- `<plot>` 新增极坐标方程和可配置采样点数,并提供有界采样与公式诊断。
|
|
30
|
+
- 新增精简扩展作者教程和 `reactive-md/export-assets`,用于稳定定位 HTML 导出所需文件。
|
|
31
|
+
|
|
32
|
+
### 修复
|
|
33
|
+
|
|
34
|
+
- 快路径 Markdown 表格与 remark 路径一样还原 `\|`,表格单元格内的 `{{ a \|\| b }}` 可以正常编译。
|
|
35
|
+
- 词法屏蔽与 Markdown 解析保持一致:info string 含反引号的行不再开启代码围栏;容器内的缩进代码不再扫描插值、标签或被重命名改写;图片 alt 保留原文,不再残留私有区标记;空行后位于列表标记列的文本会关闭该层级。
|
|
36
|
+
- 基本 HTML 属性按属性值规则解码:不带 `;` 的旧式命名引用在 `=` 或字母数字前保持字面(`href="?a=1©=2"`),重复属性取首个且仍参与校验,NUL 在所有路径统一为 U+FFFD。
|
|
37
|
+
- 状态导入按完整参数集合一次原子写入,读取其他参数的约束不再依赖声明顺序;逐个回退路径重复执行,直到不再接受新值。
|
|
38
|
+
- 动态约束收窄导致越界的值,在预览中遇到无关的文档编辑时保留;约束定义或值规则变化时仍重新校验并回退到新初值。
|
|
39
|
+
- 零的符号由取整结果决定,接近零的值不再输出 `-0.0000`。
|
|
40
|
+
- 常量静态求值失败时,读取它的常量不再额外报出误导性的“变量未声明”;未知引用与 const 违规诊断定位到标识符本身,而不是可能落在字符串字面量里的首次文本匹配。
|
|
41
|
+
- 诊断、状态采样、图表标签与 CLI 文本截断时不再留下落单的高代理项。
|
|
42
|
+
|
|
43
|
+
### 变更
|
|
44
|
+
|
|
45
|
+
- 调整默认主题的文档排版和分层组件样式,包括控件与表格表面。
|
|
46
|
+
- 更新当前源码布局和运行时的性能测量。
|
|
47
|
+
- 增量编辑会话用本地解析器校验重编译块相邻的边界,不一致时退回全量编译,会话结果与 `compileLocal` 始终一致;含孤立 `\r`、或上下文块紧跟 Markdown 的源码始终走全量路径。
|
|
48
|
+
- 分块规划把歧义输入留在通用解析器上:裸 `1.` / `2)`、快路径列表之后的惰性续行、被遮罩段落之后的打断、Lezer 提前结束的列表、跨遮罩行连接的松散列表、缩进代码,以及以空项结束的列表。这些边界输入如今与 remark 一致。
|
|
49
|
+
- 可能包含缩进代码的容器会多做一次 body 的 Markdown 解析,普通容器不受影响。
|
|
50
|
+
|
|
51
|
+
### 兼容性
|
|
52
|
+
|
|
53
|
+
- 本版本沿用 `local-draft-3`、`component-protocol-3`、`reactive-md-theme-1`、`reactive-md-state/v1` 和 `0.7.0` SDK 契约。
|
|
54
|
+
|
|
5
55
|
## 0.8.0(2026-11-12,latest 渠道)
|
|
6
56
|
|
|
7
57
|
编辑器拆为 `reactive-md-editor`,Demo 独立维护;旧 `reactive-md/editor` 导入迁移至 `reactive-md-editor`,这是 0.8 的包 API 破坏性变更。新增单次编译入口、严格模式与局部恢复、HTML details 映射;包、语法和数据协议分别管理版本。
|
|
@@ -27,7 +77,7 @@
|
|
|
27
77
|
|
|
28
78
|
### 移除
|
|
29
79
|
|
|
30
|
-
- 移除 `reactive-md/editor`、`reactive-md/editor/codemirror` 及其样式表导出。安装 `reactive-md-editor@0.1.0`,改用 `reactive-md-editor`、`reactive-md-editor/codemirror` 和对应样式表。已发布的 0.7
|
|
80
|
+
- 移除 `reactive-md/editor`、`reactive-md/editor/codemirror` 及其样式表导出。安装 `reactive-md-editor@0.1.0`,改用 `reactive-md-editor`、`reactive-md-editor/codemirror` 和对应样式表。已发布的 0.7 包仍保留旧入口。见[仓库拆分与导入迁移](docs/releases/release-0.8.0-ch.md#仓库拆分与导入迁移)。
|
|
31
81
|
|
|
32
82
|
### 兼容性
|
|
33
83
|
|
|
@@ -190,10 +240,10 @@
|
|
|
190
240
|
- 新增按依赖更新的渲染优化,浏览器等价检查覆盖参数更新、重置、可视化选择和语言切换。
|
|
191
241
|
- 新增 `npm run verify:release` 与对应 CI 分片,覆盖组合文档和仓库外的真实 tarball 消费;保留经过验证的安装包、SHA256 与 npm integrity 记录。
|
|
192
242
|
- 新增跨字段 `<validation>` 规则、关联的可访问提示及 `runtime.validate()`;`alert` 和 `badge` 支持按条件选择现有 `tone` 枚举。
|
|
193
|
-
- 新增同类型字符串/数字数组字面量、数组索引、`sum`、`average`、`minOf`、`maxOf`,以及带稳定行键和数量预算的 `<data-table>`/`<column>`。见[
|
|
243
|
+
- 新增同类型字符串/数字数组字面量、数组索引、`sum`、`average`、`minOf`、`maxOf`,以及带稳定行键和数量预算的 `<data-table>`/`<column>`。见[本地交互语法规范](docs/reference/local-interaction-syntax-ch.md)。`LocalValueKind` 增加 `number-array`,新增聚合函数名成为保留字。
|
|
194
244
|
|
|
195
245
|
- 新增不可见、只读的 `<computed>` 与 `<const>` 声明,支持依赖排序、类型推断、循环检测和各运行时独立的计算缓存。正文、条件、公式与图表可共享中间结果。
|
|
196
|
-
- 新增数字、百分比、科学计数法与货币格式化,常用字符串函数及 UTC 日期比较、日期差。默认值、舍入、空值和地区规则见[
|
|
246
|
+
- 新增数字、百分比、科学计数法与货币格式化,常用字符串函数及 UTC 日期比较、日期差。默认值、舍入、空值和地区规则见[本地交互语法规范](docs/reference/local-interaction-syntax-ch.md)。新函数名成为保留字;升级到本版本前需重命名同名旧绑定。
|
|
197
247
|
|
|
198
248
|
- 新增可选的 `<!-- reactive-md: local-draft-2 -->` 源码修订指令。显式旧修订、未知、格式错误、重复或位置错误的声明会以 `local.version.*` 诊断拒绝,不创建运行时;无指令源码保持当前修订行为。早于该指令的读者会忽略它。见[源码修订与迁移](docs/compatibility/source-versioning-ch.md)。
|
|
199
249
|
- 新增 `inspectLocalSourceVersion`、`checkLocalUpgrade`、`migrateLocalSource`,以及带 `--from`、`--check`、`--json`、`-o/--output`、`--accept-semantic-changes` 和 `--locale` 的 `reactive-md migrate`。迁移只改指令,保留正文原始字节、BOM 和 CRLF,幂等;阻止保留绑定、新增可识别标签、编译错误和文本长度语义变化,且从不改写状态文件。
|
|
@@ -212,7 +262,7 @@
|
|
|
212
262
|
- 新增文档跳转与锚点、正文颜色、多选、区间与二维坐标输入、练习题及分步阅读。
|
|
213
263
|
- 清单勾选后划线,新增组件主色及表格/图表稳定标识的共享选择。
|
|
214
264
|
- runtime.get/set 支持可选槽位,新增原子 setMany;新增槽位绑定为独占。
|
|
215
|
-
- 新增双语功能馆及编辑器插入模板。见[
|
|
265
|
+
- 新增双语功能馆及编辑器插入模板。见[本地交互语法规范](docs/reference/local-interaction-syntax-ch.md)。预览版发布在 `next` 渠道。
|
|
216
266
|
|
|
217
267
|
- Playground 新增中英文切换,界面、示例、指南和内置控件文案会同步切换,选择保存在浏览器中。
|
|
218
268
|
- `LocalDocumentView` 和 `LocalReactiveDocument` 支持 `locale: 'en' | 'zh'`(默认 `'en'`),用于内置 UI 文案。显示用编译与运行时诊断通过中英文共享目录本地化,回调仍收到带稳定机器字段的结构化诊断。
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [中文](CHANGELOG-ch.md)
|
|
4
4
|
|
|
5
|
+
## 0.9.1 (2026-11-22, latest channel)
|
|
6
|
+
|
|
7
|
+
Streaming source compilation refinements, document-scoped jump scrolling, and stricter source-phase validation.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Refine streaming source compilation. Compile sessions, `LocalCompileScheduler`, Workers and `LocalReactiveDocument` now accept explicit `streaming` or `final` phases; unfinished regions render as literal text and fixable issues are reported through `transientDiagnostics`, while deterministic errors and final strict/recovery semantics stay unchanged. Matching editor-side snapshot handling ships in a separate editor release.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Scope `<jump>` navigation to the nearest scroll container the host wraps around the rendered document; an embedded preview scrolls its own viewport instead of the surrounding page.
|
|
16
|
+
- Reject unsupported runtime `sourcePhase` values instead of falling back to interactive final rendering.
|
|
17
|
+
|
|
18
|
+
## 0.9.0 (2026-11-20, latest channel)
|
|
19
|
+
|
|
20
|
+
Theme cascade and controls, a focused 18-component minimal preset, static PDF export, named host network channels, and parser, state restoration and incremental editing fixes.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Add named host-owned network channels for validated submit and subscribe operations, with bounded JSON payloads, cancellation, idempotency keys, shared channel lifetimes, external-value mapping and HTTP, SSE, WebSocket and WebRTC adapters.
|
|
25
|
+
- Add static PDF output through `reactive-md/pdf` and the CLI, rendered from static HTML with Chromium.
|
|
26
|
+
- `<alert tone="error">` renders a red danger-toned callout with `role="alert"`; dynamic tone expressions accept `error` as well.
|
|
27
|
+
- Add `reactive-md/presets/minimal` and `reactive-md/react/minimal`, an 18-component profile for lightweight hosts. The extension SDK provides optional components.
|
|
28
|
+
- Add semantic theme tokens and cascade layers that let host and extension styles compose with the default theme, plus heading levels h5 and h6.
|
|
29
|
+
- Add polar equations and configurable sample points for `<plot>`, with bounded sampling and formula diagnostics.
|
|
30
|
+
- Add the minimal extension author tutorial and `reactive-md/export-assets` for stable lookup of the files consumed by HTML export.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Unescape `\|` inside GFM table cells on the fast Markdown path as well as the remark path, so `{{ a \|\| b }}` compiles inside a table.
|
|
35
|
+
- Follow the Markdown parse in lexical shielding: a backtick in a fence info string no longer opens a fence, indented code inside a container is no longer scanned for interpolations, tags or renames, image alt text keeps its source text instead of private-use markers, and text at the list marker column after a blank line closes the list level.
|
|
36
|
+
- Decode basic HTML attributes with attribute-value rules: a legacy named reference without `;` stays literal before `=` or an alphanumeric (`href="?a=1©=2"`), the first duplicate attribute wins while duplicates are still validated, and NUL becomes U+FFFD on every path.
|
|
37
|
+
- Validate a restored state file against the whole parameter set in one atomic write, so a constraint that reads another parameter no longer depends on declaration order; the retention fallback repeats its pass until it stops accepting values.
|
|
38
|
+
- Keep a value that a dynamic constraint has narrowed out of range across unrelated document edits in live preview; a changed constraint definition or value rule still revalidates and falls back to the new initial value.
|
|
39
|
+
- Decide the sign of zero from the rounded result, so a value within one decimal rounding step of zero no longer prints `-0.0000`.
|
|
40
|
+
- Skip the dependents of a constant that failed static evaluation instead of reporting a second, misleading "Variable ... is not declared" diagnostic.
|
|
41
|
+
- Report unknown-reference and const-violation diagnostics at the identifier token rather than at the first textual match, which could sit inside a string literal.
|
|
42
|
+
- Truncate diagnostic, state-sample, chart-label and CLI text without leaving an unpaired high surrogate.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- Align the default theme's document typography and layered component styling, including controls and tables.
|
|
47
|
+
- Refresh performance measurements for the current source layout and runtime.
|
|
48
|
+
- An incremental editing session validates the boundaries next to a recompiled block against the local parser and falls back to a full compile when they disagree, so a session result always matches `compileLocal`. Sources with a lone `\r`, or a context block followed directly by Markdown, always use the full path.
|
|
49
|
+
- Block planning keeps ambiguous inputs on the general parser: a bare `1.` / `2)`, lazy continuation after a fast list, interruption after a masked paragraph, lists Lezer ends early, loose lists joined across masked lines, indented code, and lists ending in an empty item. Those edge inputs now parse as remark does.
|
|
50
|
+
- A container that may contain indented code makes one extra Markdown parse of its body; plain containers do no extra work.
|
|
51
|
+
|
|
52
|
+
### Compatibility
|
|
53
|
+
|
|
54
|
+
- The release uses `local-draft-3`, `component-protocol-3`, `reactive-md-theme-1`, `reactive-md-state/v1` and the existing `0.7.0` SDK contract.
|
|
55
|
+
|
|
5
56
|
## 0.8.0 (2026-11-12, latest channel)
|
|
6
57
|
|
|
7
58
|
The release splits the editor into `reactive-md-editor` and the Demo into independent repositories. Replace `reactive-md/editor` imports with `reactive-md-editor`. Add one-shot compiler entries, strict/local recovery and HTML details mapping. Package, syntax and data protocols retain independent versioning.
|
|
@@ -27,7 +78,7 @@ The release splits the editor into `reactive-md-editor` and the Demo into indepe
|
|
|
27
78
|
|
|
28
79
|
### Removed
|
|
29
80
|
|
|
30
|
-
- Remove `reactive-md/editor`, `reactive-md/editor/codemirror` and their stylesheet exports. Install `reactive-md-editor@0.1.0` and use `reactive-md-editor`, `reactive-md-editor/codemirror` and the matching stylesheets. Published 0.7 packages keep the old entries.
|
|
81
|
+
- Remove `reactive-md/editor`, `reactive-md/editor/codemirror` and their stylesheet exports. Install `reactive-md-editor@0.1.0` and use `reactive-md-editor`, `reactive-md-editor/codemirror` and the matching stylesheets. Published 0.7 packages keep the old entries. See [repository split and import migration](docs/releases/release-0.8.0-en.md#repository-split-and-import-migration).
|
|
31
82
|
|
|
32
83
|
### Compatibility
|
|
33
84
|
|
|
@@ -190,10 +241,10 @@ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-
|
|
|
190
241
|
- Add dependency-aware rendering with browser equivalence checks for updates, resets, visual selections and locale changes.
|
|
191
242
|
- Add `npm run verify:release` and matching CI shards, including combined-feature documents and actual tarball consumers outside the repository. Retain the verified archive with SHA256 and npm integrity records.
|
|
192
243
|
- Add advisory cross-field `<validation>` rules with associated accessible hints and `runtime.validate()`. `alert` and `badge` accept conditional values from their existing tone enums.
|
|
193
|
-
- Add homogeneous string/numeric array literals, array indexing, `sum`, `average`, `minOf` and `maxOf`, plus `<data-table>`/`<column>` for bounded local row generation with stable keys. See [
|
|
244
|
+
- Add homogeneous string/numeric array literals, array indexing, `sum`, `average`, `minOf` and `maxOf`, plus `<data-table>`/`<column>` for bounded local row generation with stable keys. See [local interaction syntax](docs/reference/local-interaction-syntax-en.md). `LocalValueKind` gains `number-array`; aggregate names become reserved identifiers.
|
|
194
245
|
|
|
195
246
|
- Add invisible, read-only `<computed>` and `<const>` declarations with dependency ordering, inferred types, cycle detection and per-runtime calculation caching. Prose, conditions, formulas and charts can share intermediate results.
|
|
196
|
-
- Add number, percentage, scientific and currency formatting, common string functions and UTC date comparison/differences. Defaults, rounding, nulls and accepted regions are specified in [
|
|
247
|
+
- Add number, percentage, scientific and currency formatting, common string functions and UTC date comparison/differences. Defaults, rounding, nulls and accepted regions are specified in [local interaction syntax](docs/reference/local-interaction-syntax-en.md). New function names are reserved; rename any existing bindings with those names before upgrading to this release.
|
|
197
248
|
|
|
198
249
|
- Add an optional `<!-- reactive-md: local-draft-2 -->` source revision directive. Explicit older, unknown, malformed, duplicate or misplaced revisions fail with `local.version.*` diagnostics and create no runtime; unversioned source keeps current-revision behavior. Readers built before the directive ignore it. See [Source revisions and migration](docs/compatibility/source-versioning-en.md).
|
|
199
250
|
- Add `inspectLocalSourceVersion`, `checkLocalUpgrade` and `migrateLocalSource`, plus `reactive-md migrate` with `--from`, `--check`, `--json`, `-o/--output`, `--accept-semantic-changes` and `--locale`. Migration changes only the directive, preserves body bytes, BOM and CRLF, is idempotent, blocks reserved bindings, newly recognized tags, compile errors and text-length semantic changes, and never rewrites state files.
|
|
@@ -212,7 +263,7 @@ Compatible with 0.4.0; syntax remains `local-draft-2`, with `component-protocol-
|
|
|
212
263
|
- Add document jumps/anchors, text/section color, multiple selection, interval and coordinate inputs, practice questions and guided steps.
|
|
213
264
|
- Add checked-item strike-through, component accent colors and stable shared table/chart selection.
|
|
214
265
|
- Extend runtime get/set with optional slots and add atomic setMany. New slot bindings are exclusive.
|
|
215
|
-
- Add a bilingual feature tour and editor insertion templates. See [
|
|
266
|
+
- Add a bilingual feature tour and editor insertion templates. See [local interaction syntax](docs/reference/local-interaction-syntax-en.md). The preview is published on the `next` channel.
|
|
216
267
|
|
|
217
268
|
- The Playground adds a Chinese/English toggle that localizes the interface, examples, guide and built-in control labels, and saves the choice in the browser.
|
|
218
269
|
- `LocalDocumentView` and `LocalReactiveDocument` accept `locale: 'en' | 'zh'` (default `'en'`) for built-in UI labels. Displayed compile and runtime diagnostics use the shared English/Chinese catalogue; callbacks still receive structured diagnostics with stable machine fields.
|
package/CONTRIBUTING-ch.md
CHANGED
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
**中文** · [English](CONTRIBUTING.md)
|
|
4
4
|
|
|
5
|
-
本仓库维护语言引擎、运行时、SDK 与渲染适配器;[编辑器](https://github.com/yao1145/ReactiveMD-Editor)和 [Demo](https://github.com/yao1145/ReactiveMD-Demo) 分别维护。先阅读[迁移说明](docs/
|
|
5
|
+
本仓库维护语言引擎、运行时、SDK 与渲染适配器;[编辑器](https://github.com/yao1145/ReactiveMD-Editor)和 [Demo](https://github.com/yao1145/ReactiveMD-Demo) 分别维护。先阅读[迁移说明](docs/releases/release-0.8.0-ch.md#仓库拆分与导入迁移)与[语法规范](docs/reference/local-interaction-syntax-ch.md)。
|
|
6
6
|
|
|
7
7
|
使用 Node >=22.12,CI 使用 Node24。在本仓库运行 npm ci、npm run check,完成类型、构建、保留的回归和实际 tarball 消费验证。局部修改先运行直接相关检查;编译入口依赖变化时补充 npm run test:compiler-entry。
|
|
8
8
|
|
|
9
9
|
引擎公共 API 独立于编辑器 UI,纯目录、插入命令和分析服务放在 reactive-md/authoring。行为变化补针对性回归,保留安全与资源预算,更新公开文档。包版本、语法版本、状态协议与主题版本分别管理。
|
|
10
10
|
|
|
11
|
-
不提交 dist、依赖或凭据,保留无关改动。PR 描述实际行为和已运行检查。引擎发包仅在授权后使用手动 OIDC 工作流,见[发布流程](
|
|
11
|
+
不提交 dist、依赖或凭据,保留无关改动。PR 描述实际行为和已运行检查。引擎发包仅在授权后使用手动 OIDC 工作流,见[发布流程](#发布流程);站点部署由 Demo 仓库负责。
|
|
12
|
+
|
|
13
|
+
## 发布流程
|
|
14
|
+
|
|
15
|
+
reactive-md 独立维护版本;编辑器从自己的仓库发布 reactive-md-editor,Demo 独立构建站点。
|
|
16
|
+
|
|
17
|
+
1. 核对分支、本次 diff、目标版本与 registry 状态。更新 package.json、package-lock.json、变更记录及兼容说明;包版本与语法、协议版本分别管理。
|
|
18
|
+
2. 运行 npm ci、npm run check、npm run notices,检查 tarball 的 exports、声明路径与 notice。公开包检查在独立目录安装实际 tarball,不需要检出编辑器或 Demo。
|
|
19
|
+
3. 提交并推送已授权的发布源码。在对应 ref 手动触发 publish.yml,选择 dist_tag 与 update_latest。工作流使用 Node24、npm ^11.21 和 npm trusted publishing(OIDC);保留 npm 已配置的工作流文件名。工作流完成检查和构建后打包,仅发布不存在的版本;已存在的版本只更新请求的标签。本机不执行 npm publish 或 npm dist-tag。
|
|
20
|
+
4. 确认工作流成功,核对 registry 的版本、渠道和 integrity。授权后给对应源码创建 tag/Release;升级下游 registry 依赖前,在干净消费目录验证公开包。
|
|
21
|
+
|
|
22
|
+
编辑器首次发包前需单独配置其仓库与 publish.yml 的 npm trusted publisher。正式发布前,下游通过 vendor tarball 和锁文件固定候选组合。推送代码不授权发包或站点部署。
|
package/CONTRIBUTING.md
CHANGED
|
@@ -2,10 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [中文](CONTRIBUTING-ch.md)
|
|
4
4
|
|
|
5
|
-
This repository owns the ReactiveMD language engine, runtime, SDK and rendering adapters. The [editor](https://github.com/yao1145/ReactiveMD-Editor) and [Demo](https://github.com/yao1145/ReactiveMD-Demo) are separate projects. Read the [migration guide](docs/
|
|
5
|
+
This repository owns the ReactiveMD language engine, runtime, SDK and rendering adapters. The [editor](https://github.com/yao1145/ReactiveMD-Editor) and [Demo](https://github.com/yao1145/ReactiveMD-Demo) are separate projects. Read the [migration guide](docs/releases/release-0.8.0-en.md#repository-split-and-import-migration) and [syntax specification](docs/reference/local-interaction-syntax-en.md).
|
|
6
6
|
|
|
7
7
|
Use Node >=22.12 (CI uses Node24). Run npm ci, then npm run check. This checks types, builds the library, runs the retained regressions and verifies the actual package in a fresh consumer. Local changes need the directly affected checks; changes to compiler entry dependencies also need npm run test:compiler-entry.
|
|
8
8
|
|
|
9
9
|
Keep public engine APIs independent of editor UI. Pure catalog, insertion and analysis services belong in reactive-md/authoring. Add focused regressions for behavior changes, preserve security/resource budgets and update public documentation. Keep package, syntax, state and theme versions separate.
|
|
10
10
|
|
|
11
|
-
Do not commit generated dist directories, dependencies or credentials. Preserve unrelated edits. Describe behavior and actual validation in PRs. Release the engine through its manual OIDC workflow only when authorized; see
|
|
11
|
+
Do not commit generated dist directories, dependencies or credentials. Preserve unrelated edits. Describe behavior and actual validation in PRs. Release the engine through its manual OIDC workflow only when authorized; see [Releasing](#releasing). Demo deployment belongs to the Demo repository.
|
|
12
|
+
|
|
13
|
+
## Releasing
|
|
14
|
+
|
|
15
|
+
The engine, editor and Demo release independently. `reactive-md` carries its own version; `reactive-md-editor` publishes from the editor repository and the Demo builds its own site artifact.
|
|
16
|
+
|
|
17
|
+
1. Confirm the branch, the intended diff, the target version and the registry state. Update package.json, package-lock.json, the changelog and the relevant compatibility notes. Package, syntax, protocol and theme versions move separately.
|
|
18
|
+
2. Run npm ci, npm run check, npm run notices. Review the packed exports, declaration paths and notices. The public-package check installs the actual tarball in an independent consumer, so no editor or Demo checkout is needed.
|
|
19
|
+
3. Commit and push the authorized release source. Run publish.yml on that ref with the chosen dist_tag and update_latest. The workflow uses Node 24, npm ^11.21 and npm trusted publishing over OIDC, and keeps the workflow filename configured on npm. It checks and builds the package before packing, publishes only when that version does not exist, and otherwise updates the requested tags. Do not publish or retag through a local npm login.
|
|
20
|
+
4. Confirm the workflow result, registry version, tags and integrity. Tag the matching source when authorized, and verify the published package in a clean consumer before upgrading downstream dependencies.
|
|
21
|
+
|
|
22
|
+
The editor needs its own npm trusted publisher and publish.yml in its repository. Candidate tarballs stay locked in consumer vendor directories until registry publication. Pushing code does not authorize npm publication or site deployment.
|
package/README-ch.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**中文** · [English](README.md)
|
|
4
4
|
|
|
5
|
-
> 仓库已拆分:本仓库维护语言引擎;[编辑器](https://github.com/yao1145/ReactiveMD-Editor)与 [Demo](https://github.com/yao1145/ReactiveMD-Demo) 独立构建。引擎 0.8 使用独立 reactive-md-editor 包,见[迁移说明](docs/
|
|
5
|
+
> 仓库已拆分:本仓库维护语言引擎;[编辑器](https://github.com/yao1145/ReactiveMD-Editor)与 [Demo](https://github.com/yao1145/ReactiveMD-Demo) 独立构建。引擎 0.8 使用独立 reactive-md-editor 包,见[迁移说明](docs/releases/release-0.8.0-ch.md#仓库拆分与导入迁移)。
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/reactive-md)
|
|
8
8
|
[](LICENSE)
|
|
@@ -77,7 +77,7 @@ Reactive MD 把普通 Markdown 变成一个小型应用:命名输入、实时
|
|
|
77
77
|
|
|
78
78
|
## 性能
|
|
79
79
|
|
|
80
|
-
Reactive MD 面向长文档和连续编辑。当前测量日期为 2026-
|
|
80
|
+
Reactive MD 面向长文档和连续编辑。当前测量日期为 2026-11-20,环境为 Node 22.17、Intel Core Ultra 5 125H 与 Edge 135 headless、1440×1000。机器未固定频率,以下数字是可复现的实验证据,不是性能保证。
|
|
81
81
|
|
|
82
82
|
| 工作负载 | 结果 |
|
|
83
83
|
| --- | --- |
|
|
@@ -91,16 +91,16 @@ Reactive MD 面向长文档和连续编辑。当前测量日期为 2026-10-29,
|
|
|
91
91
|
|
|
92
92
|
编译器在 Worker 中运行,复用未变化的块,发布行级补丁,并为深层结构协商扁平结果格式。硬性预算会在异常输入冻结界面之前拒绝它:默认 10,000 个节点、1,000,000 个字符、100 层组件嵌套。
|
|
93
93
|
|
|
94
|
-
完整的 45 个场景矩阵、回归项、内存检查和复现命令见[性能说明](docs/development/performance-overview-ch.md),精简数据见 `benchmarks/performance-overview-2026-
|
|
94
|
+
完整的 45 个场景矩阵、回归项、内存检查和复现命令见[性能说明](docs/development/performance-overview-ch.md),精简数据见 `benchmarks/performance-overview-2026-11-20.json`。
|
|
95
95
|
|
|
96
96
|
## 体验 Demo
|
|
97
97
|
|
|
98
98
|
在线 Demo:[yaozi.raricy.com](https://yaozi.raricy.com/)
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
在 `ReactiveMD-Demo` 仓库根目录运行:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
npm ci
|
|
103
|
+
npm ci --legacy-peer-deps
|
|
104
104
|
npm run dev
|
|
105
105
|
```
|
|
106
106
|
|
|
@@ -115,12 +115,12 @@ npm run dev
|
|
|
115
115
|
- 打开俄罗斯方块与 2048 插件示例,分别体验定时驱动和回合制的外部组件。
|
|
116
116
|
- 把当前预览导出为单文件交互 HTML 或静态快照,然后在断网状态下打开。
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
在 ReactiveMD-Demo 仓库根目录验证集成:
|
|
119
119
|
|
|
120
120
|
```sh
|
|
121
121
|
npm run build
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
npm run test:runtime-extensions
|
|
123
|
+
npm run test:runtime-extensions -- --dev
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
脚本会自行启停服务,覆盖真实 Worker、两个插件示例、编辑器目录、移动端布局和离线导出,结果写入 `artifacts/demo-extensions/`。
|
|
@@ -162,12 +162,12 @@ export default { plugins: [reactiveMd({ extensions: './extensions.ts' })] };
|
|
|
162
162
|
|
|
163
163
|
Demo 提供两个完整的安装包案例:
|
|
164
164
|
|
|
165
|
-
| 包 | 标签 | 展示能力 |
|
|
165
|
+
| 包 | 标签 | 展示能力 | 更新流程 |
|
|
166
166
|
| --- | --- | --- | --- |
|
|
167
|
-
| `reactive-md-tetris-package` | `<tetris>` | 定时驱动游戏、键盘与按钮输入、种子方块、离线导出 |
|
|
168
|
-
| `reactive-md-game-2048-package` | `<game-2048>` | 回合制状态、确定性生成、键盘与按钮输入、静态预览 |
|
|
167
|
+
| `reactive-md-tetris-package` | `<tetris>` | 定时驱动游戏、键盘与按钮输入、种子方块、离线导出 | [Demo 候选包更新流程](https://github.com/yao1145/ReactiveMD-Demo/blob/main/docs/candidate-package-updates-ch.md) |
|
|
168
|
+
| `reactive-md-game-2048-package` | `<game-2048>` | 回合制状态、确定性生成、键盘与按钮输入、静态预览 | [Demo 候选包更新流程](https://github.com/yao1145/ReactiveMD-Demo/blob/main/docs/candidate-package-updates-ch.md) |
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
Demo 站点运行 `ReactiveMD-Demo/plugin/` 下的本地副本;`vendor/` 中提交的 tarball 是兼容性测试使用的安装包夹具。两个包的入口都通过公开的 `./react` 与 `./notices` 读取。它们的作者信息进入编辑器目录,能力证据支撑离线导出。
|
|
171
171
|
|
|
172
172
|
组件标签必须以字母开头,因此 2048 插件注册为 `<game-2048>`,而不是 `<2048>`。manifest、绑定、主题、资源、合规工具与打包流程见[组件插件开发指南](docs/development/component-development-ch.md)和[完整开发契约](docs/development/component-development-reference-ch.md)。
|
|
173
173
|
|
|
@@ -192,15 +192,15 @@ Reactive MD 需要 Node.js 22.12 或更新版本,包只提供 ESM 入口:
|
|
|
192
192
|
npm install reactive-md
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
0.
|
|
195
|
+
0.9.1 稳定版使用 `latest` 渠道。项目也可以固定版本。
|
|
196
196
|
|
|
197
197
|
```sh
|
|
198
198
|
npm install reactive-md
|
|
199
199
|
# 或固定版本
|
|
200
|
-
npm install reactive-md@0.
|
|
200
|
+
npm install reactive-md@0.9.1
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
升级前请阅读 [0.9.1 发布说明](docs/releases/release-0.9.1-ch.md)和[兼容性说明](docs/compatibility/compatibility-ch.md)。
|
|
204
204
|
|
|
205
205
|
### 升级到 0.8.0
|
|
206
206
|
|
|
@@ -211,7 +211,7 @@ npm install reactive-md@0.8.0
|
|
|
211
211
|
npm install reactive-md-editor@0.1.0
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
替换 `reactive-md/editor` 导入前,请阅读[0.8.0 发布说明](docs/releases/release-0.8.0-ch.md)和[三仓库迁移说明](docs/
|
|
214
|
+
替换 `reactive-md/editor` 导入前,请阅读[0.8.0 发布说明](docs/releases/release-0.8.0-ch.md)和[三仓库迁移说明](docs/releases/release-0.8.0-ch.md#仓库拆分与导入迁移)。`0.8.0` 保持语法 `local-draft-3`、`0.7.0` SDK 契约和现有状态协议,文档源码无需迁移。
|
|
215
215
|
|
|
216
216
|
`reactive-md` 入口提供本地编译器、表达式和运行时,`reactive-md/react` 提供 React 渲染器。组件样式通过 `reactive-md/styles.css` 引入。`reactive-md-editor` 提供源码编辑器,并使用独立样式 `reactive-md-editor/styles.css`。引擎 0.8 移除旧 `reactive-md/editor` 入口;已发布的 0.7 包仍保留它们。
|
|
217
217
|
|
|
@@ -230,6 +230,114 @@ if (result.ok) {
|
|
|
230
230
|
|
|
231
231
|
完整的编译与运行时 API、宿主 URL 策略、生命周期和样式覆盖见[本地模式集成](docs/integration/local-integration-ch.md)。
|
|
232
232
|
|
|
233
|
+
## 按任务选择入口
|
|
234
|
+
|
|
235
|
+
[公开接口参考](docs/reference/public-api-ch.md)逐个列出全部入口、导出、CLI 命令、浏览器协议与编辑器包,并注明各自的详细用途。下表按任务归纳引擎子路径。
|
|
236
|
+
|
|
237
|
+
每个子路径都是 ESM 入口,并带有自己的声明文件。按要做的事情选择;可选 peer 只出现在最后一列。
|
|
238
|
+
|
|
239
|
+
| 任务 | 入口 | 提供什么 | 刻意不包含 | React / Vite |
|
|
240
|
+
| --- | --- | --- | --- | --- |
|
|
241
|
+
| 单次编译并在内存中运行 | `reactive-md` | `compileLocal`、`createLocalCompileSession`、`createLocalRuntime`、表达式与曲线采样、状态导入导出与保留、宿主提供的 Worker 协议(`startLocalCompileWorker`、`LocalCompileScheduler`)、`createShareableHtml`、默认预设 | React、CSS、Vite、组件目录与工具栏命令、导出规划 | — |
|
|
242
|
+
| 在 Worker 或体积敏感包中编译 | `reactive-md/compiler` | `createCompiler` 与 `CompileResult` 契约:CommonMark、ReactiveMD 结构、表达式、绑定、预算 | React、CSS、编译 Worker 协议、会话、保留、共享/导出代码、默认预设、GFM、原生 HTML、Lezer 块规划、KaTeX 显示、曲线采样 | — |
|
|
243
|
+
| 单次编译保留完整语言能力 | `reactive-md/compiler/standard` | `createStandardCompiler`:在轻入口上增加 GFM、原生 HTML、Lezer 块规划、KaTeX 显示检查、曲线公式采样和默认预设 | React、CSS、编译 Worker 协议、会话、保留、共享/导出代码 | — |
|
|
244
|
+
| 用 React 渲染 | `reactive-md/react` | `LocalReactiveDocument`、`LocalDocumentView`、`defineReactComponentPackage`、`createReactHost`;构建把样式表提取为独立文件,不在导入时注入 | Node 构建与导出工具、编辑器 | React 19 与 `reactive-md/styles.css` |
|
|
245
|
+
| 在服务端渲染 | `reactive-md/react/server` | 带能力预检和诊断的 `renderLocalStaticDocument` | 客户端运行时、DOM、样式表 | React 19 + react-dom 19 |
|
|
246
|
+
| 渲染但不自动引入样式 | `reactive-md/react/unstyled` | 同样的组件,不带 CSS 副作用 | `styles.css` | React 19 |
|
|
247
|
+
| 编写交互组件 | `reactive-md/react/runtime` | `useTicker`、`useFrame`、`useSwipe`、`useKeys`、`useComponentState` | 文档渲染器、编译器 | React 19 |
|
|
248
|
+
| 发布组件包 | `reactive-md/sdk` | `defineLocalComponent`、`defineLocalPreset`,manifest、config、registry 与主题契约及校验 | React 实现、文档渲染、DOM | — |
|
|
249
|
+
| 驱动编辑器 | `reactive-md/authoring` | `analyzeLocalSource`、`completeLocalSource`、`formatLocalSource`、`renameLocalBinding`、组件目录与工具栏插入命令 | React、CSS、DOM、编译会话 | — |
|
|
250
|
+
| 导出前预检 | `reactive-md/export` | `createLocalExportPlan`、`createLocalShareableHtml`、恢复要求、组件状态文件、样式资源 | Vite 构建、React 渲染(标记由调用方提供)、CLI | — |
|
|
251
|
+
| 构建离线包 | `reactive-md/build` | `buildLocalStandaloneBundle`、预检、manifest 与封印、资源与 notice 收集 | 浏览器渲染、CLI | Vite 8(可选 peer,按需加载)、Node |
|
|
252
|
+
| 解析导出要内嵌的文件 | `reactive-md/export-assets` | `listExportAssets`、`resolveExportAsset`、`readExportAsset`,覆盖样式表、notice、包元数据与独立运行时 | 编译器、React、浏览器代码 | Node |
|
|
253
|
+
| 接入 Vite | `reactive-md/vite` | `reactiveMd()` 注册、开发期 host、`reactive-md-standalone.js` 与 `reactive-md-export.json` 产物 | 运行时 API、浏览器代码 | Vite 8、Node |
|
|
254
|
+
| 挂载导出的文档 | `reactive-md/standalone` | `mount`、`mountAll`、`isReactiveMDMounted`、载荷解析、挂载诊断与事件 | 编译入口、自动挂载、构建工具 | React 19 与 `reactive-md/styles.css` |
|
|
255
|
+
| 共享标识、随机、计时与组件状态 | `reactive-md/runtime` | 文档标识与种子、可复现随机、调度器、组件状态注册表与运行时服务 | 渲染、Web 存储、网络 | — |
|
|
256
|
+
| 在浏览器中保存组件状态 | `reactive-md/runtime/browser` | `createLocalBrowserStateStorage`、`flushComponentStateOnPageHide` | Node 持久化、运行时入口本身 | 浏览器存储对象 |
|
|
257
|
+
| 验证组件包 | `reactive-md/testing` | manifest 与行为一致性运行器、报告与对照工具 | React、DOM、浏览器 | — |
|
|
258
|
+
| 验证 SSR 输出 | `reactive-md/testing/react` | `runLocalReactCompliance`、`readLocalReactSpec`、错误探针、`checkLocalComplianceMarkup` | 浏览器驱动 | React 19 + react-dom 19 |
|
|
259
|
+
| 验证浏览器生命周期 | `reactive-md/testing/browser` | `runLocalBrowserCompliance`、驱动契约、`createPlaywrightBrowserDriver` | 对 Playwright 的依赖 | 真实浏览器上下文 |
|
|
260
|
+
| 安装内置组件 | `reactive-md/presets/default` | `defaultPreset`:内置标签的 manifest 数据 | 引擎运行时、React 实现 | — |
|
|
261
|
+
| 只安装其中一部分 | `reactive-md/presets/default/packs` | `controlsPack`、`layoutPack`、`dataPack`、`visualsPack` | 包外的组件 | — |
|
|
262
|
+
| 设置文档样式 | `reactive-md/styles.css` | 按已发布层叠顺序组织的组件、主题与文档层 | JavaScript | — |
|
|
263
|
+
| 打印文档 | `reactive-md/print.css` | 隐藏控件、显示 `.local-print-value` 的打印规则 | 屏幕布局 | 在 `styles.css` 之后引入 |
|
|
264
|
+
| 随包分发第三方声明 | `reactive-md/notices` | 生成的 `THIRD_PARTY_NOTICES.md` 文本 | 代码 | — |
|
|
265
|
+
| 直接放入预构建运行时 | `reactive-md/assets/standalone.js` | 带 `ReactiveMD.mount`、`mountAll` 和导出载荷自动挂载的 IIFE 构建 | ESM 导入、tree shaking、编译器 | 一个 script 标签与 `reactive-md/styles.css` |
|
|
266
|
+
|
|
267
|
+
`reactive-md`(根入口)是完整核心面:默认预设、增量会话、状态与保留工具、Worker 协议和共享 HTML 封装。`reactive-md/compiler` 是轻入口,不含 React、CSS、Worker、会话和默认预设。`reactive-md/compiler/standard` 在此基础上加入 GFM、原生 HTML、Lezer 块规划、KaTeX 显示检查、曲线采样和默认预设,仍然不含 React、CSS、Worker 和会话。`npm run test:compiler-entry` 每次构建都检查这条分界:遍历根、compiler 与 standard 三个依赖图,记录各自文件数和字节数;编译入口一旦触及 Worker、会话、保留、共享、导出、React、standalone 或预设模块、样式表或主题协议,检查即失败。
|
|
268
|
+
|
|
269
|
+
### 最小可用代码
|
|
270
|
+
|
|
271
|
+
**编译并在内存中运行**
|
|
272
|
+
|
|
273
|
+
```js
|
|
274
|
+
import { compileLocal, createLocalRuntime } from 'reactive-md';
|
|
275
|
+
|
|
276
|
+
const result = compileLocal('<number bind="n" label="数量" initial="2">');
|
|
277
|
+
if (!result.ok) throw new Error(result.diagnostics.map(item => item.message).join('\n'));
|
|
278
|
+
|
|
279
|
+
const runtime = createLocalRuntime(result.document);
|
|
280
|
+
try { console.log(runtime.text('合计:{{ n * 100 }}')); }
|
|
281
|
+
finally { runtime.dispose(); }
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**只编译,不创建运行时**
|
|
285
|
+
|
|
286
|
+
```js
|
|
287
|
+
import { createCompiler } from 'reactive-md/compiler';
|
|
288
|
+
import { createStandardCompiler } from 'reactive-md/compiler/standard';
|
|
289
|
+
|
|
290
|
+
console.log(createCompiler().compile('# 标题\n\n普通 **Markdown**。').status); // 'valid'
|
|
291
|
+
console.log(createStandardCompiler().compile('| a | b |\n| - | - |\n| 1 | 2 |').status); // 'valid'
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**用 React 渲染**
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
import { LocalReactiveDocument } from 'reactive-md/react';
|
|
298
|
+
import 'reactive-md/styles.css';
|
|
299
|
+
|
|
300
|
+
export function Article({ source }: { source: string }) {
|
|
301
|
+
return <LocalReactiveDocument source={source} />;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**在编辑器中提供作者工具**
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
import { analyzeLocalSource, insertLocalComponentFromOptions } from 'reactive-md/authoring';
|
|
309
|
+
|
|
310
|
+
const analysis = analyzeLocalSource(source);
|
|
311
|
+
const edit = insertLocalComponentFromOptions(undefined, 'chart', source, { start: 0, end: 0 });
|
|
312
|
+
console.log(analysis.bindings, edit.value);
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**导出与构建**
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
import { buildLocalStandaloneBundle } from 'reactive-md/build';
|
|
319
|
+
import { createLocalExportPlan } from 'reactive-md/export';
|
|
320
|
+
|
|
321
|
+
const bundle = await buildLocalStandaloneBundle({ entry: '.reactive-md/host.mjs' });
|
|
322
|
+
const plan = createLocalExportPlan({ document, config, target: 'offline', bundle });
|
|
323
|
+
if (!plan.ok) throw new Error(plan.diagnostics.map(item => item.message).join('\n'));
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
**测试组件包**
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
import { LOCAL_BEHAVIOR_SPEC_PROTOCOL, runLocalBehaviorCompliance, runLocalManifestCompliance } from 'reactive-md/testing';
|
|
330
|
+
|
|
331
|
+
const manifest = runLocalManifestCompliance(widgetManifest);
|
|
332
|
+
const behavior = runLocalBehaviorCompliance({
|
|
333
|
+
protocol: LOCAL_BEHAVIOR_SPEC_PROTOCOL,
|
|
334
|
+
component: 'my-widget',
|
|
335
|
+
source,
|
|
336
|
+
binding: 'value',
|
|
337
|
+
}, config);
|
|
338
|
+
console.log([...manifest.cases, ...behavior.cases].filter(item => item.status === 'failed'));
|
|
339
|
+
```
|
|
340
|
+
|
|
233
341
|
## 在 React 中使用
|
|
234
342
|
|
|
235
343
|
React 入口需要 React 19:
|
|
@@ -251,7 +359,7 @@ export function Article({ source }: { source: string }) {
|
|
|
251
359
|
|
|
252
360
|
## 用 React 编辑源码
|
|
253
361
|
|
|
254
|
-
可复用的源码编辑器位于独立包 `reactive-md-editor
|
|
362
|
+
可复用的源码编辑器位于独立包 `reactive-md-editor`(`0.2.0`,支持 `reactive-md@0.9.x` 系列),使用独立样式表,与引擎一起安装。0.7 中它以 `reactive-md/editor` 提供;自 0.8 起独立为单独的包。组件是受控的,需要 React 19:
|
|
255
363
|
|
|
256
364
|
```tsx
|
|
257
365
|
import { useState } from 'react';
|
|
@@ -299,23 +407,24 @@ benchmarks/ 带来源说明的精简性能数据
|
|
|
299
407
|
- [可分享文档与静态导出](docs/integration/shareable-export-ch.md):CLI build/lint、状态文件、本地图片内联、打印与独立浏览器运行时。
|
|
300
408
|
- [React 源码编辑器](docs/integration/editor-ch.md)与[作者工具](docs/integration/author-tools-ch.md)。
|
|
301
409
|
- [组块协议](docs/development/component-protocol-ch.md)与[组件插件开发指南](docs/development/component-development-ch.md)。
|
|
410
|
+
- [扩展开发教程](docs/development/extension-tutorial-ch.md):选择入口、编写组件包并验证。
|
|
302
411
|
- [版本与兼容性](docs/compatibility/compatibility-ch.md)。
|
|
303
|
-
- [性能说明](docs/development/performance-overview-ch.md)与[发布清单](
|
|
304
|
-
- [0.
|
|
412
|
+
- [性能说明](docs/development/performance-overview-ch.md)与[发布清单](CONTRIBUTING-ch.md#发布流程)。
|
|
413
|
+
- [0.9.1 发布说明](docs/releases/release-0.9.1-ch.md)和[历史发布记录](docs/releases)。
|
|
305
414
|
|
|
306
415
|
## 支持与状态
|
|
307
416
|
|
|
308
|
-
- CI 使用 Node
|
|
417
|
+
- CI 使用 Node 24 运行引擎检查和预设脚手架验证。打包消费者检查覆盖静态 SSR。构建后运行 `node scripts/verify-shareable.mjs`,可用 Chromium 验证单文件水合并测量 standalone 体积。
|
|
309
418
|
- 0.x 次版本可能包含破坏性变更。请保存原始 `.reactive.md` 源码,而不是运行时 AST 或内存状态。
|
|
310
|
-
- `0.
|
|
311
|
-
- 扩展 SDK 契约为 `0.7.0
|
|
419
|
+
- `0.9.1` 是 `latest` 渠道的稳定版本。安全修复可能随次版本发布。
|
|
420
|
+
- 扩展 SDK 契约为 `0.7.0`。组件包、主题、Vite 适配器、离线构建和合规工具均使用公开入口。
|
|
312
421
|
|
|
313
422
|
## 贡献与安全
|
|
314
423
|
|
|
315
424
|
- [贡献指南](CONTRIBUTING-ch.md):环境、检查命令和改动要求。
|
|
316
425
|
- [安全策略](SECURITY-ch.md):威胁边界、资源上限、宿主责任和漏洞报告渠道。
|
|
317
426
|
- [变更记录](CHANGELOG-ch.md)。
|
|
318
|
-
- [发布清单](
|
|
427
|
+
- [发布清单](CONTRIBUTING-ch.md#发布流程):验证门禁、notice、tarball 和人工发布流程。
|
|
319
428
|
|
|
320
429
|
## 许可证
|
|
321
430
|
|