@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
|
@@ -1,48 +1,26 @@
|
|
|
1
|
-
import { i as symbol } from "./global-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const mergeSlotOverrideCreate = (callsite, data) => {
|
|
25
|
-
return createSlotOverrideData(callsite, data[BUILDER_SLOT_ID]);
|
|
26
|
-
};
|
|
27
|
-
const mergeSlotOverrideData = createMerge(mergeSlotOverrideCreate, 3);
|
|
28
|
-
function createMerge(create, type) {
|
|
29
|
-
return (data, callsite, style, debug, selector, atRule) => {
|
|
30
|
-
return mergeBuilderData(create, callsite, data, style, debug, selector, atRule, type);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region builder/utils.ts
|
|
35
|
-
const FnPrefixStyle = "style.";
|
|
36
|
-
const FnPrefixSlot = "slot.";
|
|
37
|
-
const FnPrefixScope = "scope.";
|
|
38
|
-
function runtimeCallsite() {
|
|
39
|
-
return traceCallsite();
|
|
40
|
-
}
|
|
41
|
-
function resolveCallsite(debug) {
|
|
42
|
-
return debug ? getDebugCallsite(debug) : runtimeCallsite();
|
|
43
|
-
}
|
|
44
|
-
function transformStyle(style, transform) {
|
|
45
|
-
return transform ? transform.transform(style) : style;
|
|
1
|
+
import { i as symbol } from "./global-DGcWZODV.js";
|
|
2
|
+
import { a as RUNTIME_CONFIG, c as CSS_CONFIG } from "./debug-Bo43rBKc.js";
|
|
3
|
+
import { E as hashString, _ as traceMarker, f as getTraceCallsiteId, g as traceError, l as getDebugCallsiteId, p as isDebugData, v as DEV_CONFIG } from "./hash-CGO13tOn.js";
|
|
4
|
+
import { _ as createThemeData, b as importantValue, c as mergeScopeData, d as createSelectorData, f as createSelectorOverrideData, g as createStyleData, h as createSlotOverrideData, l as createScopeData, m as createSlotData, r as normalizeSelectorArg, u as createScopeTargetData, v as isStyleWeightValue, x as isStyleImportantValue, y as weightValue } from "./data-D6dD67li.js";
|
|
5
|
+
import { A as BUILDER_SLOT_ID, C as isStyleData, O as BUILDER_SELECTOR, T as BUILDER_CALLSITE, _ as isScopeTargetData, b as isSheetData, f as getScopeTargetScope, g as isScopeData, j as BUILDER_STATE, p as getScopeTargetSlotId, x as isSlotData } from "./token-CS0iRIIa.js";
|
|
6
|
+
import { n as createStyleToken, o as getChildStyleTokenName } from "./token-BX5jRxMb.js";
|
|
7
|
+
import { n as classNameValue, r as isClassNameValue } from "./transform-BZ4jPwy3.js";
|
|
8
|
+
import { _ as assertSelector, r as PrioritySelectors } from "./presets-DSanixJV.js";
|
|
9
|
+
import { C as mergeSlotData, S as mergeSelectorOverrideData, T as mergeStyleData, _ as FnPrefixSelector, a as createKeyframes, b as resolveCallsite, f as createIdCounter, g as FnPrefixScope, h as normalizeManualSelectors$1, m as assertManualSelectorSyntax, p as getId, v as FnPrefixSlot, w as mergeSlotOverrideData, x as transformStyle, y as FnPrefixStyle } from "./css-CYnQKnPu.js";
|
|
10
|
+
import { C as getCombinedStyleScopes, S as mergeTokenValues, T as isCombinedStyle, _ as addTokenOverride, b as finishTokenValues, d as getCacheTreeChild, f as getExtractedTokenBoundData, g as getStyleTokenValues, h as createCombinedStyleTokenWrapper, l as runtimeTokenValueResolver, m as createCombinedStyleFacade, p as isExtractedTokenBoundData, s as createThemeClassName, u as createCacheTreeNode, v as addTokenValues, w as getCombinedStyleStyles, x as mergeTokenOverrides, y as createMutableTokenValues } from "./env-C8lKN1dB.js";
|
|
11
|
+
import { parse } from "css-what";
|
|
12
|
+
//#region builder/data/check_selector.ts
|
|
13
|
+
function checkSelector(fnPrefix, fnName, fnSelector, arg) {
|
|
14
|
+
let message = null;
|
|
15
|
+
try {
|
|
16
|
+
assertSelector(fnSelector.assert, arg);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (typeof error === "string" && error.trim()) message = error;
|
|
19
|
+
else if (typeof error === "object" && error && error instanceof Error) message = (error.message || "").trim();
|
|
20
|
+
else message = "selector is invalid: " + arg;
|
|
21
|
+
}
|
|
22
|
+
if (!message) return;
|
|
23
|
+
throw traceError(`${fnPrefix}${fnName}(${arg || ""}): ${message}`);
|
|
46
24
|
}
|
|
47
25
|
//#endregion
|
|
48
26
|
//#region builder/style_fns.ts
|
|
@@ -95,9 +73,9 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
95
73
|
let arg;
|
|
96
74
|
let style;
|
|
97
75
|
let debug;
|
|
98
|
-
let
|
|
76
|
+
let weight = null;
|
|
99
77
|
if (hasArg) if (isMedia && typeof params[0] === "number") {
|
|
100
|
-
|
|
78
|
+
weight = params[0];
|
|
101
79
|
arg = params[1];
|
|
102
80
|
style = params[2];
|
|
103
81
|
debug = params[3];
|
|
@@ -107,7 +85,7 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
107
85
|
debug = params[2];
|
|
108
86
|
}
|
|
109
87
|
else if (isMedia && typeof params[0] === "number") {
|
|
110
|
-
|
|
88
|
+
weight = params[0];
|
|
111
89
|
arg = fnSelector.selector;
|
|
112
90
|
style = params[1];
|
|
113
91
|
debug = params[2];
|
|
@@ -127,7 +105,7 @@ function createAtRuleFn$1(mergeData, fns, createFnResult, fnPrefix, fnName, fnSe
|
|
|
127
105
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
128
106
|
for (let j = 0, len = items.length; j < len; j++) {
|
|
129
107
|
const item = items[j];
|
|
130
|
-
data = mergeData(data, callsite, isStyleData(item) ? item : transformStyle(item, transform), debug ?? null, null, [
|
|
108
|
+
data = mergeData(data, callsite, isStyleData(item) ? item : transformStyle(item, transform), debug ?? null, null, [weight !== null ? [selector, weight] : selector]);
|
|
131
109
|
}
|
|
132
110
|
}
|
|
133
111
|
return createFnResult(data, fns);
|
|
@@ -194,9 +172,9 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
194
172
|
let arg;
|
|
195
173
|
let data;
|
|
196
174
|
let debug;
|
|
197
|
-
let
|
|
175
|
+
let weight = null;
|
|
198
176
|
if (hasArg) if (isMedia && typeof params[0] === "number") {
|
|
199
|
-
|
|
177
|
+
weight = params[0];
|
|
200
178
|
arg = params[1];
|
|
201
179
|
data = params[2];
|
|
202
180
|
debug = params[3];
|
|
@@ -206,7 +184,7 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
206
184
|
debug = params[2];
|
|
207
185
|
}
|
|
208
186
|
else if (isMedia && typeof params[0] === "number") {
|
|
209
|
-
|
|
187
|
+
weight = params[0];
|
|
210
188
|
arg = fnSelector.selector;
|
|
211
189
|
data = params[1];
|
|
212
190
|
debug = params[2];
|
|
@@ -223,7 +201,7 @@ function createScopeAtRuleFn(fnPrefix, fnName, fnSelector, cloneScope) {
|
|
|
223
201
|
selector = args[i];
|
|
224
202
|
if (hasArg && DEV_CONFIG.isCheckSelectorEnabled) checkSelector(fnPrefix, fnName, fnSelector, selector);
|
|
225
203
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
226
|
-
result = mergeScopeItems(result, callsite, data, debug ?? null, null,
|
|
204
|
+
result = mergeScopeItems(result, callsite, data, debug ?? null, null, weight !== null ? [selector, weight] : selector, cloneScope);
|
|
227
205
|
}
|
|
228
206
|
return result;
|
|
229
207
|
};
|
|
@@ -311,9 +289,9 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
311
289
|
const [withoutDebug, debug] = splitDebug(params);
|
|
312
290
|
let arg;
|
|
313
291
|
let items;
|
|
314
|
-
let
|
|
292
|
+
let weight = null;
|
|
315
293
|
if (hasArg) if (isMedia && typeof withoutDebug[0] === "number") {
|
|
316
|
-
|
|
294
|
+
weight = withoutDebug[0];
|
|
317
295
|
arg = withoutDebug[1];
|
|
318
296
|
items = withoutDebug.slice(2);
|
|
319
297
|
} else {
|
|
@@ -321,7 +299,7 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
321
299
|
items = withoutDebug.slice(1);
|
|
322
300
|
}
|
|
323
301
|
else if (isMedia && typeof withoutDebug[0] === "number") {
|
|
324
|
-
|
|
302
|
+
weight = withoutDebug[0];
|
|
325
303
|
arg = fnSelector.selector;
|
|
326
304
|
items = withoutDebug.slice(1);
|
|
327
305
|
} else {
|
|
@@ -336,7 +314,7 @@ function createAtRuleFn(fns, fnPrefix, fnName, fnSelector, transform) {
|
|
|
336
314
|
let selector = argItem;
|
|
337
315
|
if (hasArg && DEV_CONFIG.isCheckSelectorEnabled) checkSelector(fnPrefix, fnName, fnSelector, selector);
|
|
338
316
|
selector = hasArg ? before + normalizeSelectorArg(selector) + after : selector;
|
|
339
|
-
data = mergeStyleData(data, callsite, classNameStyle.style, classNameStyle.debug, null, [
|
|
317
|
+
data = mergeStyleData(data, callsite, classNameStyle.style, classNameStyle.debug, null, [weight !== null ? [selector, weight] : selector]);
|
|
340
318
|
}
|
|
341
319
|
return createDefaultFnResult(data, fns);
|
|
342
320
|
};
|
|
@@ -386,7 +364,8 @@ function classNameItemsToStyle(items, transform, debug) {
|
|
|
386
364
|
for (const item of flattenClassNameItems(items)) {
|
|
387
365
|
const transformed = decorateClassNameStyle(transform.transform(item.className), item.className);
|
|
388
366
|
const weighted = item.weight === null ? transformed : applyClassNameWeight(transformed, item.weight);
|
|
389
|
-
|
|
367
|
+
const nextStyle = item.important ? applyClassNameImportant(weighted) : weighted;
|
|
368
|
+
style = style ? Object.assign({}, style, nextStyle) : nextStyle;
|
|
390
369
|
const loc = debug?.classNames?.[item.className];
|
|
391
370
|
if (loc) {
|
|
392
371
|
const nextDebugFields = debugFields ? Object.assign({}, debugFields) : Object.assign({}, debug?.fields ?? {});
|
|
@@ -409,15 +388,16 @@ function decorateClassNameStyle(style, className) {
|
|
|
409
388
|
result[property] = value;
|
|
410
389
|
continue;
|
|
411
390
|
}
|
|
412
|
-
|
|
413
|
-
const rawValue = value[1];
|
|
414
|
-
result[property] = isClassNameValue(rawValue) ? value : [value[0], classNameValue(rawValue, className)];
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
result[property] = isClassNameValue(value) ? value : classNameValue(value, className);
|
|
391
|
+
result[property] = decorateClassNameValue(value, className);
|
|
418
392
|
}
|
|
419
393
|
return result;
|
|
420
394
|
}
|
|
395
|
+
function decorateClassNameValue(value, className) {
|
|
396
|
+
if (isClassNameValue(value)) return value;
|
|
397
|
+
if (isStyleImportantValue(value)) return importantValue(decorateClassNameValue(value.value, className), value.native);
|
|
398
|
+
if (isStyleWeightValue(value)) return weightValue(decorateClassNameValue(value.value, className), value.weight);
|
|
399
|
+
return classNameValue(value, className);
|
|
400
|
+
}
|
|
421
401
|
function flattenClassNameItems(items) {
|
|
422
402
|
const result = [];
|
|
423
403
|
for (const item of items) collectClassNameItem(item, result);
|
|
@@ -428,6 +408,7 @@ function collectClassNameItem(item, result) {
|
|
|
428
408
|
if (typeof item === "string") {
|
|
429
409
|
result.push({
|
|
430
410
|
className: item,
|
|
411
|
+
important: false,
|
|
431
412
|
weight: null
|
|
432
413
|
});
|
|
433
414
|
return;
|
|
@@ -436,13 +417,29 @@ function collectClassNameItem(item, result) {
|
|
|
436
417
|
for (const child of item) collectClassNameItem(child, result);
|
|
437
418
|
return;
|
|
438
419
|
}
|
|
439
|
-
if (isWeightedClassName(item))
|
|
420
|
+
if (isWeightedClassName(item)) {
|
|
421
|
+
result.push({
|
|
422
|
+
...item,
|
|
423
|
+
important: false
|
|
424
|
+
});
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (isImportantClassName(item)) result.push({
|
|
428
|
+
className: item.className,
|
|
429
|
+
important: true,
|
|
430
|
+
weight: null
|
|
431
|
+
});
|
|
440
432
|
}
|
|
441
433
|
function isWeightedClassName(item) {
|
|
442
434
|
if (!item || typeof item !== "object") return false;
|
|
443
435
|
const weighted = item;
|
|
444
436
|
return typeof weighted.className === "string" && typeof weighted.weight === "number";
|
|
445
437
|
}
|
|
438
|
+
function isImportantClassName(item) {
|
|
439
|
+
if (!item || typeof item !== "object") return false;
|
|
440
|
+
const important = item;
|
|
441
|
+
return typeof important.className === "string" && important.important === true;
|
|
442
|
+
}
|
|
446
443
|
function applyClassNameWeight(style, weight) {
|
|
447
444
|
const weighted = {};
|
|
448
445
|
for (const [property, value] of Object.entries(style)) {
|
|
@@ -450,16 +447,43 @@ function applyClassNameWeight(style, weight) {
|
|
|
450
447
|
weighted[property] = value;
|
|
451
448
|
continue;
|
|
452
449
|
}
|
|
453
|
-
weighted[property] =
|
|
450
|
+
weighted[property] = weightValue(value, weight);
|
|
454
451
|
}
|
|
455
452
|
return weighted;
|
|
456
453
|
}
|
|
454
|
+
function applyClassNameImportant(style) {
|
|
455
|
+
const important = {};
|
|
456
|
+
for (const [property, value] of Object.entries(style)) {
|
|
457
|
+
if (value === null || value === void 0) {
|
|
458
|
+
important[property] = value;
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
important[property] = importantValue(value);
|
|
462
|
+
}
|
|
463
|
+
return important;
|
|
464
|
+
}
|
|
457
465
|
function splitDebug(params) {
|
|
458
466
|
const last = params[params.length - 1];
|
|
459
467
|
if (!isDebugData(last)) return [params.slice(), void 0];
|
|
460
468
|
return [params.slice(0, -1), last];
|
|
461
469
|
}
|
|
462
470
|
//#endregion
|
|
471
|
+
//#region builder/selector_override.ts
|
|
472
|
+
function normalizeManualSelectors(input) {
|
|
473
|
+
return normalizeManualSelectors$1(input, assertManualSelector);
|
|
474
|
+
}
|
|
475
|
+
function assertManualSelector(selector) {
|
|
476
|
+
assertManualSelectorSyntax(selector);
|
|
477
|
+
const ampersandIndex = selector.indexOf("&");
|
|
478
|
+
const ampersandSelector = selector.startsWith("&?") ? selector.slice(2) : selector.slice(1);
|
|
479
|
+
const parsedSelector = ampersandIndex === 0 ? "*" + ampersandSelector : selector;
|
|
480
|
+
try {
|
|
481
|
+
parse(parsedSelector);
|
|
482
|
+
} catch {
|
|
483
|
+
throw new Error("selector is invalid: " + selector);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
//#endregion
|
|
463
487
|
//#region builder/style_builder.ts
|
|
464
488
|
function createStyleBuilder(selectors, transform) {
|
|
465
489
|
const fns = createStyleFns(mergeStyleData, selectors, FnPrefixStyle, transform, null);
|
|
@@ -493,6 +517,20 @@ function createSlotBuilder(selectors, transform) {
|
|
|
493
517
|
traceMarker(fn, "slot");
|
|
494
518
|
return fn;
|
|
495
519
|
}
|
|
520
|
+
function createSelectorBuilder(selectors, transform) {
|
|
521
|
+
const fns = createStyleFns(mergeSelectorOverrideData, selectors, FnPrefixSelector, transform, null);
|
|
522
|
+
const fn = (selector, style, debug) => {
|
|
523
|
+
if (isDebugData(style) && debug === void 0) {
|
|
524
|
+
debug = style;
|
|
525
|
+
style = void 0;
|
|
526
|
+
}
|
|
527
|
+
const target = createCallableSelector(createSelectorData(resolveCallsite(debug), normalizeManualSelectors(selector)), fns, transform);
|
|
528
|
+
if (style === void 0) return target;
|
|
529
|
+
return target(style, debug);
|
|
530
|
+
};
|
|
531
|
+
traceMarker(fn, "style.selector");
|
|
532
|
+
return fn;
|
|
533
|
+
}
|
|
496
534
|
function createScopeBuilder(selectors) {
|
|
497
535
|
const fns = createScopeFns(selectors, FnPrefixScope, cloneScope);
|
|
498
536
|
const fn = (items, debug) => {
|
|
@@ -508,6 +546,34 @@ function createScopeBuilder(selectors) {
|
|
|
508
546
|
traceMarker(fn, "scope");
|
|
509
547
|
return fn;
|
|
510
548
|
}
|
|
549
|
+
function createCallableSelectorOverride(data, fns, transform) {
|
|
550
|
+
const callable = ((style, debug) => {
|
|
551
|
+
if (isDebugData(style) && debug === void 0) {
|
|
552
|
+
debug = style;
|
|
553
|
+
style = void 0;
|
|
554
|
+
}
|
|
555
|
+
const callsite = resolveCallsite(debug);
|
|
556
|
+
return createCallableSelectorOverride(mergeSelectorOverrideData(createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]), callsite, style ? isStyleData(style) ? style : transformStyle(style, transform) : null, debug ?? null, null, null), fns, transform);
|
|
557
|
+
});
|
|
558
|
+
traceMarker(callable, "selector.override");
|
|
559
|
+
Object.setPrototypeOf(callable, fns);
|
|
560
|
+
Object.assign(callable, data);
|
|
561
|
+
return callable;
|
|
562
|
+
}
|
|
563
|
+
function createCallableSelector(data, overrideFns, transform) {
|
|
564
|
+
const callable = ((style, debug) => {
|
|
565
|
+
if (isDebugData(style) && debug === void 0) {
|
|
566
|
+
debug = style;
|
|
567
|
+
style = void 0;
|
|
568
|
+
}
|
|
569
|
+
const callsite = resolveCallsite(debug);
|
|
570
|
+
return createCallableSelectorOverride(mergeSelectorOverrideData(createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]), callsite, style ? isStyleData(style) ? style : transformStyle(style, transform) : null, debug ?? null, null, null), overrideFns, transform);
|
|
571
|
+
});
|
|
572
|
+
traceMarker(callable, "selector");
|
|
573
|
+
Object.setPrototypeOf(callable, overrideFns);
|
|
574
|
+
Object.assign(callable, data);
|
|
575
|
+
return callable;
|
|
576
|
+
}
|
|
511
577
|
function createCallableSlot(data, fns, overrideFns, transform) {
|
|
512
578
|
const slotId = data[BUILDER_SLOT_ID];
|
|
513
579
|
const callable = ((style, debug) => {
|
|
@@ -570,9 +636,11 @@ function createStyleFn(args) {
|
|
|
570
636
|
const fnStyle = createStyleBuilder(selectors, transform);
|
|
571
637
|
const fnSlot = createSlotBuilder(selectors, transform);
|
|
572
638
|
const fnScope = createScopeBuilder(selectors);
|
|
573
|
-
const
|
|
574
|
-
|
|
639
|
+
const fnSelector = createSelectorBuilder(selectors, transform);
|
|
640
|
+
const fnWeight = (value, weight) => {
|
|
641
|
+
return weightValue(value, weight);
|
|
575
642
|
};
|
|
643
|
+
const fnImportant = (value, native) => importantValue(value, native);
|
|
576
644
|
const fnRaw = (style) => style;
|
|
577
645
|
const fnPlain = (style) => style;
|
|
578
646
|
const fnKeyframes = ((frames, stableId) => createStyleKeyframes(frames, transform ?? null, stableId));
|
|
@@ -584,11 +652,13 @@ function createStyleFn(args) {
|
|
|
584
652
|
const style = fnStyle;
|
|
585
653
|
style.slot = fnSlot;
|
|
586
654
|
style.scope = fnScope;
|
|
587
|
-
style.
|
|
655
|
+
style.weight = fnWeight;
|
|
656
|
+
style.important = fnImportant;
|
|
588
657
|
style.raw = fnRaw;
|
|
589
658
|
style.plain = fnPlain;
|
|
590
659
|
style.keyframes = fnKeyframes;
|
|
591
660
|
style.merge = fnMerge;
|
|
661
|
+
style.selector = fnSelector;
|
|
592
662
|
assignStyleFnMeta(style, {
|
|
593
663
|
mode: "StyleObject",
|
|
594
664
|
selectors,
|
|
@@ -614,12 +684,18 @@ function getStyleFnMeta(styleFn) {
|
|
|
614
684
|
function createClassNameFn(args) {
|
|
615
685
|
const { selectors, transform } = args;
|
|
616
686
|
const className = createClassNameBuilder(selectors, transform);
|
|
617
|
-
className.weight = (
|
|
687
|
+
className.weight = (className, weight) => {
|
|
618
688
|
return {
|
|
619
|
-
className
|
|
689
|
+
className,
|
|
620
690
|
weight
|
|
621
691
|
};
|
|
622
692
|
};
|
|
693
|
+
className.important = (className) => {
|
|
694
|
+
return {
|
|
695
|
+
className,
|
|
696
|
+
important: true
|
|
697
|
+
};
|
|
698
|
+
};
|
|
623
699
|
assignStyleFnMeta(className, {
|
|
624
700
|
mode: "ClassName",
|
|
625
701
|
selectors,
|
|
@@ -643,53 +719,84 @@ function createTheme(tokens, stableId, callsite) {
|
|
|
643
719
|
}
|
|
644
720
|
//#endregion
|
|
645
721
|
//#region style/tokens.ts
|
|
646
|
-
function createTokens(values,
|
|
722
|
+
function createTokens(values, stableId) {
|
|
647
723
|
const tokens = {};
|
|
648
724
|
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
649
725
|
const value = values[i];
|
|
650
|
-
tokens[value] =
|
|
726
|
+
tokens[value] = createStyleToken(value, getChildStableId$1(stableId, String(i)), getChildStyleTokenName(stableId, String(i)));
|
|
651
727
|
}
|
|
652
|
-
else assignTokenRecord(tokens, values,
|
|
728
|
+
else assignTokenRecord(tokens, values, stableId, stableId ?? null);
|
|
653
729
|
return tokens;
|
|
654
730
|
}
|
|
655
|
-
function assignTokenRecord(target, values,
|
|
731
|
+
function assignTokenRecord(target, values, stableId, debugName) {
|
|
656
732
|
for (let key in values) {
|
|
657
733
|
const value = values[key];
|
|
734
|
+
const childName = getChildStyleTokenName(debugName, key);
|
|
658
735
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
659
736
|
const child = {};
|
|
660
737
|
target[key] = child;
|
|
661
|
-
assignTokenRecord(child, value,
|
|
662
|
-
} else target[key] =
|
|
738
|
+
assignTokenRecord(child, value, getChildStableId$1(stableId, key), childName);
|
|
739
|
+
} else target[key] = createStyleToken(value, getChildStableId$1(stableId, key), childName);
|
|
663
740
|
}
|
|
664
741
|
}
|
|
665
|
-
function
|
|
666
|
-
return
|
|
742
|
+
function getChildStableId$1(stableId, child) {
|
|
743
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
667
744
|
}
|
|
668
745
|
//#endregion
|
|
669
|
-
//#region
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
|
|
746
|
+
//#region style/value.ts
|
|
747
|
+
function createToken(value, stableId) {
|
|
748
|
+
return createStyleToken(value, stableId);
|
|
749
|
+
}
|
|
750
|
+
function createValues(...args) {
|
|
751
|
+
let values = args[0];
|
|
752
|
+
let isNumber = false;
|
|
753
|
+
let stableId = args[1];
|
|
754
|
+
if (args[0] === Number) {
|
|
755
|
+
values = args[1];
|
|
756
|
+
stableId = args[2];
|
|
757
|
+
isNumber = true;
|
|
758
|
+
}
|
|
759
|
+
if (!values.length) throw new Error("[Style.values] NO_VALUES");
|
|
760
|
+
const tokens = /* @__PURE__ */ new Map();
|
|
761
|
+
for (let value of values) tokens.set(value, createStyleToken(parseValue(value, isNumber), getChildStableId(stableId, hashString(String(value))), getChildStyleTokenName(stableId ?? null, getValueDebugName(value))));
|
|
762
|
+
return function ValueFn(...args) {
|
|
763
|
+
const [value, provide, debug] = args;
|
|
764
|
+
const token = tokens.get(value);
|
|
765
|
+
if (!token) throw new Error(`[Style.values] VALUE_NOT_FOUND: ${String(value)}`);
|
|
766
|
+
if (args.length === 2) return token(provide);
|
|
767
|
+
if (args.length >= 3) return token(provide, debug);
|
|
768
|
+
return token;
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
function getChildStableId(stableId, child) {
|
|
772
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
773
|
+
}
|
|
774
|
+
function getValueDebugName(value) {
|
|
775
|
+
if (typeof value === "number") return String(value);
|
|
776
|
+
const parts = String(value).split(/[;|]/);
|
|
777
|
+
const label = parts[1]?.trim();
|
|
778
|
+
if (label) return sanitizeDebugName(label);
|
|
779
|
+
return sanitizeDebugName(parts[0]?.trim() ?? "");
|
|
780
|
+
}
|
|
781
|
+
function sanitizeDebugName(value) {
|
|
782
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
783
|
+
}
|
|
784
|
+
function parseValue(value, isNumber) {
|
|
785
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
786
|
+
value = String(value).split(/[;|]/)[0].trim();
|
|
787
|
+
if (!isNumber) return value;
|
|
788
|
+
const number = Number(value);
|
|
789
|
+
if (!Number.isFinite(number)) throw new Error(`[Style.values] INVALID_NUMBER_VALUE: ${String(value)}`);
|
|
790
|
+
return number;
|
|
673
791
|
}
|
|
674
792
|
//#endregion
|
|
675
793
|
//#region runtime/style/scope.ts
|
|
676
794
|
function combineScope(...scopes) {
|
|
677
|
-
const shortcut = resolveSingleScopeTarget(scopes);
|
|
678
|
-
if (shortcut !== null) return (target) => shortcut(target);
|
|
679
795
|
return (target) => resolveScopeTargets(target, scopes);
|
|
680
796
|
}
|
|
681
797
|
function bindScope(target, ...scopes) {
|
|
682
|
-
const shortcut = resolveSingleScopeTarget(scopes);
|
|
683
|
-
if (shortcut !== null) return shortcut(target);
|
|
684
798
|
return resolveScopeTargets(target, scopes);
|
|
685
799
|
}
|
|
686
|
-
function resolveSingleScopeTarget(scopes) {
|
|
687
|
-
if (scopes.length !== 1) return null;
|
|
688
|
-
const scope = scopes[0];
|
|
689
|
-
if (!scope) return () => [];
|
|
690
|
-
if (Array.isArray(scope) || !isScopeData(scope)) return null;
|
|
691
|
-
return (target) => [scope(target)];
|
|
692
|
-
}
|
|
693
800
|
function resolveScopeTargets(target, scopes) {
|
|
694
801
|
const targets = [];
|
|
695
802
|
const stack = scopes.slice();
|
|
@@ -708,23 +815,13 @@ function resolveScopeTargets(target, scopes) {
|
|
|
708
815
|
//#region runtime/core/cache/pool.ts
|
|
709
816
|
const DEFAULT_TTL = 1e3 * 60 * 5;
|
|
710
817
|
const TOKEN_WRAPPER_CACHE_LIMIT = 32;
|
|
711
|
-
|
|
712
|
-
let configuredPoolTTL = -1;
|
|
713
|
-
function getCombinedStylePool() {
|
|
714
|
-
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
715
|
-
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
716
|
-
configuredPool = createCombinedStylePool(ttl);
|
|
717
|
-
configuredPoolTTL = ttl;
|
|
718
|
-
}
|
|
719
|
-
return configuredPool;
|
|
720
|
-
}
|
|
721
|
-
function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
818
|
+
function createCombinedStylePool(resolver, ttl = DEFAULT_TTL) {
|
|
722
819
|
const root = createPoolNode();
|
|
723
820
|
let timer = null;
|
|
724
821
|
return {
|
|
725
822
|
get(styles, inheritedScopes, items, prevTokensData = null) {
|
|
726
823
|
if (ttl === 0) {
|
|
727
|
-
const collected = collectItems(null, items, prevTokensData);
|
|
824
|
+
const collected = collectItems(null, items, prevTokensData, resolver);
|
|
728
825
|
return {
|
|
729
826
|
style: createCombinedStyleFacade(styles, concatScopes(inheritedScopes, collected.scopes)),
|
|
730
827
|
tokenCache: null,
|
|
@@ -734,7 +831,7 @@ function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
|
734
831
|
const now = Date.now();
|
|
735
832
|
let node = getPoolChild(root, styles);
|
|
736
833
|
node = walkScopes(node, inheritedScopes);
|
|
737
|
-
const collected = collectItems(node, items, prevTokensData);
|
|
834
|
+
const collected = collectItems(node, items, prevTokensData, resolver);
|
|
738
835
|
node = collected.node ?? node;
|
|
739
836
|
node.value.updatedAt = now;
|
|
740
837
|
if (node.value.style) {
|
|
@@ -791,17 +888,17 @@ function getTokenWrapperCache(node) {
|
|
|
791
888
|
function getTokenWrapperCacheKey(tokens) {
|
|
792
889
|
return tokens.ids.join("") + "" + tokens.values.join("");
|
|
793
890
|
}
|
|
794
|
-
function collectItems(node, items, prevTokensData) {
|
|
891
|
+
function collectItems(node, items, prevTokensData, resolver) {
|
|
795
892
|
const scopes = [];
|
|
796
893
|
const tokens = createMutableTokenValues(prevTokensData);
|
|
797
894
|
let currentNode = node;
|
|
798
895
|
for (let i = 0, len = items.length; i < len; i++) {
|
|
799
896
|
const item = items[i];
|
|
800
|
-
if (addTokenOverride(tokens, item)) continue;
|
|
897
|
+
if (addTokenOverride(tokens, item, resolver)) continue;
|
|
801
898
|
if (isScopeTargetData(item)) {
|
|
802
899
|
scopes.push(item);
|
|
803
900
|
currentNode = currentNode ? walkScope(currentNode, item) : null;
|
|
804
|
-
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item)));
|
|
901
|
+
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item), resolver));
|
|
805
902
|
}
|
|
806
903
|
}
|
|
807
904
|
const tokensData = finishTokenValues(prevTokensData, tokens);
|
|
@@ -829,17 +926,16 @@ function walkScope(node, scope) {
|
|
|
829
926
|
node = getPoolChild(node, getScopeTargetSlotId(scope));
|
|
830
927
|
return node;
|
|
831
928
|
}
|
|
832
|
-
function getScopeTokenValues(node, scope) {
|
|
833
|
-
|
|
834
|
-
if (node && node.value.h && node.value.f === tokenNameFormat) return node.value.s;
|
|
929
|
+
function getScopeTokenValues(node, scope, resolver) {
|
|
930
|
+
if (node && node.value.h && node.value.f === resolver.key) return node.value.s;
|
|
835
931
|
const values = createMutableTokenValues(null);
|
|
836
932
|
const items = scope[BUILDER_STATE].items;
|
|
837
|
-
for (let i = 0, len = items.length; i < len; i++) addTokenOverride(values, items[i]);
|
|
933
|
+
for (let i = 0, len = items.length; i < len; i++) addTokenOverride(values, items[i], resolver);
|
|
838
934
|
const tokens = finishTokenValues(null, values);
|
|
839
935
|
if (node) {
|
|
840
936
|
node.value.h = true;
|
|
841
937
|
node.value.s = tokens;
|
|
842
|
-
node.value.f =
|
|
938
|
+
node.value.f = resolver.key;
|
|
843
939
|
}
|
|
844
940
|
return tokens;
|
|
845
941
|
}
|
|
@@ -880,49 +976,153 @@ function cleanupNode(node, now, ttl) {
|
|
|
880
976
|
}
|
|
881
977
|
//#endregion
|
|
882
978
|
//#region runtime/core/cache/combine.ts
|
|
883
|
-
function
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
return
|
|
979
|
+
function createCombinedStyleGetter(resolver) {
|
|
980
|
+
let configuredPool = null;
|
|
981
|
+
let configuredPoolTTL = -1;
|
|
982
|
+
return function getConfiguredCombinedStyle(styles, args) {
|
|
983
|
+
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
984
|
+
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
985
|
+
configuredPool = createCombinedStylePool(resolver, ttl);
|
|
986
|
+
configuredPoolTTL = ttl;
|
|
987
|
+
}
|
|
988
|
+
const normalized = normalizeStyleItems(styles, args, resolver);
|
|
989
|
+
const result = configuredPool.get(styles, normalized.inheritedScopes, normalized.items, normalized.tokens);
|
|
990
|
+
return result.tokens ? getCachedTokenWrapper(result.tokenCache, result.tokens, () => createCombinedStyleTokenWrapper(result.style, result.tokens)) : result.style;
|
|
991
|
+
};
|
|
887
992
|
}
|
|
888
|
-
function normalizeStyleItems(styles, args) {
|
|
993
|
+
function normalizeStyleItems(styles, args, resolver) {
|
|
889
994
|
const result = {
|
|
890
995
|
inheritedScopes: [],
|
|
891
996
|
items: [],
|
|
892
997
|
tokens: null
|
|
893
998
|
};
|
|
894
|
-
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result);
|
|
999
|
+
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result, resolver);
|
|
895
1000
|
return result;
|
|
896
1001
|
}
|
|
897
|
-
function collectStyleArg(styles, arg, result) {
|
|
1002
|
+
function collectStyleArg(styles, arg, result, resolver) {
|
|
898
1003
|
if (!arg) return;
|
|
899
1004
|
if (Array.isArray(arg)) {
|
|
900
|
-
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result);
|
|
1005
|
+
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result, resolver);
|
|
901
1006
|
return;
|
|
902
1007
|
}
|
|
903
1008
|
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(arg)) {
|
|
904
1009
|
const bound = getExtractedTokenBoundData(arg);
|
|
905
|
-
|
|
906
|
-
|
|
1010
|
+
collectStyleArg(styles, bound.data, result, resolver);
|
|
1011
|
+
result.tokens = mergeTokenOverrides(result.tokens, bound.tokens, resolver);
|
|
907
1012
|
return;
|
|
908
1013
|
}
|
|
909
1014
|
if (isCombinedStyle(arg)) {
|
|
910
|
-
if (getCombinedStyleStyles(arg) !== styles) throw new TypeError("[fluentic-style] combineStyle
|
|
1015
|
+
if (getCombinedStyleStyles(arg) !== styles) throw new TypeError("[fluentic-style] combineStyle styles mismatch.");
|
|
911
1016
|
const scopes = getCombinedStyleScopes(arg);
|
|
912
1017
|
for (let i = 0, len = scopes.length; i < len; i++) result.inheritedScopes.push(scopes[i]);
|
|
913
1018
|
result.tokens = mergeTokenValues(result.tokens, getStyleTokenValues(arg));
|
|
914
1019
|
return;
|
|
915
1020
|
}
|
|
1021
|
+
if (isSheetData(arg)) {
|
|
1022
|
+
collectTokenOverrides(arg, result, resolver);
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
if (isScopeData(arg)) {
|
|
1026
|
+
collectTokenOverrides(arg, result, resolver);
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
916
1029
|
result.items.push(arg);
|
|
917
1030
|
}
|
|
1031
|
+
function collectTokenOverrides(data, result, resolver) {
|
|
1032
|
+
const items = data[BUILDER_STATE]?.items ?? [];
|
|
1033
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
1034
|
+
const item = items[i];
|
|
1035
|
+
if (resolver.is(item)) result.tokens = mergeTokenOverrides(result.tokens, [item], resolver);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
//#endregion
|
|
1039
|
+
//#region runtime/core/cache/combineRuntime.ts
|
|
1040
|
+
const getCombinedStyle = createCombinedStyleGetter(runtimeTokenValueResolver);
|
|
918
1041
|
//#endregion
|
|
919
1042
|
//#region runtime/style/style.ts
|
|
1043
|
+
const singleStyleWrappers = /* @__PURE__ */ new WeakMap();
|
|
920
1044
|
const combineStyleBase = (styles, ...args) => getCombinedStyle(styles, args);
|
|
1045
|
+
const combineStyleResolve = ((styles, ...args) => {
|
|
1046
|
+
if (Array.isArray(styles)) return combineStyleArray(styles, collectStyleWithArgs(args));
|
|
1047
|
+
return isSingleStyleItem(styles) ? combineStyleSingle(styles, collectStyleWithArgs(args)) : combineStyleBase(styles, ...args);
|
|
1048
|
+
});
|
|
921
1049
|
const combineStyleFor = (styles) => {
|
|
922
1050
|
return (...args) => combineStyleBase(styles, ...args);
|
|
923
1051
|
};
|
|
924
|
-
const
|
|
1052
|
+
const combineStyleWith = (...args) => {
|
|
1053
|
+
const withArgs = collectStyleWithArgs(args);
|
|
1054
|
+
return ((styles) => {
|
|
1055
|
+
return isSingleStyleItem(styles) ? combineStyleSingle(styles, withArgs) : combineStyleBase(styles, ...withArgs.combineArgs);
|
|
1056
|
+
});
|
|
1057
|
+
};
|
|
1058
|
+
const combineStyleMulti = (styles, ...args) => {
|
|
1059
|
+
const withArgs = collectStyleWithArgs(args);
|
|
1060
|
+
return styles.map((style) => combineStyleSingle(style, withArgs));
|
|
1061
|
+
};
|
|
1062
|
+
function combineStyleSingle(style, args) {
|
|
1063
|
+
const result = combineStyleSingleItem(style, args.combineArgs);
|
|
1064
|
+
if (!args.styles.length) return result;
|
|
1065
|
+
const styles = [result];
|
|
1066
|
+
for (let i = 0, len = args.styles.length; i < len; i++) styles.push(combineStyleSingleItem(args.styles[i], args.combineArgs));
|
|
1067
|
+
return styles;
|
|
1068
|
+
}
|
|
1069
|
+
function combineStyleArray(styles, args) {
|
|
1070
|
+
const result = [];
|
|
1071
|
+
collectDirectStyles(styles, result, args);
|
|
1072
|
+
for (let i = 0, len = args.styles.length; i < len; i++) result.push(combineStyleSingleItem(args.styles[i], args.combineArgs));
|
|
1073
|
+
return result;
|
|
1074
|
+
}
|
|
1075
|
+
function collectDirectStyles(styles, result, args) {
|
|
1076
|
+
for (let i = 0, len = styles.length; i < len; i++) {
|
|
1077
|
+
const style = styles[i];
|
|
1078
|
+
if (!style) continue;
|
|
1079
|
+
if (Array.isArray(style)) {
|
|
1080
|
+
collectDirectStyles(style, result, args);
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
if (isSingleStyleItem(style)) result.push(combineStyleSingleItem(style, args.combineArgs));
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
function combineStyleSingleItem(style, args) {
|
|
1087
|
+
return combineStyleBase(getSingleStyleWrapper(style), ...args).value;
|
|
1088
|
+
}
|
|
1089
|
+
function getSingleStyleWrapper(style) {
|
|
1090
|
+
let wrapper = singleStyleWrappers.get(style);
|
|
1091
|
+
if (!wrapper) {
|
|
1092
|
+
wrapper = { value: style };
|
|
1093
|
+
singleStyleWrappers.set(style, wrapper);
|
|
1094
|
+
}
|
|
1095
|
+
return wrapper;
|
|
1096
|
+
}
|
|
1097
|
+
function isSingleStyleItem(value) {
|
|
1098
|
+
return isStyleData(value) || isSheetData(value) || isSlotData(value);
|
|
1099
|
+
}
|
|
1100
|
+
function collectStyleWithArgs(args) {
|
|
1101
|
+
const result = {
|
|
1102
|
+
combineArgs: [],
|
|
1103
|
+
styles: []
|
|
1104
|
+
};
|
|
1105
|
+
collectArgs(args, result);
|
|
1106
|
+
return result;
|
|
1107
|
+
}
|
|
1108
|
+
function collectArgs(args, result) {
|
|
1109
|
+
for (let i = 0, len = args.length; i < len; i++) {
|
|
1110
|
+
const arg = args[i];
|
|
1111
|
+
if (!arg) continue;
|
|
1112
|
+
if (Array.isArray(arg)) {
|
|
1113
|
+
collectArgs(arg, result);
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
result.combineArgs.push(arg);
|
|
1117
|
+
if (isSingleStyleItem(arg)) result.styles.push(arg);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
const combineStyle = Object.assign(combineStyleResolve, {
|
|
1121
|
+
for: combineStyleFor,
|
|
1122
|
+
with: combineStyleWith,
|
|
1123
|
+
multi: combineStyleMulti
|
|
1124
|
+
});
|
|
925
1125
|
//#endregion
|
|
926
|
-
export {
|
|
1126
|
+
export { createValues as a, resetStyleThemeIdCounter as c, createStyleFn as d, getStyleFnMeta as f, type as g, transformKeyframes as h, createToken as i, createClassNameFn as l, createStyleKeyframes as m, bindScope as n, createTokens as o, style as p, combineScope as r, createTheme as s, combineStyle as t, assignStyleFnMeta as u };
|
|
927
1127
|
|
|
928
|
-
//# sourceMappingURL=style-
|
|
1128
|
+
//# sourceMappingURL=style-B1tkE8zl.js.map
|