@fluentic/style 0.1.0-beta.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.md +32 -0
- package/LICENSE +21 -0
- package/README.md +409 -0
- package/atomic/atRule/counterStyle.ts +35 -0
- package/atomic/atRule/fontFace.ts +37 -0
- package/atomic/atRule/fontPaletteValues.ts +36 -0
- package/atomic/atRule/fontSrc.ts +13 -0
- package/atomic/atRule/keyframes.ts +43 -0
- package/atomic/atRule/positionTry.ts +73 -0
- package/atomic/atRule/property.ts +39 -0
- package/atomic/atRule/utils.ts +81 -0
- package/atomic/className.ts +93 -0
- package/atomic/debug/className/className.ts +33 -0
- package/atomic/debug/className/index.ts +1 -0
- package/atomic/debug/property/data.ts +59 -0
- package/atomic/debug/property/index.ts +1 -0
- package/atomic/debug/property/property.ts +59 -0
- package/atomic/debug/selector.ts +88 -0
- package/atomic/debug/value.ts +53 -0
- package/atomic/element.ts +29 -0
- package/atomic/layer/README.md +116 -0
- package/atomic/layer/index.ts +3 -0
- package/atomic/layer/layer.ts +95 -0
- package/atomic/layer/types.ts +37 -0
- package/atomic/layer/utils.ts +51 -0
- package/atomic/property/index.ts +2 -0
- package/atomic/property/presets.ts +34 -0
- package/atomic/property/property.ts +13 -0
- package/atomic/property/type_maps.ts +389 -0
- package/atomic/property/types.ts +7 -0
- package/atomic/rule.ts +116 -0
- package/atomic/theme.ts +48 -0
- package/atomic/token.ts +53 -0
- package/atomic/utils/css.ts +49 -0
- package/atomic/utils/debug.ts +37 -0
- package/atomic/utils/format.ts +192 -0
- package/atomic/utils/selector.ts +14 -0
- package/atomic/utils/types.ts +11 -0
- package/atomic/value/index.ts +2 -0
- package/atomic/value/unitless.ts +47 -0
- package/atomic/value/value.ts +17 -0
- package/atomic/var.ts +19 -0
- package/builder/data/check_selector.noop.ts +8 -0
- package/builder/data/check_selector.ts +30 -0
- package/builder/data/const.ts +25 -0
- package/builder/data/create.ts +96 -0
- package/builder/data/data.ts +63 -0
- package/builder/data/debug.ts +113 -0
- package/builder/data/index.ts +9 -0
- package/builder/data/is.ts +68 -0
- package/builder/data/merge/index.ts +2 -0
- package/builder/data/merge/scope.ts +300 -0
- package/builder/data/merge/style.ts +284 -0
- package/builder/data/merge/utils.ts +35 -0
- package/builder/data/selector.ts +11 -0
- package/builder/data/state.ts +134 -0
- package/builder/extract/index.ts +6 -0
- package/builder/extract/scope.ts +30 -0
- package/builder/extract/slot.ts +36 -0
- package/builder/extract/style.ts +89 -0
- package/builder/extract/theme.ts +16 -0
- package/builder/extract/token.ts +41 -0
- package/builder/extract/utils.ts +95 -0
- package/builder/extract/withTokens.ts +64 -0
- package/builder/index.ts +2 -0
- package/builder/style_builder.ts +234 -0
- package/builder/style_data.ts +81 -0
- package/builder/style_fns.ts +611 -0
- package/builder/types/alias.ts +83 -0
- package/builder/types/fns.ts +185 -0
- package/builder/types/index.ts +1 -0
- package/builder/types/types.ts +51 -0
- package/builder/utils.ts +19 -0
- package/compiler/compiler/cache.ts +155 -0
- package/compiler/compiler/compiler.ts +173 -0
- package/compiler/compiler/index.ts +3 -0
- package/compiler/compiler/types.ts +62 -0
- package/compiler/extract/collector.ts +25 -0
- package/compiler/extract/extract.ts +51 -0
- package/compiler/extract/index.ts +3 -0
- package/compiler/extract/types.ts +35 -0
- package/compiler/index.ts +2 -0
- package/compiler/transform/debug/index.ts +2 -0
- package/compiler/transform/debug/plugin.ts +1347 -0
- package/compiler/transform/debug/transform.ts +47 -0
- package/compiler/transform/debug/utils/debug_data.ts +187 -0
- package/compiler/transform/debug/utils/source_url.ts +29 -0
- package/compiler/transform/evaluator/evaluator.ts +1138 -0
- package/compiler/transform/evaluator/index.ts +3 -0
- package/compiler/transform/evaluator/tracer.ts +607 -0
- package/compiler/transform/evaluator/types.ts +22 -0
- package/compiler/transform/extract/chain/chain.ts +2343 -0
- package/compiler/transform/extract/chain/extract_chain.ts +89 -0
- package/compiler/transform/extract/chain/index.ts +3 -0
- package/compiler/transform/extract/chain/types.ts +37 -0
- package/compiler/transform/extract/index.ts +2 -0
- package/compiler/transform/extract/plugin.ts +665 -0
- package/compiler/transform/extract/transform.ts +45 -0
- package/compiler/transform/extract/utils/imports.ts +132 -0
- package/compiler/transform/extract/utils/replacement.ts +349 -0
- package/compiler/transform/extract/utils/slot.ts +186 -0
- package/compiler/transform/extract/utils/state.ts +48 -0
- package/compiler/transform/extract/utils/theme.ts +86 -0
- package/compiler/transform/extract/utils/token.ts +1 -0
- package/compiler/transform/index.ts +5 -0
- package/compiler/transform/syntax/index.ts +5 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +44 -0
- package/compiler/transform/syntax/isStyleChainCall.ts +16 -0
- package/compiler/transform/syntax/static_ids.ts +282 -0
- package/compiler/transform/syntax/types.ts +7 -0
- package/compiler/transform/syntax/utils.ts +31 -0
- package/compiler/transform/utils/babel.ts +100 -0
- package/compiler/transform/utils/import.ts +47 -0
- package/compiler/transform/utils/path.ts +13 -0
- package/compiler/transform/utils/selector.ts +252 -0
- package/compiler/utils/constants.ts +69 -0
- package/compiler/utils/file_resolver.ts +72 -0
- package/compiler/utils/import_source.ts +200 -0
- package/compiler/utils/imports.ts +24 -0
- package/compiler/utils/path.ts +40 -0
- package/compiler/utils/sourcemap.ts +61 -0
- package/config/build.ts +32 -0
- package/config/config/css.ts +32 -0
- package/config/config/css_extra.ts +22 -0
- package/config/config/debug.ts +26 -0
- package/config/config/dev.ts +145 -0
- package/config/config/runtime.ts +29 -0
- package/config/configure.ts +28 -0
- package/config/constants.ts +1 -0
- package/config/index.ts +2 -0
- package/config/types.ts +56 -0
- package/config/utils.ts +5 -0
- package/css/counterStyle.ts +20 -0
- package/css/fontFace.ts +25 -0
- package/css/fontPaletteValues.ts +20 -0
- package/css/index.ts +8 -0
- package/css/keyframes.ts +20 -0
- package/css/positionTry.ts +20 -0
- package/css/property.ts +32 -0
- package/css/utils.ts +56 -0
- package/dev/config.ts +16 -0
- package/dev/fns.ts +48 -0
- package/dev/index.ts +2 -0
- package/dev/trace.ts +413 -0
- package/dev/utils.ts +528 -0
- package/dist/assert-h_Zkqc4E.js +105 -0
- package/dist/assert-h_Zkqc4E.js.map +1 -0
- package/dist/className-C1Ht5Wvv.js +144 -0
- package/dist/className-C1Ht5Wvv.js.map +1 -0
- package/dist/className-DC2Cq8p3.js +251 -0
- package/dist/className-DC2Cq8p3.js.map +1 -0
- package/dist/compiler/index.mjs +2 -0
- package/dist/compiler-DweanHoB.mjs +6847 -0
- package/dist/compiler-DweanHoB.mjs.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config-BryWDfQX.js +25 -0
- package/dist/config-BryWDfQX.js.map +1 -0
- package/dist/config-DKHXWhe1.js +1 -0
- package/dist/config-Di2VYYKV.js +6 -0
- package/dist/config-Di2VYYKV.js.map +1 -0
- package/dist/config-DloHOG6I.js +13 -0
- package/dist/config-DloHOG6I.js.map +1 -0
- package/dist/css-BowBszUt.js +243 -0
- package/dist/css-BowBszUt.js.map +1 -0
- package/dist/css-ByOrugEX.js +805 -0
- package/dist/css-ByOrugEX.js.map +1 -0
- package/dist/css-DcazYor9.js +235 -0
- package/dist/css-DcazYor9.js.map +1 -0
- package/dist/css.js +2 -0
- package/dist/css_extra-DlOnsnR1.js +8 -0
- package/dist/css_extra-DlOnsnR1.js.map +1 -0
- package/dist/css_extra-oIi3UEPK.js +8 -0
- package/dist/css_extra-oIi3UEPK.js.map +1 -0
- package/dist/data-_te7t0M4.js +473 -0
- package/dist/data-_te7t0M4.js.map +1 -0
- package/dist/debug-BAw63qX6.js +15 -0
- package/dist/debug-BAw63qX6.js.map +1 -0
- package/dist/debug-DGki_v7g.js +15 -0
- package/dist/debug-DGki_v7g.js.map +1 -0
- package/dist/debug-n2aZQBSa.js +172 -0
- package/dist/debug-n2aZQBSa.js.map +1 -0
- package/dist/dev/rsc.js +183 -0
- package/dist/dev/rsc.js.map +1 -0
- package/dist/dev-CcphAa3R.js +376 -0
- package/dist/dev-CcphAa3R.js.map +1 -0
- package/dist/dev-DfBbuLeE.js +71 -0
- package/dist/dev-DfBbuLeE.js.map +1 -0
- package/dist/dev.js +2 -0
- package/dist/elementMarker-Bu7gDAkE.js +800 -0
- package/dist/elementMarker-Bu7gDAkE.js.map +1 -0
- package/dist/entry/dev/css.js +3 -0
- package/dist/entry/dev/jsx-dev-runtime.js +3 -0
- package/dist/entry/dev/jsx-runtime.js +3 -0
- package/dist/entry/dev.js +10 -0
- package/dist/entry/prod/css.js +3 -0
- package/dist/entry/prod/extract.js +3 -0
- package/dist/entry/prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/prod/jsx-runtime.js +3 -0
- package/dist/entry/prod/runtime.js +5 -0
- package/dist/entry/prod.js +1230 -0
- package/dist/entry/prod.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +3 -0
- package/dist/entry/rsc-dev/dev.js +544 -0
- package/dist/entry/rsc-dev/dev.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +12 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-runtime.js +3 -0
- package/dist/entry/rsc-dev.js +1429 -0
- package/dist/entry/rsc-dev.js.map +1 -0
- package/dist/entry/rsc-prod/css.js +3 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/rsc-prod/jsx-runtime.js +3 -0
- package/dist/entry/rsc-prod/runtime.js +5 -0
- package/dist/entry/rsc-prod.js +10 -0
- package/dist/extract-CzWJeQi8.js +121 -0
- package/dist/extract-CzWJeQi8.js.map +1 -0
- package/dist/extract-DEwSDJ9Z.js +2 -0
- package/dist/format-3nKBE_5t.js +144 -0
- package/dist/format-3nKBE_5t.js.map +1 -0
- package/dist/getClassName-BlvXHYuf.js +260 -0
- package/dist/getClassName-BlvXHYuf.js.map +1 -0
- package/dist/global-CvfmFLsK.js +11 -0
- package/dist/global-CvfmFLsK.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/jsx/jsx-dev-runtime.js +12 -0
- package/dist/jsx/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx/jsx-dev-runtime.server.js +11 -0
- package/dist/jsx/jsx-dev-runtime.server.js.map +1 -0
- package/dist/jsx/jsx-runtime.js +13 -0
- package/dist/jsx/jsx-runtime.js.map +1 -0
- package/dist/jsx/jsx-runtime.server.js +12 -0
- package/dist/jsx/jsx-runtime.server.js.map +1 -0
- package/dist/jsx-CwTeyUxr.js +39 -0
- package/dist/jsx-CwTeyUxr.js.map +1 -0
- package/dist/jsx-D2BksHSv.js +38 -0
- package/dist/jsx-D2BksHSv.js.map +1 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js +12 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js.map +1 -0
- package/dist/jsx_runtime-04xfnsi7.js +13 -0
- package/dist/jsx_runtime-04xfnsi7.js.map +1 -0
- package/dist/jsx_runtime-iHLDwpcW.js +12 -0
- package/dist/jsx_runtime-iHLDwpcW.js.map +1 -0
- package/dist/layer-D1SaH07m.js +94 -0
- package/dist/layer-D1SaH07m.js.map +1 -0
- package/dist/loader-DS61nRqr.mjs +81 -0
- package/dist/loader-DS61nRqr.mjs.map +1 -0
- package/dist/misc-B9kqEb2N.mjs +360 -0
- package/dist/misc-B9kqEb2N.mjs.map +1 -0
- package/dist/plugin/farm/index.mjs +176 -0
- package/dist/plugin/farm/index.mjs.map +1 -0
- package/dist/plugin/nextjs/index.mjs +282 -0
- package/dist/plugin/nextjs/index.mjs.map +1 -0
- package/dist/plugin/nextjs/loader.mjs +162 -0
- package/dist/plugin/nextjs/loader.mjs.map +1 -0
- package/dist/plugin/parcel/index.cjs +9 -0
- package/dist/plugin/parcel/index.mjs +5 -0
- package/dist/plugin/parcel/optimizer.cjs +28 -0
- package/dist/plugin/parcel/optimizer.cjs.map +1 -0
- package/dist/plugin/parcel/optimizer.mjs +29 -0
- package/dist/plugin/parcel/optimizer.mjs.map +1 -0
- package/dist/plugin/parcel/resolver.cjs +17 -0
- package/dist/plugin/parcel/resolver.cjs.map +1 -0
- package/dist/plugin/parcel/resolver.mjs +18 -0
- package/dist/plugin/parcel/resolver.mjs.map +1 -0
- package/dist/plugin/parcel/runtime.cjs +17 -0
- package/dist/plugin/parcel/runtime.cjs.map +1 -0
- package/dist/plugin/parcel/runtime.mjs +17 -0
- package/dist/plugin/parcel/runtime.mjs.map +1 -0
- package/dist/plugin/parcel/transformer.cjs +41 -0
- package/dist/plugin/parcel/transformer.cjs.map +1 -0
- package/dist/plugin/parcel/transformer.mjs +41 -0
- package/dist/plugin/parcel/transformer.mjs.map +1 -0
- package/dist/plugin/rspack/index.mjs +11 -0
- package/dist/plugin/rspack/index.mjs.map +1 -0
- package/dist/plugin/vite/index.mjs +176 -0
- package/dist/plugin/vite/index.mjs.map +1 -0
- package/dist/plugin/webpack/index.mjs +2 -0
- package/dist/plugin/webpack/loader.mjs +19 -0
- package/dist/plugin/webpack/loader.mjs.map +1 -0
- package/dist/presets-Bye3ea2x.js +139 -0
- package/dist/presets-Bye3ea2x.js.map +1 -0
- package/dist/property-CnLFt5kx.js +406 -0
- package/dist/property-CnLFt5kx.js.map +1 -0
- package/dist/registry-CyIj8LYK.mjs +22 -0
- package/dist/registry-CyIj8LYK.mjs.map +1 -0
- package/dist/rules-9HSO1pxL.js +767 -0
- package/dist/rules-9HSO1pxL.js.map +1 -0
- package/dist/runtime-CYqNCiaM.js +53 -0
- package/dist/runtime-CYqNCiaM.js.map +1 -0
- package/dist/selector/index.js +3 -0
- package/dist/server.js +63 -0
- package/dist/server.js.map +1 -0
- package/dist/shared-BAL9peIw.cjs +7646 -0
- package/dist/shared-BAL9peIw.cjs.map +1 -0
- package/dist/shared-CCpq1zqA.mjs +132 -0
- package/dist/shared-CCpq1zqA.mjs.map +1 -0
- package/dist/sidecar-4u6GnlQG.mjs +236 -0
- package/dist/sidecar-4u6GnlQG.mjs.map +1 -0
- package/dist/style-4rFUy-zW.js +752 -0
- package/dist/style-4rFUy-zW.js.map +1 -0
- package/dist/style-B1UUqjj5.js +743 -0
- package/dist/style-B1UUqjj5.js.map +1 -0
- package/dist/style-Cw3NtvR0.js +5 -0
- package/dist/style-DNqQ6H-7.js +1255 -0
- package/dist/style-DNqQ6H-7.js.map +1 -0
- package/dist/styleStore-Dea_WVbr.js +2000 -0
- package/dist/styleStore-Dea_WVbr.js.map +1 -0
- package/dist/styleStore-DyNXBcUK.js +54 -0
- package/dist/styleStore-DyNXBcUK.js.map +1 -0
- package/dist/token-CKXUECuU.js +76 -0
- package/dist/token-CKXUECuU.js.map +1 -0
- package/dist/token-u_tM-mtg.js +204 -0
- package/dist/token-u_tM-mtg.js.map +1 -0
- package/dist/trace-Bu_qOqRy.js +245 -0
- package/dist/trace-Bu_qOqRy.js.map +1 -0
- package/dist/trace-CU0rvNYr.js +244 -0
- package/dist/trace-CU0rvNYr.js.map +1 -0
- package/dist/utils-BbehLOby.js +2415 -0
- package/dist/utils-BbehLOby.js.map +1 -0
- package/dist/utils-C7xfDxtM.mjs +97 -0
- package/dist/utils-C7xfDxtM.mjs.map +1 -0
- package/dist/utils-CWNHx4EC.js +170 -0
- package/dist/utils-CWNHx4EC.js.map +1 -0
- package/dist/utils-CdI6vZsP.js +37 -0
- package/dist/utils-CdI6vZsP.js.map +1 -0
- package/dist/utils-D7FAOyg6.js +129 -0
- package/dist/utils-D7FAOyg6.js.map +1 -0
- package/dist/utils-DMFgOOtA.mjs +49 -0
- package/dist/utils-DMFgOOtA.mjs.map +1 -0
- package/dist/utils.js +26 -0
- package/dist/utils.js.map +1 -0
- package/dist/value-BR4e2MKt.js +910 -0
- package/dist/value-BR4e2MKt.js.map +1 -0
- package/dist/value-E8rEv2Oe.js +136 -0
- package/dist/value-E8rEv2Oe.js.map +1 -0
- package/dist/valueRef-lshFk1Cs.js +16 -0
- package/dist/valueRef-lshFk1Cs.js.map +1 -0
- package/dist/webpack-CxS2FDYU.mjs +107 -0
- package/dist/webpack-CxS2FDYU.mjs.map +1 -0
- package/dist/withTokens-LRidu3Vc.js +95 -0
- package/dist/withTokens-LRidu3Vc.js.map +1 -0
- package/entry/dev/config.ts +2 -0
- package/entry/dev/css.ts +3 -0
- package/entry/dev/index.ts +3 -0
- package/entry/dev/jsx_dev_runtime.ts +3 -0
- package/entry/dev/jsx_runtime.ts +3 -0
- package/entry/prod/config.ts +2 -0
- package/entry/prod/css.ts +3 -0
- package/entry/prod/extract.ts +1 -0
- package/entry/prod/index.ts +3 -0
- package/entry/prod/jsx_dev_runtime.ts +3 -0
- package/entry/prod/jsx_runtime.ts +3 -0
- package/entry/prod/runtime.ts +14 -0
- package/entry/rsc_dev/config.ts +6 -0
- package/entry/rsc_dev/css.ts +3 -0
- package/entry/rsc_dev/dev.ts +5 -0
- package/entry/rsc_dev/index.ts +3 -0
- package/entry/rsc_dev/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_dev/jsx_runtime.ts +3 -0
- package/entry/rsc_dev/server.ts +11 -0
- package/entry/rsc_prod/config.ts +6 -0
- package/entry/rsc_prod/css.ts +3 -0
- package/entry/rsc_prod/index.ts +3 -0
- package/entry/rsc_prod/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_prod/jsx_runtime.ts +3 -0
- package/entry/rsc_prod/runtime.ts +12 -0
- package/entry/rsc_prod/server.ts +13 -0
- package/entry/shared/config.ts +5 -0
- package/entry/shared/dev.ts +19 -0
- package/entry/shared/prod.ts +4 -0
- package/index.ts +36 -0
- package/jsx/extracted/jsx_dev_runtime.ts +11 -0
- package/jsx/extracted/jsx_runtime.ts +12 -0
- package/jsx/rsc/jsx_dev_runtime.ts +11 -0
- package/jsx/rsc/jsx_runtime.ts +12 -0
- package/jsx/rsc_extracted/jsx_dev_runtime.ts +2 -0
- package/jsx/rsc_extracted/jsx_runtime.ts +2 -0
- package/jsx/runtime/jsx_dev_runtime.ts +11 -0
- package/jsx/runtime/jsx_runtime.ts +12 -0
- package/jsx/types.ts +8 -0
- package/jsx/utils.ts +59 -0
- package/package.json +298 -0
- package/plugin/bundler/farm/index.ts +1 -0
- package/plugin/bundler/farm/plugin.ts +320 -0
- package/plugin/bundler/parcel/config.json +19 -0
- package/plugin/bundler/parcel/index.ts +1 -0
- package/plugin/bundler/parcel/optimizer.ts +36 -0
- package/plugin/bundler/parcel/plugin.ts +4 -0
- package/plugin/bundler/parcel/resolver.ts +36 -0
- package/plugin/bundler/parcel/runtime.ts +23 -0
- package/plugin/bundler/parcel/shared.ts +234 -0
- package/plugin/bundler/parcel/transformer.ts +67 -0
- package/plugin/bundler/rspack/index.ts +1 -0
- package/plugin/bundler/rspack/plugin.ts +14 -0
- package/plugin/bundler/vite/index.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +133 -0
- package/plugin/bundler/vite/state.ts +153 -0
- package/plugin/bundler/webpack/index.ts +1 -0
- package/plugin/bundler/webpack/loader.ts +19 -0
- package/plugin/bundler/webpack/plugin.ts +240 -0
- package/plugin/bundler/webpack/shared/index.ts +2 -0
- package/plugin/bundler/webpack/shared/loader.ts +155 -0
- package/plugin/bundler/webpack/shared/registry.ts +16 -0
- package/plugin/bundler/webpack/utils.ts +96 -0
- package/plugin/nextjs/constants.ts +7 -0
- package/plugin/nextjs/html.ts +62 -0
- package/plugin/nextjs/index.ts +2 -0
- package/plugin/nextjs/loader.ts +222 -0
- package/plugin/nextjs/plugin.ts +532 -0
- package/plugin/nextjs/types.ts +33 -0
- package/plugin/nextjs/utils.ts +210 -0
- package/plugin/utils/cache/css_cache.ts +146 -0
- package/plugin/utils/cache/file.ts +40 -0
- package/plugin/utils/cache/index.ts +2 -0
- package/plugin/utils/compiler.ts +94 -0
- package/plugin/utils/constants.ts +7 -0
- package/plugin/utils/cssMarker.ts +14 -0
- package/plugin/utils/cssOutput.ts +65 -0
- package/plugin/utils/filter.ts +98 -0
- package/plugin/utils/imports.ts +5 -0
- package/plugin/utils/index.ts +10 -0
- package/plugin/utils/injection.ts +28 -0
- package/plugin/utils/misc.ts +5 -0
- package/plugin/utils/runtimeEntry.ts +57 -0
- package/plugin/utils/sidecar/index.ts +1 -0
- package/plugin/utils/sidecar/server.ts +143 -0
- package/plugin/utils/sidecar/sidecar.ts +167 -0
- package/plugin/utils/sidecar/utils.ts +109 -0
- package/plugin/utils/sourcemap.ts +52 -0
- package/plugin/utils/virtual.ts +81 -0
- package/runtime/core/cache/combine.ts +102 -0
- package/runtime/core/cache/index.ts +5 -0
- package/runtime/core/cache/item.ts +231 -0
- package/runtime/core/cache/pool.ts +310 -0
- package/runtime/core/cache/prop.ts +283 -0
- package/runtime/core/cache/propCache.ts +62 -0
- package/runtime/core/cache/resolvedItem.ts +31 -0
- package/runtime/core/cache/result.ts +115 -0
- package/runtime/core/cache/stateItem.ts +208 -0
- package/runtime/core/cache/tokenValues.ts +150 -0
- package/runtime/core/cache/utils/tree.ts +57 -0
- package/runtime/core/cache/utils/walk.ts +24 -0
- package/runtime/core/className.ts +101 -0
- package/runtime/core/combinedStyle.ts +101 -0
- package/runtime/core/createTransformElement.ts +39 -0
- package/runtime/core/elementMarker.ts +189 -0
- package/runtime/core/elementMarkerData.ts +27 -0
- package/runtime/core/getClassName.ts +47 -0
- package/runtime/core/getSheetRules.ts +7 -0
- package/runtime/core/getToken.ts +14 -0
- package/runtime/core/index.ts +5 -0
- package/runtime/core/jsx.ts +4 -0
- package/runtime/core/resolveClassNameRuntime.ts +33 -0
- package/runtime/env.ts +7 -0
- package/runtime/extract/getClassName.ts +476 -0
- package/runtime/extract/index.ts +4 -0
- package/runtime/extract/jsx.ts +55 -0
- package/runtime/index.ts +12 -0
- package/runtime/rsc/constants.ts +6 -0
- package/runtime/rsc/dev.ts +38 -0
- package/runtime/rsc/getClassName.ts +98 -0
- package/runtime/rsc/index.ts +3 -0
- package/runtime/rsc/jsx.ts +4 -0
- package/runtime/rsc/observer.ts +238 -0
- package/runtime/rsc/styleStore.ts +82 -0
- package/runtime/sheet/element.ts +13 -0
- package/runtime/sheet/global-noop.ts +13 -0
- package/runtime/sheet/global-prod.ts +13 -0
- package/runtime/sheet/global.ts +13 -0
- package/runtime/sheet/index.ts +3 -0
- package/runtime/sheet/insert.ts +37 -0
- package/runtime/sheet/rule.ts +77 -0
- package/runtime/sheet/rules.ts +131 -0
- package/runtime/sheet/theme.ts +34 -0
- package/runtime/style/index.ts +3 -0
- package/runtime/style/scope.ts +65 -0
- package/runtime/style/style.ts +34 -0
- package/runtime/style/token.ts +1 -0
- package/runtime/types.ts +42 -0
- package/selector/assert.ts +131 -0
- package/selector/index.ts +5 -0
- package/selector/presets/default.ts +27 -0
- package/selector/presets/index.ts +3 -0
- package/selector/presets/minimal.ts +37 -0
- package/selector/presets/selectors.ts +85 -0
- package/selector/selector.ts +68 -0
- package/selector/types.ts +24 -0
- package/selector/validate.ts +91 -0
- package/sheet/dev/dev_layer.ts +151 -0
- package/sheet/dev/dev_sort.ts +249 -0
- package/sheet/dev/index.ts +129 -0
- package/sheet/dev/utils.ts +130 -0
- package/sheet/index.ts +4 -0
- package/sheet/prod.ts +109 -0
- package/sheet/sheet.ts +10 -0
- package/sheet/sourcemap.ts +70 -0
- package/sheet/types.ts +31 -0
- package/sheet/utils/dom.ts +71 -0
- package/sheet/utils/index.ts +4 -0
- package/sheet/utils/layer.ts +14 -0
- package/sheet/utils/noop.ts +11 -0
- package/sheet/utils/rule.ts +3 -0
- package/sheet/utils/sourcemap.ts +221 -0
- package/style/index.ts +9 -0
- package/style/keyframes.ts +40 -0
- package/style/style.ts +112 -0
- package/style/theme.ts +36 -0
- package/style/token.ts +101 -0
- package/style/tokens.ts +64 -0
- package/style/transform.ts +9 -0
- package/style/types.ts +32 -0
- package/style/utils/expose.ts +43 -0
- package/style/utils/index.ts +1 -0
- package/style/value.ts +103 -0
- package/style/valueRef.ts +25 -0
- package/utils/global.ts +44 -0
- package/utils/hash.ts +22 -0
- package/utils/id.ts +20 -0
- package/utils/object.ts +87 -0
- package/utils/trace.ts +211 -0
- package/utils/type.ts +22 -0
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
import { c as globalData, i as CSS_CONFIG, t as RUNTIME_CONFIG } from "./runtime-CYqNCiaM.js";
|
|
2
|
+
import { a as getTokenVarName, d as getStyleTokenId, i as getTokenVar, m as isStyleTokenOverrideData, p as isStyleTokenData, r as getTokenOverrideValue, t as getCssPropertyValue } from "./value-E8rEv2Oe.js";
|
|
3
|
+
import { n as escapeCssIdent, o as getIdentifierSafeHash, r as escapeCssValue, t as createNameFormatter } from "./format-3nKBE_5t.js";
|
|
4
|
+
import { c as LayerSelectorPriorities, o as LayerMediaPriorities } from "./layer-D1SaH07m.js";
|
|
5
|
+
import { n as getPropertyPriority, t as getCssPropertyName } from "./property-CnLFt5kx.js";
|
|
6
|
+
import { a as getSelectorText, c as getSlotId, d as isSlotData, f as isSlotOverrideData, h as BUILDER_CALLSITE, i as getSelectorPriority, l as isScopeData, m as isThemeData, o as getScopeTargetScope, p as isStyleData, r as getScopeClassName, s as getScopeTargetSlotId, u as isScopeTargetData, y as BUILDER_STATE } from "./className-DC2Cq8p3.js";
|
|
7
|
+
import { o as hasOwn, t as DEV_CONFIG } from "./dev-DfBbuLeE.js";
|
|
8
|
+
import { c as splitElementMarkerStyleProp, s as isElementDebugData } from "./elementMarker-Bu7gDAkE.js";
|
|
9
|
+
const formatThemeName = createNameFormatter(["name"]);
|
|
10
|
+
function createThemeClassName(name, id, themeNameFormat) {
|
|
11
|
+
return formatThemeName(themeNameFormat || "theme[-(name)]-$hash", getIdentifierSafeHash(id), { name });
|
|
12
|
+
}
|
|
13
|
+
function getThemeRuleCss(className, tokens, tokenNameFormat) {
|
|
14
|
+
const declarations = [];
|
|
15
|
+
for (let i = 0, len = tokens.length; i < len; i++) declarations.push(getThemeDeclaration(tokens[i], tokenNameFormat));
|
|
16
|
+
return "." + escapeCssIdent(className) + "{" + declarations.join(";") + "}";
|
|
17
|
+
}
|
|
18
|
+
function getThemeDeclaration(token, tokenNameFormat) {
|
|
19
|
+
const name = getTokenVarName(token, tokenNameFormat);
|
|
20
|
+
const value = token.ref ? getTokenOverrideValue(token, tokenNameFormat) : escapeCssValue(String(token.value ?? ""));
|
|
21
|
+
return name + ":" + value;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region runtime/env.ts
|
|
25
|
+
const IS_SERVER_RUNTIME = typeof window === "undefined";
|
|
26
|
+
function isServerRSC() {
|
|
27
|
+
return RUNTIME_CONFIG.isRSC && IS_SERVER_RUNTIME;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region builder/extract/withTokens.ts
|
|
31
|
+
const tokenBoundData = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
function isExtractedTokenBoundData(value) {
|
|
33
|
+
return !!value && (typeof value === "object" || typeof value === "function") && tokenBoundData.has(value);
|
|
34
|
+
}
|
|
35
|
+
function getExtractedTokenBoundData(value) {
|
|
36
|
+
return tokenBoundData.get(value);
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region runtime/core/combinedStyle.ts
|
|
40
|
+
const targets = globalData("runtime.combinedStyle.targets", () => /* @__PURE__ */ new WeakMap());
|
|
41
|
+
function createCombinedStyle(meta, getField) {
|
|
42
|
+
const target = {
|
|
43
|
+
...meta,
|
|
44
|
+
cache: Object.create(null),
|
|
45
|
+
getField
|
|
46
|
+
};
|
|
47
|
+
const proxyTarget = {};
|
|
48
|
+
const proxy = new Proxy(proxyTarget, handlers);
|
|
49
|
+
targets.set(proxyTarget, target);
|
|
50
|
+
targets.set(proxy, target);
|
|
51
|
+
return proxy;
|
|
52
|
+
}
|
|
53
|
+
function isCombinedStyle(value) {
|
|
54
|
+
return !!value && typeof value === "object" && targets.has(value);
|
|
55
|
+
}
|
|
56
|
+
function getCombinedStyleStyles(style) {
|
|
57
|
+
return getTarget(style).styles;
|
|
58
|
+
}
|
|
59
|
+
function getCombinedStyleScopes(style) {
|
|
60
|
+
return getTarget(style).scopes;
|
|
61
|
+
}
|
|
62
|
+
function getCombinedStyleTokens(style) {
|
|
63
|
+
return getTarget(style).tokens;
|
|
64
|
+
}
|
|
65
|
+
const handlers = { get(proxy, prop) {
|
|
66
|
+
const target = getTarget(proxy);
|
|
67
|
+
if (hasOwn(target.cache, prop)) return target.cache[prop];
|
|
68
|
+
const value = target.getField(target, prop);
|
|
69
|
+
if (value && typeof value === "object") target.cache[prop] = value;
|
|
70
|
+
return value;
|
|
71
|
+
} };
|
|
72
|
+
function getTarget(value) {
|
|
73
|
+
const target = targets.get(value);
|
|
74
|
+
if (!target) throw new Error("[fluentic-style] Expected combined style.");
|
|
75
|
+
return target;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region runtime/core/cache/resolvedItem.ts
|
|
79
|
+
const resolvedStyleItems = globalData("runtime.resolvedStyleItems", () => /* @__PURE__ */ new WeakSet());
|
|
80
|
+
const resolvedStyleItemTokenValues = globalData("runtime.styleItemTokenValues", () => /* @__PURE__ */ new WeakMap());
|
|
81
|
+
function markResolvedStyleItem(item) {
|
|
82
|
+
resolvedStyleItems.add(item);
|
|
83
|
+
}
|
|
84
|
+
function isResolvedStyleItem$1(value) {
|
|
85
|
+
return !!value && typeof value === "object" && resolvedStyleItems.has(value);
|
|
86
|
+
}
|
|
87
|
+
function setResolvedStyleItemTokenValues(item, tokens) {
|
|
88
|
+
resolvedStyleItemTokenValues.set(item, tokens);
|
|
89
|
+
}
|
|
90
|
+
function getResolvedStyleItemTokenValues(item) {
|
|
91
|
+
return resolvedStyleItemTokenValues.get(item) ?? null;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region runtime/core/cache/item.ts
|
|
95
|
+
const directStyleItemCache = globalData("runtime.directStyleItemCache", () => /* @__PURE__ */ new WeakMap());
|
|
96
|
+
function isResolvedStyleItem(value) {
|
|
97
|
+
return isResolvedStyleItem$1(value);
|
|
98
|
+
}
|
|
99
|
+
function createResolvedStyleItem(data, scopes, tokens = null) {
|
|
100
|
+
return createStyleItem({
|
|
101
|
+
data,
|
|
102
|
+
items: resolveItems(data, scopes)
|
|
103
|
+
}, tokens);
|
|
104
|
+
}
|
|
105
|
+
function createResolvedStyleItemFromItems(item, tokens) {
|
|
106
|
+
return createStyleItem({
|
|
107
|
+
data: item.data,
|
|
108
|
+
items: item.items
|
|
109
|
+
}, tokens);
|
|
110
|
+
}
|
|
111
|
+
function getDirectStyleItem(item) {
|
|
112
|
+
let cached = directStyleItemCache.get(item);
|
|
113
|
+
if (!cached) {
|
|
114
|
+
cached = createResolvedStyleItem(item, []);
|
|
115
|
+
directStyleItemCache.set(item, cached);
|
|
116
|
+
}
|
|
117
|
+
return cached;
|
|
118
|
+
}
|
|
119
|
+
function getStyleTokenValues(value) {
|
|
120
|
+
if (isCombinedStyle(value)) return getCombinedStyleTokens(value);
|
|
121
|
+
return getResolvedStyleItemTokenValues(value);
|
|
122
|
+
}
|
|
123
|
+
function createCombinedStyleFacade(styles, scopes) {
|
|
124
|
+
return createCombinedStyle({
|
|
125
|
+
styles,
|
|
126
|
+
scopes,
|
|
127
|
+
tokens: null
|
|
128
|
+
}, getStyleField);
|
|
129
|
+
}
|
|
130
|
+
function createCombinedStyleTokenWrapper(style, tokens) {
|
|
131
|
+
return createCombinedStyle({
|
|
132
|
+
styles: getCombinedStyleStyles(style),
|
|
133
|
+
scopes: getCombinedStyleScopes(style),
|
|
134
|
+
tokens
|
|
135
|
+
}, getTokenField(style));
|
|
136
|
+
}
|
|
137
|
+
const getStyleField = (meta, prop) => {
|
|
138
|
+
const value = meta.styles?.[prop] ?? null;
|
|
139
|
+
if (isStyleData(value) || isSlotData(value)) return createResolvedStyleItem(value, meta.scopes);
|
|
140
|
+
if (value && typeof value === "object") return createCombinedStyleFacade(value, meta.scopes);
|
|
141
|
+
return value;
|
|
142
|
+
};
|
|
143
|
+
function getTokenField(base) {
|
|
144
|
+
return (meta, prop) => {
|
|
145
|
+
const value = base?.[prop] ?? null;
|
|
146
|
+
if (isResolvedStyleItem(value)) return createStyleItem({
|
|
147
|
+
data: value.data,
|
|
148
|
+
items: value.items
|
|
149
|
+
}, meta.tokens);
|
|
150
|
+
if (isCombinedStyle(value)) return createCombinedStyleTokenWrapper(value, meta.tokens);
|
|
151
|
+
return value;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function createStyleItem(item, tokens = null) {
|
|
155
|
+
markResolvedStyleItem(item);
|
|
156
|
+
if (tokens) setResolvedStyleItemTokenValues(item, tokens);
|
|
157
|
+
return item;
|
|
158
|
+
}
|
|
159
|
+
function resolveItems(data, scopes) {
|
|
160
|
+
const items = [];
|
|
161
|
+
const stateItems = data[BUILDER_STATE]?.items ?? [];
|
|
162
|
+
const slotId = isSlotData(data) ? getSlotId(data) : null;
|
|
163
|
+
for (let i = 0, len = stateItems.length; i < len; i++) {
|
|
164
|
+
const item = stateItems[i];
|
|
165
|
+
if (Array.isArray(item)) {
|
|
166
|
+
items.push(item);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (isStyleTokenOverrideData(item)) continue;
|
|
170
|
+
if (slotId && item.type !== 2) continue;
|
|
171
|
+
items.push(item);
|
|
172
|
+
}
|
|
173
|
+
if (!slotId) return items;
|
|
174
|
+
for (let i = 0, len = scopes.length; i < len; i++) {
|
|
175
|
+
const boundScope = scopes[i];
|
|
176
|
+
const scope = getScopeTargetScope(boundScope);
|
|
177
|
+
if (!scope) continue;
|
|
178
|
+
const scopeItems = scope[BUILDER_STATE]?.items;
|
|
179
|
+
if (!scopeItems) continue;
|
|
180
|
+
const targetSlotId = getScopeTargetSlotId(boundScope);
|
|
181
|
+
for (let j = 0, len = scopeItems.length; j < len; j++) {
|
|
182
|
+
const item = scopeItems[j];
|
|
183
|
+
if (Array.isArray(item)) {
|
|
184
|
+
if (item[1] === slotId) items.push(item);
|
|
185
|
+
const hasParentSelector = isExtractedScopeParentMarker$1(item[4]) || isExtractedScopeParentMarker$1(item[5]);
|
|
186
|
+
if (targetSlotId === slotId && hasParentSelector) items.push(getScopeParentItem(String(item[3])));
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (isStyleTokenOverrideData(item)) continue;
|
|
190
|
+
if (item.type !== 4) continue;
|
|
191
|
+
if (item.slotId === slotId) items.push(item);
|
|
192
|
+
if (item.parentSelector && targetSlotId === slotId) items.push(getScopeParentItem(item.className));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return items;
|
|
196
|
+
}
|
|
197
|
+
function getScopeParentItem(className) {
|
|
198
|
+
const parentClassName = getScopeClassName(className, CSS_CONFIG.scopeClassNameFormat || null);
|
|
199
|
+
return [parentClassName, parentClassName];
|
|
200
|
+
}
|
|
201
|
+
function isExtractedScopeParentMarker$1(value) {
|
|
202
|
+
return value === 1 || value === true;
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region runtime/core/cache/utils/tree.ts
|
|
206
|
+
function createCacheTreeNode(value) {
|
|
207
|
+
return {
|
|
208
|
+
children: /* @__PURE__ */ new Map(),
|
|
209
|
+
value
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function getCacheTreeChild(node, key, createValue) {
|
|
213
|
+
let child = node.children.get(key);
|
|
214
|
+
if (!child) {
|
|
215
|
+
child = createCacheTreeNode(createValue());
|
|
216
|
+
node.children.set(key, child);
|
|
217
|
+
}
|
|
218
|
+
return child;
|
|
219
|
+
}
|
|
220
|
+
function createWeakCacheTreeNode(value) {
|
|
221
|
+
return {
|
|
222
|
+
children: /* @__PURE__ */ new WeakMap(),
|
|
223
|
+
value
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function getWeakCacheTreeChild(node, key, createValue) {
|
|
227
|
+
let child = node.children.get(key);
|
|
228
|
+
if (!child) {
|
|
229
|
+
child = createWeakCacheTreeNode(createValue());
|
|
230
|
+
node.children.set(key, child);
|
|
231
|
+
}
|
|
232
|
+
return child;
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region runtime/core/cache/propCache.ts
|
|
236
|
+
const root = createWeakCacheTreeNode(createCacheValue());
|
|
237
|
+
function getStylePropCacheValue(styleProp, walk, onUnsupported) {
|
|
238
|
+
let node = root;
|
|
239
|
+
let hasItem = false;
|
|
240
|
+
let canCache = true;
|
|
241
|
+
walk(styleProp, (item) => {
|
|
242
|
+
hasItem = true;
|
|
243
|
+
node = getWeakCacheTreeChild(node, item, createCacheValue);
|
|
244
|
+
}, () => {
|
|
245
|
+
canCache = false;
|
|
246
|
+
onUnsupported?.();
|
|
247
|
+
});
|
|
248
|
+
if (!hasItem || !canCache) return null;
|
|
249
|
+
const value = node.value;
|
|
250
|
+
if (value.c !== RUNTIME_CONFIG.changes) {
|
|
251
|
+
value.d = null;
|
|
252
|
+
value.c = RUNTIME_CONFIG.changes;
|
|
253
|
+
}
|
|
254
|
+
return value;
|
|
255
|
+
}
|
|
256
|
+
function createCacheValue() {
|
|
257
|
+
return {
|
|
258
|
+
d: null,
|
|
259
|
+
c: RUNTIME_CONFIG.changes
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region runtime/core/cache/stateItem.ts
|
|
264
|
+
function getStateItemDedupe(item) {
|
|
265
|
+
if (Array.isArray(item)) {
|
|
266
|
+
if (typeof item[0] === "number") switch (item[0]) {
|
|
267
|
+
case 1: return item[1];
|
|
268
|
+
case 2:
|
|
269
|
+
case 3:
|
|
270
|
+
case 4: return item[2];
|
|
271
|
+
}
|
|
272
|
+
else if (typeof item[1] === "string") return item[1];
|
|
273
|
+
return "";
|
|
274
|
+
}
|
|
275
|
+
if (isStyleTokenOverrideData(item)) return "";
|
|
276
|
+
return item.dedupe;
|
|
277
|
+
}
|
|
278
|
+
function getStateItemClassName(item) {
|
|
279
|
+
if (Array.isArray(item)) {
|
|
280
|
+
if (typeof item[0] === "number") switch (item[0]) {
|
|
281
|
+
case 1: return item[2];
|
|
282
|
+
case 2:
|
|
283
|
+
case 3:
|
|
284
|
+
case 4: return item[3];
|
|
285
|
+
}
|
|
286
|
+
else return item[1];
|
|
287
|
+
return "";
|
|
288
|
+
}
|
|
289
|
+
if (isStyleTokenOverrideData(item)) return "";
|
|
290
|
+
return item.className;
|
|
291
|
+
}
|
|
292
|
+
function getStateItemVariableValue(item, tokens) {
|
|
293
|
+
const value = getStateItemValue(item);
|
|
294
|
+
if (Array.isArray(value) && value[0] === 1) return [value[1], resolveMarkedVariableValue(value[2], value[3], tokens)];
|
|
295
|
+
if (!Array.isArray(item) && !isStyleTokenOverrideData(item) && item.variable?.[0] === 1) return [item.variable[1], resolveMarkedVariableValue(item.variable[2], item.variable[3], tokens)];
|
|
296
|
+
if (!Array.isArray(item) && !isStyleTokenOverrideData(item) && item.token) {
|
|
297
|
+
if (!tokens) return null;
|
|
298
|
+
const id = getStyleTokenId(item.token);
|
|
299
|
+
if (!hasOwn(tokens.lookup, id)) return null;
|
|
300
|
+
return [getTokenVarName(item.token, CSS_CONFIG.tokenNameFormat ?? null), tokens.lookup[id]];
|
|
301
|
+
}
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
function resolveMarkedVariableValue(value, valueMode, tokens) {
|
|
305
|
+
return normalizeVariableValue(resolveVariableValue(value, tokens), valueMode);
|
|
306
|
+
}
|
|
307
|
+
function normalizeVariableValue(value, valueMode) {
|
|
308
|
+
if (typeof value !== "number") return value;
|
|
309
|
+
return valueMode === 1 ? value + "px" : String(value);
|
|
310
|
+
}
|
|
311
|
+
function getStateItemAtRuleRef(item) {
|
|
312
|
+
const value = getStateItemValue(item);
|
|
313
|
+
if (Array.isArray(value) && value[0] === 3) return value[1];
|
|
314
|
+
if (!Array.isArray(item) && !isStyleTokenOverrideData(item) && item.variable?.[0] === 3) return item.variable[1];
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
function getStateItemAtRuleRefVariables(item, tokens) {
|
|
318
|
+
if (!tokens) return null;
|
|
319
|
+
const refTokens = getStateItemAtRuleRef(item)?.tokens;
|
|
320
|
+
if (!refTokens?.length) return null;
|
|
321
|
+
const values = [];
|
|
322
|
+
for (let i = 0, len = refTokens.length; i < len; i++) {
|
|
323
|
+
const token = refTokens[i];
|
|
324
|
+
const id = getStyleTokenId(token);
|
|
325
|
+
if (!hasOwn(tokens.lookup, id)) continue;
|
|
326
|
+
values.push([getTokenVarName(token, CSS_CONFIG.tokenNameFormat ?? null), tokens.lookup[id]]);
|
|
327
|
+
}
|
|
328
|
+
return values.length ? values : null;
|
|
329
|
+
}
|
|
330
|
+
function getStateItemValue(item) {
|
|
331
|
+
if (Array.isArray(item)) if (typeof item[0] === "number") switch (item[0]) {
|
|
332
|
+
case 1: return item[3];
|
|
333
|
+
case 2:
|
|
334
|
+
case 3: return item[4];
|
|
335
|
+
case 4: return isExtractedScopeParentMarker(item[4]) ? void 0 : item[4];
|
|
336
|
+
}
|
|
337
|
+
else return item[2];
|
|
338
|
+
}
|
|
339
|
+
function isExtractedScopeParentMarker(value) {
|
|
340
|
+
return value === 1 || value === true;
|
|
341
|
+
}
|
|
342
|
+
function resolveVariableValue(value, tokens) {
|
|
343
|
+
if (isStyleTokenData(value)) return resolveTokenValue(value, tokens);
|
|
344
|
+
return value;
|
|
345
|
+
}
|
|
346
|
+
function resolveTokenValue(token, tokens) {
|
|
347
|
+
if (tokens) {
|
|
348
|
+
const id = getStyleTokenId(token);
|
|
349
|
+
if (hasOwn(tokens.lookup, id)) return tokens.lookup[id];
|
|
350
|
+
}
|
|
351
|
+
return getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null);
|
|
352
|
+
}
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region runtime/core/cache/result.ts
|
|
355
|
+
const emptyStylePropResult = {
|
|
356
|
+
className: "",
|
|
357
|
+
style: void 0
|
|
358
|
+
};
|
|
359
|
+
let runId = 0;
|
|
360
|
+
const dedupeRun = Object.create(null);
|
|
361
|
+
const dedupeIndex = Object.create(null);
|
|
362
|
+
function createStylePropResult(items, getThemeClassName) {
|
|
363
|
+
runId++;
|
|
364
|
+
const classNames = [];
|
|
365
|
+
let style;
|
|
366
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
367
|
+
const item = items[i];
|
|
368
|
+
if (!isResolvedStyleItem(item)) {
|
|
369
|
+
const themeClassName = getThemeClassName(item);
|
|
370
|
+
if (themeClassName) classNames.push(themeClassName);
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
const tokens = getStyleTokenValues(item);
|
|
374
|
+
const stateItems = item.items;
|
|
375
|
+
for (let j = 0, itemLen = stateItems.length; j < itemLen; j++) style = addItem(classNames, style, stateItems[j], tokens);
|
|
376
|
+
}
|
|
377
|
+
if (!classNames.length) return emptyStylePropResult;
|
|
378
|
+
return {
|
|
379
|
+
className: classNames.join(" "),
|
|
380
|
+
style
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function addItem(classNames, style, item, tokens) {
|
|
384
|
+
const dedupe = getStateItemDedupe(item);
|
|
385
|
+
const className = getStateItemClassName(item);
|
|
386
|
+
if (!dedupe || !className) return style;
|
|
387
|
+
if (dedupeRun[dedupe] === runId) {
|
|
388
|
+
classNames[dedupeIndex[dedupe]] = className;
|
|
389
|
+
return addItemStyle(style, item, tokens);
|
|
390
|
+
}
|
|
391
|
+
dedupeRun[dedupe] = runId;
|
|
392
|
+
dedupeIndex[dedupe] = classNames.push(className) - 1;
|
|
393
|
+
return addItemStyle(style, item, tokens);
|
|
394
|
+
}
|
|
395
|
+
function addItemStyle(style, item, tokens) {
|
|
396
|
+
const variableValue = getStateItemVariableValue(item, tokens);
|
|
397
|
+
if (variableValue) style = setStyleValue(style, variableValue[0], variableValue[1]);
|
|
398
|
+
const refValues = getStateItemAtRuleRefVariables(item, tokens);
|
|
399
|
+
if (!refValues) return style;
|
|
400
|
+
for (let i = 0, len = refValues.length; i < len; i++) style = setStyleValue(style, refValues[i][0], refValues[i][1]);
|
|
401
|
+
return style;
|
|
402
|
+
}
|
|
403
|
+
function setStyleValue(style, name, value) {
|
|
404
|
+
const next = style ?? {};
|
|
405
|
+
next[name] = value;
|
|
406
|
+
return next;
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region runtime/core/cache/tokenValues.ts
|
|
410
|
+
function createMutableTokenValues(base) {
|
|
411
|
+
return {
|
|
412
|
+
ids: base ? base.ids.slice() : null,
|
|
413
|
+
values: base ? base.values.slice() : null,
|
|
414
|
+
lookup: base ? { ...base.lookup } : null,
|
|
415
|
+
index: base ? createTokenIndexLookup(base.ids) : null
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function addTokenOverride(values, item) {
|
|
419
|
+
if (!isStyleTokenOverrideData(item)) return false;
|
|
420
|
+
addTokenValue(values, getStyleTokenId(item), getTokenOverrideValue(item, CSS_CONFIG.tokenNameFormat ?? null));
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
function addTokenValue(values, id, value) {
|
|
424
|
+
if (!values.ids) values.ids = [];
|
|
425
|
+
if (!values.values) values.values = [];
|
|
426
|
+
if (!values.lookup) values.lookup = Object.create(null);
|
|
427
|
+
if (!values.index) values.index = Object.create(null);
|
|
428
|
+
const ids = values.ids;
|
|
429
|
+
const tokenValues = values.values;
|
|
430
|
+
const lookup = values.lookup;
|
|
431
|
+
const indexLookup = values.index;
|
|
432
|
+
const index = indexLookup[id];
|
|
433
|
+
if (index === void 0) {
|
|
434
|
+
indexLookup[id] = ids.push(id) - 1;
|
|
435
|
+
tokenValues.push(value);
|
|
436
|
+
} else tokenValues[index] = value;
|
|
437
|
+
lookup[id] = value;
|
|
438
|
+
}
|
|
439
|
+
function addTokenValues(values, next) {
|
|
440
|
+
if (!next) return;
|
|
441
|
+
for (let i = 0, len = next.ids.length; i < len; i++) addTokenValue(values, next.ids[i], next.values[i]);
|
|
442
|
+
}
|
|
443
|
+
function addTokenOverrides(values, overrides) {
|
|
444
|
+
for (let i = 0, len = overrides.length; i < len; i++) addTokenOverride(values, overrides[i]);
|
|
445
|
+
}
|
|
446
|
+
function finishTokenValues(base, values) {
|
|
447
|
+
if (!values.ids || !values.values || !values.lookup) return null;
|
|
448
|
+
if (isSameTokenValues(base, values.ids, values.values)) return base;
|
|
449
|
+
return {
|
|
450
|
+
ids: values.ids,
|
|
451
|
+
values: values.values,
|
|
452
|
+
lookup: values.lookup
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
function mergeTokenValues(base, next) {
|
|
456
|
+
if (!next) return base;
|
|
457
|
+
if (!base) return next;
|
|
458
|
+
const values = createMutableTokenValues(base);
|
|
459
|
+
addTokenValues(values, next);
|
|
460
|
+
return finishTokenValues(base, values);
|
|
461
|
+
}
|
|
462
|
+
function mergeTokenOverrides(base, overrides) {
|
|
463
|
+
if (!overrides.length) return base;
|
|
464
|
+
const values = createMutableTokenValues(base);
|
|
465
|
+
addTokenOverrides(values, overrides);
|
|
466
|
+
return finishTokenValues(base, values);
|
|
467
|
+
}
|
|
468
|
+
function createTokenIndexLookup(ids) {
|
|
469
|
+
const lookup = Object.create(null);
|
|
470
|
+
for (let i = 0, len = ids.length; i < len; i++) lookup[ids[i]] = i;
|
|
471
|
+
return lookup;
|
|
472
|
+
}
|
|
473
|
+
function isSameTokenValues(base, ids, values) {
|
|
474
|
+
if (!base || base.ids.length !== ids.length) return false;
|
|
475
|
+
const baseLookup = base.lookup;
|
|
476
|
+
for (let i = 0, len = ids.length; i < len; i++) {
|
|
477
|
+
if (!hasOwn(baseLookup, ids[i])) return false;
|
|
478
|
+
if (baseLookup[ids[i]] !== values[i]) return false;
|
|
479
|
+
}
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region runtime/core/cache/utils/walk.ts
|
|
484
|
+
function walkRecursiveItems(root, fn) {
|
|
485
|
+
if (!root) return;
|
|
486
|
+
const stack = [root];
|
|
487
|
+
while (stack.length > 0) {
|
|
488
|
+
const item = stack.pop();
|
|
489
|
+
if (!item) continue;
|
|
490
|
+
if (Array.isArray(item)) {
|
|
491
|
+
for (let i = item.length - 1; i >= 0; i--) stack.push(item[i]);
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
fn(item);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region runtime/core/cache/prop.ts
|
|
499
|
+
function resolveStylePropRuntime(styleProp) {
|
|
500
|
+
if (!styleProp) return null;
|
|
501
|
+
styleProp = splitElementMarkerStyleProp(styleProp).styleProp;
|
|
502
|
+
if (!styleProp) return null;
|
|
503
|
+
if (RUNTIME_CONFIG.runtimeCacheTTL === 0) {
|
|
504
|
+
const items = collectStylePropItems(styleProp);
|
|
505
|
+
return {
|
|
506
|
+
items,
|
|
507
|
+
result: createStylePropResult(items, getThemeClassName)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
let unsupportedItem;
|
|
511
|
+
const tokenBindings = [];
|
|
512
|
+
const cache = getStylePropCacheValue(styleProp, walkStylePropCachePath, () => warnUnsupportedStylePropItem(unsupportedItem));
|
|
513
|
+
if (cache?.d) {
|
|
514
|
+
if (!tokenBindings.length) return {
|
|
515
|
+
items: cache.d.i,
|
|
516
|
+
result: cache.d.r
|
|
517
|
+
};
|
|
518
|
+
return {
|
|
519
|
+
items: cache.d.i,
|
|
520
|
+
result: createStylePropResult(applyTokenBindings(cache.d.i, tokenBindings), getThemeClassName)
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
const items = collectStylePropItems(styleProp, tokenBindings.length > 0);
|
|
524
|
+
const data = {
|
|
525
|
+
i: items,
|
|
526
|
+
r: createStylePropResult(items, getThemeClassName)
|
|
527
|
+
};
|
|
528
|
+
if (cache) cache.d = data;
|
|
529
|
+
if (!tokenBindings.length) return {
|
|
530
|
+
items: data.i,
|
|
531
|
+
result: data.r
|
|
532
|
+
};
|
|
533
|
+
return {
|
|
534
|
+
items,
|
|
535
|
+
result: createStylePropResult(applyTokenBindings(items, tokenBindings), getThemeClassName)
|
|
536
|
+
};
|
|
537
|
+
function walkStylePropCachePath(styleProp, fn, onUnsupported) {
|
|
538
|
+
walkRecursiveItems(styleProp, (item) => {
|
|
539
|
+
if (isElementDebugData(item)) return;
|
|
540
|
+
const key = getStylePropCacheKey(item, tokenBindings);
|
|
541
|
+
if (key) fn(key);
|
|
542
|
+
else {
|
|
543
|
+
unsupportedItem = item;
|
|
544
|
+
onUnsupported();
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
function walkStyleProp(styleProp, fn, options) {
|
|
550
|
+
walkRecursiveItems(styleProp, (item) => {
|
|
551
|
+
if (isElementDebugData(item)) return;
|
|
552
|
+
const styleItem = normalizeStylePropItem(item, options?.stableTokenBound ?? false);
|
|
553
|
+
if (styleItem) fn(styleItem);
|
|
554
|
+
else options?.onUnsupported?.(item);
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
function getStylePropItems(item) {
|
|
558
|
+
if (isResolvedStyleItem(item)) return item.items;
|
|
559
|
+
return [];
|
|
560
|
+
}
|
|
561
|
+
function collectStylePropItems(styleProp, stableTokenBound = false) {
|
|
562
|
+
const items = [];
|
|
563
|
+
walkStyleProp(styleProp, (item) => {
|
|
564
|
+
items.push(item);
|
|
565
|
+
}, { stableTokenBound });
|
|
566
|
+
return items;
|
|
567
|
+
}
|
|
568
|
+
function warnUnsupportedStylePropItem(item) {
|
|
569
|
+
if (!DEV_CONFIG.isDev) return;
|
|
570
|
+
if (isElementDebugData(item)) return;
|
|
571
|
+
if (isSlotOverrideData(item) || isScopeData(item) || isScopeTargetData(item) || isStyleTokenOverrideData(item)) {
|
|
572
|
+
console.warn("[fluentic-style] Unsupported style prop value. Pass themes, scopes, slot overrides, and token overrides to combineStyle before using style prop.", item);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
if (item) console.warn("[fluentic-style] Unsupported style prop value.", item);
|
|
576
|
+
}
|
|
577
|
+
function normalizeStylePropItem(item, stableTokenBound) {
|
|
578
|
+
if (isElementDebugData(item)) return null;
|
|
579
|
+
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(item)) {
|
|
580
|
+
const bound = getExtractedTokenBoundData(item);
|
|
581
|
+
if (stableTokenBound) return normalizeStylePropItem(bound.data, true);
|
|
582
|
+
const tokens = mergeTokenOverrides(null, bound.tokens);
|
|
583
|
+
if (isStyleData(bound.data) || isSlotData(bound.data)) return createResolvedStyleItem(bound.data, [], tokens);
|
|
584
|
+
return normalizeStylePropItem(bound.data, false);
|
|
585
|
+
}
|
|
586
|
+
if (isResolvedStyleItem(item) || isThemeData(item)) return item;
|
|
587
|
+
if (isStyleData(item) || isSlotData(item)) return getDirectStyleItem(item);
|
|
588
|
+
return null;
|
|
589
|
+
}
|
|
590
|
+
function getStylePropCacheKey(item, tokenBindings) {
|
|
591
|
+
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(item)) {
|
|
592
|
+
const bound = getExtractedTokenBoundData(item);
|
|
593
|
+
const key = getStylePropCacheKey(bound.data, tokenBindings);
|
|
594
|
+
const tokens = mergeTokenOverrides(null, bound.tokens);
|
|
595
|
+
if (key && tokens) tokenBindings.push({
|
|
596
|
+
data: key,
|
|
597
|
+
tokens
|
|
598
|
+
});
|
|
599
|
+
return key;
|
|
600
|
+
}
|
|
601
|
+
if (isResolvedStyleItem(item) || isThemeData(item) || isStyleData(item) || isSlotData(item)) return item;
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
function getThemeClassName(item) {
|
|
605
|
+
return isThemeData(item) ? item.className : null;
|
|
606
|
+
}
|
|
607
|
+
function applyTokenBindings(items, bindings) {
|
|
608
|
+
if (!bindings.length) return items.slice();
|
|
609
|
+
return items.map((item) => {
|
|
610
|
+
if (!isResolvedStyleItem(item)) return item;
|
|
611
|
+
const tokens = getBoundTokens(item, bindings);
|
|
612
|
+
if (!tokens) return item;
|
|
613
|
+
return createResolvedStyleItemFromItems(item, tokens);
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function getBoundTokens(item, bindings) {
|
|
617
|
+
let tokens = getStyleTokenValues(item);
|
|
618
|
+
for (let i = 0, len = bindings.length; i < len; i++) {
|
|
619
|
+
const binding = bindings[i];
|
|
620
|
+
if (binding.data !== item.data && binding.data !== item) continue;
|
|
621
|
+
tokens = mergeTokenValues(tokens, binding.tokens);
|
|
622
|
+
}
|
|
623
|
+
return tokens;
|
|
624
|
+
}
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region atomic/rule.ts
|
|
627
|
+
function buildAtomicRule(className, property, value, selector, parentSelector, atRules, scopeClassNameFormat) {
|
|
628
|
+
const cssProp = getCssPropertyName(property);
|
|
629
|
+
const cssValue = getCssPropertyValue(property, value);
|
|
630
|
+
const classSelector = "." + escapeCssIdent(className);
|
|
631
|
+
const itemSelector = selector ? getSelectorText(selector) : "";
|
|
632
|
+
let selectorStr = classSelector + itemSelector;
|
|
633
|
+
if (parentSelector) {
|
|
634
|
+
const parentWhere = `:where(${"." + escapeCssIdent(getScopeClassName(className, scopeClassNameFormat)) + getSelectorText(parentSelector)})`;
|
|
635
|
+
selectorStr = classSelector + parentWhere + itemSelector + "," + parentWhere + " " + selectorStr;
|
|
636
|
+
}
|
|
637
|
+
let rule = `${selectorStr}{${cssProp}: ${cssValue}}`;
|
|
638
|
+
if (atRules) for (let i = atRules.length - 1; i >= 0; i--) rule = `${getSelectorText(atRules[i])}{${rule}}`;
|
|
639
|
+
return rule;
|
|
640
|
+
}
|
|
641
|
+
function getAtomicRuleLayerPriority(property, priority, selector, parentSelector, atRules, isScopeRule = false) {
|
|
642
|
+
const selectorPriority = getSelectorPriority(selector);
|
|
643
|
+
const parentSelectorPriority = getSelectorPriority(parentSelector);
|
|
644
|
+
const atRulePriority = getAtRulePriority(atRules);
|
|
645
|
+
return [
|
|
646
|
+
priority ?? 0,
|
|
647
|
+
getLayerSelectorPriority(selector, parentSelector, selectorPriority),
|
|
648
|
+
getParentSelectorPriority(parentSelector, parentSelectorPriority),
|
|
649
|
+
getMediaPriority(atRules, atRulePriority),
|
|
650
|
+
atRules ? atRules.length : 0,
|
|
651
|
+
isScopeRule && !parentSelector ? 1 : 0,
|
|
652
|
+
getPropertyPriority(property)
|
|
653
|
+
];
|
|
654
|
+
}
|
|
655
|
+
function getMediaPriority(atRules, priority) {
|
|
656
|
+
if (!atRules?.length) return LayerMediaPriorities.base;
|
|
657
|
+
if (priority <= 0) return LayerMediaPriorities.media;
|
|
658
|
+
return LayerMediaPriorities.priorityMedia + priority;
|
|
659
|
+
}
|
|
660
|
+
function getLayerSelectorPriority(selector, parentSelector, priority) {
|
|
661
|
+
if (selector) return priority > 0 ? LayerSelectorPriorities.prioritySelector + priority : LayerSelectorPriorities.selector;
|
|
662
|
+
if (parentSelector) return LayerSelectorPriorities.parentSelector;
|
|
663
|
+
return LayerSelectorPriorities.base;
|
|
664
|
+
}
|
|
665
|
+
function getParentSelectorPriority(parentSelector, priority) {
|
|
666
|
+
if (!parentSelector) return 0;
|
|
667
|
+
return priority > 0 ? priority + 1 : 1;
|
|
668
|
+
}
|
|
669
|
+
function getAtRulePriority(atRules) {
|
|
670
|
+
if (!atRules?.length) return 0;
|
|
671
|
+
let priority = 0;
|
|
672
|
+
for (let i = 0, len = atRules.length; i < len; i++) priority = Math.max(priority, getSelectorPriority(atRules[i]));
|
|
673
|
+
return priority;
|
|
674
|
+
}
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region runtime/sheet/rule.ts
|
|
677
|
+
function createRuntimeSheetRules(item) {
|
|
678
|
+
if (Array.isArray(item)) return null;
|
|
679
|
+
if (isStyleTokenOverrideData(item)) return null;
|
|
680
|
+
const runtimeItem = item;
|
|
681
|
+
const value = Array.isArray(runtimeItem.value) ? runtimeItem.value[0] : runtimeItem.value;
|
|
682
|
+
const priority = Array.isArray(runtimeItem.value) ? runtimeItem.value[1] : null;
|
|
683
|
+
const parentSelector = runtimeItem.type === 4 ? runtimeItem.parentSelector : null;
|
|
684
|
+
const layerPriority = getAtomicRuleLayerPriority(runtimeItem.property, priority, runtimeItem.selector, parentSelector, runtimeItem.atRule, runtimeItem.type === 4);
|
|
685
|
+
const ruleCss = buildAtomicRule(runtimeItem.className, runtimeItem.property, value, runtimeItem.selector, parentSelector, runtimeItem.atRule, CSS_CONFIG.scopeClassNameFormat || null);
|
|
686
|
+
const rule = {
|
|
687
|
+
key: runtimeItem.className,
|
|
688
|
+
dedupe: runtimeItem.dedupe,
|
|
689
|
+
priority: layerPriority,
|
|
690
|
+
css: ruleCss,
|
|
691
|
+
callsite: runtimeItem.callsite,
|
|
692
|
+
debug: runtimeItem.debug,
|
|
693
|
+
debugField: runtimeItem.debugField
|
|
694
|
+
};
|
|
695
|
+
const ref = getStateItemAtRuleRef(item);
|
|
696
|
+
if (!ref?.css) return [rule];
|
|
697
|
+
return [{
|
|
698
|
+
key: ref.key,
|
|
699
|
+
dedupe: ref.key,
|
|
700
|
+
priority: null,
|
|
701
|
+
css: ref.css,
|
|
702
|
+
callsite: runtimeItem.callsite
|
|
703
|
+
}, rule];
|
|
704
|
+
}
|
|
705
|
+
//#endregion
|
|
706
|
+
//#region runtime/sheet/theme.ts
|
|
707
|
+
function insertRuntimeThemeRule(sheet, theme) {
|
|
708
|
+
sheet.insert({
|
|
709
|
+
key: theme.className,
|
|
710
|
+
css: createThemeRule(theme),
|
|
711
|
+
callsite: theme[BUILDER_CALLSITE]
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
function createThemeRule(theme) {
|
|
715
|
+
return getThemeRuleCss(theme.className, theme.tokens, CSS_CONFIG.tokenNameFormat || null);
|
|
716
|
+
}
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region runtime/sheet/rules.ts
|
|
719
|
+
function walkStylePropItemsSheetRules(items, onRule, onTheme) {
|
|
720
|
+
for (let i = 0, len = items.length; i < len; i++) walkStylePropItemSheetRules(items[i], onRule, onTheme);
|
|
721
|
+
}
|
|
722
|
+
function walkStylePropItemSheetRules(item, onRule, onTheme) {
|
|
723
|
+
if (isThemeData(item)) {
|
|
724
|
+
onTheme?.(item);
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
const items = getStylePropItems(item);
|
|
728
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
729
|
+
const rules = createRuntimeSheetRules(items[i]);
|
|
730
|
+
if (!rules) continue;
|
|
731
|
+
for (let j = 0, len = rules.length; j < len; j++) onRule(rules[j]);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function collectStylePropItemsSheetRulesWithThemes(items) {
|
|
735
|
+
const rules = [];
|
|
736
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
737
|
+
const addRule = (rule, dedupe) => {
|
|
738
|
+
const index = lookup.get(dedupe);
|
|
739
|
+
if (index === void 0) lookup.set(dedupe, rules.push(rule) - 1);
|
|
740
|
+
else rules[index] = rule;
|
|
741
|
+
};
|
|
742
|
+
walkStylePropItemsSheetRules(items, (rule) => {
|
|
743
|
+
if (!rule.key || !rule.dedupe) return;
|
|
744
|
+
addRule(createSheetRulePayload(rule), rule.dedupe);
|
|
745
|
+
}, (theme) => {
|
|
746
|
+
addRule({
|
|
747
|
+
key: theme.className,
|
|
748
|
+
css: createThemeRule(theme),
|
|
749
|
+
callsite: theme[BUILDER_CALLSITE]
|
|
750
|
+
}, theme.className);
|
|
751
|
+
});
|
|
752
|
+
return rules;
|
|
753
|
+
}
|
|
754
|
+
function createSheetRulePayload(rule) {
|
|
755
|
+
return {
|
|
756
|
+
key: rule.key,
|
|
757
|
+
css: rule.css,
|
|
758
|
+
callsite: rule.callsite || null,
|
|
759
|
+
debug: rule.debug || null,
|
|
760
|
+
debugField: rule.debugField || null,
|
|
761
|
+
priority: rule.priority
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
//#endregion
|
|
765
|
+
export { createThemeClassName as C, isServerRSC as S, getCombinedStyleStyles as _, addTokenOverride as a, isExtractedTokenBoundData as b, finishTokenValues as c, createCacheTreeNode as d, getCacheTreeChild as f, getCombinedStyleScopes as g, getStyleTokenValues as h, resolveStylePropRuntime as i, mergeTokenOverrides as l, createCombinedStyleTokenWrapper as m, walkStylePropItemsSheetRules as n, addTokenValues as o, createCombinedStyleFacade as p, insertRuntimeThemeRule as r, createMutableTokenValues as s, collectStylePropItemsSheetRulesWithThemes as t, mergeTokenValues as u, isCombinedStyle as v, IS_SERVER_RUNTIME as x, getExtractedTokenBoundData as y };
|
|
766
|
+
|
|
767
|
+
//# sourceMappingURL=rules-9HSO1pxL.js.map
|