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
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as n
|
|
4
|
-
import { s as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { i as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { u as e } from "./document-theme-DBAfnk7y.js";
|
|
2
|
+
import { O as t } from "./preset-core-BW3NWZJ9.js";
|
|
3
|
+
import { i as n } from "./props-pJRrfDc6.js";
|
|
4
|
+
import { s as r } from "./default-config-DIrRpuQz.js";
|
|
5
|
+
import { r as i, t as a } from "./observability-core-Bcu7vpnl.js";
|
|
6
|
+
import { S as o } from "./component-state-CwKX_SN5.js";
|
|
7
|
+
import { i as s, n as c, o as l, s as u } from "./identity-BUx0Q_-d.js";
|
|
8
|
+
import { t as d } from "./runtime-BDnnimPA.js";
|
|
9
|
+
import { r as f } from "./requirements-DhIkxAbl.js";
|
|
10
|
+
import p, { Component as m, createElement as h, useCallback as g, useEffect as _, useLayoutEffect as v, useRef as y, useSyncExternalStore as b } from "react";
|
|
11
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
10
12
|
// src/react/component-api.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return e[
|
|
13
|
+
var w = Symbol("reactive-md.content-node");
|
|
14
|
+
function T(e) {
|
|
15
|
+
return e[w];
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
return Object.defineProperty(e,
|
|
17
|
+
function E(e, t) {
|
|
18
|
+
return Object.defineProperty(e, w, {
|
|
17
19
|
value: t,
|
|
18
20
|
enumerable: !1,
|
|
19
21
|
configurable: !1,
|
|
20
22
|
writable: !1
|
|
21
23
|
}), Object.freeze(e);
|
|
22
24
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
+
var D = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
26
|
+
function O(e) {
|
|
25
27
|
return e === null ? "" : typeof e == "string" ? e : typeof e == "number" ? Number.isFinite(e) ? String(e) : null : typeof e == "boolean" ? e ? "true" : "false" : null;
|
|
26
28
|
}
|
|
27
|
-
function
|
|
29
|
+
function k(e) {
|
|
28
30
|
if (!Number.isFinite(e)) return "—";
|
|
29
31
|
if (Object.is(e, -0)) return "0";
|
|
30
32
|
let t = Math.abs(e);
|
|
31
33
|
return t >= 0xe8d4a51000 || t > 0 && t < 1e-4 ? e.toExponential(3).replace(/(\.\d*?)0+e/, "$1e").replace(/\.e/, "e") : Number(e.toFixed(6)).toString();
|
|
32
34
|
}
|
|
33
|
-
function
|
|
35
|
+
function A(e) {
|
|
34
36
|
return Array.isArray(e) ? Object.freeze(e.slice()) : e === void 0 ? null : e;
|
|
35
37
|
}
|
|
36
|
-
function
|
|
38
|
+
function j(e) {
|
|
37
39
|
return Array.isArray(e) ? e.slice() : e;
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function ee(e, t, r, i, a) {
|
|
40
42
|
try {
|
|
41
43
|
return {
|
|
42
44
|
ok: !0,
|
|
43
|
-
value: n(e, t, r, i)
|
|
45
|
+
value: n(e, t, r, i, a)
|
|
44
46
|
};
|
|
45
47
|
} catch (e) {
|
|
46
48
|
return {
|
|
@@ -49,16 +51,16 @@ function O(e, t, r, i) {
|
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
54
|
-
|
|
54
|
+
var te = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
|
|
55
|
+
function ne(e) {
|
|
56
|
+
M.delete(ae(e));
|
|
55
57
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
58
|
-
let t =
|
|
59
|
-
return t || (t = Object.freeze({}),
|
|
58
|
+
var N = /* @__PURE__ */ new WeakMap(), re = 4096, ie = 512;
|
|
59
|
+
function ae(e) {
|
|
60
|
+
let t = F.get(e);
|
|
61
|
+
return t || (t = Object.freeze({}), F.set(e, t)), t;
|
|
60
62
|
}
|
|
61
|
-
function
|
|
63
|
+
function oe(e, t, n) {
|
|
62
64
|
let { environment: r, node: i } = e, a = r.positionOf?.(i.range.start) ?? {
|
|
63
65
|
line: 1,
|
|
64
66
|
column: 1
|
|
@@ -75,22 +77,22 @@ function ie(e, t, n) {
|
|
|
75
77
|
column: a.column
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function se(e, t, n) {
|
|
79
81
|
if (n.length === 0) return;
|
|
80
82
|
if (typeof window > "u") {
|
|
81
83
|
e.report(n);
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
|
-
let r =
|
|
86
|
+
let r = N.get(t);
|
|
85
87
|
r || (r = {
|
|
86
88
|
diagnostics: [],
|
|
87
89
|
scheduled: !1,
|
|
88
90
|
report: e.report
|
|
89
|
-
},
|
|
91
|
+
}, N.set(t, r));
|
|
90
92
|
let i = r;
|
|
91
93
|
i.report = e.report;
|
|
92
94
|
for (let e of n) {
|
|
93
|
-
if (i.diagnostics.length >=
|
|
95
|
+
if (i.diagnostics.length >= ie) break;
|
|
94
96
|
i.diagnostics.push(e);
|
|
95
97
|
}
|
|
96
98
|
if (i.scheduled) return;
|
|
@@ -102,16 +104,16 @@ function ae(e, t, n) {
|
|
|
102
104
|
};
|
|
103
105
|
typeof queueMicrotask == "function" ? queueMicrotask(a) : setTimeout(a, 0);
|
|
104
106
|
}
|
|
105
|
-
function
|
|
107
|
+
function ce(e, t, n, r) {
|
|
106
108
|
if (!e) return {};
|
|
107
|
-
let i = t ?? {}, a = {}, o = r?.environment.mode === "static" && typeof window > "u", s = r !== void 0, c = r ?
|
|
109
|
+
let i = t ?? {}, a = {}, o = r?.environment.mode === "static" && typeof window > "u", s = r !== void 0, c = r ? ae(n) : null, l = null;
|
|
108
110
|
if (r && c && s) {
|
|
109
|
-
let e = o ?
|
|
110
|
-
l = e.get(c) ?? null, l ? l.size >
|
|
111
|
+
let e = o ? M : te;
|
|
112
|
+
l = e.get(c) ?? null, l ? l.size > re && l.clear() : (l = /* @__PURE__ */ new Map(), e.set(c, l));
|
|
111
113
|
}
|
|
112
114
|
let u = [];
|
|
113
115
|
for (let t of Object.keys(e.props)) {
|
|
114
|
-
let o = Object.hasOwn(i, t) && typeof i[t] == "string" ? i[t] : void 0, s =
|
|
116
|
+
let o = Object.hasOwn(i, t) && typeof i[t] == "string" ? i[t] : void 0, s = ee(e, t, o, n, r?.node.literalAttributes === !0);
|
|
115
117
|
if (s.ok) a[t] = s.value, r && l && l.delete(`${r.node.id}\u0000${t}`);
|
|
116
118
|
else if (a[t] = null, r) {
|
|
117
119
|
if (l) {
|
|
@@ -119,32 +121,32 @@ function oe(e, t, n, r) {
|
|
|
119
121
|
if (l.get(e) === n) continue;
|
|
120
122
|
l.set(e, n);
|
|
121
123
|
}
|
|
122
|
-
u.push(
|
|
124
|
+
u.push(oe(r, t, s.error));
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
return r && c &&
|
|
127
|
+
return r && c && se(r.environment, c, u), a;
|
|
126
128
|
}
|
|
127
|
-
function
|
|
129
|
+
function le(e) {
|
|
128
130
|
return e?.bindings ?? {};
|
|
129
131
|
}
|
|
130
|
-
function
|
|
132
|
+
function P(e, t, n, r) {
|
|
131
133
|
let i = r.get(e);
|
|
132
134
|
if (i) return i;
|
|
133
|
-
let a = e.type === "component" || e.type === "hostComponent", o = a ? t.definitionFor(e.name ?? "") : void 0, s = Object.freeze(a ?
|
|
135
|
+
let a = e.type === "component" || e.type === "hostComponent", o = a ? t.definitionFor(e.name ?? "") : void 0, s = Object.freeze(a ? ce(o, e.attrs, t.runtime, {
|
|
134
136
|
environment: t,
|
|
135
137
|
node: e
|
|
136
|
-
}) : {}), c = (e.children ?? []).map((e) =>
|
|
138
|
+
}) : {}), c = (e.children ?? []).map((e) => P(e, t, n, r)), l = null;
|
|
137
139
|
if (a) try {
|
|
138
|
-
l =
|
|
140
|
+
l = A(t.runtime.get(e));
|
|
139
141
|
} catch {
|
|
140
142
|
l = null;
|
|
141
143
|
}
|
|
142
144
|
else if (e.type === "interpolation") try {
|
|
143
|
-
l =
|
|
145
|
+
l = A(t.runtime.evaluate(e.value ?? ""));
|
|
144
146
|
} catch {
|
|
145
147
|
l = null;
|
|
146
148
|
}
|
|
147
|
-
let u =
|
|
149
|
+
let u = E({
|
|
148
150
|
id: e.id,
|
|
149
151
|
kind: a ? "component" : e.type,
|
|
150
152
|
name: a ? e.name ?? "" : "",
|
|
@@ -163,11 +165,11 @@ function M(e, t, n, r) {
|
|
|
163
165
|
}, e);
|
|
164
166
|
return r.set(e, u), u;
|
|
165
167
|
}
|
|
166
|
-
var
|
|
167
|
-
function
|
|
168
|
-
let r = t === "static", i =
|
|
169
|
-
i || (i = Object.freeze({}),
|
|
170
|
-
let a =
|
|
168
|
+
var F = /* @__PURE__ */ new WeakMap();
|
|
169
|
+
function ue(e, t, n) {
|
|
170
|
+
let r = t === "static", i = F.get(e);
|
|
171
|
+
i || (i = Object.freeze({}), F.set(e, i));
|
|
172
|
+
let a = T, o = (e) => (e.length > 0 && n(e), e), s = (e, t) => {
|
|
171
173
|
let n = {
|
|
172
174
|
start: e.range.start,
|
|
173
175
|
end: e.range.end
|
|
@@ -184,12 +186,12 @@ function ce(e, t, n) {
|
|
|
184
186
|
return Object.freeze({
|
|
185
187
|
identity: i,
|
|
186
188
|
get(t, n) {
|
|
187
|
-
return
|
|
189
|
+
return A(e.get(a(t), n === "value" ? void 0 : n));
|
|
188
190
|
},
|
|
189
191
|
set(t, n, i) {
|
|
190
192
|
if (r) return s(t, /* @__PURE__ */ Error("Runtime is read-only in static mode."));
|
|
191
193
|
try {
|
|
192
|
-
return o(e.set(a(t),
|
|
194
|
+
return o(e.set(a(t), j(n), i === "value" ? void 0 : i));
|
|
193
195
|
} catch (e) {
|
|
194
196
|
return s(t, e);
|
|
195
197
|
}
|
|
@@ -198,7 +200,7 @@ function ce(e, t, n) {
|
|
|
198
200
|
if (r) return s(t, /* @__PURE__ */ Error("Runtime is read-only in static mode."));
|
|
199
201
|
try {
|
|
200
202
|
let r = {};
|
|
201
|
-
for (let [e, t] of Object.entries(n)) r[e] =
|
|
203
|
+
for (let [e, t] of Object.entries(n)) r[e] = j(t);
|
|
202
204
|
return o(e.setMany(a(t), r));
|
|
203
205
|
} catch (e) {
|
|
204
206
|
return s(t, e);
|
|
@@ -217,12 +219,12 @@ function ce(e, t, n) {
|
|
|
217
219
|
}
|
|
218
220
|
},
|
|
219
221
|
evaluate(t) {
|
|
220
|
-
return
|
|
222
|
+
return A(e.evaluate(t));
|
|
221
223
|
},
|
|
222
224
|
snapshot() {
|
|
223
225
|
try {
|
|
224
226
|
let t = e.snapshot(), n = {};
|
|
225
|
-
for (let [e, r] of Object.entries(t.state)) n[e] =
|
|
227
|
+
for (let [e, r] of Object.entries(t.state)) n[e] = A(r);
|
|
226
228
|
return {
|
|
227
229
|
revision: t.revision,
|
|
228
230
|
state: Object.freeze(n)
|
|
@@ -266,7 +268,7 @@ function ce(e, t, n) {
|
|
|
266
268
|
}
|
|
267
269
|
});
|
|
268
270
|
}
|
|
269
|
-
function
|
|
271
|
+
function de(e, t, n, r) {
|
|
270
272
|
return Object.freeze({
|
|
271
273
|
get: () => {
|
|
272
274
|
try {
|
|
@@ -288,11 +290,11 @@ function le(e, t, n, r) {
|
|
|
288
290
|
}
|
|
289
291
|
});
|
|
290
292
|
}
|
|
291
|
-
function
|
|
293
|
+
function fe(e, t) {
|
|
292
294
|
let n = [], r = e.children, i = t.definitionFor(e.name), a = i?.rules?.find((e) => e.kind === "options-body"), o = a?.kind === "options-body" ? a.child : i?.structure?.child ?? "option", s = a?.kind === "options-body" ? a.valueAttribute : i?.structure?.valueAttribute ?? "value", c = 0;
|
|
293
295
|
for (let i of r) {
|
|
294
296
|
if (i.kind !== "component" || i.name !== o) continue;
|
|
295
|
-
let r =
|
|
297
|
+
let r = T(i), a = i.attrs[s] ?? `option-${c + 1}`;
|
|
296
298
|
c += 1;
|
|
297
299
|
let l = t.renderToText(r.children) || i.attrs[s] || "";
|
|
298
300
|
n.push(Object.freeze({
|
|
@@ -304,12 +306,12 @@ function ue(e, t) {
|
|
|
304
306
|
}
|
|
305
307
|
return n;
|
|
306
308
|
}
|
|
307
|
-
function
|
|
309
|
+
function I(e, t) {
|
|
308
310
|
let n = e.children ?? [], r = n.filter((e) => !(e.type === "text" && !(e.value ?? "").trim())), i, a = "empty", o = "", s = null, c = null;
|
|
309
311
|
if (r.length === 1 && r[0].type === "interpolation") try {
|
|
310
312
|
i = t.runtime.evaluate(r[0].value ?? "");
|
|
311
|
-
let e =
|
|
312
|
-
i === null ? (a = "null", o = "") : typeof i == "string" ? (a = "string", o = i) : typeof i == "number" ? Number.isFinite(i) ? (a = "number", o =
|
|
313
|
+
let e = O(i);
|
|
314
|
+
i === null ? (a = "null", o = "") : typeof i == "string" ? (a = "string", o = i) : typeof i == "number" ? Number.isFinite(i) ? (a = "number", o = k(i), s = i) : (a = "error", o = t.locale === "zh" ? "无法计算" : "Cannot compute", c = t.locale === "zh" ? "结果不是有限数字" : "Result is not a finite number") : typeof i == "boolean" ? (a = "boolean", o = i ? "true" : "false") : (a = "array", o = e ?? "", c = t.locale === "zh" ? "数组需要先用 len 等函数转换" : "Arrays must first be converted with a function such as len");
|
|
313
315
|
} catch (e) {
|
|
314
316
|
a = "error", o = t.locale === "zh" ? "无法计算" : "Cannot compute", c = e instanceof Error ? e.message : String(e);
|
|
315
317
|
}
|
|
@@ -317,7 +319,7 @@ function P(e, t) {
|
|
|
317
319
|
let e = "", l = null, u = (n) => {
|
|
318
320
|
for (let r of n ?? []) if (r.type === "text" || r.type === "inlineCode" || r.type === "code") e += r.value ?? "";
|
|
319
321
|
else if (r.type === "interpolation") try {
|
|
320
|
-
let n =
|
|
322
|
+
let n = O(t.runtime.evaluate(r.value ?? ""));
|
|
321
323
|
n === null ? l ??= t.locale === "zh" ? "数组需要先用 len 等函数转换" : "Arrays must first be converted with a function such as len" : e += n;
|
|
322
324
|
} catch (n) {
|
|
323
325
|
l ??= n instanceof Error ? n.message : String(n), e += t.locale === "zh" ? "无法计算" : "Cannot compute";
|
|
@@ -326,7 +328,7 @@ function P(e, t) {
|
|
|
326
328
|
};
|
|
327
329
|
u(n);
|
|
328
330
|
let d = r.length > 0 && r.every((e) => e.type === "text"), f = e.trim();
|
|
329
|
-
if (d &&
|
|
331
|
+
if (d && D.test(f)) {
|
|
330
332
|
let t = Number(f);
|
|
331
333
|
Number.isFinite(t) && (a = "number", o = e, s = t, i = t);
|
|
332
334
|
}
|
|
@@ -341,82 +343,82 @@ function P(e, t) {
|
|
|
341
343
|
render: () => t.renderInline(n, !0)
|
|
342
344
|
});
|
|
343
345
|
}
|
|
344
|
-
function
|
|
346
|
+
function pe(e, t) {
|
|
345
347
|
let n = e.children.find((e) => e.kind === "table");
|
|
346
348
|
if (!n) return null;
|
|
347
|
-
let r = (
|
|
349
|
+
let r = (T(n).children ?? []).filter((e) => e.type === "tableRow");
|
|
348
350
|
if (r.length === 0) return null;
|
|
349
|
-
let i = (r[0].children ?? []).map((e) =>
|
|
351
|
+
let i = (r[0].children ?? []).map((e) => I(e, t));
|
|
350
352
|
return Object.freeze({
|
|
351
353
|
header: Object.freeze(i),
|
|
352
354
|
headerText: Object.freeze(i.map((e) => e.error ? t.locale === "zh" ? "无法计算" : "Cannot compute" : e.text)),
|
|
353
355
|
rows: Object.freeze(r.slice(1).map((e, n) => Object.freeze({
|
|
354
356
|
index: n,
|
|
355
|
-
cells: Object.freeze((e.children ?? []).map((e) =>
|
|
357
|
+
cells: Object.freeze((e.children ?? []).map((e) => I(e, t)))
|
|
356
358
|
})))
|
|
357
359
|
});
|
|
358
360
|
}
|
|
359
|
-
function
|
|
361
|
+
function me(e, t) {
|
|
360
362
|
let n = e["state-key"];
|
|
361
|
-
return
|
|
363
|
+
return l(typeof n == "string" ? n : t["state-key"]);
|
|
362
364
|
}
|
|
363
|
-
function
|
|
365
|
+
function he(e) {
|
|
364
366
|
try {
|
|
365
367
|
return e.document.source;
|
|
366
368
|
} catch {
|
|
367
369
|
return "";
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
|
-
var
|
|
371
|
-
function
|
|
372
|
+
var L = /* @__PURE__ */ new WeakMap();
|
|
373
|
+
function ge(e) {
|
|
372
374
|
if (e.services !== void 0) return e.services;
|
|
373
|
-
let t =
|
|
374
|
-
return t === void 0 && (t =
|
|
375
|
+
let t = L.get(e);
|
|
376
|
+
return t === void 0 && (t = d({ sourceDigest: s(he(e)) }), L.set(e, t)), t;
|
|
375
377
|
}
|
|
376
|
-
function
|
|
377
|
-
let n = t.definitionFor(e.name ?? ""), r = /* @__PURE__ */ new Map(), i =
|
|
378
|
+
function _e(e, t) {
|
|
379
|
+
let n = t.definitionFor(e.name ?? ""), r = /* @__PURE__ */ new Map(), i = P(e, t, t.visible, r), a = ue(t.runtime, t.mode, t.report), s = t.services ?? ge(t.runtime), l = n?.id ?? e.name ?? e.type, d = me(i.props, i.attrs), f = null, p = () => (f === null && (f = s.state.handle({
|
|
378
380
|
nodeId: e.id,
|
|
379
|
-
component:
|
|
381
|
+
component: l,
|
|
380
382
|
componentVersion: n?.version ?? "0.0.0",
|
|
381
383
|
stateKey: d,
|
|
382
384
|
stateVersion: 0
|
|
383
|
-
})), f), m = typeof i.props.seed == "number" && Number.isFinite(i.props.seed) ? i.props.seed : void 0, h =
|
|
385
|
+
})), f), m = typeof i.props.seed == "number" && Number.isFinite(i.props.seed) ? i.props.seed : void 0, h = u({
|
|
384
386
|
explicitSeed: m,
|
|
385
387
|
documentSeed: s.randomSeed,
|
|
386
|
-
componentId:
|
|
388
|
+
componentId: l,
|
|
387
389
|
nodeId: e.id,
|
|
388
390
|
stateKey: d
|
|
389
391
|
}), g = Object.freeze({
|
|
390
|
-
network: t.mode === "static" ?
|
|
392
|
+
network: t.mode === "static" ? o : t.network ?? t.runtime.network ?? o,
|
|
391
393
|
random: Object.freeze({
|
|
392
394
|
seed: h,
|
|
393
|
-
derive: (e) =>
|
|
395
|
+
derive: (e) => c(h, e)
|
|
394
396
|
}),
|
|
395
397
|
clock: s.clock,
|
|
396
398
|
scheduler: s.scheduler,
|
|
397
399
|
get state() {
|
|
398
400
|
return p();
|
|
399
401
|
}
|
|
400
|
-
}), _ = t.mode === "static", v =
|
|
401
|
-
for (let e of Object.keys(v)) y[e] =
|
|
402
|
+
}), _ = t.mode === "static", v = le(n), y = {};
|
|
403
|
+
for (let e of Object.keys(v)) y[e] = de(a, i, e, _);
|
|
402
404
|
let b = y.value ?? Object.freeze({
|
|
403
405
|
get: () => null,
|
|
404
406
|
set: () => ({
|
|
405
407
|
ok: !1,
|
|
406
408
|
diagnostics: []
|
|
407
409
|
})
|
|
408
|
-
}),
|
|
410
|
+
}), x = Object.freeze({
|
|
409
411
|
render: () => t.renderChildren(e.children, t.visible),
|
|
410
412
|
inline: () => t.renderInline(e.children, t.visible),
|
|
411
413
|
text: () => t.renderToText(e.children),
|
|
412
414
|
items: () => i.children,
|
|
413
|
-
renderItems: (e, n) => t.renderChildren(e.map((e) =>
|
|
414
|
-
renderInlineItems: (e, n) => t.renderInline(e.map((e) =>
|
|
415
|
-
textOf: (e) => t.renderToText(e.map((e) =>
|
|
416
|
-
options: () =>
|
|
417
|
-
table: () =>
|
|
415
|
+
renderItems: (e, n) => t.renderChildren(e.map((e) => T(e)), n ?? t.visible),
|
|
416
|
+
renderInlineItems: (e, n) => t.renderInline(e.map((e) => T(e)), n ?? t.visible),
|
|
417
|
+
textOf: (e) => t.renderToText(e.map((e) => T(e))),
|
|
418
|
+
options: () => fe(i, t),
|
|
419
|
+
table: () => pe(i, t),
|
|
418
420
|
math: () => i.children.filter((e) => e.kind === "math" || e.kind === "inlineMath")
|
|
419
|
-
}),
|
|
421
|
+
}), S = Object.freeze({
|
|
420
422
|
value: b,
|
|
421
423
|
slots: Object.freeze(y),
|
|
422
424
|
isReadOnly: _,
|
|
@@ -449,10 +451,10 @@ function L(e, t) {
|
|
|
449
451
|
diagnostics: t
|
|
450
452
|
};
|
|
451
453
|
}
|
|
454
|
+
}), C = Object.freeze({
|
|
455
|
+
fieldFor: (e) => t.validationFieldFor(T(e)),
|
|
456
|
+
hintFor: (e) => t.validationHintFor(T(e))
|
|
452
457
|
}), w = Object.freeze({
|
|
453
|
-
fieldFor: (e) => t.validationFieldFor(x(e)),
|
|
454
|
-
hintFor: (e) => t.validationHintFor(x(e))
|
|
455
|
-
}), E = Object.freeze({
|
|
456
458
|
targetId: (e) => t.targetId(e),
|
|
457
459
|
anchorId: () => t.anchorId(e),
|
|
458
460
|
allowed: (e) => t.jumpAllowed(e),
|
|
@@ -460,7 +462,7 @@ function L(e, t) {
|
|
|
460
462
|
let n = t.targetId(e);
|
|
461
463
|
return n === void 0 ? "missing" : t.jumpTo(n);
|
|
462
464
|
}
|
|
463
|
-
}),
|
|
465
|
+
}), E = Object.freeze({
|
|
464
466
|
resolve(e, n) {
|
|
465
467
|
if (!e) return null;
|
|
466
468
|
let r = e.trim();
|
|
@@ -478,7 +480,7 @@ function L(e, t) {
|
|
|
478
480
|
}
|
|
479
481
|
},
|
|
480
482
|
image(e) {
|
|
481
|
-
let n =
|
|
483
|
+
let n = E.resolve(e, "image");
|
|
482
484
|
if (!n) return null;
|
|
483
485
|
if (!t.imageResolver) return n;
|
|
484
486
|
try {
|
|
@@ -488,10 +490,10 @@ function L(e, t) {
|
|
|
488
490
|
return null;
|
|
489
491
|
}
|
|
490
492
|
}
|
|
491
|
-
}),
|
|
493
|
+
}), D = Object.freeze({
|
|
492
494
|
locale: t.locale,
|
|
493
495
|
t: (e, n) => t.locale === "zh" ? n : e,
|
|
494
|
-
formatNumber:
|
|
496
|
+
formatNumber: k
|
|
495
497
|
});
|
|
496
498
|
return Object.freeze({
|
|
497
499
|
props: i.props,
|
|
@@ -500,8 +502,8 @@ function L(e, t) {
|
|
|
500
502
|
dispatchAuthorAction: t.dispatchAuthorAction,
|
|
501
503
|
content: i,
|
|
502
504
|
services: g,
|
|
503
|
-
bindings:
|
|
504
|
-
children:
|
|
505
|
+
bindings: S,
|
|
506
|
+
children: x,
|
|
505
507
|
runtime: a,
|
|
506
508
|
instance: Object.freeze({
|
|
507
509
|
id: e.id,
|
|
@@ -516,26 +518,26 @@ function L(e, t) {
|
|
|
516
518
|
disabled: t.disabled,
|
|
517
519
|
disabledInvalid: t.disabledInvalid,
|
|
518
520
|
resetToken: t.resetToken,
|
|
519
|
-
validation:
|
|
520
|
-
source: Object.freeze({ attributes: (n) => t.sourceAttributes(n ?
|
|
521
|
-
navigation:
|
|
522
|
-
url:
|
|
523
|
-
locale:
|
|
521
|
+
validation: C,
|
|
522
|
+
source: Object.freeze({ attributes: (n) => t.sourceAttributes(n ? T(n) : e, e.name) }),
|
|
523
|
+
navigation: w,
|
|
524
|
+
url: E,
|
|
525
|
+
locale: D,
|
|
524
526
|
report: t.report
|
|
525
527
|
});
|
|
526
528
|
}
|
|
527
|
-
var
|
|
529
|
+
var ve = [
|
|
528
530
|
"interactive",
|
|
529
531
|
"static",
|
|
530
532
|
"ssr",
|
|
531
533
|
"offline"
|
|
532
534
|
];
|
|
533
|
-
function
|
|
535
|
+
function ye(e) {
|
|
534
536
|
let t = e.capabilities;
|
|
535
537
|
if (t === void 0) return;
|
|
536
538
|
if (typeof t != "object" || !t || Array.isArray(t)) throw TypeError("Component capabilities must be an object.");
|
|
537
539
|
let n = {};
|
|
538
|
-
for (let e of
|
|
540
|
+
for (let e of ve) {
|
|
539
541
|
let r = t[e];
|
|
540
542
|
if (r !== void 0) {
|
|
541
543
|
if (typeof r != "boolean") throw TypeError(`Component capability "${e}" must be a boolean.`);
|
|
@@ -544,7 +546,7 @@ function z(e) {
|
|
|
544
546
|
}
|
|
545
547
|
return n;
|
|
546
548
|
}
|
|
547
|
-
function
|
|
549
|
+
function be(e, t, n) {
|
|
548
550
|
if (t) {
|
|
549
551
|
if (typeof n.render != "function") throw TypeError("defineReactComponent requires a render function.");
|
|
550
552
|
if (n.renderStatic !== void 0 && typeof n.renderStatic != "function") throw TypeError("defineReactComponent renderStatic must be a function.");
|
|
@@ -553,17 +555,17 @@ function B(e, t, n) {
|
|
|
553
555
|
if (t.interactive === !1 && t.offline === !0 && t.static !== !0) throw TypeError(`Component "${e.id ?? ""}" declares offline output without any renderable implementation.`);
|
|
554
556
|
}
|
|
555
557
|
}
|
|
556
|
-
function
|
|
558
|
+
function xe(e) {
|
|
557
559
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("defineReactComponent requires a component definition object.");
|
|
558
560
|
return e;
|
|
559
561
|
}
|
|
560
|
-
function
|
|
561
|
-
let r =
|
|
562
|
+
function R(e, n) {
|
|
563
|
+
let r = xe(e);
|
|
562
564
|
if (!n || typeof n != "object") throw TypeError("defineReactComponent requires an implementation object.");
|
|
563
|
-
|
|
565
|
+
be(r, ye(r), n);
|
|
564
566
|
let i;
|
|
565
567
|
try {
|
|
566
|
-
i =
|
|
568
|
+
i = t(r);
|
|
567
569
|
} catch (e) {
|
|
568
570
|
throw TypeError(`Cannot bind a React implementation to component "${r.id}": ${e instanceof Error ? e.message : String(e)}`);
|
|
569
571
|
}
|
|
@@ -574,346 +576,249 @@ function he(t, n) {
|
|
|
574
576
|
...n.renderStatic === void 0 ? {} : { renderStatic: n.renderStatic }
|
|
575
577
|
});
|
|
576
578
|
}
|
|
577
|
-
// src/react/component-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
navigation: e.navigation,
|
|
596
|
-
url: e.url,
|
|
597
|
-
report: e.report,
|
|
598
|
-
render: (t, n) => e.children.renderItems(t ?? e.children.items(), n),
|
|
599
|
-
renderInline: (t, n) => e.children.renderInlineItems(t ?? e.children.items(), n)
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
function _e(e) {
|
|
603
|
-
let [n, r] = _(null), { locale: i, report: a, bindings: o } = e, s = m((e) => e.map((e) => t(e, i.locale)).join("; "), [i.locale]);
|
|
604
|
-
return {
|
|
605
|
-
write: m((e, t = "value") => {
|
|
606
|
-
let n = o.set(t, e);
|
|
607
|
-
return n.ok ? (r(null), !0) : (n.diagnostics.length > 0 ? (r(s(n.diagnostics)), a(n.diagnostics)) : r(i.t("Cannot write this value", "无法写入此值")), !1);
|
|
608
|
-
}, [
|
|
609
|
-
o,
|
|
610
|
-
i,
|
|
611
|
-
s,
|
|
612
|
-
a
|
|
613
|
-
]),
|
|
614
|
-
writeMany: m((e) => {
|
|
615
|
-
let t = o.setMany(e);
|
|
616
|
-
return t.ok ? (r(null), !0) : (t.diagnostics.length > 0 ? (r(s(t.diagnostics)), a(t.diagnostics)) : r(i.t("Cannot write this value", "无法写入此值")), !1);
|
|
617
|
-
}, [
|
|
618
|
-
o,
|
|
619
|
-
i,
|
|
620
|
-
s,
|
|
621
|
-
a
|
|
622
|
-
]),
|
|
623
|
-
error: n,
|
|
624
|
-
setError: r
|
|
625
|
-
};
|
|
626
|
-
}
|
|
627
|
-
function ve(e) {
|
|
628
|
-
return {
|
|
629
|
-
disabled: e.disabled,
|
|
630
|
-
invalid: e.disabledInvalid
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
function ye(e, t) {
|
|
634
|
-
return e.validation.fieldFor(t ?? e.content);
|
|
635
|
-
}
|
|
636
|
-
function be(e, t) {
|
|
637
|
-
return e.validation.hintFor(t ?? e.content);
|
|
638
|
-
}
|
|
639
|
-
function xe(e, t) {
|
|
640
|
-
return e.source.attributes(t);
|
|
641
|
-
}
|
|
642
|
-
function Se(e, t) {
|
|
643
|
-
let n = e.resetToken, r = g(n), i = g(t);
|
|
644
|
-
i.current = t, h(() => {
|
|
645
|
-
r.current !== n && (r.current = n, i.current());
|
|
646
|
-
}, [n]);
|
|
647
|
-
}
|
|
648
|
-
function Ce(e, t) {
|
|
649
|
-
return e.attrs[t];
|
|
650
|
-
}
|
|
651
|
-
function we(e, t, n = "") {
|
|
652
|
-
let r = e.props[t];
|
|
653
|
-
return typeof r == "string" ? r : typeof r == "number" ? Number.isFinite(r) ? String(r) : n : typeof r == "boolean" ? r ? "true" : "false" : e.content.attrs[t] === void 0 ? n : e.locale.t("Cannot compute", "无法计算");
|
|
654
|
-
}
|
|
655
|
-
function V(e, t, n) {
|
|
656
|
-
let r = e.props[t];
|
|
657
|
-
return typeof r == "number" && Number.isFinite(r) ? r : n;
|
|
658
|
-
}
|
|
659
|
-
function Te(e, t, n, r = "") {
|
|
660
|
-
let i = t.props[n];
|
|
661
|
-
return typeof i == "string" ? i : typeof i == "number" ? Number.isFinite(i) ? String(i) : r : typeof i == "boolean" ? i ? "true" : "false" : t.attrs[n] === void 0 ? r : e.locale.t("Cannot compute", "无法计算");
|
|
662
|
-
}
|
|
663
|
-
function Ee(e, t, n, r = !1) {
|
|
664
|
-
let i = t.props[n];
|
|
665
|
-
return typeof i == "boolean" ? i : r;
|
|
666
|
-
}
|
|
667
|
-
function De(e, t) {
|
|
668
|
-
if (e.content.attrs[t] === void 0) return {
|
|
669
|
-
present: !1,
|
|
670
|
-
error: !1
|
|
671
|
-
};
|
|
672
|
-
let n = e.props[t];
|
|
673
|
-
return typeof n == "number" && Number.isFinite(n) ? {
|
|
674
|
-
present: !0,
|
|
675
|
-
error: !1,
|
|
676
|
-
value: n
|
|
677
|
-
} : {
|
|
678
|
-
present: !0,
|
|
679
|
-
error: !0
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
function Oe(e, t) {
|
|
683
|
-
if (e.content.attrs[t] === void 0) return {
|
|
684
|
-
present: !1,
|
|
685
|
-
error: !1
|
|
686
|
-
};
|
|
687
|
-
let n = e.props[t];
|
|
688
|
-
return typeof n == "string" ? {
|
|
689
|
-
present: !0,
|
|
690
|
-
error: !1,
|
|
691
|
-
value: n
|
|
692
|
-
} : {
|
|
693
|
-
present: !0,
|
|
694
|
-
error: !0
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
function H(e, t, n) {
|
|
698
|
-
if (e.content.attrs[t] === void 0) return {
|
|
699
|
-
ok: !0,
|
|
700
|
-
value: n
|
|
701
|
-
};
|
|
702
|
-
let r = e.props[t];
|
|
703
|
-
return typeof r == "boolean" ? {
|
|
704
|
-
ok: !0,
|
|
705
|
-
value: r
|
|
706
|
-
} : { ok: !1 };
|
|
707
|
-
}
|
|
708
|
-
function ke(e, t, n = !1) {
|
|
709
|
-
let r = H(e, t, n);
|
|
710
|
-
return r.ok ? r.value : n;
|
|
711
|
-
}
|
|
712
|
-
function Ae(e, t, n, r) {
|
|
713
|
-
if (e.content.attrs[t] === void 0) return {
|
|
714
|
-
tone: r,
|
|
715
|
-
error: !1
|
|
716
|
-
};
|
|
717
|
-
let i = e.props[t];
|
|
718
|
-
return typeof i == "string" && n.includes(i) ? {
|
|
719
|
-
tone: i,
|
|
720
|
-
error: !1
|
|
721
|
-
} : {
|
|
722
|
-
tone: r,
|
|
723
|
-
error: /\{\{/.test(e.content.attrs[t] ?? "")
|
|
724
|
-
};
|
|
725
|
-
}
|
|
726
|
-
function je(e) {
|
|
727
|
-
let t = e.attrs.color;
|
|
728
|
-
if (t === void 0) return;
|
|
729
|
-
let n = t.trim();
|
|
730
|
-
return n !== "" && r(n) ? n : void 0;
|
|
731
|
-
}
|
|
732
|
-
function Me(e) {
|
|
733
|
-
if (e) return {
|
|
734
|
-
"--local-accent": e,
|
|
735
|
-
"--local-accent-soft": `color-mix(in srgb, ${e} 14%, var(--surface))`,
|
|
736
|
-
"--local-accent-strong": e
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
function U(e) {
|
|
740
|
-
return e === null ? "" : typeof e == "string" ? e : typeof e == "number" ? Number.isFinite(e) ? String(e) : null : typeof e == "boolean" ? e ? "true" : "false" : null;
|
|
741
|
-
}
|
|
742
|
-
function Ne(e) {
|
|
743
|
-
return U(e) ?? "";
|
|
744
|
-
}
|
|
745
|
-
function Pe(e) {
|
|
746
|
-
try {
|
|
747
|
-
return e.runtime.get(e.content);
|
|
748
|
-
} catch {
|
|
749
|
-
return null;
|
|
579
|
+
// src/react/component-loader.ts
|
|
580
|
+
var z = Object.freeze({ status: "loading" }), B = Object.freeze({ status: "failed" }), V = () => globalThis.performance?.now() ?? Date.now(), Se = (e) => Math.max(0, Math.round(V() - e));
|
|
581
|
+
function H(e, t) {
|
|
582
|
+
return JSON.stringify([
|
|
583
|
+
e.traceId ?? t,
|
|
584
|
+
e.documentId,
|
|
585
|
+
e.sourceRevision,
|
|
586
|
+
e.sourcePhase
|
|
587
|
+
]);
|
|
588
|
+
}
|
|
589
|
+
var U = class {
|
|
590
|
+
resolver;
|
|
591
|
+
identityFor;
|
|
592
|
+
validate;
|
|
593
|
+
entries = /* @__PURE__ */ new Map();
|
|
594
|
+
identities = /* @__PURE__ */ new WeakMap();
|
|
595
|
+
constructor(e, t, n) {
|
|
596
|
+
this.resolver = e, this.identityFor = t, this.validate = n;
|
|
750
597
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
let r = e.runtime.get(e.content, t);
|
|
755
|
-
return typeof r == "number" && Number.isFinite(r) ? r : n;
|
|
756
|
-
} catch {
|
|
757
|
-
return n;
|
|
598
|
+
identity(e) {
|
|
599
|
+
let t = this.identities.get(e);
|
|
600
|
+
return t || (t = this.identityFor(e), this.identities.set(e, t)), t;
|
|
758
601
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
return Math.min(n, Math.max(t, e));
|
|
762
|
-
}
|
|
763
|
-
function Le(e, t, n, r) {
|
|
764
|
-
let i = Number.isFinite(r) && r > 0 ? r : 1, a = Math.max(0, Math.floor((n - t) / i + 1e-9)), o = t + Math.max(0, Math.min(a, Math.round((e - t) / i))) * i;
|
|
765
|
-
return Number(o.toPrecision(15));
|
|
766
|
-
}
|
|
767
|
-
function Re(e, t, n, r, i, a = 1) {
|
|
768
|
-
let o = V(e, t, r), s = V(e, n, i);
|
|
769
|
-
o > s && ([o, s] = [s, o]);
|
|
770
|
-
let c = V(e, "step", a);
|
|
771
|
-
return {
|
|
772
|
-
min: o,
|
|
773
|
-
max: s,
|
|
774
|
-
step: Number.isFinite(c) && c > 0 ? c : 1
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
function ze(e) {
|
|
778
|
-
return e.trim() === "" ? "—" : e;
|
|
779
|
-
}
|
|
780
|
-
var W = (e) => e.startsWith("--") ? e : e.replace(/^ms-?/, "-ms").replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
781
|
-
function Be(e, t, n) {
|
|
782
|
-
let r = e.ownerDocument.createElement("span").style;
|
|
783
|
-
for (let [e, n] of Object.entries(t ?? {})) {
|
|
784
|
-
if (n == null) continue;
|
|
785
|
-
let t = W(e);
|
|
786
|
-
r.setProperty(t, String(n)), typeof n == "number" && !t.startsWith("--") && !r.getPropertyValue(t) && r.setProperty(t, `${n}px`);
|
|
602
|
+
snapshot(e) {
|
|
603
|
+
return this.entries.get(this.identity(e))?.state ?? z;
|
|
787
604
|
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
ref: void 0
|
|
605
|
+
serverSnapshot() {
|
|
606
|
+
return z;
|
|
607
|
+
}
|
|
608
|
+
subscribe(e, t, n) {
|
|
609
|
+
let r = this.identity(e), i = n?.observer?.onTrace ? n : void 0, a = this.entries.get(r);
|
|
610
|
+
a ? (a.subscribers.set(t, i), a.abort && i && this.observeWait(e, a, t, i), a.observation && (a.observation.peakSubscribers = Math.max(a.observation.peakSubscribers, a.subscribers.size))) : (a = {
|
|
611
|
+
state: z,
|
|
612
|
+
subscribers: /* @__PURE__ */ new Map([[t, i]])
|
|
613
|
+
}, this.entries.set(r, a), this.start(r, e, a));
|
|
614
|
+
let o = a;
|
|
615
|
+
return () => {
|
|
616
|
+
let e = o.observation, n = i?.observer;
|
|
617
|
+
if (e && n) {
|
|
618
|
+
let r = e.waits.get(n), a = H(i, e.id), s = r?.get(a);
|
|
619
|
+
r && s?.subscribers.delete(t) && !s.subscribers.size && queueMicrotask(() => {
|
|
620
|
+
o.observation !== e || s.subscribers.size || r.get(a) !== s || (r.delete(a), r.size || e.waits.delete(n), s.finish("cancelled"));
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
o.subscribers.delete(t), !(o.subscribers.size || o.state.status === "ready") && queueMicrotask(() => {
|
|
624
|
+
o.subscribers.size || o.state.status === "ready" || this.entries.get(r) !== o || (this.entries.delete(r), o.abort?.abort(), o.abort = void 0, this.finishObservation(o, "cancelled"));
|
|
625
|
+
});
|
|
810
626
|
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
627
|
+
}
|
|
628
|
+
retry(e, t) {
|
|
629
|
+
let n = this.identity(e), r = this.entries.get(n);
|
|
630
|
+
if (r?.state.status === "failed") {
|
|
631
|
+
this.start(n, e, r, t);
|
|
632
|
+
for (let e of r.subscribers.keys()) e();
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
observeWait(e, t, n, r) {
|
|
636
|
+
let o = r.observer, s = t.observation ??= {
|
|
637
|
+
id: a(),
|
|
638
|
+
peakSubscribers: t.subscribers.size,
|
|
639
|
+
waits: /* @__PURE__ */ new Map()
|
|
640
|
+
}, c = s.waits.get(o);
|
|
641
|
+
c || (c = /* @__PURE__ */ new Map(), s.waits.set(o, c));
|
|
642
|
+
let l = H(r, s.id), u = c.get(l);
|
|
643
|
+
if (!u) {
|
|
644
|
+
let { traceId: t = s.id, documentId: n, sourceRevision: a, sourcePhase: d } = r, f = V();
|
|
645
|
+
u = {
|
|
646
|
+
subscribers: /* @__PURE__ */ new Set(),
|
|
647
|
+
finish: (r) => i(o, {
|
|
648
|
+
type: "component-load-wait-end",
|
|
649
|
+
traceId: t,
|
|
650
|
+
documentId: n,
|
|
651
|
+
sourceRevision: a,
|
|
652
|
+
sourcePhase: d,
|
|
653
|
+
loadId: s.id,
|
|
654
|
+
timestamp: Date.now(),
|
|
655
|
+
status: r,
|
|
656
|
+
componentName: e.name,
|
|
657
|
+
componentVersion: e.version,
|
|
658
|
+
durationMs: Se(f)
|
|
659
|
+
})
|
|
660
|
+
}, c.set(l, u);
|
|
661
|
+
}
|
|
662
|
+
u.subscribers.add(n);
|
|
663
|
+
}
|
|
664
|
+
finishObservation(e, t) {
|
|
665
|
+
let n = e.observation;
|
|
666
|
+
if (e.observation = void 0, n?.finishRequest?.(t), n) for (let e of n.waits.values()) for (let n of e.values()) n.finish(n.subscribers.size ? t : "cancelled");
|
|
667
|
+
}
|
|
668
|
+
start(e, t, n, r) {
|
|
669
|
+
let a = new AbortController();
|
|
670
|
+
n.abort = a, n.state = z;
|
|
671
|
+
for (let [e, r] of n.subscribers) r && this.observeWait(t, n, e, r);
|
|
672
|
+
let o = (t) => {
|
|
673
|
+
if (this.entries.get(e) === n && n.abort === a) {
|
|
674
|
+
n.abort = void 0, n.state = t, this.finishObservation(n, t.status === "ready" ? "ok" : "failed");
|
|
675
|
+
for (let e of n.subscribers.keys()) e();
|
|
676
|
+
}
|
|
816
677
|
};
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
function Ge({ message: e }) {
|
|
862
|
-
return /* @__PURE__ */ v("span", {
|
|
863
|
-
className: "local-error",
|
|
864
|
-
role: "alert",
|
|
865
|
-
children: e ?? "Cannot compute"
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
function Ke({ message: e }) {
|
|
869
|
-
return /* @__PURE__ */ v("span", {
|
|
870
|
-
className: "local-error local-tone-error",
|
|
871
|
-
role: "status",
|
|
872
|
-
children: e
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
function qe(e, t) {
|
|
876
|
-
let n = Math.max(0, Math.floor(e)), r = Math.floor(n / 60), i = n % 60;
|
|
877
|
-
return r === 0 ? t(`${i} seconds`, `${i} 秒`) : `${r}:${String(i).padStart(2, "0")}`;
|
|
878
|
-
}
|
|
879
|
-
function Je(e) {
|
|
880
|
-
return T(e);
|
|
881
|
-
}
|
|
882
|
-
function G(e, t, n = 0) {
|
|
883
|
-
if (!t || n > 64) return "";
|
|
884
|
-
let r = "";
|
|
885
|
-
for (let i of t) switch (i.kind) {
|
|
886
|
-
case "text":
|
|
887
|
-
case "inlineCode":
|
|
888
|
-
case "fallback":
|
|
889
|
-
r += i.text;
|
|
890
|
-
break;
|
|
891
|
-
case "interpolation":
|
|
892
|
-
try {
|
|
893
|
-
let t = U(e.runtime.evaluate(i.text));
|
|
894
|
-
r += t ?? e.locale.t("Cannot compute", "无法计算");
|
|
895
|
-
} catch {
|
|
896
|
-
r += e.locale.t("Cannot compute", "无法计算");
|
|
678
|
+
Promise.resolve().then(() => {
|
|
679
|
+
if (a.signal.aborted || !n.subscribers.size) return null;
|
|
680
|
+
let e = n.observation;
|
|
681
|
+
if (e) {
|
|
682
|
+
let a = r?.observer?.onTrace ? r : void 0;
|
|
683
|
+
if (!a) {
|
|
684
|
+
for (let e of n.subscribers.values()) if (e?.observer?.onTrace) {
|
|
685
|
+
a = e;
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
if (a?.observer) {
|
|
690
|
+
let { observer: n, traceId: r = e.id, documentId: o, sourceRevision: s, sourcePhase: c } = a, l = {
|
|
691
|
+
traceId: r,
|
|
692
|
+
documentId: o,
|
|
693
|
+
sourceRevision: s,
|
|
694
|
+
sourcePhase: c,
|
|
695
|
+
loadId: e.id,
|
|
696
|
+
componentName: t.name,
|
|
697
|
+
componentVersion: t.version
|
|
698
|
+
}, u = V();
|
|
699
|
+
e.finishRequest = (t) => i(n, {
|
|
700
|
+
...l,
|
|
701
|
+
type: "component-load-end",
|
|
702
|
+
timestamp: Date.now(),
|
|
703
|
+
status: t,
|
|
704
|
+
subscribers: e.peakSubscribers,
|
|
705
|
+
durationMs: Se(u)
|
|
706
|
+
}), i(n, {
|
|
707
|
+
...l,
|
|
708
|
+
type: "component-load-start",
|
|
709
|
+
timestamp: Date.now()
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return this.resolver({
|
|
714
|
+
name: t.name,
|
|
715
|
+
definition: t,
|
|
716
|
+
signal: a.signal
|
|
717
|
+
});
|
|
718
|
+
}).then((e) => {
|
|
719
|
+
if (!e || a.signal.aborted) {
|
|
720
|
+
o(B);
|
|
721
|
+
return;
|
|
897
722
|
}
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
723
|
+
let n = this.validate(t, e);
|
|
724
|
+
o(n === null ? B : {
|
|
725
|
+
status: "ready",
|
|
726
|
+
component: n
|
|
727
|
+
});
|
|
728
|
+
}).catch(() => o(B));
|
|
903
729
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
730
|
+
}, Ce = class extends U {
|
|
731
|
+
resolveSync;
|
|
732
|
+
synchronous = /* @__PURE__ */ new WeakMap();
|
|
733
|
+
constructor(e, n) {
|
|
734
|
+
super(e, (e) => `${e.id}\0${e.version}\0${t(e)}`, W), this.resolveSync = n;
|
|
735
|
+
}
|
|
736
|
+
synchronousImplementation(e) {
|
|
737
|
+
if (!this.resolveSync) return null;
|
|
738
|
+
let t = this.synchronous.get(e);
|
|
739
|
+
if (t !== void 0) return t;
|
|
740
|
+
let n = null;
|
|
741
|
+
try {
|
|
742
|
+
let t = this.resolveSync({
|
|
743
|
+
name: e.name,
|
|
744
|
+
definition: e
|
|
745
|
+
});
|
|
746
|
+
t && (n = W(e, t));
|
|
747
|
+
} catch {}
|
|
748
|
+
return this.synchronous.set(e, n), n;
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
function W(e, n) {
|
|
752
|
+
let r = t(e);
|
|
753
|
+
return n.digest === r && t(n.definition) === r ? R(e, n) : null;
|
|
754
|
+
}
|
|
755
|
+
// src/react/render-lifecycle.tsx
|
|
756
|
+
var G = () => globalThis.performance?.now() ?? Date.now(), K = (e, t) => Math.max(0, Math.round(t - e));
|
|
757
|
+
function q({ trace: e, component: t }) {
|
|
758
|
+
let n = y(e);
|
|
759
|
+
n.current = e;
|
|
760
|
+
let r = e.observer?.onTrace ? G() : void 0, o = y(e.sourcePhase), s = y(void 0), c = y(void 0);
|
|
761
|
+
return v(() => {
|
|
762
|
+
if (e.observer?.onTrace) return () => {
|
|
763
|
+
c.current = G();
|
|
764
|
+
};
|
|
765
|
+
}, [e.observer, t]), _(() => {
|
|
766
|
+
let e = n.current;
|
|
767
|
+
if (!e.observer?.onTrace || r === void 0) return;
|
|
768
|
+
let o = e.traceId ?? a();
|
|
769
|
+
s.current = o;
|
|
770
|
+
let l = typeof p.captureOwnerStack == "function" ? "development" : "production", u = G(), d = {
|
|
771
|
+
traceId: o,
|
|
772
|
+
environment: l,
|
|
773
|
+
componentName: t?.name,
|
|
774
|
+
componentVersion: t?.version
|
|
775
|
+
};
|
|
776
|
+
return i(e.observer, {
|
|
777
|
+
...d,
|
|
778
|
+
type: "render-mount",
|
|
779
|
+
timestamp: Date.now(),
|
|
780
|
+
documentId: e.documentId,
|
|
781
|
+
sourceRevision: e.sourceRevision,
|
|
782
|
+
sourcePhase: e.sourcePhase,
|
|
783
|
+
durationMs: K(r, u)
|
|
784
|
+
}), () => {
|
|
785
|
+
let t = n.current, r = G(), a = K(u, r), s = c.current === void 0 ? void 0 : K(c.current, r);
|
|
786
|
+
c.current = void 0, i(e.observer, {
|
|
787
|
+
...d,
|
|
788
|
+
traceId: t.traceId ?? o,
|
|
789
|
+
type: "render-unmount",
|
|
790
|
+
timestamp: Date.now(),
|
|
791
|
+
mountedMs: a,
|
|
792
|
+
durationMs: a,
|
|
793
|
+
unmountMs: s,
|
|
794
|
+
documentId: t.documentId,
|
|
795
|
+
sourceRevision: t.sourceRevision,
|
|
796
|
+
sourcePhase: t.sourcePhase
|
|
797
|
+
});
|
|
798
|
+
};
|
|
799
|
+
}, [e.observer, t]), _(() => {
|
|
800
|
+
let n = o.current;
|
|
801
|
+
o.current = e.sourcePhase, n === "streaming" && e.sourcePhase === "final" && e.observer?.onTrace && i(e.observer, {
|
|
802
|
+
type: "render-retained",
|
|
803
|
+
traceId: e.traceId ?? s.current ?? a(),
|
|
804
|
+
timestamp: Date.now(),
|
|
805
|
+
environment: typeof p.captureOwnerStack == "function" ? "development" : "production",
|
|
806
|
+
documentId: e.documentId,
|
|
807
|
+
sourceRevision: e.sourceRevision,
|
|
808
|
+
sourcePhase: e.sourcePhase,
|
|
809
|
+
componentName: t?.name,
|
|
810
|
+
componentVersion: t?.version
|
|
811
|
+
});
|
|
812
|
+
}, [e, t]), null;
|
|
908
813
|
}
|
|
909
814
|
// src/react/sdk-core.tsx
|
|
910
|
-
function
|
|
815
|
+
function we(e) {
|
|
911
816
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("defineReactComponent requires a component definition object.");
|
|
912
817
|
return e;
|
|
913
818
|
}
|
|
914
|
-
var
|
|
915
|
-
function
|
|
916
|
-
let t =
|
|
819
|
+
var J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
|
|
820
|
+
function Te(e) {
|
|
821
|
+
let t = J.get(e);
|
|
917
822
|
if (t) return t;
|
|
918
823
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
919
824
|
for (let t of e.components) n.set(t.definition.name, t), r.set(t.definition.id, t);
|
|
@@ -921,9 +826,9 @@ function q(e) {
|
|
|
921
826
|
byName: n,
|
|
922
827
|
byId: r
|
|
923
828
|
});
|
|
924
|
-
return
|
|
829
|
+
return J.set(e, i), i;
|
|
925
830
|
}
|
|
926
|
-
function
|
|
831
|
+
function Ee(e) {
|
|
927
832
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("createReactConfig components must be LocalReactComponent values.");
|
|
928
833
|
let t = e;
|
|
929
834
|
if (!t.definition || typeof t.definition != "object") throw TypeError("A React component is missing its manifest definition.");
|
|
@@ -931,66 +836,74 @@ function Ze(e) {
|
|
|
931
836
|
if (t.renderStatic !== void 0 && typeof t.renderStatic != "function") throw TypeError("A React component renderStatic must be a function.");
|
|
932
837
|
return t;
|
|
933
838
|
}
|
|
934
|
-
function
|
|
935
|
-
let
|
|
936
|
-
if (!Array.isArray(
|
|
937
|
-
let
|
|
938
|
-
if (!Array.isArray(
|
|
939
|
-
let
|
|
940
|
-
let r =
|
|
839
|
+
function X(e, n, i, a) {
|
|
840
|
+
let o = r(e), s = n?.components;
|
|
841
|
+
if (!Array.isArray(s)) throw TypeError("createReactConfig requires a components array.");
|
|
842
|
+
let c = n?.presets ?? [];
|
|
843
|
+
if (!Array.isArray(c)) throw TypeError("createReactConfig presets must be an array.");
|
|
844
|
+
let l = [], u = [], d = /* @__PURE__ */ new Set(), f = (e, n) => {
|
|
845
|
+
let r = Ee(e), i = we(r.definition), a = t(i);
|
|
941
846
|
if (r.digest !== a) throw TypeError(`React component "${i.id}" from ${n} has a stale digest; create it with defineReactComponent.`);
|
|
942
|
-
return
|
|
847
|
+
return l.push(r), r;
|
|
943
848
|
};
|
|
944
|
-
for (let e of
|
|
945
|
-
let t =
|
|
946
|
-
|
|
849
|
+
for (let e of i) {
|
|
850
|
+
let t = f(e, "the default React preset");
|
|
851
|
+
d.add(t);
|
|
947
852
|
}
|
|
948
|
-
for (let e of
|
|
853
|
+
for (let e of c) {
|
|
949
854
|
if (!e || typeof e != "object" || !Array.isArray(e.components)) throw TypeError("createReactConfig preset must expose a components array.");
|
|
950
|
-
for (let t of e.components)
|
|
855
|
+
for (let t of e.components) u.push(f(t, `preset "${e.id ?? ""}"`));
|
|
951
856
|
}
|
|
952
|
-
for (let e of
|
|
953
|
-
let
|
|
954
|
-
for (let
|
|
955
|
-
let n = e
|
|
857
|
+
for (let e of s) u.push(f(e, "components"));
|
|
858
|
+
let p = [], m = [], h = /* @__PURE__ */ new Map();
|
|
859
|
+
for (let e of o.registry) {
|
|
860
|
+
let n = t(e), r = l.filter((t) => t.definition.id === e.id && t.definition.name === e.name && t.definition.version === e.version && t.digest === n);
|
|
956
861
|
if (r.length === 0) {
|
|
957
|
-
if (
|
|
958
|
-
|
|
862
|
+
if (l.some((t) => t.definition.id === e.id)) throw TypeError(`React component "${e.id}@${e.version}" does not match the installed manifest contract.`);
|
|
863
|
+
a ? h.set(e.name, e) : m.push(`${e.id}@${e.version}`);
|
|
959
864
|
} else {
|
|
960
|
-
if (r.length > 1) throw TypeError(`Component id "${
|
|
961
|
-
|
|
865
|
+
if (r.length > 1) throw TypeError(`Component id "${e.id}" has more than one matching React implementation.`);
|
|
866
|
+
p.push(r[0]);
|
|
962
867
|
}
|
|
963
868
|
}
|
|
964
|
-
if (
|
|
965
|
-
let e = new Set(
|
|
966
|
-
throw TypeError(`createReactConfig is missing implementations for: ${
|
|
869
|
+
if (m.length > 0) {
|
|
870
|
+
let e = new Set(o.registry.map((e) => e.id)), t = [...new Set(u.filter((t) => !e.has(t.definition.id)).map((e) => `${e.definition.id}@${e.definition.version}`))];
|
|
871
|
+
throw TypeError(`createReactConfig is missing implementations for: ${m.join(", ")}.` + (t.length === 0 ? "" : ` Supplied implementation(s) ${t.join(", ")} are not declared by this local config.`));
|
|
967
872
|
}
|
|
968
|
-
let
|
|
969
|
-
byName: new Map(
|
|
970
|
-
byId: new Map(
|
|
971
|
-
}),
|
|
972
|
-
config:
|
|
973
|
-
components: Object.freeze(
|
|
974
|
-
implementations: Object.freeze(
|
|
975
|
-
themes:
|
|
976
|
-
hostRenderer:
|
|
873
|
+
let g = new Map(p.map((e) => [e.definition.id, e])), _ = new Map(p.map((e) => [e.definition.name, e])), v = p.filter((e) => !d.has(e)), y = Object.freeze(o.themes.slice()), b = Object.freeze({
|
|
874
|
+
byName: new Map(_),
|
|
875
|
+
byId: new Map(g)
|
|
876
|
+
}), x = Object.freeze({
|
|
877
|
+
config: o,
|
|
878
|
+
components: Object.freeze(v),
|
|
879
|
+
implementations: Object.freeze(p),
|
|
880
|
+
themes: y,
|
|
881
|
+
hostRenderer: Le(b)
|
|
977
882
|
});
|
|
978
|
-
return
|
|
883
|
+
return J.set(x, b), a && Y.set(x, {
|
|
884
|
+
loader: new Ce(a.resolver, a.resolveSync),
|
|
885
|
+
definitions: h
|
|
886
|
+
}), x;
|
|
887
|
+
}
|
|
888
|
+
function De(e, t, n) {
|
|
889
|
+
if (typeof t?.resolver != "function") throw TypeError("A deferred React config requires a resolver.");
|
|
890
|
+
if (t.resolveSync !== void 0 && typeof t.resolveSync != "function") throw TypeError("resolveSync must be a function.");
|
|
891
|
+
return X(e, t, n, t);
|
|
979
892
|
}
|
|
980
|
-
var
|
|
893
|
+
var Z = class extends Error {
|
|
981
894
|
componentName;
|
|
982
895
|
constructor(e) {
|
|
983
896
|
super(`No React implementation is registered for <${e}>.`), this.name = "LocalReactExtensionMissingError", this.componentName = e;
|
|
984
897
|
}
|
|
985
898
|
};
|
|
986
|
-
function
|
|
899
|
+
function Oe(e) {
|
|
987
900
|
try {
|
|
988
901
|
return e.snapshot().revision;
|
|
989
902
|
} catch {
|
|
990
903
|
return 0;
|
|
991
904
|
}
|
|
992
905
|
}
|
|
993
|
-
function
|
|
906
|
+
function ke(e, t) {
|
|
994
907
|
if (typeof e != "string" || e.length === 0) return {
|
|
995
908
|
line: 1,
|
|
996
909
|
column: 1
|
|
@@ -1002,8 +915,8 @@ function et(e, t) {
|
|
|
1002
915
|
column: n - i + 1
|
|
1003
916
|
};
|
|
1004
917
|
}
|
|
1005
|
-
function
|
|
1006
|
-
let { line: a, column: o } =
|
|
918
|
+
function Ae(e, t, n, r, i) {
|
|
919
|
+
let { line: a, column: o } = ke(r, n.start);
|
|
1007
920
|
return {
|
|
1008
921
|
code: e,
|
|
1009
922
|
message: `Component <${t}> failed: ${i instanceof Error ? i.message : String(i)}`,
|
|
@@ -1016,21 +929,21 @@ function Y(e, t, n, r, i) {
|
|
|
1016
929
|
column: o
|
|
1017
930
|
};
|
|
1018
931
|
}
|
|
1019
|
-
var
|
|
932
|
+
var je = class extends m {
|
|
1020
933
|
state = { failed: !1 };
|
|
1021
934
|
static getDerivedStateFromError() {
|
|
1022
935
|
return { failed: !0 };
|
|
1023
936
|
}
|
|
1024
937
|
componentDidCatch(e) {
|
|
1025
938
|
try {
|
|
1026
|
-
this.props.report([
|
|
939
|
+
this.props.report([Ae("local.extension.render", this.props.name, this.props.range, this.props.source, e)]);
|
|
1027
940
|
} catch {}
|
|
1028
941
|
}
|
|
1029
942
|
componentDidUpdate(e) {
|
|
1030
943
|
this.state.failed && e.revision !== this.props.revision && this.setState({ failed: !1 });
|
|
1031
944
|
}
|
|
1032
945
|
render() {
|
|
1033
|
-
return this.state.failed ?
|
|
946
|
+
return this.state.failed ? h("span", {
|
|
1034
947
|
className: "local-host-component local-host-unavailable local-sdk-unavailable",
|
|
1035
948
|
"data-local-host-component": this.props.name,
|
|
1036
949
|
"data-local-host-reason": "error",
|
|
@@ -1043,10 +956,10 @@ var X = class extends f {
|
|
|
1043
956
|
}, `Component <${this.props.name}> is unavailable here.`) : this.props.children;
|
|
1044
957
|
}
|
|
1045
958
|
};
|
|
1046
|
-
function
|
|
959
|
+
function Me({ implementation: e, node: t, environment: n }) {
|
|
1047
960
|
let r = e.definition.id.startsWith("reactive-md/"), i = n.mode === "static" ? "static" : "interactive";
|
|
1048
961
|
if (!r && !e.definition.capabilities[i]) throw Error(`Component ${e.definition.id} does not support ${i} rendering.`);
|
|
1049
|
-
let a =
|
|
962
|
+
let a = _e(t, {
|
|
1050
963
|
runtime: n.runtime,
|
|
1051
964
|
authorStyle: n.authorStyle,
|
|
1052
965
|
authorStyleText: n.authorStyleText,
|
|
@@ -1073,42 +986,103 @@ function tt({ implementation: e, node: t, environment: n }) {
|
|
|
1073
986
|
jumpTo: n.jumpTo,
|
|
1074
987
|
urlPolicy: n.urlPolicy,
|
|
1075
988
|
imageResolver: n.imageResolver
|
|
1076
|
-
}), o = n.mode === "static" && e.renderStatic ? e.renderStatic : e.render;
|
|
1077
|
-
return
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
989
|
+
}), o = n.mode === "static" && e.renderStatic ? e.renderStatic : e.render, s = h(o, a);
|
|
990
|
+
return n.trace?.observer?.onTrace ? /* @__PURE__ */ C(x, { children: [s, /* @__PURE__ */ S(q, {
|
|
991
|
+
trace: n.trace,
|
|
992
|
+
component: e.definition
|
|
993
|
+
})] }) : s;
|
|
994
|
+
}
|
|
995
|
+
function Q(e, t, n, r) {
|
|
996
|
+
let i = t.name ?? "", a = r ?? e.byName.get(i);
|
|
997
|
+
if (!a) throw new Z(i);
|
|
998
|
+
let o;
|
|
1083
999
|
try {
|
|
1084
|
-
|
|
1000
|
+
o = n.runtime.document.source;
|
|
1085
1001
|
} catch {
|
|
1086
|
-
|
|
1002
|
+
o = void 0;
|
|
1087
1003
|
}
|
|
1088
|
-
let
|
|
1089
|
-
implementation:
|
|
1004
|
+
let s = h(Me, {
|
|
1005
|
+
implementation: a,
|
|
1090
1006
|
node: t,
|
|
1091
1007
|
environment: n
|
|
1092
1008
|
});
|
|
1093
|
-
return
|
|
1094
|
-
name:
|
|
1009
|
+
return a.definition.id.startsWith("reactive-md/") ? s : h(je, {
|
|
1010
|
+
name: i,
|
|
1095
1011
|
nodeId: t.id,
|
|
1096
|
-
revision:
|
|
1012
|
+
revision: Oe(n.runtime),
|
|
1097
1013
|
range: t.range,
|
|
1098
|
-
source:
|
|
1014
|
+
source: o,
|
|
1099
1015
|
report: n.report
|
|
1100
|
-
},
|
|
1016
|
+
}, s);
|
|
1017
|
+
}
|
|
1018
|
+
var Ne = /* @__PURE__ */ new WeakMap();
|
|
1019
|
+
function Pe({ loader: t, index: n, definition: r, node: i, environment: a }) {
|
|
1020
|
+
let o = a.trace, s = g((e) => t.subscribe(r, e, o), [
|
|
1021
|
+
t,
|
|
1022
|
+
r,
|
|
1023
|
+
o
|
|
1024
|
+
]), c = g(() => t.snapshot(r), [t, r]), l = b(s, c, t.serverSnapshot), u = a.runtime.document, d = l.status === "loading", f = d ? "local.extension.load" : "local.extension.load-failed", p = e(f, a.locale) ?? f;
|
|
1025
|
+
if (_(() => {
|
|
1026
|
+
if (l.status === "ready") return;
|
|
1027
|
+
let e = Ne.get(u);
|
|
1028
|
+
e || (e = /* @__PURE__ */ new Set(), Ne.set(u, e));
|
|
1029
|
+
let t = `${o?.sourceRevision ?? ""}:${r.id}:${r.version}:${f}`;
|
|
1030
|
+
e.size >= 64 || e.has(t) || (e.add(t), a.report([{
|
|
1031
|
+
code: f,
|
|
1032
|
+
message: p,
|
|
1033
|
+
messageKey: f,
|
|
1034
|
+
severity: "warning",
|
|
1035
|
+
range: i.range,
|
|
1036
|
+
...ke(u.source, i.range.start),
|
|
1037
|
+
phase: "host",
|
|
1038
|
+
recoverable: !0
|
|
1039
|
+
}]));
|
|
1040
|
+
}, [
|
|
1041
|
+
u,
|
|
1042
|
+
r,
|
|
1043
|
+
f,
|
|
1044
|
+
p,
|
|
1045
|
+
l.status,
|
|
1046
|
+
o?.sourceRevision,
|
|
1047
|
+
a,
|
|
1048
|
+
i
|
|
1049
|
+
]), l.status === "ready") return Q(n, i, a, l.component);
|
|
1050
|
+
let m = a.locale === "zh" ? "重试" : "Retry";
|
|
1051
|
+
return /* @__PURE__ */ C("span", {
|
|
1052
|
+
className: "local-component-loading",
|
|
1053
|
+
"data-rmd-component-load": l.status,
|
|
1054
|
+
role: "status",
|
|
1055
|
+
children: [p, !d && /* @__PURE__ */ S("button", {
|
|
1056
|
+
type: "button",
|
|
1057
|
+
onClick: () => t.retry(r, o),
|
|
1058
|
+
children: m
|
|
1059
|
+
})]
|
|
1060
|
+
});
|
|
1101
1061
|
}
|
|
1102
|
-
function
|
|
1103
|
-
|
|
1062
|
+
function Fe(e) {
|
|
1063
|
+
let n = Te(e), r = Y.get(e);
|
|
1064
|
+
return (e, i) => {
|
|
1065
|
+
let a = e.name ?? "", o = r?.definitions.get(a);
|
|
1066
|
+
if (!r || !o) return Q(n, e, i);
|
|
1067
|
+
let s = i.runtime.document.componentDefinitions?.find((e) => e.name === a);
|
|
1068
|
+
if (!s || s.id !== o.id || s.version !== o.version || t(s) !== t(o)) throw new Z(a);
|
|
1069
|
+
let c = r.loader.synchronousImplementation(o);
|
|
1070
|
+
return c ? Q(n, e, i, c) : /* @__PURE__ */ S(Pe, {
|
|
1071
|
+
loader: r.loader,
|
|
1072
|
+
index: n,
|
|
1073
|
+
definition: o,
|
|
1074
|
+
node: e,
|
|
1075
|
+
environment: i
|
|
1076
|
+
});
|
|
1077
|
+
};
|
|
1104
1078
|
}
|
|
1105
|
-
function
|
|
1079
|
+
function Ie(e) {
|
|
1106
1080
|
let t = "";
|
|
1107
|
-
for (let n of e ?? []) n.type === "text" || n.type === "inlineCode" || n.type === "code" ? t += n.value ?? "" : n.type === "math" || n.type === "inlineMath" || n.type === "image" ? t += n.value ?? n.alt ?? "" : t +=
|
|
1081
|
+
for (let n of e ?? []) n.type === "text" || n.type === "inlineCode" || n.type === "code" || n.type === "rawBody" ? t += n.value ?? "" : n.type === "math" || n.type === "inlineMath" || n.type === "image" ? t += n.value ?? n.alt ?? "" : t += Ie(n.children);
|
|
1108
1082
|
return t;
|
|
1109
1083
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return (t, n, r) =>
|
|
1084
|
+
function Le(e) {
|
|
1085
|
+
return (t, n, r) => Q(e, t, {
|
|
1112
1086
|
runtime: r.runtime,
|
|
1113
1087
|
mode: r.mode,
|
|
1114
1088
|
visible: r.visible,
|
|
@@ -1118,7 +1092,7 @@ function rt(e) {
|
|
|
1118
1092
|
locale: "en",
|
|
1119
1093
|
renderChildren: (e, t) => r.render(e, t),
|
|
1120
1094
|
renderInline: (e, t) => r.render(e, t),
|
|
1121
|
-
renderToText: (e) =>
|
|
1095
|
+
renderToText: (e) => Ie(e),
|
|
1122
1096
|
report: (e) => r.report(e),
|
|
1123
1097
|
definitionFor: (t) => e.byName.get(t)?.definition,
|
|
1124
1098
|
validationField: () => ({ invalid: !1 }),
|
|
@@ -1130,16 +1104,16 @@ function rt(e) {
|
|
|
1130
1104
|
jumpTo: () => "missing"
|
|
1131
1105
|
});
|
|
1132
1106
|
}
|
|
1133
|
-
function
|
|
1134
|
-
let n =
|
|
1107
|
+
function Re(e, t) {
|
|
1108
|
+
let n = f(t, e.config);
|
|
1135
1109
|
if (n.length || !t || typeof t != "object") return n;
|
|
1136
1110
|
let r = t.components;
|
|
1137
1111
|
if (!Array.isArray(r)) return n;
|
|
1138
|
-
let i =
|
|
1139
|
-
for (let e of r) i.byId.has(e.id)
|
|
1112
|
+
let i = Te(e), a = Y.get(e);
|
|
1113
|
+
for (let e of r) !i.byId.has(e.id) && a?.definitions.get(e.name)?.id !== e.id && n.push({
|
|
1140
1114
|
code: "local.extension.renderer-missing",
|
|
1141
1115
|
severity: "error",
|
|
1142
|
-
message: new
|
|
1116
|
+
message: new Z(e.name).message,
|
|
1143
1117
|
range: {
|
|
1144
1118
|
start: 0,
|
|
1145
1119
|
end: 0
|
|
@@ -1151,10 +1125,10 @@ function it(e, t) {
|
|
|
1151
1125
|
}
|
|
1152
1126
|
function $(e, t, n) {
|
|
1153
1127
|
try {
|
|
1154
|
-
e.report([
|
|
1128
|
+
e.report([Ae("local.extension.event", e.instance.componentId, e.instance.range, n, t)]);
|
|
1155
1129
|
} catch {}
|
|
1156
1130
|
}
|
|
1157
|
-
function
|
|
1131
|
+
function ze(e, t, n) {
|
|
1158
1132
|
return (...r) => {
|
|
1159
1133
|
try {
|
|
1160
1134
|
t(...r);
|
|
@@ -1163,4 +1137,4 @@ function at(e, t, n) {
|
|
|
1163
1137
|
}
|
|
1164
1138
|
};
|
|
1165
1139
|
}
|
|
1166
|
-
export {
|
|
1140
|
+
export { $ as a, q as c, R as d, k as f, Fe as i, U as l, De as n, ze as o, X as r, Re as s, Z as t, ne as u };
|