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,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as r,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { n as e, r as t } from "./document-theme-CJvN-nC1.js";
|
|
2
|
+
import { A as n, H as r, I as i, M as a, n as o, r as s } from "./preset-core-BKPbH_Nv.js";
|
|
3
|
+
import { i as c, r as l, t as u } from "./version-4wzhbvDG.js";
|
|
4
|
+
import { _ as d, a as f, c as p, d as ee, g as te, h as ne, i as m, m as h, n as re, o as ie, p as ae, r as g, s as oe, t as se, v as ce } from "./config-validation-DbmsWAEV.js";
|
|
5
|
+
import _ from "./reactive-md-default-preset.js";
|
|
6
6
|
// src/themes/contract.ts
|
|
7
|
-
var
|
|
7
|
+
var le = "reactive-md-styles-1", v = Object.freeze([
|
|
8
8
|
"rmd.reset",
|
|
9
9
|
"rmd.defaults",
|
|
10
10
|
"rmd.components",
|
|
11
11
|
"rmd.themes",
|
|
12
12
|
"rmd.overrides"
|
|
13
|
-
]),
|
|
13
|
+
]), ue = "rmd.themes", y = `@layer ${v.join(", ")};`, de = 128, fe = 32, b = 128, x = 262144, S = 524288, pe = /^[a-z][a-z0-9]*(?:[-./][a-z0-9]+)*$/, me = /^[a-z][a-z0-9._/-]*$/, he = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/, ge = /^\[\s*data-rmd-theme\s*=\s*(?:"[^"]*"|'[^']*'|[^\]]*?)\s*\]/, _e = /^(?::root|html|body)(?![A-Za-z0-9_-])/i, ve = /* @__PURE__ */ new Set([
|
|
14
14
|
"media",
|
|
15
15
|
"supports",
|
|
16
16
|
"layer",
|
|
17
17
|
"container",
|
|
18
18
|
"scope",
|
|
19
19
|
"starting-style"
|
|
20
|
-
]),
|
|
20
|
+
]), ye = 256, be = /* @__PURE__ */ new Set([
|
|
21
21
|
"serif",
|
|
22
22
|
"sans-serif",
|
|
23
23
|
"monospace",
|
|
@@ -39,14 +39,14 @@ var se = "reactive-md-styles-1", ce = Object.freeze([
|
|
|
39
39
|
"unset",
|
|
40
40
|
"revert",
|
|
41
41
|
"revert-layer"
|
|
42
|
-
]),
|
|
42
|
+
]), xe = /* @__PURE__ */ new Set([
|
|
43
43
|
"caption",
|
|
44
44
|
"icon",
|
|
45
45
|
"menu",
|
|
46
46
|
"message-box",
|
|
47
47
|
"small-caption",
|
|
48
48
|
"status-bar"
|
|
49
|
-
]),
|
|
49
|
+
]), Se = /* @__PURE__ */ new Set([
|
|
50
50
|
"xx-small",
|
|
51
51
|
"x-small",
|
|
52
52
|
"small",
|
|
@@ -57,33 +57,33 @@ var se = "reactive-md-styles-1", ce = Object.freeze([
|
|
|
57
57
|
"xxx-large",
|
|
58
58
|
"smaller",
|
|
59
59
|
"larger"
|
|
60
|
-
]),
|
|
60
|
+
]), Ce = /^rmd-theme-([a-z][a-z0-9-]*)-font-([0-9a-f]+)$/;
|
|
61
61
|
function w(e, t) {
|
|
62
62
|
return /* @__PURE__ */ Error(`Invalid local theme ${e}: ${t}`);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function we(e) {
|
|
65
65
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
66
66
|
}
|
|
67
67
|
function T(e, t) {
|
|
68
|
-
if (!
|
|
68
|
+
if (!we(e)) throw w(t, "must be an object.");
|
|
69
69
|
return e;
|
|
70
70
|
}
|
|
71
71
|
function E(e, t) {
|
|
72
72
|
if (typeof e != "string" || e.length === 0) throw w(t, "must be a non-empty string.");
|
|
73
|
-
if (e.length >
|
|
74
|
-
if (!
|
|
73
|
+
if (e.length > de) throw w(t, `must not exceed ${de} characters.`);
|
|
74
|
+
if (!pe.test(e)) throw w(t, `"${e}" must be lowercase, start with a letter and use "-", "." or "/" only as separators.`);
|
|
75
75
|
return e;
|
|
76
76
|
}
|
|
77
|
-
function D(e,
|
|
78
|
-
if (!
|
|
79
|
-
if (e === "default") throw w(
|
|
77
|
+
function D(e, n) {
|
|
78
|
+
if (!t(e)) throw w(n, "must be a lowercase kebab-case name that starts with a letter.");
|
|
79
|
+
if (e === "default") throw w(n, "must not replace the reserved built-in \"default\" theme.");
|
|
80
80
|
return e;
|
|
81
81
|
}
|
|
82
82
|
function O(e, t) {
|
|
83
|
-
if (typeof e != "string" || !
|
|
83
|
+
if (typeof e != "string" || !he.test(e)) throw w(t, "must be a semantic version such as \"1.0.0\".");
|
|
84
84
|
return e;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function k(e, t) {
|
|
87
87
|
if (e === void 0) return Object.freeze(["light", "dark"]);
|
|
88
88
|
if (!Array.isArray(e)) throw w(t, "must be an array of \"light\" and \"dark\".");
|
|
89
89
|
let n = [];
|
|
@@ -95,7 +95,7 @@ function we(e, t) {
|
|
|
95
95
|
if (!n.includes("light") || !n.includes("dark")) throw w(t, "must declare both \"light\" and \"dark\".");
|
|
96
96
|
return Object.freeze(n);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function A(e, t) {
|
|
99
99
|
let n = e[t], r = t + 1;
|
|
100
100
|
for (; r < e.length;) if (e[r] === "\\") r += 2;
|
|
101
101
|
else {
|
|
@@ -104,11 +104,11 @@ function k(e, t) {
|
|
|
104
104
|
}
|
|
105
105
|
return e.length;
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function j(e, t, n, r) {
|
|
108
108
|
let i = 0;
|
|
109
109
|
for (let a = t; a < e.length; a += 1) {
|
|
110
110
|
let t = e[a];
|
|
111
|
-
if (t === "\"" || t === "'") a =
|
|
111
|
+
if (t === "\"" || t === "'") a = A(e, a) - 1;
|
|
112
112
|
else if (t === "/" && e[a + 1] === "*") {
|
|
113
113
|
let t = e.indexOf("*/", a + 2);
|
|
114
114
|
a = (t < 0 ? e.length : t + 2) - 1;
|
|
@@ -145,7 +145,7 @@ function Ee(e, t, n, r) {
|
|
|
145
145
|
let i = t;
|
|
146
146
|
for (; i < e.length && e[i] !== "(";) i += 1;
|
|
147
147
|
if (i >= e.length) throw w(r, `has a malformed ${n}() value.`);
|
|
148
|
-
let a =
|
|
148
|
+
let a = j(e, i, "(", ")");
|
|
149
149
|
if (a <= i + 1 || e[a - 1] !== ")") throw w(r, `has an unterminated ${n}() value.`);
|
|
150
150
|
return {
|
|
151
151
|
body: e.slice(i + 1, a - 1),
|
|
@@ -157,7 +157,7 @@ function De(e, t) {
|
|
|
157
157
|
for (; n < e.length;) {
|
|
158
158
|
let r = e[n];
|
|
159
159
|
if (r === "\"" || r === "'") {
|
|
160
|
-
let i =
|
|
160
|
+
let i = A(e, n);
|
|
161
161
|
if (i > e.length || e[i - 1] !== r) throw w(t, "has an unterminated image-set() string.");
|
|
162
162
|
let a = e.slice(n + 1, i - 1).trim();
|
|
163
163
|
if (!/^data:/i.test(a)) throw w(t, "image-set() entries must be inline data: URLs; network and file URLs are not allowed.");
|
|
@@ -173,7 +173,7 @@ function Oe(e, t, n = !1) {
|
|
|
173
173
|
let r = 0;
|
|
174
174
|
for (; r < e.length;) {
|
|
175
175
|
let i = e[r];
|
|
176
|
-
if (i === "\"" || i === "'") r =
|
|
176
|
+
if (i === "\"" || i === "'") r = A(e, r);
|
|
177
177
|
else if (i === "/" && e[r + 1] === "*") {
|
|
178
178
|
let t = e.indexOf("*/", r + 2);
|
|
179
179
|
r = t < 0 ? e.length : t + 2;
|
|
@@ -206,7 +206,7 @@ function Ae(e) {
|
|
|
206
206
|
let t = [], n = 0, r = 0, i = 0;
|
|
207
207
|
for (let a = 0; a < e.length; a += 1) {
|
|
208
208
|
let o = e[a];
|
|
209
|
-
if (o === "\"" || o === "'") a =
|
|
209
|
+
if (o === "\"" || o === "'") a = A(e, a) - 1;
|
|
210
210
|
else if (o === "/" && e[a + 1] === "*") {
|
|
211
211
|
let t = e.indexOf("*/", a + 2);
|
|
212
212
|
a = (t < 0 ? e.length : t + 2) - 1;
|
|
@@ -215,10 +215,10 @@ function Ae(e) {
|
|
|
215
215
|
return t.push(e.slice(n)), t;
|
|
216
216
|
}
|
|
217
217
|
function je(e, t) {
|
|
218
|
-
let n = e.trim(), r = `[data-rmd-theme="${t}"]`, i =
|
|
218
|
+
let n = e.trim(), r = `[data-rmd-theme="${t}"]`, i = ge.exec(n);
|
|
219
219
|
return i ? `${r}${n.slice(i[0].length)}` : `${r} ${n}`;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function M(e, t) {
|
|
222
222
|
let n = t;
|
|
223
223
|
for (; n < e.length;) if (/\s/.test(e[n])) n += 1;
|
|
224
224
|
else if (e[n] === "/" && e[n + 1] === "*") {
|
|
@@ -231,7 +231,7 @@ function Me(e, t) {
|
|
|
231
231
|
let n = e.toLowerCase(), r = /:has\s*\(/g;
|
|
232
232
|
for (let i = r.exec(n); i; i = r.exec(n)) {
|
|
233
233
|
if (r.lastIndex = i.index + 1, i.index >= t) continue;
|
|
234
|
-
let n = i.index + i[0].length - 1, a =
|
|
234
|
+
let n = i.index + i[0].length - 1, a = j(e, n, "(", ")"), o = e.slice(n + 1, Math.max(n + 1, a - 1));
|
|
235
235
|
for (let t of Ae(o)) if (/^\s*[+~]/.test(t)) throw w("theme.css", `selector "${e.trim()}" uses :has() with a sibling combinator that can escape the theme root.`);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -239,15 +239,15 @@ function Ne(e) {
|
|
|
239
239
|
let t = e.trim();
|
|
240
240
|
if (t === "") return;
|
|
241
241
|
if (t[0] === "+" || t[0] === "~") throw w("theme.css", `selector "${t}" begins with a sibling combinator and cannot be scoped.`);
|
|
242
|
-
let n =
|
|
242
|
+
let n = ge.exec(t);
|
|
243
243
|
if (n) {
|
|
244
244
|
let e = n[0].length;
|
|
245
245
|
for (; e < t.length;) {
|
|
246
246
|
let n = t[e];
|
|
247
247
|
if (/\s/.test(n) || n === "+" || n === "~" || n === ">" || n === ",") break;
|
|
248
|
-
n === "[" ? e =
|
|
248
|
+
n === "[" ? e = j(t, e, "[", "]") : n === "(" ? e = j(t, e, "(", ")") : e += 1;
|
|
249
249
|
}
|
|
250
|
-
let r =
|
|
250
|
+
let r = M(t, e);
|
|
251
251
|
if (t[r] === "+" || t[r] === "~") throw w("theme.css", `selector "${t}" uses a sibling combinator that can escape the theme root.`);
|
|
252
252
|
Me(t, e);
|
|
253
253
|
}
|
|
@@ -256,16 +256,16 @@ function Pe(e, t) {
|
|
|
256
256
|
let n = Ae(e).map((e) => e.trim()).filter(Boolean);
|
|
257
257
|
if (n.length === 0) return e.trim();
|
|
258
258
|
for (let e of n) {
|
|
259
|
-
if (
|
|
259
|
+
if (_e.test(e)) throw w("theme.css", `selector "${e}" targets the host document; scope it under the theme root instead.`);
|
|
260
260
|
Ne(e);
|
|
261
261
|
}
|
|
262
262
|
return n.map((e) => je(e, t)).join(", ");
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function N(e, t) {
|
|
265
265
|
let n = 1;
|
|
266
266
|
for (let r = t; r < e.length; r += 1) {
|
|
267
267
|
let t = e[r];
|
|
268
|
-
if (t === "\"" || t === "'") r =
|
|
268
|
+
if (t === "\"" || t === "'") r = A(e, r) - 1;
|
|
269
269
|
else if (t === "/" && e[r + 1] === "*") {
|
|
270
270
|
let t = e.indexOf("*/", r + 2);
|
|
271
271
|
r = (t < 0 ? e.length : t + 2) - 1;
|
|
@@ -274,7 +274,7 @@ function M(e, t) {
|
|
|
274
274
|
}
|
|
275
275
|
return e.length;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function P(e) {
|
|
278
278
|
return e.trim().replace(/\s+/g, " ").toLowerCase();
|
|
279
279
|
}
|
|
280
280
|
function Fe(e) {
|
|
@@ -308,13 +308,13 @@ function Ie(e) {
|
|
|
308
308
|
function Le(e, t) {
|
|
309
309
|
return `rmd-theme-${e}-font-${Fe(t).map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
let t =
|
|
311
|
+
function Re(e) {
|
|
312
|
+
let t = Ce.exec(e);
|
|
313
313
|
if (!t || t[2].length % 2 != 0) return null;
|
|
314
314
|
let n = [];
|
|
315
315
|
for (let e = 0; e < t[2].length; e += 2) n.push(Number.parseInt(t[2].slice(e, e + 2), 16));
|
|
316
316
|
let r = Ie(n);
|
|
317
|
-
return r === null || r.length === 0 ||
|
|
317
|
+
return r === null || r.length === 0 || P(r) !== r ? null : {
|
|
318
318
|
themeName: t[1],
|
|
319
319
|
original: r
|
|
320
320
|
};
|
|
@@ -322,7 +322,7 @@ function P(e) {
|
|
|
322
322
|
function F(e) {
|
|
323
323
|
return e === void 0 ? !1 : /[A-Za-z0-9_-]/.test(e) || e.codePointAt(0) >= 128;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function ze(e, t) {
|
|
326
326
|
let n = e[t];
|
|
327
327
|
if (n === void 0) return !1;
|
|
328
328
|
if (/[A-Za-z_]/.test(n) || n.codePointAt(0) >= 128) return !0;
|
|
@@ -332,7 +332,7 @@ function Re(e, t) {
|
|
|
332
332
|
}
|
|
333
333
|
return !1;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Be(e, t) {
|
|
336
336
|
let n = e[t];
|
|
337
337
|
if (n === void 0) return !1;
|
|
338
338
|
if (n >= "0" && n <= "9") return !0;
|
|
@@ -354,7 +354,7 @@ function I(e) {
|
|
|
354
354
|
}
|
|
355
355
|
let i = n;
|
|
356
356
|
if (r === "\"" || r === "'") {
|
|
357
|
-
let r =
|
|
357
|
+
let r = A(e, n);
|
|
358
358
|
t.push({
|
|
359
359
|
type: "string",
|
|
360
360
|
text: e.slice(i, r),
|
|
@@ -371,7 +371,7 @@ function I(e) {
|
|
|
371
371
|
name: "",
|
|
372
372
|
stringValue: ""
|
|
373
373
|
}), n += 1;
|
|
374
|
-
else if (
|
|
374
|
+
else if (Be(e, n)) {
|
|
375
375
|
let r = n;
|
|
376
376
|
for ((e[r] === "+" || e[r] === "-") && (r += 1); e[r] >= "0" && e[r] <= "9";) r += 1;
|
|
377
377
|
if (e[r] === ".") for (r += 1; e[r] >= "0" && e[r] <= "9";) r += 1;
|
|
@@ -384,7 +384,7 @@ function I(e) {
|
|
|
384
384
|
}
|
|
385
385
|
let a = "number";
|
|
386
386
|
if (e[r] === "%") r += 1, a = "percentage";
|
|
387
|
-
else if (
|
|
387
|
+
else if (ze(e, r)) {
|
|
388
388
|
for (r += 1; F(e[r]);) r += 1;
|
|
389
389
|
a = "dimension";
|
|
390
390
|
}
|
|
@@ -396,12 +396,12 @@ function I(e) {
|
|
|
396
396
|
name: "",
|
|
397
397
|
stringValue: ""
|
|
398
398
|
}), n = r;
|
|
399
|
-
} else if (
|
|
399
|
+
} else if (ze(e, n)) {
|
|
400
400
|
let r = n + 1;
|
|
401
401
|
for (; F(e[r]);) r += 1;
|
|
402
402
|
let a = e.slice(n, r).toLowerCase();
|
|
403
403
|
if (e[r] === "(") {
|
|
404
|
-
let o =
|
|
404
|
+
let o = j(e, r, "(", ")"), s = Math.min(o, e.length);
|
|
405
405
|
t.push({
|
|
406
406
|
type: "function",
|
|
407
407
|
text: e.slice(n, s),
|
|
@@ -421,7 +421,7 @@ function I(e) {
|
|
|
421
421
|
stringValue: ""
|
|
422
422
|
}), n = r;
|
|
423
423
|
} else if (r === "(") {
|
|
424
|
-
let r =
|
|
424
|
+
let r = j(e, n, "(", ")"), a = Math.min(r, e.length);
|
|
425
425
|
t.push({
|
|
426
426
|
type: "function",
|
|
427
427
|
text: e.slice(n, a),
|
|
@@ -441,14 +441,14 @@ function I(e) {
|
|
|
441
441
|
}
|
|
442
442
|
return t;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
return
|
|
444
|
+
function Ve(e) {
|
|
445
|
+
return M(e, 0) === e.length;
|
|
446
446
|
}
|
|
447
447
|
function L(e) {
|
|
448
448
|
let t = I(e);
|
|
449
449
|
if (t.length === 0) return null;
|
|
450
450
|
if (t.length === 1 && t[0].type === "string") {
|
|
451
|
-
let e =
|
|
451
|
+
let e = P(t[0].stringValue);
|
|
452
452
|
return e === "" ? null : {
|
|
453
453
|
key: e,
|
|
454
454
|
start: t[0].start,
|
|
@@ -456,9 +456,9 @@ function L(e) {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
if (t[0].type === "string") return null;
|
|
459
|
-
for (let n = 0; n < t.length; n += 1) if (t[n].type !== "ident" || n > 0 && !
|
|
460
|
-
if (t.length === 1 && (C.has(t[0].name) ||
|
|
461
|
-
let n =
|
|
459
|
+
for (let n = 0; n < t.length; n += 1) if (t[n].type !== "ident" || n > 0 && !Ve(e.slice(t[n - 1].end, t[n].start))) return null;
|
|
460
|
+
if (t.length === 1 && (C.has(t[0].name) || be.has(t[0].name))) return null;
|
|
461
|
+
let n = P(t.map((e) => e.text).join(" "));
|
|
462
462
|
return n === "" ? null : {
|
|
463
463
|
key: n,
|
|
464
464
|
start: t[0].start,
|
|
@@ -469,11 +469,11 @@ function R(e) {
|
|
|
469
469
|
let t = [], n = 0, r = 0;
|
|
470
470
|
for (; r < e.length;) {
|
|
471
471
|
let i = e[r];
|
|
472
|
-
if (i === "\"" || i === "'") r =
|
|
472
|
+
if (i === "\"" || i === "'") r = A(e, r);
|
|
473
473
|
else if (i === "/" && e[r + 1] === "*") {
|
|
474
474
|
let t = e.indexOf("*/", r + 2);
|
|
475
475
|
r = t < 0 ? e.length : t + 2;
|
|
476
|
-
} else i === "(" || i === "[" ? r =
|
|
476
|
+
} else i === "(" || i === "[" ? r = j(e, r, i, i === "(" ? ")" : "]") : (i === "," && (t.push({
|
|
477
477
|
start: n,
|
|
478
478
|
end: r
|
|
479
479
|
}), n = r + 1), r += 1);
|
|
@@ -490,7 +490,7 @@ function z(e) {
|
|
|
490
490
|
important: ""
|
|
491
491
|
};
|
|
492
492
|
let n = t[t.length - 1], r = t[t.length - 2];
|
|
493
|
-
return n.type !== "ident" || n.name !== "important" || r.type !== "delimiter" || r.text !== "!" || !
|
|
493
|
+
return n.type !== "ident" || n.name !== "important" || r.type !== "delimiter" || r.text !== "!" || !Ve(e.slice(r.end, n.start)) ? {
|
|
494
494
|
body: e,
|
|
495
495
|
important: ""
|
|
496
496
|
} : {
|
|
@@ -504,7 +504,7 @@ function B(e, t) {
|
|
|
504
504
|
for (let t of n) t.start < i || (r += e.slice(i, t.start) + t.text, i = t.end);
|
|
505
505
|
return r + e.slice(i);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function He(e) {
|
|
508
508
|
return `"${e}"`;
|
|
509
509
|
}
|
|
510
510
|
function V(e, t, n = 0) {
|
|
@@ -518,12 +518,12 @@ function V(e, t, n = 0) {
|
|
|
518
518
|
n && a.push({
|
|
519
519
|
start: e.start + o.start,
|
|
520
520
|
end: e.start + o.end,
|
|
521
|
-
text:
|
|
521
|
+
text: He(n)
|
|
522
522
|
});
|
|
523
523
|
continue;
|
|
524
524
|
}
|
|
525
525
|
let s = I(i);
|
|
526
|
-
if (s.length !== 0 && (s.length !== 1 || s[0].type !== "ident" || !
|
|
526
|
+
if (s.length !== 0 && (s.length !== 1 || s[0].type !== "ident" || !be.has(s[0].name) && !C.has(s[0].name))) {
|
|
527
527
|
if (s.length === 1 && s[0].type === "function" && s[0].name === "var") {
|
|
528
528
|
let r = s[0], i = r.text.indexOf("("), o = r.text.slice(i + 1, -1), c = R(o), l = I(o.slice(0, c[0].end));
|
|
529
529
|
if (!r.text.endsWith(")") || l.length !== 1 || l[0].type !== "ident" || !l[0].text.startsWith("--")) throw w("theme.css", "font-family var() must start with a custom property name.");
|
|
@@ -540,13 +540,13 @@ function V(e, t, n = 0) {
|
|
|
540
540
|
}
|
|
541
541
|
return B(r, a) + i;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function Ue(e) {
|
|
544
544
|
let t = I(e);
|
|
545
|
-
if (t.length === 0 || t.length === 1 && t[0].type === "ident" && (
|
|
545
|
+
if (t.length === 0 || t.length === 1 && t[0].type === "ident" && (xe.has(t[0].name) || C.has(t[0].name))) return null;
|
|
546
546
|
let n = -1;
|
|
547
547
|
for (let e = 0; e < t.length; e += 1) {
|
|
548
548
|
let r = t[e];
|
|
549
|
-
if (r.type === "dimension" && !/(?:deg|grad|rad|turn)$/i.test(r.text) || r.type === "percentage" || r.type === "ident" &&
|
|
549
|
+
if (r.type === "dimension" && !/(?:deg|grad|rad|turn)$/i.test(r.text) || r.type === "percentage" || r.type === "ident" && Se.has(r.name) || r.type === "number" && Number(r.text) === 0) {
|
|
550
550
|
n = e;
|
|
551
551
|
break;
|
|
552
552
|
}
|
|
@@ -567,12 +567,12 @@ function He(e) {
|
|
|
567
567
|
let r = n + 1, i = t[r];
|
|
568
568
|
return i?.type === "delimiter" && i.text === "/" && (r += 2), r >= t.length ? null : t[r].start;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function We(e, t) {
|
|
571
571
|
if (t.size === 0) return e;
|
|
572
|
-
let { body: n, important: r } = z(e), i =
|
|
572
|
+
let { body: n, important: r } = z(e), i = Ue(n);
|
|
573
573
|
if (i === null) {
|
|
574
574
|
let t = I(n);
|
|
575
|
-
if (t.length === 1 && t[0].type === "ident" && (
|
|
575
|
+
if (t.length === 1 && t[0].type === "ident" && (xe.has(t[0].name) || C.has(t[0].name)) || t.length === 1 && t[0].type === "function" && t[0].name === "var" && R(t[0].text.slice(t[0].text.indexOf("(") + 1, -1)).length === 1) return e;
|
|
576
576
|
throw w("theme.css", "unsupported font shorthand; use an explicit font size (including calc/min/max/clamp) and a family list.");
|
|
577
577
|
}
|
|
578
578
|
let a = V(n.slice(i), t);
|
|
@@ -581,7 +581,7 @@ function Ue(e, t) {
|
|
|
581
581
|
function H(e, t = !1, n = 0) {
|
|
582
582
|
if (n > 64) throw w("theme.css", "nested font declarations exceed 64 levels.");
|
|
583
583
|
let r = [], i = (i) => {
|
|
584
|
-
let a =
|
|
584
|
+
let a = N(e, i + 1);
|
|
585
585
|
if (t) for (let t of H(e.slice(i + 1, a), !0, n + 1)) r.push({
|
|
586
586
|
name: t.name,
|
|
587
587
|
valueStart: i + 1 + t.valueStart,
|
|
@@ -589,7 +589,7 @@ function H(e, t = !1, n = 0) {
|
|
|
589
589
|
});
|
|
590
590
|
return Math.min(a + 1, e.length);
|
|
591
591
|
}, a = 0;
|
|
592
|
-
for (; a < e.length && (a =
|
|
592
|
+
for (; a < e.length && (a = M(e, a), !(a >= e.length));) {
|
|
593
593
|
if (e[a] === ";" || e[a] === "}") {
|
|
594
594
|
a += 1;
|
|
595
595
|
continue;
|
|
@@ -601,9 +601,9 @@ function H(e, t = !1, n = 0) {
|
|
|
601
601
|
let t = a, n = a;
|
|
602
602
|
for (; n < e.length;) {
|
|
603
603
|
let t = e[n];
|
|
604
|
-
if (t === "\"" || t === "'") n =
|
|
605
|
-
else if (t === "/" && e[n + 1] === "*") n =
|
|
606
|
-
else if (t === "(" || t === "[") n =
|
|
604
|
+
if (t === "\"" || t === "'") n = A(e, n);
|
|
605
|
+
else if (t === "/" && e[n + 1] === "*") n = M(e, n);
|
|
606
|
+
else if (t === "(" || t === "[") n = j(e, n, t, t === "(" ? ")" : "]");
|
|
607
607
|
else {
|
|
608
608
|
if (t === ":" || t === ";" || t === "{" || t === "}") break;
|
|
609
609
|
n += 1;
|
|
@@ -617,10 +617,10 @@ function H(e, t = !1, n = 0) {
|
|
|
617
617
|
let o = I(e.slice(t, n)), s = o.length === 1 && o[0].type === "ident" ? o[0] : void 0, c = s?.text ?? "", l = c.startsWith("--") ? c : c.toLowerCase(), u = n + 1, d = u;
|
|
618
618
|
for (; d < e.length;) {
|
|
619
619
|
let t = e[d];
|
|
620
|
-
if (t === "\"" || t === "'") d =
|
|
621
|
-
else if (t === "/" && e[d + 1] === "*") d =
|
|
622
|
-
else if (t === "(" || t === "[") d =
|
|
623
|
-
else if (t === "{" && c.startsWith("--")) d =
|
|
620
|
+
if (t === "\"" || t === "'") d = A(e, d);
|
|
621
|
+
else if (t === "/" && e[d + 1] === "*") d = M(e, d);
|
|
622
|
+
else if (t === "(" || t === "[") d = j(e, d, t, t === "(" ? ")" : "]");
|
|
623
|
+
else if (t === "{" && c.startsWith("--")) d = N(e, d + 1) + 1;
|
|
624
624
|
else {
|
|
625
625
|
if (t === ";" || t === "{" || t === "}") break;
|
|
626
626
|
d += 1;
|
|
@@ -634,13 +634,18 @@ function H(e, t = !1, n = 0) {
|
|
|
634
634
|
}
|
|
635
635
|
return r;
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Ge(e, t) {
|
|
638
638
|
if (t.size === 0) return e;
|
|
639
639
|
let n = [];
|
|
640
640
|
for (let r of H(e, !0)) {
|
|
641
|
-
let i =
|
|
641
|
+
let i = [
|
|
642
|
+
"font-family",
|
|
643
|
+
"--font-sans",
|
|
644
|
+
"--font-serif",
|
|
645
|
+
"--font-mono"
|
|
646
|
+
].includes(r.name);
|
|
642
647
|
if (!i && r.name !== "font") continue;
|
|
643
|
-
let a = e.slice(r.valueStart, r.valueEnd), o = i ? V(a, t) :
|
|
648
|
+
let a = e.slice(r.valueStart, r.valueEnd), o = i ? V(a, t) : We(a, t);
|
|
644
649
|
o !== a && n.push({
|
|
645
650
|
start: r.valueStart,
|
|
646
651
|
end: r.valueEnd,
|
|
@@ -649,7 +654,7 @@ function We(e, t) {
|
|
|
649
654
|
}
|
|
650
655
|
return B(e, n);
|
|
651
656
|
}
|
|
652
|
-
function
|
|
657
|
+
function Ke(e, t, n) {
|
|
653
658
|
let r = 0;
|
|
654
659
|
for (; r < e.length;) {
|
|
655
660
|
let i = e[r];
|
|
@@ -663,17 +668,17 @@ function Ge(e, t, n) {
|
|
|
663
668
|
continue;
|
|
664
669
|
}
|
|
665
670
|
if (i === "{") {
|
|
666
|
-
r =
|
|
671
|
+
r = N(e, r + 1) + 1;
|
|
667
672
|
continue;
|
|
668
673
|
}
|
|
669
674
|
let a = r, o = r;
|
|
670
675
|
for (; o < e.length;) {
|
|
671
676
|
let t = e[o];
|
|
672
|
-
if (t === "\"" || t === "'") o =
|
|
677
|
+
if (t === "\"" || t === "'") o = A(e, o);
|
|
673
678
|
else if (t === "/" && e[o + 1] === "*") {
|
|
674
679
|
let t = e.indexOf("*/", o + 2);
|
|
675
680
|
o = t < 0 ? e.length : t + 2;
|
|
676
|
-
} else if (t === "(" || t === "[") o =
|
|
681
|
+
} else if (t === "(" || t === "[") o = j(e, o, t, t === "(" ? ")" : "]");
|
|
677
682
|
else {
|
|
678
683
|
if (t === "{" || t === ";" || t === "}") break;
|
|
679
684
|
o += 1;
|
|
@@ -684,15 +689,15 @@ function Ge(e, t, n) {
|
|
|
684
689
|
r = o + 1;
|
|
685
690
|
continue;
|
|
686
691
|
}
|
|
687
|
-
let s =
|
|
692
|
+
let s = N(e, o + 1), c = e.slice(a, o).trim();
|
|
688
693
|
if (c.startsWith("@")) {
|
|
689
694
|
let r = (/^@([A-Za-z-]+)/.exec(c)?.[1] ?? "").toLowerCase();
|
|
690
|
-
r === "font-face" ? n(e.slice(o + 1, s), t) :
|
|
695
|
+
r === "font-face" ? n(e.slice(o + 1, s), t) : ve.has(r) && Ke(e.slice(o + 1, s), t, n);
|
|
691
696
|
}
|
|
692
697
|
r = Math.min(s + 1, e.length);
|
|
693
698
|
}
|
|
694
699
|
}
|
|
695
|
-
function
|
|
700
|
+
function qe(e, t) {
|
|
696
701
|
let n = H(e).filter((e) => e.name === "font-family");
|
|
697
702
|
if (n.length === 0) throw w(t, "@font-face must declare a font-family descriptor.");
|
|
698
703
|
if (n.length > 1) throw w(t, "@font-face may declare font-family only once.");
|
|
@@ -701,19 +706,19 @@ function Ke(e, t) {
|
|
|
701
706
|
if (R(r).length !== 1) throw w(t, "@font-face font-family must be a single family name, not a list.");
|
|
702
707
|
let a = L(r);
|
|
703
708
|
if (!a) throw w(t, "@font-face font-family must be one quoted or unquoted family name; generic families, keywords, var() and other functions are not allowed.");
|
|
704
|
-
if (Fe(
|
|
709
|
+
if (Fe(Re(a.key)?.original ?? a.key).length > ye) throw w(t, `@font-face font-family must not exceed ${ye} UTF-8 bytes.`);
|
|
705
710
|
return a.key;
|
|
706
711
|
}
|
|
707
|
-
function
|
|
712
|
+
function Je(e, t, n) {
|
|
708
713
|
let r = /* @__PURE__ */ new Map();
|
|
709
|
-
for (let i of e)
|
|
710
|
-
let i =
|
|
714
|
+
for (let i of e) Ke(i.css, n, (e, n) => {
|
|
715
|
+
let i = qe(e, n), a = Re(i), o = a ? a.original : i, s = Le(t, o), c = r.get(i);
|
|
711
716
|
if (c !== void 0 && c !== s) throw w(n, `@font-face family "${i}" maps to more than one name.`);
|
|
712
717
|
r.set(i, s), r.set(o, s);
|
|
713
718
|
});
|
|
714
719
|
return r;
|
|
715
720
|
}
|
|
716
|
-
function
|
|
721
|
+
function Ye(e, t, n) {
|
|
717
722
|
let r = H(e).filter((e) => e.name === "font-family");
|
|
718
723
|
if (r.length !== 1) throw w(n, "@font-face must declare exactly one font-family descriptor.");
|
|
719
724
|
let i = r[0], { body: a } = z(e.slice(i.valueStart, i.valueEnd));
|
|
@@ -725,14 +730,14 @@ function Je(e, t, n) {
|
|
|
725
730
|
return B(e, [{
|
|
726
731
|
start: i.valueStart + o.start,
|
|
727
732
|
end: i.valueStart + o.end,
|
|
728
|
-
text:
|
|
733
|
+
text: He(s)
|
|
729
734
|
}]);
|
|
730
735
|
}
|
|
731
|
-
var
|
|
732
|
-
function
|
|
736
|
+
var Xe = /* @__PURE__ */ new Map();
|
|
737
|
+
function Ze(e) {
|
|
733
738
|
return e.replace(/\/\*[\s\S]*?\*\//g, " ").trim().replace(/^@layer\b/i, "@layer").replace(/\s+/g, " ").replace(/\s*,\s*/g, ", ");
|
|
734
739
|
}
|
|
735
|
-
function U(e, t, n =
|
|
740
|
+
function U(e, t, n = Xe, r = !1) {
|
|
736
741
|
let i = "", a = 0;
|
|
737
742
|
for (; a < e.length;) {
|
|
738
743
|
let o = e[a];
|
|
@@ -748,12 +753,12 @@ function U(e, t, n = Ye, r = !1) {
|
|
|
748
753
|
let s = a, c = a;
|
|
749
754
|
for (; c < e.length;) {
|
|
750
755
|
let t = e[c];
|
|
751
|
-
if (t === "\"" || t === "'") c =
|
|
756
|
+
if (t === "\"" || t === "'") c = A(e, c);
|
|
752
757
|
else if (t === "/" && e[c + 1] === "*") {
|
|
753
758
|
let t = e.indexOf("*/", c + 2);
|
|
754
759
|
c = t < 0 ? e.length : t + 2;
|
|
755
|
-
} else if (t === "(") c =
|
|
756
|
-
else if (t === "[") c =
|
|
760
|
+
} else if (t === "(") c = j(e, c, "(", ")");
|
|
761
|
+
else if (t === "[") c = j(e, c, "[", "]");
|
|
757
762
|
else {
|
|
758
763
|
if (t === "{" || t === ";" || t === "}") break;
|
|
759
764
|
c += 1;
|
|
@@ -765,44 +770,44 @@ function U(e, t, n = Ye, r = !1) {
|
|
|
765
770
|
}
|
|
766
771
|
let l = e.slice(s, c), u = e[c];
|
|
767
772
|
if (u === ";" || u === "}") {
|
|
768
|
-
let e =
|
|
769
|
-
if (!r && (e === "@layer rmd.themes" || `${e};` ===
|
|
773
|
+
let e = Ze(l);
|
|
774
|
+
if (!r && (e === "@layer rmd.themes" || `${e};` === y)) {
|
|
770
775
|
a = c + 1;
|
|
771
776
|
continue;
|
|
772
777
|
}
|
|
773
778
|
i += l + u, a = c + 1;
|
|
774
779
|
continue;
|
|
775
780
|
}
|
|
776
|
-
let d =
|
|
781
|
+
let d = N(e, c + 1), f = e.slice(c + 1, d), p = l.trim();
|
|
777
782
|
if (p.startsWith("@")) {
|
|
778
783
|
let e = (/^@([A-Za-z-]+)/.exec(p)?.[1] ?? "").toLowerCase();
|
|
779
784
|
if (e === "import") throw w("theme.css", "must not use @import.");
|
|
780
785
|
if (e === "keyframes" || e.endsWith("-keyframes")) throw w("theme.css", `@${e} declares a global name; phase one only supports document-scoped CSS.`);
|
|
781
|
-
if (e === "font-face") i += `${p} {${
|
|
782
|
-
else if (e === "layer" && !r &&
|
|
786
|
+
if (e === "font-face") i += `${p} {${Ye(f, n, "theme.css")}}`;
|
|
787
|
+
else if (e === "layer" && !r && Ze(p) === "@layer rmd.themes") i += U(f, t, n, !0).trim();
|
|
783
788
|
else {
|
|
784
|
-
let a =
|
|
789
|
+
let a = ve.has(e) ? U(f, t, n, r || e === "layer") : f;
|
|
785
790
|
i += `${p} {${a}}`;
|
|
786
791
|
}
|
|
787
|
-
} else i += `${Pe(p, t)} {${
|
|
792
|
+
} else i += `${Pe(p, t)} {${Ge(f, n)}}`;
|
|
788
793
|
a = Math.min(d + 1, e.length);
|
|
789
794
|
}
|
|
790
795
|
return i;
|
|
791
796
|
}
|
|
792
|
-
function W(e, t, n =
|
|
793
|
-
return `${
|
|
797
|
+
function W(e, t, n = Xe) {
|
|
798
|
+
return `${y}\n@layer ${ue} {\n${U(e, t, n).trim()}\n}`;
|
|
794
799
|
}
|
|
795
800
|
function G(e, t) {
|
|
796
801
|
if (!Array.isArray(e)) throw w(t, "must be an array of { id, css } resources.");
|
|
797
|
-
if (e.length >
|
|
802
|
+
if (e.length > fe) throw w(t, `may contain at most ${fe} resources.`);
|
|
798
803
|
let n = /* @__PURE__ */ new Set(), r = [], i = 0;
|
|
799
804
|
for (let a = 0; a < e.length; a += 1) {
|
|
800
805
|
let o = e[a], s = `${t}[${a}]`;
|
|
801
|
-
if (!
|
|
806
|
+
if (!we(o)) throw w(s, "must be an object.");
|
|
802
807
|
let c = o.id;
|
|
803
808
|
if (typeof c != "string" || c.length === 0) throw w(`${s}.id`, "must be a non-empty string.");
|
|
804
|
-
if (c.length >
|
|
805
|
-
if (!
|
|
809
|
+
if (c.length > b) throw w(`${s}.id`, `must not exceed ${b} characters.`);
|
|
810
|
+
if (!me.test(c)) throw w(`${s}.id`, `"${c}" must start with a letter and use letters, digits, ".", "_", "-" or "/".`);
|
|
806
811
|
if (n.has(c)) throw w(`${s}.id`, `"${c}" is declared more than once.`);
|
|
807
812
|
n.add(c);
|
|
808
813
|
let l = o.css;
|
|
@@ -819,7 +824,7 @@ function G(e, t) {
|
|
|
819
824
|
totalLength: i
|
|
820
825
|
};
|
|
821
826
|
}
|
|
822
|
-
function
|
|
827
|
+
function Qe(e) {
|
|
823
828
|
let t = 0;
|
|
824
829
|
for (let [n, r] of e.entries()) {
|
|
825
830
|
if (r.css.length > x) throw w(`theme.css[${n}].css`, `scoped CSS must not exceed ${x} characters.`);
|
|
@@ -834,81 +839,93 @@ function K(e) {
|
|
|
834
839
|
version: e.version,
|
|
835
840
|
protocol: e.protocol,
|
|
836
841
|
colorSchemes: Object.freeze([...e.colorSchemes]),
|
|
842
|
+
...e.fonts ? { fonts: e.fonts } : {},
|
|
837
843
|
css: Object.freeze(e.css.map((e) => Object.freeze({
|
|
838
844
|
id: e.id,
|
|
839
845
|
css: e.css
|
|
840
846
|
})))
|
|
841
847
|
});
|
|
842
848
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
849
|
+
function $e(e, t) {
|
|
850
|
+
return !e || t.size === 0 ? e : Object.freeze(Object.fromEntries(Object.entries(e).map(([e, n]) => [e, t.get(P(n)) ?? n])));
|
|
851
|
+
}
|
|
852
|
+
function et(t, n) {
|
|
853
|
+
let i = T(t, n), a = E(i.id, `${n}.id`), o = D(i.name, `${n}.name`), s = O(i.version, `${n}.version`);
|
|
854
|
+
if (i.protocol !== "reactive-md-theme-1") throw w(`${n}.protocol`, `must be "${e}".`);
|
|
855
|
+
let c = k(i.colorSchemes, `${n}.colorSchemes`), { resources: l } = G(i.css, `${n}.css`);
|
|
847
856
|
return K({
|
|
848
|
-
id:
|
|
849
|
-
name:
|
|
850
|
-
version:
|
|
851
|
-
protocol:
|
|
852
|
-
colorSchemes:
|
|
853
|
-
css:
|
|
857
|
+
id: a,
|
|
858
|
+
name: o,
|
|
859
|
+
version: s,
|
|
860
|
+
protocol: e,
|
|
861
|
+
colorSchemes: c,
|
|
862
|
+
css: l,
|
|
863
|
+
fonts: r(i.fonts, `${n}.fonts`)
|
|
854
864
|
});
|
|
855
865
|
}
|
|
856
|
-
function q(
|
|
857
|
-
let
|
|
858
|
-
if ((
|
|
859
|
-
let
|
|
866
|
+
function q(t) {
|
|
867
|
+
let n = T(t, "input"), i = E(n.id, "theme.id"), a = D(n.name, "theme.name"), o = O(n.version, "theme.version");
|
|
868
|
+
if ((n.protocol === void 0 ? "reactive-md-theme-1" : n.protocol) !== "reactive-md-theme-1") throw w("theme.protocol", `must be "${e}".`);
|
|
869
|
+
let s = k(n.colorSchemes, "theme.colorSchemes"), { resources: c } = G(n.css, "theme.css"), l = Je(c, a, "theme.css"), u = c.map((e) => Object.freeze({
|
|
860
870
|
id: e.id,
|
|
861
|
-
css: W(e.css,
|
|
871
|
+
css: W(e.css, a, l)
|
|
862
872
|
}));
|
|
863
|
-
return
|
|
864
|
-
id:
|
|
865
|
-
name:
|
|
866
|
-
version:
|
|
867
|
-
protocol:
|
|
868
|
-
colorSchemes:
|
|
869
|
-
css:
|
|
873
|
+
return Qe(u), K({
|
|
874
|
+
id: i,
|
|
875
|
+
name: a,
|
|
876
|
+
version: o,
|
|
877
|
+
protocol: e,
|
|
878
|
+
colorSchemes: s,
|
|
879
|
+
css: u,
|
|
880
|
+
fonts: $e(r(n.fonts, "theme.fonts"), l)
|
|
870
881
|
});
|
|
871
882
|
}
|
|
872
|
-
function
|
|
873
|
-
let t = T(e, "input"), n = E(t.id, "theme.id"),
|
|
874
|
-
for (let e of
|
|
875
|
-
if (
|
|
876
|
-
|
|
883
|
+
function tt(e) {
|
|
884
|
+
let t = T(e, "input"), n = E(t.id, "theme.id"), i = D(t.name, "theme.name"), a = O(t.version, "theme.version"), o = et(t.base, "theme.base"), s = G(t.overrides, "theme.overrides"), c = Je([...o.css, ...s.resources], i, "theme.css"), l = new Set(o.css.map((e) => e.id));
|
|
885
|
+
for (let e of s.resources) {
|
|
886
|
+
if (l.has(e.id)) throw w("theme.overrides", `resource "${e.id}" is already declared by the base theme.`);
|
|
887
|
+
l.add(e.id);
|
|
877
888
|
}
|
|
878
|
-
let
|
|
889
|
+
let u = [...o.css.map((e) => Object.freeze({
|
|
879
890
|
id: e.id,
|
|
880
|
-
css: W(e.css,
|
|
881
|
-
})), ...
|
|
891
|
+
css: W(e.css, i, c)
|
|
892
|
+
})), ...s.resources.map((e) => Object.freeze({
|
|
882
893
|
id: e.id,
|
|
883
|
-
css: W(e.css,
|
|
894
|
+
css: W(e.css, i, c)
|
|
884
895
|
}))];
|
|
885
|
-
|
|
896
|
+
Qe(u);
|
|
897
|
+
let d = r(t.fonts, "theme.fonts"), f = d ? r({
|
|
898
|
+
...o.fonts,
|
|
899
|
+
...d
|
|
900
|
+
}, "theme.fonts") : o.fonts;
|
|
901
|
+
return K({
|
|
886
902
|
id: n,
|
|
887
|
-
name:
|
|
888
|
-
version:
|
|
889
|
-
protocol:
|
|
890
|
-
colorSchemes:
|
|
891
|
-
css:
|
|
903
|
+
name: i,
|
|
904
|
+
version: a,
|
|
905
|
+
protocol: o.protocol,
|
|
906
|
+
colorSchemes: o.colorSchemes,
|
|
907
|
+
css: u,
|
|
908
|
+
fonts: $e(f, c)
|
|
892
909
|
});
|
|
893
910
|
}
|
|
894
|
-
function
|
|
911
|
+
function nt(e) {
|
|
895
912
|
return q(e).css.map((e) => e.css).join("\n");
|
|
896
913
|
}
|
|
897
914
|
// src/sdk/preset.ts
|
|
898
915
|
var J = /* @__PURE__ */ new WeakSet();
|
|
899
|
-
function
|
|
916
|
+
function rt(e, t) {
|
|
900
917
|
let n = t instanceof Error ? t.message : String(t);
|
|
901
918
|
throw Error(`Invalid local preset (themes[${e}]): ${n}`);
|
|
902
919
|
}
|
|
903
920
|
function Y(e) {
|
|
904
921
|
if (typeof e == "object" && e && J.has(e)) return e;
|
|
905
|
-
let t =
|
|
922
|
+
let t = s(e);
|
|
906
923
|
if (t.themes === void 0) return J.add(t), t;
|
|
907
924
|
let n = t.themes.map((e, t) => {
|
|
908
925
|
try {
|
|
909
926
|
return q(e);
|
|
910
927
|
} catch (e) {
|
|
911
|
-
|
|
928
|
+
rt(t, e);
|
|
912
929
|
}
|
|
913
930
|
}), r = Object.freeze({
|
|
914
931
|
...t,
|
|
@@ -916,75 +933,92 @@ function Y(e) {
|
|
|
916
933
|
});
|
|
917
934
|
return J.add(r), r;
|
|
918
935
|
}
|
|
919
|
-
function
|
|
936
|
+
function it(e) {
|
|
920
937
|
return Y(e);
|
|
921
938
|
}
|
|
922
|
-
function
|
|
923
|
-
|
|
939
|
+
function at(e, t) {
|
|
940
|
+
let n = Y(e), { include: r, exclude: i } = t, a = r ?? i;
|
|
941
|
+
if (r !== void 0 && i !== void 0 || !Array.isArray(a)) throw TypeError("Provide exactly one include or exclude array.");
|
|
942
|
+
let o = new Set(n.components.map((e) => e.name)), s = /* @__PURE__ */ new Set();
|
|
943
|
+
for (let e of a) {
|
|
944
|
+
if (!o.has(e) || s.has(e)) throw TypeError(`Invalid or repeated component name: ${e}.`);
|
|
945
|
+
s.add(e);
|
|
946
|
+
}
|
|
947
|
+
let c = n.components.filter((e) => s.has(e.name) === (r !== void 0)), l = new Set(c.map((e) => e.id));
|
|
948
|
+
return it({
|
|
949
|
+
...n,
|
|
950
|
+
components: c,
|
|
951
|
+
...n.authoring ? { authoring: n.authoring.filter((e) => l.has(e.componentId)) } : {}
|
|
952
|
+
});
|
|
924
953
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
954
|
+
function ot(e) {
|
|
955
|
+
return o(e);
|
|
956
|
+
}
|
|
957
|
+
// src/assemblies/default-config.ts
|
|
958
|
+
var st = _.id, ct = _.version, lt = Object.freeze({
|
|
959
|
+
id: st,
|
|
960
|
+
version: ct
|
|
961
|
+
}), ut = 16, dt = /* @__PURE__ */ new Set([
|
|
930
962
|
"presets",
|
|
931
963
|
"components",
|
|
932
964
|
"replacements",
|
|
933
|
-
"themes"
|
|
965
|
+
"themes",
|
|
966
|
+
"fonts"
|
|
934
967
|
]), X = /* @__PURE__ */ new WeakSet();
|
|
935
|
-
function
|
|
936
|
-
|
|
968
|
+
function ft(e) {
|
|
969
|
+
f(e) || m("themes", "each theme must be an object."), g(e, /* @__PURE__ */ new Set([
|
|
937
970
|
"id",
|
|
938
971
|
"name",
|
|
939
972
|
"version",
|
|
940
973
|
"protocol",
|
|
941
974
|
"colorSchemes",
|
|
942
|
-
"css"
|
|
975
|
+
"css",
|
|
976
|
+
"fonts"
|
|
943
977
|
]), "theme");
|
|
944
978
|
try {
|
|
945
979
|
return q(e);
|
|
946
980
|
} catch (e) {
|
|
947
|
-
|
|
981
|
+
m("theme", e instanceof Error ? e.message : String(e));
|
|
948
982
|
}
|
|
949
983
|
}
|
|
950
984
|
function Z(e) {
|
|
951
985
|
if (e === void 0) return Object.freeze([]);
|
|
952
|
-
Array.isArray(e) ||
|
|
986
|
+
Array.isArray(e) || m("themes", "must be an array."), e.length > 16 && m("themes", "accepts at most 16 themes.");
|
|
953
987
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = [];
|
|
954
988
|
for (let i of e) {
|
|
955
|
-
let e =
|
|
956
|
-
t.has(e.id) &&
|
|
989
|
+
let e = ft(i);
|
|
990
|
+
t.has(e.id) && m("themes", `theme id "${e.id}" is declared more than once.`), n.has(e.name) && m("themes", `theme name "${e.name}" is declared more than once.`), t.add(e.id), n.add(e.name), r.push(e);
|
|
957
991
|
}
|
|
958
992
|
return Object.freeze(r.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
|
|
959
993
|
}
|
|
960
|
-
function
|
|
961
|
-
if (typeof e == "string") return e !== "default" && e !==
|
|
962
|
-
if (
|
|
994
|
+
function pt(e, t) {
|
|
995
|
+
if (typeof e == "string") return e !== "default" && e !== _.id && m(`presets[${t}]`, `unsupported preset "${e}"; phase one accepts only the built-in default package.`), _;
|
|
996
|
+
if (f(e) || m(`presets[${t}]`, "must be a preset package, \"default\" or a preset reference."), e.protocol !== void 0 || e.components !== void 0) try {
|
|
963
997
|
return Y(e);
|
|
964
998
|
} catch (e) {
|
|
965
|
-
|
|
999
|
+
m(`presets[${t}]`, e instanceof Error ? e.message : String(e));
|
|
966
1000
|
}
|
|
967
1001
|
let n = e.id, r = e.version;
|
|
968
|
-
return typeof n != "string" &&
|
|
1002
|
+
return typeof n != "string" && m(`presets[${t}].id`, "must be a string."), typeof r != "string" && m(`presets[${t}].version`, "must be a string."), (n === "default" ? _.id : n) !== _.id && m(`presets[${t}]`, `unsupported preset "${n}"; phase one accepts only "${_.id}".`), r !== _.version && m(`presets[${t}].version`, `must be "${_.version}".`), _;
|
|
969
1003
|
}
|
|
970
|
-
function
|
|
971
|
-
if (e === void 0) return Object.freeze([
|
|
972
|
-
Array.isArray(e) ||
|
|
1004
|
+
function mt(e) {
|
|
1005
|
+
if (e === void 0) return Object.freeze([_]);
|
|
1006
|
+
Array.isArray(e) || m("presets", "must be an array.");
|
|
973
1007
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
974
1008
|
for (let r = 0; r < e.length; r += 1) {
|
|
975
|
-
let i =
|
|
976
|
-
n.has(i.id) &&
|
|
1009
|
+
let i = pt(e[r], r);
|
|
1010
|
+
n.has(i.id) && m("presets", `preset "${i.id}" is selected more than once.`), n.add(i.id), t.push(i);
|
|
977
1011
|
}
|
|
978
1012
|
return Object.freeze([...t].sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
|
|
979
1013
|
}
|
|
980
|
-
function
|
|
1014
|
+
function ht(e) {
|
|
981
1015
|
if (e === void 0) return Object.freeze([]);
|
|
982
|
-
Array.isArray(e) ||
|
|
1016
|
+
Array.isArray(e) || m("components", "must be an array.");
|
|
983
1017
|
let t = e.map((e, t) => {
|
|
984
1018
|
try {
|
|
985
|
-
return
|
|
1019
|
+
return a(e);
|
|
986
1020
|
} catch (e) {
|
|
987
|
-
|
|
1021
|
+
m(`components[${t}]`, e instanceof Error ? e.message : String(e));
|
|
988
1022
|
}
|
|
989
1023
|
});
|
|
990
1024
|
return Object.freeze(t.sort((e, t) => {
|
|
@@ -993,44 +1027,45 @@ function ft(e) {
|
|
|
993
1027
|
return n === r ? e.version === t.version ? e.name < t.name ? -1 : +(e.name > t.name) : e.version < t.version ? -1 : 1 : n - r;
|
|
994
1028
|
}));
|
|
995
1029
|
}
|
|
996
|
-
function
|
|
997
|
-
return e === void 0 ? "allow" : (e !== "allow" && e !== "forbid" &&
|
|
998
|
-
}
|
|
999
|
-
function
|
|
1000
|
-
|
|
1001
|
-
let r = Object.freeze({
|
|
1002
|
-
protocol:
|
|
1003
|
-
presets:
|
|
1004
|
-
components:
|
|
1005
|
-
replacementPolicy:
|
|
1006
|
-
themes: Z(e.themes)
|
|
1030
|
+
function gt(e) {
|
|
1031
|
+
return e === void 0 ? "allow" : (e !== "allow" && e !== "forbid" && m("replacements", "must be \"allow\" or \"forbid\"."), e);
|
|
1032
|
+
}
|
|
1033
|
+
function _t(e, t) {
|
|
1034
|
+
f(e) || m(t, "must be an object."), g(e, dt, t);
|
|
1035
|
+
let i = r(e.fonts, "fonts"), a = Object.freeze({
|
|
1036
|
+
protocol: u,
|
|
1037
|
+
presets: mt(e.presets),
|
|
1038
|
+
components: ht(e.components),
|
|
1039
|
+
replacementPolicy: gt(e.replacements),
|
|
1040
|
+
themes: Z(e.themes),
|
|
1041
|
+
...i ? { fonts: i } : {}
|
|
1007
1042
|
});
|
|
1008
|
-
return
|
|
1043
|
+
return n(a) > 16777216 && m(t, `serialized size exceeds the ${re}-byte budget.`), a;
|
|
1009
1044
|
}
|
|
1010
|
-
function
|
|
1045
|
+
function vt(e) {
|
|
1011
1046
|
return Object.freeze({
|
|
1012
1047
|
...e,
|
|
1013
1048
|
presets: Object.freeze(e.presets.map((e) => Y(e))),
|
|
1014
1049
|
themes: Z(e.themes)
|
|
1015
1050
|
});
|
|
1016
1051
|
}
|
|
1017
|
-
function
|
|
1018
|
-
let t =
|
|
1052
|
+
function yt(e) {
|
|
1053
|
+
let t = vt(e), n = ne(t, { legacyProfiles: te }), r = ee(t, n);
|
|
1019
1054
|
return X.add(r), r;
|
|
1020
1055
|
}
|
|
1021
1056
|
function Q(e = {}) {
|
|
1022
|
-
return
|
|
1057
|
+
return yt(_t(e, "config"));
|
|
1023
1058
|
}
|
|
1024
|
-
var
|
|
1025
|
-
function
|
|
1026
|
-
return e === void 0 ?
|
|
1059
|
+
var bt;
|
|
1060
|
+
function xt(e) {
|
|
1061
|
+
return e === void 0 ? bt ??= Q().key : $(e).key;
|
|
1027
1062
|
}
|
|
1028
|
-
function
|
|
1063
|
+
function St(e) {
|
|
1029
1064
|
return new Set(e.legacyKeys.map((e) => e.key));
|
|
1030
1065
|
}
|
|
1031
|
-
function
|
|
1066
|
+
function Ct(e, t) {
|
|
1032
1067
|
let n = $(t ?? Q()), r = e.componentConfigKey;
|
|
1033
|
-
return r === void 0 || r === n.key ||
|
|
1068
|
+
return r === void 0 || r === n.key || St(n).has(r) ? [] : [{
|
|
1034
1069
|
code: "local.extension.config-mismatch",
|
|
1035
1070
|
severity: "error",
|
|
1036
1071
|
message: "The document compiler configuration differs from the installed renderer. Recompile with the same host.config used by host.reactConfig (including Worker requests).",
|
|
@@ -1042,52 +1077,52 @@ function bt(e, t) {
|
|
|
1042
1077
|
column: 1
|
|
1043
1078
|
}];
|
|
1044
1079
|
}
|
|
1045
|
-
function
|
|
1046
|
-
return e.preset.id ===
|
|
1047
|
-
...
|
|
1080
|
+
function wt(e) {
|
|
1081
|
+
return e.preset.id === _.id && e.preset.version === _.version ? _ : Y({
|
|
1082
|
+
..._,
|
|
1048
1083
|
id: e.preset.id,
|
|
1049
1084
|
version: e.preset.version
|
|
1050
1085
|
});
|
|
1051
1086
|
}
|
|
1052
|
-
function
|
|
1053
|
-
let
|
|
1054
|
-
|
|
1055
|
-
let
|
|
1056
|
-
|
|
1057
|
-
let
|
|
1058
|
-
|
|
1059
|
-
let
|
|
1060
|
-
protocol:
|
|
1061
|
-
presets: Object.freeze([
|
|
1062
|
-
components:
|
|
1087
|
+
function Tt(e, t) {
|
|
1088
|
+
let n = oe(e.presets, lt, t)[0] ?? lt, r = d(n, t);
|
|
1089
|
+
r === void 0 && m("presets", `local.config.migration-unsupported: no compatibility profile matches preset "${n.id}" ${n.version}.`);
|
|
1090
|
+
let i = r.legacyKeys[0];
|
|
1091
|
+
i === void 0 && m("presets", `local.config.migration-unsupported: profile "${r.name}" has no legacy key mapping.`), p(r, _.components);
|
|
1092
|
+
let a = wt(r), o = ie(e.components, _.components);
|
|
1093
|
+
o.some((e) => e.replaces !== void 0) && m("config", "replaces is not supported by reactive-md-config/v1.");
|
|
1094
|
+
let s = Z(e.themes), c = Object.freeze({
|
|
1095
|
+
protocol: u,
|
|
1096
|
+
presets: Object.freeze([a]),
|
|
1097
|
+
components: o,
|
|
1063
1098
|
replacementPolicy: "forbid",
|
|
1064
|
-
themes:
|
|
1065
|
-
}),
|
|
1066
|
-
profile:
|
|
1067
|
-
key:
|
|
1068
|
-
})]],
|
|
1069
|
-
return X.add(
|
|
1099
|
+
themes: s
|
|
1100
|
+
}), l = ne(c, { legacyProfiles: t }), f = ae(r.preset, l.components), te = [...l.legacyKeys, ...l.legacyKeys.some((e) => e.key === f) ? [] : [Object.freeze({
|
|
1101
|
+
profile: i.profile,
|
|
1102
|
+
key: f
|
|
1103
|
+
})]], h = ee(c, l, te);
|
|
1104
|
+
return X.add(h), h;
|
|
1070
1105
|
}
|
|
1071
|
-
function $(
|
|
1072
|
-
return typeof
|
|
1106
|
+
function $(e, t = []) {
|
|
1107
|
+
return typeof e == "object" && e && X.has(e) ? e : (f(e) || m("config", "must be an object."), g(e, se, "config"), e.protocol === "reactive-md-config/v1" ? Tt(e, ce(t)) : (e.protocol !== "reactive-md-config/v2" && m("config.protocol", `must be "${c}" (or legacy "${l}").`), yt(h(e.assembly))));
|
|
1073
1108
|
}
|
|
1074
|
-
function
|
|
1109
|
+
function Et(e) {
|
|
1075
1110
|
if (typeof e == "object" && e && X.has(e)) return e.key;
|
|
1076
1111
|
try {
|
|
1077
1112
|
return $(e).key;
|
|
1078
1113
|
} catch {
|
|
1079
1114
|
try {
|
|
1080
|
-
return `invalid:${
|
|
1115
|
+
return `invalid:${i(JSON.stringify(e))}`;
|
|
1081
1116
|
} catch {
|
|
1082
1117
|
return "invalid";
|
|
1083
1118
|
}
|
|
1084
1119
|
}
|
|
1085
1120
|
}
|
|
1086
|
-
function
|
|
1121
|
+
function Dt(e) {
|
|
1087
1122
|
try {
|
|
1088
1123
|
return $(e);
|
|
1089
1124
|
} catch {
|
|
1090
1125
|
return e;
|
|
1091
1126
|
}
|
|
1092
1127
|
}
|
|
1093
|
-
export {
|
|
1128
|
+
export { ke as _, xt as a, y as b, Dt as c, at as d, ot as f, q as g, tt as h, Q as i, Ct as l, nt as m, ct as n, Et as o, Y as p, ut as r, $ as s, st as t, it as u, le as v, ue as x, v as y };
|