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
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
本文说明 `local-draft-2` 新增的单文件 HTML 导出能力。编译与运行时接口见[本地模式集成](local-integration-ch.md),语法见[交互语法规范](../reference/local-interaction-syntax-ch.md),修订声明与迁移见[源码修订与迁移](../compatibility/source-versioning-ch.md),升级说明见[0.4.0 发布与迁移](../releases/release-0.4.0-ch.md)。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 导出产物
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
交互导出保存 RMD 状态基线、能力开关与 `sourceSemantics: "mixed-rmd-v1"`。运行时按旧语义读取历史导出。静态导出使用选择的状态而不启动作者脚本。参见 [HTML 兼容](../reference/html-compatibility-ch.md)。
|
|
10
|
+
|
|
11
|
+
直接调用 `createShareableHtml` 时,请用与导出一致的 CSS 和扩展 HTML 授权渲染 `staticMarkup`。导出关闭某项能力时,函数会拒绝仍使用该能力的快照。
|
|
10
12
|
|
|
11
13
|
**交互式 HTML** 是一个自包含的 `.html` 文件。它内嵌原始源码、独立浏览器运行时、React 19、样式表和打印样式。读者通过 `file://` 打开即可交互,不需要 Node.js、React、reactive-md 包或网络连接。
|
|
12
14
|
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
|
|
15
17
|
**静态 HTML**(`--mode static`)只包含只读结果,不携带可执行运行时。它适合邮件附件、归档和静态站点。供交互使用的按钮、表单控件和重置操作会被移除。
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
**静态 PDF**(`--format pdf`)使用 Chromium 将静态 HTML 排版为分页文档。三个产物共用 React 渲染,使用所选状态计算条件内容、插值、表格、公式和图表。
|
|
18
20
|
|
|
19
21
|
## CLI
|
|
20
22
|
|
|
@@ -33,7 +35,9 @@ reactive-md lint "docs/**/*.reactive.md" --json --strict
|
|
|
33
35
|
| 选项 | 含义 |
|
|
34
36
|
| --- | --- |
|
|
35
37
|
| `-o, --output <file>` | 必填输出路径;父目录必须已存在。 |
|
|
36
|
-
| `--mode interactive\|static` |
|
|
38
|
+
| `--mode interactive\|static` | HTML 默认 `interactive`,PDF 使用 `static`。 |
|
|
39
|
+
| `--format html\|pdf` | 文件格式,默认 HTML。 |
|
|
40
|
+
| `--project-root <dir>` | 在可信项目目录中装配精简预设,自动发现 `plugin/` 与 `theme/`。需要 Vite。 |
|
|
37
41
|
| `--state-file <json>` | 使用经过校验的 `reactive-md-state/v1` 文件作为打开和重置基线。 |
|
|
38
42
|
| `--component-state-file <json>` | 将经过校验的 `reactive-md-component-state/v1` sidecar 写入交互式 HTML;静态导出拒绝该选项。 |
|
|
39
43
|
| `--document-id <id>` | 组件状态的稳定文档身份;默认使用源码摘要。 |
|
|
@@ -55,11 +59,21 @@ reactive-md lint "docs/**/*.reactive.md" --json --strict
|
|
|
55
59
|
| `4` | 输入/输出文件错误 |
|
|
56
60
|
| `5` | 资源或安全策略错误 |
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
使用 `--state-file` 指定导出状态。直接构建 PDF 时先安装可选引擎。
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npm install playwright
|
|
66
|
+
npx playwright install chromium
|
|
67
|
+
reactive-md build doc.reactive.md -o doc.pdf --format pdf --pdf-margin 12mm
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
默认纸张为 A4,纵向排版并打印背景。可用 `--pdf-paper Letter`、`--pdf-landscape` 和 `--pdf-background off` 调整。Node 调用方也可以将静态 HTML 传给 `reactive-md/pdf` 的 `renderLocalPdf`,获取 PDF 字节。
|
|
71
|
+
|
|
72
|
+
`--pdf-margin` 覆盖默认页边距。Chromium 无法解码图片时,CLI 会发出警告。加上 `--strict` 会终止导出。
|
|
59
73
|
|
|
60
74
|
## 迁移源码
|
|
61
75
|
|
|
62
|
-
`reactive-md migrate` 把单份源码的修订声明迁移到 `local-draft-
|
|
76
|
+
`reactive-md migrate` 把单份源码的修订声明迁移到 `local-draft-3`:
|
|
63
77
|
|
|
64
78
|
```sh
|
|
65
79
|
reactive-md migrate old.reactive.md --from local-draft-1 -o new.reactive.md
|
|
@@ -79,7 +93,7 @@ reactive-md migrate old.reactive.md --check --json
|
|
|
79
93
|
```json
|
|
80
94
|
{
|
|
81
95
|
"format": "reactive-md-state/v1",
|
|
82
|
-
"syntax": "local-draft-
|
|
96
|
+
"syntax": "local-draft-3",
|
|
83
97
|
"sourceDigest": "fnv1a32:0123abcd",
|
|
84
98
|
"parameters": {
|
|
85
99
|
"people": 7,
|
|
@@ -212,7 +226,7 @@ handle.unmount();
|
|
|
212
226
|
```html
|
|
213
227
|
<div id="doc"></div>
|
|
214
228
|
<script type="application/reactive-md+json" data-reactive-md-auto>
|
|
215
|
-
{"version":1,"target":"doc","source":"# Hello","state":{"format":"reactive-md-state/v1","syntax":"local-draft-
|
|
229
|
+
{"version":1,"target":"doc","source":"# Hello","state":{"format":"reactive-md-state/v1","syntax":"local-draft-3","sourceDigest":"fnv1a32:01209266","parameters":{}},"locale":"en","colorScheme":"auto","hydrate":false}
|
|
216
230
|
</script>
|
|
217
231
|
```
|
|
218
232
|
|
|
@@ -234,6 +248,37 @@ IIFE 会注册一个 Light DOM 自定义元素。简单选项通过属性传递
|
|
|
234
248
|
|
|
235
249
|
元素使用 Light DOM,以复用现有文档样式、标题锚点和打印样式。本版本不提供 Shadow DOM。
|
|
236
250
|
|
|
251
|
+
## 导出资源清单
|
|
252
|
+
|
|
253
|
+
需要引擎文件本身来生成导出 HTML 或独立页面时,使用 `reactive-md/export-assets`:
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
import { listExportAssets, readExportAsset, resolveExportAsset } from 'reactive-md/export-assets';
|
|
257
|
+
|
|
258
|
+
for (const asset of listExportAssets().assets) {
|
|
259
|
+
console.log(asset.id, asset.specifier, asset.description);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const css = readExportAsset('base-css');
|
|
263
|
+
const runtimeUrl = resolveExportAsset('runtime'); // 文件 URL
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
清单的 `protocol` 为 `reactive-md-export-assets/v1`,条目列表冻结,id 在版本之间保持稳定:
|
|
267
|
+
|
|
268
|
+
| id | 公开 specifier | 内容 |
|
|
269
|
+
| --- | --- | --- |
|
|
270
|
+
| `base-css` | `reactive-md/styles.css` | 文档样式表 |
|
|
271
|
+
| `print-css` | `reactive-md/print.css` | 打印样式表 |
|
|
272
|
+
| `notices` | `reactive-md/notices` | 第三方许可证声明 |
|
|
273
|
+
| `package-json` | `reactive-md/package.json` | 包元数据,包含导出记录使用的版本号 |
|
|
274
|
+
| `runtime` | `reactive-md/assets/standalone.js` | 独立浏览器运行时 |
|
|
275
|
+
|
|
276
|
+
`resolveExportAsset(id)` 通过 `import.meta.resolve` 解析已安装包并返回文件 URL,`readExportAsset(id)` 返回 UTF-8 内容,未知 id 抛出 `TypeError`。
|
|
277
|
+
|
|
278
|
+
稳定性范围包括协议字符串、id 和 `specifier` 的含义。tarball 内部布局与条目背后的文件数量会随发布变化,因此构建工具通过这个入口读取资源,而不去遍历 `node_modules/reactive-md`。该入口使用 `node:fs`,服务于 Vite、构建和 CLI 工具;浏览器、React、编译器和根入口都不引用它。
|
|
279
|
+
|
|
280
|
+
Demo 的 `vite.export-assets.ts` 用它把样式表、打印样式表、notices、包元数据和独立运行时暴露为构建期字符串模块。
|
|
281
|
+
|
|
237
282
|
## 安全边界
|
|
238
283
|
|
|
239
284
|
- 核心与 React 入口继续保持 React external;只有 standalone IIFE 打包 React。
|
|
@@ -245,21 +290,18 @@ IIFE 会注册一个 Light DOM 自定义元素。简单选项通过属性传递
|
|
|
245
290
|
|
|
246
291
|
## 产物体积基线
|
|
247
292
|
|
|
248
|
-
`
|
|
293
|
+
在引擎源码目录完成构建后,运行 `node scripts/verify-shareable.mjs` 检查静态首屏水合并测量原始及 gzip 体积。体积阈值以当前完整预设构建为基线。
|
|
249
294
|
|
|
250
295
|
| 产物 | 当前基线 | 报警阈值 |
|
|
251
296
|
| --- | --- | --- |
|
|
252
|
-
| `reactive-md-standalone.js` |
|
|
253
|
-
| `reactive-md-standalone.css` |
|
|
254
|
-
|
|
255
|
-
0.5 基线包含语法高亮器和常见语言语法,离线文件也能高亮。
|
|
297
|
+
| `reactive-md-standalone.js` | 3.66 MiB / gzip 1,135 KiB | 4 MiB / gzip 1,250 KiB |
|
|
298
|
+
| `reactive-md-standalone.css` | 616 KiB / gzip 293 KiB | 680 KiB / gzip 325 KiB |
|
|
256
299
|
|
|
257
|
-
|
|
300
|
+
生成的 HTML 还包含源码、notices 和内联图片。
|
|
258
301
|
|
|
259
302
|
## 当前范围
|
|
260
303
|
|
|
261
|
-
|
|
304
|
+
CLI 提供 `build`、`lint` 和 `migrate`。导出格式包括交互 HTML、静态 HTML 和静态 PDF。标准 HTML 导出支持状态文件和本地位图内联,交互 HTML 还支持组件状态 sidecar、自动挂载、standalone API 和 Web Component。
|
|
262
305
|
|
|
263
|
-
本版本不包含:`format`、UMD、远程图片抓取、SVG 内联、框架插件(Vite、Astro、Docusaurus、Next.js)、Shadow DOM,以及单文件导出之外的通用 SSR 水合保证。
|
|
264
306
|
|
|
265
307
|
单文件静态首屏水合由 Playwright Chromium 和本地 Edge 检查覆盖。Firefox、Safari/WebKit 以及通用服务端水合尚未验证,不作支持声明。
|
|
@@ -6,7 +6,9 @@ This guide covers the single-file HTML exporter introduced with `local-draft-2`.
|
|
|
6
6
|
|
|
7
7
|
## Output modes
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Interactive exports save the RMD state baseline, capability flags and `sourceSemantics: "mixed-rmd-v1"`. The runtime’s legacy reader preserves the original interpretation of older exports. Static output uses the selected state without executing author scripts. See [HTML compatibility](../reference/html-compatibility-en.md).
|
|
10
|
+
|
|
11
|
+
When calling `createShareableHtml` directly, render `staticMarkup` with the same CSS and Extended HTML grants as the export. The function rejects a snapshot that still uses a capability disabled for the export.
|
|
10
12
|
|
|
11
13
|
**Interactive HTML** is one self-contained `.html` file. It embeds the original source, the standalone browser runtime, React 19, the current stylesheet and print styles. Readers can open it through `file://` without Node.js, React, the reactive-md package or network access.
|
|
12
14
|
|
|
@@ -14,7 +16,7 @@ The first rendered pass is static. After the embedded runtime hydrates it, contr
|
|
|
14
16
|
|
|
15
17
|
**Static HTML** (`--mode static`) contains read-only values and no executable script cargo. It is intended for archives, static sites and email attachments. Interactive action buttons, form widgets and the reset action are removed.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
**Static PDF** (`--format pdf`) prints the static HTML through Chromium. All three formats use the same React renderer and evaluate conditional content, interpolations, tables, formulas, and charts against the selected state.
|
|
18
20
|
|
|
19
21
|
## CLI
|
|
20
22
|
|
|
@@ -35,7 +37,9 @@ Build options:
|
|
|
35
37
|
| Option | Meaning |
|
|
36
38
|
| --- | --- |
|
|
37
39
|
| `-o, --output <file>` | Required output path. Its parent directory must already exist. |
|
|
38
|
-
| `--mode interactive\|static` |
|
|
40
|
+
| `--mode interactive\|static` | HTML defaults to `interactive`. PDF uses `static`. |
|
|
41
|
+
| `--format html\|pdf` | File format. Defaults to HTML. |
|
|
42
|
+
| `--project-root <dir>` | Use the minimal preset and discover `plugin/` and `theme/` in a trusted project directory. Requires Vite. |
|
|
39
43
|
| `--state-file <json>` | Use a validated `reactive-md-state/v1` file as the starting and reset baseline. |
|
|
40
44
|
| `--component-state-file <json>` | Embed a validated `reactive-md-component-state/v1` sidecar in interactive HTML. Static output rejects it. |
|
|
41
45
|
| `--document-id <id>` | Stable document identity used to scope component state. Default: the source digest. |
|
|
@@ -57,11 +61,21 @@ Exit codes are separate so build automation can distinguish failures:
|
|
|
57
61
|
| `4` | Input/output file failure |
|
|
58
62
|
| `5` | Asset or security-policy failure |
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
Pass `--state-file` to select the export state. Install the optional print engine to build a PDF.
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
npm install playwright
|
|
68
|
+
npx playwright install chromium
|
|
69
|
+
reactive-md build doc.reactive.md -o doc.pdf --format pdf --pdf-margin 12mm
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
PDF output defaults to A4 portrait with backgrounds. Use `--pdf-paper Letter`, `--pdf-landscape`, or `--pdf-background off` to change those settings. In Node, pass static HTML to `renderLocalPdf` from `reactive-md/pdf` to get the PDF bytes.
|
|
73
|
+
|
|
74
|
+
Use `--pdf-margin` to override the default page margins. The CLI warns when Chromium cannot decode an image. With `--strict`, it stops the export.
|
|
61
75
|
|
|
62
76
|
## Migrating source
|
|
63
77
|
|
|
64
|
-
`reactive-md migrate` moves one source revision declaration to `local-draft-
|
|
78
|
+
`reactive-md migrate` moves one source revision declaration to `local-draft-3`:
|
|
65
79
|
|
|
66
80
|
```sh
|
|
67
81
|
reactive-md migrate old.reactive.md --from local-draft-1 -o new.reactive.md
|
|
@@ -81,7 +95,7 @@ A state file has this versioned shape:
|
|
|
81
95
|
```json
|
|
82
96
|
{
|
|
83
97
|
"format": "reactive-md-state/v1",
|
|
84
|
-
"syntax": "local-draft-
|
|
98
|
+
"syntax": "local-draft-3",
|
|
85
99
|
"sourceDigest": "fnv1a32:0123abcd",
|
|
86
100
|
"parameters": {
|
|
87
101
|
"people": 7,
|
|
@@ -214,7 +228,7 @@ handle.unmount();
|
|
|
214
228
|
```html
|
|
215
229
|
<div id="doc"></div>
|
|
216
230
|
<script type="application/reactive-md+json" data-reactive-md-auto>
|
|
217
|
-
{"version":1,"target":"doc","source":"# Hello","state":{"format":"reactive-md-state/v1","syntax":"local-draft-
|
|
231
|
+
{"version":1,"target":"doc","source":"# Hello","state":{"format":"reactive-md-state/v1","syntax":"local-draft-3","sourceDigest":"fnv1a32:01209266","parameters":{}},"locale":"en","colorScheme":"auto","hydrate":false}
|
|
218
232
|
</script>
|
|
219
233
|
```
|
|
220
234
|
|
|
@@ -236,6 +250,37 @@ The IIFE registers a light-DOM custom element. Simple options are attributes; co
|
|
|
236
250
|
|
|
237
251
|
The element uses Light DOM so the existing document CSS, heading anchors and print styles apply. Shadow DOM is intentionally out of scope for this release.
|
|
238
252
|
|
|
253
|
+
## Export assets for hosts
|
|
254
|
+
|
|
255
|
+
Hosts that assemble exported or standalone HTML need the engine files themselves. `reactive-md/export-assets` is the supported way to find and read them:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
import { listExportAssets, readExportAsset, resolveExportAsset } from 'reactive-md/export-assets';
|
|
259
|
+
|
|
260
|
+
for (const asset of listExportAssets().assets) {
|
|
261
|
+
console.log(asset.id, asset.specifier, asset.description);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
const css = readExportAsset('base-css');
|
|
265
|
+
const runtimeUrl = resolveExportAsset('runtime'); // file URL
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The manifest reports `protocol: 'reactive-md-export-assets/v1'` and a frozen entry list. Ids stay stable across releases:
|
|
269
|
+
|
|
270
|
+
| Id | Public specifier | Content |
|
|
271
|
+
| --- | --- | --- |
|
|
272
|
+
| `base-css` | `reactive-md/styles.css` | Document stylesheet |
|
|
273
|
+
| `print-css` | `reactive-md/print.css` | Print stylesheet |
|
|
274
|
+
| `notices` | `reactive-md/notices` | Third-party license notices |
|
|
275
|
+
| `package-json` | `reactive-md/package.json` | Package metadata, including the version exports record |
|
|
276
|
+
| `runtime` | `reactive-md/assets/standalone.js` | Standalone browser runtime |
|
|
277
|
+
|
|
278
|
+
`resolveExportAsset(id)` resolves the installed package through `import.meta.resolve` and returns a file URL; `readExportAsset(id)` returns the UTF-8 contents. Unknown ids throw a `TypeError`.
|
|
279
|
+
|
|
280
|
+
The stability contract covers the protocol string, the ids and the meaning of `specifier`. Tarball layout and the files behind an entry change between releases, so build tooling reads assets through this entry point instead of walking `node_modules/reactive-md`. The entry uses `node:fs` and belongs to Vite, build and CLI tooling; no browser, React, compiler or root entry imports it.
|
|
281
|
+
|
|
282
|
+
The demo's `vite.export-assets.ts` uses it to expose the stylesheet, print stylesheet, notices, package metadata and standalone runtime as build-time string modules.
|
|
283
|
+
|
|
239
284
|
## Security boundaries
|
|
240
285
|
|
|
241
286
|
- Core and React entry points keep React external. Only the standalone IIFE bundles React.
|
|
@@ -247,21 +292,18 @@ The element uses Light DOM so the existing document CSS, heading anchors and pri
|
|
|
247
292
|
|
|
248
293
|
## Bundle baseline
|
|
249
294
|
|
|
250
|
-
|
|
295
|
+
In the engine checkout, run `node scripts/verify-shareable.mjs` after building. It tests static-first hydration and reports the raw and gzip sizes. The current full-preset build sets the baseline for the current size limits.
|
|
251
296
|
|
|
252
297
|
| Artifact | Current baseline | Alarm |
|
|
253
298
|
| --- | --- | --- |
|
|
254
|
-
| `reactive-md-standalone.js` |
|
|
255
|
-
| `reactive-md-standalone.css` |
|
|
256
|
-
|
|
257
|
-
The 0.5 baseline includes the syntax highlighter and common language grammars for offline use.
|
|
299
|
+
| `reactive-md-standalone.js` | 3.66 MiB / 1,135 KiB gzip | 4 MiB / 1,250 KiB gzip |
|
|
300
|
+
| `reactive-md-standalone.css` | 616 KiB / 293 KiB gzip | 680 KiB / 325 KiB gzip |
|
|
258
301
|
|
|
259
|
-
|
|
302
|
+
The generated HTML also contains the source, notices and any inlined images.
|
|
260
303
|
|
|
261
304
|
## Current scope
|
|
262
305
|
|
|
263
|
-
|
|
306
|
+
The CLI provides `build`, `lint`, and `migrate`. Export formats include interactive HTML, static HTML, and static PDF. Standard HTML export supports state files and local raster inlining. Interactive HTML also supports component-state sidecars, standalone mount APIs, auto-mount, and the Web Component.
|
|
264
307
|
|
|
265
|
-
Not included in this release: `format`, UMD, remote image fetching, SVG inlining, framework plugins (Vite, Astro, Docusaurus, Next.js), Shadow DOM, and general SSR hydration guarantees outside the single-file export path.
|
|
266
308
|
|
|
267
309
|
Single-file static-first hydration is covered by the Playwright Chromium checks and local Edge checks. Firefox, Safari/WebKit and general server-side hydration remain unverified and are not claimed as supported.
|
|
@@ -1,60 +1,28 @@
|
|
|
1
|
-
# HTML
|
|
1
|
+
# HTML 兼容与作者能力
|
|
2
2
|
|
|
3
3
|
**中文** · [English](html-compatibility-en.md)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`strict: false` 可在默认文档路径中启用[局部结构恢复](tolerance-ch.md),无需开启上述能力。`details` 的 `summary` 与正文可连续换行,呈现为单个 disclosure 的 accordion,支持富文本标题和键盘切换。
|
|
8
|
-
|
|
9
|
-
## 暂时性分流政策
|
|
10
|
-
|
|
11
|
-
为了避开作者 CSS、JavaScript、扩展 HTML 与 ReactiveMD 之间的混合解析和渲染冲突,本版采用整篇分流:
|
|
12
|
-
|
|
13
|
-
| 编译选项 | 文档行为 |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| 三个开关全部关闭或省略 | 使用 ReactiveMD 解析器和现有 React 渲染器,支持 P0 HTML |
|
|
16
|
-
| 任意一个开关为 `true` | 整篇源码按原生 HTML 处理,在隔离的 iframe 中渲染 |
|
|
17
|
-
|
|
18
|
-
原生 HTML 路径中的 `# 标题`、`**强调**`、LaTeX 和 `{{ 表达式 }}` 保持普通文本;`<input>`、`<table>` 等按 HTML 语义处理,ReactiveMD 组件不建立绑定。关闭全部开关会重新编译回默认模式。此政策是本版的过渡方案,后续版本再评估混合兼容。
|
|
19
|
-
|
|
20
|
-
开关是宿主能力设置,源码、参数状态文件和文档标签不能自行开启它们。Demo 始终显示当前模式,刷新页面后回到三个开关全部关闭的状态。
|
|
21
|
-
|
|
22
|
-
## 开关与 API
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { compileLocal } from 'reactive-md';
|
|
26
|
-
|
|
27
|
-
// Markdown、ReactiveMD 与 P0 HTML。
|
|
28
|
-
const reactive = compileLocal(source);
|
|
29
|
-
|
|
30
|
-
// 整篇按原生 HTML 处理;只允许作者 CSS。
|
|
31
|
-
const html = compileLocal(source, {
|
|
32
|
-
enableCss: true,
|
|
33
|
-
enableJavaScript: false,
|
|
34
|
-
enableExtendedHtml: false,
|
|
35
|
-
});
|
|
36
|
-
```
|
|
5
|
+
同一份文档可混排 Markdown、RMD 组件、表达式和基础 HTML。宿主独立控制三项能力。
|
|
37
6
|
|
|
38
7
|
| 选项 | 默认值 | 作用 |
|
|
39
8
|
| --- | --- | --- |
|
|
40
|
-
| `enableCss` | `
|
|
41
|
-
| `enableJavaScript` | `false` |
|
|
42
|
-
| `enableExtendedHtml` | `false` |
|
|
9
|
+
| `enableCss` | `true` | 文档样式、组件行内声明及获准 HTML 片段中的样式 |
|
|
10
|
+
| `enableJavaScript` | `false` | 在交互挂载时执行作者脚本 |
|
|
11
|
+
| `enableExtendedHtml` | `false` | 允许额外的原生 HTML 片段 |
|
|
43
12
|
|
|
44
|
-
|
|
13
|
+
源码视图从 `LocalReactiveDocument.compileOptions` 取得授权。预编译视图通过 `LocalDocumentView.capabilityGrants` 授权,缺省为 CSS 开、JavaScript 关、扩展 HTML 关。每项能力需要编译与当前挂载同时允许。单独切换开关保留源码视图的运行时状态。
|
|
45
14
|
|
|
46
|
-
|
|
15
|
+
### 样式
|
|
47
16
|
|
|
48
|
-
|
|
17
|
+
在正文前放一个或多个成对的 `<css>` 块,按源码顺序层叠。组件实例的 `css` 属性接收 CSS 声明,应用到可见根。文档选择器止于嵌套文档根,DOM 的 CSS 继承照常生效。作者样式使用文内规则,外链样式表和样式资源请求受策略过滤。迟置样式块和无可见根的组件会收到定点诊断。已注册的 `css`、`javascript` 组件保留各自的标签,组件 schema 自行定义的 `css` 属性保留原有语义。
|
|
49
18
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
compileOptions={{ enableCss: true }}
|
|
54
|
-
/>
|
|
55
|
-
```
|
|
19
|
+
### 脚本
|
|
20
|
+
|
|
21
|
+
用成对的 `<javascript>` 声明代码。交互运行时恢复状态后,隔离 Worker 按源码顺序执行脚本。每个块有自己的词法作用域。通过 `await rmd.get(name)` 读取命名绑定,通过 `await rmd.set(name, value)` 写入单项,或通过 `await rmd.setMany(values)` 原子更新多项。写入沿用组件的约束和只读规则。
|
|
56
22
|
|
|
57
|
-
|
|
23
|
+
通过计数器的 `action-id` 命名实例。调用 `rmd.handleAction(id, "increment", callback)` 接管该实例的增加动作。计数器还提供 `decrement` 和 `reset`。用 `rmd.observeAction` 观察动作,默认处理照常运行。替换脚本、撤销授权或卸载文档时清理会话。静态 HTML、PDF 和 hydration 的静态阶段使用给定的 RMD 状态。
|
|
24
|
+
|
|
25
|
+
异步预览重新编译时,可用 `LocalDocumentView.authorScriptPaused` 暂停作者动作和绑定请求。确认脚本未变后恢复原会话。撤销计数器 `action-id` 的删除后,同一脚本会话可继续接管这个动作。
|
|
58
26
|
|
|
59
27
|
## 默认支持的 P0 HTML
|
|
60
28
|
|
|
@@ -83,7 +51,7 @@ React 快捷组件通过 `compileOptions` 接收同样的设置:
|
|
|
83
51
|
<p align="right">右对齐的 **Markdown** 段落。</p>
|
|
84
52
|
```
|
|
85
53
|
|
|
86
|
-
对齐不需要开启 CSS 或扩展 HTML,容器内的 Markdown
|
|
54
|
+
对齐不需要开启 CSS 或扩展 HTML,容器内的 Markdown 和绑定继续生效;嵌套元素可以设置自己的对齐。
|
|
87
55
|
|
|
88
56
|
通用属性按允许列表接收,支持文档标识、标题、语言、方向和可访问性属性。默认模式中的作者 `style`、事件处理属性及不支持的标签保持惰性源码或产生定位诊断。图片仍需宿主明确允许后才加载。代码与不支持区域不执行脚本。
|
|
89
57
|
|
|
@@ -114,27 +82,12 @@ React 快捷组件通过 `compileOptions` 接收同样的设置:
|
|
|
114
82
|
|
|
115
83
|
无法编译的局部原生 HTML 按原文显示,其余 Markdown、公式和控件继续工作。回退覆盖不支持的标签或属性、无效的原生表格,以及缺少完整结束标记的 HTML 片段。无法找到结束标签时,片段截至当前段落或外层 ReactiveMD 容器的结束标签。回退片段中的 Markdown、`{{ 表达式 }}`、组件和脚本均保留为文本。
|
|
116
84
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## 扩展 HTML
|
|
120
|
-
|
|
121
|
-
`enableExtendedHtml` 管理以下作者语法:
|
|
122
|
-
|
|
123
|
-
- 定义列表:`dl`、`dt`、`dd`。
|
|
124
|
-
- 补充文字语义:`small`、`kbd`、`samp`、`var`、`abbr`、`q`、`cite`、`ins`。
|
|
125
|
-
- 图文和结构:`figure`、`figcaption`、`article`、`section`、`aside`、`header`、`footer`、`ruby`、`rt`、`rp`、`wbr`。
|
|
126
|
-
- 原生表单、`iframe`、`object`、`embed`、`dialog`、任意 SVG/MathML 和整页 HTML 功能。
|
|
127
|
-
|
|
128
|
-
在默认模式中,ReactiveMD `<table>` 按正文结构与原生表格区分;`<section>`、`<input>`、`<select>` 等同名组件继续采用当前语义。在原生 HTML 模式中,同名元素采用浏览器语义。
|
|
129
|
-
|
|
130
|
-
## 隔离与导出
|
|
131
|
-
|
|
132
|
-
作者 HTML 放在不带 `allow-same-origin` 的沙箱 iframe 中。源码中的整页结构、样式和脚本作用于该隔离文档。资源加载、表单提交和导航仍受 CSP 与沙箱限制;启用扩展 HTML 不代表获得全部网络能力。
|
|
85
|
+
## 扩展 HTML 与导出
|
|
133
86
|
|
|
134
|
-
|
|
87
|
+
已注册组件优先。比如 `<input bind="name">` 仍是 RMD 输入框,`details` 的正文继续支持 Markdown 和表达式。净化后的普通定义列表等结构直接进入文档,包含嵌入、作者脚本或样式的片段由沙箱承载。未获准的片段在原位置显示转义源码。
|
|
135
88
|
|
|
136
|
-
|
|
89
|
+
自包含嵌入可用经净化的 `srcdoc`。通过挂载参数 `allowedFrameOrigins` 开放精确的 HTTPS 来源。片段样式和脚本继续受对应开关管理,沙箱约束导航、表单和对父文档的访问。
|
|
137
90
|
|
|
138
|
-
|
|
91
|
+
新版交互导出记录 `sourceSemantics: "mixed-rmd-v1"`、开关和状态基线。缺少该字段的 v1/v2 导出按原语义打开,包含此前显式开启能力时的整页 HTML 路径。载荷的 v1/v2 继续区分恢复契约。
|
|
139
92
|
|
|
140
|
-
|
|
93
|
+
参见[集成说明](../integration/local-integration-ch.md)、[可分享导出](../integration/shareable-export-ch.md)和[安全约定](../../SECURITY-ch.md)。
|
|
@@ -1,60 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# HTML compatibility and author capabilities
|
|
2
2
|
|
|
3
3
|
**English** · [中文](html-compatibility-ch.md)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This feature targets the next release. Documents use Markdown, ReactiveMD controls and expressions by default, with the P0 HTML subset below. Host applications can enable author CSS, JavaScript and extended HTML separately. All three options default to `false`.
|
|
8
|
-
|
|
9
|
-
## Temporary routing policy
|
|
10
|
-
|
|
11
|
-
This release routes whole documents to avoid mixed parsing and rendering conflicts between author CSS, JavaScript, extended HTML and ReactiveMD.
|
|
12
|
-
|
|
13
|
-
| Compile options | Document behavior |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| All three options omitted or `false` | ReactiveMD parsing and the existing React renderer, including P0 HTML |
|
|
16
|
-
| Any option `true` | Native HTML for the entire source, rendered in an isolated iframe |
|
|
17
|
-
|
|
18
|
-
In native HTML mode, `# headings`, `**emphasis**`, LaTeX and `{{ expressions }}` remain ordinary text. Elements such as `input` and `table` use HTML semantics. ReactiveMD components establish no bindings. Turning all options off recompiles the document in the default mode. This is a transitional policy for this release; mixed compatibility can be evaluated later.
|
|
19
|
-
|
|
20
|
-
Options are host capabilities. Source tags and parameter state files cannot grant them. The demo displays the active mode and resets all three capabilities when the page reloads.
|
|
21
|
-
|
|
22
|
-
## Options and API
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { compileLocal } from 'reactive-md';
|
|
26
|
-
|
|
27
|
-
// Markdown, ReactiveMD and P0 HTML.
|
|
28
|
-
const reactive = compileLocal(source);
|
|
29
|
-
|
|
30
|
-
// Native HTML for the entire source; author CSS is enabled.
|
|
31
|
-
const html = compileLocal(source, {
|
|
32
|
-
enableCss: true,
|
|
33
|
-
enableJavaScript: false,
|
|
34
|
-
enableExtendedHtml: false,
|
|
35
|
-
});
|
|
36
|
-
```
|
|
5
|
+
ReactiveMD documents mix Markdown, RMD components, expressions and basic HTML. The host controls author capabilities independently.
|
|
37
6
|
|
|
38
7
|
| Option | Default | Capability |
|
|
39
8
|
| --- | --- | --- |
|
|
40
|
-
| `enableCss` | `
|
|
41
|
-
| `enableJavaScript` | `false` | Author scripts
|
|
42
|
-
| `enableExtendedHtml` | `false` |
|
|
9
|
+
| `enableCss` | `true` | Document styles, component declarations and styles in granted HTML fragments |
|
|
10
|
+
| `enableJavaScript` | `false` | Author scripts in interactive mounts |
|
|
11
|
+
| `enableExtendedHtml` | `false` | Additional native HTML fragments |
|
|
43
12
|
|
|
44
|
-
|
|
13
|
+
Give a source view its grants through `LocalReactiveDocument.compileOptions`. Give a precompiled view its own grants through `LocalDocumentView.capabilityGrants`. A direct mount defaults to CSS on, JavaScript off and extended HTML off. Effective permission requires both compilation and mount permission. Changing only these capabilities preserves the source view's runtime state.
|
|
45
14
|
|
|
46
|
-
|
|
15
|
+
### Styles
|
|
47
16
|
|
|
48
|
-
|
|
17
|
+
Place paired `<css>` blocks before the body. Multiple blocks cascade in source order. A component's `css` attribute applies declarations to its visible root. Document selectors stop at nested document roots. Ordinary inheritance still applies when the host nests documents. External author stylesheets and CSS resource loads are outside the inline style policy. A late style block or a declaration on a node without a visible root produces a source diagnostic. A registered component named `css` or `javascript` keeps its tag. A component schema's own `css` property keeps its original meaning.
|
|
49
18
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
19
|
+
### Scripts
|
|
20
|
+
|
|
21
|
+
Place code in a paired `<javascript>` block. After an interactive mount restores its state, an isolated worker initializes the blocks in source order. Each block has its own lexical scope. Use `await rmd.get(name)`, `await rmd.set(name, value)` and `await rmd.setMany(values)` to operate on named bindings. Writes follow the component's existing validation and read-only rules.
|
|
22
|
+
|
|
23
|
+
The counter exposes `increment`, `decrement` and `reset`. Give a counter an `action-id` and register `rmd.handleAction(id, "increment", callback)` to take over that action on that instance. `rmd.observeAction` observes an action without changing its default handler. Revocation, script replacement and unmount end the session. Static HTML, PDF and the static phase of hydration use the supplied RMD state.
|
|
56
24
|
|
|
57
|
-
|
|
25
|
+
Set `LocalDocumentView.authorScriptPaused` to pause author actions and binding requests while an asynchronous preview recompiles. When the script is unchanged, resume the existing session. Restoring a counter's `action-id` restores its registration within that session.
|
|
58
26
|
|
|
59
27
|
## P0 HTML in the default mode
|
|
60
28
|
|
|
@@ -116,25 +84,12 @@ Native HTML fragments that cannot compile are displayed as their original text,
|
|
|
116
84
|
|
|
117
85
|
In the native HTML route, an unsupported attribute makes its element fall back to source while neighboring elements continue to render. If whole-document parsing, serialization or compilation budget checks fail, React previews and standalone mounts display the complete source with preserved line breaks and escaped tags. Error results from `compileLocal`, resource limits and `onDiagnostics` reports are retained. Invalid host options and ReactiveMD component syntax errors keep their existing behavior.
|
|
118
86
|
|
|
119
|
-
## Extended HTML
|
|
120
|
-
|
|
121
|
-
`enableExtendedHtml` controls the following author syntax:
|
|
122
|
-
|
|
123
|
-
- Definition lists: `dl`, `dt`, `dd`.
|
|
124
|
-
- Additional text semantics: `small`, `kbd`, `samp`, `var`, `abbr`, `q`, `cite`, `ins`.
|
|
125
|
-
- Figures and structure: `figure`, `figcaption`, `article`, `section`, `aside`, `header`, `footer`, `ruby`, `rt`, `rp`, `wbr`.
|
|
126
|
-
- Native forms, `iframe`, `object`, `embed`, `dialog`, arbitrary SVG/MathML and whole-page HTML features.
|
|
127
|
-
|
|
128
|
-
In the default mode, `table` distinguishes native and ReactiveMD syntax by its body; existing components such as `section`, `input` and `select` retain their current meanings. In native HTML mode, these names use browser semantics.
|
|
129
|
-
|
|
130
|
-
## Isolation and export
|
|
131
|
-
|
|
132
|
-
Author HTML runs inside a sandboxed iframe without `allow-same-origin`. Whole-page structure, styles and scripts apply to this isolated document. CSP and sandbox restrictions still govern resources, form submission and navigation. Extended HTML does not grant unrestricted network access.
|
|
87
|
+
## Extended HTML and export
|
|
133
88
|
|
|
134
|
-
|
|
89
|
+
Registered components take precedence. For example, `<input bind="name">` remains an RMD input, and `details` keeps Markdown and expressions in its body. Sanitized definition lists and other inert structures render in the document. Embeds, fragment scripts and styles run inside a sandbox. Denied fragments appear as source at their original positions.
|
|
135
90
|
|
|
136
|
-
|
|
91
|
+
Use sanitized `srcdoc` for self-contained embeds. Grant exact remote HTTPS origins with the mount's `allowedFrameOrigins` option. Fragment styles and scripts require their respective grants. The sandbox governs navigation, forms and parent document access.
|
|
137
92
|
|
|
138
|
-
|
|
93
|
+
New interactive exports record `sourceSemantics: "mixed-rmd-v1"`, the capability flags and the chosen state baseline. Old v1/v2 files without the field retain their original interpretation, including whole-document HTML where a capability was enabled. The envelope version continues to distinguish restoration contracts.
|
|
139
94
|
|
|
140
|
-
See [integration](../integration/local-integration-en.md), [shareable export](../integration/shareable-export-en.md) and [security](../../SECURITY.md).
|
|
95
|
+
See [local integration](../integration/local-integration-en.md), [shareable export](../integration/shareable-export-en.md) and the [security policy](../../SECURITY.md).
|