reactive-md 0.9.3 → 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 +34 -0
- package/CHANGELOG.md +34 -0
- package/README-ch.md +7 -7
- package/README-en.md +7 -7
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/cli/help.mjs +6 -4
- package/cli/init.mjs +1 -1
- package/cli/migrate.mjs +1 -1
- package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
- package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
- package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
- package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
- package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
- package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
- package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
- package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
- package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
- package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
- package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
- package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
- package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
- package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
- package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
- package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
- package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
- package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
- package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
- package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
- package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
- package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
- package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
- package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
- package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
- package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
- package/dist-library/reactive-md-authoring.js +277 -269
- package/dist-library/reactive-md-build.js +327 -33
- package/dist-library/reactive-md-compiler-session.js +3 -3
- 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 +4 -4
- package/dist-library/reactive-md-default-packs.js +4 -3
- package/dist-library/reactive-md-default-preset.js +3 -3
- package/dist-library/reactive-md-export.js +6 -6
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +18 -17
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +2 -2
- package/dist-library/reactive-md-pack-style-manifest.js +8 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -9
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +5 -5
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +10 -10
- package/dist-library/reactive-md-plugin-network.js +5 -5
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-react-component-accordion.js +3 -3
- package/dist-library/reactive-md-react-component-alert.js +3 -3
- package/dist-library/reactive-md-react-component-anchor.js +3 -3
- package/dist-library/reactive-md-react-component-badge.js +3 -3
- package/dist-library/reactive-md-react-component-card.js +3 -3
- package/dist-library/reactive-md-react-component-chart.js +2 -2
- package/dist-library/reactive-md-react-component-checkbox.js +2 -2
- package/dist-library/reactive-md-react-component-checklist.js +2 -2
- package/dist-library/reactive-md-react-component-choices.js +2 -2
- package/dist-library/reactive-md-react-component-column.js +1 -1
- package/dist-library/reactive-md-react-component-coordinate.js +2 -2
- package/dist-library/reactive-md-react-component-counter.js +2 -2
- package/dist-library/reactive-md-react-component-data-table.js +2 -2
- package/dist-library/reactive-md-react-component-date.js +2 -2
- package/dist-library/reactive-md-react-component-diagram.js +2 -2
- package/dist-library/reactive-md-react-component-disclosure.js +3 -3
- package/dist-library/reactive-md-react-component-edge.js +1 -1
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
- package/dist-library/reactive-md-react-component-gallery.js +2 -2
- package/dist-library/reactive-md-react-component-grid.js +3 -3
- package/dist-library/reactive-md-react-component-if.js +3 -3
- package/dist-library/reactive-md-react-component-input.js +2 -2
- package/dist-library/reactive-md-react-component-jump.js +3 -3
- package/dist-library/reactive-md-react-component-multi-select.js +2 -2
- package/dist-library/reactive-md-react-component-node.js +2 -2
- package/dist-library/reactive-md-react-component-number.js +2 -2
- package/dist-library/reactive-md-react-component-option.js +1 -1
- package/dist-library/reactive-md-react-component-panel.js +3 -3
- package/dist-library/reactive-md-react-component-plot.js +2 -2
- package/dist-library/reactive-md-react-component-progress.js +2 -2
- package/dist-library/reactive-md-react-component-quiz.js +2 -2
- package/dist-library/reactive-md-react-component-radio-group.js +2 -2
- package/dist-library/reactive-md-react-component-range-slider.js +2 -2
- package/dist-library/reactive-md-react-component-section.js +3 -3
- package/dist-library/reactive-md-react-component-select.js +2 -2
- package/dist-library/reactive-md-react-component-slider.js +2 -2
- package/dist-library/reactive-md-react-component-step.js +3 -3
- package/dist-library/reactive-md-react-component-steps.js +3 -3
- package/dist-library/reactive-md-react-component-tab.js +3 -3
- package/dist-library/reactive-md-react-component-table.js +2 -2
- package/dist-library/reactive-md-react-component-tabs.js +3 -3
- package/dist-library/reactive-md-react-component-text.js +3 -3
- package/dist-library/reactive-md-react-component-textarea.js +2 -2
- package/dist-library/reactive-md-react-component-timeline.js +2 -2
- package/dist-library/reactive-md-react-component-timer.js +2 -2
- package/dist-library/reactive-md-react-component-toggle.js +2 -2
- package/dist-library/reactive-md-react-component-tooltip.js +3 -3
- package/dist-library/reactive-md-react-component-validation.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +4 -4
- package/dist-library/reactive-md-react-pack-data.js +3 -3
- package/dist-library/reactive-md-react-pack-layout.js +25 -24
- package/dist-library/reactive-md-react-pack-visuals.js +2 -2
- package/dist-library/reactive-md-react-packed.js +6 -6
- package/dist-library/reactive-md-react-server.js +37 -36
- package/dist-library/reactive-md-react-static-server.js +2 -2
- package/dist-library/reactive-md-react-static.js +1 -1
- package/dist-library/reactive-md-react-unstyled.js +12 -12
- package/dist-library/reactive-md-react.js +12 -12
- package/dist-library/reactive-md-scan.js +1 -1
- 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 +6 -6
- package/dist-library/reactive-md-testing.js +6 -6
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +3 -3
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +52 -43
- package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
- package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
- package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
- package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
- package/dist-library/rmd-pack-layout.css +9 -0
- package/dist-library/rmd-pack-resource-layout.css +9 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
- package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
- package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
- package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
- package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +3 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- 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/else.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +5 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -1
- package/dist-library/types/components/table/data-table-model.d.ts +95 -2
- package/dist-library/types/components/table/data-table.d.ts +2 -2
- package/dist-library/types/contracts/component-kernel.d.ts +5 -0
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -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/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
- package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- 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 +4 -3
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -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/types.d.ts +33 -2
- package/dist-library/types/react/component-api.d.ts +21 -2
- 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/package-core.d.ts +3 -0
- package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
- package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
- package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +3 -1
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +6 -0
- package/dist-library/types/sdk/version.d.ts +1 -1
- 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 +4 -1
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Bza88SGK.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-B0G1699c.js → version-4wzhbvDG.js} +1 -1
- package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +128 -368
- package/docs/README-ch.md +3 -1
- package/docs/README.md +3 -1
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +15 -15
- package/docs/compatibility/compatibility-en.md +15 -15
- 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 +22 -14
- package/docs/compatibility/source-versioning-en.md +22 -13
- 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 +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-protocol-ch.md +18 -18
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/guides/local-guide-ch.md +109 -20
- package/docs/guides/local-guide-en.md +109 -20
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +29 -3
- package/docs/integration/extension-sdk-en.md +29 -3
- package/docs/integration/local-integration-ch.md +3 -3
- package/docs/integration/local-integration-en.md +3 -3
- 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 +11 -19
- package/docs/integration/shareable-export-en.md +11 -19
- package/docs/reference/diagnostics-counting-ch.md +24 -1
- package/docs/reference/diagnostics-counting-en.md +24 -1
- package/docs/reference/local-interaction-syntax-ch.md +222 -33
- package/docs/reference/local-interaction-syntax-en.md +220 -31
- package/docs/reference/public-api-ch.md +24 -18
- package/docs/reference/public-api-en.md +24 -18
- package/docs/reference/theme-protocol-ch.md +1 -1
- package/docs/reference/theme-protocol-en.md +1 -1
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/integration/README-ch.md +3 -3
- package/examples/integration/README.md +3 -3
- package/examples/integration/chat-session/package.json +1 -1
- package/examples/local/README-ch.md +1 -1
- package/examples/local/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
- package/dist-library/authoring-B14SsOXZ.js +0 -893
- package/dist-library/compile-D50B5_Ww.js +0 -1249
- package/dist-library/computations-CffoW7Ff.js +0 -340
- package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
- package/dist-library/default-options-DU5dxuU6.js +0 -125
- package/dist-library/layout-BfUzzO2b.js +0 -553
- package/dist-library/runtime-CuJndKqK.js +0 -1289
- package/dist-library/shareable-C6mUerpQ.js +0 -817
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
- package/dist-library/visuals-CoVSjVD8.js +0 -49159
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { n as e, r as t } from "./document-theme-
|
|
2
|
-
import { A as n,
|
|
3
|
-
import { i as
|
|
4
|
-
import { _ as
|
|
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,21 +57,21 @@ 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
77
|
function D(e, n) {
|
|
@@ -80,10 +80,10 @@ function D(e, n) {
|
|
|
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:
|
|
857
|
+
id: a,
|
|
858
|
+
name: o,
|
|
859
|
+
version: s,
|
|
851
860
|
protocol: e,
|
|
852
|
-
colorSchemes:
|
|
853
|
-
css:
|
|
861
|
+
colorSchemes: c,
|
|
862
|
+
css: l,
|
|
863
|
+
fonts: r(i.fonts, `${n}.fonts`)
|
|
854
864
|
});
|
|
855
865
|
}
|
|
856
866
|
function q(t) {
|
|
857
|
-
let n = T(t, "input"),
|
|
867
|
+
let n = T(t, "input"), i = E(n.id, "theme.id"), a = D(n.name, "theme.name"), o = O(n.version, "theme.version");
|
|
858
868
|
if ((n.protocol === void 0 ? "reactive-md-theme-1" : n.protocol) !== "reactive-md-theme-1") throw w("theme.protocol", `must be "${e}".`);
|
|
859
|
-
let
|
|
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:
|
|
873
|
+
return Qe(u), K({
|
|
874
|
+
id: i,
|
|
875
|
+
name: a,
|
|
876
|
+
version: o,
|
|
867
877
|
protocol: e,
|
|
868
|
-
colorSchemes:
|
|
869
|
-
css:
|
|
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,10 +933,10 @@ 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
|
|
939
|
+
function at(e, t) {
|
|
923
940
|
let n = Y(e), { include: r, exclude: i } = t, a = r ?? i;
|
|
924
941
|
if (r !== void 0 && i !== void 0 || !Array.isArray(a)) throw TypeError("Provide exactly one include or exclude array.");
|
|
925
942
|
let o = new Set(n.components.map((e) => e.name)), s = /* @__PURE__ */ new Set();
|
|
@@ -928,78 +945,80 @@ function rt(e, t) {
|
|
|
928
945
|
s.add(e);
|
|
929
946
|
}
|
|
930
947
|
let c = n.components.filter((e) => s.has(e.name) === (r !== void 0)), l = new Set(c.map((e) => e.id));
|
|
931
|
-
return
|
|
948
|
+
return it({
|
|
932
949
|
...n,
|
|
933
950
|
components: c,
|
|
934
951
|
...n.authoring ? { authoring: n.authoring.filter((e) => l.has(e.componentId)) } : {}
|
|
935
952
|
});
|
|
936
953
|
}
|
|
937
|
-
function
|
|
938
|
-
return
|
|
954
|
+
function ot(e) {
|
|
955
|
+
return o(e);
|
|
939
956
|
}
|
|
940
957
|
// src/assemblies/default-config.ts
|
|
941
|
-
var
|
|
942
|
-
id:
|
|
943
|
-
version:
|
|
944
|
-
}),
|
|
958
|
+
var st = _.id, ct = _.version, lt = Object.freeze({
|
|
959
|
+
id: st,
|
|
960
|
+
version: ct
|
|
961
|
+
}), ut = 16, dt = /* @__PURE__ */ new Set([
|
|
945
962
|
"presets",
|
|
946
963
|
"components",
|
|
947
964
|
"replacements",
|
|
948
|
-
"themes"
|
|
965
|
+
"themes",
|
|
966
|
+
"fonts"
|
|
949
967
|
]), X = /* @__PURE__ */ new WeakSet();
|
|
950
|
-
function
|
|
951
|
-
|
|
968
|
+
function ft(e) {
|
|
969
|
+
f(e) || m("themes", "each theme must be an object."), g(e, /* @__PURE__ */ new Set([
|
|
952
970
|
"id",
|
|
953
971
|
"name",
|
|
954
972
|
"version",
|
|
955
973
|
"protocol",
|
|
956
974
|
"colorSchemes",
|
|
957
|
-
"css"
|
|
975
|
+
"css",
|
|
976
|
+
"fonts"
|
|
958
977
|
]), "theme");
|
|
959
978
|
try {
|
|
960
979
|
return q(e);
|
|
961
980
|
} catch (e) {
|
|
962
|
-
|
|
981
|
+
m("theme", e instanceof Error ? e.message : String(e));
|
|
963
982
|
}
|
|
964
983
|
}
|
|
965
984
|
function Z(e) {
|
|
966
985
|
if (e === void 0) return Object.freeze([]);
|
|
967
|
-
Array.isArray(e) ||
|
|
986
|
+
Array.isArray(e) || m("themes", "must be an array."), e.length > 16 && m("themes", "accepts at most 16 themes.");
|
|
968
987
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = [];
|
|
969
988
|
for (let i of e) {
|
|
970
|
-
let e =
|
|
971
|
-
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);
|
|
972
991
|
}
|
|
973
992
|
return Object.freeze(r.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
|
|
974
993
|
}
|
|
975
|
-
function
|
|
976
|
-
if (typeof e == "string") return e !== "default" && e !==
|
|
977
|
-
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 {
|
|
978
997
|
return Y(e);
|
|
979
998
|
} catch (e) {
|
|
980
|
-
|
|
999
|
+
m(`presets[${t}]`, e instanceof Error ? e.message : String(e));
|
|
981
1000
|
}
|
|
982
1001
|
let n = e.id, r = e.version;
|
|
983
|
-
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}".`), _;
|
|
984
1003
|
}
|
|
985
|
-
function
|
|
986
|
-
if (e === void 0) return Object.freeze([
|
|
987
|
-
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.");
|
|
988
1007
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
989
1008
|
for (let r = 0; r < e.length; r += 1) {
|
|
990
|
-
let i =
|
|
991
|
-
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);
|
|
992
1011
|
}
|
|
993
1012
|
return Object.freeze([...t].sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
|
|
994
1013
|
}
|
|
995
|
-
function
|
|
1014
|
+
function ht(e) {
|
|
996
1015
|
if (e === void 0) return Object.freeze([]);
|
|
997
|
-
Array.isArray(e) ||
|
|
1016
|
+
Array.isArray(e) || m("components", "must be an array.");
|
|
998
1017
|
let t = e.map((e, t) => {
|
|
999
1018
|
try {
|
|
1000
|
-
return
|
|
1019
|
+
return a(e);
|
|
1001
1020
|
} catch (e) {
|
|
1002
|
-
|
|
1021
|
+
m(`components[${t}]`, e instanceof Error ? e.message : String(e));
|
|
1003
1022
|
}
|
|
1004
1023
|
});
|
|
1005
1024
|
return Object.freeze(t.sort((e, t) => {
|
|
@@ -1008,44 +1027,45 @@ function pt(e) {
|
|
|
1008
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;
|
|
1009
1028
|
}));
|
|
1010
1029
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return e === void 0 ? "allow" : (e !== "allow" && e !== "forbid" &&
|
|
1013
|
-
}
|
|
1014
|
-
function
|
|
1015
|
-
|
|
1016
|
-
let r = Object.freeze({
|
|
1017
|
-
protocol:
|
|
1018
|
-
presets:
|
|
1019
|
-
components:
|
|
1020
|
-
replacementPolicy:
|
|
1021
|
-
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 } : {}
|
|
1022
1042
|
});
|
|
1023
|
-
return n(
|
|
1043
|
+
return n(a) > 16777216 && m(t, `serialized size exceeds the ${re}-byte budget.`), a;
|
|
1024
1044
|
}
|
|
1025
|
-
function
|
|
1045
|
+
function vt(e) {
|
|
1026
1046
|
return Object.freeze({
|
|
1027
1047
|
...e,
|
|
1028
1048
|
presets: Object.freeze(e.presets.map((e) => Y(e))),
|
|
1029
1049
|
themes: Z(e.themes)
|
|
1030
1050
|
});
|
|
1031
1051
|
}
|
|
1032
|
-
function
|
|
1033
|
-
let t =
|
|
1052
|
+
function yt(e) {
|
|
1053
|
+
let t = vt(e), n = ne(t, { legacyProfiles: te }), r = ee(t, n);
|
|
1034
1054
|
return X.add(r), r;
|
|
1035
1055
|
}
|
|
1036
1056
|
function Q(e = {}) {
|
|
1037
|
-
return _t(
|
|
1057
|
+
return yt(_t(e, "config"));
|
|
1038
1058
|
}
|
|
1039
|
-
var
|
|
1040
|
-
function
|
|
1041
|
-
return e === void 0 ?
|
|
1059
|
+
var bt;
|
|
1060
|
+
function xt(e) {
|
|
1061
|
+
return e === void 0 ? bt ??= Q().key : $(e).key;
|
|
1042
1062
|
}
|
|
1043
|
-
function
|
|
1063
|
+
function St(e) {
|
|
1044
1064
|
return new Set(e.legacyKeys.map((e) => e.key));
|
|
1045
1065
|
}
|
|
1046
|
-
function
|
|
1066
|
+
function Ct(e, t) {
|
|
1047
1067
|
let n = $(t ?? Q()), r = e.componentConfigKey;
|
|
1048
|
-
return r === void 0 || r === n.key ||
|
|
1068
|
+
return r === void 0 || r === n.key || St(n).has(r) ? [] : [{
|
|
1049
1069
|
code: "local.extension.config-mismatch",
|
|
1050
1070
|
severity: "error",
|
|
1051
1071
|
message: "The document compiler configuration differs from the installed renderer. Recompile with the same host.config used by host.reactConfig (including Worker requests).",
|
|
@@ -1057,36 +1077,36 @@ function xt(e, t) {
|
|
|
1057
1077
|
column: 1
|
|
1058
1078
|
}];
|
|
1059
1079
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return e.preset.id ===
|
|
1062
|
-
...
|
|
1080
|
+
function wt(e) {
|
|
1081
|
+
return e.preset.id === _.id && e.preset.version === _.version ? _ : Y({
|
|
1082
|
+
..._,
|
|
1063
1083
|
id: e.preset.id,
|
|
1064
1084
|
version: e.preset.version
|
|
1065
1085
|
});
|
|
1066
1086
|
}
|
|
1067
|
-
function
|
|
1068
|
-
let n =
|
|
1069
|
-
r === void 0 &&
|
|
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}.`);
|
|
1070
1090
|
let i = r.legacyKeys[0];
|
|
1071
|
-
i === void 0 &&
|
|
1072
|
-
let a =
|
|
1073
|
-
o.some((e) => e.replaces !== void 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.");
|
|
1074
1094
|
let s = Z(e.themes), c = Object.freeze({
|
|
1075
|
-
protocol:
|
|
1095
|
+
protocol: u,
|
|
1076
1096
|
presets: Object.freeze([a]),
|
|
1077
1097
|
components: o,
|
|
1078
1098
|
replacementPolicy: "forbid",
|
|
1079
1099
|
themes: s
|
|
1080
|
-
}),
|
|
1100
|
+
}), l = ne(c, { legacyProfiles: t }), f = ae(r.preset, l.components), te = [...l.legacyKeys, ...l.legacyKeys.some((e) => e.key === f) ? [] : [Object.freeze({
|
|
1081
1101
|
profile: i.profile,
|
|
1082
|
-
key:
|
|
1083
|
-
})]],
|
|
1084
|
-
return X.add(
|
|
1102
|
+
key: f
|
|
1103
|
+
})]], h = ee(c, l, te);
|
|
1104
|
+
return X.add(h), h;
|
|
1085
1105
|
}
|
|
1086
1106
|
function $(e, t = []) {
|
|
1087
|
-
return typeof e == "object" && e && X.has(e) ? e : (
|
|
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))));
|
|
1088
1108
|
}
|
|
1089
|
-
function
|
|
1109
|
+
function Et(e) {
|
|
1090
1110
|
if (typeof e == "object" && e && X.has(e)) return e.key;
|
|
1091
1111
|
try {
|
|
1092
1112
|
return $(e).key;
|
|
@@ -1098,11 +1118,11 @@ function wt(e) {
|
|
|
1098
1118
|
}
|
|
1099
1119
|
}
|
|
1100
1120
|
}
|
|
1101
|
-
function
|
|
1121
|
+
function Dt(e) {
|
|
1102
1122
|
try {
|
|
1103
1123
|
return $(e);
|
|
1104
1124
|
} catch {
|
|
1105
1125
|
return e;
|
|
1106
1126
|
}
|
|
1107
1127
|
}
|
|
1108
|
-
export { ke as _,
|
|
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 };
|