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
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { _ as e, g as t, n, t as r, y as i } from "./compiler-core-kPiH-gOV.js";
|
|
2
|
-
import { n as a } from "./math-display-BJz4gbFc.js";
|
|
3
|
-
import { o } from "./parser-standard-DlCk7sLo.js";
|
|
4
|
-
import { n as s, t as c } from "./options-CX5m5n-J.js";
|
|
5
|
-
// src/local/compilation/compiler.ts
|
|
6
|
-
function l(e, t) {
|
|
7
|
-
return n(p(e, t));
|
|
8
|
-
}
|
|
9
|
-
function u(e, t, n) {
|
|
10
|
-
let r, i = () => globalThis.performance?.now?.() ?? Date.now(), a = i(), o = {}, s = a, l = (e) => {
|
|
11
|
-
let t = i();
|
|
12
|
-
o[e] = t - s, s = t;
|
|
13
|
-
};
|
|
14
|
-
n?.semantic?.begin(c(t));
|
|
15
|
-
let u = p(e, t, (e) => {
|
|
16
|
-
r = e;
|
|
17
|
-
}, n, l);
|
|
18
|
-
return o.totalMs = i() - a, {
|
|
19
|
-
result: u,
|
|
20
|
-
parsed: r,
|
|
21
|
-
...n?.semantic ? { semantic: n.semantic.stats } : {},
|
|
22
|
-
timings: o
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function d(e) {
|
|
26
|
-
return {
|
|
27
|
-
ok: !1,
|
|
28
|
-
diagnostics: [{
|
|
29
|
-
code: "local.options.invalid",
|
|
30
|
-
message: e.message,
|
|
31
|
-
severity: "error",
|
|
32
|
-
range: {
|
|
33
|
-
start: 0,
|
|
34
|
-
end: 0
|
|
35
|
-
},
|
|
36
|
-
line: 1,
|
|
37
|
-
column: 1,
|
|
38
|
-
messageKey: e.key,
|
|
39
|
-
...e.detail === void 0 ? {} : { params: { detail: e.detail } }
|
|
40
|
-
}]
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function f(n) {
|
|
44
|
-
return {
|
|
45
|
-
...n?.parser ? { parser: n.parser } : {},
|
|
46
|
-
...n?.semantic ? { semantic: n.semantic } : {},
|
|
47
|
-
...n?.rowPlans ? { rowPlans: n.rowPlans } : {},
|
|
48
|
-
display: n?.semantic ? (e, t) => n.semantic.display(e, t) : a,
|
|
49
|
-
htmlDocument: o,
|
|
50
|
-
plotMath: {
|
|
51
|
-
kind: i,
|
|
52
|
-
gridSize: e,
|
|
53
|
-
compile: t
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function p(e, t, n, i, a) {
|
|
58
|
-
let o = s(t);
|
|
59
|
-
return o.ok ? r(e, t, o, f(i), n, a) : d(o);
|
|
60
|
-
}
|
|
61
|
-
export { u as n, l as t };
|
|
@@ -1,490 +0,0 @@
|
|
|
1
|
-
// src/runtime-services/identity.ts
|
|
2
|
-
var e = new TextEncoder(), t = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/, n = /^[^\u0000-\u001f\u007f]{1,256}$/;
|
|
3
|
-
function r(t) {
|
|
4
|
-
let n = e.encode(t), r = 2166136261;
|
|
5
|
-
for (let e = 0; e < n.length; e += 1) r ^= n[e], r = Math.imul(r, 16777619) >>> 0;
|
|
6
|
-
return r >>> 0;
|
|
7
|
-
}
|
|
8
|
-
function i(e) {
|
|
9
|
-
if (typeof e != "string") throw TypeError("localSourceDigest requires a source string.");
|
|
10
|
-
return `fnv1a32:${r(e).toString(16).padStart(8, "0")}`;
|
|
11
|
-
}
|
|
12
|
-
function a(e) {
|
|
13
|
-
if (typeof e != "string") return;
|
|
14
|
-
let t = e.trim();
|
|
15
|
-
return n.test(t) ? t : void 0;
|
|
16
|
-
}
|
|
17
|
-
function o(e) {
|
|
18
|
-
if (typeof e != "string") return;
|
|
19
|
-
let n = e.trim();
|
|
20
|
-
return t.test(n) ? n : void 0;
|
|
21
|
-
}
|
|
22
|
-
function s(e) {
|
|
23
|
-
return a(e.documentId) ?? e.sourceDigest;
|
|
24
|
-
}
|
|
25
|
-
function c(e) {
|
|
26
|
-
let t = s(e), n = o(e.stateKey), i = n === void 0 ? `node:${e.nodeId}` : `state:${n}`, a = encodeURIComponent(t);
|
|
27
|
-
return `doc:${a.length <= 256 ? a : `h${r(t).toString(16).padStart(8, "0")}`}:${i}`;
|
|
28
|
-
}
|
|
29
|
-
function l(e, t) {
|
|
30
|
-
return r(`${e >>> 0}:${t}`);
|
|
31
|
-
}
|
|
32
|
-
function u(e) {
|
|
33
|
-
if (typeof e.explicitSeed == "number" && Number.isFinite(e.explicitSeed)) return Math.trunc(e.explicitSeed) >>> 0;
|
|
34
|
-
let t = o(e.stateKey), n = t === void 0 ? `node:${e.nodeId}` : `state:${t}`;
|
|
35
|
-
return l(e.documentSeed, `${e.componentId}|${n}`);
|
|
36
|
-
}
|
|
37
|
-
function d(e) {
|
|
38
|
-
return Number.isFinite(e) ? Math.trunc(e) >>> 0 : 0;
|
|
39
|
-
}
|
|
40
|
-
// src/runtime-services/random.ts
|
|
41
|
-
var f = "mulberry32", p = 1;
|
|
42
|
-
function m(e) {
|
|
43
|
-
return Object.freeze({
|
|
44
|
-
algorithm: f,
|
|
45
|
-
version: 1,
|
|
46
|
-
state: d(e)
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function h(e) {
|
|
50
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return null;
|
|
51
|
-
let t = e;
|
|
52
|
-
if (t.algorithm !== "mulberry32" || t.version !== 1 || typeof t.state != "number" || !Number.isFinite(t.state)) return null;
|
|
53
|
-
let n = d(t.state);
|
|
54
|
-
return n === t.state ? Object.freeze({
|
|
55
|
-
algorithm: f,
|
|
56
|
-
version: 1,
|
|
57
|
-
state: n
|
|
58
|
-
}) : null;
|
|
59
|
-
}
|
|
60
|
-
function g(e) {
|
|
61
|
-
let t = d(e.state + 1831565813), n = Math.imul(t ^ t >>> 15, t | 1);
|
|
62
|
-
return n ^= n + Math.imul(n ^ n >>> 7, n | 61), {
|
|
63
|
-
value: ((n ^ n >>> 14) >>> 0) / 4294967296,
|
|
64
|
-
state: Object.freeze({
|
|
65
|
-
algorithm: f,
|
|
66
|
-
version: 1,
|
|
67
|
-
state: t
|
|
68
|
-
})
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function _(e, t, n) {
|
|
72
|
-
let r = g(e);
|
|
73
|
-
if (!Number.isFinite(t) || !Number.isFinite(n)) return {
|
|
74
|
-
value: 0,
|
|
75
|
-
state: r.state
|
|
76
|
-
};
|
|
77
|
-
let i = Math.ceil(Math.min(t, n)), a = Math.floor(Math.max(t, n));
|
|
78
|
-
return a < i ? {
|
|
79
|
-
value: i,
|
|
80
|
-
state: r.state
|
|
81
|
-
} : {
|
|
82
|
-
value: i + Math.floor(r.value * (a - i + 1)),
|
|
83
|
-
state: r.state
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function v(e, t) {
|
|
87
|
-
let n = t.slice(), r = e;
|
|
88
|
-
for (let e = n.length - 1; e > 0; --e) {
|
|
89
|
-
let t = _(r, 0, e);
|
|
90
|
-
r = t.state;
|
|
91
|
-
let i = n[e];
|
|
92
|
-
n[e] = n[t.value], n[t.value] = i;
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
items: n,
|
|
96
|
-
state: r
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function y(e, t) {
|
|
100
|
-
return m(l(e, t));
|
|
101
|
-
}
|
|
102
|
-
function b(e, t = .5) {
|
|
103
|
-
let n = g(e);
|
|
104
|
-
return {
|
|
105
|
-
value: n.value < t,
|
|
106
|
-
state: n.state
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
// src/runtime-services/component-state.ts
|
|
110
|
-
var x = "reactive-md-component-state/v1", S = "reactive-md-component-state-document/v1", C = 16384, w = 262144, T = 16, E = 1e4, D = 1e5, O = 1048576, k = 128, A = 64, j = 512, M = 1e6, N = 128, P = /[\u0000-\u001f\u007f-\u009f]/, F = new TextEncoder();
|
|
111
|
-
function I(e, t, n = "error") {
|
|
112
|
-
return {
|
|
113
|
-
code: e,
|
|
114
|
-
message: t,
|
|
115
|
-
severity: n,
|
|
116
|
-
range: {
|
|
117
|
-
start: 0,
|
|
118
|
-
end: 0
|
|
119
|
-
},
|
|
120
|
-
line: 1,
|
|
121
|
-
column: 1
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function L(e) {
|
|
125
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
126
|
-
let t = Object.getPrototypeOf(e);
|
|
127
|
-
return t === Object.prototype || t === null;
|
|
128
|
-
}
|
|
129
|
-
function R(e) {
|
|
130
|
-
for (let t = 0; t < e.length; t += 1) {
|
|
131
|
-
let n = e.charCodeAt(t);
|
|
132
|
-
if (n >= 55296 && n <= 56319) {
|
|
133
|
-
let n = e.charCodeAt(t + 1);
|
|
134
|
-
if (n >= 56320 && n <= 57343) {
|
|
135
|
-
t += 1;
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
return !1;
|
|
139
|
-
}
|
|
140
|
-
if (n >= 56320 && n <= 57343) return !1;
|
|
141
|
-
}
|
|
142
|
-
return !0;
|
|
143
|
-
}
|
|
144
|
-
function z(e) {
|
|
145
|
-
return typeof e == "string" && e.length > 0 && e.length <= N && !P.test(e) && R(e);
|
|
146
|
-
}
|
|
147
|
-
function B(e, t, n) {
|
|
148
|
-
return t === void 0 || e === t || n.includes(e);
|
|
149
|
-
}
|
|
150
|
-
function V(e, t) {
|
|
151
|
-
if (e === null) return null;
|
|
152
|
-
if (typeof e == "boolean") return e;
|
|
153
|
-
if (typeof e == "number") {
|
|
154
|
-
if (!Number.isFinite(e)) throw TypeError("numbers must be finite");
|
|
155
|
-
return e;
|
|
156
|
-
}
|
|
157
|
-
if (typeof e == "string") {
|
|
158
|
-
if (e.length > 1e5) throw RangeError(`strings exceed ${D} characters`);
|
|
159
|
-
if (!R(e)) throw TypeError("strings must be well-formed Unicode");
|
|
160
|
-
return e;
|
|
161
|
-
}
|
|
162
|
-
if (t >= 16) throw RangeError("nesting exceeds 16 levels");
|
|
163
|
-
if (Array.isArray(e)) {
|
|
164
|
-
if (e.length > 1e4) throw RangeError(`arrays exceed ${E} items`);
|
|
165
|
-
if (Object.getOwnPropertySymbols(e).length > 0) throw TypeError("arrays cannot use symbol keys");
|
|
166
|
-
return e.map((e) => V(e, t + 1));
|
|
167
|
-
}
|
|
168
|
-
if (L(e)) {
|
|
169
|
-
if (Object.getOwnPropertySymbols(e).length > 0) throw TypeError("objects cannot use symbol keys");
|
|
170
|
-
let n = Object.keys(e);
|
|
171
|
-
if (n.length > 1e4) throw RangeError(`objects exceed ${E} keys`);
|
|
172
|
-
let r = {};
|
|
173
|
-
for (let i of n) {
|
|
174
|
-
if (i === "__proto__") throw TypeError("the key \"__proto__\" is not allowed");
|
|
175
|
-
if (i.length > 1e5) throw RangeError(`keys exceed ${D} characters`);
|
|
176
|
-
if (!R(i)) throw TypeError("keys must be well-formed Unicode");
|
|
177
|
-
r[i] = V(e[i], t + 1);
|
|
178
|
-
}
|
|
179
|
-
return r;
|
|
180
|
-
}
|
|
181
|
-
throw TypeError("values must be JSON-safe primitives, arrays or plain objects");
|
|
182
|
-
}
|
|
183
|
-
function H(e) {
|
|
184
|
-
return V(e, 0);
|
|
185
|
-
}
|
|
186
|
-
function U(e) {
|
|
187
|
-
return Object.freeze({
|
|
188
|
-
...e,
|
|
189
|
-
data: V(e.data, 0),
|
|
190
|
-
...e.random === void 0 ? {} : { random: h(e.random) ?? e.random }
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
function W(e) {
|
|
194
|
-
if (!L(e)) return {
|
|
195
|
-
ok: !1,
|
|
196
|
-
diagnostics: [I("local.runtime.state.shape", "A component state record must be a plain object.")]
|
|
197
|
-
};
|
|
198
|
-
let t = /* @__PURE__ */ new Set([
|
|
199
|
-
"format",
|
|
200
|
-
"component",
|
|
201
|
-
"componentVersion",
|
|
202
|
-
"stateVersion",
|
|
203
|
-
"key",
|
|
204
|
-
"documentId",
|
|
205
|
-
"data",
|
|
206
|
-
"random"
|
|
207
|
-
]);
|
|
208
|
-
for (let n of Object.keys(e)) if (!t.has(n)) return {
|
|
209
|
-
ok: !1,
|
|
210
|
-
diagnostics: [I("local.runtime.state.key", `Unknown component state key "${n}".`)]
|
|
211
|
-
};
|
|
212
|
-
if (e.format !== "reactive-md-component-state/v1") return {
|
|
213
|
-
ok: !1,
|
|
214
|
-
diagnostics: [I("local.runtime.state.format", `Unsupported component state format; expected "${x}".`)]
|
|
215
|
-
};
|
|
216
|
-
let n = e.component;
|
|
217
|
-
if (typeof n != "string" || n.trim() === "" || n.length > k) return {
|
|
218
|
-
ok: !1,
|
|
219
|
-
diagnostics: [I("local.runtime.state.component", "Component name must be a non-empty string.")]
|
|
220
|
-
};
|
|
221
|
-
let r = e.componentVersion;
|
|
222
|
-
if (typeof r != "string" || r.trim() === "" || r.length > A) return {
|
|
223
|
-
ok: !1,
|
|
224
|
-
diagnostics: [I("local.runtime.state.component-version", "Component version must be a non-empty string.")]
|
|
225
|
-
};
|
|
226
|
-
let i = e.stateVersion;
|
|
227
|
-
if (typeof i != "number" || !Number.isInteger(i) || i < 0 || i > M) return {
|
|
228
|
-
ok: !1,
|
|
229
|
-
diagnostics: [I("local.runtime.state.version", "State version must be a non-negative integer.")]
|
|
230
|
-
};
|
|
231
|
-
let a = e.key;
|
|
232
|
-
if (typeof a != "string" || a.trim() === "" || a.length > j) return {
|
|
233
|
-
ok: !1,
|
|
234
|
-
diagnostics: [I("local.runtime.state.key-name", "State key must be a non-empty string.")]
|
|
235
|
-
};
|
|
236
|
-
let o = e.documentId;
|
|
237
|
-
if (o !== void 0 && (typeof o != "string" || o.trim() === "" || o.length > 256)) return {
|
|
238
|
-
ok: !1,
|
|
239
|
-
diagnostics: [I("local.runtime.state.document", "State documentId must be a non-empty string.")]
|
|
240
|
-
};
|
|
241
|
-
let s;
|
|
242
|
-
try {
|
|
243
|
-
s = H(e.data);
|
|
244
|
-
} catch (e) {
|
|
245
|
-
return {
|
|
246
|
-
ok: !1,
|
|
247
|
-
diagnostics: [I("local.runtime.state.data", `Invalid component state data: ${e instanceof Error ? e.message : String(e)}.`)]
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
let c;
|
|
251
|
-
if (e.random !== void 0 && (c = h(e.random) ?? void 0, c === void 0)) return {
|
|
252
|
-
ok: !1,
|
|
253
|
-
diagnostics: [I("local.runtime.state.random", "Invalid random state.")]
|
|
254
|
-
};
|
|
255
|
-
let l = {
|
|
256
|
-
format: x,
|
|
257
|
-
component: n,
|
|
258
|
-
componentVersion: r,
|
|
259
|
-
stateVersion: i,
|
|
260
|
-
key: a,
|
|
261
|
-
...o === void 0 ? {} : { documentId: o },
|
|
262
|
-
data: s,
|
|
263
|
-
...c === void 0 ? {} : { random: c }
|
|
264
|
-
};
|
|
265
|
-
return F.encode(JSON.stringify(l)).length > 16384 ? {
|
|
266
|
-
ok: !1,
|
|
267
|
-
diagnostics: [I("local.runtime.state.size", `Component state exceeds the ${C}-byte limit.`)]
|
|
268
|
-
} : {
|
|
269
|
-
ok: !0,
|
|
270
|
-
record: Object.freeze(l)
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
function G(e) {
|
|
274
|
-
let t = e;
|
|
275
|
-
if (typeof e == "string") {
|
|
276
|
-
if (e.length > 1048576) return {
|
|
277
|
-
ok: !1,
|
|
278
|
-
diagnostics: [I("local.runtime.state.size", "The component state payload is too large.")]
|
|
279
|
-
};
|
|
280
|
-
try {
|
|
281
|
-
t = JSON.parse(e);
|
|
282
|
-
} catch {
|
|
283
|
-
return {
|
|
284
|
-
ok: !1,
|
|
285
|
-
diagnostics: [I("local.runtime.state.json", "The component state payload is not valid JSON.")]
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
if (!L(t)) return {
|
|
290
|
-
ok: !1,
|
|
291
|
-
diagnostics: [I("local.runtime.state.shape", "The component state document must be a plain object.")]
|
|
292
|
-
};
|
|
293
|
-
if (t.format !== "reactive-md-component-state-document/v1") return {
|
|
294
|
-
ok: !1,
|
|
295
|
-
diagnostics: [I("local.runtime.state.document-format", `Unsupported component state document format; expected "${S}".`)]
|
|
296
|
-
};
|
|
297
|
-
let n = t.configKey;
|
|
298
|
-
if (n !== void 0 && !z(n)) return {
|
|
299
|
-
ok: !1,
|
|
300
|
-
diagnostics: [I("local.runtime.state.config-key", "The component state configKey must be a non-empty bounded string.")]
|
|
301
|
-
};
|
|
302
|
-
if (!L(t.records)) return {
|
|
303
|
-
ok: !1,
|
|
304
|
-
diagnostics: [I("local.runtime.state.records", "Component state records must be a plain object.")]
|
|
305
|
-
};
|
|
306
|
-
let r = {}, i = [], a = [], o = 0;
|
|
307
|
-
for (let e of Object.keys(t.records)) {
|
|
308
|
-
let n = W(t.records[e]);
|
|
309
|
-
n.ok ? n.record.key === e ? (o += F.encode(JSON.stringify(n.record)).length, o > 262144 ? (a.push(e), i.push(I("local.runtime.state.total-size", `Component state exceeds the ${w}-byte document limit.`))) : r[e] = n.record) : (a.push(e), i.push(I("local.runtime.state.key-mismatch", `Component state record "${e}" declares a different key "${n.record.key}".`))) : (a.push(e), i.push(...n.diagnostics));
|
|
310
|
-
}
|
|
311
|
-
return {
|
|
312
|
-
ok: !0,
|
|
313
|
-
...n === void 0 ? {} : { configKey: n },
|
|
314
|
-
records: r,
|
|
315
|
-
diagnostics: i,
|
|
316
|
-
skipped: a
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function K(e) {
|
|
320
|
-
let t = G(e);
|
|
321
|
-
if (!t.ok) return t;
|
|
322
|
-
let n = {};
|
|
323
|
-
for (let [e, r] of Object.entries(t.records)) n[e] = r;
|
|
324
|
-
return {
|
|
325
|
-
ok: !0,
|
|
326
|
-
document: Object.freeze({
|
|
327
|
-
format: S,
|
|
328
|
-
...t.configKey === void 0 ? {} : { configKey: t.configKey },
|
|
329
|
-
records: Object.freeze(n)
|
|
330
|
-
}),
|
|
331
|
-
records: Object.freeze(n),
|
|
332
|
-
diagnostics: t.diagnostics,
|
|
333
|
-
skipped: t.skipped
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function q(e) {
|
|
337
|
-
let t = s(e), n = e.sourceDigest, r = e.knownKeys, i = e.configKey;
|
|
338
|
-
if (i !== void 0 && !z(i)) throw TypeError("configKey must be a non-empty bounded string.");
|
|
339
|
-
let a = Object.freeze((e.legacyConfigKeys ?? []).filter(z)), o = e.writeDelayMs ?? 0;
|
|
340
|
-
if (typeof o != "number" || !Number.isFinite(o) || o < 0) throw TypeError("writeDelayMs must be a non-negative finite number.");
|
|
341
|
-
let l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = [], m = e.storage, h = null, g = null, _ = !1, v = () => {
|
|
342
|
-
for (let e of f) e();
|
|
343
|
-
};
|
|
344
|
-
function y() {
|
|
345
|
-
if (m === void 0) return !0;
|
|
346
|
-
try {
|
|
347
|
-
let e = D.snapshot();
|
|
348
|
-
return Object.keys(e.records).length === 0 ? m.remove() : m.write(e), h = null, !0;
|
|
349
|
-
} catch (e) {
|
|
350
|
-
let t = e instanceof Error ? e.message : String(e);
|
|
351
|
-
return t !== h && (h = t, p.push(I("local.runtime.state.storage", `The component state could not be persisted: ${t}`, "warning"))), !1;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
let b = () => {
|
|
355
|
-
g !== null && (clearTimeout(g), g = null);
|
|
356
|
-
};
|
|
357
|
-
function C() {
|
|
358
|
-
_ && (b(), y() && (_ = !1));
|
|
359
|
-
}
|
|
360
|
-
let T = () => {
|
|
361
|
-
m !== void 0 && (o <= 0 ? y() : (_ = !0, g === null && (g = setTimeout(() => {
|
|
362
|
-
g = null, C();
|
|
363
|
-
}, Math.min(o, 2147483647)))));
|
|
364
|
-
}, E = (e) => {
|
|
365
|
-
let t = 0;
|
|
366
|
-
for (let [n, r] of l) n !== e && (t += F.encode(JSON.stringify(r)).length);
|
|
367
|
-
return t;
|
|
368
|
-
}, D = {
|
|
369
|
-
documentId: t,
|
|
370
|
-
sourceDigest: n,
|
|
371
|
-
key(e) {
|
|
372
|
-
return c({
|
|
373
|
-
documentId: t,
|
|
374
|
-
sourceDigest: n,
|
|
375
|
-
nodeId: e.nodeId,
|
|
376
|
-
stateKey: e.stateKey
|
|
377
|
-
});
|
|
378
|
-
},
|
|
379
|
-
handle(e) {
|
|
380
|
-
let n = D.key({
|
|
381
|
-
nodeId: e.nodeId,
|
|
382
|
-
stateKey: e.stateKey
|
|
383
|
-
}), r = u.get(n), i = !1;
|
|
384
|
-
r !== void 0 && r !== e.nodeId ? (i = !0, d.has(n) || (d.add(n), p.push(I("local.runtime.state.duplicate-key", `Component state key "${n}" is used by more than one component instance.`)))) : u.set(n, e.nodeId);
|
|
385
|
-
let a = {
|
|
386
|
-
key: n,
|
|
387
|
-
component: e.component,
|
|
388
|
-
componentVersion: e.componentVersion,
|
|
389
|
-
duplicate: i,
|
|
390
|
-
load() {
|
|
391
|
-
if (i) return null;
|
|
392
|
-
let e = l.get(n);
|
|
393
|
-
return e === void 0 ? null : U(e);
|
|
394
|
-
},
|
|
395
|
-
save(r, a) {
|
|
396
|
-
if (i) return {
|
|
397
|
-
ok: !1,
|
|
398
|
-
diagnostics: [I("local.runtime.state.duplicate-key", `Component state key "${n}" is used by more than one component instance.`)]
|
|
399
|
-
};
|
|
400
|
-
let o = a?.version ?? e.stateVersion ?? 0, s = W({
|
|
401
|
-
format: x,
|
|
402
|
-
component: e.component,
|
|
403
|
-
componentVersion: e.componentVersion,
|
|
404
|
-
stateVersion: o,
|
|
405
|
-
key: n,
|
|
406
|
-
documentId: t,
|
|
407
|
-
data: r,
|
|
408
|
-
...a?.random === void 0 ? {} : { random: a.random }
|
|
409
|
-
});
|
|
410
|
-
if (!s.ok) return {
|
|
411
|
-
ok: !1,
|
|
412
|
-
diagnostics: s.diagnostics
|
|
413
|
-
};
|
|
414
|
-
let c = F.encode(JSON.stringify(s.record)).length;
|
|
415
|
-
return E(n) + c > 262144 ? {
|
|
416
|
-
ok: !1,
|
|
417
|
-
diagnostics: [I("local.runtime.state.total-size", `Component state exceeds the ${w}-byte document limit.`)]
|
|
418
|
-
} : (l.set(n, s.record), T(), v(), {
|
|
419
|
-
ok: !0,
|
|
420
|
-
diagnostics: [],
|
|
421
|
-
record: U(s.record)
|
|
422
|
-
});
|
|
423
|
-
},
|
|
424
|
-
clear() {
|
|
425
|
-
i || l.delete(n) && (T(), v());
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
return Object.freeze(a);
|
|
429
|
-
},
|
|
430
|
-
load(e) {
|
|
431
|
-
let t = l.get(e);
|
|
432
|
-
return t === void 0 ? null : U(t);
|
|
433
|
-
},
|
|
434
|
-
clear(e) {
|
|
435
|
-
l.delete(e) && (T(), v());
|
|
436
|
-
},
|
|
437
|
-
snapshot() {
|
|
438
|
-
let e = {};
|
|
439
|
-
for (let [t, n] of l) e[t] = U(n);
|
|
440
|
-
return Object.freeze({
|
|
441
|
-
format: S,
|
|
442
|
-
...i === void 0 ? {} : { configKey: i },
|
|
443
|
-
records: Object.freeze(e)
|
|
444
|
-
});
|
|
445
|
-
},
|
|
446
|
-
restore(e) {
|
|
447
|
-
let n = G(e);
|
|
448
|
-
if (!n.ok) return p.push(...n.diagnostics), {
|
|
449
|
-
accepted: [],
|
|
450
|
-
skipped: [],
|
|
451
|
-
diagnostics: n.diagnostics
|
|
452
|
-
};
|
|
453
|
-
if (n.configKey !== void 0 && !B(n.configKey, i, a)) {
|
|
454
|
-
let e = [.../* @__PURE__ */ new Set([...n.skipped, ...Object.keys(n.records)])];
|
|
455
|
-
return n.diagnostics.push(I("local.runtime.state.config-mismatch", `Saved component state belongs to configuration "${n.configKey}", not "${i}".`, "warning")), p.push(...n.diagnostics), {
|
|
456
|
-
accepted: [],
|
|
457
|
-
skipped: e,
|
|
458
|
-
diagnostics: n.diagnostics
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
let o = [], s = typeof r == "function" ? r() : r;
|
|
462
|
-
for (let [e, r] of Object.entries(n.records)) r.documentId !== void 0 && r.documentId !== t ? (n.skipped.push(e), n.diagnostics.push(I("local.runtime.state.document-mismatch", `Saved state key "${e}" belongs to a different document.`))) : s !== void 0 && !s.has(e) ? (n.skipped.push(e), n.diagnostics.push(I("local.runtime.state.unknown-component", `Saved state key "${e}" does not match any component in this document.`))) : (l.set(e, r), o.push(e));
|
|
463
|
-
return n.diagnostics.length && p.push(...n.diagnostics), o.length && v(), {
|
|
464
|
-
accepted: o,
|
|
465
|
-
skipped: n.skipped,
|
|
466
|
-
diagnostics: n.diagnostics
|
|
467
|
-
};
|
|
468
|
-
},
|
|
469
|
-
flush() {
|
|
470
|
-
C();
|
|
471
|
-
},
|
|
472
|
-
diagnostics() {
|
|
473
|
-
return Object.freeze([...p]);
|
|
474
|
-
},
|
|
475
|
-
subscribe(e) {
|
|
476
|
-
return f.add(e), () => {
|
|
477
|
-
f.delete(e);
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
}, O = e.initial;
|
|
481
|
-
if (O === void 0 && m !== void 0) try {
|
|
482
|
-
let e = m.read();
|
|
483
|
-
e !== null && (O = e);
|
|
484
|
-
} catch (e) {
|
|
485
|
-
let t = e instanceof Error ? e.message : String(e);
|
|
486
|
-
p.push(I("local.runtime.state.storage", `The component state could not be read: ${t}`, "warning"));
|
|
487
|
-
}
|
|
488
|
-
return O !== void 0 && D.restore(O), Object.freeze(D);
|
|
489
|
-
}
|
|
490
|
-
export { i as C, s as D, u as E, d as O, r as S, o as T, b as _, O as a, c as b, w as c, f as d, p as f, h as g, g as h, T as i, q as l, y as m, x as n, E as o, m as p, C as r, D as s, S as t, K as u, _ as v, a as w, l as x, v as y };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { f as e, l as t } from "./validation-W-bmny-x.js";
|
|
2
|
-
import { t as n } from "./parser-standard-DlCk7sLo.js";
|
|
3
|
-
import r from "./reactive-md-default-preset.js";
|
|
4
|
-
import { c as i, l as a, n as o, u as s } from "./registry-B9Jc3FVe.js";
|
|
5
|
-
// src/local/configuration/options.ts
|
|
6
|
-
function c(t) {
|
|
7
|
-
return e(t, {
|
|
8
|
-
defaults: o(),
|
|
9
|
-
preset: {
|
|
10
|
-
id: r.id,
|
|
11
|
-
version: r.version
|
|
12
|
-
},
|
|
13
|
-
defaultConfigKey: i(),
|
|
14
|
-
readConfig: (e) => s(e),
|
|
15
|
-
configKey: (e) => i(e),
|
|
16
|
-
capabilities: n
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function l(e) {
|
|
20
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
21
|
-
}
|
|
22
|
-
var u = 256, d = 4096, f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new WeakMap(), h = 0;
|
|
23
|
-
function g() {
|
|
24
|
-
return h += 1, h;
|
|
25
|
-
}
|
|
26
|
-
function _(e) {
|
|
27
|
-
if (typeof e == "object" && e || typeof e == "function") {
|
|
28
|
-
let t = e, n = m.get(t);
|
|
29
|
-
return n === void 0 && (n = g(), m.set(t, n)), `unreadable#${n}`;
|
|
30
|
-
}
|
|
31
|
-
return `unreadable:${typeof e}:${String(e)}`;
|
|
32
|
-
}
|
|
33
|
-
function v(e) {
|
|
34
|
-
let t = [], n = 0, r = (e) => {
|
|
35
|
-
if (n += 1, n > d) throw RangeError("signature budget");
|
|
36
|
-
switch (typeof e) {
|
|
37
|
-
case "string": return `s${JSON.stringify(e)}`;
|
|
38
|
-
case "number": return `n${Object.is(e, -0) ? "-0" : String(e)}`;
|
|
39
|
-
case "boolean": return e ? "b1" : "b0";
|
|
40
|
-
case "undefined": return "u";
|
|
41
|
-
case "bigint": return `g${e.toString()}`;
|
|
42
|
-
case "symbol": {
|
|
43
|
-
let t = p.get(e);
|
|
44
|
-
return t === void 0 && (t = g(), p.set(e, t)), `y${t}`;
|
|
45
|
-
}
|
|
46
|
-
case "function": {
|
|
47
|
-
let t = f.get(e);
|
|
48
|
-
return t === void 0 && (t = g(), f.set(e, t)), `f${t}`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (e === null) return "null";
|
|
52
|
-
let i = e, a = t.indexOf(i);
|
|
53
|
-
if (a >= 0) return `r${a}`;
|
|
54
|
-
t.push(i);
|
|
55
|
-
try {
|
|
56
|
-
if (Array.isArray(i)) {
|
|
57
|
-
let e = Math.min(i.length, 8);
|
|
58
|
-
if (i.length > u) {
|
|
59
|
-
let t = `a#${i.length}[`;
|
|
60
|
-
for (let n = 0; n < e; n += 1) t += `${r(i[n])},`;
|
|
61
|
-
return `${t}]`;
|
|
62
|
-
}
|
|
63
|
-
let t = `a${i.length}[`;
|
|
64
|
-
for (let e = 0; e < i.length; e += 1) t += `${r(i[e])},`;
|
|
65
|
-
return `${t}]`;
|
|
66
|
-
}
|
|
67
|
-
let e = Object.keys(i);
|
|
68
|
-
if (e.length > u) {
|
|
69
|
-
let t = `o#${e.length}{`;
|
|
70
|
-
for (let n of e.slice(0, 8)) t += `${r(n)},`;
|
|
71
|
-
return `${t}}`;
|
|
72
|
-
}
|
|
73
|
-
e.sort();
|
|
74
|
-
let t = "o{";
|
|
75
|
-
for (let n of e) t += `${r(n)}:${r(i[n])},`;
|
|
76
|
-
return `${t}}`;
|
|
77
|
-
} finally {
|
|
78
|
-
t.pop();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
try {
|
|
82
|
-
return r(e);
|
|
83
|
-
} catch {
|
|
84
|
-
return _(e);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function y(e) {
|
|
88
|
-
if (e === void 0 && (e = {}), !l(e)) return "invalid";
|
|
89
|
-
let n = t.map((t) => {
|
|
90
|
-
if (!Object.hasOwn(e, t)) return "-";
|
|
91
|
-
let n = e[t];
|
|
92
|
-
return n === void 0 ? "-" : n === !0 ? "1" : n === !1 ? "0" : "!";
|
|
93
|
-
}).join(""), r = "";
|
|
94
|
-
if (Object.hasOwn(e, "limits")) {
|
|
95
|
-
let t = e.limits;
|
|
96
|
-
if (t === void 0) r = "default";
|
|
97
|
-
else if (!l(t)) r = "invalid";
|
|
98
|
-
else {
|
|
99
|
-
let e = (e) => !Object.hasOwn(t, e) || t[e] === void 0 ? "default" : String(t[e]);
|
|
100
|
-
r = `${e("maxSyntaxNodes")}:${e("maxParseWork")}:${e("maxMarkdownDepth")}`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
let i = "";
|
|
104
|
-
if (Object.hasOwn(e, "hostComponents") && e.hostComponents !== void 0) {
|
|
105
|
-
let t = e.hostComponents;
|
|
106
|
-
try {
|
|
107
|
-
Array.isArray(t) ? t.length > 0 && (i = t.length > 32 ? `:hosts=oversize:${t.length}` : `:hosts=${v(t)}`) : i = `:hosts=${v(t)}`;
|
|
108
|
-
} catch {
|
|
109
|
-
i = `:hosts=${_(t)}`;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
let o = !Object.hasOwn(e, "markdownBreaks") || e.markdownBreaks === void 0 ? "-" : e.markdownBreaks === !0 ? "1" : e.markdownBreaks === !1 ? "0" : "!", s = !Object.hasOwn(e, "strict") || e.strict === void 0 || e.strict === !0 ? "strict=1" : e.strict === !1 ? "strict=0:recovery=2" : "strict=!", c = "";
|
|
113
|
-
return Object.hasOwn(e, "config") && e.config !== void 0 && (c = `:config=${a(e.config)}`), `${n}:${r}:${o}:${s}${i}${c}`;
|
|
114
|
-
}
|
|
115
|
-
export { c as n, y as t };
|