reactive-md 0.9.1 → 0.9.3
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 +44 -0
- package/CHANGELOG.md +44 -0
- package/README-ch.md +7 -7
- package/README-en.md +6 -6
- package/README.md +7 -7
- package/cli/init.mjs +1 -1
- package/dist-library/LocalDocumentView-D6zQkTkt.js +112 -0
- package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-CmJhemcA.js} +387 -9471
- package/dist-library/LocalReactiveDocumentCore-lAKOGAZ7.js +283 -0
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +143 -0
- package/dist-library/{authoring-Dsune4Hy.js → authoring-B14SsOXZ.js} +68 -67
- package/dist-library/chart-B1TUtzm-.js +3 -0
- package/dist-library/color-values-r8Wf7ALn.js +6 -0
- package/dist-library/{compile-wUv8KEge.js → compile-D50B5_Ww.js} +32 -32
- package/dist-library/compile-cache-key-6GgpETz_.js +28 -0
- package/dist-library/compiler-DLkKUK4t.js +98 -0
- package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-Niqhp9wV.js} +2963 -3283
- package/dist-library/{registry-core-Bbad9Bm2.js → component-kernel-IG4wOO0i.js} +72 -195
- package/dist-library/component-state-CwKX_SN5.js +763 -0
- package/dist-library/{component-state-C52ZFJGl.js → component-state-Ht-hOK0W.js} +15 -14
- package/dist-library/component-utils-eSj5IdG4.js +338 -0
- package/dist-library/computations-CffoW7Ff.js +340 -0
- package/dist-library/config-validation-Cpol91_M.js +456 -0
- package/dist-library/controls-B-CLSK8Q.js +5927 -0
- package/dist-library/controls-DWlx-AQl.js +3 -0
- package/dist-library/{coordinate-CWS9p5q_.js → coordinate-PyLPMIQK.js} +85 -85
- package/dist-library/data-BtFlkJzp.js +3 -0
- package/dist-library/{data-table-Bgccxd7h.js → data-table-Kv_ZA2Z2.js} +14 -13
- package/dist-library/data-visuals-_Z7QqYTk.js +384 -0
- package/dist-library/{default-components-BwQf0oP-.js → default-components-jugH7Ubr.js} +333 -331
- package/dist-library/{config-BadfhjdP.js → default-config-DIrRpuQz.js} +96 -79
- package/dist-library/default-options-DU5dxuU6.js +125 -0
- package/dist-library/{registry-B9NGct4d.js → default-registry-BlloaZi7.js} +4 -4
- package/dist-library/default-schema-Ch-Vznpm.js +33 -0
- package/dist-library/diagram-BLepzI8l.js +3 -0
- package/dist-library/{display-B-VhqVND.js → display-y4v9v0Qd.js} +1 -1
- package/dist-library/dist-Cueh1Psp.js +4761 -0
- package/dist-library/{config-validation-F47AcE6o.js → document-theme-DBAfnk7y.js} +248 -731
- package/dist-library/{export-BqVmTXm8.js → export-heVBqgxA.js} +46 -44
- package/dist-library/gallery-BC6FYTqw.js +3 -0
- package/dist-library/{gallery-CY6mTx8i.js → gallery-Q6VPS2ep.js} +1 -1
- package/dist-library/{html-CNT4KD-2.js → html-CCnvzan1.js} +56 -54
- package/dist-library/identity-BUx0Q_-d.js +40 -0
- package/dist-library/{incremental-Dv0FSp_U.js → incremental-Bzvh8_lB.js} +529 -380
- package/dist-library/{layout-C0YlEPGr.js → layout-BfUzzO2b.js} +147 -156
- package/dist-library/layout-BnfDeUNy.js +3 -0
- package/dist-library/limits-CFERRrlC.js +10 -0
- package/dist-library/localization-COdJ6lw2.js +6 -0
- package/dist-library/mafs-CnzDC5CR.js +3 -0
- package/dist-library/math-view-B0jthpRw.js +20 -0
- package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
- package/dist-library/mount-preset-C_i37FvY.js +24 -0
- package/dist-library/numeric-sliders-CkWS0-ja.js +542 -0
- package/dist-library/observability-CYLuvFfL.js +502 -0
- package/dist-library/observability-core-Bcu7vpnl.js +24 -0
- package/dist-library/{package-core-WFK1RhAZ.js → package-core-9UK5ZdqB.js} +57 -46
- package/dist-library/parser-9yNJxGip.js +8 -0
- package/dist-library/parser-standard-BPIy4HOu.js +4872 -0
- package/dist-library/plugin-packs-CZb46nuv.js +19 -0
- package/dist-library/preset-core-BW3NWZJ9.js +1300 -0
- package/dist-library/props-pJRrfDc6.js +179 -0
- package/dist-library/react-BSo0o998.js +32 -0
- package/dist-library/reactive-md-authoring.js +274 -263
- package/dist-library/reactive-md-build.js +55 -20
- package/dist-library/reactive-md-compiler-session.js +4 -0
- package/dist-library/reactive-md-compiler-standard.js +6 -6
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +6 -0
- package/dist-library/reactive-md-default-packs.js +31 -14
- package/dist-library/reactive-md-default-preset.js +7 -6
- package/dist-library/reactive-md-export.js +6 -5
- package/dist-library/reactive-md-minimal-preset.js +2 -2
- package/dist-library/reactive-md-minimal-react-preset.js +22 -20
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +126 -0
- package/dist-library/reactive-md-pack-style-manifest.js +797 -0
- package/dist-library/reactive-md-plugin-chart.js +6 -5
- package/dist-library/reactive-md-plugin-data.js +8 -8
- package/dist-library/reactive-md-plugin-diagram.js +7 -6
- package/dist-library/reactive-md-plugin-forms.js +14 -13
- package/dist-library/reactive-md-plugin-gallery.js +6 -5
- package/dist-library/reactive-md-plugin-navigation.js +9 -9
- package/dist-library/reactive-md-plugin-network.js +13 -12
- package/dist-library/reactive-md-plugin-plot.js +7 -6
- package/dist-library/reactive-md-react-component-accordion.js +10 -0
- package/dist-library/reactive-md-react-component-alert.js +10 -0
- package/dist-library/reactive-md-react-component-anchor.js +10 -0
- package/dist-library/reactive-md-react-component-badge.js +10 -0
- package/dist-library/reactive-md-react-component-card.js +10 -0
- package/dist-library/reactive-md-react-component-chart.js +22 -0
- package/dist-library/reactive-md-react-component-checkbox.js +10 -0
- package/dist-library/reactive-md-react-component-checklist.js +10 -0
- package/dist-library/reactive-md-react-component-choices.js +10 -0
- package/dist-library/reactive-md-react-component-column.js +6 -0
- package/dist-library/reactive-md-react-component-coordinate.js +21 -0
- package/dist-library/reactive-md-react-component-counter.js +10 -0
- package/dist-library/reactive-md-react-component-data-table.js +14 -0
- package/dist-library/reactive-md-react-component-date.js +10 -0
- package/dist-library/reactive-md-react-component-diagram.js +22 -0
- package/dist-library/reactive-md-react-component-disclosure.js +10 -0
- package/dist-library/reactive-md-react-component-edge.js +22 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
- package/dist-library/reactive-md-react-component-gallery.js +10 -0
- package/dist-library/reactive-md-react-component-grid.js +10 -0
- package/dist-library/reactive-md-react-component-if.js +10 -0
- package/dist-library/reactive-md-react-component-input.js +10 -0
- package/dist-library/reactive-md-react-component-jump.js +10 -0
- package/dist-library/reactive-md-react-component-multi-select.js +10 -0
- package/dist-library/reactive-md-react-component-node.js +22 -0
- package/dist-library/reactive-md-react-component-number.js +10 -0
- package/dist-library/reactive-md-react-component-option.js +10 -0
- package/dist-library/reactive-md-react-component-panel.js +10 -0
- package/dist-library/reactive-md-react-component-plot.js +26 -0
- package/dist-library/reactive-md-react-component-progress.js +10 -0
- package/dist-library/reactive-md-react-component-quiz.js +10 -0
- package/dist-library/reactive-md-react-component-radio-group.js +10 -0
- package/dist-library/reactive-md-react-component-range-slider.js +10 -0
- package/dist-library/reactive-md-react-component-section.js +10 -0
- package/dist-library/reactive-md-react-component-select.js +10 -0
- package/dist-library/reactive-md-react-component-slider.js +10 -0
- package/dist-library/reactive-md-react-component-step.js +10 -0
- package/dist-library/reactive-md-react-component-steps.js +10 -0
- package/dist-library/reactive-md-react-component-tab.js +10 -0
- package/dist-library/reactive-md-react-component-table.js +14 -0
- package/dist-library/reactive-md-react-component-tabs.js +10 -0
- package/dist-library/reactive-md-react-component-text.js +10 -0
- package/dist-library/reactive-md-react-component-textarea.js +10 -0
- package/dist-library/reactive-md-react-component-timeline.js +14 -0
- package/dist-library/reactive-md-react-component-timer.js +10 -0
- package/dist-library/reactive-md-react-component-toggle.js +10 -0
- package/dist-library/reactive-md-react-component-tooltip.js +10 -0
- package/dist-library/reactive-md-react-component-validation.js +10 -0
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +44 -0
- package/dist-library/reactive-md-react-pack-data.js +21 -0
- package/dist-library/reactive-md-react-pack-layout.js +36 -0
- package/dist-library/reactive-md-react-pack-visuals.js +43 -0
- package/dist-library/reactive-md-react-packed.js +50 -0
- package/dist-library/reactive-md-react-server.js +26 -25
- package/dist-library/reactive-md-react-static-server.js +24 -0
- package/dist-library/reactive-md-react-static.js +1 -0
- package/dist-library/reactive-md-react-unstyled.js +15 -12
- package/dist-library/reactive-md-react.js +15 -12
- package/dist-library/reactive-md-runtime-browser.js +2 -1
- package/dist-library/reactive-md-runtime.js +4 -3
- package/dist-library/reactive-md-scan.js +1 -0
- package/dist-library/reactive-md-sdk.js +9 -8
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +32 -32
- package/dist-library/reactive-md-testing.js +12 -12
- package/dist-library/reactive-md-worker-pool.js +401 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +84 -1361
- package/dist-library/registry-core-CziAIP5P.js +125 -0
- package/dist-library/render-nodes-DKjg_TR1.js +9369 -0
- package/dist-library/{resources-D2GDQS0p.js → requirements-DhIkxAbl.js} +37 -84
- package/dist-library/resources-B_nbROgj.js +74 -0
- package/dist-library/rmd-pack-controls.css +1032 -0
- package/dist-library/rmd-pack-data.css +724 -0
- package/dist-library/rmd-pack-layout.css +1825 -0
- package/dist-library/rmd-pack-resource-chart.css +300 -0
- package/dist-library/rmd-pack-resource-controls.css +781 -0
- package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
- package/dist-library/rmd-pack-resource-diagram.css +106 -0
- package/dist-library/rmd-pack-resource-gallery.css +346 -0
- package/dist-library/rmd-pack-resource-graphics.css +516 -0
- package/dist-library/rmd-pack-resource-layout.css +1480 -0
- package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
- package/dist-library/rmd-pack-resource-mafs.css +129 -0
- package/dist-library/rmd-pack-resource-visual-base.css +224 -0
- package/dist-library/rmd-pack-visuals.css +1394 -0
- package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
- package/dist-library/{runtime-kcA7bG7G.js → runtime-CuJndKqK.js} +320 -313
- package/dist-library/runtime-requirement-C4-vNcf5.js +769 -0
- package/dist-library/schema-core-4sd1Vu7V.js +132 -0
- package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-BLsW9cCy.js} +494 -520
- package/dist-library/{session-core-nmJHuR9c.js → session-core-DLBRPV7f.js} +33 -31
- package/dist-library/{shareable-DpbE-59H.js → shareable-C6mUerpQ.js} +215 -209
- package/dist-library/shared-bTzN-F4g.js +3 -0
- package/dist-library/structural-views-30-YD_TJ.js +11 -0
- package/dist-library/table-surface-CfZn_tk-.js +13 -0
- package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
- package/dist-library/types/assemblies/default-config.d.ts +35 -0
- package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
- package/dist-library/types/assemblies/default-registry.d.ts +18 -0
- package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
- package/dist-library/types/authoring/catalog.d.ts +11 -1
- package/dist-library/types/authoring/extensions.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +3 -3
- package/dist-library/types/authoring/templates.d.ts +1 -1
- package/dist-library/types/build/diagnostics.d.ts +1 -1
- package/dist-library/types/compiler/index.d.ts +1 -0
- package/dist-library/types/compiler/session.d.ts +19 -0
- package/dist-library/types/compiler/standard.d.ts +1 -0
- package/dist-library/types/components/entries/accordion.d.ts +3 -0
- package/dist-library/types/components/entries/alert.d.ts +3 -0
- package/dist-library/types/components/entries/anchor.d.ts +3 -0
- package/dist-library/types/components/entries/badge.d.ts +3 -0
- package/dist-library/types/components/entries/card.d.ts +3 -0
- package/dist-library/types/components/entries/chart.d.ts +3 -0
- package/dist-library/types/components/entries/checkbox.d.ts +3 -0
- package/dist-library/types/components/entries/checklist.d.ts +3 -0
- package/dist-library/types/components/entries/choices.d.ts +3 -0
- package/dist-library/types/components/entries/column.d.ts +3 -0
- package/dist-library/types/components/entries/coordinate.d.ts +3 -0
- package/dist-library/types/components/entries/counter.d.ts +3 -0
- package/dist-library/types/components/entries/data-table.d.ts +3 -0
- package/dist-library/types/components/entries/date.d.ts +3 -0
- package/dist-library/types/components/entries/diagram.d.ts +3 -0
- package/dist-library/types/components/entries/disclosure.d.ts +3 -0
- package/dist-library/types/components/entries/edge.d.ts +3 -0
- package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
- package/dist-library/types/components/entries/gallery.d.ts +3 -0
- package/dist-library/types/components/entries/grid.d.ts +3 -0
- package/dist-library/types/components/entries/if.d.ts +3 -0
- package/dist-library/types/components/entries/input.d.ts +3 -0
- package/dist-library/types/components/entries/jump.d.ts +3 -0
- package/dist-library/types/components/entries/multi-select.d.ts +3 -0
- package/dist-library/types/components/entries/node.d.ts +3 -0
- package/dist-library/types/components/entries/number.d.ts +3 -0
- package/dist-library/types/components/entries/option.d.ts +3 -0
- package/dist-library/types/components/entries/panel.d.ts +3 -0
- package/dist-library/types/components/entries/plot.d.ts +3 -0
- package/dist-library/types/components/entries/progress.d.ts +3 -0
- package/dist-library/types/components/entries/quiz.d.ts +3 -0
- package/dist-library/types/components/entries/radio-group.d.ts +3 -0
- package/dist-library/types/components/entries/range-slider.d.ts +3 -0
- package/dist-library/types/components/entries/section.d.ts +3 -0
- package/dist-library/types/components/entries/select.d.ts +3 -0
- package/dist-library/types/components/entries/slider.d.ts +3 -0
- package/dist-library/types/components/entries/step.d.ts +3 -0
- package/dist-library/types/components/entries/steps.d.ts +3 -0
- package/dist-library/types/components/entries/tab.d.ts +3 -0
- package/dist-library/types/components/entries/table.d.ts +3 -0
- package/dist-library/types/components/entries/tabs.d.ts +3 -0
- package/dist-library/types/components/entries/text.d.ts +3 -0
- package/dist-library/types/components/entries/textarea.d.ts +3 -0
- package/dist-library/types/components/entries/timeline.d.ts +3 -0
- package/dist-library/types/components/entries/timer.d.ts +3 -0
- package/dist-library/types/components/entries/toggle.d.ts +3 -0
- package/dist-library/types/components/entries/tooltip.d.ts +3 -0
- package/dist-library/types/components/entries/validation.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +1 -3
- package/dist-library/types/components/layout/structural-views.d.ts +3 -0
- package/dist-library/types/components/mount-preset.d.ts +2 -0
- package/dist-library/types/components/packs/controls.d.ts +2 -0
- package/dist-library/types/components/packs/data.d.ts +2 -0
- package/dist-library/types/components/packs/layout.d.ts +2 -0
- package/dist-library/types/components/packs/visuals.d.ts +2 -0
- package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
- package/dist-library/types/components/shared/table-surface.d.ts +10 -0
- package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
- package/dist-library/types/components/shared/visuals.d.ts +0 -2
- package/dist-library/types/components/table/data-table-model.d.ts +48 -0
- package/dist-library/types/components/table/data-table.d.ts +1 -48
- package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +4 -2
- package/dist-library/types/contracts/index.d.ts +8 -0
- package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
- package/dist-library/types/contracts/localization.d.ts +6 -0
- package/dist-library/types/contracts/runtime-types.d.ts +19 -0
- package/dist-library/types/local/compilation/cache-version.d.ts +1 -0
- package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
- package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +5 -4
- package/dist-library/types/local/compilation/compiler-structure.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-tables.d.ts +3 -2
- package/dist-library/types/local/compilation/compiler-validation.d.ts +5 -9
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler.d.ts +1 -1
- package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
- package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
- package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
- package/dist-library/types/local/compilation/streaming.d.ts +1 -1
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +55 -0
- package/dist-library/types/local/configuration/embedding.d.ts +4 -0
- package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
- package/dist-library/types/local/configuration/options-core.d.ts +8 -2
- package/dist-library/types/local/index.d.ts +12 -1
- package/dist-library/types/local/observability-codes.d.ts +2 -0
- package/dist-library/types/local/observability-core.d.ts +44 -0
- package/dist-library/types/local/observability-messages.d.ts +6 -0
- package/dist-library/types/local/observability.d.ts +45 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
- package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
- package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
- package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
- package/dist-library/types/local/performance-report.d.ts +70 -0
- package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
- package/dist-library/types/local/transport/worker-handler.d.ts +3 -0
- package/dist-library/types/local/transport/worker-job.d.ts +12 -2
- package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
- package/dist-library/types/local/transport/worker.d.ts +66 -1
- package/dist-library/types/local/types.d.ts +45 -25
- package/dist-library/types/observability.d.ts +8 -0
- package/dist-library/types/presets/default-semantics.d.ts +1 -1
- package/dist-library/types/presets/identity.d.ts +1 -8
- package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
- package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
- package/dist-library/types/react/component-api.d.ts +3 -2
- package/dist-library/types/react/component-loader.d.ts +61 -0
- package/dist-library/types/react/component-primitives.d.ts +5 -5
- package/dist-library/types/react/index.d.ts +9 -5
- package/dist-library/types/react/localization.d.ts +5 -6
- package/dist-library/types/react/minimal.d.ts +2 -2
- package/dist-library/types/react/package-core.d.ts +3 -0
- package/dist-library/types/react/packed.d.ts +17 -0
- package/dist-library/types/react/render-lifecycle.d.ts +9 -0
- package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
- package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
- package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
- package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
- package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
- package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
- package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
- package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
- package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
- package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
- package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +2 -2
- package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
- package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +2 -2
- package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
- package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
- package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
- package/dist-library/types/react/sdk-core.d.ts +12 -3
- package/dist-library/types/react/sdk.d.ts +2 -1
- package/dist-library/types/react/server.d.ts +3 -10
- package/dist-library/types/react/static-server.d.ts +12 -0
- package/dist-library/types/scan/index.d.ts +15 -0
- package/dist-library/types/sdk/config.d.ts +2 -35
- package/dist-library/types/sdk/default-identity.d.ts +3 -0
- package/dist-library/types/sdk/index.d.ts +1 -1
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +8 -3
- package/dist-library/types/sdk/registry-core.d.ts +2 -2
- package/dist-library/types/sdk/registry.d.ts +2 -18
- package/dist-library/types/sdk/types.d.ts +2 -2
- package/dist-library/types/sdk/version.d.ts +2 -0
- package/dist-library/types/standalone/session-core.d.ts +1 -1
- package/dist-library/{types-BeNtPqdY.js → types-Bza88SGK.js} +1 -1
- package/dist-library/types-daDo2c_w.js +3 -0
- package/dist-library/use-hydrated-W-laKPhY.js +22975 -0
- package/dist-library/validation-XXlb-spV.js +860 -0
- package/dist-library/version-B0G1699c.js +138 -0
- package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
- package/dist-library/visual-helpers-CRmaqCHX.js +75 -0
- package/dist-library/visuals-CdHezgh5.js +3 -0
- package/dist-library/visuals-CoVSjVD8.js +49159 -0
- package/dist-library/worker-D6WMV8xJ.js +1632 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +119 -118
- package/docs/README-ch.md +8 -1
- package/docs/README.md +8 -1
- package/docs/compatibility/api-stability-ch.md +25 -0
- package/docs/compatibility/api-stability-en.md +25 -0
- package/docs/compatibility/compatibility-ch.md +32 -15
- package/docs/compatibility/compatibility-en.md +32 -15
- package/docs/compatibility/compatibility-manifest.schema.json +161 -0
- package/docs/compatibility/deprecation-ch.md +21 -0
- package/docs/compatibility/deprecation-en.md +21 -0
- package/docs/compatibility/source-versioning-ch.md +1 -1
- package/docs/compatibility/source-versioning-en.md +1 -1
- package/docs/compatibility/support-matrix-ch.md +108 -0
- package/docs/compatibility/support-matrix-en.md +108 -0
- 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 +16 -0
- package/docs/development/component-development-reference-en.md +16 -0
- package/docs/development/component-protocol-ch.md +31 -11
- package/docs/development/component-protocol-en.md +31 -11
- package/docs/integration/author-tools-ch.md +3 -1
- package/docs/integration/author-tools-en.md +3 -1
- package/docs/integration/compiler-ch.md +42 -1
- package/docs/integration/compiler-en.md +42 -1
- package/docs/integration/editor-ch.md +2 -2
- package/docs/integration/editor-en.md +2 -2
- package/docs/integration/extension-sdk-ch.md +6 -2
- package/docs/integration/extension-sdk-en.md +6 -2
- package/docs/integration/local-integration-ch.md +4 -2
- package/docs/integration/local-integration-en.md +4 -2
- package/docs/reference/public-api-ch.md +143 -7
- package/docs/reference/public-api-en.md +143 -7
- package/docs/releases/release-0.9.2-ch.md +33 -0
- package/docs/releases/release-0.9.2-en.md +33 -0
- package/docs/releases/release-0.9.3-ch.md +45 -0
- package/docs/releases/release-0.9.3-en.md +45 -0
- package/examples/integration/README-ch.md +36 -4
- package/examples/integration/README.md +36 -4
- package/examples/integration/chat-session/index.mjs +91 -0
- package/examples/integration/chat-session/package.json +10 -0
- package/examples/integration/static-embed/embed.mjs +44 -0
- package/examples/integration/static-embed/index.html +12 -0
- package/examples/integration/static-embed/main.mjs +24 -0
- package/examples/integration/static-embed/references.mjs +5 -0
- package/examples/integration/static-embed/render.mjs +10 -0
- package/package.json +67 -2
- package/dist-library/LocalDocumentView-sthUP0ct.js +0 -109
- package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +0 -275
- package/dist-library/compiler-eOfcinZs.js +0 -62
- package/dist-library/component-state-BoLCGee4.js +0 -801
- package/dist-library/controls-CcT6n7k_.js +0 -6740
- package/dist-library/mount-preset-KxvtKgJb.js +0 -13
- package/dist-library/options-1aDLK7JY.js +0 -121
- package/dist-library/parser-standard-Yuf3A_VI.js +0 -9630
- package/dist-library/plugin-packs-B1XPWcFs.js +0 -18
- package/dist-library/preset-core-CKc5YXSM.js +0 -1443
- package/dist-library/props-sJ8vk0cr.js +0 -183
- package/dist-library/react-D5iGiUdL.js +0 -7
- package/dist-library/schema-BufhKUSM.js +0 -40
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
- package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
- package/dist-library/validation-BEBA_HvS.js +0 -1121
- package/dist-library/visual-frame-CyV1FXzs.js +0 -48
- package/dist-library/visuals-BZbZYA7w.js +0 -72572
- /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
- /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
- /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import { c as e, l as t, n, t as r } from "./identity-BUx0Q_-d.js";
|
|
2
|
+
// src/runtime-services/network.ts
|
|
3
|
+
var i = 65536, a = Object.freeze({
|
|
4
|
+
code: "unavailable",
|
|
5
|
+
message: "This channel operation is unavailable."
|
|
6
|
+
}), o = Object.freeze({
|
|
7
|
+
code: "cancelled",
|
|
8
|
+
message: "The operation was cancelled."
|
|
9
|
+
}), s = Object.freeze({
|
|
10
|
+
code: "invalid-data",
|
|
11
|
+
message: "The channel data is invalid."
|
|
12
|
+
}), c = Object.freeze({
|
|
13
|
+
code: "transport",
|
|
14
|
+
message: "The channel could not communicate with its endpoint."
|
|
15
|
+
}), l = Object.freeze({
|
|
16
|
+
code: "rejected",
|
|
17
|
+
message: "A channel listener failed."
|
|
18
|
+
}), u = 0;
|
|
19
|
+
function d(e) {
|
|
20
|
+
return {
|
|
21
|
+
ok: !1,
|
|
22
|
+
error: e
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var f = Object.freeze({
|
|
26
|
+
supports: () => !1,
|
|
27
|
+
submit: async () => d(a),
|
|
28
|
+
subscribe(e, t) {
|
|
29
|
+
let n = !0;
|
|
30
|
+
return queueMicrotask(() => {
|
|
31
|
+
if (n) try {
|
|
32
|
+
t({
|
|
33
|
+
type: "error",
|
|
34
|
+
error: a
|
|
35
|
+
});
|
|
36
|
+
} catch {}
|
|
37
|
+
}), () => {
|
|
38
|
+
n = !1;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
function p(e = i) {
|
|
43
|
+
if (!Number.isSafeInteger(e) || e < 1) throw TypeError("A channel byte budget must be a positive integer.");
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
function m(e, t) {
|
|
47
|
+
let n = t;
|
|
48
|
+
function r(e) {
|
|
49
|
+
if (n -= e, n < 0) throw RangeError();
|
|
50
|
+
}
|
|
51
|
+
function i(e, t) {
|
|
52
|
+
if (r(1), t > 64) throw RangeError();
|
|
53
|
+
if (e === null || typeof e == "boolean") return e;
|
|
54
|
+
if (typeof e == "string") return r(e.length), e;
|
|
55
|
+
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
56
|
+
if (Array.isArray(e)) {
|
|
57
|
+
if (e.length > n) throw RangeError();
|
|
58
|
+
let r = [];
|
|
59
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
60
|
+
let a = Object.getOwnPropertyDescriptor(e, String(n));
|
|
61
|
+
if (!a || !("value" in a)) throw TypeError();
|
|
62
|
+
r.push(i(a.value, t + 1));
|
|
63
|
+
}
|
|
64
|
+
return Object.freeze(r);
|
|
65
|
+
}
|
|
66
|
+
if (typeof e != "object" || !e) throw TypeError();
|
|
67
|
+
let a = Object.getPrototypeOf(e);
|
|
68
|
+
if (a !== Object.prototype && a !== null) throw TypeError();
|
|
69
|
+
let o = Object.create(null);
|
|
70
|
+
for (let n of Object.keys(e)) {
|
|
71
|
+
r(n.length);
|
|
72
|
+
let a = Object.getOwnPropertyDescriptor(e, n);
|
|
73
|
+
if (!a || !("value" in a)) throw TypeError();
|
|
74
|
+
o[n] = i(a.value, t + 1);
|
|
75
|
+
}
|
|
76
|
+
return Object.freeze(o);
|
|
77
|
+
}
|
|
78
|
+
let a = i(e, 0);
|
|
79
|
+
if (new TextEncoder().encode(JSON.stringify(a)).length > t) throw RangeError();
|
|
80
|
+
return a;
|
|
81
|
+
}
|
|
82
|
+
function h(e) {
|
|
83
|
+
if (!e.ok) return e;
|
|
84
|
+
try {
|
|
85
|
+
let t = Object.getOwnPropertyDescriptor(e, "data");
|
|
86
|
+
if (t && "value" in t && t.value !== void 0) return {
|
|
87
|
+
ok: !0,
|
|
88
|
+
data: m(t.value, i)
|
|
89
|
+
};
|
|
90
|
+
} catch {}
|
|
91
|
+
return { ok: !0 };
|
|
92
|
+
}
|
|
93
|
+
function g(e, t) {
|
|
94
|
+
let n = t(e);
|
|
95
|
+
if (n !== !0) return typeof n == "string" && n.trim() ? Object.freeze({
|
|
96
|
+
code: "invalid-data",
|
|
97
|
+
message: n
|
|
98
|
+
}) : s;
|
|
99
|
+
}
|
|
100
|
+
function _(e) {
|
|
101
|
+
if (!e) return {
|
|
102
|
+
network: f,
|
|
103
|
+
bindExternalValues: () => void 0,
|
|
104
|
+
dispose() {}
|
|
105
|
+
};
|
|
106
|
+
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
107
|
+
for (let [r, i] of Object.entries(e.channels)) {
|
|
108
|
+
let { submit: e, subscribe: a, mapExternalValues: o } = i;
|
|
109
|
+
if (e && (typeof e.validate != "function" || typeof e.send != "function")) throw TypeError("A submit channel requires a validator and a send function.");
|
|
110
|
+
if (a && (typeof a.validate != "function" || typeof a.open != "function")) throw TypeError("A subscription channel requires a validator and an open function.");
|
|
111
|
+
if (o !== void 0) {
|
|
112
|
+
if (!a || typeof o != "function") throw TypeError("Mapping external values requires a subscription and a mapper function.");
|
|
113
|
+
n.set(r, o.bind(i));
|
|
114
|
+
}
|
|
115
|
+
t.set(r, {
|
|
116
|
+
...e && { submit: {
|
|
117
|
+
maxBytes: p(e.maxBytes),
|
|
118
|
+
validate: e.validate.bind(e),
|
|
119
|
+
send: e.send.bind(e)
|
|
120
|
+
} },
|
|
121
|
+
...a && { subscribe: {
|
|
122
|
+
maxBytes: p(a.maxBytes),
|
|
123
|
+
validate: a.validate.bind(a),
|
|
124
|
+
open: a.open.bind(a)
|
|
125
|
+
} }
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), v = !1;
|
|
129
|
+
function y(e) {
|
|
130
|
+
let t = r.get(e);
|
|
131
|
+
return t || r.set(e, t = new AbortController()), t.signal;
|
|
132
|
+
}
|
|
133
|
+
function b(t, n) {
|
|
134
|
+
try {
|
|
135
|
+
t.notify(Object.freeze(n));
|
|
136
|
+
} catch {
|
|
137
|
+
try {
|
|
138
|
+
e?.onListenerError?.(l);
|
|
139
|
+
} catch {}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function x(e) {
|
|
143
|
+
try {
|
|
144
|
+
e?.();
|
|
145
|
+
} catch {}
|
|
146
|
+
}
|
|
147
|
+
function S(e, t) {
|
|
148
|
+
_.delete(e), t.listeners.clear(), t.events.length = 0, t.controller.abort(), x(t.release);
|
|
149
|
+
}
|
|
150
|
+
function C(e, t) {
|
|
151
|
+
if (!(v || e.controller.signal.aborted) && (e.events.push({
|
|
152
|
+
event: t,
|
|
153
|
+
recipients: [...e.listeners],
|
|
154
|
+
status: e.status
|
|
155
|
+
}), !e.dispatching)) {
|
|
156
|
+
e.dispatching = !0;
|
|
157
|
+
try {
|
|
158
|
+
for (let t = 0; t < e.events.length; t += 1) {
|
|
159
|
+
let { event: n, recipients: r, status: i } = e.events[t];
|
|
160
|
+
for (let t of r) e.listeners.has(t) && (t.initial || (t.initial = !0, n.type !== "status" && b(t, {
|
|
161
|
+
type: "status",
|
|
162
|
+
state: i
|
|
163
|
+
})), e.listeners.has(t) && b(t, n));
|
|
164
|
+
}
|
|
165
|
+
} finally {
|
|
166
|
+
e.events.length = 0, e.dispatching = !1;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function w(e, t, n) {
|
|
171
|
+
let r = t.controller.signal;
|
|
172
|
+
if (r.aborted) return;
|
|
173
|
+
let i = (e) => {
|
|
174
|
+
r.aborted || t.status === e || (t.status = e, C(t, {
|
|
175
|
+
type: "status",
|
|
176
|
+
state: e
|
|
177
|
+
}));
|
|
178
|
+
}, a = (e) => {
|
|
179
|
+
C(t, {
|
|
180
|
+
type: "error",
|
|
181
|
+
error: Object.freeze({ ...e })
|
|
182
|
+
});
|
|
183
|
+
}, o = (e) => {
|
|
184
|
+
if (r.aborted) return;
|
|
185
|
+
let i, o;
|
|
186
|
+
try {
|
|
187
|
+
i = m(e, n.maxBytes ?? 65536), o = g(i, n.validate);
|
|
188
|
+
} catch {
|
|
189
|
+
a(s);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
o ? a(o) : C(t, {
|
|
193
|
+
type: "data",
|
|
194
|
+
value: i
|
|
195
|
+
});
|
|
196
|
+
}, l = () => {
|
|
197
|
+
r.aborted || (a(c), i("closed"));
|
|
198
|
+
}, u = (e) => {
|
|
199
|
+
r.aborted ? x(e) : t.release = e;
|
|
200
|
+
};
|
|
201
|
+
try {
|
|
202
|
+
let t = n.open({
|
|
203
|
+
signal: r,
|
|
204
|
+
sessionSignal: y(e),
|
|
205
|
+
status: i,
|
|
206
|
+
error: a,
|
|
207
|
+
data: o
|
|
208
|
+
});
|
|
209
|
+
typeof t == "function" ? u(t) : Promise.resolve(t).then(u, l);
|
|
210
|
+
} catch {
|
|
211
|
+
l();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
let T = {
|
|
215
|
+
supports(e, n) {
|
|
216
|
+
return !v && (n === "submit" || n === "subscribe") && t.get(e)?.[n] !== void 0;
|
|
217
|
+
},
|
|
218
|
+
async submit(e, n, r) {
|
|
219
|
+
let l = v ? void 0 : t.get(e)?.submit;
|
|
220
|
+
if (!l) return d(a);
|
|
221
|
+
if (r?.signal?.aborted) return d(o);
|
|
222
|
+
let f;
|
|
223
|
+
try {
|
|
224
|
+
let e = m(n, l.maxBytes ?? 65536);
|
|
225
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return d(s);
|
|
226
|
+
f = e;
|
|
227
|
+
let t = g(f, l.validate);
|
|
228
|
+
if (t) return d(t);
|
|
229
|
+
} catch {
|
|
230
|
+
return d(s);
|
|
231
|
+
}
|
|
232
|
+
let p = r?.signal;
|
|
233
|
+
if (v || p?.aborted) return d(o);
|
|
234
|
+
let _ = new AbortController();
|
|
235
|
+
return new Promise((t) => {
|
|
236
|
+
let n = !1, a = (e) => {
|
|
237
|
+
n || (n = !0, p?.removeEventListener("abort", s), i.delete(s), t(h(e)));
|
|
238
|
+
}, s = () => {
|
|
239
|
+
a(d(o)), _.abort();
|
|
240
|
+
};
|
|
241
|
+
i.add(s), p?.addEventListener("abort", s, { once: !0 });
|
|
242
|
+
try {
|
|
243
|
+
let t = l.send(f, {
|
|
244
|
+
signal: _.signal,
|
|
245
|
+
sessionSignal: y(e),
|
|
246
|
+
requestId: String(++u),
|
|
247
|
+
...r?.idempotencyKey === void 0 ? {} : { idempotencyKey: r.idempotencyKey }
|
|
248
|
+
});
|
|
249
|
+
Promise.resolve(t).then(a, () => a(d(c)));
|
|
250
|
+
} catch {
|
|
251
|
+
a(d(c));
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
},
|
|
255
|
+
subscribe(e, n) {
|
|
256
|
+
if (v) return f.subscribe(e, n);
|
|
257
|
+
let r = {
|
|
258
|
+
notify: n,
|
|
259
|
+
initial: !1
|
|
260
|
+
}, i = t.get(e)?.subscribe;
|
|
261
|
+
if (!i) {
|
|
262
|
+
let e = !0;
|
|
263
|
+
return queueMicrotask(() => {
|
|
264
|
+
e && !v && b(r, {
|
|
265
|
+
type: "error",
|
|
266
|
+
error: a
|
|
267
|
+
});
|
|
268
|
+
}), () => {
|
|
269
|
+
e = !1;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
let o = _.get(e), s = o ?? {
|
|
273
|
+
controller: new AbortController(),
|
|
274
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
275
|
+
events: [],
|
|
276
|
+
status: "connecting",
|
|
277
|
+
dispatching: !1
|
|
278
|
+
};
|
|
279
|
+
return s.listeners.add(r), o || _.set(e, s), queueMicrotask(() => {
|
|
280
|
+
s.listeners.has(r) && !r.initial && (r.initial = !0, b(r, {
|
|
281
|
+
type: "status",
|
|
282
|
+
state: s.status
|
|
283
|
+
})), o || w(e, s, i);
|
|
284
|
+
}), () => {
|
|
285
|
+
s.listeners.delete(r) && s.listeners.size === 0 && S(e, s);
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
return {
|
|
290
|
+
network: Object.freeze(T),
|
|
291
|
+
bindExternalValues(e) {
|
|
292
|
+
if (v || n.size === 0) return;
|
|
293
|
+
let t = [...n].map(([t, n]) => T.subscribe(t, (t) => {
|
|
294
|
+
if (t.type !== "data") return;
|
|
295
|
+
let r = n(t.value);
|
|
296
|
+
r !== void 0 && e(r);
|
|
297
|
+
}));
|
|
298
|
+
return () => {
|
|
299
|
+
for (let e of t) e();
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
dispose() {
|
|
303
|
+
if (!v) {
|
|
304
|
+
v = !0;
|
|
305
|
+
for (let e of i) e();
|
|
306
|
+
for (let [e, t] of _) S(e, t);
|
|
307
|
+
for (let e of r.values()) e.abort();
|
|
308
|
+
r.clear(), t.clear(), n.clear();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
// src/runtime-services/random.ts
|
|
314
|
+
var v = "mulberry32", y = 1;
|
|
315
|
+
function b(e) {
|
|
316
|
+
return Object.freeze({
|
|
317
|
+
algorithm: v,
|
|
318
|
+
version: 1,
|
|
319
|
+
state: t(e)
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function x(e) {
|
|
323
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return null;
|
|
324
|
+
let n = e;
|
|
325
|
+
if (n.algorithm !== "mulberry32" || n.version !== 1 || typeof n.state != "number" || !Number.isFinite(n.state)) return null;
|
|
326
|
+
let r = t(n.state);
|
|
327
|
+
return r === n.state ? Object.freeze({
|
|
328
|
+
algorithm: v,
|
|
329
|
+
version: 1,
|
|
330
|
+
state: r
|
|
331
|
+
}) : null;
|
|
332
|
+
}
|
|
333
|
+
function S(e) {
|
|
334
|
+
let n = t(e.state + 1831565813), r = Math.imul(n ^ n >>> 15, n | 1);
|
|
335
|
+
return r ^= r + Math.imul(r ^ r >>> 7, r | 61), {
|
|
336
|
+
value: ((r ^ r >>> 14) >>> 0) / 4294967296,
|
|
337
|
+
state: Object.freeze({
|
|
338
|
+
algorithm: v,
|
|
339
|
+
version: 1,
|
|
340
|
+
state: n
|
|
341
|
+
})
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
function C(e, t, n) {
|
|
345
|
+
let r = S(e);
|
|
346
|
+
if (!Number.isFinite(t) || !Number.isFinite(n)) return {
|
|
347
|
+
value: 0,
|
|
348
|
+
state: r.state
|
|
349
|
+
};
|
|
350
|
+
let i = Math.ceil(Math.min(t, n)), a = Math.floor(Math.max(t, n));
|
|
351
|
+
return a < i ? {
|
|
352
|
+
value: i,
|
|
353
|
+
state: r.state
|
|
354
|
+
} : {
|
|
355
|
+
value: i + Math.floor(r.value * (a - i + 1)),
|
|
356
|
+
state: r.state
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function w(e, t) {
|
|
360
|
+
let n = t.slice(), r = e;
|
|
361
|
+
for (let e = n.length - 1; e > 0; --e) {
|
|
362
|
+
let t = C(r, 0, e);
|
|
363
|
+
r = t.state;
|
|
364
|
+
let i = n[e];
|
|
365
|
+
n[e] = n[t.value], n[t.value] = i;
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
items: n,
|
|
369
|
+
state: r
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function T(e, t) {
|
|
373
|
+
return b(n(e, t));
|
|
374
|
+
}
|
|
375
|
+
function E(e, t = .5) {
|
|
376
|
+
let n = S(e);
|
|
377
|
+
return {
|
|
378
|
+
value: n.value < t,
|
|
379
|
+
state: n.state
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
// src/runtime-services/component-state.ts
|
|
383
|
+
var D = "reactive-md-component-state/v1", O = "reactive-md-component-state-document/v1", k = 16384, A = 262144, j = 16, M = 1e4, N = 1e5, P = 1048576, F = 128, I = 64, L = 512, R = 1e6, z = 128, B = /[\u0000-\u001f\u007f-\u009f]/, V = new TextEncoder();
|
|
384
|
+
function H(e, t, n = "error") {
|
|
385
|
+
return {
|
|
386
|
+
code: e,
|
|
387
|
+
message: t,
|
|
388
|
+
severity: n,
|
|
389
|
+
range: {
|
|
390
|
+
start: 0,
|
|
391
|
+
end: 0
|
|
392
|
+
},
|
|
393
|
+
line: 1,
|
|
394
|
+
column: 1
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function U(e) {
|
|
398
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
399
|
+
let t = Object.getPrototypeOf(e);
|
|
400
|
+
return t === Object.prototype || t === null;
|
|
401
|
+
}
|
|
402
|
+
function W(e) {
|
|
403
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
404
|
+
let n = e.charCodeAt(t);
|
|
405
|
+
if (n >= 55296 && n <= 56319) {
|
|
406
|
+
let n = e.charCodeAt(t + 1);
|
|
407
|
+
if (n >= 56320 && n <= 57343) {
|
|
408
|
+
t += 1;
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
return !1;
|
|
412
|
+
}
|
|
413
|
+
if (n >= 56320 && n <= 57343) return !1;
|
|
414
|
+
}
|
|
415
|
+
return !0;
|
|
416
|
+
}
|
|
417
|
+
function G(e) {
|
|
418
|
+
return typeof e == "string" && e.length > 0 && e.length <= z && !B.test(e) && W(e);
|
|
419
|
+
}
|
|
420
|
+
function K(e, t, n) {
|
|
421
|
+
return t === void 0 || e === t || n.includes(e);
|
|
422
|
+
}
|
|
423
|
+
function q(e, t) {
|
|
424
|
+
if (e === null) return null;
|
|
425
|
+
if (typeof e == "boolean") return e;
|
|
426
|
+
if (typeof e == "number") {
|
|
427
|
+
if (!Number.isFinite(e)) throw TypeError("numbers must be finite");
|
|
428
|
+
return e;
|
|
429
|
+
}
|
|
430
|
+
if (typeof e == "string") {
|
|
431
|
+
if (e.length > 1e5) throw RangeError(`strings exceed ${N} characters`);
|
|
432
|
+
if (!W(e)) throw TypeError("strings must be well-formed Unicode");
|
|
433
|
+
return e;
|
|
434
|
+
}
|
|
435
|
+
if (t >= 16) throw RangeError("nesting exceeds 16 levels");
|
|
436
|
+
if (Array.isArray(e)) {
|
|
437
|
+
if (e.length > 1e4) throw RangeError(`arrays exceed ${M} items`);
|
|
438
|
+
if (Object.getOwnPropertySymbols(e).length > 0) throw TypeError("arrays cannot use symbol keys");
|
|
439
|
+
return e.map((e) => q(e, t + 1));
|
|
440
|
+
}
|
|
441
|
+
if (U(e)) {
|
|
442
|
+
if (Object.getOwnPropertySymbols(e).length > 0) throw TypeError("objects cannot use symbol keys");
|
|
443
|
+
let n = Object.keys(e);
|
|
444
|
+
if (n.length > 1e4) throw RangeError(`objects exceed ${M} keys`);
|
|
445
|
+
let r = {};
|
|
446
|
+
for (let i of n) {
|
|
447
|
+
if (i === "__proto__") throw TypeError("the key \"__proto__\" is not allowed");
|
|
448
|
+
if (i.length > 1e5) throw RangeError(`keys exceed ${N} characters`);
|
|
449
|
+
if (!W(i)) throw TypeError("keys must be well-formed Unicode");
|
|
450
|
+
r[i] = q(e[i], t + 1);
|
|
451
|
+
}
|
|
452
|
+
return r;
|
|
453
|
+
}
|
|
454
|
+
throw TypeError("values must be JSON-safe primitives, arrays or plain objects");
|
|
455
|
+
}
|
|
456
|
+
function J(e) {
|
|
457
|
+
return q(e, 0);
|
|
458
|
+
}
|
|
459
|
+
function Y(e) {
|
|
460
|
+
return Object.freeze({
|
|
461
|
+
...e,
|
|
462
|
+
data: q(e.data, 0),
|
|
463
|
+
...e.random === void 0 ? {} : { random: x(e.random) ?? e.random }
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
function X(e) {
|
|
467
|
+
if (!U(e)) return {
|
|
468
|
+
ok: !1,
|
|
469
|
+
diagnostics: [H("local.runtime.state.shape", "A component state record must be a plain object.")]
|
|
470
|
+
};
|
|
471
|
+
let t = /* @__PURE__ */ new Set([
|
|
472
|
+
"format",
|
|
473
|
+
"component",
|
|
474
|
+
"componentVersion",
|
|
475
|
+
"stateVersion",
|
|
476
|
+
"key",
|
|
477
|
+
"documentId",
|
|
478
|
+
"data",
|
|
479
|
+
"random"
|
|
480
|
+
]);
|
|
481
|
+
for (let n of Object.keys(e)) if (!t.has(n)) return {
|
|
482
|
+
ok: !1,
|
|
483
|
+
diagnostics: [H("local.runtime.state.key", `Unknown component state key "${n}".`)]
|
|
484
|
+
};
|
|
485
|
+
if (e.format !== "reactive-md-component-state/v1") return {
|
|
486
|
+
ok: !1,
|
|
487
|
+
diagnostics: [H("local.runtime.state.format", `Unsupported component state format; expected "${D}".`)]
|
|
488
|
+
};
|
|
489
|
+
let n = e.component;
|
|
490
|
+
if (typeof n != "string" || n.trim() === "" || n.length > F) return {
|
|
491
|
+
ok: !1,
|
|
492
|
+
diagnostics: [H("local.runtime.state.component", "Component name must be a non-empty string.")]
|
|
493
|
+
};
|
|
494
|
+
let r = e.componentVersion;
|
|
495
|
+
if (typeof r != "string" || r.trim() === "" || r.length > I) return {
|
|
496
|
+
ok: !1,
|
|
497
|
+
diagnostics: [H("local.runtime.state.component-version", "Component version must be a non-empty string.")]
|
|
498
|
+
};
|
|
499
|
+
let i = e.stateVersion;
|
|
500
|
+
if (typeof i != "number" || !Number.isInteger(i) || i < 0 || i > R) return {
|
|
501
|
+
ok: !1,
|
|
502
|
+
diagnostics: [H("local.runtime.state.version", "State version must be a non-negative integer.")]
|
|
503
|
+
};
|
|
504
|
+
let a = e.key;
|
|
505
|
+
if (typeof a != "string" || a.trim() === "" || a.length > L) return {
|
|
506
|
+
ok: !1,
|
|
507
|
+
diagnostics: [H("local.runtime.state.key-name", "State key must be a non-empty string.")]
|
|
508
|
+
};
|
|
509
|
+
let o = e.documentId;
|
|
510
|
+
if (o !== void 0 && (typeof o != "string" || o.trim() === "" || o.length > 256)) return {
|
|
511
|
+
ok: !1,
|
|
512
|
+
diagnostics: [H("local.runtime.state.document", "State documentId must be a non-empty string.")]
|
|
513
|
+
};
|
|
514
|
+
let s;
|
|
515
|
+
try {
|
|
516
|
+
s = J(e.data);
|
|
517
|
+
} catch (e) {
|
|
518
|
+
return {
|
|
519
|
+
ok: !1,
|
|
520
|
+
diagnostics: [H("local.runtime.state.data", `Invalid component state data: ${e instanceof Error ? e.message : String(e)}.`)]
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
let c;
|
|
524
|
+
if (e.random !== void 0 && (c = x(e.random) ?? void 0, c === void 0)) return {
|
|
525
|
+
ok: !1,
|
|
526
|
+
diagnostics: [H("local.runtime.state.random", "Invalid random state.")]
|
|
527
|
+
};
|
|
528
|
+
let l = {
|
|
529
|
+
format: D,
|
|
530
|
+
component: n,
|
|
531
|
+
componentVersion: r,
|
|
532
|
+
stateVersion: i,
|
|
533
|
+
key: a,
|
|
534
|
+
...o === void 0 ? {} : { documentId: o },
|
|
535
|
+
data: s,
|
|
536
|
+
...c === void 0 ? {} : { random: c }
|
|
537
|
+
};
|
|
538
|
+
return V.encode(JSON.stringify(l)).length > 16384 ? {
|
|
539
|
+
ok: !1,
|
|
540
|
+
diagnostics: [H("local.runtime.state.size", `Component state exceeds the ${k}-byte limit.`)]
|
|
541
|
+
} : {
|
|
542
|
+
ok: !0,
|
|
543
|
+
record: Object.freeze(l)
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
function Z(e) {
|
|
547
|
+
let t = e;
|
|
548
|
+
if (typeof e == "string") {
|
|
549
|
+
if (e.length > 1048576) return {
|
|
550
|
+
ok: !1,
|
|
551
|
+
diagnostics: [H("local.runtime.state.size", "The component state payload is too large.")]
|
|
552
|
+
};
|
|
553
|
+
try {
|
|
554
|
+
t = JSON.parse(e);
|
|
555
|
+
} catch {
|
|
556
|
+
return {
|
|
557
|
+
ok: !1,
|
|
558
|
+
diagnostics: [H("local.runtime.state.json", "The component state payload is not valid JSON.")]
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
if (!U(t)) return {
|
|
563
|
+
ok: !1,
|
|
564
|
+
diagnostics: [H("local.runtime.state.shape", "The component state document must be a plain object.")]
|
|
565
|
+
};
|
|
566
|
+
if (t.format !== "reactive-md-component-state-document/v1") return {
|
|
567
|
+
ok: !1,
|
|
568
|
+
diagnostics: [H("local.runtime.state.document-format", `Unsupported component state document format; expected "${O}".`)]
|
|
569
|
+
};
|
|
570
|
+
let n = t.configKey;
|
|
571
|
+
if (n !== void 0 && !G(n)) return {
|
|
572
|
+
ok: !1,
|
|
573
|
+
diagnostics: [H("local.runtime.state.config-key", "The component state configKey must be a non-empty bounded string.")]
|
|
574
|
+
};
|
|
575
|
+
if (!U(t.records)) return {
|
|
576
|
+
ok: !1,
|
|
577
|
+
diagnostics: [H("local.runtime.state.records", "Component state records must be a plain object.")]
|
|
578
|
+
};
|
|
579
|
+
let r = {}, i = [], a = [], o = 0;
|
|
580
|
+
for (let e of Object.keys(t.records)) {
|
|
581
|
+
let n = X(t.records[e]);
|
|
582
|
+
n.ok ? n.record.key === e ? (o += V.encode(JSON.stringify(n.record)).length, o > 262144 ? (a.push(e), i.push(H("local.runtime.state.total-size", `Component state exceeds the ${A}-byte document limit.`))) : r[e] = n.record) : (a.push(e), i.push(H("local.runtime.state.key-mismatch", `Component state record "${e}" declares a different key "${n.record.key}".`))) : (a.push(e), i.push(...n.diagnostics));
|
|
583
|
+
}
|
|
584
|
+
return {
|
|
585
|
+
ok: !0,
|
|
586
|
+
...n === void 0 ? {} : { configKey: n },
|
|
587
|
+
records: r,
|
|
588
|
+
diagnostics: i,
|
|
589
|
+
skipped: a
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function Q(e) {
|
|
593
|
+
let t = Z(e);
|
|
594
|
+
if (!t.ok) return t;
|
|
595
|
+
let n = {};
|
|
596
|
+
for (let [e, r] of Object.entries(t.records)) n[e] = r;
|
|
597
|
+
return {
|
|
598
|
+
ok: !0,
|
|
599
|
+
document: Object.freeze({
|
|
600
|
+
format: O,
|
|
601
|
+
...t.configKey === void 0 ? {} : { configKey: t.configKey },
|
|
602
|
+
records: Object.freeze(n)
|
|
603
|
+
}),
|
|
604
|
+
records: Object.freeze(n),
|
|
605
|
+
diagnostics: t.diagnostics,
|
|
606
|
+
skipped: t.skipped
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
function $(t) {
|
|
610
|
+
let n = e(t), i = t.sourceDigest, a = t.knownKeys, o = t.configKey;
|
|
611
|
+
if (o !== void 0 && !G(o)) throw TypeError("configKey must be a non-empty bounded string.");
|
|
612
|
+
let s = Object.freeze((t.legacyConfigKeys ?? []).filter(G)), c = t.writeDelayMs ?? 0;
|
|
613
|
+
if (typeof c != "number" || !Number.isFinite(c) || c < 0) throw TypeError("writeDelayMs must be a non-negative finite number.");
|
|
614
|
+
let l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = [], m = t.storage, h = null, g = null, _ = !1, v = () => {
|
|
615
|
+
for (let e of f) e();
|
|
616
|
+
};
|
|
617
|
+
function y() {
|
|
618
|
+
if (m === void 0) return !0;
|
|
619
|
+
try {
|
|
620
|
+
let e = w.snapshot();
|
|
621
|
+
return Object.keys(e.records).length === 0 ? m.remove() : m.write(e), h = null, !0;
|
|
622
|
+
} catch (e) {
|
|
623
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
624
|
+
return t !== h && (h = t, p.push(H("local.runtime.state.storage", `The component state could not be persisted: ${t}`, "warning"))), !1;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
let b = () => {
|
|
628
|
+
g !== null && (clearTimeout(g), g = null);
|
|
629
|
+
};
|
|
630
|
+
function x() {
|
|
631
|
+
_ && (b(), y() && (_ = !1));
|
|
632
|
+
}
|
|
633
|
+
let S = () => {
|
|
634
|
+
m !== void 0 && (c <= 0 ? y() : (_ = !0, g === null && (g = setTimeout(() => {
|
|
635
|
+
g = null, x();
|
|
636
|
+
}, Math.min(c, 2147483647)))));
|
|
637
|
+
}, C = (e) => {
|
|
638
|
+
let t = 0;
|
|
639
|
+
for (let [n, r] of l) n !== e && (t += V.encode(JSON.stringify(r)).length);
|
|
640
|
+
return t;
|
|
641
|
+
}, w = {
|
|
642
|
+
documentId: n,
|
|
643
|
+
sourceDigest: i,
|
|
644
|
+
key(e) {
|
|
645
|
+
return r({
|
|
646
|
+
documentId: n,
|
|
647
|
+
sourceDigest: i,
|
|
648
|
+
nodeId: e.nodeId,
|
|
649
|
+
stateKey: e.stateKey
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
handle(e) {
|
|
653
|
+
let t = w.key({
|
|
654
|
+
nodeId: e.nodeId,
|
|
655
|
+
stateKey: e.stateKey
|
|
656
|
+
}), r = u.get(t), i = !1;
|
|
657
|
+
r !== void 0 && r !== e.nodeId ? (i = !0, d.has(t) || (d.add(t), p.push(H("local.runtime.state.duplicate-key", `Component state key "${t}" is used by more than one component instance.`)))) : u.set(t, e.nodeId);
|
|
658
|
+
let a = {
|
|
659
|
+
key: t,
|
|
660
|
+
component: e.component,
|
|
661
|
+
componentVersion: e.componentVersion,
|
|
662
|
+
duplicate: i,
|
|
663
|
+
load() {
|
|
664
|
+
if (i) return null;
|
|
665
|
+
let e = l.get(t);
|
|
666
|
+
return e === void 0 ? null : Y(e);
|
|
667
|
+
},
|
|
668
|
+
save(r, a) {
|
|
669
|
+
if (i) return {
|
|
670
|
+
ok: !1,
|
|
671
|
+
diagnostics: [H("local.runtime.state.duplicate-key", `Component state key "${t}" is used by more than one component instance.`)]
|
|
672
|
+
};
|
|
673
|
+
let o = a?.version ?? e.stateVersion ?? 0, s = X({
|
|
674
|
+
format: D,
|
|
675
|
+
component: e.component,
|
|
676
|
+
componentVersion: e.componentVersion,
|
|
677
|
+
stateVersion: o,
|
|
678
|
+
key: t,
|
|
679
|
+
documentId: n,
|
|
680
|
+
data: r,
|
|
681
|
+
...a?.random === void 0 ? {} : { random: a.random }
|
|
682
|
+
});
|
|
683
|
+
if (!s.ok) return {
|
|
684
|
+
ok: !1,
|
|
685
|
+
diagnostics: s.diagnostics
|
|
686
|
+
};
|
|
687
|
+
let c = V.encode(JSON.stringify(s.record)).length;
|
|
688
|
+
return C(t) + c > 262144 ? {
|
|
689
|
+
ok: !1,
|
|
690
|
+
diagnostics: [H("local.runtime.state.total-size", `Component state exceeds the ${A}-byte document limit.`)]
|
|
691
|
+
} : (l.set(t, s.record), S(), v(), {
|
|
692
|
+
ok: !0,
|
|
693
|
+
diagnostics: [],
|
|
694
|
+
record: Y(s.record)
|
|
695
|
+
});
|
|
696
|
+
},
|
|
697
|
+
clear() {
|
|
698
|
+
i || l.delete(t) && (S(), v());
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
return Object.freeze(a);
|
|
702
|
+
},
|
|
703
|
+
load(e) {
|
|
704
|
+
let t = l.get(e);
|
|
705
|
+
return t === void 0 ? null : Y(t);
|
|
706
|
+
},
|
|
707
|
+
clear(e) {
|
|
708
|
+
l.delete(e) && (S(), v());
|
|
709
|
+
},
|
|
710
|
+
snapshot() {
|
|
711
|
+
let e = {};
|
|
712
|
+
for (let [t, n] of l) e[t] = Y(n);
|
|
713
|
+
return Object.freeze({
|
|
714
|
+
format: O,
|
|
715
|
+
...o === void 0 ? {} : { configKey: o },
|
|
716
|
+
records: Object.freeze(e)
|
|
717
|
+
});
|
|
718
|
+
},
|
|
719
|
+
restore(e) {
|
|
720
|
+
let t = Z(e);
|
|
721
|
+
if (!t.ok) return p.push(...t.diagnostics), {
|
|
722
|
+
accepted: [],
|
|
723
|
+
skipped: [],
|
|
724
|
+
diagnostics: t.diagnostics
|
|
725
|
+
};
|
|
726
|
+
if (t.configKey !== void 0 && !K(t.configKey, o, s)) {
|
|
727
|
+
let e = [.../* @__PURE__ */ new Set([...t.skipped, ...Object.keys(t.records)])];
|
|
728
|
+
return t.diagnostics.push(H("local.runtime.state.config-mismatch", `Saved component state belongs to configuration "${t.configKey}", not "${o}".`, "warning")), p.push(...t.diagnostics), {
|
|
729
|
+
accepted: [],
|
|
730
|
+
skipped: e,
|
|
731
|
+
diagnostics: t.diagnostics
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
let r = [], i = typeof a == "function" ? a() : a;
|
|
735
|
+
for (let [e, a] of Object.entries(t.records)) a.documentId !== void 0 && a.documentId !== n ? (t.skipped.push(e), t.diagnostics.push(H("local.runtime.state.document-mismatch", `Saved state key "${e}" belongs to a different document.`))) : i !== void 0 && !i.has(e) ? (t.skipped.push(e), t.diagnostics.push(H("local.runtime.state.unknown-component", `Saved state key "${e}" does not match any component in this document.`))) : (l.set(e, a), r.push(e));
|
|
736
|
+
return t.diagnostics.length && p.push(...t.diagnostics), r.length && v(), {
|
|
737
|
+
accepted: r,
|
|
738
|
+
skipped: t.skipped,
|
|
739
|
+
diagnostics: t.diagnostics
|
|
740
|
+
};
|
|
741
|
+
},
|
|
742
|
+
flush() {
|
|
743
|
+
x();
|
|
744
|
+
},
|
|
745
|
+
diagnostics() {
|
|
746
|
+
return Object.freeze([...p]);
|
|
747
|
+
},
|
|
748
|
+
subscribe(e) {
|
|
749
|
+
return f.add(e), () => {
|
|
750
|
+
f.delete(e);
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
}, T = t.initial;
|
|
754
|
+
if (T === void 0 && m !== void 0) try {
|
|
755
|
+
let e = m.read();
|
|
756
|
+
e !== null && (T = e);
|
|
757
|
+
} catch (e) {
|
|
758
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
759
|
+
p.push(H("local.runtime.state.storage", `The component state could not be read: ${t}`, "warning"));
|
|
760
|
+
}
|
|
761
|
+
return T !== void 0 && w.restore(T), Object.freeze(w);
|
|
762
|
+
}
|
|
763
|
+
export { f as S, E as _, P as a, i as b, A as c, v as d, y as f, x as g, S as h, j as i, $ as l, T as m, D as n, M as o, b as p, k as r, N as s, O as t, Q as u, C as v, _ as x, w as y };
|