@fluentic/style 0.1.0-beta.2 → 0.1.0-beta.20
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 +228 -16
- package/README.md +182 -49
- package/atomic/className.ts +33 -12
- package/atomic/debug/className/className.ts +10 -15
- package/atomic/element.ts +2 -2
- package/atomic/layer/layer.ts +7 -3
- package/atomic/rule.ts +20 -6
- package/atomic/scope.ts +19 -0
- package/atomic/theme.ts +41 -2
- package/atomic/token.ts +13 -3
- package/atomic/utils/{css.ts → cssIdent.ts} +0 -20
- package/atomic/utils/cssVar.ts +19 -0
- package/atomic/utils/debug.ts +1 -1
- package/atomic/utils/hash.ts +1 -65
- package/atomic/utils/selector.ts +40 -1
- package/atomic/utils/types.ts +4 -2
- package/builder/classname/class_name_builder.ts +68 -24
- package/builder/classname/fns.ts +2 -2
- package/builder/classname/types.ts +7 -0
- package/builder/data/const.ts +10 -1
- package/builder/data/create.ts +46 -0
- package/builder/data/data.ts +26 -1
- package/builder/data/index.ts +0 -1
- package/builder/data/is.ts +23 -0
- package/builder/data/merge/scope.ts +27 -19
- package/builder/data/merge/style.ts +115 -46
- package/builder/data/state.ts +17 -2
- package/builder/extract/index.ts +1 -0
- package/builder/extract/sheet.ts +30 -0
- package/builder/extract/token.ts +40 -14
- package/builder/extract/utils.ts +2 -0
- package/builder/extract/withTokens.ts +2 -1
- package/builder/selector_override.noop.ts +11 -0
- package/builder/selector_override.ts +31 -0
- package/builder/selector_override_core.ts +99 -0
- package/builder/style_builder.ts +127 -3
- package/builder/style_data.ts +25 -0
- package/builder/style_fns.ts +24 -24
- package/builder/token/data.ts +30 -0
- package/builder/token/index.ts +3 -0
- package/builder/token/name.ts +54 -0
- package/builder/token/symbols.ts +6 -0
- package/builder/types/alias.ts +34 -6
- package/builder/types/fns.ts +13 -5
- package/builder/types/types.ts +32 -2
- package/builder/utils.ts +1 -0
- package/compiler/compiler/cache_identity.ts +115 -0
- package/compiler/compiler/compiler.ts +123 -18
- package/compiler/compiler/constants.ts +6 -0
- package/compiler/compiler/index.ts +1 -0
- package/compiler/compiler/persistent_cache.ts +310 -0
- package/compiler/compiler/types.ts +16 -1
- package/compiler/cssProp.ts +21 -0
- package/compiler/extract/collector.ts +2 -2
- package/compiler/extract/extract.ts +24 -45
- package/compiler/extract/types.ts +6 -0
- package/compiler/index.ts +1 -0
- package/compiler/transform/cssProp/index.ts +1 -0
- package/compiler/transform/cssProp/plugin.ts +161 -0
- package/compiler/transform/debug/plugin.ts +107 -1
- package/compiler/transform/debug/transform.ts +2 -1
- package/compiler/transform/evaluator/evaluator.ts +223 -38
- package/compiler/transform/evaluator/lazy_bindings.ts +63 -0
- package/compiler/transform/evaluator/metadata_cache.ts +124 -0
- package/compiler/transform/evaluator/tracer.ts +151 -89
- package/compiler/transform/extract/chain/chain.ts +794 -84
- package/compiler/transform/extract/chain/extract_chain.ts +28 -4
- package/compiler/transform/extract/chain/types.ts +3 -1
- package/compiler/transform/extract/plugin.ts +159 -42
- package/compiler/transform/extract/transform.ts +2 -1
- package/compiler/transform/extract/utils/imports.ts +8 -1
- package/compiler/transform/extract/utils/replacement.ts +92 -5
- package/compiler/transform/extract/utils/state.ts +8 -2
- package/compiler/transform/extract/utils/theme.ts +6 -6
- package/compiler/transform/extract/utils/token.ts +107 -0
- package/compiler/transform/index.ts +1 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
- package/compiler/transform/syntax/static_ids.ts +1 -1
- package/compiler/transform/utils/babel.ts +1 -1
- package/compiler/utils/check_diagnostics.ts +18 -0
- package/compiler/utils/constants.ts +10 -5
- package/compiler/utils/file_resolver.ts +27 -1
- package/compiler/utils/import_source.ts +17 -7
- package/compiler/utils/imports.ts +11 -1
- package/config/build.ts +9 -2
- package/config/config/check.ts +25 -0
- package/config/config/css.ts +36 -1
- package/config/config/debug.ts +24 -1
- package/config/config/dev.ts +8 -0
- package/config/configure.ts +23 -2
- package/config/document.ts +23 -0
- package/css/globalSheet.ts +66 -0
- package/css/index.ts +5 -0
- package/css/sheet.ts +173 -0
- package/css/styleTarget.ts +251 -0
- package/dev/config.ts +2 -3
- package/dev/utils.ts +3 -3
- package/dialect/namedTokens.ts +30 -8
- package/dist/adapter/preact.js +2 -0
- package/dist/adapter/react.js +2 -0
- package/dist/adapter/solid.js +2 -0
- package/dist/className-CC5PHcXI.js +311 -0
- package/dist/className-CC5PHcXI.js.map +1 -0
- package/dist/{style-DUztHzBz.js → combine-CtR6MyD4.js} +402 -733
- package/dist/combine-CtR6MyD4.js.map +1 -0
- package/dist/compiler/index.mjs +2 -2
- package/dist/{compiler-BXcGyZUP.mjs → compiler-oXXProzz.mjs} +3092 -850
- package/dist/compiler-oXXProzz.mjs.map +1 -0
- package/dist/config/index.js +2 -2
- package/dist/config-BK7oK4Hx.js +57 -0
- package/dist/config-BK7oK4Hx.js.map +1 -0
- package/dist/config-BWFlaJ_v.js +6 -0
- package/dist/config-BWFlaJ_v.js.map +1 -0
- package/dist/config-BsF-QRgz.js +6 -0
- package/dist/{config-DcYrUB-M.js.map → config-BsF-QRgz.js.map} +1 -1
- package/dist/{config-C1k9vUrM.js → config-DKaGtG9O.js} +9 -7
- package/dist/config-DKaGtG9O.js.map +1 -0
- package/dist/config-IFmsTOQp.js +1 -0
- package/dist/css-B-7-Do-J.js +4541 -0
- package/dist/css-B-7-Do-J.js.map +1 -0
- package/dist/{css-CohHH2tn.js → css-BmIytNon.js} +185 -14
- package/dist/css-BmIytNon.js.map +1 -0
- package/dist/css-CYnQKnPu.js +563 -0
- package/dist/css-CYnQKnPu.js.map +1 -0
- package/dist/css.js +2 -2
- package/dist/{css_extra-DQdCrYoC.js → css_extra-Br7eDCrf.js} +2 -2
- package/dist/{css_extra-9BZ_jVET.js.map → css_extra-Br7eDCrf.js.map} +1 -1
- package/dist/{css_extra-9BZ_jVET.js → css_extra-qzi_eFFf.js} +2 -2
- package/dist/{css_extra-DQdCrYoC.js.map → css_extra-qzi_eFFf.js.map} +1 -1
- package/dist/data-D6dD67li.js +786 -0
- package/dist/data-D6dD67li.js.map +1 -0
- package/dist/debug-Bo43rBKc.js +73 -0
- package/dist/debug-Bo43rBKc.js.map +1 -0
- package/dist/dev/rsc.js +138 -28
- package/dist/dev/rsc.js.map +1 -1
- package/dist/{dev-C2u78xuv.js → dev-_DW5n4U4.js} +9 -10
- package/dist/dev-_DW5n4U4.js.map +1 -0
- package/dist/dev.js +1 -1
- package/dist/dialect/extracted/index.js +1 -1
- package/dist/dialect/index.js +1 -1
- package/dist/{elementMarker-BKzZyg5V.js → elementMarker-u0d2LH8r.js} +582 -61
- package/dist/elementMarker-u0d2LH8r.js.map +1 -0
- package/dist/entry/dev/adapter/preact.js +12 -0
- package/dist/entry/dev/adapter/preact.js.map +1 -0
- package/dist/entry/dev/adapter/react.js +12 -0
- package/dist/entry/dev/adapter/react.js.map +1 -0
- package/dist/entry/dev/adapter/solid.js +12 -0
- package/dist/entry/dev/adapter/solid.js.map +1 -0
- package/dist/entry/dev/css.js +3 -3
- package/dist/entry/dev/jsx-dev-runtime.js +2 -2
- package/dist/entry/dev/jsx-runtime.js +2 -2
- package/dist/entry/dev.js +13 -12
- package/dist/entry/prod/adapter/preact.js +12 -0
- package/dist/entry/prod/adapter/preact.js.map +1 -0
- package/dist/entry/prod/adapter/react.js +12 -0
- package/dist/entry/prod/adapter/react.js.map +1 -0
- package/dist/entry/prod/adapter/solid.js +12 -0
- package/dist/entry/prod/adapter/solid.js.map +1 -0
- package/dist/entry/prod/css.js +3 -3
- package/dist/entry/prod/extract.js +251 -3
- package/dist/entry/prod/extract.js.map +1 -0
- package/dist/entry/prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/prod/jsx-runtime.js +2 -2
- package/dist/entry/prod/runtime.js +3 -4
- package/dist/entry/prod.js +84 -1201
- package/dist/entry/prod.js.map +1 -1
- package/dist/entry/rsc-dev/adapter/preact.js +13 -0
- package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/react.js +13 -0
- package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/solid.js +13 -0
- package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +4 -3
- package/dist/entry/rsc-dev/dev.js +135 -32
- package/dist/entry/rsc-dev/dev.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +5 -4
- package/dist/entry/rsc-dev/jsx-dev-runtime.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
- package/dist/entry/rsc-dev.js +298 -616
- package/dist/entry/rsc-dev.js.map +1 -1
- package/dist/entry/rsc-prod/adapter/preact.js +2 -0
- package/dist/entry/rsc-prod/adapter/react.js +2 -0
- package/dist/entry/rsc-prod/adapter/solid.js +2 -0
- package/dist/entry/rsc-prod/css.js +9 -3
- package/dist/entry/rsc-prod/css.js.map +1 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
- package/dist/entry/rsc-prod/runtime.js +3 -4
- package/dist/entry/rsc-prod.js +251 -10
- package/dist/entry/rsc-prod.js.map +1 -0
- package/dist/{rules-Dz7Pu2K6.js → env-C8lKN1dB.js} +727 -147
- package/dist/env-C8lKN1dB.js.map +1 -0
- package/dist/{getClassName-C6690_nr.js → getClassName-BraU01Hd.js} +60 -15
- package/dist/getClassName-BraU01Hd.js.map +1 -0
- package/dist/getClassName-C35yO40s.js +548 -0
- package/dist/getClassName-C35yO40s.js.map +1 -0
- package/dist/getClassName-CfkGcBZy.js +49 -0
- package/dist/getClassName-CfkGcBZy.js.map +1 -0
- package/dist/{utils-D4YWF2K0.js → getClassName-i4oy2Up_.js} +27 -65
- package/dist/getClassName-i4oy2Up_.js.map +1 -0
- package/dist/{global-zaCE-g1C.js → global-DGcWZODV.js} +7 -8
- package/dist/global-DGcWZODV.js.map +1 -0
- package/dist/globalSheet-2ozCV1Zm.js +1091 -0
- package/dist/globalSheet-2ozCV1Zm.js.map +1 -0
- package/dist/hash-CGO13tOn.js +407 -0
- package/dist/hash-CGO13tOn.js.map +1 -0
- package/dist/index.js +10 -10
- package/dist/jsx/jsx-dev-runtime.js +2 -2
- package/dist/jsx/jsx-dev-runtime.server.js +3 -3
- package/dist/jsx/jsx-dev-runtime.server.js.map +1 -1
- package/dist/jsx/jsx-runtime.js +2 -2
- package/dist/jsx/jsx-runtime.server.js +4 -4
- package/dist/jsx/jsx-runtime.server.js.map +1 -1
- package/dist/jsx-C-v1b99-.js +39 -0
- package/dist/jsx-C-v1b99-.js.map +1 -0
- package/dist/{jsx_dev_runtime-DXlSD6kV.js → jsx_dev_runtime-Bd7FO7C1.js} +2 -3
- package/dist/{jsx_dev_runtime-DXlSD6kV.js.map → jsx_dev_runtime-Bd7FO7C1.js.map} +1 -1
- package/dist/jsx_runtime-BxumFGUy.js +13 -0
- package/dist/jsx_runtime-BxumFGUy.js.map +1 -0
- package/dist/{jsx_runtime-DPWo5qvV.js → jsx_runtime-gO4GQFcW.js} +3 -3
- package/dist/{jsx_runtime-CMdEXGNZ.js.map → jsx_runtime-gO4GQFcW.js.map} +1 -1
- package/dist/{loader-DCT1Q9yi.mjs → loader-A15L-NVK.mjs} +13 -14
- package/dist/loader-A15L-NVK.mjs.map +1 -0
- package/dist/{misc-o8pviMUi.mjs → misc-CRRQr1DT.mjs} +35 -8
- package/dist/misc-CRRQr1DT.mjs.map +1 -0
- package/dist/{namedTokens-BUa6raTb.js → namedTokens-paLD-Pdk.js} +15 -9
- package/dist/namedTokens-paLD-Pdk.js.map +1 -0
- package/dist/plugin/farm/index.mjs +5 -4
- package/dist/plugin/farm/index.mjs.map +1 -1
- package/dist/plugin/nextjs/index.mjs +153 -33
- package/dist/plugin/nextjs/index.mjs.map +1 -1
- package/dist/plugin/nextjs/loader.mjs +7 -5
- package/dist/plugin/nextjs/loader.mjs.map +1 -1
- package/dist/plugin/parcel/index.cjs +2 -0
- package/dist/plugin/parcel/index.mjs +3 -1
- package/dist/plugin/parcel/optimizer.cjs +3 -2
- package/dist/plugin/parcel/optimizer.cjs.map +1 -1
- package/dist/plugin/parcel/optimizer.mjs +3 -2
- package/dist/plugin/parcel/optimizer.mjs.map +1 -1
- package/dist/plugin/parcel/resolver.cjs +1 -1
- package/dist/plugin/parcel/resolver.mjs +2 -2
- package/dist/plugin/parcel/runtime.cjs +1 -1
- package/dist/plugin/parcel/runtime.mjs +1 -1
- package/dist/plugin/parcel/transformer.cjs +1 -1
- package/dist/plugin/parcel/transformer.mjs +2 -2
- package/dist/plugin/rspack/index.mjs +3 -2
- package/dist/plugin/rspack/index.mjs.map +1 -1
- package/dist/plugin/vite/index.mjs +26 -23
- package/dist/plugin/vite/index.mjs.map +1 -1
- package/dist/plugin/webpack/index.mjs +3 -2
- package/dist/plugin/webpack/loader.mjs +2 -2
- package/dist/presets/tailwind/index.js +32 -8
- package/dist/presets/tailwind/index.js.map +1 -1
- package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
- package/dist/presets-DSanixJV.js.map +1 -0
- package/dist/{registry-D3x1EDJm.mjs → registry-D2C6hTdx.mjs} +2 -2
- package/dist/{registry-D3x1EDJm.mjs.map → registry-D2C6hTdx.mjs.map} +1 -1
- package/dist/resolveClassNameRuntime-Cp8_UcxF.js +63 -0
- package/dist/resolveClassNameRuntime-Cp8_UcxF.js.map +1 -0
- package/dist/scope-Dg83Az-2.js +601 -0
- package/dist/scope-Dg83Az-2.js.map +1 -0
- package/dist/selector/index.js +1 -2
- package/dist/server.js +91 -17
- package/dist/server.js.map +1 -1
- package/dist/{shared-B_gJf5uj.cjs → shared-B7Nw_dcx.cjs} +3152 -891
- package/dist/shared-B7Nw_dcx.cjs.map +1 -0
- package/dist/{shared-uAzFeq0x.mjs → shared-BmJmaxu8.mjs} +5 -5
- package/dist/shared-BmJmaxu8.mjs.map +1 -0
- package/dist/sheet-CHnDkjn4.js +56 -0
- package/dist/sheet-CHnDkjn4.js.map +1 -0
- package/dist/sheet-PVxRQrOp.js +7 -0
- package/dist/sheet-PVxRQrOp.js.map +1 -0
- package/dist/sheet-ueNBw_2u.js +1 -0
- package/dist/{sidecar-BUO1hKXu.mjs → sidecar-DVegwGec.mjs} +3 -3
- package/dist/{sidecar-BUO1hKXu.mjs.map → sidecar-DVegwGec.mjs.map} +1 -1
- package/dist/{style-BkeAZl0n.js → style-B1tkE8zl.js} +329 -129
- package/dist/style-B1tkE8zl.js.map +1 -0
- package/dist/styleStore-BK2XBS8n.js +45 -0
- package/dist/styleStore-BK2XBS8n.js.map +1 -0
- package/dist/styleStore-D4umgIwQ.js +3457 -0
- package/dist/styleStore-D4umgIwQ.js.map +1 -0
- package/dist/token-BX5jRxMb.js +110 -0
- package/dist/token-BX5jRxMb.js.map +1 -0
- package/dist/token-CS0iRIIa.js +140 -0
- package/dist/token-CS0iRIIa.js.map +1 -0
- package/dist/{trace-D0IL6JT8.js → trace-DZYKSwdB.js} +2 -2
- package/dist/{trace-D0IL6JT8.js.map → trace-DZYKSwdB.js.map} +1 -1
- package/dist/{trace-DR7_Rpkg.js → trace-EEKXwKSr.js} +3 -3
- package/dist/{trace-DR7_Rpkg.js.map → trace-EEKXwKSr.js.map} +1 -1
- package/dist/{transform-BTJOg8Hg.js → transform-BZ4jPwy3.js} +2 -2
- package/dist/transform-BZ4jPwy3.js.map +1 -0
- package/dist/types/adapter/preact.d.ts +1 -0
- package/dist/types/adapter/react.d.ts +1 -0
- package/dist/types/adapter/solid.d.ts +1 -0
- package/dist/types/atomic/atRule/counterStyle.d.ts +10 -0
- package/dist/types/atomic/atRule/fontFace.d.ts +10 -0
- package/dist/types/atomic/atRule/fontPaletteValues.d.ts +10 -0
- package/dist/types/atomic/atRule/fontSrc.d.ts +1 -0
- package/dist/types/atomic/atRule/keyframes.d.ts +13 -0
- package/dist/types/atomic/atRule/positionTry.d.ts +13 -0
- package/dist/types/atomic/atRule/property.d.ts +13 -0
- package/dist/types/atomic/atRule/utils.d.ts +5 -0
- package/dist/types/atomic/className.d.ts +11 -0
- package/dist/types/atomic/debug/className/className.d.ts +9 -0
- package/dist/types/atomic/debug/className/index.d.ts +1 -0
- package/dist/types/atomic/debug/property/data.d.ts +3 -0
- package/dist/types/atomic/debug/property/index.d.ts +1 -0
- package/dist/types/atomic/debug/property/property.d.ts +5 -0
- package/dist/types/atomic/debug/selector.d.ts +2 -0
- package/dist/types/atomic/debug/value.d.ts +5 -0
- package/dist/types/atomic/element.d.ts +5 -0
- package/dist/types/atomic/layer/index.d.ts +3 -0
- package/dist/types/atomic/layer/layer.d.ts +12 -0
- package/dist/types/atomic/layer/types.d.ts +30 -0
- package/dist/types/atomic/layer/utils.d.ts +4 -0
- package/dist/types/atomic/property/index.d.ts +2 -0
- package/dist/types/atomic/property/presets.d.ts +4 -0
- package/dist/types/atomic/property/property.d.ts +3 -0
- package/dist/types/atomic/property/type_maps.d.ts +31 -0
- package/dist/types/atomic/property/types.d.ts +4 -0
- package/dist/types/atomic/rule.d.ts +5 -0
- package/dist/types/atomic/scope.d.ts +3 -0
- package/dist/types/atomic/theme.d.ts +7 -0
- package/dist/types/atomic/token.d.ts +7 -0
- package/dist/types/atomic/utils/cssIdent.d.ts +2 -0
- package/dist/types/atomic/utils/cssVar.d.ts +3 -0
- package/dist/types/atomic/utils/debug.d.ts +4 -0
- package/dist/types/atomic/utils/format.d.ts +5 -0
- package/dist/types/atomic/utils/hash.d.ts +1 -0
- package/dist/types/atomic/utils/selector.d.ts +7 -0
- package/dist/types/atomic/utils/types.d.ts +8 -0
- package/dist/types/atomic/value/index.d.ts +2 -0
- package/dist/types/atomic/value/unitless.d.ts +1 -0
- package/dist/types/atomic/value/value.d.ts +2 -0
- package/dist/types/atomic/var.d.ts +4 -0
- package/dist/types/builder/classname/class_name_builder.d.ts +4 -0
- package/dist/types/builder/classname/fns.d.ts +48 -0
- package/dist/types/builder/classname/index.d.ts +3 -0
- package/dist/types/builder/classname/types.d.ts +18 -0
- package/dist/types/builder/data/check_selector.d.ts +2 -0
- package/dist/types/builder/data/const.d.ts +27 -0
- package/dist/types/builder/data/create.d.ts +13 -0
- package/dist/types/builder/data/data.d.ts +44 -0
- package/dist/types/builder/data/debug.d.ts +38 -0
- package/dist/types/builder/data/index.d.ts +8 -0
- package/dist/types/builder/data/is.d.ts +16 -0
- package/dist/types/builder/data/merge/index.d.ts +2 -0
- package/dist/types/builder/data/merge/scope.d.ts +7 -0
- package/dist/types/builder/data/merge/style.d.ts +6 -0
- package/dist/types/builder/data/merge/utils.d.ts +10 -0
- package/dist/types/builder/data/selector.d.ts +8 -0
- package/dist/types/builder/data/state.d.ts +100 -0
- package/dist/types/builder/extract/index.d.ts +7 -0
- package/dist/types/builder/extract/scope.d.ts +14 -0
- package/dist/types/builder/extract/sheet.d.ts +10 -0
- package/dist/types/builder/extract/slot.d.ts +9 -0
- package/dist/types/builder/extract/style.d.ts +11 -0
- package/dist/types/builder/extract/theme.d.ts +2 -0
- package/dist/types/builder/extract/token.d.ts +12 -0
- package/dist/types/builder/extract/utils.d.ts +28 -0
- package/dist/types/builder/extract/withTokens.d.ts +10 -0
- package/dist/types/builder/index.d.ts +2 -0
- package/dist/types/builder/selector_override.d.ts +5 -0
- package/dist/types/builder/selector_override_core.d.ts +8 -0
- package/dist/types/builder/style_builder.d.ts +15 -0
- package/dist/types/builder/style_data.d.ts +8 -0
- package/dist/types/builder/style_fns.d.ts +14 -0
- package/dist/types/builder/token/data.d.ts +10 -0
- package/dist/types/builder/token/name.d.ts +3 -0
- package/dist/types/builder/token/symbols.d.ts +4 -0
- package/dist/types/builder/types/alias.d.ts +59 -0
- package/dist/types/builder/types/fns.d.ts +115 -0
- package/dist/types/builder/types/index.d.ts +1 -0
- package/dist/types/builder/types/types.d.ts +22 -0
- package/dist/types/builder/utils.d.ts +9 -0
- package/dist/types/compiler/compiler/cache.d.ts +24 -0
- package/dist/types/compiler/compiler/cache_identity.d.ts +4 -0
- package/dist/types/compiler/compiler/compiler.d.ts +40 -0
- package/dist/types/compiler/compiler/constants.d.ts +6 -0
- package/dist/types/compiler/compiler/index.d.ts +4 -0
- package/dist/types/compiler/compiler/persistent_cache.d.ts +14 -0
- package/dist/types/compiler/compiler/types.d.ts +64 -0
- package/dist/types/compiler/cssProp.d.ts +8 -0
- package/dist/types/compiler/extract/collector.d.ts +8 -0
- package/dist/types/compiler/extract/extract.d.ts +6 -0
- package/dist/types/compiler/extract/index.d.ts +3 -0
- package/dist/types/compiler/extract/types.d.ts +29 -0
- package/dist/types/compiler/index.d.ts +3 -0
- package/dist/types/compiler/transform/cssProp/index.d.ts +1 -0
- package/dist/types/compiler/transform/cssProp/plugin.d.ts +13 -0
- package/dist/types/compiler/transform/debug/index.d.ts +2 -0
- package/dist/types/compiler/transform/debug/plugin.d.ts +34 -0
- package/dist/types/compiler/transform/debug/transform.d.ts +7 -0
- package/dist/types/compiler/transform/debug/utils/debug_data.d.ts +11 -0
- package/dist/types/compiler/transform/debug/utils/source_url.d.ts +2 -0
- package/dist/types/compiler/transform/evaluator/evaluator.d.ts +58 -0
- package/dist/types/compiler/transform/evaluator/index.d.ts +3 -0
- package/dist/types/compiler/transform/evaluator/lazy_bindings.d.ts +22 -0
- package/dist/types/compiler/transform/evaluator/metadata_cache.d.ts +13 -0
- package/dist/types/compiler/transform/evaluator/tracer.d.ts +15 -0
- package/dist/types/compiler/transform/evaluator/types.d.ts +21 -0
- package/dist/types/compiler/transform/extract/chain/chain.d.ts +18 -0
- package/dist/types/compiler/transform/extract/chain/extract_chain.d.ts +21 -0
- package/dist/types/compiler/transform/extract/chain/index.d.ts +3 -0
- package/dist/types/compiler/transform/extract/chain/types.d.ts +32 -0
- package/dist/types/compiler/transform/extract/index.d.ts +2 -0
- package/dist/types/compiler/transform/extract/plugin.d.ts +20 -0
- package/dist/types/compiler/transform/extract/transform.d.ts +10 -0
- package/dist/types/compiler/transform/extract/utils/imports.d.ts +3 -0
- package/dist/types/compiler/transform/extract/utils/replacement.d.ts +11 -0
- package/dist/types/compiler/transform/extract/utils/slot.d.ts +4 -0
- package/dist/types/compiler/transform/extract/utils/state.d.ts +36 -0
- package/dist/types/compiler/transform/extract/utils/theme.d.ts +9 -0
- package/dist/types/compiler/transform/extract/utils/token.d.ts +4 -0
- package/dist/types/compiler/transform/index.d.ts +5 -0
- package/dist/types/compiler/transform/syntax/index.d.ts +5 -0
- package/dist/types/compiler/transform/syntax/isStaticStyleValue.d.ts +2 -0
- package/dist/types/compiler/transform/syntax/isStyleChainCall.d.ts +2 -0
- package/dist/types/compiler/transform/syntax/static_ids.d.ts +16 -0
- package/dist/types/compiler/transform/syntax/types.d.ts +4 -0
- package/dist/types/compiler/transform/syntax/utils.d.ts +5 -0
- package/dist/types/compiler/transform/utils/babel.d.ts +21 -0
- package/dist/types/compiler/transform/utils/import.d.ts +2 -0
- package/dist/types/compiler/transform/utils/path.d.ts +1 -0
- package/dist/types/compiler/transform/utils/selector.d.ts +18 -0
- package/dist/types/compiler/utils/check_diagnostics.d.ts +7 -0
- package/dist/types/compiler/utils/constants.d.ts +70 -0
- package/dist/types/compiler/utils/file_resolver.d.ts +16 -0
- package/dist/types/compiler/utils/import_source.d.ts +34 -0
- package/dist/types/compiler/utils/imports.d.ts +6 -0
- package/dist/types/compiler/utils/path.d.ts +4 -0
- package/dist/types/compiler/utils/sourcemap.d.ts +36 -0
- package/dist/types/config/build.d.ts +20 -0
- package/dist/types/config/config/check.d.ts +11 -0
- package/dist/types/config/config/css.d.ts +29 -0
- package/dist/types/config/config/css_extra.d.ts +13 -0
- package/dist/types/config/config/debug.d.ts +14 -0
- package/dist/types/config/config/dev.d.ts +36 -0
- package/dist/types/config/config/runtime.d.ts +10 -0
- package/dist/types/config/configure.d.ts +14 -0
- package/dist/types/config/constants.d.ts +1 -0
- package/dist/types/config/document.d.ts +3 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/types.d.ts +47 -0
- package/dist/types/config/utils.d.ts +2 -0
- package/dist/types/css/counterStyle.d.ts +4 -0
- package/dist/types/css/fontFace.d.ts +5 -0
- package/dist/types/css/fontPaletteValues.d.ts +4 -0
- package/dist/types/css/globalSheet.d.ts +24 -0
- package/dist/types/css/index.d.ts +12 -0
- package/dist/types/css/keyframes.d.ts +4 -0
- package/dist/types/css/positionTry.d.ts +4 -0
- package/dist/types/css/property.d.ts +7 -0
- package/dist/types/css/sheet.d.ts +8 -0
- package/dist/types/css/styleTarget.d.ts +9 -0
- package/dist/types/css/utils.d.ts +19 -0
- package/dist/types/dev/config.d.ts +6 -0
- package/dist/types/dev/fns.d.ts +14 -0
- package/dist/types/dev/index.d.ts +2 -0
- package/dist/types/dev/trace.d.ts +8 -0
- package/dist/types/dev/utils.d.ts +5 -0
- package/dist/types/dialect/extracted/index.d.ts +1 -0
- package/dist/types/dialect/index.d.ts +1 -0
- package/dist/types/dialect/namedTokens.d.ts +9 -0
- package/dist/types/entry/dev/adapter/preact.d.ts +1 -0
- package/dist/types/entry/dev/adapter/react.d.ts +1 -0
- package/dist/types/entry/dev/adapter/solid.d.ts +1 -0
- package/dist/types/entry/dev/config.d.ts +2 -0
- package/dist/types/entry/dev/css.d.ts +2 -0
- package/dist/types/entry/dev/index.d.ts +3 -0
- package/dist/types/entry/dev/jsx_dev_runtime.d.ts +3 -0
- package/dist/types/entry/dev/sheet.d.ts +1 -0
- package/dist/types/entry/prod/adapter/preact.d.ts +1 -0
- package/dist/types/entry/prod/adapter/react.d.ts +1 -0
- package/dist/types/entry/prod/adapter/solid.d.ts +1 -0
- package/dist/types/entry/prod/config.d.ts +2 -0
- package/dist/types/entry/prod/config_debug.d.ts +2 -0
- package/dist/types/entry/prod/css.d.ts +2 -0
- package/dist/types/entry/prod/extract.d.ts +1 -0
- package/dist/types/entry/prod/index.d.ts +2 -0
- package/dist/types/entry/prod/jsx_runtime.d.ts +2 -0
- package/dist/types/entry/prod/runtime.d.ts +8 -0
- package/dist/types/entry/rsc_dev/adapter/preact.d.ts +1 -0
- package/dist/types/entry/rsc_dev/adapter/react.d.ts +1 -0
- package/dist/types/entry/rsc_dev/adapter/solid.d.ts +1 -0
- package/dist/types/entry/rsc_dev/config.d.ts +2 -0
- package/dist/types/entry/rsc_dev/css.d.ts +3 -0
- package/dist/types/entry/rsc_dev/index.d.ts +2 -0
- package/dist/types/entry/rsc_dev/server.d.ts +10 -0
- package/dist/types/entry/rsc_prod/adapter/preact.d.ts +1 -0
- package/dist/types/entry/rsc_prod/adapter/react.d.ts +1 -0
- package/dist/types/entry/rsc_prod/adapter/solid.d.ts +1 -0
- package/dist/types/entry/rsc_prod/config.d.ts +2 -0
- package/dist/types/entry/rsc_prod/config_debug.d.ts +2 -0
- package/dist/types/entry/rsc_prod/css.d.ts +2 -0
- package/dist/types/entry/rsc_prod/index.d.ts +2 -0
- package/dist/types/entry/rsc_prod/jsx_runtime.d.ts +2 -0
- package/dist/types/entry/rsc_prod/runtime.d.ts +4 -0
- package/dist/types/entry/rsc_prod/server.d.ts +6 -0
- package/dist/types/entry/shared/config.d.ts +1 -0
- package/dist/types/entry/shared/config_debug.d.ts +1 -0
- package/dist/types/entry/shared/config_dev.d.ts +1 -0
- package/dist/types/entry/shared/dev.d.ts +1 -0
- package/dist/types/entry/shared/prod.d.ts +1 -0
- package/dist/types/entry/shared/utils.d.ts +2 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/jsx/extracted/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/rsc/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/rsc_extracted/jsx_runtime.d.ts +2 -0
- package/dist/types/jsx/runtime/jsx_dev_runtime.d.ts +6 -0
- package/dist/types/jsx/runtime/jsx_runtime.d.ts +7 -0
- package/dist/types/jsx/types/index.d.ts +1 -0
- package/dist/types/jsx/types/preact.d.ts +12 -0
- package/dist/types/jsx/types/react.d.ts +10 -0
- package/dist/types/jsx/types/solid.d.ts +12 -0
- package/dist/types/jsx/utils.d.ts +19 -0
- package/dist/types/plugin/bundler/farm/index.d.ts +1 -0
- package/dist/types/plugin/bundler/farm/plugin.d.ts +97 -0
- package/dist/types/plugin/bundler/parcel/index.d.ts +1 -0
- package/dist/types/plugin/bundler/parcel/optimizer.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/plugin.d.ts +6 -0
- package/dist/types/plugin/bundler/parcel/resolver.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/runtime.d.ts +3 -0
- package/dist/types/plugin/bundler/parcel/shared.d.ts +37 -0
- package/dist/types/plugin/bundler/parcel/transformer.d.ts +3 -0
- package/dist/types/plugin/bundler/rspack/index.d.ts +1 -0
- package/dist/types/plugin/bundler/rspack/plugin.d.ts +7 -0
- package/dist/types/plugin/bundler/vite/index.d.ts +1 -0
- package/dist/types/plugin/bundler/vite/plugin.d.ts +6 -0
- package/dist/types/plugin/bundler/vite/state.d.ts +79 -0
- package/dist/types/plugin/bundler/webpack/index.d.ts +1 -0
- package/dist/types/plugin/bundler/webpack/loader.d.ts +2 -0
- package/dist/types/plugin/bundler/webpack/plugin.d.ts +11 -0
- package/dist/types/plugin/bundler/webpack/shared/loader.d.ts +31 -0
- package/dist/types/plugin/bundler/webpack/shared/registry.d.ts +4 -0
- package/dist/types/plugin/bundler/webpack/utils.d.ts +18 -0
- package/dist/types/plugin/nextjs/constants.d.ts +3 -0
- package/dist/types/plugin/nextjs/html.d.ts +1 -0
- package/dist/types/plugin/nextjs/index.d.ts +2 -0
- package/dist/types/plugin/nextjs/loader.d.ts +3 -0
- package/dist/types/plugin/nextjs/plugin.d.ts +5 -0
- package/dist/types/plugin/nextjs/types.d.ts +21 -0
- package/dist/types/plugin/nextjs/utils.d.ts +59 -0
- package/dist/types/plugin/utils/cache/css_cache.d.ts +34 -0
- package/dist/types/plugin/utils/cache/file.d.ts +4 -0
- package/dist/types/plugin/utils/cache/index.d.ts +2 -0
- package/dist/types/plugin/utils/compiler.d.ts +51 -0
- package/dist/types/plugin/utils/constants.d.ts +4 -0
- package/dist/types/plugin/utils/cssMarker.d.ts +4 -0
- package/dist/types/plugin/utils/cssOutput.d.ts +10 -0
- package/dist/types/plugin/utils/filter.d.ts +25 -0
- package/dist/types/plugin/utils/imports.d.ts +3 -0
- package/dist/types/plugin/utils/index.d.ts +10 -0
- package/dist/types/plugin/utils/injection.d.ts +3 -0
- package/dist/types/plugin/utils/misc.d.ts +1 -0
- package/dist/types/plugin/utils/runtimeEntry.d.ts +8 -0
- package/dist/types/plugin/utils/sidecar/index.d.ts +1 -0
- package/dist/types/plugin/utils/sidecar/server.d.ts +19 -0
- package/dist/types/plugin/utils/sidecar/sidecar.d.ts +17 -0
- package/dist/types/plugin/utils/sidecar/utils.d.ts +33 -0
- package/dist/types/plugin/utils/sourcemap.d.ts +9 -0
- package/dist/types/plugin/utils/virtual.d.ts +12 -0
- package/dist/types/presets/tailwind/classname/index.d.ts +2 -0
- package/dist/types/presets/tailwind/classname/transform.d.ts +8 -0
- package/dist/types/presets/tailwind/classname/types.d.ts +27 -0
- package/dist/types/presets/tailwind/index.d.ts +5 -0
- package/dist/types/presets/tailwind/selectors.d.ts +68 -0
- package/dist/types/presets/tailwind/style/index.d.ts +2 -0
- package/dist/types/presets/tailwind/style/transform.d.ts +8 -0
- package/dist/types/presets/tailwind/style/types.d.ts +149 -0
- package/dist/types/presets/tailwind/theme.d.ts +477 -0
- package/dist/types/presets/tailwind/types.d.ts +53 -0
- package/dist/types/runtime/adapter/utils.d.ts +12 -0
- package/dist/types/runtime/core/cache/combine.d.ts +6 -0
- package/dist/types/runtime/core/cache/combineRuntime.d.ts +1 -0
- package/dist/types/runtime/core/cache/item.d.ts +15 -0
- package/dist/types/runtime/core/cache/itemWithResolver.d.ts +4 -0
- package/dist/types/runtime/core/cache/pool.d.ts +16 -0
- package/dist/types/runtime/core/cache/prop.d.ts +19 -0
- package/dist/types/runtime/core/cache/propCache.d.ts +12 -0
- package/dist/types/runtime/core/cache/resolvedItem.d.ts +5 -0
- package/dist/types/runtime/core/cache/result.d.ts +9 -0
- package/dist/types/runtime/core/cache/stateItem.d.ts +14 -0
- package/dist/types/runtime/core/cache/token.d.ts +2 -0
- package/dist/types/runtime/core/cache/tokenValues.d.ts +26 -0
- package/dist/types/runtime/core/cache/utils/tree.d.ts +12 -0
- package/dist/types/runtime/core/cache/utils/walk.d.ts +1 -0
- package/dist/types/runtime/core/className.d.ts +18 -0
- package/dist/types/runtime/core/combinedStyle.d.ts +20 -0
- package/dist/types/runtime/core/createTransformElement.d.ts +4 -0
- package/dist/types/runtime/core/elementMarker.d.ts +12 -0
- package/dist/types/runtime/core/elementMarkerData.d.ts +7 -0
- package/dist/types/runtime/core/getClassName.d.ts +4 -0
- package/dist/types/runtime/core/getSheetRules.d.ts +3 -0
- package/dist/types/runtime/core/getToken.d.ts +3 -0
- package/dist/types/runtime/core/index.d.ts +5 -0
- package/dist/types/runtime/core/jsx.d.ts +1 -0
- package/dist/types/runtime/core/resolveClassNameRuntime.d.ts +8 -0
- package/dist/types/runtime/env.d.ts +2 -0
- package/dist/types/runtime/extract/combineStyle.d.ts +27 -0
- package/dist/types/runtime/extract/getClassName.d.ts +10 -0
- package/dist/types/runtime/extract/index.d.ts +6 -0
- package/dist/types/runtime/extract/jsx.d.ts +10 -0
- package/dist/types/runtime/extract/token.d.ts +5 -0
- package/dist/types/runtime/extract/tokenResolver.d.ts +2 -0
- package/dist/types/runtime/rsc/constants.d.ts +6 -0
- package/dist/types/runtime/rsc/dev.d.ts +11 -0
- package/dist/types/runtime/rsc/getClassName.d.ts +27 -0
- package/dist/types/runtime/rsc/globalSheet.d.ts +22 -0
- package/dist/types/runtime/rsc/index.d.ts +1 -0
- package/dist/types/runtime/rsc/jsx.d.ts +1 -0
- package/dist/types/runtime/rsc/observer.d.ts +10 -0
- package/dist/types/runtime/rsc/styleStore.d.ts +7 -0
- package/dist/types/runtime/sheet/document.d.ts +3 -0
- package/dist/types/runtime/sheet/element.d.ts +2 -0
- package/dist/types/runtime/sheet/global.d.ts +3 -0
- package/dist/types/runtime/sheet/index.d.ts +3 -0
- package/dist/types/runtime/sheet/insert.d.ts +5 -0
- package/dist/types/runtime/sheet/rule.d.ts +8 -0
- package/dist/types/runtime/sheet/rules.d.ts +10 -0
- package/dist/types/runtime/sheet/theme.d.ts +5 -0
- package/dist/types/runtime/style/index.d.ts +3 -0
- package/dist/types/runtime/style/scope.d.ts +4 -0
- package/dist/types/runtime/style/style.d.ts +27 -0
- package/dist/types/runtime/style/token.d.ts +1 -0
- package/dist/types/runtime/types.d.ts +31 -0
- package/dist/types/selector/assert.d.ts +13 -0
- package/dist/types/selector/index.d.ts +5 -0
- package/dist/types/selector/presets/default.d.ts +108 -0
- package/dist/types/selector/presets/index.d.ts +3 -0
- package/dist/types/selector/presets/minimal.d.ts +46 -0
- package/dist/types/selector/presets/selectors.d.ts +62 -0
- package/dist/types/selector/selector.d.ts +25 -0
- package/dist/types/selector/types.d.ts +12 -0
- package/dist/types/selector/validate.d.ts +5 -0
- package/dist/types/sheet/dev/dev_layer.d.ts +4 -0
- package/dist/types/sheet/dev/dev_sort.d.ts +2 -0
- package/dist/types/sheet/dev/index.d.ts +5 -0
- package/dist/types/sheet/dev/utils.d.ts +26 -0
- package/dist/types/sheet/index.d.ts +4 -0
- package/dist/types/sheet/ordered.d.ts +4 -0
- package/dist/types/sheet/ordering.d.ts +15 -0
- package/dist/types/sheet/prod.d.ts +2 -0
- package/dist/types/sheet/sheet.d.ts +2 -0
- package/dist/types/sheet/sourcemap.d.ts +11 -0
- package/dist/types/sheet/types.d.ts +37 -0
- package/dist/types/sheet/utils/dom.d.ts +5 -0
- package/dist/types/sheet/utils/index.d.ts +4 -0
- package/dist/types/sheet/utils/layer.d.ts +10 -0
- package/dist/types/sheet/utils/noop.d.ts +2 -0
- package/dist/types/sheet/utils/rule.d.ts +3 -0
- package/dist/types/sheet/utils/sourcemap.d.ts +12 -0
- package/dist/types/style/classname.d.ts +15 -0
- package/dist/types/style/important.d.ts +9 -0
- package/dist/types/style/index.d.ts +12 -0
- package/dist/types/style/keyframes.d.ts +10 -0
- package/dist/types/style/style.d.ts +426 -0
- package/dist/types/style/theme.d.ts +5 -0
- package/dist/types/style/token.d.ts +29 -0
- package/dist/types/style/tokens.d.ts +10 -0
- package/dist/types/style/transform.d.ts +22 -0
- package/dist/types/style/types.d.ts +22 -0
- package/dist/types/style/utils/expose.d.ts +8 -0
- package/dist/types/style/utils/index.d.ts +1 -0
- package/dist/types/style/value.d.ts +12 -0
- package/dist/types/style/valueRef.d.ts +13 -0
- package/dist/types/style/weight.d.ts +9 -0
- package/dist/types/utils/global.d.ts +4 -0
- package/dist/types/utils/hash.d.ts +3 -0
- package/dist/types/utils/id.d.ts +12 -0
- package/dist/types/utils/object.d.ts +10 -0
- package/dist/types/utils/symbol.d.ts +1 -0
- package/dist/types/utils/trace.d.ts +21 -0
- package/dist/types/utils/type.d.ts +11 -0
- package/dist/utils-0UTYm294.js +42 -0
- package/dist/utils-0UTYm294.js.map +1 -0
- package/dist/utils-CO1ZXzKK.mjs +182 -0
- package/dist/utils-CO1ZXzKK.mjs.map +1 -0
- package/dist/{utils-DQGa0uzS.mjs → utils-CxYxZSSk.mjs} +3 -3
- package/dist/{utils-DQGa0uzS.mjs.map → utils-CxYxZSSk.mjs.map} +1 -1
- package/dist/utils-D1duUYV9.js +72 -0
- package/dist/utils-D1duUYV9.js.map +1 -0
- package/dist/utils-DxCpyV2E.js +62 -0
- package/dist/utils-DxCpyV2E.js.map +1 -0
- package/dist/{utils-BsbfH6cd.js → utils-ymEmGz-T.js} +1274 -608
- package/dist/utils-ymEmGz-T.js.map +1 -0
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/dist/{webpack-Fb9xF5jS.mjs → webpack-DF165M2x.mjs} +7 -7
- package/dist/webpack-DF165M2x.mjs.map +1 -0
- package/entry/dev/adapter/preact.ts +8 -0
- package/entry/dev/adapter/react.ts +8 -0
- package/entry/dev/adapter/solid.ts +8 -0
- package/entry/dev/sheet.ts +4 -2
- package/entry/prod/adapter/preact.ts +8 -0
- package/entry/prod/adapter/react.ts +8 -0
- package/entry/prod/adapter/solid.ts +8 -0
- package/entry/prod/config_debug.ts +2 -0
- package/entry/prod/index.ts +1 -1
- package/entry/prod/runtime.ts +3 -1
- package/entry/rsc_dev/adapter/preact.ts +9 -0
- package/entry/rsc_dev/adapter/react.ts +9 -0
- package/entry/rsc_dev/adapter/solid.ts +9 -0
- package/entry/rsc_dev/css.ts +2 -0
- package/entry/rsc_prod/adapter/preact.ts +1 -0
- package/entry/rsc_prod/adapter/react.ts +1 -0
- package/entry/rsc_prod/adapter/solid.ts +1 -0
- package/entry/rsc_prod/config_debug.ts +6 -0
- package/entry/rsc_prod/index.ts +1 -1
- package/entry/shared/config_debug.ts +9 -0
- package/entry/shared/config_dev.ts +9 -7
- package/index.ts +1 -0
- package/jsx/rsc/jsx_dev_runtime.ts +11 -2
- package/jsx/rsc/jsx_runtime.ts +14 -3
- package/jsx/types/index.ts +1 -0
- package/jsx/types/preact.ts +14 -0
- package/jsx/{types.ts → types/react.ts} +2 -2
- package/jsx/types/solid.ts +15 -0
- package/package.json +179 -74
- package/plugin/bundler/farm/plugin.ts +3 -1
- package/plugin/bundler/parcel/optimizer.ts +1 -0
- package/plugin/bundler/parcel/plugin.ts +2 -0
- package/plugin/bundler/parcel/shared.ts +1 -1
- package/plugin/bundler/rspack/plugin.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +23 -25
- package/plugin/bundler/vite/state.ts +7 -8
- package/plugin/bundler/webpack/plugin.ts +4 -3
- package/plugin/bundler/webpack/shared/loader.ts +13 -7
- package/plugin/nextjs/loader.ts +18 -2
- package/plugin/nextjs/plugin.ts +248 -35
- package/plugin/nextjs/types.ts +1 -2
- package/plugin/nextjs/utils.ts +122 -1
- package/plugin/utils/compiler.ts +3 -2
- package/plugin/utils/filter.ts +65 -1
- package/plugin/utils/runtimeEntry.ts +3 -2
- package/presets/tailwind/classname/transform.ts +32 -1
- package/presets/tailwind/style/transform.ts +9 -3
- package/runtime/adapter/utils.ts +120 -0
- package/runtime/core/cache/combine.ts +76 -28
- package/runtime/core/cache/combineRuntime.ts +4 -0
- package/runtime/core/cache/index.ts +2 -1
- package/runtime/core/cache/item.ts +32 -13
- package/runtime/core/cache/itemWithResolver.ts +44 -0
- package/runtime/core/cache/pool.ts +15 -30
- package/runtime/core/cache/prop.ts +10 -8
- package/runtime/core/cache/result.ts +2 -2
- package/runtime/core/cache/stateItem.ts +19 -1
- package/runtime/core/cache/token.ts +20 -0
- package/runtime/core/cache/tokenValues.ts +19 -11
- package/runtime/core/combinedStyle.ts +4 -4
- package/runtime/core/elementMarker.ts +9 -3
- package/runtime/extract/combineStyle.ts +211 -0
- package/runtime/extract/getClassName.ts +61 -16
- package/runtime/extract/index.ts +3 -1
- package/runtime/extract/token.ts +41 -0
- package/runtime/extract/tokenResolver.ts +17 -0
- package/runtime/rsc/constants.ts +3 -0
- package/runtime/rsc/dev.ts +31 -15
- package/runtime/rsc/getClassName.ts +10 -0
- package/runtime/rsc/globalSheet.ts +130 -0
- package/runtime/rsc/observer.ts +125 -15
- package/runtime/rsc/styleStore.ts +10 -19
- package/runtime/sheet/document.ts +28 -0
- package/runtime/sheet/global-prod.ts +3 -5
- package/runtime/sheet/global.ts +3 -5
- package/runtime/sheet/rule.ts +18 -12
- package/runtime/sheet/rules.ts +11 -3
- package/runtime/style/scope.ts +0 -24
- package/runtime/style/style.ts +181 -6
- package/runtime/types.ts +3 -3
- package/sheet/dev/dev_layer.ts +76 -17
- package/sheet/dev/dev_sort.ts +70 -18
- package/sheet/dev/index.ts +23 -3
- package/sheet/ordered.ts +225 -0
- package/sheet/ordering.ts +156 -0
- package/sheet/prod.ts +39 -12
- package/sheet/types.ts +7 -0
- package/sheet/utils/layer.ts +34 -0
- package/style/classname.ts +12 -6
- package/style/important.ts +21 -0
- package/style/index.ts +2 -0
- package/style/style.ts +17 -5
- package/style/theme.ts +0 -1
- package/style/token.ts +28 -21
- package/style/tokens.ts +20 -13
- package/style/transform.ts +5 -4
- package/style/types.ts +6 -4
- package/style/utils/expose.ts +4 -3
- package/style/value.ts +26 -11
- package/style/valueRef.ts +1 -1
- package/style/weight.ts +21 -0
- package/utils/global.ts +1 -3
- package/utils/symbol.ts +3 -0
- package/utils/trace.ts +1 -0
- package/dist/assert-BGdigdr5.js.map +0 -1
- package/dist/className-Cuh2JNxO.js +0 -263
- package/dist/className-Cuh2JNxO.js.map +0 -1
- package/dist/className-W2kDyeVl.js +0 -144
- package/dist/className-W2kDyeVl.js.map +0 -1
- package/dist/compiler-BXcGyZUP.mjs.map +0 -1
- package/dist/config-C1k9vUrM.js.map +0 -1
- package/dist/config-CLYMN3_p.js +0 -26
- package/dist/config-CLYMN3_p.js.map +0 -1
- package/dist/config-DcYrUB-M.js +0 -6
- package/dist/config-oI_yS50f.js +0 -1
- package/dist/css-CELBp6Gu.js +0 -58
- package/dist/css-CELBp6Gu.js.map +0 -1
- package/dist/css-CohHH2tn.js.map +0 -1
- package/dist/css-D_DL1yOz.js +0 -237
- package/dist/css-D_DL1yOz.js.map +0 -1
- package/dist/css-DfH4Gb1c.js +0 -805
- package/dist/css-DfH4Gb1c.js.map +0 -1
- package/dist/data-Ze8GNiJm.js +0 -483
- package/dist/data-Ze8GNiJm.js.map +0 -1
- package/dist/debug-BefbXMq1.js +0 -15
- package/dist/debug-BefbXMq1.js.map +0 -1
- package/dist/debug-DLmUG3Vh.js +0 -172
- package/dist/debug-DLmUG3Vh.js.map +0 -1
- package/dist/debug-OG2wSB5R.js +0 -15
- package/dist/debug-OG2wSB5R.js.map +0 -1
- package/dist/dev-4TqJORRn.js +0 -75
- package/dist/dev-4TqJORRn.js.map +0 -1
- package/dist/dev-C2u78xuv.js.map +0 -1
- package/dist/elementMarker-BKzZyg5V.js.map +0 -1
- package/dist/extract-B9j4TBkU.js +0 -2
- package/dist/extract-CzWJeQi8.js +0 -121
- package/dist/extract-CzWJeQi8.js.map +0 -1
- package/dist/getClassName-C6690_nr.js.map +0 -1
- package/dist/global-C7GsCW6Y.js +0 -14
- package/dist/global-C7GsCW6Y.js.map +0 -1
- package/dist/global-zaCE-g1C.js.map +0 -1
- package/dist/hash-Bycpk3MR.js +0 -160
- package/dist/hash-Bycpk3MR.js.map +0 -1
- package/dist/jsx-Berx-L-r.js +0 -39
- package/dist/jsx-Berx-L-r.js.map +0 -1
- package/dist/jsx-DsMajv_M.js +0 -38
- package/dist/jsx-DsMajv_M.js.map +0 -1
- package/dist/jsx_runtime-CMdEXGNZ.js +0 -13
- package/dist/jsx_runtime-DPWo5qvV.js.map +0 -1
- package/dist/layer-DiNeeTgG.js +0 -94
- package/dist/layer-DiNeeTgG.js.map +0 -1
- package/dist/loader-DCT1Q9yi.mjs.map +0 -1
- package/dist/misc-o8pviMUi.mjs.map +0 -1
- package/dist/namedTokens-BUa6raTb.js.map +0 -1
- package/dist/presets-BhXa232U.js +0 -108
- package/dist/presets-BhXa232U.js.map +0 -1
- package/dist/property-BzZSTVIh.js +0 -406
- package/dist/property-BzZSTVIh.js.map +0 -1
- package/dist/rules-Dz7Pu2K6.js.map +0 -1
- package/dist/runtime-B3jHW9B1.js +0 -32
- package/dist/runtime-B3jHW9B1.js.map +0 -1
- package/dist/shared-B_gJf5uj.cjs.map +0 -1
- package/dist/shared-uAzFeq0x.mjs.map +0 -1
- package/dist/sheet-DasbRnvy.js +0 -7
- package/dist/sheet-DasbRnvy.js.map +0 -1
- package/dist/style-B0F1sgRZ.js +0 -5
- package/dist/style-BkeAZl0n.js.map +0 -1
- package/dist/style-CYXTs1iu.js +0 -771
- package/dist/style-CYXTs1iu.js.map +0 -1
- package/dist/style-DUztHzBz.js.map +0 -1
- package/dist/styleStore-BGJ2ZYtK.js +0 -2009
- package/dist/styleStore-BGJ2ZYtK.js.map +0 -1
- package/dist/styleStore-DVDp-gI-.js +0 -55
- package/dist/styleStore-DVDp-gI-.js.map +0 -1
- package/dist/token-CA1j7suG.js +0 -273
- package/dist/token-CA1j7suG.js.map +0 -1
- package/dist/token-CKXUECuU.js +0 -76
- package/dist/token-CKXUECuU.js.map +0 -1
- package/dist/token-DTOyFLmp.js +0 -58
- package/dist/token-DTOyFLmp.js.map +0 -1
- package/dist/transform-BTJOg8Hg.js.map +0 -1
- package/dist/utils-BsbfH6cd.js.map +0 -1
- package/dist/utils-CpA-dSpY.mjs +0 -97
- package/dist/utils-CpA-dSpY.mjs.map +0 -1
- package/dist/utils-D4YWF2K0.js.map +0 -1
- package/dist/utils-R6QadAsY.js +0 -170
- package/dist/utils-R6QadAsY.js.map +0 -1
- package/dist/value-CJG6EWe8.js +0 -85
- package/dist/value-CJG6EWe8.js.map +0 -1
- package/dist/value-D-ZcRzLA.js +0 -42
- package/dist/value-D-ZcRzLA.js.map +0 -1
- package/dist/value-DBtSe-9B.js +0 -1000
- package/dist/value-DBtSe-9B.js.map +0 -1
- package/dist/valueRef-CsLVJwjA.js +0 -16
- package/dist/valueRef-CsLVJwjA.js.map +0 -1
- package/dist/webpack-Fb9xF5jS.mjs.map +0 -1
- package/dist/withTokens-LRidu3Vc.js +0 -95
- package/dist/withTokens-LRidu3Vc.js.map +0 -1
package/dist/entry/rsc-dev.js
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import { H as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as createElement } from "../jsx_runtime-
|
|
1
|
+
import { $ as TOKEN_VAR_NAME, A as addTokenOverride, B as createStyleToken, Bt as isDebugData, C as runtimeTokenValueResolver, D as createCombinedStyleFacade, E as getCacheTreeChild, F as mergeTokenValues, G as getStyleTokenId, H as getStyleTokenOverrideDebug, I as getCombinedStyleScopes, J as isStyleTokenData, K as getStyleTokenName, L as getCombinedStyleStyles, Lt as getDebugCallsiteId, M as createMutableTokenValues, N as finishTokenValues, O as createCombinedStyleTokenWrapper, P as mergeTokenOverrides, Q as TOKEN_OVERRIDE, Qt as configureStyleRuntime, R as isCombinedStyle, Sn as symbol, T as createCacheTreeNode, U as resetStyleTokenIdCounter, Ut as traceError, V as createStyleTokenOverride, W as getChildStyleTokenName, Wt as traceMarker, X as TOKEN_ID, Y as isStyleTokenOverrideData, Z as TOKEN_NAME, _n as RUNTIME_CONFIG, at as isScopeData, dn as CSS_CONFIG, et as getExtractedTokenBoundData, ft as isStyleData, g as createThemeClassName, gt as BUILDER_SELECTOR, hn as LayerPlaceholder, j as addTokenValues, k as getStyleTokenValues, lt as isSheetData, nt as getScopeTargetScope, ot as isScopeTargetData, pt as BUILDER_CALLSITE, q as getStyleTokenVarName, rt as getScopeTargetSlotId, sn as hashString, tn as DEV_CONFIG, tt as isExtractedTokenBoundData, ut as isSlotData, vt as BUILDER_SLOT_ID, yt as BUILDER_STATE, z as TOKEN_DEBUG, zt as getTraceCallsiteId } from "../styleStore-D4umgIwQ.js";
|
|
2
|
+
import "../sheet-CHnDkjn4.js";
|
|
3
|
+
import { t as getClassName } from "../getClassName-CfkGcBZy.js";
|
|
4
|
+
import { A as styleTransform, B as createStyleData, C as weightValue, D as classNameTransform, E as isAtRuleRef, F as createScopeTargetData, I as createSelectorData, L as createSelectorOverrideData, M as isStyleImportantValue, N as mergeScopeData, O as classNameValue, P as createScopeData, R as createSlotData, S as isStyleWeightValue, T as createAtRuleRef, V as createThemeData, _ as mergeSlotOverrideData, c as normalizeManualSelectors$1, d as FnPrefixSlot, f as FnPrefixStyle, g as mergeSlotData, h as mergeSelectorOverrideData, j as importantValue, k as isClassNameValue, l as FnPrefixScope, m as transformStyle, p as resolveCallsite, s as assertManualSelectorSyntax, u as FnPrefixSelector, v as mergeStyleData, w as AT_RULE_REF, x as normalizeSelectorArg, z as createSlotOverrideData } from "../globalSheet-2ozCV1Zm.js";
|
|
5
|
+
import { d as getToken, i as createKeyframes, l as createIdCounter, u as getId } from "../css-BmIytNon.js";
|
|
6
|
+
import { n as createElement } from "../jsx_runtime-BxumFGUy.js";
|
|
7
7
|
import { SelectorType, parse } from "css-what";
|
|
8
8
|
//#region runtime/style/scope.ts
|
|
9
9
|
function combineScope(...scopes) {
|
|
10
|
-
const shortcut = resolveSingleScopeTarget(scopes);
|
|
11
|
-
if (shortcut !== null) return (target) => shortcut(target);
|
|
12
10
|
return (target) => resolveScopeTargets(target, scopes);
|
|
13
11
|
}
|
|
14
12
|
function bindScope(target, ...scopes) {
|
|
15
|
-
const shortcut = resolveSingleScopeTarget(scopes);
|
|
16
|
-
if (shortcut !== null) return shortcut(target);
|
|
17
13
|
return resolveScopeTargets(target, scopes);
|
|
18
14
|
}
|
|
19
|
-
function resolveSingleScopeTarget(scopes) {
|
|
20
|
-
if (scopes.length !== 1) return null;
|
|
21
|
-
const scope = scopes[0];
|
|
22
|
-
if (!scope) return () => [];
|
|
23
|
-
if (Array.isArray(scope) || !isScopeData(scope)) return null;
|
|
24
|
-
return (target) => [scope(target)];
|
|
25
|
-
}
|
|
26
15
|
function resolveScopeTargets(target, scopes) {
|
|
27
16
|
const targets = [];
|
|
28
17
|
const stack = scopes.slice();
|
|
@@ -41,23 +30,13 @@ function resolveScopeTargets(target, scopes) {
|
|
|
41
30
|
//#region runtime/core/cache/pool.ts
|
|
42
31
|
const DEFAULT_TTL = 1e3 * 60 * 5;
|
|
43
32
|
const TOKEN_WRAPPER_CACHE_LIMIT = 32;
|
|
44
|
-
|
|
45
|
-
let configuredPoolTTL = -1;
|
|
46
|
-
function getCombinedStylePool() {
|
|
47
|
-
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
48
|
-
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
49
|
-
configuredPool = createCombinedStylePool(ttl);
|
|
50
|
-
configuredPoolTTL = ttl;
|
|
51
|
-
}
|
|
52
|
-
return configuredPool;
|
|
53
|
-
}
|
|
54
|
-
function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
33
|
+
function createCombinedStylePool(resolver, ttl = DEFAULT_TTL) {
|
|
55
34
|
const root = createPoolNode();
|
|
56
35
|
let timer = null;
|
|
57
36
|
return {
|
|
58
37
|
get(styles, inheritedScopes, items, prevTokensData = null) {
|
|
59
38
|
if (ttl === 0) {
|
|
60
|
-
const collected = collectItems(null, items, prevTokensData);
|
|
39
|
+
const collected = collectItems(null, items, prevTokensData, resolver);
|
|
61
40
|
return {
|
|
62
41
|
style: createCombinedStyleFacade(styles, concatScopes(inheritedScopes, collected.scopes)),
|
|
63
42
|
tokenCache: null,
|
|
@@ -67,7 +46,7 @@ function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
|
67
46
|
const now = Date.now();
|
|
68
47
|
let node = getPoolChild(root, styles);
|
|
69
48
|
node = walkScopes(node, inheritedScopes);
|
|
70
|
-
const collected = collectItems(node, items, prevTokensData);
|
|
49
|
+
const collected = collectItems(node, items, prevTokensData, resolver);
|
|
71
50
|
node = collected.node ?? node;
|
|
72
51
|
node.value.updatedAt = now;
|
|
73
52
|
if (node.value.style) {
|
|
@@ -124,17 +103,17 @@ function getTokenWrapperCache(node) {
|
|
|
124
103
|
function getTokenWrapperCacheKey(tokens) {
|
|
125
104
|
return tokens.ids.join("") + "" + tokens.values.join("");
|
|
126
105
|
}
|
|
127
|
-
function collectItems(node, items, prevTokensData) {
|
|
106
|
+
function collectItems(node, items, prevTokensData, resolver) {
|
|
128
107
|
const scopes = [];
|
|
129
108
|
const tokens = createMutableTokenValues(prevTokensData);
|
|
130
109
|
let currentNode = node;
|
|
131
110
|
for (let i = 0, len = items.length; i < len; i++) {
|
|
132
111
|
const item = items[i];
|
|
133
|
-
if (addTokenOverride
|
|
112
|
+
if (addTokenOverride(tokens, item, resolver)) continue;
|
|
134
113
|
if (isScopeTargetData(item)) {
|
|
135
114
|
scopes.push(item);
|
|
136
115
|
currentNode = currentNode ? walkScope(currentNode, item) : null;
|
|
137
|
-
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item)));
|
|
116
|
+
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item), resolver));
|
|
138
117
|
}
|
|
139
118
|
}
|
|
140
119
|
const tokensData = finishTokenValues(prevTokensData, tokens);
|
|
@@ -162,17 +141,16 @@ function walkScope(node, scope) {
|
|
|
162
141
|
node = getPoolChild(node, getScopeTargetSlotId(scope));
|
|
163
142
|
return node;
|
|
164
143
|
}
|
|
165
|
-
function getScopeTokenValues(node, scope) {
|
|
166
|
-
|
|
167
|
-
if (node && node.value.h && node.value.f === tokenNameFormat) return node.value.s;
|
|
144
|
+
function getScopeTokenValues(node, scope, resolver) {
|
|
145
|
+
if (node && node.value.h && node.value.f === resolver.key) return node.value.s;
|
|
168
146
|
const values = createMutableTokenValues(null);
|
|
169
147
|
const items = scope[BUILDER_STATE].items;
|
|
170
|
-
for (let i = 0, len = items.length; i < len; i++) addTokenOverride
|
|
148
|
+
for (let i = 0, len = items.length; i < len; i++) addTokenOverride(values, items[i], resolver);
|
|
171
149
|
const tokens = finishTokenValues(null, values);
|
|
172
150
|
if (node) {
|
|
173
151
|
node.value.h = true;
|
|
174
152
|
node.value.s = tokens;
|
|
175
|
-
node.value.f =
|
|
153
|
+
node.value.f = resolver.key;
|
|
176
154
|
}
|
|
177
155
|
return tokens;
|
|
178
156
|
}
|
|
@@ -213,54 +191,152 @@ function cleanupNode(node, now, ttl) {
|
|
|
213
191
|
}
|
|
214
192
|
//#endregion
|
|
215
193
|
//#region runtime/core/cache/combine.ts
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return
|
|
194
|
+
function createCombinedStyleGetter(resolver) {
|
|
195
|
+
let configuredPool = null;
|
|
196
|
+
let configuredPoolTTL = -1;
|
|
197
|
+
return function getConfiguredCombinedStyle(styles, args) {
|
|
198
|
+
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
199
|
+
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
200
|
+
configuredPool = createCombinedStylePool(resolver, ttl);
|
|
201
|
+
configuredPoolTTL = ttl;
|
|
202
|
+
}
|
|
203
|
+
const normalized = normalizeStyleItems(styles, args, resolver);
|
|
204
|
+
const result = configuredPool.get(styles, normalized.inheritedScopes, normalized.items, normalized.tokens);
|
|
205
|
+
return result.tokens ? getCachedTokenWrapper(result.tokenCache, result.tokens, () => createCombinedStyleTokenWrapper(result.style, result.tokens)) : result.style;
|
|
206
|
+
};
|
|
220
207
|
}
|
|
221
|
-
function normalizeStyleItems(styles, args) {
|
|
208
|
+
function normalizeStyleItems(styles, args, resolver) {
|
|
222
209
|
const result = {
|
|
223
210
|
inheritedScopes: [],
|
|
224
211
|
items: [],
|
|
225
212
|
tokens: null
|
|
226
213
|
};
|
|
227
|
-
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result);
|
|
214
|
+
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result, resolver);
|
|
228
215
|
return result;
|
|
229
216
|
}
|
|
230
|
-
function collectStyleArg(styles, arg, result) {
|
|
217
|
+
function collectStyleArg(styles, arg, result, resolver) {
|
|
231
218
|
if (!arg) return;
|
|
232
219
|
if (Array.isArray(arg)) {
|
|
233
|
-
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result);
|
|
220
|
+
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result, resolver);
|
|
234
221
|
return;
|
|
235
222
|
}
|
|
236
223
|
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(arg)) {
|
|
237
224
|
const bound = getExtractedTokenBoundData(arg);
|
|
238
|
-
|
|
239
|
-
|
|
225
|
+
collectStyleArg(styles, bound.data, result, resolver);
|
|
226
|
+
result.tokens = mergeTokenOverrides(result.tokens, bound.tokens, resolver);
|
|
240
227
|
return;
|
|
241
228
|
}
|
|
242
229
|
if (isCombinedStyle(arg)) {
|
|
243
|
-
if (getCombinedStyleStyles(arg) !== styles) throw new TypeError("[fluentic-style] combineStyle
|
|
230
|
+
if (getCombinedStyleStyles(arg) !== styles) throw new TypeError("[fluentic-style] combineStyle styles mismatch.");
|
|
244
231
|
const scopes = getCombinedStyleScopes(arg);
|
|
245
232
|
for (let i = 0, len = scopes.length; i < len; i++) result.inheritedScopes.push(scopes[i]);
|
|
246
233
|
result.tokens = mergeTokenValues(result.tokens, getStyleTokenValues(arg));
|
|
247
234
|
return;
|
|
248
235
|
}
|
|
236
|
+
if (isSheetData(arg)) {
|
|
237
|
+
collectTokenOverrides(arg, result, resolver);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (isScopeData(arg)) {
|
|
241
|
+
collectTokenOverrides(arg, result, resolver);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
249
244
|
result.items.push(arg);
|
|
250
245
|
}
|
|
246
|
+
function collectTokenOverrides(data, result, resolver) {
|
|
247
|
+
const items = data[BUILDER_STATE]?.items ?? [];
|
|
248
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
249
|
+
const item = items[i];
|
|
250
|
+
if (resolver.is(item)) result.tokens = mergeTokenOverrides(result.tokens, [item], resolver);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region runtime/core/cache/combineRuntime.ts
|
|
255
|
+
const getCombinedStyle = createCombinedStyleGetter(runtimeTokenValueResolver);
|
|
251
256
|
//#endregion
|
|
252
257
|
//#region runtime/style/style.ts
|
|
258
|
+
const singleStyleWrappers = /* @__PURE__ */ new WeakMap();
|
|
253
259
|
const combineStyleBase = (styles, ...args) => getCombinedStyle(styles, args);
|
|
260
|
+
const combineStyleResolve = ((styles, ...args) => {
|
|
261
|
+
if (Array.isArray(styles)) return combineStyleArray(styles, collectStyleWithArgs(args));
|
|
262
|
+
return isSingleStyleItem(styles) ? combineStyleSingle(styles, collectStyleWithArgs(args)) : combineStyleBase(styles, ...args);
|
|
263
|
+
});
|
|
254
264
|
const combineStyleFor = (styles) => {
|
|
255
265
|
return (...args) => combineStyleBase(styles, ...args);
|
|
256
266
|
};
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
267
|
+
const combineStyleWith = (...args) => {
|
|
268
|
+
const withArgs = collectStyleWithArgs(args);
|
|
269
|
+
return ((styles) => {
|
|
270
|
+
return isSingleStyleItem(styles) ? combineStyleSingle(styles, withArgs) : combineStyleBase(styles, ...withArgs.combineArgs);
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
const combineStyleMulti = (styles, ...args) => {
|
|
274
|
+
const withArgs = collectStyleWithArgs(args);
|
|
275
|
+
return styles.map((style) => combineStyleSingle(style, withArgs));
|
|
276
|
+
};
|
|
277
|
+
function combineStyleSingle(style, args) {
|
|
278
|
+
const result = combineStyleSingleItem(style, args.combineArgs);
|
|
279
|
+
if (!args.styles.length) return result;
|
|
280
|
+
const styles = [result];
|
|
281
|
+
for (let i = 0, len = args.styles.length; i < len; i++) styles.push(combineStyleSingleItem(args.styles[i], args.combineArgs));
|
|
282
|
+
return styles;
|
|
283
|
+
}
|
|
284
|
+
function combineStyleArray(styles, args) {
|
|
285
|
+
const result = [];
|
|
286
|
+
collectDirectStyles(styles, result, args);
|
|
287
|
+
for (let i = 0, len = args.styles.length; i < len; i++) result.push(combineStyleSingleItem(args.styles[i], args.combineArgs));
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
function collectDirectStyles(styles, result, args) {
|
|
291
|
+
for (let i = 0, len = styles.length; i < len; i++) {
|
|
292
|
+
const style = styles[i];
|
|
293
|
+
if (!style) continue;
|
|
294
|
+
if (Array.isArray(style)) {
|
|
295
|
+
collectDirectStyles(style, result, args);
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
if (isSingleStyleItem(style)) result.push(combineStyleSingleItem(style, args.combineArgs));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function combineStyleSingleItem(style, args) {
|
|
302
|
+
return combineStyleBase(getSingleStyleWrapper(style), ...args).value;
|
|
303
|
+
}
|
|
304
|
+
function getSingleStyleWrapper(style) {
|
|
305
|
+
let wrapper = singleStyleWrappers.get(style);
|
|
306
|
+
if (!wrapper) {
|
|
307
|
+
wrapper = { value: style };
|
|
308
|
+
singleStyleWrappers.set(style, wrapper);
|
|
309
|
+
}
|
|
310
|
+
return wrapper;
|
|
311
|
+
}
|
|
312
|
+
function isSingleStyleItem(value) {
|
|
313
|
+
return isStyleData(value) || isSheetData(value) || isSlotData(value);
|
|
314
|
+
}
|
|
315
|
+
function collectStyleWithArgs(args) {
|
|
316
|
+
const result = {
|
|
317
|
+
combineArgs: [],
|
|
318
|
+
styles: []
|
|
319
|
+
};
|
|
320
|
+
collectArgs(args, result);
|
|
321
|
+
return result;
|
|
322
|
+
}
|
|
323
|
+
function collectArgs(args, result) {
|
|
324
|
+
for (let i = 0, len = args.length; i < len; i++) {
|
|
325
|
+
const arg = args[i];
|
|
326
|
+
if (!arg) continue;
|
|
327
|
+
if (Array.isArray(arg)) {
|
|
328
|
+
collectArgs(arg, result);
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
result.combineArgs.push(arg);
|
|
332
|
+
if (isSingleStyleItem(arg)) result.styles.push(arg);
|
|
333
|
+
}
|
|
263
334
|
}
|
|
335
|
+
const combineStyle = Object.assign(combineStyleResolve, {
|
|
336
|
+
for: combineStyleFor,
|
|
337
|
+
with: combineStyleWith,
|
|
338
|
+
multi: combineStyleMulti
|
|
339
|
+
});
|
|
264
340
|
//#endregion
|
|
265
341
|
//#region selector/selector.ts
|
|
266
342
|
function selector(selector, ...args) {
|
|
@@ -405,509 +481,6 @@ function checkSelector(fnPrefix, fnName, fnSelector, arg) {
|
|
|
405
481
|
throw traceError(`${fnPrefix}${fnName}(${arg || ""}): ${message}`);
|
|
406
482
|
}
|
|
407
483
|
//#endregion
|
|
408
|
-
//#region builder/data/create.ts
|
|
409
|
-
function createStyleData(callsite) {
|
|
410
|
-
return {
|
|
411
|
-
[BUILDER_TYPE]: 1,
|
|
412
|
-
[BUILDER_STATE]: {
|
|
413
|
-
items: [],
|
|
414
|
-
lookup: {}
|
|
415
|
-
},
|
|
416
|
-
[BUILDER_CALLSITE]: callsite
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
function createSlotData(callsite, slotId) {
|
|
420
|
-
return {
|
|
421
|
-
[BUILDER_TYPE]: 2,
|
|
422
|
-
[BUILDER_STATE]: {
|
|
423
|
-
items: [],
|
|
424
|
-
lookup: {}
|
|
425
|
-
},
|
|
426
|
-
[BUILDER_CALLSITE]: callsite,
|
|
427
|
-
[BUILDER_SLOT_ID]: slotId
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
function createSlotOverrideData(callsite, slotId) {
|
|
431
|
-
return {
|
|
432
|
-
[BUILDER_TYPE]: 3,
|
|
433
|
-
[BUILDER_STATE]: {
|
|
434
|
-
items: [],
|
|
435
|
-
lookup: {}
|
|
436
|
-
},
|
|
437
|
-
[BUILDER_CALLSITE]: callsite,
|
|
438
|
-
[BUILDER_SLOT_ID]: slotId
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
function createScopeData(callsite) {
|
|
442
|
-
return {
|
|
443
|
-
[BUILDER_TYPE]: 4,
|
|
444
|
-
[BUILDER_STATE]: {
|
|
445
|
-
items: [],
|
|
446
|
-
lookup: {}
|
|
447
|
-
},
|
|
448
|
-
[BUILDER_CALLSITE]: callsite
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
function createScopeTargetData(scope, slot) {
|
|
452
|
-
return {
|
|
453
|
-
[BUILDER_TYPE]: 5,
|
|
454
|
-
[BUILDER_SCOPE]: scope,
|
|
455
|
-
[BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID]
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
function createThemeData(callsite, id, className, tokens) {
|
|
459
|
-
return {
|
|
460
|
-
[BUILDER_TYPE]: 6,
|
|
461
|
-
[BUILDER_STATE]: {
|
|
462
|
-
items: [],
|
|
463
|
-
lookup: {}
|
|
464
|
-
},
|
|
465
|
-
[BUILDER_CALLSITE]: callsite,
|
|
466
|
-
id,
|
|
467
|
-
className,
|
|
468
|
-
tokens
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
//#endregion
|
|
472
|
-
//#region builder/data/merge/utils.ts
|
|
473
|
-
function cloneData(data, source, debug, merge = true) {
|
|
474
|
-
const runtimeType = DEV_CONFIG.isDev ? debug ? -2 : -1 : -3;
|
|
475
|
-
const state = data[BUILDER_STATE];
|
|
476
|
-
state.items = merge ? source[BUILDER_STATE].items.slice() : [];
|
|
477
|
-
state.lookup = Object.assign(Object.create(null), merge ? source[BUILDER_STATE].lookup : null);
|
|
478
|
-
const lookup = state.lookup;
|
|
479
|
-
return [
|
|
480
|
-
runtimeType,
|
|
481
|
-
data,
|
|
482
|
-
state.items,
|
|
483
|
-
lookup
|
|
484
|
-
];
|
|
485
|
-
}
|
|
486
|
-
function logInvalidData(message, data) {
|
|
487
|
-
console.log(traceError(message), "data:", data);
|
|
488
|
-
}
|
|
489
|
-
//#endregion
|
|
490
|
-
//#region builder/data/merge/scope.ts
|
|
491
|
-
function mergeScopeData(scope, callsite, items, debug, parentSelector, scopeAtRule) {
|
|
492
|
-
if (!items) return scope;
|
|
493
|
-
const sourceItems = Array.isArray(items) ? items : [items];
|
|
494
|
-
const [runtimeType, data, styles, lookup] = cloneData(scope, scope, debug);
|
|
495
|
-
let source;
|
|
496
|
-
let item;
|
|
497
|
-
let lookupIndex;
|
|
498
|
-
let priority;
|
|
499
|
-
let value;
|
|
500
|
-
let atRule;
|
|
501
|
-
let dedupe;
|
|
502
|
-
let className;
|
|
503
|
-
let itemDebug;
|
|
504
|
-
let itemCallsite;
|
|
505
|
-
for (let i = 0, len = sourceItems.length; i < len; i++) {
|
|
506
|
-
source = sourceItems[i];
|
|
507
|
-
if (!source) continue;
|
|
508
|
-
if (isStyleTokenOverrideData(source)) {
|
|
509
|
-
addTokenOverride(source, styles, lookup);
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
if (isScopeData(source)) {
|
|
513
|
-
const scopeItems = source[BUILDER_STATE].items;
|
|
514
|
-
for (let j = 0, len = scopeItems.length; j < len; j++) {
|
|
515
|
-
item = scopeItems[j];
|
|
516
|
-
if (isStyleTokenOverrideData(item)) {
|
|
517
|
-
addTokenOverride(item, styles, lookup);
|
|
518
|
-
continue;
|
|
519
|
-
}
|
|
520
|
-
if (Array.isArray(item) || item.type !== 4) {
|
|
521
|
-
logInvalidData("invalid scope data", {
|
|
522
|
-
source,
|
|
523
|
-
item
|
|
524
|
-
});
|
|
525
|
-
continue;
|
|
526
|
-
}
|
|
527
|
-
const sourceScopeItem = item;
|
|
528
|
-
atRule = scopeAtRule ? sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule] : sourceScopeItem.atRule;
|
|
529
|
-
const scopeItem = {
|
|
530
|
-
...sourceScopeItem,
|
|
531
|
-
runtime: runtimeType,
|
|
532
|
-
atRule,
|
|
533
|
-
parentSelector: parentSelector ?? sourceScopeItem.parentSelector
|
|
534
|
-
};
|
|
535
|
-
itemDebug = getMergedScopeDebug(debug, scopeItem);
|
|
536
|
-
itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ?? callsite ?? scopeItem.callsite;
|
|
537
|
-
value = scopeItem.value;
|
|
538
|
-
priority = null;
|
|
539
|
-
if (Array.isArray(value)) {
|
|
540
|
-
priority = value[1];
|
|
541
|
-
value = value[0];
|
|
542
|
-
}
|
|
543
|
-
dedupe = getClassNameDedupe(scopeItem.property, priority, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule);
|
|
544
|
-
className = getAtomicClassName(scopeItem.property, priority, value, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule, itemCallsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null);
|
|
545
|
-
scopeItem.dedupe = dedupe;
|
|
546
|
-
scopeItem.className = className;
|
|
547
|
-
scopeItem.callsite = itemCallsite;
|
|
548
|
-
scopeItem.debug = itemDebug ?? null;
|
|
549
|
-
scopeItem.debugField = itemDebug ? scopeItem.property : null;
|
|
550
|
-
const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);
|
|
551
|
-
lookupIndex = lookup[lookupKey];
|
|
552
|
-
if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
|
|
553
|
-
else lookup[lookupKey] = styles.push(scopeItem) - 1;
|
|
554
|
-
}
|
|
555
|
-
continue;
|
|
556
|
-
}
|
|
557
|
-
if (!isSlotOverrideData(source)) {
|
|
558
|
-
logInvalidData("invalid scope data", { source });
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
const slotId = source[BUILDER_SLOT_ID];
|
|
562
|
-
const overrideItems = source[BUILDER_STATE].items;
|
|
563
|
-
for (let j = 0, len = overrideItems.length; j < len; j++) {
|
|
564
|
-
item = overrideItems[j];
|
|
565
|
-
if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 3) {
|
|
566
|
-
logInvalidData("invalid scope data", {
|
|
567
|
-
source,
|
|
568
|
-
item
|
|
569
|
-
});
|
|
570
|
-
continue;
|
|
571
|
-
}
|
|
572
|
-
const overrideItem = item;
|
|
573
|
-
atRule = scopeAtRule ? overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule] : overrideItem.atRule;
|
|
574
|
-
const scopeItem = {
|
|
575
|
-
type: 4,
|
|
576
|
-
slotId,
|
|
577
|
-
runtime: runtimeType,
|
|
578
|
-
dedupe: "",
|
|
579
|
-
className: "",
|
|
580
|
-
property: overrideItem.property,
|
|
581
|
-
value: overrideItem.value,
|
|
582
|
-
transformClassName: overrideItem.transformClassName,
|
|
583
|
-
token: overrideItem.token,
|
|
584
|
-
selector: overrideItem.selector,
|
|
585
|
-
atRule,
|
|
586
|
-
callsite: overrideItem.callsite ?? callsite,
|
|
587
|
-
debug: overrideItem.debug,
|
|
588
|
-
debugField: overrideItem.debugField,
|
|
589
|
-
parentSelector
|
|
590
|
-
};
|
|
591
|
-
value = scopeItem.value;
|
|
592
|
-
priority = null;
|
|
593
|
-
if (Array.isArray(value)) {
|
|
594
|
-
priority = value[1];
|
|
595
|
-
value = value[0];
|
|
596
|
-
}
|
|
597
|
-
dedupe = getClassNameDedupe(scopeItem.property, priority, scopeItem.selector, parentSelector, scopeItem.atRule);
|
|
598
|
-
className = getAtomicClassName(scopeItem.property, priority, value, scopeItem.selector, parentSelector, scopeItem.atRule, scopeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null);
|
|
599
|
-
scopeItem.dedupe = dedupe;
|
|
600
|
-
scopeItem.className = className;
|
|
601
|
-
const lookupKey = getScopeLookupKey(slotId, dedupe);
|
|
602
|
-
lookupIndex = lookup[lookupKey];
|
|
603
|
-
if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
|
|
604
|
-
else lookup[lookupKey] = styles.push(scopeItem) - 1;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
return data;
|
|
608
|
-
}
|
|
609
|
-
function addTokenOverride(item, styles, lookup) {
|
|
610
|
-
const lookupKey = getTokenLookupKey(getStyleTokenId(item));
|
|
611
|
-
const lookupIndex = lookup[lookupKey];
|
|
612
|
-
if (typeof lookupIndex === "number") styles[lookupIndex] = item;
|
|
613
|
-
else lookup[lookupKey] = styles.push(item) - 1;
|
|
614
|
-
}
|
|
615
|
-
function getMergedScopeDebug(debug, item) {
|
|
616
|
-
if (!debug) return item.debug;
|
|
617
|
-
if (debug.fields?.[item.property]) return debug;
|
|
618
|
-
const valueLoc = getRuntimeScopeItemValueLoc(item);
|
|
619
|
-
if (!valueLoc) return debug;
|
|
620
|
-
return {
|
|
621
|
-
...debug,
|
|
622
|
-
fields: {
|
|
623
|
-
...debug.fields,
|
|
624
|
-
[item.property]: {
|
|
625
|
-
[0]: debug.loc,
|
|
626
|
-
[1]: valueLoc
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
}
|
|
631
|
-
function getRuntimeScopeItemValueLoc(item) {
|
|
632
|
-
if (item.debug && item.debugField) {
|
|
633
|
-
const loc = item.debug.fields?.[item.debugField];
|
|
634
|
-
if (Array.isArray(loc)) return withDebugSource$1(loc, item.debug.sourceUrl, item.debug.code);
|
|
635
|
-
if (loc) {
|
|
636
|
-
const valueLoc = loc[1] ?? loc[0] ?? null;
|
|
637
|
-
return valueLoc ? withDebugSource$1(valueLoc, item.debug.sourceUrl, item.debug.code) : null;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
return item.callsite ? [
|
|
641
|
-
item.callsite.line,
|
|
642
|
-
item.callsite.column,
|
|
643
|
-
void 0,
|
|
644
|
-
item.callsite.sourceUrl,
|
|
645
|
-
item.callsite.sourceContent
|
|
646
|
-
] : null;
|
|
647
|
-
}
|
|
648
|
-
function withDebugSource$1(loc, sourceUrl, sourceContent) {
|
|
649
|
-
return loc[3] ? loc : [
|
|
650
|
-
loc[0],
|
|
651
|
-
loc[1],
|
|
652
|
-
loc[2],
|
|
653
|
-
sourceUrl,
|
|
654
|
-
sourceContent
|
|
655
|
-
];
|
|
656
|
-
}
|
|
657
|
-
function getScopeLookupKey(slotId, dedupe) {
|
|
658
|
-
return slotId + "\0" + dedupe;
|
|
659
|
-
}
|
|
660
|
-
function getTokenLookupKey(tokenId) {
|
|
661
|
-
return "token\0" + tokenId;
|
|
662
|
-
}
|
|
663
|
-
//#endregion
|
|
664
|
-
//#region style/transform.ts
|
|
665
|
-
const CLASS_NAME_VALUE = symbol("transform.classNameValue");
|
|
666
|
-
function classNameValue(value, className) {
|
|
667
|
-
return {
|
|
668
|
-
[CLASS_NAME_VALUE]: true,
|
|
669
|
-
value,
|
|
670
|
-
className
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
function isClassNameValue(value) {
|
|
674
|
-
return !!value && typeof value === "object" && value[CLASS_NAME_VALUE] === true && typeof value.className === "string";
|
|
675
|
-
}
|
|
676
|
-
function styleTransform(options) {
|
|
677
|
-
return options;
|
|
678
|
-
}
|
|
679
|
-
function classNameTransform(options) {
|
|
680
|
-
return options;
|
|
681
|
-
}
|
|
682
|
-
//#endregion
|
|
683
|
-
//#region builder/data/merge/style.ts
|
|
684
|
-
function mergeBuilderData(create, callsite, source, style, debug, selector, atRule, type) {
|
|
685
|
-
if (!style) return source;
|
|
686
|
-
const [runtimeType, data, styles, lookup] = cloneData(create(callsite, source), source, debug);
|
|
687
|
-
const slotId = isSlotData(source) || isSlotOverrideData(source) ? source[BUILDER_SLOT_ID] : null;
|
|
688
|
-
const items = [];
|
|
689
|
-
let item;
|
|
690
|
-
let itemData;
|
|
691
|
-
let valueRaw;
|
|
692
|
-
let value;
|
|
693
|
-
let priority;
|
|
694
|
-
let itemCallsite;
|
|
695
|
-
let className;
|
|
696
|
-
let dedupe;
|
|
697
|
-
let token;
|
|
698
|
-
let ref;
|
|
699
|
-
let variableName;
|
|
700
|
-
let transformClassName;
|
|
701
|
-
let lookupIndex;
|
|
702
|
-
if (isStyleData(style)) {
|
|
703
|
-
const stylesItems = style[BUILDER_STATE].items;
|
|
704
|
-
for (let i = 0, len = stylesItems.length; i < len; i++) {
|
|
705
|
-
item = stylesItems[i];
|
|
706
|
-
if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 1) {
|
|
707
|
-
logInvalidData("invalid style data", {
|
|
708
|
-
item,
|
|
709
|
-
style
|
|
710
|
-
});
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
713
|
-
if (atRule) item = Object.assign({}, item, { atRule: item.atRule ? atRule.concat(item.atRule) : atRule });
|
|
714
|
-
if (type === 2 && slotId !== null) item = Object.assign({}, item, {
|
|
715
|
-
type: 2,
|
|
716
|
-
slotId
|
|
717
|
-
});
|
|
718
|
-
else if (type === 3 && slotId !== null) item = Object.assign({}, item, {
|
|
719
|
-
type: 3,
|
|
720
|
-
slotId
|
|
721
|
-
});
|
|
722
|
-
const itemDebug = getMergedStyleDebug(debug, item);
|
|
723
|
-
const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);
|
|
724
|
-
if (debugCallsite) item = Object.assign({}, item, {
|
|
725
|
-
callsite: debugCallsite,
|
|
726
|
-
debug: itemDebug,
|
|
727
|
-
debugField: item.property
|
|
728
|
-
});
|
|
729
|
-
items.push(item);
|
|
730
|
-
}
|
|
731
|
-
} else for (const property in style) {
|
|
732
|
-
valueRaw = style[property];
|
|
733
|
-
priority = null;
|
|
734
|
-
if (Array.isArray(valueRaw) && valueRaw.length === 2 && typeof valueRaw[0] === "number") {
|
|
735
|
-
priority = valueRaw[0];
|
|
736
|
-
valueRaw = valueRaw[1];
|
|
737
|
-
}
|
|
738
|
-
transformClassName = null;
|
|
739
|
-
if (isClassNameValue(valueRaw)) {
|
|
740
|
-
transformClassName = valueRaw.className;
|
|
741
|
-
valueRaw = valueRaw.value;
|
|
742
|
-
}
|
|
743
|
-
ref = isAtRuleRef(valueRaw) ? valueRaw : null;
|
|
744
|
-
if (ref) valueRaw = ref.value;
|
|
745
|
-
token = isStyleTokenData(valueRaw) ? valueRaw : null;
|
|
746
|
-
variableName = getDebugFieldVarName(debug, property);
|
|
747
|
-
value = variableName && token ? getCssVarRawFallback(variableName, getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null)) : token ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null) : String(valueRaw ?? "");
|
|
748
|
-
value = priority !== null ? [value, priority] : value;
|
|
749
|
-
itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;
|
|
750
|
-
itemData = {
|
|
751
|
-
runtime: runtimeType,
|
|
752
|
-
debug,
|
|
753
|
-
debugField: property,
|
|
754
|
-
dedupe: "",
|
|
755
|
-
className: "",
|
|
756
|
-
property,
|
|
757
|
-
value,
|
|
758
|
-
transformClassName,
|
|
759
|
-
variable: ref ? [3, ref] : variableName && token ? [
|
|
760
|
-
1,
|
|
761
|
-
variableName,
|
|
762
|
-
valueRaw,
|
|
763
|
-
shouldAppendCssPx(property) ? 1 : void 0
|
|
764
|
-
] : ref ? [3, ref] : void 0,
|
|
765
|
-
token,
|
|
766
|
-
selector,
|
|
767
|
-
atRule,
|
|
768
|
-
callsite: itemCallsite
|
|
769
|
-
};
|
|
770
|
-
if (type === 1) {
|
|
771
|
-
items.push({
|
|
772
|
-
...itemData,
|
|
773
|
-
type: 1
|
|
774
|
-
});
|
|
775
|
-
continue;
|
|
776
|
-
}
|
|
777
|
-
if (slotId === null) {
|
|
778
|
-
logInvalidData("invalid style data", {
|
|
779
|
-
property,
|
|
780
|
-
style
|
|
781
|
-
});
|
|
782
|
-
continue;
|
|
783
|
-
}
|
|
784
|
-
if (type === 2) {
|
|
785
|
-
items.push({
|
|
786
|
-
...itemData,
|
|
787
|
-
type: 2,
|
|
788
|
-
slotId
|
|
789
|
-
});
|
|
790
|
-
continue;
|
|
791
|
-
}
|
|
792
|
-
if (type === 3) {
|
|
793
|
-
items.push({
|
|
794
|
-
...itemData,
|
|
795
|
-
type: 3,
|
|
796
|
-
slotId
|
|
797
|
-
});
|
|
798
|
-
continue;
|
|
799
|
-
}
|
|
800
|
-
logInvalidData("invalid style data", {
|
|
801
|
-
property,
|
|
802
|
-
style
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
if (!items.length) return data;
|
|
806
|
-
for (let i = 0, len = items.length; i < len; i++) {
|
|
807
|
-
item = items[i];
|
|
808
|
-
if (Array.isArray(item) || isStyleTokenOverrideData(item)) {
|
|
809
|
-
logInvalidData("invalid style data", {
|
|
810
|
-
item,
|
|
811
|
-
style
|
|
812
|
-
});
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
const runtimeItem = item;
|
|
816
|
-
value = runtimeItem.value;
|
|
817
|
-
priority = null;
|
|
818
|
-
if (Array.isArray(value)) {
|
|
819
|
-
priority = value[1];
|
|
820
|
-
value = value[0];
|
|
821
|
-
}
|
|
822
|
-
dedupe = getClassNameDedupe(runtimeItem.property, priority, runtimeItem.selector, null, runtimeItem.atRule);
|
|
823
|
-
className = getAtomicClassName(runtimeItem.property, priority, value, runtimeItem.selector, null, runtimeItem.atRule, runtimeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, runtimeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null);
|
|
824
|
-
runtimeItem.dedupe = dedupe;
|
|
825
|
-
runtimeItem.className = className;
|
|
826
|
-
lookupIndex = lookup[dedupe];
|
|
827
|
-
if (typeof lookupIndex === "number") styles[lookupIndex] = runtimeItem;
|
|
828
|
-
else lookup[dedupe] = styles.push(runtimeItem) - 1;
|
|
829
|
-
}
|
|
830
|
-
return data;
|
|
831
|
-
}
|
|
832
|
-
function getMergedStyleDebug(debug, item) {
|
|
833
|
-
if (!debug) return null;
|
|
834
|
-
if (debug.fields?.[item.property]) return debug;
|
|
835
|
-
const valueLoc = getMergedItemValueLoc(item);
|
|
836
|
-
if (!valueLoc) return debug;
|
|
837
|
-
return {
|
|
838
|
-
...debug,
|
|
839
|
-
fields: {
|
|
840
|
-
...debug.fields,
|
|
841
|
-
[item.property]: {
|
|
842
|
-
[0]: withDebugSource(debug.loc, debug),
|
|
843
|
-
[1]: valueLoc
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
function getMergedItemValueLoc(item) {
|
|
849
|
-
if (item.debug && item.debugField) {
|
|
850
|
-
const loc = item.debug.fields?.[item.debugField];
|
|
851
|
-
if (Array.isArray(loc)) return withDebugSource(loc, item.debug);
|
|
852
|
-
if (loc) {
|
|
853
|
-
const traceLoc = loc[1] ?? loc[0] ?? null;
|
|
854
|
-
return traceLoc ? withDebugSource(traceLoc, item.debug) : null;
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
return item.callsite ? [
|
|
858
|
-
item.callsite.line,
|
|
859
|
-
item.callsite.column,
|
|
860
|
-
void 0,
|
|
861
|
-
item.callsite.sourceUrl,
|
|
862
|
-
item.callsite.sourceContent
|
|
863
|
-
] : null;
|
|
864
|
-
}
|
|
865
|
-
function withDebugSource(loc, debug) {
|
|
866
|
-
return loc[3] ? loc : [
|
|
867
|
-
loc[0],
|
|
868
|
-
loc[1],
|
|
869
|
-
loc[2],
|
|
870
|
-
debug.sourceUrl,
|
|
871
|
-
debug.code
|
|
872
|
-
];
|
|
873
|
-
}
|
|
874
|
-
function normalizeSelectorArg(arg) {
|
|
875
|
-
return arg.includes("\n") ? arg.replace(/\n/g, "") : arg;
|
|
876
|
-
}
|
|
877
|
-
//#endregion
|
|
878
|
-
//#region builder/style_data.ts
|
|
879
|
-
const mergeStyleCreate = (callsite) => {
|
|
880
|
-
return createStyleData(callsite);
|
|
881
|
-
};
|
|
882
|
-
const mergeStyleData = createMerge(mergeStyleCreate, 1);
|
|
883
|
-
const mergeSlotCreate = (callsite, data) => {
|
|
884
|
-
return createSlotData(callsite, data[BUILDER_SLOT_ID]);
|
|
885
|
-
};
|
|
886
|
-
const mergeSlotData = createMerge(mergeSlotCreate, 2);
|
|
887
|
-
const mergeSlotOverrideCreate = (callsite, data) => {
|
|
888
|
-
return createSlotOverrideData(callsite, data[BUILDER_SLOT_ID]);
|
|
889
|
-
};
|
|
890
|
-
const mergeSlotOverrideData = createMerge(mergeSlotOverrideCreate, 3);
|
|
891
|
-
function createMerge(create, type) {
|
|
892
|
-
return (data, callsite, style, debug, selector, atRule) => {
|
|
893
|
-
return mergeBuilderData(create, callsite, data, style, debug, selector, atRule, type);
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
|
-
//#endregion
|
|
897
|
-
//#region builder/utils.ts
|
|
898
|
-
const FnPrefixStyle = "style.";
|
|
899
|
-
const FnPrefixSlot = "slot.";
|
|
900
|
-
const FnPrefixScope = "scope.";
|
|
901
|
-
function runtimeCallsite() {
|
|
902
|
-
return traceCallsite();
|
|
903
|
-
}
|
|
904
|
-
function resolveCallsite(debug) {
|
|
905
|
-
return debug ? getDebugCallsite(debug) : runtimeCallsite();
|
|
906
|
-
}
|
|
907
|
-
function transformStyle(style, transform) {
|
|
908
|
-
return transform ? transform.transform(style) : style;
|
|
909
|
-
}
|
|
910
|
-
//#endregion
|
|
911
484
|
//#region builder/style_fns.ts
|
|
912
485
|
const createDefaultFnResult = (data, fns) => {
|
|
913
486
|
return Object.assign(Object.create(fns), data);
|
|
@@ -958,9 +531,9 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
958
531
|
let arg;
|
|
959
532
|
let style;
|
|
960
533
|
let debug;
|
|
961
|
-
let
|
|
534
|
+
let weight = null;
|
|
962
535
|
if (hasArg) if (isMedia && typeof params[0] === "number") {
|
|
963
|
-
|
|
536
|
+
weight = params[0];
|
|
964
537
|
arg = params[1];
|
|
965
538
|
style = params[2];
|
|
966
539
|
debug = params[3];
|
|
@@ -970,7 +543,7 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
970
543
|
debug = params[2];
|
|
971
544
|
}
|
|
972
545
|
else if (isMedia && typeof params[0] === "number") {
|
|
973
|
-
|
|
546
|
+
weight = params[0];
|
|
974
547
|
arg = fnSelector.selector;
|
|
975
548
|
style = params[1];
|
|
976
549
|
debug = params[2];
|
|
@@ -990,7 +563,7 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
990
563
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
991
564
|
for (let j = 0, len = items.length; j < len; j++) {
|
|
992
565
|
const item = items[j];
|
|
993
|
-
data = mergeData(data, callsite, isStyleData(item) ? item : transformStyle(item, transform), debug ?? null, null, [
|
|
566
|
+
data = mergeData(data, callsite, isStyleData(item) ? item : transformStyle(item, transform), debug ?? null, null, [weight !== null ? [selector, weight] : selector]);
|
|
994
567
|
}
|
|
995
568
|
}
|
|
996
569
|
return createFnResult(data, fns);
|
|
@@ -1057,9 +630,9 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
1057
630
|
let arg;
|
|
1058
631
|
let data;
|
|
1059
632
|
let debug;
|
|
1060
|
-
let
|
|
633
|
+
let weight = null;
|
|
1061
634
|
if (hasArg) if (isMedia && typeof params[0] === "number") {
|
|
1062
|
-
|
|
635
|
+
weight = params[0];
|
|
1063
636
|
arg = params[1];
|
|
1064
637
|
data = params[2];
|
|
1065
638
|
debug = params[3];
|
|
@@ -1069,7 +642,7 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
1069
642
|
debug = params[2];
|
|
1070
643
|
}
|
|
1071
644
|
else if (isMedia && typeof params[0] === "number") {
|
|
1072
|
-
|
|
645
|
+
weight = params[0];
|
|
1073
646
|
arg = fnSelector.selector;
|
|
1074
647
|
data = params[1];
|
|
1075
648
|
debug = params[2];
|
|
@@ -1086,7 +659,7 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
1086
659
|
selector = args[i];
|
|
1087
660
|
if (hasArg && DEV_CONFIG.isCheckSelectorEnabled) checkSelector(fnPrefix, fnName, fnSelector, selector);
|
|
1088
661
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
1089
|
-
result = mergeScopeItems(result, callsite, data, debug ?? null, null,
|
|
662
|
+
result = mergeScopeItems(result, callsite, data, debug ?? null, null, weight !== null ? [selector, weight] : selector, cloneScope);
|
|
1090
663
|
}
|
|
1091
664
|
return result;
|
|
1092
665
|
};
|
|
@@ -1174,9 +747,9 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
1174
747
|
const [withoutDebug, debug] = splitDebug(params);
|
|
1175
748
|
let arg;
|
|
1176
749
|
let items;
|
|
1177
|
-
let
|
|
750
|
+
let weight = null;
|
|
1178
751
|
if (hasArg) if (isMedia && typeof withoutDebug[0] === "number") {
|
|
1179
|
-
|
|
752
|
+
weight = withoutDebug[0];
|
|
1180
753
|
arg = withoutDebug[1];
|
|
1181
754
|
items = withoutDebug.slice(2);
|
|
1182
755
|
} else {
|
|
@@ -1184,7 +757,7 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
1184
757
|
items = withoutDebug.slice(1);
|
|
1185
758
|
}
|
|
1186
759
|
else if (isMedia && typeof withoutDebug[0] === "number") {
|
|
1187
|
-
|
|
760
|
+
weight = withoutDebug[0];
|
|
1188
761
|
arg = fnSelector.selector;
|
|
1189
762
|
items = withoutDebug.slice(1);
|
|
1190
763
|
} else {
|
|
@@ -1199,7 +772,7 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
1199
772
|
let selector = argItem;
|
|
1200
773
|
if (hasArg && DEV_CONFIG.isCheckSelectorEnabled) checkSelector(fnPrefix, fnName, fnSelector, selector);
|
|
1201
774
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
1202
|
-
data = mergeStyleData(data, callsite, classNameStyle.style, classNameStyle.debug, null, [
|
|
775
|
+
data = mergeStyleData(data, callsite, classNameStyle.style, classNameStyle.debug, null, [weight !== null ? [selector, weight] : selector]);
|
|
1203
776
|
}
|
|
1204
777
|
return createDefaultFnResult(data, fns);
|
|
1205
778
|
};
|
|
@@ -1249,7 +822,8 @@ function classNameItemsToStyle(items, transform, debug) {
|
|
|
1249
822
|
for (const item of flattenClassNameItems(items)) {
|
|
1250
823
|
const transformed = decorateClassNameStyle(transform.transform(item.className), item.className);
|
|
1251
824
|
const weighted = item.weight === null ? transformed : applyClassNameWeight(transformed, item.weight);
|
|
1252
|
-
|
|
825
|
+
const nextStyle = item.important ? applyClassNameImportant(weighted) : weighted;
|
|
826
|
+
style = style ? Object.assign({}, style, nextStyle) : nextStyle;
|
|
1253
827
|
const loc = debug?.classNames?.[item.className];
|
|
1254
828
|
if (loc) {
|
|
1255
829
|
const nextDebugFields = debugFields ? Object.assign({}, debugFields) : Object.assign({}, debug?.fields ?? {});
|
|
@@ -1272,15 +846,16 @@ function decorateClassNameStyle(style, className) {
|
|
|
1272
846
|
result[property] = value;
|
|
1273
847
|
continue;
|
|
1274
848
|
}
|
|
1275
|
-
|
|
1276
|
-
const rawValue = value[1];
|
|
1277
|
-
result[property] = isClassNameValue(rawValue) ? value : [value[0], classNameValue(rawValue, className)];
|
|
1278
|
-
continue;
|
|
1279
|
-
}
|
|
1280
|
-
result[property] = isClassNameValue(value) ? value : classNameValue(value, className);
|
|
849
|
+
result[property] = decorateClassNameValue(value, className);
|
|
1281
850
|
}
|
|
1282
851
|
return result;
|
|
1283
852
|
}
|
|
853
|
+
function decorateClassNameValue(value, className) {
|
|
854
|
+
if (isClassNameValue(value)) return value;
|
|
855
|
+
if (isStyleImportantValue(value)) return importantValue(decorateClassNameValue(value.value, className), value.native);
|
|
856
|
+
if (isStyleWeightValue(value)) return weightValue(decorateClassNameValue(value.value, className), value.weight);
|
|
857
|
+
return classNameValue(value, className);
|
|
858
|
+
}
|
|
1284
859
|
function flattenClassNameItems(items) {
|
|
1285
860
|
const result = [];
|
|
1286
861
|
for (const item of items) collectClassNameItem(item, result);
|
|
@@ -1291,6 +866,7 @@ function collectClassNameItem(item, result) {
|
|
|
1291
866
|
if (typeof item === "string") {
|
|
1292
867
|
result.push({
|
|
1293
868
|
className: item,
|
|
869
|
+
important: false,
|
|
1294
870
|
weight: null
|
|
1295
871
|
});
|
|
1296
872
|
return;
|
|
@@ -1299,13 +875,29 @@ function collectClassNameItem(item, result) {
|
|
|
1299
875
|
for (const child of item) collectClassNameItem(child, result);
|
|
1300
876
|
return;
|
|
1301
877
|
}
|
|
1302
|
-
if (isWeightedClassName(item))
|
|
878
|
+
if (isWeightedClassName(item)) {
|
|
879
|
+
result.push({
|
|
880
|
+
...item,
|
|
881
|
+
important: false
|
|
882
|
+
});
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
if (isImportantClassName(item)) result.push({
|
|
886
|
+
className: item.className,
|
|
887
|
+
important: true,
|
|
888
|
+
weight: null
|
|
889
|
+
});
|
|
1303
890
|
}
|
|
1304
891
|
function isWeightedClassName(item) {
|
|
1305
892
|
if (!item || typeof item !== "object") return false;
|
|
1306
893
|
const weighted = item;
|
|
1307
894
|
return typeof weighted.className === "string" && typeof weighted.weight === "number";
|
|
1308
895
|
}
|
|
896
|
+
function isImportantClassName(item) {
|
|
897
|
+
if (!item || typeof item !== "object") return false;
|
|
898
|
+
const important = item;
|
|
899
|
+
return typeof important.className === "string" && important.important === true;
|
|
900
|
+
}
|
|
1309
901
|
function applyClassNameWeight(style, weight) {
|
|
1310
902
|
const weighted = {};
|
|
1311
903
|
for (const [property, value] of Object.entries(style)) {
|
|
@@ -1313,10 +905,21 @@ function applyClassNameWeight(style, weight) {
|
|
|
1313
905
|
weighted[property] = value;
|
|
1314
906
|
continue;
|
|
1315
907
|
}
|
|
1316
|
-
weighted[property] =
|
|
908
|
+
weighted[property] = weightValue(value, weight);
|
|
1317
909
|
}
|
|
1318
910
|
return weighted;
|
|
1319
911
|
}
|
|
912
|
+
function applyClassNameImportant(style) {
|
|
913
|
+
const important = {};
|
|
914
|
+
for (const [property, value] of Object.entries(style)) {
|
|
915
|
+
if (value === null || value === void 0) {
|
|
916
|
+
important[property] = value;
|
|
917
|
+
continue;
|
|
918
|
+
}
|
|
919
|
+
important[property] = importantValue(value);
|
|
920
|
+
}
|
|
921
|
+
return important;
|
|
922
|
+
}
|
|
1320
923
|
function splitDebug(params) {
|
|
1321
924
|
const last = params[params.length - 1];
|
|
1322
925
|
if (!isDebugData(last)) return [params.slice(), void 0];
|
|
@@ -1421,6 +1024,22 @@ selectorPriority({
|
|
|
1421
1024
|
...AtRuleSelectors
|
|
1422
1025
|
}, PrioritySelectors);
|
|
1423
1026
|
//#endregion
|
|
1027
|
+
//#region builder/selector_override.ts
|
|
1028
|
+
function normalizeManualSelectors(input) {
|
|
1029
|
+
return normalizeManualSelectors$1(input, assertManualSelector);
|
|
1030
|
+
}
|
|
1031
|
+
function assertManualSelector(selector) {
|
|
1032
|
+
assertManualSelectorSyntax(selector);
|
|
1033
|
+
const ampersandIndex = selector.indexOf("&");
|
|
1034
|
+
const ampersandSelector = selector.startsWith("&?") ? selector.slice(2) : selector.slice(1);
|
|
1035
|
+
const parsedSelector = ampersandIndex === 0 ? "*" + ampersandSelector : selector;
|
|
1036
|
+
try {
|
|
1037
|
+
parse(parsedSelector);
|
|
1038
|
+
} catch {
|
|
1039
|
+
throw new Error("selector is invalid: " + selector);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
//#endregion
|
|
1424
1043
|
//#region builder/style_builder.ts
|
|
1425
1044
|
function createStyleBuilder(selectors, transform) {
|
|
1426
1045
|
const fns = createStyleFns(mergeStyleData, selectors, FnPrefixStyle, transform, null);
|
|
@@ -1454,6 +1073,20 @@ function createSlotBuilder(selectors, transform) {
|
|
|
1454
1073
|
traceMarker(fn, "slot");
|
|
1455
1074
|
return fn;
|
|
1456
1075
|
}
|
|
1076
|
+
function createSelectorBuilder(selectors, transform) {
|
|
1077
|
+
const fns = createStyleFns(mergeSelectorOverrideData, selectors, FnPrefixSelector, transform, null);
|
|
1078
|
+
const fn = (selector, style, debug) => {
|
|
1079
|
+
if (isDebugData(style) && debug === void 0) {
|
|
1080
|
+
debug = style;
|
|
1081
|
+
style = void 0;
|
|
1082
|
+
}
|
|
1083
|
+
const target = createCallableSelector(createSelectorData(resolveCallsite(debug), normalizeManualSelectors(selector)), fns, transform);
|
|
1084
|
+
if (style === void 0) return target;
|
|
1085
|
+
return target(style, debug);
|
|
1086
|
+
};
|
|
1087
|
+
traceMarker(fn, "style.selector");
|
|
1088
|
+
return fn;
|
|
1089
|
+
}
|
|
1457
1090
|
function createScopeBuilder(selectors) {
|
|
1458
1091
|
const fns = createScopeFns(selectors, FnPrefixScope, cloneScope);
|
|
1459
1092
|
const fn = (items, debug) => {
|
|
@@ -1469,6 +1102,34 @@ function createScopeBuilder(selectors) {
|
|
|
1469
1102
|
traceMarker(fn, "scope");
|
|
1470
1103
|
return fn;
|
|
1471
1104
|
}
|
|
1105
|
+
function createCallableSelectorOverride(data, fns, transform) {
|
|
1106
|
+
const callable = ((style, debug) => {
|
|
1107
|
+
if (isDebugData(style) && debug === void 0) {
|
|
1108
|
+
debug = style;
|
|
1109
|
+
style = void 0;
|
|
1110
|
+
}
|
|
1111
|
+
const callsite = resolveCallsite(debug);
|
|
1112
|
+
return createCallableSelectorOverride(mergeSelectorOverrideData(createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]), callsite, style ? isStyleData(style) ? style : transformStyle(style, transform) : null, debug ?? null, null, null), fns, transform);
|
|
1113
|
+
});
|
|
1114
|
+
traceMarker(callable, "selector.override");
|
|
1115
|
+
Object.setPrototypeOf(callable, fns);
|
|
1116
|
+
Object.assign(callable, data);
|
|
1117
|
+
return callable;
|
|
1118
|
+
}
|
|
1119
|
+
function createCallableSelector(data, overrideFns, transform) {
|
|
1120
|
+
const callable = ((style, debug) => {
|
|
1121
|
+
if (isDebugData(style) && debug === void 0) {
|
|
1122
|
+
debug = style;
|
|
1123
|
+
style = void 0;
|
|
1124
|
+
}
|
|
1125
|
+
const callsite = resolveCallsite(debug);
|
|
1126
|
+
return createCallableSelectorOverride(mergeSelectorOverrideData(createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]), callsite, style ? isStyleData(style) ? style : transformStyle(style, transform) : null, debug ?? null, null, null), overrideFns, transform);
|
|
1127
|
+
});
|
|
1128
|
+
traceMarker(callable, "selector");
|
|
1129
|
+
Object.setPrototypeOf(callable, overrideFns);
|
|
1130
|
+
Object.assign(callable, data);
|
|
1131
|
+
return callable;
|
|
1132
|
+
}
|
|
1472
1133
|
function createCallableSlot(data, fns, overrideFns, transform) {
|
|
1473
1134
|
const slotId = data[BUILDER_SLOT_ID];
|
|
1474
1135
|
const callable = ((style, debug) => {
|
|
@@ -1531,9 +1192,11 @@ function createStyleFn(args) {
|
|
|
1531
1192
|
const fnStyle = createStyleBuilder(selectors, transform);
|
|
1532
1193
|
const fnSlot = createSlotBuilder(selectors, transform);
|
|
1533
1194
|
const fnScope = createScopeBuilder(selectors);
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1195
|
+
const fnSelector = createSelectorBuilder(selectors, transform);
|
|
1196
|
+
const fnWeight = (value, weight) => {
|
|
1197
|
+
return weightValue(value, weight);
|
|
1536
1198
|
};
|
|
1199
|
+
const fnImportant = (value, native) => importantValue(value, native);
|
|
1537
1200
|
const fnRaw = (style) => style;
|
|
1538
1201
|
const fnPlain = (style) => style;
|
|
1539
1202
|
const fnKeyframes = ((frames, stableId) => createStyleKeyframes(frames, transform ?? null, stableId));
|
|
@@ -1545,11 +1208,13 @@ function createStyleFn(args) {
|
|
|
1545
1208
|
const style = fnStyle;
|
|
1546
1209
|
style.slot = fnSlot;
|
|
1547
1210
|
style.scope = fnScope;
|
|
1548
|
-
style.
|
|
1211
|
+
style.weight = fnWeight;
|
|
1212
|
+
style.important = fnImportant;
|
|
1549
1213
|
style.raw = fnRaw;
|
|
1550
1214
|
style.plain = fnPlain;
|
|
1551
1215
|
style.keyframes = fnKeyframes;
|
|
1552
1216
|
style.merge = fnMerge;
|
|
1217
|
+
style.selector = fnSelector;
|
|
1553
1218
|
assignStyleFnMeta(style, {
|
|
1554
1219
|
mode: "StyleObject",
|
|
1555
1220
|
selectors,
|
|
@@ -1575,12 +1240,18 @@ function getStyleFnMeta(styleFn) {
|
|
|
1575
1240
|
function createClassNameFn(args) {
|
|
1576
1241
|
const { selectors, transform } = args;
|
|
1577
1242
|
const className = createClassNameBuilder(selectors, transform);
|
|
1578
|
-
className.weight = (
|
|
1243
|
+
className.weight = (className, weight) => {
|
|
1579
1244
|
return {
|
|
1580
|
-
className
|
|
1245
|
+
className,
|
|
1581
1246
|
weight
|
|
1582
1247
|
};
|
|
1583
1248
|
};
|
|
1249
|
+
className.important = (className) => {
|
|
1250
|
+
return {
|
|
1251
|
+
className,
|
|
1252
|
+
important: true
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1584
1255
|
assignStyleFnMeta(className, {
|
|
1585
1256
|
mode: "ClassName",
|
|
1586
1257
|
selectors,
|
|
@@ -1603,22 +1274,47 @@ function createTheme(tokens, stableId, callsite) {
|
|
|
1603
1274
|
return createThemeData(callsite ?? null, id, className, tokens);
|
|
1604
1275
|
}
|
|
1605
1276
|
//#endregion
|
|
1277
|
+
//#region style/tokens.ts
|
|
1278
|
+
function createTokens(values, stableId) {
|
|
1279
|
+
const tokens = {};
|
|
1280
|
+
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1281
|
+
const value = values[i];
|
|
1282
|
+
tokens[value] = createStyleToken(value, getChildStableId$1(stableId, String(i)), getChildStyleTokenName(stableId, String(i)));
|
|
1283
|
+
}
|
|
1284
|
+
else assignTokenRecord(tokens, values, stableId, stableId ?? null);
|
|
1285
|
+
return tokens;
|
|
1286
|
+
}
|
|
1287
|
+
function assignTokenRecord(target, values, stableId, debugName) {
|
|
1288
|
+
for (let key in values) {
|
|
1289
|
+
const value = values[key];
|
|
1290
|
+
const childName = getChildStyleTokenName(debugName, key);
|
|
1291
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1292
|
+
const child = {};
|
|
1293
|
+
target[key] = child;
|
|
1294
|
+
assignTokenRecord(child, value, getChildStableId$1(stableId, key), childName);
|
|
1295
|
+
} else target[key] = createStyleToken(value, getChildStableId$1(stableId, key), childName);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
function getChildStableId$1(stableId, child) {
|
|
1299
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1300
|
+
}
|
|
1301
|
+
//#endregion
|
|
1606
1302
|
//#region style/value.ts
|
|
1607
|
-
function createToken(value,
|
|
1608
|
-
return createStyleToken(value,
|
|
1303
|
+
function createToken(value, stableId) {
|
|
1304
|
+
return createStyleToken(value, stableId);
|
|
1609
1305
|
}
|
|
1610
1306
|
function createValues(...args) {
|
|
1611
1307
|
let values = args[0];
|
|
1612
1308
|
let isNumber = false;
|
|
1613
|
-
let
|
|
1309
|
+
let stableId = args[1];
|
|
1614
1310
|
if (args[0] === Number) {
|
|
1615
1311
|
values = args[1];
|
|
1616
|
-
|
|
1312
|
+
stableId = args[2];
|
|
1617
1313
|
isNumber = true;
|
|
1618
1314
|
}
|
|
1619
1315
|
if (!values.length) throw new Error("[Style.values] NO_VALUES");
|
|
1620
1316
|
const tokens = /* @__PURE__ */ new Map();
|
|
1621
|
-
for (let value of values) tokens.set(value,
|
|
1317
|
+
for (let value of values) tokens.set(value, createStyleToken(parseValue(value, isNumber), getChildStableId(stableId, hashString(String(value))), getChildStyleTokenName(stableId ?? null, getValueDebugName(value))));
|
|
1622
1318
|
return function ValueFn(...args) {
|
|
1623
1319
|
const [value, provide, debug] = args;
|
|
1624
1320
|
const token = tokens.get(value);
|
|
@@ -1628,8 +1324,18 @@ function createValues(...args) {
|
|
|
1628
1324
|
return token;
|
|
1629
1325
|
};
|
|
1630
1326
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return
|
|
1327
|
+
function getChildStableId(stableId, child) {
|
|
1328
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1329
|
+
}
|
|
1330
|
+
function getValueDebugName(value) {
|
|
1331
|
+
if (typeof value === "number") return String(value);
|
|
1332
|
+
const parts = String(value).split(/[;|]/);
|
|
1333
|
+
const label = parts[1]?.trim();
|
|
1334
|
+
if (label) return sanitizeDebugName(label);
|
|
1335
|
+
return sanitizeDebugName(parts[0]?.trim() ?? "");
|
|
1336
|
+
}
|
|
1337
|
+
function sanitizeDebugName(value) {
|
|
1338
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
1633
1339
|
}
|
|
1634
1340
|
function parseValue(value, isNumber) {
|
|
1635
1341
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -1640,30 +1346,6 @@ function parseValue(value, isNumber) {
|
|
|
1640
1346
|
return number;
|
|
1641
1347
|
}
|
|
1642
1348
|
//#endregion
|
|
1643
|
-
|
|
1644
|
-
function createTokens(values, debugId) {
|
|
1645
|
-
const tokens = {};
|
|
1646
|
-
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1647
|
-
const value = values[i];
|
|
1648
|
-
tokens[value] = createToken(value, getChildDebugId(debugId, String(i)));
|
|
1649
|
-
}
|
|
1650
|
-
else assignTokenRecord(tokens, values, debugId);
|
|
1651
|
-
return tokens;
|
|
1652
|
-
}
|
|
1653
|
-
function assignTokenRecord(target, values, debugId) {
|
|
1654
|
-
for (let key in values) {
|
|
1655
|
-
const value = values[key];
|
|
1656
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1657
|
-
const child = {};
|
|
1658
|
-
target[key] = child;
|
|
1659
|
-
assignTokenRecord(child, value, getChildDebugId(debugId, key));
|
|
1660
|
-
} else target[key] = createToken(value, getChildDebugId(debugId, key));
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
function getChildDebugId(debugId, child) {
|
|
1664
|
-
return debugId ? debugId + "--" + child : void 0;
|
|
1665
|
-
}
|
|
1666
|
-
//#endregion
|
|
1667
|
-
export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_OVERRIDE, assignStyleFnMeta, bindScope, classNameTransform, classNameValue, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createClassNameFn, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenOverrideDebug, getToken, isAtRuleRef, isClassNameValue, isStyleTokenData, isStyleTokenOverrideData, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformKeyframes, type };
|
|
1349
|
+
export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME, assignStyleFnMeta, bindScope, classNameTransform, classNameValue, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createClassNameFn, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenName, getStyleTokenOverrideDebug, getStyleTokenVarName, getToken, importantValue, isAtRuleRef, isClassNameValue, isStyleImportantValue, isStyleTokenData, isStyleTokenOverrideData, isStyleWeightValue, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformKeyframes, type, weightValue };
|
|
1668
1350
|
|
|
1669
1351
|
//# sourceMappingURL=rsc-dev.js.map
|