reactive-md 0.9.2 → 0.10.0
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 +397 -333
- package/CHANGELOG.md +398 -334
- package/CONTRIBUTING-ch.md +22 -22
- package/CONTRIBUTING.md +22 -22
- package/README-ch.md +431 -431
- package/README-en.md +431 -431
- package/README.md +429 -429
- package/SECURITY-ch.md +83 -83
- package/SECURITY.md +83 -83
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +263 -263
- package/cli/assets.mjs +395 -395
- package/cli/build.mjs +445 -445
- package/cli/check.mjs +444 -444
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +325 -323
- package/cli/init.mjs +1577 -1577
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +65 -65
- package/cli/migrate.mjs +368 -368
- package/cli/package-loader.mjs +41 -41
- package/cli/package.mjs +211 -211
- package/dist-library/LocalDocumentView-CP2QG86k.js +114 -0
- package/dist-library/{LocalDocumentViewCore-DXE0I0Qc.js → LocalDocumentViewCore-Cd6yMEkg.js} +379 -9445
- package/dist-library/LocalReactiveDocumentCore-VuYpZqdn.js +283 -0
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/chart-B1TUtzm-.js +3 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/color-values-r8Wf7ALn.js +6 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/compile-cache-key-D21X2Obx.js +28 -0
- package/dist-library/compiler-DBwLawMZ.js +98 -0
- package/dist-library/{compiler-core-DDDdvuLy.js → compiler-core-kkDiQ1RK.js} +4202 -3496
- package/dist-library/component-kernel-CsJSabHX.js +372 -0
- package/dist-library/{component-state-BRwvTV0d.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/component-utils-ZM3jUJNy.js +339 -0
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/config-validation-DbmsWAEV.js +469 -0
- package/dist-library/controls-DRy5rzzN.js +5970 -0
- package/dist-library/controls-DWlx-AQl.js +3 -0
- package/dist-library/{coordinate-B1VFK9fd.js → coordinate-c54pHfgf.js} +89 -89
- package/dist-library/data-BtFlkJzp.js +3 -0
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/data-visuals-rZQUeQM0.js +384 -0
- package/dist-library/{default-components-s21NevON.js → default-components-B-39etG9.js} +518 -355
- package/dist-library/{config-DXLvctiZ.js → default-config-CCa8rm2k.js} +265 -230
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{registry-D6OGkOcX.js → default-registry-DXJy66xj.js} +4 -4
- package/dist-library/default-schema-CeYiEW1K.js +33 -0
- package/dist-library/diagram-BLepzI8l.js +3 -0
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/dist-Cueh1Psp.js +4761 -0
- package/dist-library/{document-theme-C8J6UyNO.js → document-theme-CJvN-nC1.js} +246 -4
- package/dist-library/{export-CIAIPBov.js → export-BSV4E0jv.js} +135 -135
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/gallery-BC6FYTqw.js +3 -0
- package/dist-library/{gallery-Dv1rOvL0.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-Cr4CBwAH.js → html-CY9mC3Sr.js} +49 -48
- package/dist-library/{incremental-9nx92u9c.js → incremental-B-wW4H3F.js} +537 -384
- package/dist-library/{display-B_uutKkN.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/layout-CaDWsDof.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-CyGTS6kv.js +20 -0
- package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
- package/dist-library/mount-preset-DtrCX4G8.js +24 -0
- package/dist-library/numeric-sliders-BmJ1LCLx.js +542 -0
- package/dist-library/{observability-4KqXhIEU.js → observability-BVQ16ByQ.js} +125 -43
- package/dist-library/package-core-Cu_r_qs7.js +128 -0
- package/dist-library/parser-BHl9Lxbw.js +8 -0
- package/dist-library/parser-standard-DDAKv_DZ.js +4872 -0
- package/dist-library/plugin-packs-CkI0floL.js +19 -0
- package/dist-library/preset-core-BKPbH_Nv.js +1371 -0
- package/dist-library/props-0iDqxlTk.js +174 -0
- package/dist-library/react-74jdGBmu.js +32 -0
- package/dist-library/reactive-md-authoring.js +315 -296
- package/dist-library/reactive-md-build.js +334 -43
- package/dist-library/reactive-md-compiler-session.js +4 -0
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- 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 +32 -15
- package/dist-library/reactive-md-default-preset.js +7 -7
- package/dist-library/reactive-md-export.js +6 -5
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +26 -23
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +125 -3
- package/dist-library/reactive-md-pack-style-manifest.js +805 -0
- package/dist-library/reactive-md-plugin-chart.js +14 -9
- 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 +8 -8
- package/dist-library/reactive-md-plugin-network.js +13 -13
- package/dist-library/reactive-md-plugin-plot.js +7 -6
- package/dist-library/reactive-md-print.css +304 -304
- 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-else.js +10 -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 +37 -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 +29 -27
- 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-scan.js +1 -0
- package/dist-library/reactive-md-sdk.js +23 -9
- 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-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +401 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +97 -1554
- package/dist-library/registry-core-DxEaxhJ6.js +126 -0
- package/dist-library/render-nodes-B6j6Ip5I.js +9404 -0
- package/dist-library/requirements-C56sFIEs.js +157 -0
- package/dist-library/resources-6VaNgk-h.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 +1834 -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 +1489 -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-BHeuLOv_.js +1369 -0
- package/dist-library/runtime-requirement-DzPO8raU.js +772 -0
- package/dist-library/schema-core-CDXfxdID.js +155 -0
- package/dist-library/sdk-core-CnE-n0Z7.js +1295 -0
- package/dist-library/{session-core-dxQCJBNa.js → session-core-C071yQwV.js} +147 -133
- package/dist-library/sha256-utf16-Bmandi_H.js +937 -0
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- 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 +14 -2
- package/dist-library/types/authoring/extensions.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +4 -4
- package/dist-library/types/authoring/templates.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/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -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/else.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 +6 -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 +1 -3
- package/dist-library/types/components/table/data-table-model.d.ts +141 -0
- package/dist-library/types/components/table/data-table.d.ts +3 -50
- package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +9 -2
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- 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/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/runtime-types.d.ts +19 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- 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-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +17 -5
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +9 -3
- package/dist-library/types/local/compilation/compiler-tables.d.ts +4 -2
- package/dist-library/types/local/compilation/compiler-validation.d.ts +14 -7
- package/dist-library/types/local/compilation/compiler-values.d.ts +2 -3
- 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 +228 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -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/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +10 -4
- package/dist-library/types/local/observability-core.d.ts +20 -1
- package/dist-library/types/local/observability.d.ts +2 -0
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
- 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/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/performance-report.d.ts +70 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -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 +14 -0
- package/dist-library/types/local/types.d.ts +70 -27
- package/dist-library/types/observability.d.ts +1 -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 +24 -4
- 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/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- 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 +6 -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 +3 -3
- 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 +5 -14
- 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 +15 -4
- 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/assembly.d.ts +3 -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/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +2 -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/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +8 -2
- package/dist-library/types/sdk/version.d.ts +2 -0
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +5 -2
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Ib5kSScP.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-DAxuGOG2.js → version-4wzhbvDG.js} +24 -33
- package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
- package/dist-library/visual-helpers-UU6xiL8g.js +75 -0
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/visuals-CdHezgh5.js +3 -0
- package/dist-library/worker-3ldRjOEG.js +1632 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +127 -366
- package/docs/README-ch.md +104 -101
- package/docs/README.md +104 -101
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +146 -146
- package/docs/compatibility/compatibility-en.md +146 -146
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +170 -162
- package/docs/compatibility/source-versioning-en.md +171 -162
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +66 -66
- package/docs/development/component-development-en.md +66 -66
- package/docs/development/component-development-reference-ch.md +269 -253
- package/docs/development/component-development-reference-en.md +254 -238
- package/docs/development/component-protocol-ch.md +768 -748
- package/docs/development/component-protocol-en.md +770 -750
- package/docs/development/extension-tutorial-ch.md +308 -308
- package/docs/development/extension-tutorial-en.md +308 -308
- package/docs/development/performance-overview-ch.md +422 -422
- package/docs/development/performance-overview-en.md +422 -422
- package/docs/guides/local-guide-ch.md +621 -532
- package/docs/guides/local-guide-en.md +621 -532
- package/docs/integration/author-tools-ch.md +66 -64
- package/docs/integration/author-tools-en.md +66 -64
- package/docs/integration/compiler-ch.md +90 -49
- package/docs/integration/compiler-en.md +77 -36
- package/docs/integration/directory-discovery-en.md +1 -1
- package/docs/integration/editor-ch.md +295 -295
- package/docs/integration/editor-en.md +303 -303
- package/docs/integration/extension-sdk-ch.md +424 -394
- package/docs/integration/extension-sdk-en.md +409 -379
- package/docs/integration/local-integration-ch.md +648 -646
- package/docs/integration/local-integration-en.md +664 -662
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +299 -307
- package/docs/integration/shareable-export-en.md +301 -309
- package/docs/reference/diagnostics-counting-ch.md +127 -104
- package/docs/reference/diagnostics-counting-en.md +127 -104
- package/docs/reference/html-compatibility-ch.md +93 -93
- package/docs/reference/html-compatibility-en.md +95 -95
- package/docs/reference/local-interaction-syntax-ch.md +913 -724
- package/docs/reference/local-interaction-syntax-en.md +911 -722
- package/docs/reference/public-api-ch.md +134 -21
- package/docs/reference/public-api-en.md +134 -21
- package/docs/reference/theme-protocol-ch.md +198 -198
- package/docs/reference/theme-protocol-en.md +217 -217
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/docs/releases/release-0.4.0-ch.md +91 -91
- package/docs/releases/release-0.4.0-en.md +91 -91
- package/docs/releases/release-0.4.1-ch.md +25 -25
- package/docs/releases/release-0.4.1-en.md +25 -25
- package/docs/releases/release-0.5.0-ch.md +43 -43
- package/docs/releases/release-0.5.0-en.md +43 -43
- package/docs/releases/release-0.5.1-ch.md +41 -41
- package/docs/releases/release-0.5.1-en.md +41 -41
- package/docs/releases/release-0.5.2-ch.md +37 -37
- package/docs/releases/release-0.5.2-en.md +37 -37
- package/docs/releases/release-0.5.3-ch.md +26 -26
- package/docs/releases/release-0.5.3-en.md +26 -26
- package/docs/releases/release-0.6.0-ch.md +59 -59
- package/docs/releases/release-0.6.0-en.md +59 -59
- package/docs/releases/release-0.6.1-ch.md +29 -29
- package/docs/releases/release-0.6.1-en.md +29 -29
- package/docs/releases/release-0.7.0-ch.md +86 -86
- package/docs/releases/release-0.7.0-en.md +86 -86
- package/docs/releases/release-0.9.3-ch.md +45 -0
- package/docs/releases/release-0.9.3-en.md +45 -0
- package/examples/component-package/README-ch.md +101 -101
- package/examples/component-package/README.md +133 -133
- package/examples/conformance/README-ch.md +55 -55
- package/examples/conformance/README.md +55 -55
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/game-2048-package/LICENSE +21 -21
- package/examples/game-2048-package/NOTICES.md +11 -11
- package/examples/game-2048-package/README-ch.md +91 -91
- package/examples/game-2048-package/README.md +98 -98
- package/examples/game-2048-package/package.json +35 -35
- package/examples/game-2048-package/sample/document.reactive.md +17 -17
- package/examples/game-2048-package/scripts/build-export.mjs +44 -44
- package/examples/game-2048-package/scripts/build.mjs +130 -130
- package/examples/game-2048-package/scripts/verify.mjs +180 -180
- package/examples/game-2048-package/src/component.css +161 -161
- package/examples/game-2048-package/src/components.tsx +326 -326
- package/examples/game-2048-package/src/game-engine.ts +228 -228
- package/examples/game-2048-package/src/harness.tsx +34 -34
- package/examples/game-2048-package/src/manifest.ts +85 -85
- package/examples/game-2048-package/src/node-entry.ts +30 -30
- package/examples/game-2048-package/src/sample.ts +4 -4
- package/examples/game-2048-package/tsconfig.json +15 -15
- package/examples/integration/README-ch.md +114 -82
- package/examples/integration/README.md +114 -82
- package/examples/integration/chat-session/index.mjs +91 -0
- package/examples/integration/chat-session/package.json +10 -0
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/extension-sdk/README-ch.md +24 -24
- package/examples/integration/extension-sdk/README.md +24 -24
- 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/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README-ch.md +76 -76
- package/examples/local/README.md +76 -76
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README-ch.md +22 -22
- package/examples/local/showcase/README.md +31 -31
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/examples/minimal-extension/README-ch.md +78 -78
- package/examples/minimal-extension/README.md +78 -78
- package/examples/minimal-extension/index.html +15 -15
- package/examples/minimal-extension/package.json +26 -26
- package/examples/minimal-extension/sample/document.reactive.md +10 -10
- package/examples/minimal-extension/scripts/build.mjs +32 -32
- package/examples/minimal-extension/scripts/export.mjs +72 -72
- package/examples/minimal-extension/scripts/test-node.mjs +75 -75
- package/examples/minimal-extension/src/extension.tsx +90 -90
- package/examples/minimal-extension/src/preview.tsx +12 -12
- package/examples/minimal-extension/src/source.ts +4 -4
- package/examples/minimal-extension/tsconfig.json +14 -14
- package/examples/sci-fi-theme/README-ch.md +133 -133
- package/examples/sci-fi-theme/README.md +148 -148
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
- package/examples/sci-fi-theme/demo/demo.css +638 -638
- package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
- package/examples/sci-fi-theme/demo/index.html +13 -13
- package/examples/sci-fi-theme/demo/main.tsx +215 -215
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
- package/examples/sci-fi-theme/docs/design-system.md +474 -474
- package/examples/sci-fi-theme/package.json +28 -28
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
- package/examples/sci-fi-theme/src/components.css +2370 -2370
- package/examples/sci-fi-theme/src/index.ts +6 -6
- package/examples/sci-fi-theme/src/notch.css +142 -142
- package/examples/sci-fi-theme/src/sci-fi.css +7 -7
- package/examples/sci-fi-theme/src/theme.ts +39 -39
- package/examples/sci-fi-theme/tsconfig.json +20 -20
- package/examples/sci-fi-theme/vite.config.ts +24 -24
- package/examples/tetris-package/LICENSE +21 -21
- package/examples/tetris-package/NOTICES.md +11 -11
- package/examples/tetris-package/README-ch.md +91 -91
- package/examples/tetris-package/README.md +95 -95
- package/examples/tetris-package/package.json +35 -35
- package/examples/tetris-package/sample/document.reactive.md +16 -16
- package/examples/tetris-package/scripts/build-export.mjs +44 -44
- package/examples/tetris-package/scripts/build.mjs +130 -130
- package/examples/tetris-package/scripts/verify.mjs +173 -173
- package/examples/tetris-package/src/component.css +145 -145
- package/examples/tetris-package/src/components.tsx +334 -334
- package/examples/tetris-package/src/harness.tsx +34 -34
- package/examples/tetris-package/src/manifests.ts +93 -93
- package/examples/tetris-package/src/node-entry.ts +16 -16
- package/examples/tetris-package/src/sample.ts +4 -4
- package/examples/tetris-package/src/tetris-engine.ts +325 -325
- package/examples/tetris-package/tsconfig.json +15 -15
- package/package.json +66 -2
- package/dist-library/LocalDocumentView-BuqgJZEY.js +0 -109
- package/dist-library/LocalReactiveDocumentCore-CWBe4Mm5.js +0 -275
- package/dist-library/authoring-Ci_KzJ0q.js +0 -892
- package/dist-library/compile-Dx6Uw3D9.js +0 -1249
- package/dist-library/compiler-dxLPB9Ym.js +0 -86
- package/dist-library/config-validation-D3D7Dy2J.js +0 -586
- package/dist-library/controls-DoZyLCrV.js +0 -6740
- package/dist-library/data-table-8-3F15Jf.js +0 -296
- package/dist-library/layout-BBB2VF0S.js +0 -562
- package/dist-library/mount-preset-DMZ5wd3t.js +0 -13
- package/dist-library/options-BBp9IcHm.js +0 -121
- package/dist-library/package-core-K5xesGqy.js +0 -117
- package/dist-library/parser-standard-CBA1-hdG.js +0 -9630
- package/dist-library/plugin-packs-Bh1HhLym.js +0 -19
- package/dist-library/preset-core-DeZPA8IE.js +0 -1298
- package/dist-library/props-sJ8vk0cr.js +0 -183
- package/dist-library/react-0DCh-Mar.js +0 -7
- package/dist-library/registry-core-C9xOunaw.js +0 -479
- package/dist-library/resources-B0x_w3s9.js +0 -229
- package/dist-library/runtime-BpQdZmFI.js +0 -1288
- package/dist-library/schema-BryM_VRW.js +0 -40
- package/dist-library/sdk-core-ChslheKs.js +0 -1167
- package/dist-library/shareable-B8xMoGEa.js +0 -814
- 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/types-daDo2c_w.js +0 -3
- package/dist-library/validation-B3RI0xOk.js +0 -1123
- package/dist-library/visual-frame-_rcd5HUv.js +0 -48
- package/dist-library/visuals-DkDhNdEZ.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,1288 +0,0 @@
|
|
|
1
|
-
import { j as e } from "./version-DAxuGOG2.js";
|
|
2
|
-
import { _ as t, l as n, o as r, y as i } from "./document-theme-C8J6UyNO.js";
|
|
3
|
-
import { a, c as o, r as s, s as c, t as l } from "./compile-Dx6Uw3D9.js";
|
|
4
|
-
import { a as u, c as d, h as f, i as p, l as ee, n as m, o as h, p as g, r as _, t as v, u as y } from "./validation-B3RI0xOk.js";
|
|
5
|
-
import { n as b, t as x } from "./types-daDo2c_w.js";
|
|
6
|
-
import { i as S } from "./registry-core-C9xOunaw.js";
|
|
7
|
-
import { t as C } from "./registry-D6OGkOcX.js";
|
|
8
|
-
import { x as te } from "./component-state-CwKX_SN5.js";
|
|
9
|
-
import { i as ne, t as w } from "./identity-BUx0Q_-d.js";
|
|
10
|
-
import { n as T } from "./runtime-BDnnimPA.js";
|
|
11
|
-
// src/local/runtime/runtime-values.ts
|
|
12
|
-
function E(e, t) {
|
|
13
|
-
return e.attrs?.[t];
|
|
14
|
-
}
|
|
15
|
-
function D(e, t) {
|
|
16
|
-
let n = E(e, t);
|
|
17
|
-
if (n === "true") return !0;
|
|
18
|
-
if (n === "false") return !1;
|
|
19
|
-
}
|
|
20
|
-
function O(e, t) {
|
|
21
|
-
let n = E(e, t);
|
|
22
|
-
if (n === void 0) return;
|
|
23
|
-
let r = Number(n);
|
|
24
|
-
return Number.isFinite(r) ? r : void 0;
|
|
25
|
-
}
|
|
26
|
-
function k(e) {
|
|
27
|
-
return t(e);
|
|
28
|
-
}
|
|
29
|
-
function A(e, t) {
|
|
30
|
-
return {
|
|
31
|
-
ok: !1,
|
|
32
|
-
detail: n(e, t)
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function j(e, t) {
|
|
36
|
-
if (t !== void 0) return E(e, t);
|
|
37
|
-
}
|
|
38
|
-
function M(e, t) {
|
|
39
|
-
if (t !== void 0) return O(e, t);
|
|
40
|
-
}
|
|
41
|
-
function N(t, n, r, i = {}) {
|
|
42
|
-
for (let a of r) if (a.kind === "date") {
|
|
43
|
-
if (!S(n)) return A("local.runtime.value.date-invalid");
|
|
44
|
-
let e = i.required ?? (a.required !== void 0 && D(t, a.required) === !0);
|
|
45
|
-
if (n === "" && e) return A("local.runtime.value.date-required");
|
|
46
|
-
let r = i.min ?? j(t, a.min), o = i.max ?? j(t, a.max);
|
|
47
|
-
if (n !== "" && r && n < r) return A("local.runtime.value.date-earlier", { min: r });
|
|
48
|
-
if (n !== "" && o && n > o) return A("local.runtime.value.date-later", { max: o });
|
|
49
|
-
} else if (a.kind === "required") {
|
|
50
|
-
let e = i.required ?? D(t, a.required) === !0;
|
|
51
|
-
if (n === "" && e) return A("local.runtime.value.field-required");
|
|
52
|
-
} else if (a.kind === "length") {
|
|
53
|
-
let e = k(n), r = M(t, a.min), i = M(t, a.max);
|
|
54
|
-
if (r !== void 0 && r > 0 && n !== "" && e < r) return A("local.runtime.value.min-length", { min: r });
|
|
55
|
-
if (i !== void 0 && e > i) return A("local.runtime.value.max-length", { max: i });
|
|
56
|
-
} else if (a.kind === "email" && (j(t, a.type) ?? "text") === a.value && n !== "") {
|
|
57
|
-
if (n.length > 254) return A("local.runtime.value.email-length", { limit: 254 });
|
|
58
|
-
if (!e(n)) return A("local.runtime.value.email-invalid");
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
ok: !0,
|
|
62
|
-
value: n
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
var P = /* @__PURE__ */ new Map();
|
|
66
|
-
function F(e) {
|
|
67
|
-
if (!e.name) return I;
|
|
68
|
-
let t = P.get(e.name);
|
|
69
|
-
if (t !== void 0) return t ?? I;
|
|
70
|
-
let n = C(e.name), r = n ? f(n) : I;
|
|
71
|
-
return P.set(e.name, n ? r : null), r;
|
|
72
|
-
}
|
|
73
|
-
var I = Object.freeze([]);
|
|
74
|
-
function L(e, t, n, i, a, s = !1) {
|
|
75
|
-
switch (e.type) {
|
|
76
|
-
case "number": {
|
|
77
|
-
if (typeof n != "number" || !Number.isFinite(n)) return A("local.runtime.value.finite-number", { name: e.name });
|
|
78
|
-
let r = e.step ?? 1, a = e.min ?? 0;
|
|
79
|
-
for (let r of t) {
|
|
80
|
-
let t = i(r, "min");
|
|
81
|
-
if (t.present && !t.ok) return A("local.runtime.value.constraint", {
|
|
82
|
-
name: e.name,
|
|
83
|
-
attribute: "min"
|
|
84
|
-
});
|
|
85
|
-
if (t.present && t.ok) {
|
|
86
|
-
if (typeof t.value != "number" || !Number.isFinite(t.value)) return A("local.runtime.value.constraint", {
|
|
87
|
-
name: e.name,
|
|
88
|
-
attribute: "min"
|
|
89
|
-
});
|
|
90
|
-
if (a = t.value, n < t.value) return A("local.runtime.value.min", {
|
|
91
|
-
name: e.name,
|
|
92
|
-
min: t.value
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
let o = i(r, "max");
|
|
96
|
-
if (o.present && !o.ok) return A("local.runtime.value.constraint", {
|
|
97
|
-
name: e.name,
|
|
98
|
-
attribute: "max"
|
|
99
|
-
});
|
|
100
|
-
if (o.present && o.ok) {
|
|
101
|
-
if (typeof o.value != "number" || !Number.isFinite(o.value)) return A("local.runtime.value.constraint", {
|
|
102
|
-
name: e.name,
|
|
103
|
-
attribute: "max"
|
|
104
|
-
});
|
|
105
|
-
if (n > o.value) return A("local.runtime.value.max", {
|
|
106
|
-
name: e.name,
|
|
107
|
-
max: o.value
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
if (t.present && t.ok && o.present && o.ok && typeof t.value == "number" && typeof o.value == "number" && t.value > o.value) return A("local.runtime.value.constraint-range", { name: e.name });
|
|
111
|
-
}
|
|
112
|
-
return e.min !== void 0 && n < e.min ? A("local.runtime.value.min", {
|
|
113
|
-
name: e.name,
|
|
114
|
-
min: e.min
|
|
115
|
-
}) : e.max !== void 0 && n > e.max ? A("local.runtime.value.max", {
|
|
116
|
-
name: e.name,
|
|
117
|
-
max: e.max
|
|
118
|
-
}) : r > 0 && !V(n, a, r) ? A("local.runtime.value.step", {
|
|
119
|
-
name: e.name,
|
|
120
|
-
step: r,
|
|
121
|
-
base: a
|
|
122
|
-
}) : {
|
|
123
|
-
ok: !0,
|
|
124
|
-
value: n
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
case "boolean": return typeof n == "boolean" ? {
|
|
128
|
-
ok: !0,
|
|
129
|
-
value: n
|
|
130
|
-
} : A("local.runtime.value.boolean", { name: e.name });
|
|
131
|
-
case "string": {
|
|
132
|
-
if (typeof n != "string") return A("local.runtime.value.string", { name: e.name });
|
|
133
|
-
let c = o(n);
|
|
134
|
-
if (c) return A("local.runtime.value.budget", {
|
|
135
|
-
name: e.name,
|
|
136
|
-
detail: r(c),
|
|
137
|
-
detailKey: c.key,
|
|
138
|
-
...c.params
|
|
139
|
-
});
|
|
140
|
-
for (let r of t) {
|
|
141
|
-
let t = a?.get(r.id) ?? (s ? F(r) : I);
|
|
142
|
-
if (!t.length) continue;
|
|
143
|
-
let o = {};
|
|
144
|
-
for (let n of t) {
|
|
145
|
-
if (n.kind === "date") {
|
|
146
|
-
for (let t of ["min", "max"]) {
|
|
147
|
-
if (n[t] === void 0) continue;
|
|
148
|
-
let a = i(r, t);
|
|
149
|
-
if (a.present) {
|
|
150
|
-
if (!a.ok || typeof a.value != "string" || !S(a.value)) return A("local.runtime.value.constraint-date", {
|
|
151
|
-
name: e.name,
|
|
152
|
-
attribute: t
|
|
153
|
-
});
|
|
154
|
-
o[t] = a.value;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
let t = o.min ?? j(r, n.min), a = o.max ?? j(r, n.max);
|
|
158
|
-
if (t && a && S(t) && S(a) && t > a) return A("local.runtime.value.constraint-range", { name: e.name });
|
|
159
|
-
}
|
|
160
|
-
if ((n.kind === "date" || n.kind === "required" ? n.required : void 0) !== void 0) {
|
|
161
|
-
let t = i(r, "required");
|
|
162
|
-
if (t.present) {
|
|
163
|
-
if (!t.ok || typeof t.value != "boolean") return A("local.runtime.value.constraint", {
|
|
164
|
-
name: e.name,
|
|
165
|
-
attribute: "required"
|
|
166
|
-
});
|
|
167
|
-
o.required = t.value;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
let c = N(r, n, t, o);
|
|
172
|
-
if (!c.ok) return c;
|
|
173
|
-
}
|
|
174
|
-
return e.options?.length && !e.options.includes(n) ? A("local.runtime.value.option", {
|
|
175
|
-
value: n,
|
|
176
|
-
options: e.options.join(", ")
|
|
177
|
-
}) : {
|
|
178
|
-
ok: !0,
|
|
179
|
-
value: n
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
case "array": {
|
|
183
|
-
if (!Array.isArray(n)) return A("local.runtime.value.array", { name: e.name });
|
|
184
|
-
let t = o(n);
|
|
185
|
-
if (t) return A("local.runtime.value.budget", {
|
|
186
|
-
name: e.name,
|
|
187
|
-
detail: r(t),
|
|
188
|
-
detailKey: t.key,
|
|
189
|
-
...t.params
|
|
190
|
-
});
|
|
191
|
-
for (let t of n) if (typeof t != "string") return A("local.runtime.value.array-members", { name: e.name });
|
|
192
|
-
if (e.family === "collection") return e.maxItems !== void 0 && n.length > e.maxItems ? A("local.runtime.value.max-items", {
|
|
193
|
-
name: e.name,
|
|
194
|
-
max: e.maxItems
|
|
195
|
-
}) : {
|
|
196
|
-
ok: !0,
|
|
197
|
-
value: n.slice()
|
|
198
|
-
};
|
|
199
|
-
let i = /* @__PURE__ */ new Set();
|
|
200
|
-
for (let t of n) {
|
|
201
|
-
if (e.options && !e.options.includes(t)) return A("local.runtime.value.checklist-option", { value: t });
|
|
202
|
-
i.add(t);
|
|
203
|
-
}
|
|
204
|
-
let a = e.options ? e.options.filter((e) => i.has(e)) : [...i];
|
|
205
|
-
return e.maxItems !== void 0 && a.length > e.maxItems ? A("local.runtime.value.max-items", {
|
|
206
|
-
name: e.name,
|
|
207
|
-
max: e.maxItems
|
|
208
|
-
}) : {
|
|
209
|
-
ok: !0,
|
|
210
|
-
value: a
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
case "number-array": {
|
|
214
|
-
if (!Array.isArray(n)) return A("local.runtime.value.number-array", { name: e.name });
|
|
215
|
-
let t = o(n);
|
|
216
|
-
if (t) return A("local.runtime.value.budget", {
|
|
217
|
-
name: e.name,
|
|
218
|
-
detail: r(t),
|
|
219
|
-
detailKey: t.key,
|
|
220
|
-
...t.params
|
|
221
|
-
});
|
|
222
|
-
for (let t of n) if (typeof t != "number" || !Number.isFinite(t)) return A("local.runtime.value.number-array-members", { name: e.name });
|
|
223
|
-
return e.maxItems !== void 0 && n.length > e.maxItems ? A("local.runtime.value.max-items", {
|
|
224
|
-
name: e.name,
|
|
225
|
-
max: e.maxItems
|
|
226
|
-
}) : {
|
|
227
|
-
ok: !0,
|
|
228
|
-
value: n.slice()
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
case "null": return n === null ? {
|
|
232
|
-
ok: !0,
|
|
233
|
-
value: n
|
|
234
|
-
} : A("local.runtime.value.null", { name: e.name });
|
|
235
|
-
}
|
|
236
|
-
return A("local.runtime.value.unsupported-type", { name: e.name });
|
|
237
|
-
}
|
|
238
|
-
function R(e) {
|
|
239
|
-
return e instanceof a ? e : new a("expression-eval", e instanceof Error ? e.message : String(e), 0);
|
|
240
|
-
}
|
|
241
|
-
function re(e, t) {
|
|
242
|
-
switch (e) {
|
|
243
|
-
case "string": {
|
|
244
|
-
if (typeof t != "string") return {
|
|
245
|
-
ok: !1,
|
|
246
|
-
key: "local.runtime.external-value",
|
|
247
|
-
params: { kind: "string" }
|
|
248
|
-
};
|
|
249
|
-
let e = o(t);
|
|
250
|
-
return e ? {
|
|
251
|
-
ok: !1,
|
|
252
|
-
key: "local.runtime.external-budget",
|
|
253
|
-
params: {
|
|
254
|
-
detailKey: e.key,
|
|
255
|
-
...e.params ?? {}
|
|
256
|
-
}
|
|
257
|
-
} : {
|
|
258
|
-
ok: !0,
|
|
259
|
-
value: t
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
case "number": return typeof t == "number" && Number.isFinite(t) ? {
|
|
263
|
-
ok: !0,
|
|
264
|
-
value: t
|
|
265
|
-
} : {
|
|
266
|
-
ok: !1,
|
|
267
|
-
key: "local.runtime.external-value",
|
|
268
|
-
params: { kind: "number" }
|
|
269
|
-
};
|
|
270
|
-
case "boolean": return typeof t == "boolean" ? {
|
|
271
|
-
ok: !0,
|
|
272
|
-
value: t
|
|
273
|
-
} : {
|
|
274
|
-
ok: !1,
|
|
275
|
-
key: "local.runtime.external-value",
|
|
276
|
-
params: { kind: "boolean" }
|
|
277
|
-
};
|
|
278
|
-
case "array": {
|
|
279
|
-
if (!Array.isArray(t)) return {
|
|
280
|
-
ok: !1,
|
|
281
|
-
key: "local.runtime.external-value",
|
|
282
|
-
params: { kind: "string-array" }
|
|
283
|
-
};
|
|
284
|
-
for (let e of t) if (typeof e != "string") return {
|
|
285
|
-
ok: !1,
|
|
286
|
-
key: "local.runtime.external-value",
|
|
287
|
-
params: { kind: "string-array" }
|
|
288
|
-
};
|
|
289
|
-
let e = o(t);
|
|
290
|
-
return e ? {
|
|
291
|
-
ok: !1,
|
|
292
|
-
key: "local.runtime.external-budget",
|
|
293
|
-
params: {
|
|
294
|
-
detailKey: e.key,
|
|
295
|
-
...e.params ?? {}
|
|
296
|
-
}
|
|
297
|
-
} : {
|
|
298
|
-
ok: !0,
|
|
299
|
-
value: t.slice()
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
case "number-array": {
|
|
303
|
-
if (!Array.isArray(t)) return {
|
|
304
|
-
ok: !1,
|
|
305
|
-
key: "local.runtime.external-value",
|
|
306
|
-
params: { kind: "number-array" }
|
|
307
|
-
};
|
|
308
|
-
for (let e of t) if (typeof e != "number" || !Number.isFinite(e)) return {
|
|
309
|
-
ok: !1,
|
|
310
|
-
key: "local.runtime.external-value",
|
|
311
|
-
params: { kind: "number-array" }
|
|
312
|
-
};
|
|
313
|
-
let e = o(t);
|
|
314
|
-
return e ? {
|
|
315
|
-
ok: !1,
|
|
316
|
-
key: "local.runtime.external-budget",
|
|
317
|
-
params: {
|
|
318
|
-
detailKey: e.key,
|
|
319
|
-
...e.params ?? {}
|
|
320
|
-
}
|
|
321
|
-
} : {
|
|
322
|
-
ok: !0,
|
|
323
|
-
value: t.slice()
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
default: return {
|
|
327
|
-
ok: !1,
|
|
328
|
-
key: "local.runtime.external-value",
|
|
329
|
-
params: { kind: String(e) }
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
var z = 1e-9;
|
|
334
|
-
function B(e) {
|
|
335
|
-
return Array.isArray(e) ? e.slice() : e;
|
|
336
|
-
}
|
|
337
|
-
function V(e, t, n) {
|
|
338
|
-
let r = (e - t) / n;
|
|
339
|
-
return Math.abs(r - Math.round(r)) <= z * Math.max(1, Math.abs(r));
|
|
340
|
-
}
|
|
341
|
-
function H(e, t, n, i) {
|
|
342
|
-
let a = Math.max(0, Math.min(e.source.length, t.range.start)), o = e.source.slice(0, a).split("\n");
|
|
343
|
-
return {
|
|
344
|
-
code: n,
|
|
345
|
-
message: r(i),
|
|
346
|
-
severity: "error",
|
|
347
|
-
range: {
|
|
348
|
-
start: a,
|
|
349
|
-
end: Math.max(a + 1, Math.min(e.source.length, t.range.end))
|
|
350
|
-
},
|
|
351
|
-
line: o.length,
|
|
352
|
-
column: (o.at(-1) ?? "").length + 1,
|
|
353
|
-
messageKey: i.key,
|
|
354
|
-
phase: "runtime",
|
|
355
|
-
recoverable: !0,
|
|
356
|
-
...i.params ? { params: i.params } : {}
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
function U(e, t, n) {
|
|
360
|
-
return {
|
|
361
|
-
code: e,
|
|
362
|
-
message: t,
|
|
363
|
-
severity: "error",
|
|
364
|
-
range: {
|
|
365
|
-
start: 0,
|
|
366
|
-
end: 0
|
|
367
|
-
},
|
|
368
|
-
line: 1,
|
|
369
|
-
column: 1,
|
|
370
|
-
phase: "runtime",
|
|
371
|
-
recoverable: !0,
|
|
372
|
-
...n ? {
|
|
373
|
-
messageKey: n.key,
|
|
374
|
-
...n.params ? { params: n.params } : {}
|
|
375
|
-
} : {}
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
// src/local/runtime/runtime-document.ts
|
|
379
|
-
function W(e, t) {
|
|
380
|
-
let n = e.document.bindings[t];
|
|
381
|
-
if (!n) return;
|
|
382
|
-
let { nodeIds: r, owner: i, ...a } = n, o = (e.controls.get(t) ?? []).map((t) => {
|
|
383
|
-
let n = e.document.dynamicConstraints?.[t.id] ?? {};
|
|
384
|
-
return {
|
|
385
|
-
name: t.name ?? null,
|
|
386
|
-
attrs: t.attrs ?? {},
|
|
387
|
-
dynamic: Object.fromEntries(Object.entries(n).map(([e, t]) => [e, t ? {
|
|
388
|
-
source: t.source,
|
|
389
|
-
numeric: t.numeric ?? null
|
|
390
|
-
} : null])),
|
|
391
|
-
rules: e.valueRules.get(t.id) ?? null
|
|
392
|
-
};
|
|
393
|
-
});
|
|
394
|
-
return JSON.stringify({
|
|
395
|
-
facts: a,
|
|
396
|
-
legacy: e.legacyValueRules,
|
|
397
|
-
controls: o
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
function ie(e, t) {
|
|
401
|
-
let n = t.get(e);
|
|
402
|
-
if (n) return {
|
|
403
|
-
expression: n,
|
|
404
|
-
error: null
|
|
405
|
-
};
|
|
406
|
-
try {
|
|
407
|
-
let n = l(e);
|
|
408
|
-
if (t.size >= 200) {
|
|
409
|
-
let e = t.keys().next().value;
|
|
410
|
-
e !== void 0 && t.delete(e);
|
|
411
|
-
}
|
|
412
|
-
return t.set(e, n), {
|
|
413
|
-
expression: n,
|
|
414
|
-
error: null
|
|
415
|
-
};
|
|
416
|
-
} catch (e) {
|
|
417
|
-
return {
|
|
418
|
-
expression: null,
|
|
419
|
-
error: R(e)
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
function ae(e, t) {
|
|
424
|
-
let n = /* @__PURE__ */ new Map();
|
|
425
|
-
for (let t of i(e.nodes)) n.set(t.id, t);
|
|
426
|
-
let s = {}, l = /* @__PURE__ */ new Map();
|
|
427
|
-
for (let [t, i] of Object.entries(e.bindings)) {
|
|
428
|
-
let e = o(i.initial);
|
|
429
|
-
if (e) throw new a("expression-budget", `Parameter "${t}": ${r(e)}`, 0);
|
|
430
|
-
s[t] = B(i.initial);
|
|
431
|
-
let c = [];
|
|
432
|
-
for (let e of i.nodeIds) {
|
|
433
|
-
let t = n.get(e);
|
|
434
|
-
t && c.push(t);
|
|
435
|
-
}
|
|
436
|
-
l.set(t, c);
|
|
437
|
-
}
|
|
438
|
-
let d = /* @__PURE__ */ new Map();
|
|
439
|
-
for (let [t, n] of Object.entries(e.bindingSlots ?? {})) d.set(t, { ...n });
|
|
440
|
-
let f = g(e), p = new Map(Object.entries(f?.valueRules ?? {})), ee = f === void 0, m = /* @__PURE__ */ new Map();
|
|
441
|
-
if (f) for (let e of f.slotRelations) {
|
|
442
|
-
let t = d.get(e.nodeId), n = t?.[e.lower], r = t?.[e.upper];
|
|
443
|
-
if (!n || !r) continue;
|
|
444
|
-
let i = m.get(e.nodeId) ?? [];
|
|
445
|
-
i.push({
|
|
446
|
-
lower: n,
|
|
447
|
-
upper: r
|
|
448
|
-
}), m.set(e.nodeId, i);
|
|
449
|
-
}
|
|
450
|
-
else for (let [e, t] of d) t.start && t.end && m.set(e, [{
|
|
451
|
-
lower: t.start,
|
|
452
|
-
upper: t.end
|
|
453
|
-
}]);
|
|
454
|
-
let _ = /* @__PURE__ */ new Map();
|
|
455
|
-
for (let [t, n] of Object.entries(e.bindings)) for (let e of n.nodeIds) {
|
|
456
|
-
if (d.has(e)) continue;
|
|
457
|
-
let n = _.get(e);
|
|
458
|
-
(n === void 0 || n.startsWith("@") && !t.startsWith("@")) && _.set(e, t);
|
|
459
|
-
}
|
|
460
|
-
let v = Object.freeze(Object.keys(e.bindings).filter((e) => !e.startsWith("@")).sort()), b = /* @__PURE__ */ new Map();
|
|
461
|
-
for (let [e, t] of d) for (let n of Object.values(t)) {
|
|
462
|
-
if (n.startsWith("@")) continue;
|
|
463
|
-
let t = b.get(n) ?? /* @__PURE__ */ new Set();
|
|
464
|
-
t.add(e), b.set(n, t);
|
|
465
|
-
}
|
|
466
|
-
let x = e.computations ?? {}, S = Object.keys(x), C = /* @__PURE__ */ new Map();
|
|
467
|
-
for (let [e, n] of Object.entries(x)) {
|
|
468
|
-
let r = ie(n.source, t);
|
|
469
|
-
r.expression && C.set(e, r.expression);
|
|
470
|
-
}
|
|
471
|
-
let { order: te, cyclic: ne } = y(x), w = {}, T = /* @__PURE__ */ new Map();
|
|
472
|
-
for (let e of te) {
|
|
473
|
-
let t = x[e];
|
|
474
|
-
if (!t || t.kind !== "const") continue;
|
|
475
|
-
if (Object.hasOwn(t, "value")) {
|
|
476
|
-
let n = t.value, r = c(n);
|
|
477
|
-
if (r) {
|
|
478
|
-
T.set(e, new a("expression-budget", `Constant "${e}": ${r}`, 0));
|
|
479
|
-
continue;
|
|
480
|
-
}
|
|
481
|
-
w[e] = B(n);
|
|
482
|
-
continue;
|
|
483
|
-
}
|
|
484
|
-
let n = C.get(e);
|
|
485
|
-
if (!n) T.set(e, new a("expression-eval", `Constant "${e}" cannot be evaluated.`, 0));
|
|
486
|
-
else try {
|
|
487
|
-
let t = n.evaluate({ ...w }), r = c(t);
|
|
488
|
-
if (r) {
|
|
489
|
-
T.set(e, new a("expression-budget", `Constant "${e}": ${r}`, 0));
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
w[e] = B(t);
|
|
493
|
-
} catch (t) {
|
|
494
|
-
T.set(e, R(t));
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
let E = /* @__PURE__ */ new Map();
|
|
498
|
-
for (let e of ne) E.set(e, new a("expression-cycle", `Computation "${e}" is part of a dependency cycle.`, 0));
|
|
499
|
-
let D = [];
|
|
500
|
-
if (Array.isArray(e.validations)) for (let n of e.validations) {
|
|
501
|
-
if (!u(n)) continue;
|
|
502
|
-
let e = ie(n.expression, t);
|
|
503
|
-
D.push({
|
|
504
|
-
rule: n,
|
|
505
|
-
expression: e.expression,
|
|
506
|
-
error: e.error
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
return {
|
|
510
|
-
document: e,
|
|
511
|
-
nodeIndex: n,
|
|
512
|
-
controls: l,
|
|
513
|
-
slotKeys: d,
|
|
514
|
-
publicNames: v,
|
|
515
|
-
publicSlotOwners: b,
|
|
516
|
-
initial: s,
|
|
517
|
-
valueRules: p,
|
|
518
|
-
legacyValueRules: ee,
|
|
519
|
-
slotRelations: m,
|
|
520
|
-
bindingByNode: _,
|
|
521
|
-
computationMetadata: x,
|
|
522
|
-
computationNames: S,
|
|
523
|
-
computationOrder: te,
|
|
524
|
-
cyclicComputations: ne,
|
|
525
|
-
computationExpressions: C,
|
|
526
|
-
constValues: w,
|
|
527
|
-
constErrors: T,
|
|
528
|
-
cycleErrors: E,
|
|
529
|
-
validationRules: D,
|
|
530
|
-
validationLineStarts: h(typeof e.source == "string" ? e.source : "")
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
function oe(e) {
|
|
534
|
-
return !e || e.syntax !== "local" ? "createLocalRuntime requires a local interaction document." : e.syntaxVersion !== void 0 && e.syntaxVersion !== "local-draft-3" || e.versionDeclaration && e.versionDeclaration.version !== "local-draft-3" ? `createLocalRuntime requires ${x}; migrate the source before constructing a runtime.` : null;
|
|
535
|
-
}
|
|
536
|
-
function G(e, t) {
|
|
537
|
-
return (e.controls.get(t.name) ?? [])[0] ?? (t.owner ? e.nodeIndex.get(t.owner) : void 0) ?? (t.nodeIds[0] ? e.nodeIndex.get(t.nodeIds[0]) : void 0);
|
|
538
|
-
}
|
|
539
|
-
function se(e, t, n) {
|
|
540
|
-
let i = G(e, t);
|
|
541
|
-
return i ? H(e.document, i, "local.runtime.value", n) : U("local.runtime.value", r(n));
|
|
542
|
-
}
|
|
543
|
-
function K(e, t, n) {
|
|
544
|
-
let r = e.slotRelations.get(t);
|
|
545
|
-
return r?.length ? r.some(({ lower: e, upper: t }) => {
|
|
546
|
-
let r = n[e], i = n[t];
|
|
547
|
-
return typeof r == "number" && typeof i == "number" && r > i;
|
|
548
|
-
}) : !1;
|
|
549
|
-
}
|
|
550
|
-
function ce(e, t) {
|
|
551
|
-
let i = e.nodeIndex.get(t);
|
|
552
|
-
return i ? H(e.document, i, "local.runtime.value", n("local.runtime.value.range-order")) : U("local.runtime.value", r(n("local.runtime.value.range-order")));
|
|
553
|
-
}
|
|
554
|
-
// src/local/runtime/retention.ts
|
|
555
|
-
function q(e) {
|
|
556
|
-
let t = /* @__PURE__ */ new Map();
|
|
557
|
-
for (let n of i(e.nodes)) t.set(n.id, n);
|
|
558
|
-
return t;
|
|
559
|
-
}
|
|
560
|
-
function le(e, t, n) {
|
|
561
|
-
let r = e.bindingSlots?.[t.id];
|
|
562
|
-
return r !== void 0 && Object.values(r).includes(n);
|
|
563
|
-
}
|
|
564
|
-
function J(e, t, n) {
|
|
565
|
-
let r = t.name ? C(t.name) : void 0;
|
|
566
|
-
if (r?.bindings) {
|
|
567
|
-
let i = e.bindingSlots?.[t.id];
|
|
568
|
-
for (let [e, a] of Object.entries(r.bindings)) if (t.attrs?.[a.bind] === n || e !== "value" && i?.[e] === n) return a.retain === !1 ? void 0 : a.initial;
|
|
569
|
-
} else if (t.attrs?.bind === n || le(e, t, n)) return "initial";
|
|
570
|
-
}
|
|
571
|
-
function Y(e) {
|
|
572
|
-
let t = q(e), n = g(e), r = new Set(n?.retentionExclusions ?? []), i = /* @__PURE__ */ new Map();
|
|
573
|
-
for (let [a, o] of Object.entries(e.bindings)) {
|
|
574
|
-
let s = o.nodeIds.flatMap((e) => {
|
|
575
|
-
let n = t.get(e);
|
|
576
|
-
return n ? [n] : [];
|
|
577
|
-
});
|
|
578
|
-
if (!s.length || a.startsWith("@") || r.has(a)) continue;
|
|
579
|
-
let c;
|
|
580
|
-
if (n === void 0) {
|
|
581
|
-
let t = s.map((t) => J(e, t, a));
|
|
582
|
-
if (t.some((e) => e === void 0)) continue;
|
|
583
|
-
c = t;
|
|
584
|
-
} else {
|
|
585
|
-
let e = n.bindingAttributes?.[a]?.initial ?? "initial";
|
|
586
|
-
c = s.map(() => e);
|
|
587
|
-
}
|
|
588
|
-
let l = s.flatMap((e, t) => Object.hasOwn(e.attrs ?? {}, c[t]) ? [e.attrs[c[t]]] : []).sort();
|
|
589
|
-
i.set(a, {
|
|
590
|
-
type: o.type,
|
|
591
|
-
initialDefinition: JSON.stringify([o.initial, l])
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
return i;
|
|
595
|
-
}
|
|
596
|
-
function X(e, t) {
|
|
597
|
-
return Object.freeze({
|
|
598
|
-
name: e,
|
|
599
|
-
reason: t
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
function Z(e) {
|
|
603
|
-
let t = Y(e.previous), n = Y(e.next), r = {}, i = [], a = [];
|
|
604
|
-
for (let o of Object.keys(e.state).sort()) {
|
|
605
|
-
if (o.startsWith("@")) {
|
|
606
|
-
a.push(X(o, "internal"));
|
|
607
|
-
continue;
|
|
608
|
-
}
|
|
609
|
-
if (!Object.hasOwn(e.previous.bindings, o) || !Object.hasOwn(e.next.bindings, o)) {
|
|
610
|
-
a.push(X(o, "unknown"));
|
|
611
|
-
continue;
|
|
612
|
-
}
|
|
613
|
-
let s = t.get(o), c = n.get(o);
|
|
614
|
-
if (!s || !c) {
|
|
615
|
-
a.push(X(o, "unretainable"));
|
|
616
|
-
continue;
|
|
617
|
-
}
|
|
618
|
-
if (s.type !== c.type) {
|
|
619
|
-
a.push(X(o, "type"));
|
|
620
|
-
continue;
|
|
621
|
-
}
|
|
622
|
-
if (s.initialDefinition !== c.initialDefinition) {
|
|
623
|
-
a.push(X(o, "initial"));
|
|
624
|
-
continue;
|
|
625
|
-
}
|
|
626
|
-
let l = e.state[o];
|
|
627
|
-
r[o] = Array.isArray(l) ? Object.freeze([...l]) : l, i.push(o);
|
|
628
|
-
}
|
|
629
|
-
return Object.freeze({
|
|
630
|
-
values: Object.freeze(r),
|
|
631
|
-
retained: Object.freeze(i),
|
|
632
|
-
dropped: Object.freeze(a)
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
function ue(e, t, n) {
|
|
636
|
-
return Object.freeze({
|
|
637
|
-
retained: Object.freeze([...e]),
|
|
638
|
-
dropped: Object.freeze(t.map((e) => Object.freeze({ ...e }))),
|
|
639
|
-
diagnostics: Object.freeze([...n])
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
function Q(e, t) {
|
|
643
|
-
let n = Object.keys(t.values).sort();
|
|
644
|
-
if (!e.setParameters(t.values).length) return ue(n, t.dropped, []);
|
|
645
|
-
let r = [], i = n, a = [];
|
|
646
|
-
for (; i.length;) {
|
|
647
|
-
let n = [];
|
|
648
|
-
a = [];
|
|
649
|
-
for (let o of i) {
|
|
650
|
-
let i = e.setParameter(o, t.values[o]);
|
|
651
|
-
i.length ? (n.push(o), a.push(...i)) : r.push(o);
|
|
652
|
-
}
|
|
653
|
-
if (n.length === i.length) break;
|
|
654
|
-
i = n;
|
|
655
|
-
}
|
|
656
|
-
r.sort();
|
|
657
|
-
let o = [...t.dropped, ...i.map((e) => X(e, "invalid"))];
|
|
658
|
-
return o.sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name)), ue(r, o, a);
|
|
659
|
-
}
|
|
660
|
-
// src/local/runtime/runtime-migration.ts
|
|
661
|
-
function de(e, t, n, r, i) {
|
|
662
|
-
let a = Z({
|
|
663
|
-
previous: e.document,
|
|
664
|
-
state: t,
|
|
665
|
-
next: n
|
|
666
|
-
}), o = {};
|
|
667
|
-
for (let [e, t] of Object.entries(n.bindings)) o[e] = B(t.initial);
|
|
668
|
-
let s = /* @__PURE__ */ new Map();
|
|
669
|
-
for (let e of a.dropped) s.set(e.name, Object.freeze({ ...e }));
|
|
670
|
-
let c = [], l = {}, u = [], d = /* @__PURE__ */ new Set(), f, p = (n) => {
|
|
671
|
-
let o = e.document.bindings[n], s = e.controls.get(n) ?? [];
|
|
672
|
-
return !o || !s.some((t) => e.document.dynamicConstraints?.[t.id]) || (f ??= i({}, e, t), L(o, s, a.values[n], f, e.valueRules, e.legacyValueRules).ok) ? !1 : W(e, n) === W(r, n);
|
|
673
|
-
};
|
|
674
|
-
for (let e of a.retained) {
|
|
675
|
-
let t = n.bindings[e];
|
|
676
|
-
if (!t) continue;
|
|
677
|
-
if (p(e)) {
|
|
678
|
-
d.add(e), l[e] = B(a.values[e]), u.push(e);
|
|
679
|
-
continue;
|
|
680
|
-
}
|
|
681
|
-
let f = L(t, r.controls.get(e) ?? [], a.values[e], i(a.values, r, o), r.valueRules, r.legacyValueRules);
|
|
682
|
-
f.ok ? (l[e] = B(f.value), u.push(e)) : (c.push(se(r, t, f.detail)), s.set(e, Object.freeze({
|
|
683
|
-
name: e,
|
|
684
|
-
reason: "invalid"
|
|
685
|
-
})));
|
|
686
|
-
}
|
|
687
|
-
let ee = {
|
|
688
|
-
...o,
|
|
689
|
-
...l
|
|
690
|
-
}, m = /* @__PURE__ */ new Set();
|
|
691
|
-
for (let e of u) for (let t of r.publicSlotOwners.get(e) ?? []) m.add(t);
|
|
692
|
-
let h = !1;
|
|
693
|
-
for (let e of [...m].sort()) if (K(r, e, ee)) {
|
|
694
|
-
h = !0;
|
|
695
|
-
break;
|
|
696
|
-
}
|
|
697
|
-
let g;
|
|
698
|
-
if (!h) Object.assign(o, l), g = u;
|
|
699
|
-
else {
|
|
700
|
-
g = [];
|
|
701
|
-
for (let e of u) {
|
|
702
|
-
let t = o[e];
|
|
703
|
-
o[e] = l[e];
|
|
704
|
-
let n = !1;
|
|
705
|
-
for (let t of [...r.publicSlotOwners.get(e) ?? []].sort()) K(r, t, o) && (c.push(ce(r, t)), n = !0);
|
|
706
|
-
n ? (o[e] = t, s.set(e, Object.freeze({
|
|
707
|
-
name: e,
|
|
708
|
-
reason: "invalid"
|
|
709
|
-
}))) : g.push(e);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
for (let [e, t] of r.slotRelations) if (K(r, e, o)) {
|
|
713
|
-
for (let e of t) for (let t of [e.lower, e.upper]) {
|
|
714
|
-
let e = n.bindings[t];
|
|
715
|
-
if (!e) continue;
|
|
716
|
-
o[t] = B(e.initial);
|
|
717
|
-
let r = g.indexOf(t);
|
|
718
|
-
r >= 0 && g.splice(r, 1), s.set(t, Object.freeze({
|
|
719
|
-
name: t,
|
|
720
|
-
reason: "invalid"
|
|
721
|
-
}));
|
|
722
|
-
}
|
|
723
|
-
if (c.push(ce(r, e)), K(r, e, o)) return {
|
|
724
|
-
values: {},
|
|
725
|
-
retained: [],
|
|
726
|
-
dropped: [],
|
|
727
|
-
diagnostics: []
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
let _ = !0;
|
|
731
|
-
for (; _;) {
|
|
732
|
-
let e = i({}, r, o), t = [];
|
|
733
|
-
for (let i of g) {
|
|
734
|
-
if (d.has(i)) continue;
|
|
735
|
-
let a = n.bindings[i], s = L(a, r.controls.get(i) ?? [], o[i], e, r.valueRules, r.legacyValueRules);
|
|
736
|
-
s.ok || (c.push(se(r, a, s.detail)), t.push(i));
|
|
737
|
-
}
|
|
738
|
-
for (let e of t) o[e] = B(n.bindings[e].initial), g.splice(g.indexOf(e), 1), s.set(e, Object.freeze({
|
|
739
|
-
name: e,
|
|
740
|
-
reason: "invalid"
|
|
741
|
-
}));
|
|
742
|
-
_ = t.length > 0;
|
|
743
|
-
}
|
|
744
|
-
let v = [...s.values()].sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name));
|
|
745
|
-
return g.sort(), {
|
|
746
|
-
values: o,
|
|
747
|
-
retained: g,
|
|
748
|
-
dropped: v,
|
|
749
|
-
diagnostics: c
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
// src/local/runtime/runtime.ts
|
|
753
|
-
function fe(e) {
|
|
754
|
-
return {
|
|
755
|
-
...e,
|
|
756
|
-
range: { ...e.range }
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
function pe(e, t) {
|
|
760
|
-
return Array.isArray(e) || Array.isArray(t) ? !Array.isArray(e) || !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => e === t[n]) : e === t;
|
|
761
|
-
}
|
|
762
|
-
function me(e) {
|
|
763
|
-
for (let [t, n] of Object.entries(e)) Array.isArray(n) && !Object.isFrozen(n) && (e[t] = Object.freeze([...n]));
|
|
764
|
-
return Object.freeze(e);
|
|
765
|
-
}
|
|
766
|
-
var he = /* @__PURE__ */ new WeakMap();
|
|
767
|
-
function $(e) {
|
|
768
|
-
return Object.freeze({
|
|
769
|
-
ok: e.ok,
|
|
770
|
-
changed: e.changed,
|
|
771
|
-
revision: e.revision,
|
|
772
|
-
retained: Object.freeze([...e.retained]),
|
|
773
|
-
dropped: Object.freeze(e.dropped.map((e) => Object.freeze({ ...e }))),
|
|
774
|
-
diagnostics: Object.freeze([...e.diagnostics])
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
function ge(e, t, n) {
|
|
778
|
-
let r = he.get(e);
|
|
779
|
-
if (!r) throw TypeError("updateLocalRuntime requires a runtime created by createLocalRuntime.");
|
|
780
|
-
return r.update(t, n?.notify !== !1);
|
|
781
|
-
}
|
|
782
|
-
function _e(e) {
|
|
783
|
-
he.get(e)?.notify();
|
|
784
|
-
}
|
|
785
|
-
function ve(e, t, n) {
|
|
786
|
-
return he.get(e)?.bindNetworkExternals(t, n) ?? (() => {});
|
|
787
|
-
}
|
|
788
|
-
function ye(e, t) {
|
|
789
|
-
let c = oe(e);
|
|
790
|
-
if (c) throw Error(c);
|
|
791
|
-
let u = t?.services === void 0, f = te(t?.network), h = /* @__PURE__ */ new Map(), g = ne(e.source), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), S = ae(e, x), C = () => S, E = () => {
|
|
792
|
-
let e = /* @__PURE__ */ new Set();
|
|
793
|
-
for (let n of i(S.document.nodes)) n.name !== void 0 && e.add(w({
|
|
794
|
-
documentId: t?.documentId,
|
|
795
|
-
sourceDigest: g,
|
|
796
|
-
nodeId: n.id,
|
|
797
|
-
stateKey: n.attrs?.["state-key"]
|
|
798
|
-
}));
|
|
799
|
-
return e;
|
|
800
|
-
}, D = t?.services ?? T({
|
|
801
|
-
documentId: t?.documentId,
|
|
802
|
-
sourceDigest: g,
|
|
803
|
-
randomSeed: t?.randomSeed,
|
|
804
|
-
componentState: t?.componentState,
|
|
805
|
-
...t?.componentStateStorage === void 0 ? {} : { componentStateStorage: t.componentStateStorage },
|
|
806
|
-
...t?.componentStateWriteDelayMs === void 0 ? {} : { componentStateWriteDelayMs: t.componentStateWriteDelayMs },
|
|
807
|
-
...t?.configKey === void 0 ? {} : { configKey: t.configKey },
|
|
808
|
-
...t?.legacyConfigKeys === void 0 ? {} : { legacyConfigKeys: t.legacyConfigKeys },
|
|
809
|
-
...u ? { knownStateKeys: E } : {}
|
|
810
|
-
}), O = {}, k = /* @__PURE__ */ new Map();
|
|
811
|
-
for (let [n, r] of Object.entries(e.externals ?? {})) {
|
|
812
|
-
let e = t?.externalValues?.[n];
|
|
813
|
-
if (e === void 0) continue;
|
|
814
|
-
let i = re(r.type, e);
|
|
815
|
-
i.ok && (O[n] = i.value);
|
|
816
|
-
}
|
|
817
|
-
let A = (e, t) => {
|
|
818
|
-
let n = {};
|
|
819
|
-
for (let [r, i] of Object.entries(e.document.externals ?? {})) {
|
|
820
|
-
if (!Object.hasOwn(t, r)) continue;
|
|
821
|
-
let e = re(i.type, t[r]);
|
|
822
|
-
e.ok && (n[r] = e.value);
|
|
823
|
-
}
|
|
824
|
-
return n;
|
|
825
|
-
}, j = (e) => {
|
|
826
|
-
let t = A(e, O);
|
|
827
|
-
for (let n of k.keys()) Object.assign(t, A(e, n));
|
|
828
|
-
return t;
|
|
829
|
-
}, M = (e, t, n, r = C()) => {
|
|
830
|
-
let i = r.document.dynamicConstraints?.[e.id]?.[t];
|
|
831
|
-
if (!i) return { present: !1 };
|
|
832
|
-
let a = ie(i.source, x);
|
|
833
|
-
if (!a.expression) return {
|
|
834
|
-
present: !0,
|
|
835
|
-
ok: !1
|
|
836
|
-
};
|
|
837
|
-
try {
|
|
838
|
-
let e = a.expression.evaluate(n), t = i.numeric;
|
|
839
|
-
return t && (typeof e != "number" || !Number.isFinite(e) || t.integer === !0 && !Number.isInteger(e) || t.min !== void 0 && e < t.min || t.max !== void 0 && e > t.max) ? {
|
|
840
|
-
present: !0,
|
|
841
|
-
ok: !1
|
|
842
|
-
} : {
|
|
843
|
-
present: !0,
|
|
844
|
-
ok: !0,
|
|
845
|
-
value: e
|
|
846
|
-
};
|
|
847
|
-
} catch {
|
|
848
|
-
return {
|
|
849
|
-
present: !0,
|
|
850
|
-
ok: !1
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
}, N = S.initial, P = 0, F = {}, I = {}, R = {
|
|
854
|
-
revision: 0,
|
|
855
|
-
state: me({})
|
|
856
|
-
}, z = !1, V = null, W = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Map(), q = () => {
|
|
857
|
-
if (z) throw Error("The local interaction runtime has been disposed.");
|
|
858
|
-
};
|
|
859
|
-
function le(e, t) {
|
|
860
|
-
if (!t.startsWith("@") && Object.hasOwn(e.document.bindings, t)) return Object.hasOwn(N, t) ? N[t] : void 0;
|
|
861
|
-
}
|
|
862
|
-
let J = (e, t) => {
|
|
863
|
-
let n = j(e), r = /* @__PURE__ */ new Map();
|
|
864
|
-
for (let t of Object.keys(e.document.externals ?? {})) Object.hasOwn(n, t) || r.set(t, new a("external-missing", "External data \"" + t + "\" is not available.", 0));
|
|
865
|
-
let i = {}, o = /* @__PURE__ */ new Map();
|
|
866
|
-
if (e.computationNames.length > 0) {
|
|
867
|
-
let a = ee(e.computationMetadata, e.computationOrder, e.computationExpressions, {
|
|
868
|
-
...t,
|
|
869
|
-
...n
|
|
870
|
-
}, e.constValues, r);
|
|
871
|
-
i = a.values, o = a.errors;
|
|
872
|
-
for (let [t, n] of e.constErrors) Object.hasOwn(i, t) || o.set(t, n);
|
|
873
|
-
for (let [t, n] of e.cycleErrors) Object.hasOwn(i, t) || o.set(t, n);
|
|
874
|
-
}
|
|
875
|
-
let s = {};
|
|
876
|
-
for (let [e, n] of Object.entries(t)) s[e] = n;
|
|
877
|
-
for (let [e, t] of Object.entries(n)) s[e] = t;
|
|
878
|
-
for (let [e, t] of Object.entries(i)) s[e] = t;
|
|
879
|
-
for (let [e, t] of [...r, ...o]) Object.hasOwn(i, e) || Object.defineProperty(s, e, {
|
|
880
|
-
enumerable: !0,
|
|
881
|
-
configurable: !0,
|
|
882
|
-
get() {
|
|
883
|
-
throw t;
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
let c = {};
|
|
887
|
-
for (let [e, n] of Object.entries(t)) c[e] = n;
|
|
888
|
-
for (let [e, t] of Object.entries(n)) c[e] = t;
|
|
889
|
-
for (let [e, t] of Object.entries(i)) c[e] = t;
|
|
890
|
-
return {
|
|
891
|
-
environment: s,
|
|
892
|
-
snapshotState: c
|
|
893
|
-
};
|
|
894
|
-
}, Y = () => {
|
|
895
|
-
let e = J(C(), N);
|
|
896
|
-
F = e.environment, I = e.snapshotState;
|
|
897
|
-
}, X = (e, t = C(), n = N) => {
|
|
898
|
-
let r;
|
|
899
|
-
return (i, a) => t.document.dynamicConstraints?.[i.id]?.[a] ? (r ??= J(t, {
|
|
900
|
-
...n,
|
|
901
|
-
...e
|
|
902
|
-
}).environment, M(i, a, r, t)) : { present: !1 };
|
|
903
|
-
}, Z = () => {
|
|
904
|
-
R = {
|
|
905
|
-
revision: P,
|
|
906
|
-
state: me(I)
|
|
907
|
-
};
|
|
908
|
-
}, ue = () => {
|
|
909
|
-
for (let e of W) e();
|
|
910
|
-
}, Q = (e) => {
|
|
911
|
-
N = e, P += 1, Y(), Z(), ue();
|
|
912
|
-
}, ge = () => {
|
|
913
|
-
P += 1, Y(), Z(), ue();
|
|
914
|
-
}, _e = (e, t = O) => {
|
|
915
|
-
if (q(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setExternalValues requires an object of external values.");
|
|
916
|
-
let i = [], a = {}, o = Object.keys(e).sort();
|
|
917
|
-
for (let t of o) {
|
|
918
|
-
if (t === "__proto__") {
|
|
919
|
-
i.push(U("local.runtime.external", "External names cannot be \"__proto__\"."));
|
|
920
|
-
continue;
|
|
921
|
-
}
|
|
922
|
-
let o = C().document.externals ?? {}, s = Object.hasOwn(o, t) ? o[t] : void 0;
|
|
923
|
-
if (!s) {
|
|
924
|
-
let e = n("local.runtime.external", { name: t });
|
|
925
|
-
i.push(U("local.runtime.external", r(e), e));
|
|
926
|
-
continue;
|
|
927
|
-
}
|
|
928
|
-
let c = re(s.type, e[t]);
|
|
929
|
-
if (c.ok) a[t] = c.value;
|
|
930
|
-
else {
|
|
931
|
-
let e = n(c.key, {
|
|
932
|
-
name: t,
|
|
933
|
-
...c.params ?? {}
|
|
934
|
-
});
|
|
935
|
-
i.push(U("local.runtime.external", r(e), e));
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
return i.length ? i : (o.some((e) => !pe(t[e], a[e])) && (Object.assign(t, a), ge()), []);
|
|
939
|
-
}, ve = (e, t) => {
|
|
940
|
-
if (z) return () => {};
|
|
941
|
-
let n = {}, r = e.bindExternalValues((e) => {
|
|
942
|
-
if (z || !k.has(n)) return;
|
|
943
|
-
let r = _e(e, n);
|
|
944
|
-
r.length && t?.(r);
|
|
945
|
-
});
|
|
946
|
-
return r ? (k.set(n, r), () => {
|
|
947
|
-
k.delete(n) && (r(), !z && Object.keys(n).length && ge());
|
|
948
|
-
}) : () => {};
|
|
949
|
-
}, ye = (e) => {
|
|
950
|
-
q();
|
|
951
|
-
let t = C(), n = [], r = {}, i = Object.keys(e).sort(), a = X(e);
|
|
952
|
-
for (let o of i) {
|
|
953
|
-
if (o === "__proto__") {
|
|
954
|
-
n.push(U("local.runtime.parameter", "Parameter names cannot be \"__proto__\"."));
|
|
955
|
-
continue;
|
|
956
|
-
}
|
|
957
|
-
if (o.startsWith("@")) {
|
|
958
|
-
n.push(U("local.runtime.parameter", `Internal parameter "${o}" cannot be written by name.`));
|
|
959
|
-
continue;
|
|
960
|
-
}
|
|
961
|
-
if (!Object.hasOwn(t.document.bindings, o)) {
|
|
962
|
-
n.push(U("local.runtime.parameter", `Unknown parameter "${o}".`));
|
|
963
|
-
continue;
|
|
964
|
-
}
|
|
965
|
-
let i = t.document.bindings[o], s = L(i, t.controls.get(o) ?? [], e[o], a, t.valueRules, t.legacyValueRules);
|
|
966
|
-
s.ok ? r[o] = B(s.value) : n.push(se(t, i, s.detail));
|
|
967
|
-
}
|
|
968
|
-
if (n.length) return n;
|
|
969
|
-
if (!i.some((e) => !pe(N[e], r[e]))) return [];
|
|
970
|
-
let o = {
|
|
971
|
-
...N,
|
|
972
|
-
...r
|
|
973
|
-
}, s = /* @__PURE__ */ new Set();
|
|
974
|
-
for (let e of i) for (let n of t.publicSlotOwners.get(e) ?? []) s.add(n);
|
|
975
|
-
for (let e of [...s].sort()) K(t, e, o) && n.push(ce(t, e));
|
|
976
|
-
return n.length ? n : (Q(o), []);
|
|
977
|
-
}, be = (e) => {
|
|
978
|
-
let t = y.get(e);
|
|
979
|
-
if (!t) {
|
|
980
|
-
if (t = l(e), y.size >= 200) {
|
|
981
|
-
let e = y.keys().next().value;
|
|
982
|
-
e !== void 0 && y.delete(e);
|
|
983
|
-
}
|
|
984
|
-
y.set(e, t);
|
|
985
|
-
}
|
|
986
|
-
return t;
|
|
987
|
-
}, xe = () => {
|
|
988
|
-
let e = C(), t = [], n = typeof e.document.source == "string" ? e.document.source : "";
|
|
989
|
-
for (let r of e.validationRules) {
|
|
990
|
-
if (r.error) {
|
|
991
|
-
t.push(d(n, e.validationLineStarts, r.rule.range, v, p(`Validation expression is invalid: ${r.error.message}`)));
|
|
992
|
-
continue;
|
|
993
|
-
}
|
|
994
|
-
if (!r.expression) continue;
|
|
995
|
-
let i;
|
|
996
|
-
try {
|
|
997
|
-
i = r.expression.evaluate(F);
|
|
998
|
-
} catch (i) {
|
|
999
|
-
t.push(d(n, e.validationLineStarts, r.rule.range, v, p(`Validation expression failed: ${i instanceof Error ? i.message : String(i)}`)));
|
|
1000
|
-
continue;
|
|
1001
|
-
}
|
|
1002
|
-
typeof i == "boolean" ? i || t.push(d(n, e.validationLineStarts, r.rule.range, m, Se(r.rule.message))) : t.push(d(n, e.validationLineStarts, r.rule.range, v, "Validation expression must evaluate to a boolean."));
|
|
1003
|
-
}
|
|
1004
|
-
return t;
|
|
1005
|
-
}, Se = (e) => {
|
|
1006
|
-
let t;
|
|
1007
|
-
try {
|
|
1008
|
-
t = s(e, F);
|
|
1009
|
-
} catch {
|
|
1010
|
-
t = _;
|
|
1011
|
-
}
|
|
1012
|
-
return p(t);
|
|
1013
|
-
}, Ce = (e, t) => {
|
|
1014
|
-
if (q(), e === S.document) return $({
|
|
1015
|
-
ok: !0,
|
|
1016
|
-
changed: !1,
|
|
1017
|
-
revision: P,
|
|
1018
|
-
retained: [],
|
|
1019
|
-
dropped: [],
|
|
1020
|
-
diagnostics: []
|
|
1021
|
-
});
|
|
1022
|
-
if (oe(e)) return $({
|
|
1023
|
-
ok: !1,
|
|
1024
|
-
changed: !1,
|
|
1025
|
-
revision: P,
|
|
1026
|
-
retained: [],
|
|
1027
|
-
dropped: [],
|
|
1028
|
-
diagnostics: []
|
|
1029
|
-
});
|
|
1030
|
-
let n;
|
|
1031
|
-
try {
|
|
1032
|
-
n = ae(e, x);
|
|
1033
|
-
} catch {
|
|
1034
|
-
return $({
|
|
1035
|
-
ok: !1,
|
|
1036
|
-
changed: !1,
|
|
1037
|
-
revision: P,
|
|
1038
|
-
retained: [],
|
|
1039
|
-
dropped: [],
|
|
1040
|
-
diagnostics: []
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
let r = de(S, N, e, n, X);
|
|
1044
|
-
if (Object.keys(r.values).length === 0 && Object.keys(e.bindings).length > 0) return $({
|
|
1045
|
-
ok: !1,
|
|
1046
|
-
changed: !1,
|
|
1047
|
-
revision: P,
|
|
1048
|
-
retained: [],
|
|
1049
|
-
dropped: [],
|
|
1050
|
-
diagnostics: []
|
|
1051
|
-
});
|
|
1052
|
-
let i;
|
|
1053
|
-
try {
|
|
1054
|
-
i = J(n, r.values);
|
|
1055
|
-
} catch {
|
|
1056
|
-
return $({
|
|
1057
|
-
ok: !1,
|
|
1058
|
-
changed: !1,
|
|
1059
|
-
revision: P,
|
|
1060
|
-
retained: [],
|
|
1061
|
-
dropped: [],
|
|
1062
|
-
diagnostics: []
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
for (let e of [O, ...k.keys()]) {
|
|
1066
|
-
let t = A(n, e);
|
|
1067
|
-
for (let t of Object.keys(e)) delete e[t];
|
|
1068
|
-
Object.assign(e, t);
|
|
1069
|
-
}
|
|
1070
|
-
if (S = n, N = r.values, F = i.environment, I = i.snapshotState, V = null, P += 1, Z(), t) for (let e of W) e();
|
|
1071
|
-
return $({
|
|
1072
|
-
ok: !0,
|
|
1073
|
-
changed: !0,
|
|
1074
|
-
revision: P,
|
|
1075
|
-
retained: r.retained,
|
|
1076
|
-
dropped: r.dropped,
|
|
1077
|
-
diagnostics: r.diagnostics
|
|
1078
|
-
});
|
|
1079
|
-
}, we = (e) => {
|
|
1080
|
-
let t = /* @__PURE__ */ new Set();
|
|
1081
|
-
for (let n of i([e])) t.add(n.id);
|
|
1082
|
-
return t;
|
|
1083
|
-
}, Te = {
|
|
1084
|
-
network: f.network,
|
|
1085
|
-
get document() {
|
|
1086
|
-
return S.document;
|
|
1087
|
-
},
|
|
1088
|
-
services: D,
|
|
1089
|
-
snapshot() {
|
|
1090
|
-
return q(), R;
|
|
1091
|
-
},
|
|
1092
|
-
get(e, t) {
|
|
1093
|
-
q();
|
|
1094
|
-
let n = C(), r = n.nodeIndex.get(e.id);
|
|
1095
|
-
if (!r) return null;
|
|
1096
|
-
let i = t === void 0 ? n.slotKeys.get(r.id)?.value ?? n.bindingByNode.get(r.id) ?? b(r) : n.slotKeys.get(r.id)?.[t];
|
|
1097
|
-
return i && Object.hasOwn(N, i) ? B(N[i]) : null;
|
|
1098
|
-
},
|
|
1099
|
-
set(e, t, r) {
|
|
1100
|
-
q();
|
|
1101
|
-
let i = C(), a = i.nodeIndex.get(e.id);
|
|
1102
|
-
if (!a) return [H(i.document, e, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
|
|
1103
|
-
let o = i.slotKeys.get(a.id), s;
|
|
1104
|
-
if (r === void 0) {
|
|
1105
|
-
if (o && !o.value) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.needs-slot"))];
|
|
1106
|
-
s = o?.value ?? i.bindingByNode.get(a.id) ?? b(a);
|
|
1107
|
-
} else if (s = o?.[r], !s) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.unknown-slot", { slot: r }))];
|
|
1108
|
-
let c = Object.hasOwn(i.document.bindings, s) ? i.document.bindings[s] : void 0;
|
|
1109
|
-
if (!c) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
|
|
1110
|
-
let l = L(c, i.controls.get(s) ?? [], t, X({ [s]: t }), i.valueRules, i.legacyValueRules);
|
|
1111
|
-
if (!l.ok) return [H(i.document, a, "local.runtime.value", l.detail)];
|
|
1112
|
-
let u = B(l.value);
|
|
1113
|
-
if (pe(N[s], u)) return [];
|
|
1114
|
-
let d = {
|
|
1115
|
-
...N,
|
|
1116
|
-
[s]: u
|
|
1117
|
-
};
|
|
1118
|
-
return K(i, a.id, d) ? [H(i.document, a, "local.runtime.value", n("local.runtime.value.range-order"))] : (Q(d), []);
|
|
1119
|
-
},
|
|
1120
|
-
setMany(e, t) {
|
|
1121
|
-
q();
|
|
1122
|
-
let r = C(), i = r.nodeIndex.get(e.id);
|
|
1123
|
-
if (!i) return [H(r.document, e, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
|
|
1124
|
-
let a = r.slotKeys.get(i.id);
|
|
1125
|
-
if (!a) return [H(r.document, i, "local.runtime.binding", n("local.runtime.binding.no-multi-slot"))];
|
|
1126
|
-
let o = Object.entries(t);
|
|
1127
|
-
if (!o.length) return [];
|
|
1128
|
-
let s = { ...N }, c = J(r, {
|
|
1129
|
-
...N,
|
|
1130
|
-
...Object.fromEntries(o.map(([e, t]) => [a[e], t]))
|
|
1131
|
-
}).environment;
|
|
1132
|
-
for (let [e, t] of o) {
|
|
1133
|
-
let o = a[e];
|
|
1134
|
-
if (!o || !Object.hasOwn(r.document.bindings, o)) return [H(r.document, i, "local.runtime.binding", n("local.runtime.binding.unknown-slot", { slot: e }))];
|
|
1135
|
-
let l = L(r.document.bindings[o], r.controls.get(o) ?? [], t, (e, t) => M(e, t, c), r.valueRules, r.legacyValueRules);
|
|
1136
|
-
if (!l.ok) return [H(r.document, i, "local.runtime.value", l.detail)];
|
|
1137
|
-
s[o] = B(l.value);
|
|
1138
|
-
}
|
|
1139
|
-
return K(r, i.id, s) ? [H(r.document, i, "local.runtime.value", n("local.runtime.value.range-order"))] : (o.every(([e, t]) => pe(N[a[e]], t)) || Q(s), []);
|
|
1140
|
-
},
|
|
1141
|
-
parameterNames() {
|
|
1142
|
-
return q(), C().publicNames;
|
|
1143
|
-
},
|
|
1144
|
-
getParameter(e) {
|
|
1145
|
-
q();
|
|
1146
|
-
let t = le(C(), e);
|
|
1147
|
-
return t === void 0 ? void 0 : B(t);
|
|
1148
|
-
},
|
|
1149
|
-
getParameters() {
|
|
1150
|
-
q();
|
|
1151
|
-
let e = C(), t = {};
|
|
1152
|
-
for (let n of e.publicNames) {
|
|
1153
|
-
let e = N[n];
|
|
1154
|
-
t[n] = Array.isArray(e) ? Object.freeze([...e]) : e;
|
|
1155
|
-
}
|
|
1156
|
-
return Object.freeze(t);
|
|
1157
|
-
},
|
|
1158
|
-
readSubmissionFields(e) {
|
|
1159
|
-
q();
|
|
1160
|
-
let t = C(), n = /* @__PURE__ */ new Map(), r = (e, n) => M(e, n, F, t);
|
|
1161
|
-
if (e.length === 0) return {
|
|
1162
|
-
ok: !1,
|
|
1163
|
-
field: "",
|
|
1164
|
-
reason: "unavailable"
|
|
1165
|
-
};
|
|
1166
|
-
for (let i of e) {
|
|
1167
|
-
let e = le(t, i);
|
|
1168
|
-
if (e === void 0 || n.has(i)) return {
|
|
1169
|
-
ok: !1,
|
|
1170
|
-
field: i,
|
|
1171
|
-
reason: "unavailable"
|
|
1172
|
-
};
|
|
1173
|
-
let a = L(t.document.bindings[i], t.controls.get(i) ?? [], e, r, t.valueRules, t.legacyValueRules);
|
|
1174
|
-
if (!a.ok) {
|
|
1175
|
-
let e = a.detail.key;
|
|
1176
|
-
return {
|
|
1177
|
-
ok: !1,
|
|
1178
|
-
field: i,
|
|
1179
|
-
reason: e === "local.runtime.value.field-required" || e === "local.runtime.value.date-required" ? "required" : "invalid"
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
n.set(i, e);
|
|
1183
|
-
}
|
|
1184
|
-
let i = Object.create(null);
|
|
1185
|
-
for (let [e, r] of n) {
|
|
1186
|
-
for (let [n, i] of h.get(e) ?? []) {
|
|
1187
|
-
if (!t.controls.get(e)?.some((e) => e.id === i)) continue;
|
|
1188
|
-
let a = n(B(r));
|
|
1189
|
-
if (a) return {
|
|
1190
|
-
ok: !1,
|
|
1191
|
-
field: e,
|
|
1192
|
-
reason: a
|
|
1193
|
-
};
|
|
1194
|
-
}
|
|
1195
|
-
i[e] = Array.isArray(r) ? Object.freeze([...r]) : r;
|
|
1196
|
-
}
|
|
1197
|
-
return {
|
|
1198
|
-
ok: !0,
|
|
1199
|
-
payload: Object.freeze(i)
|
|
1200
|
-
};
|
|
1201
|
-
},
|
|
1202
|
-
registerSubmissionField(e, t) {
|
|
1203
|
-
if (z) return () => {};
|
|
1204
|
-
let n = C(), r = n.slotKeys.get(e.id)?.value ?? n.bindingByNode.get(e.id);
|
|
1205
|
-
if (!r || r.startsWith("@")) return () => {};
|
|
1206
|
-
let i = h.get(r);
|
|
1207
|
-
return i || h.set(r, i = /* @__PURE__ */ new Map()), i.set(t, e.id), () => {
|
|
1208
|
-
i.delete(t), i.size === 0 && h.get(r) === i && h.delete(r);
|
|
1209
|
-
};
|
|
1210
|
-
},
|
|
1211
|
-
setParameter(e, t) {
|
|
1212
|
-
q();
|
|
1213
|
-
let n = Object.create(null);
|
|
1214
|
-
return n[e] = t, ye(n);
|
|
1215
|
-
},
|
|
1216
|
-
setParameters(e) {
|
|
1217
|
-
if (q(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setParameters requires an object of parameter values.");
|
|
1218
|
-
return ye(e);
|
|
1219
|
-
},
|
|
1220
|
-
getExternal(e) {
|
|
1221
|
-
if (q(), Object.hasOwn(C().document.externals ?? {}, e) && Object.hasOwn(I, e)) return B(I[e]);
|
|
1222
|
-
},
|
|
1223
|
-
getExternalValues() {
|
|
1224
|
-
q();
|
|
1225
|
-
let e = {};
|
|
1226
|
-
for (let [t, n] of Object.entries(j(C()))) e[t] = Array.isArray(n) ? Object.freeze([...n]) : n;
|
|
1227
|
-
return Object.freeze(e);
|
|
1228
|
-
},
|
|
1229
|
-
setExternalValues(e) {
|
|
1230
|
-
return _e(e);
|
|
1231
|
-
},
|
|
1232
|
-
evaluate(e) {
|
|
1233
|
-
q();
|
|
1234
|
-
let t = be(e).evaluate(F);
|
|
1235
|
-
return Array.isArray(t) ? t.slice() : t;
|
|
1236
|
-
},
|
|
1237
|
-
validate() {
|
|
1238
|
-
if (q(), V && V.revision === P) return V.diagnostics.map(fe);
|
|
1239
|
-
let e = xe();
|
|
1240
|
-
return V = {
|
|
1241
|
-
revision: P,
|
|
1242
|
-
diagnostics: e
|
|
1243
|
-
}, e.map(fe);
|
|
1244
|
-
},
|
|
1245
|
-
text(e) {
|
|
1246
|
-
return q(), s(e, F);
|
|
1247
|
-
},
|
|
1248
|
-
reset(e) {
|
|
1249
|
-
q();
|
|
1250
|
-
let t = C(), n = t.nodeIndex.get(e.id);
|
|
1251
|
-
if (!n) return;
|
|
1252
|
-
let i = we(n), s = { ...N };
|
|
1253
|
-
for (let [e, n] of Object.entries(t.document.bindings)) {
|
|
1254
|
-
if (!(t.controls.get(e) ?? []).some((e) => i.has(e.id))) continue;
|
|
1255
|
-
let c = o(n.initial);
|
|
1256
|
-
if (c) throw new a("expression-budget", `Parameter "${e}": ${r(c)}`, 0);
|
|
1257
|
-
s[e] = B(n.initial);
|
|
1258
|
-
}
|
|
1259
|
-
for (let e of i) G.set(e, (G.get(e) ?? 0) + 1);
|
|
1260
|
-
Q(s);
|
|
1261
|
-
},
|
|
1262
|
-
resetToken(e) {
|
|
1263
|
-
q();
|
|
1264
|
-
let t = C().nodeIndex.get(e.id);
|
|
1265
|
-
return t ? G.get(t.id) ?? 0 : 0;
|
|
1266
|
-
},
|
|
1267
|
-
subscribe(e) {
|
|
1268
|
-
return q(), W.add(e), () => {
|
|
1269
|
-
W.delete(e);
|
|
1270
|
-
};
|
|
1271
|
-
},
|
|
1272
|
-
dispose() {
|
|
1273
|
-
if (!z) {
|
|
1274
|
-
z = !0, f.dispose();
|
|
1275
|
-
for (let e of k.values()) e();
|
|
1276
|
-
k.clear(), h.clear(), D.state.flush(), u && D.scheduler.dispose(), W.clear(), y.clear(), x.clear(), S.computationExpressions.clear(), S.constErrors.clear(), S.cycleErrors.clear(), S.validationRules.length = 0, G.clear();
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
};
|
|
1280
|
-
return he.set(Te, {
|
|
1281
|
-
update: Ce,
|
|
1282
|
-
bindNetworkExternals: ve,
|
|
1283
|
-
notify() {
|
|
1284
|
-
if (!z) for (let e of W) e();
|
|
1285
|
-
}
|
|
1286
|
-
}), Y(), Z(), ve(f), Te;
|
|
1287
|
-
}
|
|
1288
|
-
export { Q as a, ge as i, ye as n, Z as o, _e as r, ve as t };
|