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,8 +1,9 @@
|
|
|
1
|
+
import { builtinModules } from "node:module";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import { readFile, realpath, stat } from "node:fs/promises";
|
|
3
4
|
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
4
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
-
// src/
|
|
6
|
+
// src/contracts/limits.ts
|
|
6
7
|
/** Number of elements in one array value or selection. */
|
|
7
8
|
var MAX_LOCAL_ARRAY_LENGTH = 1e4;
|
|
8
9
|
/** Curve sample points requested across one document compilation. */
|
|
@@ -10,6 +11,37 @@ var MAX_LOCAL_PLOT_POINTS = 2e4;
|
|
|
10
11
|
var MAX_LOCAL_DATA_TABLE_ROWS = 1e3;
|
|
11
12
|
var MAX_LOCAL_DATA_DOCUMENT_ROWS = 2e3;
|
|
12
13
|
var MAX_LOCAL_DATA_DOCUMENT_CELLS = 1e4;
|
|
14
|
+
// src/contracts/font-aliases.ts
|
|
15
|
+
var LOCAL_TEXT_FONT_CHOICES = [
|
|
16
|
+
"sans",
|
|
17
|
+
"serif",
|
|
18
|
+
"mono"
|
|
19
|
+
];
|
|
20
|
+
var RESERVED = /* @__PURE__ */ new Set([
|
|
21
|
+
...LOCAL_TEXT_FONT_CHOICES,
|
|
22
|
+
"constructor",
|
|
23
|
+
"prototype"
|
|
24
|
+
]);
|
|
25
|
+
var ALIAS = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
26
|
+
var FAMILY = /^[\p{L}\p{N}][\p{L}\p{M}\p{N} ._-]*$/u;
|
|
27
|
+
Object.freeze({});
|
|
28
|
+
var MAX_ALIASES = 64;
|
|
29
|
+
/** Validate metadata without reading a stylesheet or loading any font. */
|
|
30
|
+
function readLocalFontAliases(value, path) {
|
|
31
|
+
if (value === void 0) return void 0;
|
|
32
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new TypeError(`${path} must map font aliases to family names.`);
|
|
33
|
+
const aliases = Object.keys(value).sort();
|
|
34
|
+
if (aliases.length > MAX_ALIASES) throw new TypeError(`${path} accepts at most ${MAX_ALIASES} aliases.`);
|
|
35
|
+
if (!aliases.length) return void 0;
|
|
36
|
+
const record = value;
|
|
37
|
+
const entries = aliases.map((alias) => {
|
|
38
|
+
if (alias.length > 64 || alias.trim() !== alias || !ALIAS.test(alias) || RESERVED.has(alias)) throw new TypeError(`${path} has an invalid or reserved font alias "${alias}".`);
|
|
39
|
+
const family = record[alias];
|
|
40
|
+
if (typeof family !== "string" || family.length > 600 || family.trim() !== family || !FAMILY.test(family)) throw new TypeError(`${path}.${alias} must be a single font family name.`);
|
|
41
|
+
return [alias, family];
|
|
42
|
+
});
|
|
43
|
+
return Object.freeze(Object.fromEntries(entries));
|
|
44
|
+
}
|
|
13
45
|
var LOCAL_KERNEL_DECLARATIONS = Object.freeze([
|
|
14
46
|
Object.freeze({
|
|
15
47
|
name: "computed",
|
|
@@ -89,9 +121,32 @@ var LOCAL_KERNEL_DECLARATIONS = Object.freeze([
|
|
|
89
121
|
rule: "none",
|
|
90
122
|
label: "none"
|
|
91
123
|
}
|
|
92
|
-
})
|
|
124
|
+
}),
|
|
125
|
+
{
|
|
126
|
+
name: "dataset",
|
|
127
|
+
form: "container",
|
|
128
|
+
childRule: "table",
|
|
129
|
+
label: "none",
|
|
130
|
+
props: {
|
|
131
|
+
name: {
|
|
132
|
+
kind: "string",
|
|
133
|
+
static: true,
|
|
134
|
+
required: true
|
|
135
|
+
},
|
|
136
|
+
key: {
|
|
137
|
+
kind: "string",
|
|
138
|
+
static: true,
|
|
139
|
+
required: true
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
structure: {
|
|
143
|
+
rule: "table",
|
|
144
|
+
label: "none"
|
|
145
|
+
},
|
|
146
|
+
rules: [{ kind: "single-table" }]
|
|
147
|
+
}
|
|
93
148
|
]);
|
|
94
|
-
// src/
|
|
149
|
+
// src/contracts/html-names.ts
|
|
95
150
|
/**
|
|
96
151
|
* P0 native HTML tag names. The parser handles these before component tags, and
|
|
97
152
|
* host component schemas may not reuse them because document parsing would
|
|
@@ -243,6 +298,18 @@ function isSafeLocalPattern(source) {
|
|
|
243
298
|
}
|
|
244
299
|
return groups.length === 0 && !escaped && !inClass;
|
|
245
300
|
}
|
|
301
|
+
// src/contracts/number-literal.ts
|
|
302
|
+
var NUMBER_TEXT = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
303
|
+
function parseNumberLiteral(raw) {
|
|
304
|
+
const text = raw.trim();
|
|
305
|
+
if (!NUMBER_TEXT.test(text)) return null;
|
|
306
|
+
const value = Number(text);
|
|
307
|
+
return Number.isFinite(value) ? value : null;
|
|
308
|
+
}
|
|
309
|
+
function parsePositiveNumberLiteral(raw) {
|
|
310
|
+
const value = parseNumberLiteral(raw);
|
|
311
|
+
return value !== null && value > 0 ? value : void 0;
|
|
312
|
+
}
|
|
246
313
|
// src/sdk/version.ts
|
|
247
314
|
/**
|
|
248
315
|
* SDK protocol identities and package version.
|
|
@@ -498,6 +565,7 @@ var CHILD_RULES = /* @__PURE__ */ new Set([
|
|
|
498
565
|
"none",
|
|
499
566
|
"any",
|
|
500
567
|
"inline",
|
|
568
|
+
"raw-body",
|
|
501
569
|
"content",
|
|
502
570
|
"table",
|
|
503
571
|
"plot",
|
|
@@ -516,6 +584,7 @@ var RULE_KINDS = /* @__PURE__ */ new Set([
|
|
|
516
584
|
"progress-bounds",
|
|
517
585
|
"timer-duration",
|
|
518
586
|
"option-count",
|
|
587
|
+
"required-one-of",
|
|
519
588
|
"selection-requires",
|
|
520
589
|
"inline-body",
|
|
521
590
|
"no-components",
|
|
@@ -586,6 +655,7 @@ var PROP_KEYS = /* @__PURE__ */ new Set([
|
|
|
586
655
|
"max",
|
|
587
656
|
"integer",
|
|
588
657
|
"positive",
|
|
658
|
+
"allowPositiveNumber",
|
|
589
659
|
"color",
|
|
590
660
|
"coerce",
|
|
591
661
|
"description"
|
|
@@ -770,6 +840,7 @@ function readStructure(value, form, path) {
|
|
|
770
840
|
const rawRule = value.rule;
|
|
771
841
|
if (typeof rawRule !== "string" || !CHILD_RULES.has(rawRule)) fail$2(`${path}.rule`, "is not a supported child rule.");
|
|
772
842
|
const rule = rawRule;
|
|
843
|
+
if (rule === "raw-body" && form !== "container") fail$2(path, "\"raw-body\" requires form \"container\".");
|
|
773
844
|
if (form === "leaf" && rule !== "none") fail$2(path, "a leaf component cannot declare body content.");
|
|
774
845
|
if (form === "inline" && rule !== "none" && rule !== "inline" && rule !== "any") fail$2(path, "an inline component only supports \"none\", \"inline\" or \"any\".");
|
|
775
846
|
const out = { rule };
|
|
@@ -908,6 +979,15 @@ function readRule(value, path) {
|
|
|
908
979
|
kind,
|
|
909
980
|
...value.max !== void 0 ? { max: readRuleAttribute(value.max, `${path}.max`) } : {}
|
|
910
981
|
};
|
|
982
|
+
case "required-one-of": {
|
|
983
|
+
allow(["attributes"]);
|
|
984
|
+
const attributes = readRuleStringList(value.attributes, `${path}.attributes`);
|
|
985
|
+
if (!attributes.length) fail$2(`${path}.attributes`, "must list at least one attribute.");
|
|
986
|
+
return {
|
|
987
|
+
kind,
|
|
988
|
+
attributes
|
|
989
|
+
};
|
|
990
|
+
}
|
|
911
991
|
case "selection-requires":
|
|
912
992
|
allow(["key", "attributes"]);
|
|
913
993
|
return {
|
|
@@ -1259,6 +1339,7 @@ function readProp(value, path) {
|
|
|
1259
1339
|
"dynamic",
|
|
1260
1340
|
"integer",
|
|
1261
1341
|
"positive",
|
|
1342
|
+
"allowPositiveNumber",
|
|
1262
1343
|
"color",
|
|
1263
1344
|
"nullable"
|
|
1264
1345
|
]) {
|
|
@@ -1275,6 +1356,7 @@ function readProp(value, path) {
|
|
|
1275
1356
|
const hasEnum = rawEnum !== void 0;
|
|
1276
1357
|
if (typedKind !== "enum") {
|
|
1277
1358
|
if (hasEnum) fail$2(path, `"enum" is only valid for kind "enum", not "${typedKind}".`);
|
|
1359
|
+
if (out.allowPositiveNumber !== void 0) fail$2(path, "\"allowPositiveNumber\" is only valid for kind \"enum\".");
|
|
1278
1360
|
} else {
|
|
1279
1361
|
if (value.enum !== void 0 && value.values !== void 0) fail$2(path, "use \"enum\" or \"values\", not both.");
|
|
1280
1362
|
if (!Array.isArray(rawEnum) || rawEnum.length === 0) fail$2(`${path}.enum`, "must be a non-empty string array.");
|
|
@@ -1332,7 +1414,7 @@ function readProp(value, path) {
|
|
|
1332
1414
|
} else if (typedKind === "boolean") out.default = readBoolean(fallback, `${path}.default`);
|
|
1333
1415
|
else {
|
|
1334
1416
|
const text = readString(fallback, `${path}.default`, 128);
|
|
1335
|
-
if (!out.enum?.includes(text)) fail$2(`${path}.default`, `"${text}" is not an allowed enum value.`);
|
|
1417
|
+
if (!out.enum?.includes(text) && !(out.allowPositiveNumber && parsePositiveNumberLiteral(text) !== void 0)) fail$2(`${path}.default`, `"${text}" is not an allowed enum value.`);
|
|
1336
1418
|
out.default = text;
|
|
1337
1419
|
}
|
|
1338
1420
|
if (out.pattern !== void 0 && typedKind === "string" && typeof out.default === "string") {
|
|
@@ -1647,6 +1729,10 @@ function readLocalComponentManifest(value) {
|
|
|
1647
1729
|
if (value.children !== void 0 && value.structure !== void 0) fail$2("manifest", "cannot declare both \"children\" and \"structure\"; use \"structure\".");
|
|
1648
1730
|
const structure = value.structure !== void 0 ? readStructure(value.structure, form, "structure") : localStructureFromChildren(children);
|
|
1649
1731
|
const rules = value.rules === void 0 ? void 0 : readRules(value.rules);
|
|
1732
|
+
for (const [index, rule] of (rules ?? []).entries()) {
|
|
1733
|
+
if (rule.kind !== "required-one-of") continue;
|
|
1734
|
+
for (const attribute of rule.attributes) if (!Object.hasOwn(props, attribute)) fail$2(`rules[${index}].attributes`, `refers to undeclared attribute "${attribute}".`);
|
|
1735
|
+
}
|
|
1650
1736
|
const slotRelations = value.slotRelations === void 0 ? void 0 : readSlotRelations(value.slotRelations);
|
|
1651
1737
|
if (value.legacyHost !== void 0) readBoolean(value.legacyHost, "legacyHost");
|
|
1652
1738
|
const capabilities = readCapabilities(value.capabilities, "capabilities");
|
|
@@ -1716,6 +1802,7 @@ function canonicalProp(prop) {
|
|
|
1716
1802
|
...prop.max !== void 0 ? { max: prop.max } : {},
|
|
1717
1803
|
...prop.integer === true ? { integer: true } : {},
|
|
1718
1804
|
...prop.positive === true ? { positive: true } : {},
|
|
1805
|
+
...prop.allowPositiveNumber === true ? { allowPositiveNumber: true } : {},
|
|
1719
1806
|
...prop.color === true ? { color: true } : {},
|
|
1720
1807
|
...prop.coerce !== void 0 ? { coerce: prop.coerce } : {}
|
|
1721
1808
|
};
|
|
@@ -1839,12 +1926,7 @@ function localComponentRequirement(definition) {
|
|
|
1839
1926
|
function isLocalComponentId(value) {
|
|
1840
1927
|
return typeof value === "string" && value.length > 0 && value.length <= 160 && ID.test(value);
|
|
1841
1928
|
}
|
|
1842
|
-
// src/
|
|
1843
|
-
/**
|
|
1844
|
-
* Shared identity of the built-in default preset. Keeping the identity in one
|
|
1845
|
-
* plain-data module lets the minimal compiler validate preset references
|
|
1846
|
-
* without importing the preset implementation or its component table.
|
|
1847
|
-
*/
|
|
1929
|
+
// src/sdk/default-identity.ts
|
|
1848
1930
|
var DEFAULT_PRESET_ID$1 = "reactive-md/default";
|
|
1849
1931
|
var DEFAULT_PRESET_VERSION$1 = LOCAL_SDK_VERSION;
|
|
1850
1932
|
// src/sdk/compat-profile.ts
|
|
@@ -2022,7 +2104,11 @@ function readThemeList(value) {
|
|
|
2022
2104
|
if (names.has(name)) presetError("themes", `theme name "${name}" is declared more than once.`);
|
|
2023
2105
|
ids.add(id);
|
|
2024
2106
|
names.add(name);
|
|
2025
|
-
|
|
2107
|
+
const fonts = readLocalFontAliases(entry.fonts, `themes[${index}].fonts`);
|
|
2108
|
+
themes.push(Object.freeze({
|
|
2109
|
+
...entry,
|
|
2110
|
+
...entry.fonts !== void 0 ? { fonts } : {}
|
|
2111
|
+
}));
|
|
2026
2112
|
}
|
|
2027
2113
|
return Object.freeze(themes.sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
2028
2114
|
}
|
|
@@ -2113,7 +2199,8 @@ var SNAPSHOT_KEYS = /* @__PURE__ */ new Set([
|
|
|
2113
2199
|
"presets",
|
|
2114
2200
|
"components",
|
|
2115
2201
|
"replacementPolicy",
|
|
2116
|
-
"themes"
|
|
2202
|
+
"themes",
|
|
2203
|
+
"fonts"
|
|
2117
2204
|
]);
|
|
2118
2205
|
var MAX_ASSEMBLY_PRESETS = 32;
|
|
2119
2206
|
var MAX_ASSEMBLY_COMPONENTS = 256;
|
|
@@ -2192,7 +2279,11 @@ function readAssemblyThemes(value) {
|
|
|
2192
2279
|
if (typeof version !== "string" || !isLocalVersion(version)) fail$1(`assembly.themes[${index}].version`, "must be a semantic version.");
|
|
2193
2280
|
if (ids.has(id)) fail$1("assembly.themes", `theme id "${id}" is declared more than once.`);
|
|
2194
2281
|
ids.add(id);
|
|
2195
|
-
|
|
2282
|
+
const fonts = readLocalFontAliases(entry.fonts, `assembly.themes[${index}].fonts`);
|
|
2283
|
+
return Object.freeze({
|
|
2284
|
+
...entry,
|
|
2285
|
+
...entry.fonts !== void 0 ? { fonts } : {}
|
|
2286
|
+
});
|
|
2196
2287
|
}), (theme) => theme.id));
|
|
2197
2288
|
}
|
|
2198
2289
|
/** Validate and freeze a transported assembly snapshot. */
|
|
@@ -2202,12 +2293,14 @@ function readLocalAssemblySnapshot(value) {
|
|
|
2202
2293
|
if (value.protocol !== "reactive-md-assembly/v1") fail$1("assembly.protocol", `must be "${LOCAL_ASSEMBLY_PROTOCOL}".`);
|
|
2203
2294
|
const replacementPolicy = value.replacementPolicy;
|
|
2204
2295
|
if (replacementPolicy !== "allow" && replacementPolicy !== "forbid") fail$1("assembly.replacementPolicy", "must be \"allow\" or \"forbid\".");
|
|
2296
|
+
const fonts = readLocalFontAliases(value.fonts, "assembly.fonts");
|
|
2205
2297
|
return Object.freeze({
|
|
2206
2298
|
protocol: LOCAL_ASSEMBLY_PROTOCOL,
|
|
2207
2299
|
presets: readAssemblyPresets(value.presets),
|
|
2208
2300
|
components: readAssemblyComponents(value.components),
|
|
2209
2301
|
replacementPolicy,
|
|
2210
|
-
themes: readAssemblyThemes(value.themes)
|
|
2302
|
+
themes: readAssemblyThemes(value.themes),
|
|
2303
|
+
...fonts ? { fonts } : {}
|
|
2211
2304
|
});
|
|
2212
2305
|
}
|
|
2213
2306
|
function orderPresets(presets) {
|
|
@@ -2368,7 +2461,9 @@ function resolveContributions(contributions, replacementPolicy, presetAuthoring)
|
|
|
2368
2461
|
}
|
|
2369
2462
|
const active = [];
|
|
2370
2463
|
const replacements = [];
|
|
2371
|
-
for (const
|
|
2464
|
+
for (const contributions of groups.values()) {
|
|
2465
|
+
const chartColumn = contributions.find((item) => item.definition.id === "reactive-md/column" && item.origin.kind === "preset" && item.origin.id === "reactive-md/chart" && item.definition.replaces === void 0);
|
|
2466
|
+
const group = chartColumn && contributions.find((item) => item !== chartColumn && item.origin.kind === "preset" && item.origin.id.startsWith("reactive-md/") && item.definition.replaces === void 0 && localComponentDigest(item.definition) === localComponentDigest(chartColumn.definition) && JSON.stringify(effectiveAuthoring(item, presetAuthoring)) === JSON.stringify(effectiveAuthoring(chartColumn, presetAuthoring))) ? contributions.filter((item) => item !== chartColumn) : contributions;
|
|
2372
2467
|
if (group.length === 1) {
|
|
2373
2468
|
const only = group[0];
|
|
2374
2469
|
if (only.definition.replaces !== void 0) {
|
|
@@ -2537,6 +2632,7 @@ function localConfigFromAssembly(assembly, resolved, legacyKeys = resolved.legac
|
|
|
2537
2632
|
replacements: resolved.replacements,
|
|
2538
2633
|
registry: resolved.registry,
|
|
2539
2634
|
themes: resolved.themes,
|
|
2635
|
+
...assembly.fonts ? { fonts: assembly.fonts } : {},
|
|
2540
2636
|
legacyKeys: Object.freeze(legacyKeys)
|
|
2541
2637
|
});
|
|
2542
2638
|
}
|
|
@@ -2547,7 +2643,8 @@ function localAssemblyIdentity(input) {
|
|
|
2547
2643
|
presets: Object.freeze(sortById(input.presets, (item) => item.id)),
|
|
2548
2644
|
components: Object.freeze(sortById(input.registry.map(localComponentRequirement), (item) => item.id)),
|
|
2549
2645
|
replacements: Object.freeze(sortById(input.replacements, (item) => item.id)),
|
|
2550
|
-
legacyKeys: Object.freeze(sortById(input.legacyKeys, (item) => item.key))
|
|
2646
|
+
legacyKeys: Object.freeze(sortById(input.legacyKeys, (item) => item.key)),
|
|
2647
|
+
...input.fonts ? { fontDigest: localHash(JSON.stringify(input.fonts)) } : {}
|
|
2551
2648
|
});
|
|
2552
2649
|
}
|
|
2553
2650
|
/** Deterministic digest over the assembly identity. */
|
|
@@ -2580,6 +2677,7 @@ var CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
2580
2677
|
"replacements",
|
|
2581
2678
|
"registry",
|
|
2582
2679
|
"themes",
|
|
2680
|
+
"fonts",
|
|
2583
2681
|
"legacyKeys"
|
|
2584
2682
|
]);
|
|
2585
2683
|
function fail(path, message) {
|
|
@@ -2804,24 +2902,28 @@ var DEFAULT_COMPONENT_AUTHORING = Object.freeze({
|
|
|
2804
2902
|
},
|
|
2805
2903
|
text: {
|
|
2806
2904
|
title: {
|
|
2807
|
-
en: "
|
|
2808
|
-
zh: "
|
|
2905
|
+
en: "Inline text style",
|
|
2906
|
+
zh: "行内文字样式"
|
|
2809
2907
|
},
|
|
2810
2908
|
description: {
|
|
2811
|
-
en: "
|
|
2812
|
-
zh: "
|
|
2909
|
+
en: "Set at least one of color, size or font. Omitted styles are inherited.",
|
|
2910
|
+
zh: "至少填写 color、size、font 中的一项。省略的样式由上下文继承。"
|
|
2813
2911
|
},
|
|
2814
2912
|
category: "hint",
|
|
2815
2913
|
keywords: {
|
|
2816
2914
|
en: [
|
|
2817
2915
|
"text",
|
|
2818
2916
|
"color",
|
|
2819
|
-
"foreground"
|
|
2917
|
+
"foreground",
|
|
2918
|
+
"size",
|
|
2919
|
+
"font"
|
|
2820
2920
|
],
|
|
2821
2921
|
zh: [
|
|
2822
2922
|
"文字",
|
|
2823
2923
|
"颜色",
|
|
2824
|
-
"前景"
|
|
2924
|
+
"前景",
|
|
2925
|
+
"字号",
|
|
2926
|
+
"字体"
|
|
2825
2927
|
]
|
|
2826
2928
|
},
|
|
2827
2929
|
inline: true,
|
|
@@ -3462,6 +3564,39 @@ var DEFAULT_COMPONENT_AUTHORING = Object.freeze({
|
|
|
3462
3564
|
zh: "<if when=\"{{ {{select:true}} }}\">\n{{selection:示例内容}}\n</if>"
|
|
3463
3565
|
}
|
|
3464
3566
|
},
|
|
3567
|
+
else: {
|
|
3568
|
+
title: {
|
|
3569
|
+
en: "If/else pair",
|
|
3570
|
+
zh: "条件与否则"
|
|
3571
|
+
},
|
|
3572
|
+
description: {
|
|
3573
|
+
en: "Insert a complete if/else pair; the else branch shows when the condition is false.",
|
|
3574
|
+
zh: "一次插入完整的 if/else 配对;条件不成立时显示否则分支。"
|
|
3575
|
+
},
|
|
3576
|
+
category: "layout",
|
|
3577
|
+
keywords: {
|
|
3578
|
+
en: [
|
|
3579
|
+
"else",
|
|
3580
|
+
"if",
|
|
3581
|
+
"otherwise",
|
|
3582
|
+
"fallback",
|
|
3583
|
+
"condition",
|
|
3584
|
+
"branch"
|
|
3585
|
+
],
|
|
3586
|
+
zh: [
|
|
3587
|
+
"否则",
|
|
3588
|
+
"如果",
|
|
3589
|
+
"其他",
|
|
3590
|
+
"分支",
|
|
3591
|
+
"条件",
|
|
3592
|
+
"配对"
|
|
3593
|
+
]
|
|
3594
|
+
},
|
|
3595
|
+
insertText: {
|
|
3596
|
+
en: "<if when=\"{{ {{select:true}} }}\">\n{{selection:Sample content}}\n</if>\n<else>\n{{selection:Alternative content}}\n</else>",
|
|
3597
|
+
zh: "<if when=\"{{ {{select:true}} }}\">\n{{selection:示例内容}}\n</if>\n<else>\n{{selection:否则内容}}\n</else>"
|
|
3598
|
+
}
|
|
3599
|
+
},
|
|
3465
3600
|
gallery: {
|
|
3466
3601
|
title: {
|
|
3467
3602
|
en: "Gallery",
|
|
@@ -4237,6 +4372,7 @@ function optionsComponent(name, def = "container") {
|
|
|
4237
4372
|
return definition(name, def, {
|
|
4238
4373
|
props: {
|
|
4239
4374
|
label: label(),
|
|
4375
|
+
options: props.expressionText(),
|
|
4240
4376
|
disabled: disabled(),
|
|
4241
4377
|
color: color()
|
|
4242
4378
|
},
|
|
@@ -4256,6 +4392,13 @@ function optionsComponent(name, def = "container") {
|
|
|
4256
4392
|
valueAttribute: "value",
|
|
4257
4393
|
unique: true,
|
|
4258
4394
|
max: MAX_LOCAL_ARRAY_LENGTH
|
|
4395
|
+
}, {
|
|
4396
|
+
kind: "require-full-interpolation",
|
|
4397
|
+
attributes: ["options"]
|
|
4398
|
+
}, {
|
|
4399
|
+
kind: "scoped-expressions",
|
|
4400
|
+
attributes: ["options"],
|
|
4401
|
+
scope: "row"
|
|
4259
4402
|
})
|
|
4260
4403
|
});
|
|
4261
4404
|
}
|
|
@@ -4265,6 +4408,7 @@ var radioGroupDef = optionsComponent("radio-group");
|
|
|
4265
4408
|
var multiSelectDef = definition("multi-select", "container", {
|
|
4266
4409
|
props: {
|
|
4267
4410
|
label: label(),
|
|
4411
|
+
options: props.expressionText(),
|
|
4268
4412
|
"max-selected": props.number({
|
|
4269
4413
|
integer: true,
|
|
4270
4414
|
min: 0
|
|
@@ -4296,6 +4440,13 @@ var multiSelectDef = definition("multi-select", "container", {
|
|
|
4296
4440
|
}, {
|
|
4297
4441
|
kind: "option-count",
|
|
4298
4442
|
max: "max-selected"
|
|
4443
|
+
}, {
|
|
4444
|
+
kind: "require-full-interpolation",
|
|
4445
|
+
attributes: ["options"]
|
|
4446
|
+
}, {
|
|
4447
|
+
kind: "scoped-expressions",
|
|
4448
|
+
attributes: ["options"],
|
|
4449
|
+
scope: "row"
|
|
4299
4450
|
})
|
|
4300
4451
|
});
|
|
4301
4452
|
var optionDef = definition("option", "container", {
|
|
@@ -4447,10 +4598,23 @@ var anchorDef = definition("anchor", "leaf", {
|
|
|
4447
4598
|
})
|
|
4448
4599
|
});
|
|
4449
4600
|
var textDef = definition("text", "inline", {
|
|
4450
|
-
props: {
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4601
|
+
props: {
|
|
4602
|
+
color: color(),
|
|
4603
|
+
size: props.choice([
|
|
4604
|
+
"sm",
|
|
4605
|
+
"md",
|
|
4606
|
+
"lg",
|
|
4607
|
+
"xl"
|
|
4608
|
+
], {
|
|
4609
|
+
static: true,
|
|
4610
|
+
allowPositiveNumber: true,
|
|
4611
|
+
description: {
|
|
4612
|
+
en: "A theme size or a positive number in pixels, such as 20.",
|
|
4613
|
+
zh: "主题字号或以像素为单位的正数,例如 20。"
|
|
4614
|
+
}
|
|
4615
|
+
}),
|
|
4616
|
+
font: props.choice(LOCAL_TEXT_FONT_CHOICES, { static: true })
|
|
4617
|
+
},
|
|
4454
4618
|
structure: structure({
|
|
4455
4619
|
rule: "inline",
|
|
4456
4620
|
label: "none",
|
|
@@ -4458,6 +4622,13 @@ var textDef = definition("text", "inline", {
|
|
|
4458
4622
|
noComponents: true
|
|
4459
4623
|
}),
|
|
4460
4624
|
rules: rules({
|
|
4625
|
+
kind: "required-one-of",
|
|
4626
|
+
attributes: [
|
|
4627
|
+
"color",
|
|
4628
|
+
"size",
|
|
4629
|
+
"font"
|
|
4630
|
+
]
|
|
4631
|
+
}, {
|
|
4461
4632
|
kind: "inline-body",
|
|
4462
4633
|
strict: true
|
|
4463
4634
|
}, { kind: "no-components" })
|
|
@@ -4684,6 +4855,17 @@ var ifDef = definition("if", "container", {
|
|
|
4684
4855
|
attributes: ["when"]
|
|
4685
4856
|
})
|
|
4686
4857
|
});
|
|
4858
|
+
var elseDef = definition("else", "container", {
|
|
4859
|
+
props: { when: props.boolean({ dynamic: true }) },
|
|
4860
|
+
structure: structure({
|
|
4861
|
+
rule: "any",
|
|
4862
|
+
label: "none"
|
|
4863
|
+
}),
|
|
4864
|
+
rules: rules({
|
|
4865
|
+
kind: "require-full-interpolation",
|
|
4866
|
+
attributes: ["when"]
|
|
4867
|
+
})
|
|
4868
|
+
});
|
|
4687
4869
|
var alertDef = definition("alert", "container", {
|
|
4688
4870
|
props: {
|
|
4689
4871
|
title: optionalTitle(),
|
|
@@ -4767,15 +4949,36 @@ var validationDef = definition("validation", "leaf", {
|
|
|
4767
4949
|
var dataTableDef = definition("data-table", "container", {
|
|
4768
4950
|
props: {
|
|
4769
4951
|
label: props.staticText(),
|
|
4952
|
+
empty: props.staticText(),
|
|
4770
4953
|
rows: props.expressionText({ required: true }),
|
|
4771
4954
|
key: props.expressionText({ required: true }),
|
|
4955
|
+
searchable: props.boolean({ default: false }),
|
|
4956
|
+
sortable: props.boolean({ default: false }),
|
|
4957
|
+
"page-size": props.number({
|
|
4958
|
+
integer: true,
|
|
4959
|
+
positive: true
|
|
4960
|
+
}),
|
|
4772
4961
|
"max-rows": props.number({
|
|
4773
4962
|
integer: true,
|
|
4774
4963
|
positive: true,
|
|
4775
4964
|
max: MAX_LOCAL_DATA_TABLE_ROWS,
|
|
4776
4965
|
default: 100
|
|
4777
|
-
})
|
|
4966
|
+
}),
|
|
4967
|
+
align: props.choice([
|
|
4968
|
+
"left",
|
|
4969
|
+
"center",
|
|
4970
|
+
"right"
|
|
4971
|
+
], {
|
|
4972
|
+
static: true,
|
|
4973
|
+
default: "center"
|
|
4974
|
+
}),
|
|
4975
|
+
"row-align": props.choice([
|
|
4976
|
+
"left",
|
|
4977
|
+
"center",
|
|
4978
|
+
"right"
|
|
4979
|
+
], { dynamic: true })
|
|
4778
4980
|
},
|
|
4981
|
+
bindings: { value: binding("string", "selection", "none", { requiresAttributes: ["key"] }) },
|
|
4779
4982
|
structure: structure({
|
|
4780
4983
|
rule: "components",
|
|
4781
4984
|
label: "required",
|
|
@@ -4798,10 +5001,14 @@ var dataTableDef = definition("data-table", "container", {
|
|
|
4798
5001
|
maxColumns: 20
|
|
4799
5002
|
}, {
|
|
4800
5003
|
kind: "require-full-interpolation",
|
|
4801
|
-
attributes: [
|
|
5004
|
+
attributes: [
|
|
5005
|
+
"rows",
|
|
5006
|
+
"key",
|
|
5007
|
+
"row-align"
|
|
5008
|
+
]
|
|
4802
5009
|
}, {
|
|
4803
5010
|
kind: "scoped-expressions",
|
|
4804
|
-
attributes: ["key"],
|
|
5011
|
+
attributes: ["key", "row-align"],
|
|
4805
5012
|
scope: "row"
|
|
4806
5013
|
}, {
|
|
4807
5014
|
kind: "row-values",
|
|
@@ -4809,17 +5016,59 @@ var dataTableDef = definition("data-table", "container", {
|
|
|
4809
5016
|
key: "key",
|
|
4810
5017
|
child: "column",
|
|
4811
5018
|
childValue: "value"
|
|
5019
|
+
}, {
|
|
5020
|
+
kind: "self-binding-read",
|
|
5021
|
+
mode: "always"
|
|
4812
5022
|
})
|
|
4813
5023
|
});
|
|
4814
5024
|
var columnDef = definition("column", "leaf", {
|
|
4815
5025
|
props: {
|
|
4816
5026
|
label: props.staticText({ required: true }),
|
|
4817
|
-
value: props.expressionText({ required: true })
|
|
5027
|
+
value: props.expressionText({ required: true }),
|
|
5028
|
+
format: props.choice([
|
|
5029
|
+
"plain",
|
|
5030
|
+
"number",
|
|
5031
|
+
"percent",
|
|
5032
|
+
"scientific",
|
|
5033
|
+
"currency"
|
|
5034
|
+
], {
|
|
5035
|
+
static: true,
|
|
5036
|
+
default: "plain"
|
|
5037
|
+
}),
|
|
5038
|
+
summary: props.choice([
|
|
5039
|
+
"sum",
|
|
5040
|
+
"average",
|
|
5041
|
+
"count"
|
|
5042
|
+
], { static: true }),
|
|
5043
|
+
align: props.choice([
|
|
5044
|
+
"left",
|
|
5045
|
+
"center",
|
|
5046
|
+
"right"
|
|
5047
|
+
], { static: true }),
|
|
5048
|
+
digits: props.number({
|
|
5049
|
+
integer: true,
|
|
5050
|
+
min: 0,
|
|
5051
|
+
max: 20
|
|
5052
|
+
}),
|
|
5053
|
+
currency: props.staticText({
|
|
5054
|
+
default: "USD",
|
|
5055
|
+
pattern: "^[A-Z]{3}$"
|
|
5056
|
+
}),
|
|
5057
|
+
locale: props.choice([
|
|
5058
|
+
"en-US",
|
|
5059
|
+
"zh-CN",
|
|
5060
|
+
"de-DE",
|
|
5061
|
+
"fr-FR",
|
|
5062
|
+
"ja-JP"
|
|
5063
|
+
], {
|
|
5064
|
+
static: true,
|
|
5065
|
+
default: "en-US"
|
|
5066
|
+
})
|
|
4818
5067
|
},
|
|
4819
5068
|
structure: structure({
|
|
4820
5069
|
rule: "none",
|
|
4821
5070
|
label: "none",
|
|
4822
|
-
parents: ["data-table"]
|
|
5071
|
+
parents: ["data-table", "chart"]
|
|
4823
5072
|
}),
|
|
4824
5073
|
rules: rules({
|
|
4825
5074
|
kind: "require-full-interpolation",
|
|
@@ -4875,11 +5124,18 @@ var chartDef = definition("chart", "container", {
|
|
|
4875
5124
|
default: "bar"
|
|
4876
5125
|
}),
|
|
4877
5126
|
title: optionalTitle(),
|
|
5127
|
+
rows: props.expressionText(),
|
|
4878
5128
|
x: props.staticText(),
|
|
4879
5129
|
y: props.staticText(),
|
|
4880
5130
|
"x-label": props.text(),
|
|
4881
5131
|
"y-label": props.text(),
|
|
4882
|
-
key: props.staticText()
|
|
5132
|
+
key: props.staticText(),
|
|
5133
|
+
"max-rows": props.number({
|
|
5134
|
+
integer: true,
|
|
5135
|
+
positive: true,
|
|
5136
|
+
max: MAX_LOCAL_DATA_TABLE_ROWS,
|
|
5137
|
+
default: 100
|
|
5138
|
+
})
|
|
4883
5139
|
},
|
|
4884
5140
|
bindings: { value: binding("string", "selection", "none", { requiresAttributes: ["key"] }) },
|
|
4885
5141
|
structure: structure({
|
|
@@ -4891,6 +5147,10 @@ var chartDef = definition("chart", "container", {
|
|
|
4891
5147
|
chartKind: "kind",
|
|
4892
5148
|
x: "x",
|
|
4893
5149
|
y: "y"
|
|
5150
|
+
}, {
|
|
5151
|
+
kind: "scoped-expressions",
|
|
5152
|
+
attributes: ["rows"],
|
|
5153
|
+
scope: "row"
|
|
4894
5154
|
}, {
|
|
4895
5155
|
kind: "table-selection",
|
|
4896
5156
|
key: "key",
|
|
@@ -5040,7 +5300,7 @@ var edgeDef = definition("edge", "leaf", {
|
|
|
5040
5300
|
/**
|
|
5041
5301
|
* The rendered/structural components of the default preset, in declaration
|
|
5042
5302
|
* order. `computed`, `const` and `external` stay kernel grammar
|
|
5043
|
-
* metadata in `src/
|
|
5303
|
+
* metadata in `src/contracts/component-kernel.ts`.
|
|
5044
5304
|
*/
|
|
5045
5305
|
var DEFAULT_SEMANTIC_COMPONENTS = Object.freeze([
|
|
5046
5306
|
inputDef,
|
|
@@ -5078,6 +5338,7 @@ var DEFAULT_SEMANTIC_COMPONENTS = Object.freeze([
|
|
|
5078
5338
|
accordionDef,
|
|
5079
5339
|
disclosureDef,
|
|
5080
5340
|
ifDef,
|
|
5341
|
+
elseDef,
|
|
5081
5342
|
alertDef,
|
|
5082
5343
|
badgeDef,
|
|
5083
5344
|
tooltipDef,
|
|
@@ -6050,7 +6311,12 @@ function rewriteDeclarationBody(body, families) {
|
|
|
6050
6311
|
if (families.size === 0) return body;
|
|
6051
6312
|
const replacements = [];
|
|
6052
6313
|
for (const declaration of scanDeclarations(body, true)) {
|
|
6053
|
-
const familyProperty =
|
|
6314
|
+
const familyProperty = [
|
|
6315
|
+
"font-family",
|
|
6316
|
+
"--font-sans",
|
|
6317
|
+
"--font-serif",
|
|
6318
|
+
"--font-mono"
|
|
6319
|
+
].includes(declaration.name);
|
|
6054
6320
|
if (!familyProperty && declaration.name !== "font") continue;
|
|
6055
6321
|
const value = body.slice(declaration.valueStart, declaration.valueEnd);
|
|
6056
6322
|
const rewritten = familyProperty ? rewriteFontFamilyList(value, families) : rewriteFontShorthand(value, families);
|
|
@@ -6294,12 +6560,17 @@ function freezePackage(input) {
|
|
|
6294
6560
|
version: input.version,
|
|
6295
6561
|
protocol: input.protocol,
|
|
6296
6562
|
colorSchemes: Object.freeze([...input.colorSchemes]),
|
|
6563
|
+
...input.fonts ? { fonts: input.fonts } : {},
|
|
6297
6564
|
css: Object.freeze(input.css.map((resource) => Object.freeze({
|
|
6298
6565
|
id: resource.id,
|
|
6299
6566
|
css: resource.css
|
|
6300
6567
|
})))
|
|
6301
6568
|
});
|
|
6302
6569
|
}
|
|
6570
|
+
function rewriteFontAliases(fonts, families) {
|
|
6571
|
+
if (!fonts || families.size === 0) return fonts;
|
|
6572
|
+
return Object.freeze(Object.fromEntries(Object.entries(fonts).map(([alias, family]) => [alias, families.get(normalizeFontFamily(family)) ?? family])));
|
|
6573
|
+
}
|
|
6303
6574
|
/**
|
|
6304
6575
|
* Validate, scope and freeze a theme package. The input is cloned; the result
|
|
6305
6576
|
* and every nested resource are frozen.
|
|
@@ -6324,7 +6595,8 @@ function defineLocalTheme(input) {
|
|
|
6324
6595
|
version,
|
|
6325
6596
|
protocol: LOCAL_THEME_PROTOCOL,
|
|
6326
6597
|
colorSchemes,
|
|
6327
|
-
css: scoped
|
|
6598
|
+
css: scoped,
|
|
6599
|
+
fonts: rewriteFontAliases(readLocalFontAliases(record.fonts, "theme.fonts"), families)
|
|
6328
6600
|
});
|
|
6329
6601
|
}
|
|
6330
6602
|
// src/sdk/preset.ts
|
|
@@ -6360,7 +6632,7 @@ function readLocalPresetPackage(value) {
|
|
|
6360
6632
|
validatedPresets.add(preset);
|
|
6361
6633
|
return preset;
|
|
6362
6634
|
}
|
|
6363
|
-
// src/
|
|
6635
|
+
// src/assemblies/default-config.ts
|
|
6364
6636
|
/** Identifiers the default preset contributes in phase one. */
|
|
6365
6637
|
var DEFAULT_PRESET_ID = defaultPreset.id;
|
|
6366
6638
|
var DEFAULT_PRESET_VERSION = defaultPreset.version;
|
|
@@ -6372,7 +6644,8 @@ var INPUT_KEYS = /* @__PURE__ */ new Set([
|
|
|
6372
6644
|
"presets",
|
|
6373
6645
|
"components",
|
|
6374
6646
|
"replacements",
|
|
6375
|
-
"themes"
|
|
6647
|
+
"themes",
|
|
6648
|
+
"fonts"
|
|
6376
6649
|
]);
|
|
6377
6650
|
/**
|
|
6378
6651
|
* Configurations produced by this module are deeply frozen and already
|
|
@@ -6388,7 +6661,8 @@ function readThemePackage(value) {
|
|
|
6388
6661
|
"version",
|
|
6389
6662
|
"protocol",
|
|
6390
6663
|
"colorSchemes",
|
|
6391
|
-
"css"
|
|
6664
|
+
"css",
|
|
6665
|
+
"fonts"
|
|
6392
6666
|
]), "theme");
|
|
6393
6667
|
try {
|
|
6394
6668
|
return defineLocalTheme(value);
|
|
@@ -6472,12 +6746,14 @@ function readReplacementPolicy(value) {
|
|
|
6472
6746
|
function buildAssembly(input, path) {
|
|
6473
6747
|
if (!isPlainRecord(input)) fail(path, "must be an object.");
|
|
6474
6748
|
checkKeys(input, INPUT_KEYS, path);
|
|
6749
|
+
const fonts = readLocalFontAliases(input.fonts, "fonts");
|
|
6475
6750
|
const assembly = Object.freeze({
|
|
6476
6751
|
protocol: LOCAL_ASSEMBLY_PROTOCOL,
|
|
6477
6752
|
presets: readPresetInputs(input.presets),
|
|
6478
6753
|
components: readInputComponents(input.components),
|
|
6479
6754
|
replacementPolicy: readReplacementPolicy(input.replacements),
|
|
6480
|
-
themes: readInputThemes(input.themes)
|
|
6755
|
+
themes: readInputThemes(input.themes),
|
|
6756
|
+
...fonts ? { fonts } : {}
|
|
6481
6757
|
});
|
|
6482
6758
|
if (localJsonByteLength(assembly) > 16777216) fail(path, `serialized size exceeds the ${MAX_LOCAL_SDK_CONFIG_BYTES}-byte budget.`);
|
|
6483
6759
|
return assembly;
|
|
@@ -6569,7 +6845,8 @@ function localThemeContractDigest(theme) {
|
|
|
6569
6845
|
theme.version,
|
|
6570
6846
|
theme.protocol,
|
|
6571
6847
|
theme.colorSchemes,
|
|
6572
|
-
theme.css.map(({ id, css }) => [id, css])
|
|
6848
|
+
theme.css.map(({ id, css }) => [id, css]),
|
|
6849
|
+
...theme.fonts ? [theme.fonts] : []
|
|
6573
6850
|
]));
|
|
6574
6851
|
}
|
|
6575
6852
|
function createLocalBundleManifest(script, config) {
|
|
@@ -7734,6 +8011,18 @@ if (typeof document !== "undefined") {
|
|
|
7734
8011
|
}
|
|
7735
8012
|
// src/build/vite.ts
|
|
7736
8013
|
var MAX_SCRIPT_BYTES = 33554432;
|
|
8014
|
+
var NODE_BUILTIN_MARKER = "reactive-md-node-builtin: ";
|
|
8015
|
+
var NODE_BUILTINS = new Set(builtinModules.flatMap((name) => [name, `node:${name}`]));
|
|
8016
|
+
function nodeBuiltinMessage(id, importer) {
|
|
8017
|
+
return `${NODE_BUILTIN_MARKER}"${id}"${importer ? ` (imported by ${importer})` : ""} cannot be bundled for a browser build. Host modules run in the browser; compute build-only paths in the build script or use new URL('.', import.meta.url) for root.`;
|
|
8018
|
+
}
|
|
8019
|
+
function browserSafetyDetail(error) {
|
|
8020
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8021
|
+
const index = message.indexOf(NODE_BUILTIN_MARKER);
|
|
8022
|
+
if (index < 0) return null;
|
|
8023
|
+
const end = message.indexOf("\n", index);
|
|
8024
|
+
return message.slice(index + 26, end < 0 ? void 0 : end).replace(/\u001b\[[0-9;]*m/g, "");
|
|
8025
|
+
}
|
|
7737
8026
|
var FORBIDDEN_SCRIPT_TOKENS = [
|
|
7738
8027
|
[/\bimport\s*\.\s*meta\b/, "import.meta"],
|
|
7739
8028
|
[/\bimport\s*\(/, "a dynamic import"],
|
|
@@ -7857,7 +8146,8 @@ async function buildLocalStandaloneScript(input, vite, diagnostics) {
|
|
|
7857
8146
|
plugins: [{
|
|
7858
8147
|
name: "reactive-md-standalone-host",
|
|
7859
8148
|
enforce: "pre",
|
|
7860
|
-
resolveId(id) {
|
|
8149
|
+
resolveId(id, importer) {
|
|
8150
|
+
if (id.startsWith("node:") || NODE_BUILTINS.has(id)) throw new Error(nodeBuiltinMessage(id, importer));
|
|
7861
8151
|
if (id === "virtual:reactive-md-host-entry") return `\0${VIRTUAL_HOST_ENTRY}`;
|
|
7862
8152
|
if (id === "virtual:reactive-md-host-module") return hostId;
|
|
7863
8153
|
return null;
|
|
@@ -7900,7 +8190,8 @@ async function buildLocalStandaloneScript(input, vite, diagnostics) {
|
|
|
7900
8190
|
try {
|
|
7901
8191
|
result = await vite.build(config);
|
|
7902
8192
|
} catch (error) {
|
|
7903
|
-
|
|
8193
|
+
const safety = browserSafetyDetail(error);
|
|
8194
|
+
diagnostics.push(safety ? buildDiagnostic("local.build.host-browser", `The standalone host is not browser-safe: ${safety}`) : buildDiagnostic("local.build.vite", `The Vite build failed: ${messageOf(error)}`));
|
|
7904
8195
|
return null;
|
|
7905
8196
|
}
|
|
7906
8197
|
const output = readSingleOutput(result, diagnostics);
|
|
@@ -8055,4 +8346,4 @@ async function buildLocalStandaloneBundle(options) {
|
|
|
8055
8346
|
manifest
|
|
8056
8347
|
});
|
|
8057
8348
|
}
|
|
8058
|
-
export { DEFAULT_LOCAL_BUILD_BUDGETS, LOCAL_BUILD_PROTOCOL, LocalBuildError, VIRTUAL_HOST_ENTRY, VIRTUAL_HOST_MODULE, buildLocalStandaloneBundle, collectLocalBuildNotices, collectLocalBuildResources, createLocalStandaloneEntrySource, defineLocalTheme as n, preflightLocalStandaloneBuild, LOCAL_REACT_PRESET_PROTOCOL as r, readLocalBuildBudgets, readLocalBuildHost, readLocalStyleResourceInputs, resolveLocalVite, createLocalConfig as t };
|
|
8349
|
+
export { DEFAULT_LOCAL_BUILD_BUDGETS, LOCAL_BUILD_PROTOCOL, LocalBuildError, VIRTUAL_HOST_ENTRY, VIRTUAL_HOST_MODULE, buildLocalStandaloneBundle, collectLocalBuildNotices, collectLocalBuildResources, createLocalStandaloneEntrySource, readLocalFontAliases as i, defineLocalTheme as n, preflightLocalStandaloneBuild, LOCAL_REACT_PRESET_PROTOCOL as r, readLocalBuildBudgets, readLocalBuildHost, readLocalStyleResourceInputs, resolveLocalVite, createLocalConfig as t };
|