@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
|
@@ -0,0 +1,1091 @@
|
|
|
1
|
+
import { Bt as isDebugData, G as getStyleTokenId, Ht as traceCallsite, It as getDebugCallsite, J as isStyleTokenData, Jt as createNameFormatter, Rt as getDebugFieldCallsite, Sn as symbol, St as SHEET_SELECTOR_ANCHOR, Ut as traceError, Xt as normalizePropertyName, Y as isStyleTokenOverrideData, Yt as normalizeDebugKeywordValue, Zt as sanitizeDebugPropertyName, _t as BUILDER_SHEET_OPTIONS, an as hasOwn, at as isScopeData, b as hasSheetSelectorAnchor, bt as BUILDER_TYPE, c as GLOBAL_SEED_ATTR, cn as DEBUG_CONFIG, ct as isSelectorOverrideData, dn as CSS_CONFIG, dt as isSlotOverrideData, fn as CSS_CONFIG_DEFAULT, ft as isStyleData, gn as CHECK_CONFIG, gt as BUILDER_SELECTOR, ht as BUILDER_SCOPE_ID, i as IS_SERVER_RUNTIME, it as getSelectorSelectors, kt as splitElementMarkerStyleProp, mt as BUILDER_SCOPE, n as getRscStyleRules, p as collectStylePropSheetRules, pn as isSheetLayerOption, pt as BUILDER_CALLSITE, qt as getIdentifierSafeHash, r as serializeRscRules, s as GLOBAL_RULES_ATTR, sn as hashString, st as isSelectorData, tn as DEV_CONFIG, ut as isSlotData, v as getSelectorHash, vt as BUILDER_SLOT_ID, w as getTokenVar, wt as createElementMarkerClassName, xn as globalData, xt as GLOBAL_SHEET_SELECTOR_ANCHOR, y as getSelectorText$1, yt as BUILDER_STATE } from "./styleStore-D4umgIwQ.js";
|
|
2
|
+
import { t as getGlobalSheet } from "./sheet-CHnDkjn4.js";
|
|
3
|
+
import { Fragment, cache, cloneElement, createElement } from "react";
|
|
4
|
+
//#region builder/data/create.ts
|
|
5
|
+
function createStyleData(callsite) {
|
|
6
|
+
return {
|
|
7
|
+
[BUILDER_TYPE]: 1,
|
|
8
|
+
[BUILDER_STATE]: {
|
|
9
|
+
items: [],
|
|
10
|
+
lookup: {}
|
|
11
|
+
},
|
|
12
|
+
[BUILDER_CALLSITE]: callsite
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function createSheetData(callsite, options = {}) {
|
|
16
|
+
return {
|
|
17
|
+
[BUILDER_TYPE]: 9,
|
|
18
|
+
[BUILDER_STATE]: {
|
|
19
|
+
items: [],
|
|
20
|
+
lookup: {}
|
|
21
|
+
},
|
|
22
|
+
[BUILDER_CALLSITE]: callsite,
|
|
23
|
+
[BUILDER_SHEET_OPTIONS]: options
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createSlotData(callsite, slotId) {
|
|
27
|
+
return {
|
|
28
|
+
[BUILDER_TYPE]: 2,
|
|
29
|
+
[BUILDER_STATE]: {
|
|
30
|
+
items: [],
|
|
31
|
+
lookup: {}
|
|
32
|
+
},
|
|
33
|
+
[BUILDER_CALLSITE]: callsite,
|
|
34
|
+
[BUILDER_SLOT_ID]: slotId
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function createSlotOverrideData(callsite, slotId) {
|
|
38
|
+
return {
|
|
39
|
+
[BUILDER_TYPE]: 3,
|
|
40
|
+
[BUILDER_STATE]: {
|
|
41
|
+
items: [],
|
|
42
|
+
lookup: {}
|
|
43
|
+
},
|
|
44
|
+
[BUILDER_CALLSITE]: callsite,
|
|
45
|
+
[BUILDER_SLOT_ID]: slotId
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function createSelectorOverrideData(callsite, selectors) {
|
|
49
|
+
return {
|
|
50
|
+
[BUILDER_TYPE]: 8,
|
|
51
|
+
[BUILDER_STATE]: {
|
|
52
|
+
items: [],
|
|
53
|
+
lookup: {}
|
|
54
|
+
},
|
|
55
|
+
[BUILDER_CALLSITE]: callsite,
|
|
56
|
+
[BUILDER_SELECTOR]: selectors
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function createSelectorData(callsite, selectors) {
|
|
60
|
+
return {
|
|
61
|
+
[BUILDER_TYPE]: 7,
|
|
62
|
+
[BUILDER_STATE]: {
|
|
63
|
+
items: [],
|
|
64
|
+
lookup: {}
|
|
65
|
+
},
|
|
66
|
+
[BUILDER_CALLSITE]: callsite,
|
|
67
|
+
[BUILDER_SELECTOR]: selectors
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function createScopeData(callsite) {
|
|
71
|
+
return {
|
|
72
|
+
[BUILDER_TYPE]: 4,
|
|
73
|
+
[BUILDER_STATE]: {
|
|
74
|
+
items: [],
|
|
75
|
+
lookup: {}
|
|
76
|
+
},
|
|
77
|
+
[BUILDER_CALLSITE]: callsite
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function createScopeTargetData(scope, slot) {
|
|
81
|
+
return {
|
|
82
|
+
[BUILDER_TYPE]: 5,
|
|
83
|
+
[BUILDER_SCOPE]: scope,
|
|
84
|
+
[BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function createThemeData(callsite, id, className, tokens) {
|
|
88
|
+
return {
|
|
89
|
+
[BUILDER_TYPE]: 6,
|
|
90
|
+
[BUILDER_STATE]: {
|
|
91
|
+
items: [],
|
|
92
|
+
lookup: {}
|
|
93
|
+
},
|
|
94
|
+
[BUILDER_CALLSITE]: callsite,
|
|
95
|
+
id,
|
|
96
|
+
className,
|
|
97
|
+
tokens
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const formatClassName = createNameFormatter([
|
|
101
|
+
"atRule",
|
|
102
|
+
"scopeSelector",
|
|
103
|
+
"property",
|
|
104
|
+
"selector",
|
|
105
|
+
"value"
|
|
106
|
+
]);
|
|
107
|
+
const formatTransformClassName = createNameFormatter(["className"]);
|
|
108
|
+
function getDebugClassName(format, hash, info) {
|
|
109
|
+
return formatClassName(format || "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash", hash, info);
|
|
110
|
+
}
|
|
111
|
+
function getDebugSheetClassName(format, hash, info) {
|
|
112
|
+
return formatClassName(format || "sheet-(property)[-(value)]--$hash", hash, info);
|
|
113
|
+
}
|
|
114
|
+
function getDebugTransformClassName(format, hash, info) {
|
|
115
|
+
return formatTransformClassName(format || "(className)--$hash", hash, info);
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region atomic/debug/value.ts
|
|
119
|
+
function getDebugValueName(value) {
|
|
120
|
+
if (!value) return {
|
|
121
|
+
value: null,
|
|
122
|
+
arbitraryValue: null
|
|
123
|
+
};
|
|
124
|
+
const normalized = value.trim().toLowerCase();
|
|
125
|
+
if (!normalized) return {
|
|
126
|
+
value: null,
|
|
127
|
+
arbitraryValue: null
|
|
128
|
+
};
|
|
129
|
+
if (normalized.startsWith("url") || normalized.includes("gradient") || normalized.startsWith("image") || normalized.startsWith("calc(") || normalized.startsWith("var(") || normalized.startsWith("env(") || normalized.startsWith("rgb") || normalized.startsWith("hsl")) return {
|
|
130
|
+
value: null,
|
|
131
|
+
arbitraryValue: null
|
|
132
|
+
};
|
|
133
|
+
if (/^[a-z][a-z0-9-]*$/.test(normalized)) return {
|
|
134
|
+
value: normalized,
|
|
135
|
+
arbitraryValue: null
|
|
136
|
+
};
|
|
137
|
+
const name = normalized.replace(/px/g, "").replace(/rem/g, "rem").replace(/em/g, "em").replace(/%/g, "pct").replace(/fr/g, "fr").replace(/[,()"'#]/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9._%-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
138
|
+
if (!name) return {
|
|
139
|
+
value: null,
|
|
140
|
+
arbitraryValue: null
|
|
141
|
+
};
|
|
142
|
+
return {
|
|
143
|
+
value: null,
|
|
144
|
+
arbitraryValue: name
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region atomic/debug/property/data.ts
|
|
149
|
+
const PROPERTY_ALIASES = {
|
|
150
|
+
"border-radius": "radius",
|
|
151
|
+
"flex-direction": "flex",
|
|
152
|
+
"font-style": "font",
|
|
153
|
+
"font-weight": "font",
|
|
154
|
+
"grid-template-columns": "grid-cols",
|
|
155
|
+
"grid-template-rows": "grid-rows",
|
|
156
|
+
"align-items": "items",
|
|
157
|
+
"justify-content": "justify",
|
|
158
|
+
"z-index": "zindex",
|
|
159
|
+
"pointer-events": "pointer"
|
|
160
|
+
};
|
|
161
|
+
const KEYWORD_VALUE_PROPERTIES = new Set([
|
|
162
|
+
"align-content",
|
|
163
|
+
"align-items",
|
|
164
|
+
"align-self",
|
|
165
|
+
"background-repeat",
|
|
166
|
+
"background-size",
|
|
167
|
+
"border-collapse",
|
|
168
|
+
"border-style",
|
|
169
|
+
"box-sizing",
|
|
170
|
+
"clear",
|
|
171
|
+
"cursor",
|
|
172
|
+
"display",
|
|
173
|
+
"flex-direction",
|
|
174
|
+
"flex-wrap",
|
|
175
|
+
"float",
|
|
176
|
+
"font-weight",
|
|
177
|
+
"font-style",
|
|
178
|
+
"justify-content",
|
|
179
|
+
"justify-items",
|
|
180
|
+
"justify-self",
|
|
181
|
+
"list-style-position",
|
|
182
|
+
"list-style-type",
|
|
183
|
+
"object-fit",
|
|
184
|
+
"object-position",
|
|
185
|
+
"overflow",
|
|
186
|
+
"overflow-x",
|
|
187
|
+
"overflow-y",
|
|
188
|
+
"pointer-events",
|
|
189
|
+
"place-content",
|
|
190
|
+
"place-items",
|
|
191
|
+
"place-self",
|
|
192
|
+
"position",
|
|
193
|
+
"resize",
|
|
194
|
+
"table-layout",
|
|
195
|
+
"text-align",
|
|
196
|
+
"text-decoration-line",
|
|
197
|
+
"text-transform",
|
|
198
|
+
"user-select",
|
|
199
|
+
"vertical-align",
|
|
200
|
+
"visibility",
|
|
201
|
+
"white-space"
|
|
202
|
+
]);
|
|
203
|
+
const ARBITRARY_VALUE_PROPERTIES = new Set(["font-weight"]);
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region atomic/debug/property/property.ts
|
|
206
|
+
function getDebugPropertyName(property, value) {
|
|
207
|
+
if (!property) return null;
|
|
208
|
+
const normalized = normalizePropertyName(property);
|
|
209
|
+
const name = PROPERTY_ALIASES[normalized] || sanitizeDebugPropertyName(normalized);
|
|
210
|
+
if (!name) return null;
|
|
211
|
+
return {
|
|
212
|
+
property: name,
|
|
213
|
+
...withKeywordValueFallback(normalized, value, withArbitraryValueFallback(normalized, getDebugValueName(value)))
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function withArbitraryValueFallback(property, valueName) {
|
|
217
|
+
if (!valueName.arbitraryValue || ARBITRARY_VALUE_PROPERTIES.has(property)) return valueName;
|
|
218
|
+
return {
|
|
219
|
+
value: valueName.value,
|
|
220
|
+
arbitraryValue: null
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function withKeywordValueFallback(property, value, valueName) {
|
|
224
|
+
if (valueName.value || valueName.arbitraryValue) return valueName;
|
|
225
|
+
if (!KEYWORD_VALUE_PROPERTIES.has(property)) return valueName;
|
|
226
|
+
const normalized = normalizeDebugKeywordValue(value);
|
|
227
|
+
if (!normalized) return valueName;
|
|
228
|
+
return {
|
|
229
|
+
value: normalized,
|
|
230
|
+
arbitraryValue: null
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region atomic/debug/selector.ts
|
|
235
|
+
function getDebugSelectorName(selector) {
|
|
236
|
+
if (!selector) return null;
|
|
237
|
+
const normalized = selector.trim().toLowerCase();
|
|
238
|
+
if (/^[a-z0-9]+$/.test(normalized)) return null;
|
|
239
|
+
return validateName(normalized.replace(/\$\$/g, "args").replace(/\$/g, "arg").replace(/\.\.\./g, "merge").replace(/:not\(/g, "not-").replace(/:(is|where|has)\(/g, "$1-").replace(/:nth-(child|of-type)\(/g, "nth-").replace(/[.#]/g, "-").replace(/[[\]()]/g, "-").replace(/:+/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9_-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
|
|
240
|
+
}
|
|
241
|
+
function getDebugAtRuleName(selector) {
|
|
242
|
+
if (!selector || Array.isArray(selector) && selector.length === 0) return null;
|
|
243
|
+
return validateName((Array.isArray(selector) ? selector.map(parseAtRule).filter(Boolean).join("-") : parseAtRule(selector)).replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
|
|
244
|
+
}
|
|
245
|
+
function compressQuery(query) {
|
|
246
|
+
return query.trim().toLowerCase().replace(/prefers-color-scheme\s*:\s*dark/g, "dark").replace(/prefers-color-scheme\s*:\s*light/g, "light").replace(/min-width\s*:\s*/g, "min-").replace(/max-width\s*:\s*/g, "max-").replace(/min-height\s*:\s*/g, "minh-").replace(/max-height\s*:\s*/g, "maxh-").replace(/inline-size/g, "inline").replace(/\b(and|or|only|not)\b/g, "").replace(/>=/g, "-gte-").replace(/<=/g, "-lte-").replace(/>/g, "-gt-").replace(/</g, "-lt-").replace(/[():=\s]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
247
|
+
}
|
|
248
|
+
function validateName(name) {
|
|
249
|
+
if (!name || name === "selector" || name.length < 2) return null;
|
|
250
|
+
return name;
|
|
251
|
+
}
|
|
252
|
+
function parseAtRule(rule) {
|
|
253
|
+
const normalized = rule.trim().toLowerCase();
|
|
254
|
+
if (normalized.startsWith("@media")) return compressQuery(normalized.slice(6));
|
|
255
|
+
if (normalized.startsWith("@container")) return compressQuery(normalized.slice(10));
|
|
256
|
+
if (normalized.startsWith("@supports")) return compressQuery(normalized.slice(9));
|
|
257
|
+
return compressQuery(normalized);
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region atomic/className.ts
|
|
261
|
+
function getAtomicClassName(property, priority, important, value, selector, parentSelector, atRule, callsite, localClassName, debugClassName, classNameFormat, transformClassName, transformClassNameFormat, sheetClassNameFormat = null, hashLength = null, importantNative = false) {
|
|
262
|
+
let hash = property;
|
|
263
|
+
hash += "\n" + (priority || "");
|
|
264
|
+
if (important) hash += "\nimportant";
|
|
265
|
+
if (importantNative) hash += "\nnative-important";
|
|
266
|
+
hash += "\n" + value;
|
|
267
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
268
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
269
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
270
|
+
hash += "\n" + getCallsiteHash(callsite, localClassName);
|
|
271
|
+
hash = getIdentifierSafeHash(hash, hashLength ?? getRuntimeClassNameHashLength(debugClassName));
|
|
272
|
+
if (!debugClassName) return hash;
|
|
273
|
+
if (transformClassName) return getDebugTransformClassName(transformClassNameFormat, hash, { className: transformClassName });
|
|
274
|
+
const propertyName = getDebugPropertyName(property, value);
|
|
275
|
+
const isSheetClassName = hasSheetSelectorAnchor(selector);
|
|
276
|
+
return (isSheetClassName ? getDebugSheetClassName : getDebugClassName)(isSheetClassName ? sheetClassNameFormat : classNameFormat, hash, {
|
|
277
|
+
atRule: atRule ? getDebugAtRuleName(atRule.map(getSelectorText$1)) : null,
|
|
278
|
+
scopeSelector: parentSelector ? getDebugSelectorName(getSelectorText$1(parentSelector)) : null,
|
|
279
|
+
selector: selector ? getDebugSelectorName(getSelectorText$1(selector)) : null,
|
|
280
|
+
property: propertyName ? propertyName.property : property,
|
|
281
|
+
value: propertyName ? propertyName.value ?? propertyName.arbitraryValue : null
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function getRuntimeClassNameHashLength(debugClassName) {
|
|
285
|
+
return getClassNameHashLength({
|
|
286
|
+
debugClassName,
|
|
287
|
+
isDev: DEV_CONFIG.isDev,
|
|
288
|
+
devHashLength: DEV_CONFIG.hashLength,
|
|
289
|
+
cssHashLength: CSS_CONFIG.hashLength
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
function getClassNameHashLength(options) {
|
|
293
|
+
if (options.debugClassName && options.isDev) return options.devHashLength ?? options.cssHashLength ?? 5;
|
|
294
|
+
return options.cssHashLength ?? 7;
|
|
295
|
+
}
|
|
296
|
+
function getClassNameDedupe(property, priority, important, selector, parentSelector, atRule, importantNative = false) {
|
|
297
|
+
let hash = property;
|
|
298
|
+
hash += "\n" + (priority || "");
|
|
299
|
+
if (important) hash += "\nimportant";
|
|
300
|
+
if (importantNative) hash += "\nnative-important";
|
|
301
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
302
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
303
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
304
|
+
return hashString(hash);
|
|
305
|
+
}
|
|
306
|
+
function getCallsiteHash(callsite, localClassName) {
|
|
307
|
+
if (!localClassName || !callsite) return "";
|
|
308
|
+
return callsite.filePath + "\n" + callsite.line + ":" + callsite.column;
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region builder/data/merge/utils.ts
|
|
312
|
+
function cloneData(data, source, debug, merge = true) {
|
|
313
|
+
const runtimeType = DEV_CONFIG.isDev ? debug ? -2 : -1 : -3;
|
|
314
|
+
const state = data[BUILDER_STATE];
|
|
315
|
+
state.items = merge ? source[BUILDER_STATE].items.slice() : [];
|
|
316
|
+
state.lookup = Object.assign(Object.create(null), merge ? source[BUILDER_STATE].lookup : null);
|
|
317
|
+
const lookup = state.lookup;
|
|
318
|
+
return [
|
|
319
|
+
runtimeType,
|
|
320
|
+
data,
|
|
321
|
+
state.items,
|
|
322
|
+
lookup
|
|
323
|
+
];
|
|
324
|
+
}
|
|
325
|
+
function logInvalidData(message, data) {
|
|
326
|
+
console.log(traceError(message), "data:", data);
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region builder/data/merge/scope.ts
|
|
330
|
+
function mergeScopeData(scope, callsite, items, debug, parentSelector, scopeAtRule) {
|
|
331
|
+
if (!items) return scope;
|
|
332
|
+
const sourceItems = Array.isArray(items) ? items : [items];
|
|
333
|
+
const [runtimeType, data, styles, lookup] = cloneData(scope, scope, debug);
|
|
334
|
+
let source;
|
|
335
|
+
let item;
|
|
336
|
+
let lookupIndex;
|
|
337
|
+
let weight;
|
|
338
|
+
let important;
|
|
339
|
+
let value;
|
|
340
|
+
let atRule;
|
|
341
|
+
let dedupe;
|
|
342
|
+
let className;
|
|
343
|
+
let itemDebug;
|
|
344
|
+
let itemCallsite;
|
|
345
|
+
for (let i = 0, len = sourceItems.length; i < len; i++) {
|
|
346
|
+
source = sourceItems[i];
|
|
347
|
+
if (!source) continue;
|
|
348
|
+
if (isStyleTokenOverrideData(source)) {
|
|
349
|
+
addTokenOverride(source, styles, lookup);
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
if (isScopeData(source)) {
|
|
353
|
+
const scopeItems = source[BUILDER_STATE].items;
|
|
354
|
+
for (let j = 0, len = scopeItems.length; j < len; j++) {
|
|
355
|
+
item = scopeItems[j];
|
|
356
|
+
if (isStyleTokenOverrideData(item)) {
|
|
357
|
+
addTokenOverride(item, styles, lookup);
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (Array.isArray(item) || item.type !== 4) {
|
|
361
|
+
logInvalidData("invalid scope data", {
|
|
362
|
+
source,
|
|
363
|
+
item
|
|
364
|
+
});
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
const sourceScopeItem = item;
|
|
368
|
+
atRule = scopeAtRule ? sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule] : sourceScopeItem.atRule;
|
|
369
|
+
const scopeItem = {
|
|
370
|
+
...sourceScopeItem,
|
|
371
|
+
runtime: runtimeType,
|
|
372
|
+
atRule,
|
|
373
|
+
parentSelector: parentSelector ?? sourceScopeItem.parentSelector
|
|
374
|
+
};
|
|
375
|
+
itemDebug = getMergedScopeDebug(debug, scopeItem);
|
|
376
|
+
itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ?? callsite ?? scopeItem.callsite;
|
|
377
|
+
value = scopeItem.value;
|
|
378
|
+
weight = scopeItem.weight;
|
|
379
|
+
important = scopeItem.important;
|
|
380
|
+
dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule, scopeItem.importantNative);
|
|
381
|
+
className = getAtomicClassName(scopeItem.property, weight, important, 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, CSS_CONFIG.sheetClassNameFormat ?? null, null, scopeItem.importantNative);
|
|
382
|
+
scopeItem.dedupe = dedupe;
|
|
383
|
+
scopeItem.className = className;
|
|
384
|
+
scopeItem.callsite = itemCallsite;
|
|
385
|
+
scopeItem.debug = itemDebug ?? null;
|
|
386
|
+
scopeItem.debugField = itemDebug ? scopeItem.property : null;
|
|
387
|
+
const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);
|
|
388
|
+
lookupIndex = lookup[lookupKey];
|
|
389
|
+
if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
|
|
390
|
+
else lookup[lookupKey] = styles.push(scopeItem) - 1;
|
|
391
|
+
}
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
if (!isSlotOverrideData(source)) {
|
|
395
|
+
logInvalidData("invalid scope data", { source });
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
const slotId = source[BUILDER_SLOT_ID];
|
|
399
|
+
const overrideItems = source[BUILDER_STATE].items;
|
|
400
|
+
for (let j = 0, len = overrideItems.length; j < len; j++) {
|
|
401
|
+
item = overrideItems[j];
|
|
402
|
+
if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 3) {
|
|
403
|
+
logInvalidData("invalid scope data", {
|
|
404
|
+
source,
|
|
405
|
+
item
|
|
406
|
+
});
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const overrideItem = item;
|
|
410
|
+
atRule = scopeAtRule ? overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule] : overrideItem.atRule;
|
|
411
|
+
const scopeItem = {
|
|
412
|
+
type: 4,
|
|
413
|
+
slotId,
|
|
414
|
+
runtime: runtimeType,
|
|
415
|
+
dedupe: "",
|
|
416
|
+
className: "",
|
|
417
|
+
property: overrideItem.property,
|
|
418
|
+
weight: overrideItem.weight,
|
|
419
|
+
important: overrideItem.important,
|
|
420
|
+
importantNative: overrideItem.importantNative,
|
|
421
|
+
value: overrideItem.value,
|
|
422
|
+
transformClassName: overrideItem.transformClassName,
|
|
423
|
+
token: overrideItem.token,
|
|
424
|
+
selector: overrideItem.selector,
|
|
425
|
+
atRule,
|
|
426
|
+
callsite: overrideItem.callsite ?? callsite,
|
|
427
|
+
debug: overrideItem.debug,
|
|
428
|
+
debugField: overrideItem.debugField,
|
|
429
|
+
parentSelector
|
|
430
|
+
};
|
|
431
|
+
value = scopeItem.value;
|
|
432
|
+
weight = scopeItem.weight;
|
|
433
|
+
important = scopeItem.important;
|
|
434
|
+
dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, parentSelector, scopeItem.atRule, scopeItem.importantNative);
|
|
435
|
+
className = getAtomicClassName(scopeItem.property, weight, important, 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, CSS_CONFIG.sheetClassNameFormat ?? null, null, scopeItem.importantNative);
|
|
436
|
+
scopeItem.dedupe = dedupe;
|
|
437
|
+
scopeItem.className = className;
|
|
438
|
+
const lookupKey = getScopeLookupKey(slotId, dedupe);
|
|
439
|
+
lookupIndex = lookup[lookupKey];
|
|
440
|
+
if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
|
|
441
|
+
else lookup[lookupKey] = styles.push(scopeItem) - 1;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return data;
|
|
445
|
+
}
|
|
446
|
+
function addTokenOverride(item, styles, lookup) {
|
|
447
|
+
const lookupKey = getTokenLookupKey(getStyleTokenId(item));
|
|
448
|
+
const lookupIndex = lookup[lookupKey];
|
|
449
|
+
if (typeof lookupIndex === "number") styles[lookupIndex] = item;
|
|
450
|
+
else lookup[lookupKey] = styles.push(item) - 1;
|
|
451
|
+
}
|
|
452
|
+
function getMergedScopeDebug(debug, item) {
|
|
453
|
+
if (!debug) return item.debug;
|
|
454
|
+
if (debug.fields?.[item.property]) return debug;
|
|
455
|
+
const valueLoc = getRuntimeScopeItemValueLoc(item);
|
|
456
|
+
if (!valueLoc) return debug;
|
|
457
|
+
return {
|
|
458
|
+
...debug,
|
|
459
|
+
fields: {
|
|
460
|
+
...debug.fields,
|
|
461
|
+
[item.property]: {
|
|
462
|
+
[0]: debug.loc,
|
|
463
|
+
[1]: valueLoc
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
function getRuntimeScopeItemValueLoc(item) {
|
|
469
|
+
if (item.debug && item.debugField) {
|
|
470
|
+
const loc = item.debug.fields?.[item.debugField];
|
|
471
|
+
if (Array.isArray(loc)) return withDebugSource$1(loc, item.debug.sourceUrl, item.debug.code);
|
|
472
|
+
if (loc) {
|
|
473
|
+
const valueLoc = loc[1] ?? loc[0] ?? null;
|
|
474
|
+
return valueLoc ? withDebugSource$1(valueLoc, item.debug.sourceUrl, item.debug.code) : null;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
return item.callsite ? [
|
|
478
|
+
item.callsite.line,
|
|
479
|
+
item.callsite.column,
|
|
480
|
+
void 0,
|
|
481
|
+
item.callsite.sourceUrl,
|
|
482
|
+
item.callsite.sourceContent
|
|
483
|
+
] : null;
|
|
484
|
+
}
|
|
485
|
+
function withDebugSource$1(loc, sourceUrl, sourceContent) {
|
|
486
|
+
return loc[3] ? loc : [
|
|
487
|
+
loc[0],
|
|
488
|
+
loc[1],
|
|
489
|
+
loc[2],
|
|
490
|
+
sourceUrl,
|
|
491
|
+
sourceContent
|
|
492
|
+
];
|
|
493
|
+
}
|
|
494
|
+
function getScopeLookupKey(slotId, dedupe) {
|
|
495
|
+
return slotId + "\0" + dedupe;
|
|
496
|
+
}
|
|
497
|
+
function getTokenLookupKey(tokenId) {
|
|
498
|
+
return "token\0" + tokenId;
|
|
499
|
+
}
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region style/important.ts
|
|
502
|
+
const STYLE_IMPORTANT = symbol("style.important");
|
|
503
|
+
function importantValue(value, native = false) {
|
|
504
|
+
return {
|
|
505
|
+
[STYLE_IMPORTANT]: true,
|
|
506
|
+
value,
|
|
507
|
+
native
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
function isStyleImportantValue(value) {
|
|
511
|
+
return !!value && typeof value === "object" && value[STYLE_IMPORTANT] === true;
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region style/transform.ts
|
|
515
|
+
const CLASS_NAME_VALUE = symbol("transform.classNameValue");
|
|
516
|
+
function classNameValue(value, className) {
|
|
517
|
+
return {
|
|
518
|
+
[CLASS_NAME_VALUE]: true,
|
|
519
|
+
value,
|
|
520
|
+
className
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function isClassNameValue(value) {
|
|
524
|
+
return !!value && typeof value === "object" && value[CLASS_NAME_VALUE] === true && typeof value.className === "string";
|
|
525
|
+
}
|
|
526
|
+
function styleTransform(options) {
|
|
527
|
+
return options;
|
|
528
|
+
}
|
|
529
|
+
function classNameTransform(options) {
|
|
530
|
+
return options;
|
|
531
|
+
}
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region style/valueRef.ts
|
|
534
|
+
const AT_RULE_REF = symbol("atRule.ref");
|
|
535
|
+
function createAtRuleRef(data) {
|
|
536
|
+
return {
|
|
537
|
+
[AT_RULE_REF]: true,
|
|
538
|
+
...data
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
function isAtRuleRef(value) {
|
|
542
|
+
return !!value && typeof value === "object" && value[AT_RULE_REF] === true;
|
|
543
|
+
}
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region style/weight.ts
|
|
546
|
+
const STYLE_WEIGHT = symbol("style.weight");
|
|
547
|
+
function weightValue(value, weight) {
|
|
548
|
+
return {
|
|
549
|
+
[STYLE_WEIGHT]: true,
|
|
550
|
+
value,
|
|
551
|
+
weight
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
function isStyleWeightValue(value) {
|
|
555
|
+
return !!value && typeof value === "object" && value[STYLE_WEIGHT] === true;
|
|
556
|
+
}
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region builder/data/merge/style.ts
|
|
559
|
+
function mergeBuilderData(create, callsite, source, style, debug, selector, atRule, type) {
|
|
560
|
+
if (!style) return source;
|
|
561
|
+
const [runtimeType, data, styles, lookup] = cloneData(create(callsite, source), source, debug);
|
|
562
|
+
const slotId = isSlotData(source) || isSlotOverrideData(source) ? source[BUILDER_SLOT_ID] : null;
|
|
563
|
+
const items = [];
|
|
564
|
+
let item;
|
|
565
|
+
let itemData;
|
|
566
|
+
let valueRaw;
|
|
567
|
+
let value;
|
|
568
|
+
let weight;
|
|
569
|
+
let important;
|
|
570
|
+
let importantNative;
|
|
571
|
+
let itemCallsite;
|
|
572
|
+
let className;
|
|
573
|
+
let dedupe;
|
|
574
|
+
let token;
|
|
575
|
+
let ref;
|
|
576
|
+
let transformClassName;
|
|
577
|
+
let lookupIndex;
|
|
578
|
+
if (isStyleData(style)) {
|
|
579
|
+
const stylesItems = style[BUILDER_STATE].items;
|
|
580
|
+
for (let i = 0, len = stylesItems.length; i < len; i++) {
|
|
581
|
+
item = stylesItems[i];
|
|
582
|
+
if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 1) {
|
|
583
|
+
logInvalidData("invalid style data", {
|
|
584
|
+
item,
|
|
585
|
+
style
|
|
586
|
+
});
|
|
587
|
+
continue;
|
|
588
|
+
}
|
|
589
|
+
if (atRule) item = Object.assign({}, item, { atRule: item.atRule ? atRule.concat(item.atRule) : atRule });
|
|
590
|
+
if (selector) item = Object.assign({}, item, { selector: item.selector ? combineSelectors(selector, item.selector) : selector });
|
|
591
|
+
if (type === 2 && slotId !== null) item = Object.assign({}, item, {
|
|
592
|
+
type: 2,
|
|
593
|
+
slotId
|
|
594
|
+
});
|
|
595
|
+
else if (type === 3 && slotId !== null) item = Object.assign({}, item, {
|
|
596
|
+
type: 3,
|
|
597
|
+
slotId
|
|
598
|
+
});
|
|
599
|
+
else if (type === 8) item = Object.assign({}, item, { type: 1 });
|
|
600
|
+
const itemDebug = getMergedStyleDebug(debug, item);
|
|
601
|
+
const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);
|
|
602
|
+
if (debugCallsite) item = Object.assign({}, item, {
|
|
603
|
+
callsite: debugCallsite,
|
|
604
|
+
debug: itemDebug,
|
|
605
|
+
debugField: item.property
|
|
606
|
+
});
|
|
607
|
+
items.push(item);
|
|
608
|
+
}
|
|
609
|
+
} else for (const property in style) {
|
|
610
|
+
valueRaw = style[property];
|
|
611
|
+
[valueRaw, weight, important, importantNative] = unwrapAuthoredStyleValue(valueRaw);
|
|
612
|
+
const sourceType = source[BUILDER_TYPE];
|
|
613
|
+
checkImportantUsage(valueRaw, important, sourceType === 9 || sourceType === 8);
|
|
614
|
+
transformClassName = null;
|
|
615
|
+
if (isClassNameValue(valueRaw)) {
|
|
616
|
+
transformClassName = valueRaw.className;
|
|
617
|
+
valueRaw = valueRaw.value;
|
|
618
|
+
}
|
|
619
|
+
ref = isAtRuleRef(valueRaw) ? valueRaw : null;
|
|
620
|
+
if (ref) valueRaw = ref.value;
|
|
621
|
+
token = isStyleTokenData(valueRaw) ? valueRaw : null;
|
|
622
|
+
value = token ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null) : String(valueRaw ?? "");
|
|
623
|
+
itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;
|
|
624
|
+
itemData = {
|
|
625
|
+
runtime: runtimeType,
|
|
626
|
+
debug,
|
|
627
|
+
debugField: property,
|
|
628
|
+
dedupe: "",
|
|
629
|
+
className: "",
|
|
630
|
+
property,
|
|
631
|
+
weight,
|
|
632
|
+
important,
|
|
633
|
+
importantNative,
|
|
634
|
+
value,
|
|
635
|
+
transformClassName,
|
|
636
|
+
variable: ref ? [3, ref] : void 0,
|
|
637
|
+
token,
|
|
638
|
+
selector,
|
|
639
|
+
atRule,
|
|
640
|
+
callsite: itemCallsite
|
|
641
|
+
};
|
|
642
|
+
if (type === 1 || type === 8) {
|
|
643
|
+
items.push({
|
|
644
|
+
...itemData,
|
|
645
|
+
type: 1
|
|
646
|
+
});
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
if (slotId === null) {
|
|
650
|
+
logInvalidData("invalid style data", {
|
|
651
|
+
property,
|
|
652
|
+
style
|
|
653
|
+
});
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
if (type === 2) {
|
|
657
|
+
items.push({
|
|
658
|
+
...itemData,
|
|
659
|
+
type: 2,
|
|
660
|
+
slotId
|
|
661
|
+
});
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
664
|
+
if (type === 3) {
|
|
665
|
+
items.push({
|
|
666
|
+
...itemData,
|
|
667
|
+
type: 3,
|
|
668
|
+
slotId
|
|
669
|
+
});
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
logInvalidData("invalid style data", {
|
|
673
|
+
property,
|
|
674
|
+
style
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
if (!items.length) return data;
|
|
678
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
679
|
+
item = items[i];
|
|
680
|
+
if (Array.isArray(item) || isStyleTokenOverrideData(item)) {
|
|
681
|
+
logInvalidData("invalid style data", {
|
|
682
|
+
item,
|
|
683
|
+
style
|
|
684
|
+
});
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
const runtimeItem = item;
|
|
688
|
+
value = runtimeItem.value;
|
|
689
|
+
weight = runtimeItem.weight;
|
|
690
|
+
important = runtimeItem.important;
|
|
691
|
+
dedupe = getClassNameDedupe(runtimeItem.property, weight, important, runtimeItem.selector, null, runtimeItem.atRule, runtimeItem.importantNative);
|
|
692
|
+
className = getAtomicClassName(runtimeItem.property, weight, important, 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, CSS_CONFIG.sheetClassNameFormat ?? null, null, runtimeItem.importantNative);
|
|
693
|
+
runtimeItem.dedupe = dedupe;
|
|
694
|
+
runtimeItem.className = className;
|
|
695
|
+
lookupIndex = lookup[dedupe];
|
|
696
|
+
if (typeof lookupIndex === "number") styles[lookupIndex] = runtimeItem;
|
|
697
|
+
else lookup[dedupe] = styles.push(runtimeItem) - 1;
|
|
698
|
+
}
|
|
699
|
+
return data;
|
|
700
|
+
}
|
|
701
|
+
function unwrapAuthoredStyleValue(value) {
|
|
702
|
+
let weight = null;
|
|
703
|
+
let important = false;
|
|
704
|
+
let native = false;
|
|
705
|
+
while (true) {
|
|
706
|
+
if (isStyleImportantValue(value)) {
|
|
707
|
+
important = true;
|
|
708
|
+
native ||= value.native === true;
|
|
709
|
+
value = value.value;
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
if (isStyleWeightValue(value)) {
|
|
713
|
+
weight = value.weight;
|
|
714
|
+
value = value.value;
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
return [
|
|
720
|
+
value,
|
|
721
|
+
weight,
|
|
722
|
+
important,
|
|
723
|
+
native
|
|
724
|
+
];
|
|
725
|
+
}
|
|
726
|
+
function checkImportantUsage(value, important, isSheet) {
|
|
727
|
+
const options = CHECK_CONFIG.important;
|
|
728
|
+
if (!options) return;
|
|
729
|
+
if (typeof value === "string" && /!\s*important\b/i.test(value)) reportImportantCheck(options.rawValue, "Do not write raw \"!important\" values. Wrap the value with style.important(...) instead.");
|
|
730
|
+
if (important && !isSheet) reportImportantCheck(options.outsideSheet, "style.important(...) outside createSheet is discouraged. Prefer style.weight(...) for Fluentic style priority.");
|
|
731
|
+
}
|
|
732
|
+
function reportImportantCheck(level, message) {
|
|
733
|
+
if (!level) return;
|
|
734
|
+
if (level === "error") throw new Error(message);
|
|
735
|
+
if (DEV_CONFIG.isDev) console.warn("[fluentic-style] " + message);
|
|
736
|
+
}
|
|
737
|
+
function combineSelectors(parent, child) {
|
|
738
|
+
const parentText = getSelectorText(parent);
|
|
739
|
+
const childText = getSelectorText(child);
|
|
740
|
+
const priority = Math.max(getSelectorPriority(parent), getSelectorPriority(child));
|
|
741
|
+
const selector = parentText + childText;
|
|
742
|
+
return priority > 0 ? [selector, priority] : selector;
|
|
743
|
+
}
|
|
744
|
+
function getSelectorText(selector) {
|
|
745
|
+
return Array.isArray(selector) ? selector[0] : selector;
|
|
746
|
+
}
|
|
747
|
+
function getSelectorPriority(selector) {
|
|
748
|
+
return Array.isArray(selector) ? selector[1] : 0;
|
|
749
|
+
}
|
|
750
|
+
function getMergedStyleDebug(debug, item) {
|
|
751
|
+
if (!debug) return null;
|
|
752
|
+
if (debug.fields?.[item.property]) return debug;
|
|
753
|
+
const valueLoc = getMergedItemValueLoc(item);
|
|
754
|
+
if (!valueLoc) return debug;
|
|
755
|
+
return {
|
|
756
|
+
...debug,
|
|
757
|
+
fields: {
|
|
758
|
+
...debug.fields,
|
|
759
|
+
[item.property]: {
|
|
760
|
+
[0]: withDebugSource(debug.loc, debug),
|
|
761
|
+
[1]: valueLoc
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
function getMergedItemValueLoc(item) {
|
|
767
|
+
if (item.debug && item.debugField) {
|
|
768
|
+
const loc = item.debug.fields?.[item.debugField];
|
|
769
|
+
if (Array.isArray(loc)) return withDebugSource(loc, item.debug);
|
|
770
|
+
if (loc) {
|
|
771
|
+
const traceLoc = loc[1] ?? loc[0] ?? null;
|
|
772
|
+
return traceLoc ? withDebugSource(traceLoc, item.debug) : null;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return item.callsite ? [
|
|
776
|
+
item.callsite.line,
|
|
777
|
+
item.callsite.column,
|
|
778
|
+
void 0,
|
|
779
|
+
item.callsite.sourceUrl,
|
|
780
|
+
item.callsite.sourceContent
|
|
781
|
+
] : null;
|
|
782
|
+
}
|
|
783
|
+
function withDebugSource(loc, debug) {
|
|
784
|
+
return loc[3] ? loc : [
|
|
785
|
+
loc[0],
|
|
786
|
+
loc[1],
|
|
787
|
+
loc[2],
|
|
788
|
+
debug.sourceUrl,
|
|
789
|
+
debug.code
|
|
790
|
+
];
|
|
791
|
+
}
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region builder/data/selector.ts
|
|
794
|
+
const SELECTOR_MEDIA = "@media";
|
|
795
|
+
const SELECTOR_CONTAINER = "@container";
|
|
796
|
+
function normalizeSelectorArg(arg) {
|
|
797
|
+
return arg.includes("\n") ? arg.replace(/\n/g, "") : arg;
|
|
798
|
+
}
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region builder/style_data.ts
|
|
801
|
+
const mergeStyleCreate = (callsite) => {
|
|
802
|
+
return createStyleData(callsite);
|
|
803
|
+
};
|
|
804
|
+
const mergeStyleData = createMerge(mergeStyleCreate, 1);
|
|
805
|
+
const mergeSheetCreate = (callsite, data) => {
|
|
806
|
+
return createSheetData(callsite, data[BUILDER_SHEET_OPTIONS]);
|
|
807
|
+
};
|
|
808
|
+
const mergeSheetData = createMerge(mergeSheetCreate, 1);
|
|
809
|
+
const mergeSlotCreate = (callsite, data) => {
|
|
810
|
+
return createSlotData(callsite, data[BUILDER_SLOT_ID]);
|
|
811
|
+
};
|
|
812
|
+
const mergeSlotData = createMerge(mergeSlotCreate, 2);
|
|
813
|
+
const mergeSlotOverrideCreate = (callsite, data) => {
|
|
814
|
+
return createSlotOverrideData(callsite, data[BUILDER_SLOT_ID]);
|
|
815
|
+
};
|
|
816
|
+
const mergeSlotOverrideData = createMerge(mergeSlotOverrideCreate, 3);
|
|
817
|
+
const mergeSelectorOverrideCreate = (callsite, data) => {
|
|
818
|
+
return createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]);
|
|
819
|
+
};
|
|
820
|
+
const mergeSelectorOverrideData = createMerge(mergeSelectorOverrideCreate, 8);
|
|
821
|
+
function createMerge(create, type) {
|
|
822
|
+
return (data, callsite, style, debug, selector, atRule) => {
|
|
823
|
+
return mergeBuilderData(create, callsite, data, style, debug, selector, atRule, type);
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
//#endregion
|
|
827
|
+
//#region builder/utils.ts
|
|
828
|
+
const FnPrefixStyle = "style.";
|
|
829
|
+
const FnPrefixSlot = "slot.";
|
|
830
|
+
const FnPrefixScope = "scope.";
|
|
831
|
+
const FnPrefixSelector = "selector.";
|
|
832
|
+
function runtimeCallsite() {
|
|
833
|
+
return traceCallsite();
|
|
834
|
+
}
|
|
835
|
+
function resolveCallsite(debug) {
|
|
836
|
+
return debug ? getDebugCallsite(debug) : runtimeCallsite();
|
|
837
|
+
}
|
|
838
|
+
function transformStyle(style, transform) {
|
|
839
|
+
return transform ? transform.transform(style) : style;
|
|
840
|
+
}
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region builder/selector_override_core.ts
|
|
843
|
+
function normalizeManualSelectors(input, assertManualSelector) {
|
|
844
|
+
const selectors = Array.isArray(input) ? input : [input];
|
|
845
|
+
if (!selectors.length) throw new Error("selector array cannot be empty");
|
|
846
|
+
return selectors.flatMap((selector) => normalizeManualSelector(selector, assertManualSelector));
|
|
847
|
+
}
|
|
848
|
+
function assertManualSelectorSyntax(selector) {
|
|
849
|
+
if (!selector) throw new Error("selector cannot be empty");
|
|
850
|
+
if (selector.includes("{") || selector.includes("}")) throw new Error("selector must not contain \"{\" or \"}\"");
|
|
851
|
+
if (selector.includes(",")) throw new Error("selector must not contain \",\"; use an array of selectors instead");
|
|
852
|
+
const ampersandIndex = selector.indexOf("&");
|
|
853
|
+
if (ampersandIndex > 0) throw new Error("selector can only use \"&\" at the beginning");
|
|
854
|
+
const ampersandSelector = selector.startsWith("&?") ? selector.slice(2) : selector.slice(1);
|
|
855
|
+
if (ampersandIndex === 0 && ampersandSelector && /^\s/.test(ampersandSelector)) throw new Error("selector cannot have whitespace after \"&\"; omit \"&\" for descendant selectors");
|
|
856
|
+
}
|
|
857
|
+
function setSheetSelectorOptions(selector, options) {
|
|
858
|
+
if (options.specificity === void 0 && options.layer === void 0) return selector;
|
|
859
|
+
const text = Array.isArray(selector) ? selector[0] : selector;
|
|
860
|
+
const weighted = SHEET_SELECTOR_ANCHOR + (":" + (options.specificity ?? "") + ":" + (typeof options.layer === "string" ? JSON.stringify(options.layer) : options.layer === void 0 ? "" : options.layer ? "1" : "0")) + "\0" + text.slice(SHEET_SELECTOR_ANCHOR.length);
|
|
861
|
+
return Array.isArray(selector) ? [weighted, selector[1]] : weighted;
|
|
862
|
+
}
|
|
863
|
+
function normalizeManualSelector(selector, assertManualSelector) {
|
|
864
|
+
const value = selector.trim();
|
|
865
|
+
assertManualSelector(value);
|
|
866
|
+
if (value.startsWith("&?")) {
|
|
867
|
+
const suffix = value.slice(2);
|
|
868
|
+
return suffix ? [SHEET_SELECTOR_ANCHOR + suffix, SHEET_SELECTOR_ANCHOR + " " + suffix] : [SHEET_SELECTOR_ANCHOR];
|
|
869
|
+
}
|
|
870
|
+
return [SHEET_SELECTOR_ANCHOR + (value.startsWith("&") ? value.slice(1) : " " + value)];
|
|
871
|
+
}
|
|
872
|
+
/** Convert a normalized explicit selector into an unscoped sheet selector. */
|
|
873
|
+
function setGlobalSheetSelectorOptions(selector, options) {
|
|
874
|
+
const suffix = (Array.isArray(selector) ? selector[0] : selector).slice(SHEET_SELECTOR_ANCHOR.length);
|
|
875
|
+
if (!suffix.startsWith(" ") || !suffix.trim()) throw new Error("createGlobalSheet requires explicit selectors without an ampersand anchor");
|
|
876
|
+
const global = GLOBAL_SHEET_SELECTOR_ANCHOR + JSON.stringify(options.layer ?? null) + "\0" + suffix.trimStart();
|
|
877
|
+
return Array.isArray(selector) ? [global, selector[1]] : global;
|
|
878
|
+
}
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region css/sheet.ts
|
|
881
|
+
function createSheet(optionsOrItems, itemsOrDebug, debug) {
|
|
882
|
+
const hasOptions = arguments.length >= 2 && !isDebugData(itemsOrDebug);
|
|
883
|
+
return buildSheet(hasOptions ? optionsOrItems : {}, hasOptions ? itemsOrDebug : optionsOrItems, hasOptions ? debug : itemsOrDebug);
|
|
884
|
+
}
|
|
885
|
+
function buildSheet(options, items, resolvedDebug, global = false) {
|
|
886
|
+
assertCreateSheetOptions(options);
|
|
887
|
+
const callsite = resolveCallsite(resolvedDebug);
|
|
888
|
+
let data = createSheetData(callsite, options);
|
|
889
|
+
if (items) data = mergeSheetItems(data, callsite, items, global);
|
|
890
|
+
return data;
|
|
891
|
+
}
|
|
892
|
+
function mergeSheetItems(data, callsite, items, global = false) {
|
|
893
|
+
if (!items) return data;
|
|
894
|
+
if (Array.isArray(items)) {
|
|
895
|
+
let next = data;
|
|
896
|
+
for (let i = 0, len = items.length; i < len; i++) next = mergeSheetItems(next, callsite, items[i], global);
|
|
897
|
+
return next;
|
|
898
|
+
}
|
|
899
|
+
if (isStyleTokenOverrideData(items)) {
|
|
900
|
+
if (global) throw new Error("createGlobalSheet requires token overrides inside an explicit selector");
|
|
901
|
+
addSheetTokenOverride(data, items);
|
|
902
|
+
return data;
|
|
903
|
+
}
|
|
904
|
+
if (!isSelectorData(items) && !isSelectorOverrideData(items)) throw new Error("createSheet(items) requires selector items from style.selector(...) or token overrides");
|
|
905
|
+
const selectorItem = items;
|
|
906
|
+
const selectors = getSelectorSelectors(selectorItem);
|
|
907
|
+
const options = data[BUILDER_SHEET_OPTIONS];
|
|
908
|
+
let next = data;
|
|
909
|
+
const sheetSelectors = selectors.map((selector) => global ? setGlobalSheetSelectorOptions(selector, options) : setSheetSelectorOptions(selector, options));
|
|
910
|
+
if (isSelectorData(selectorItem)) return next;
|
|
911
|
+
for (let i = 0, len = selectors.length; i < len; i++) next = mergeSheetData(next, callsite, getSelectorItemStyleData(selectorItem), null, sheetSelectors[i], null);
|
|
912
|
+
return next;
|
|
913
|
+
}
|
|
914
|
+
function assertCreateSheetOptions(options) {
|
|
915
|
+
if (!options || typeof options !== "object" || Object.keys(options).some((key) => key !== "layer" && key !== "specificity")) throw new Error("createSheet only supports layer and specificity options");
|
|
916
|
+
if (!isSheetLayerOption(options.layer)) throw new Error("createSheet options.layer must be a boolean or a valid layer name");
|
|
917
|
+
if (options.specificity !== void 0 && (!Number.isInteger(options.specificity) || options.specificity < 0)) throw new Error("createSheet options.specificity must be a non-negative integer");
|
|
918
|
+
}
|
|
919
|
+
function addSheetTokenOverride(data, item) {
|
|
920
|
+
const state = data[BUILDER_STATE];
|
|
921
|
+
const lookup = state.lookup ??= {};
|
|
922
|
+
const lookupKey = getSheetTokenLookupKey(getStyleTokenId(item));
|
|
923
|
+
const lookupIndex = lookup[lookupKey];
|
|
924
|
+
if (typeof lookupIndex === "number") state.items[lookupIndex] = item;
|
|
925
|
+
else lookup[lookupKey] = state.items.push(item) - 1;
|
|
926
|
+
}
|
|
927
|
+
function getSelectorItemStyleData(data) {
|
|
928
|
+
return {
|
|
929
|
+
[BUILDER_TYPE]: 1,
|
|
930
|
+
[BUILDER_STATE]: data[BUILDER_STATE],
|
|
931
|
+
[BUILDER_CALLSITE]: data[BUILDER_CALLSITE]
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function getSheetTokenLookupKey(tokenId) {
|
|
935
|
+
return "token\0" + tokenId;
|
|
936
|
+
}
|
|
937
|
+
//#endregion
|
|
938
|
+
//#region css/globalSheet.ts
|
|
939
|
+
function createGlobalSheet$1(optionsOrItems, items, debug) {
|
|
940
|
+
const rules = buildGlobalSheetRules(optionsOrItems, items, debug, arguments.length >= 2 && !isDebugData(items));
|
|
941
|
+
const sheet = getGlobalSheet();
|
|
942
|
+
sheet.updateLayers(CSS_CONFIG.layers ?? CSS_CONFIG_DEFAULT.layers ?? []);
|
|
943
|
+
for (const rule of rules) sheet.insert(rule);
|
|
944
|
+
sheet.flush();
|
|
945
|
+
}
|
|
946
|
+
function buildGlobalSheetRules(optionsOrItems, items, debug, hasOptions = arguments.length >= 2 && !isDebugData(items)) {
|
|
947
|
+
const options = hasOptions ? optionsOrItems : {};
|
|
948
|
+
if (!options || typeof options !== "object" || Object.keys(options).some((key) => key !== "layer" && key !== "order")) throw new Error("createGlobalSheet only supports layer and order options");
|
|
949
|
+
if (options.order !== void 0 && !Number.isFinite(options.order)) throw new Error("createGlobalSheet order must be a finite number");
|
|
950
|
+
const data = buildSheet({ layer: options.layer }, hasOptions ? items : optionsOrItems, isDebugData(items) ? items : debug, true);
|
|
951
|
+
const rules = collectStylePropSheetRules(data);
|
|
952
|
+
const site = isDebugData(items) || debug ? data[BUILDER_CALLSITE] : null;
|
|
953
|
+
const id = hashString(JSON.stringify(site ? [
|
|
954
|
+
site.filePath,
|
|
955
|
+
site.line,
|
|
956
|
+
site.column
|
|
957
|
+
] : [options, rules.map((rule) => rule.css)]));
|
|
958
|
+
const globals = [];
|
|
959
|
+
for (const rule of rules) globals.push({
|
|
960
|
+
...rule,
|
|
961
|
+
key: id + ":" + rule.key,
|
|
962
|
+
globalSheet: {
|
|
963
|
+
id,
|
|
964
|
+
order: options.order ?? 0
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
return globals;
|
|
968
|
+
}
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region runtime/core/createTransformElement.ts
|
|
971
|
+
function createTransformElement(getClassName) {
|
|
972
|
+
return ({ type, props }) => {
|
|
973
|
+
if (!props || typeof type !== "string") return {
|
|
974
|
+
type,
|
|
975
|
+
props
|
|
976
|
+
};
|
|
977
|
+
if (!hasOwn(props, "css")) return {
|
|
978
|
+
type,
|
|
979
|
+
props
|
|
980
|
+
};
|
|
981
|
+
const { css, ...rest } = props;
|
|
982
|
+
if (!css) return {
|
|
983
|
+
type,
|
|
984
|
+
props: rest
|
|
985
|
+
};
|
|
986
|
+
const marker = splitElementMarkerStyleProp(css);
|
|
987
|
+
if (marker.styleProp) Object.assign(rest, getClassName(marker.styleProp, rest));
|
|
988
|
+
prependClassName(rest, createElementMarkerClassName(marker.debug));
|
|
989
|
+
return {
|
|
990
|
+
type,
|
|
991
|
+
props: rest
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function prependClassName(props, className) {
|
|
996
|
+
if (!className) return;
|
|
997
|
+
props.className = props.className ? `${className} ${props.className}` : className;
|
|
998
|
+
}
|
|
999
|
+
//#endregion
|
|
1000
|
+
//#region runtime/rsc/globalSheet.ts
|
|
1001
|
+
const seedComponent = globalData("runtime.rsc.global.seedComponent", () => ({ current: null }));
|
|
1002
|
+
/** Registered only by the Next loader, keeping the core RSC runtime framework-neutral. */
|
|
1003
|
+
function setGlobalSheetSeedComponent(component) {
|
|
1004
|
+
seedComponent.current = component;
|
|
1005
|
+
}
|
|
1006
|
+
const modules = globalData("runtime.rsc.global.modules", () => /* @__PURE__ */ new Map());
|
|
1007
|
+
const requestRegistry = globalData("runtime.rsc.global.request", () => cache(() => /* @__PURE__ */ new Map()));
|
|
1008
|
+
const delivered = globalData("runtime.rsc.global.delivered", () => cache(() => /* @__PURE__ */ new Map()));
|
|
1009
|
+
function resetGlobalSheetModule(filePath) {
|
|
1010
|
+
if (!IS_SERVER_RUNTIME) return;
|
|
1011
|
+
if (modules.has(filePath)) modules.set(filePath, []);
|
|
1012
|
+
}
|
|
1013
|
+
const createGlobalSheet = (...args) => {
|
|
1014
|
+
if (!IS_SERVER_RUNTIME) {
|
|
1015
|
+
createGlobalSheet$1(...args);
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
const debug = isDebugData(args[1]) ? args[1] : args[2];
|
|
1019
|
+
const rules = buildGlobalSheetRules(...args);
|
|
1020
|
+
if (debug?.globalModule) {
|
|
1021
|
+
const existing = modules.get(debug.globalModule) ?? [];
|
|
1022
|
+
modules.set(debug.globalModule, [...existing, ...rules]);
|
|
1023
|
+
} else {
|
|
1024
|
+
const owner = "request:" + (debug ? debug.sourceUrl + ":" + debug.loc.join(":") : rules[0]?.key ?? "empty");
|
|
1025
|
+
requestRegistry().set(owner, rules);
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
function getGlobalRuleBatches() {
|
|
1029
|
+
return [...modules, ...requestRegistry()].map(([owner, rules]) => ({
|
|
1030
|
+
owner,
|
|
1031
|
+
revision: hashString(JSON.stringify(rules)),
|
|
1032
|
+
rules
|
|
1033
|
+
}));
|
|
1034
|
+
}
|
|
1035
|
+
function serializeGlobalRuleBatches(batches) {
|
|
1036
|
+
return JSON.stringify(batches).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
1037
|
+
}
|
|
1038
|
+
function GlobalSheetPayload() {
|
|
1039
|
+
const cursor = delivered();
|
|
1040
|
+
return renderGlobalRuleBatches(getGlobalRuleBatches().filter((batch) => {
|
|
1041
|
+
if (cursor.get(batch.owner) === batch.revision) return false;
|
|
1042
|
+
cursor.set(batch.owner, batch.revision);
|
|
1043
|
+
return true;
|
|
1044
|
+
}));
|
|
1045
|
+
}
|
|
1046
|
+
function renderGlobalRuleBatches(batches) {
|
|
1047
|
+
if (!batches.length) return null;
|
|
1048
|
+
const payload = serializeGlobalRuleBatches(batches);
|
|
1049
|
+
const current = new Map(getGlobalRuleBatches().map((batch) => [batch.owner, batch]));
|
|
1050
|
+
for (const batch of batches) current.set(batch.owner, batch);
|
|
1051
|
+
const allBatches = [...current.values()];
|
|
1052
|
+
const css = serializeRscRules([...getRscStyleRules(), ...allBatches.flatMap((batch) => batch.rules)]);
|
|
1053
|
+
const id = hashString(payload + css);
|
|
1054
|
+
return createElement(Fragment, null, seedComponent.current ? createElement(seedComponent.current, {
|
|
1055
|
+
globalRules: allBatches,
|
|
1056
|
+
seedOnly: true
|
|
1057
|
+
}) : null, createElement("style", {
|
|
1058
|
+
[GLOBAL_SEED_ATTR]: id,
|
|
1059
|
+
href: "fluentic-global-" + id,
|
|
1060
|
+
precedence: "default",
|
|
1061
|
+
dangerouslySetInnerHTML: { __html: css.replace(/<\/style/gi, "<\\/style") },
|
|
1062
|
+
suppressHydrationWarning: true
|
|
1063
|
+
}), createElement("script", {
|
|
1064
|
+
type: "application/json",
|
|
1065
|
+
async: true,
|
|
1066
|
+
[GLOBAL_RULES_ATTR]: id,
|
|
1067
|
+
dangerouslySetInnerHTML: { __html: payload },
|
|
1068
|
+
suppressHydrationWarning: true
|
|
1069
|
+
}));
|
|
1070
|
+
}
|
|
1071
|
+
function withGlobalSheetPayload(element, type) {
|
|
1072
|
+
if (!IS_SERVER_RUNTIME || !DEV_CONFIG.isDev || typeof type === "string" && [
|
|
1073
|
+
"html",
|
|
1074
|
+
"head",
|
|
1075
|
+
"style",
|
|
1076
|
+
"script",
|
|
1077
|
+
"meta",
|
|
1078
|
+
"link",
|
|
1079
|
+
"title"
|
|
1080
|
+
].includes(type)) return element;
|
|
1081
|
+
if (typeof type === "string" && !modules.size && !requestRegistry().size) return element;
|
|
1082
|
+
if (type === "body") {
|
|
1083
|
+
const props = element.props;
|
|
1084
|
+
return cloneElement(element, {}, createElement(GlobalSheetPayload), props.children);
|
|
1085
|
+
}
|
|
1086
|
+
return createElement(Fragment, element.key == null ? null : { key: element.key }, typeof type === "string" ? createElement(GlobalSheetPayload) : element, typeof type === "string" ? element : createElement(GlobalSheetPayload));
|
|
1087
|
+
}
|
|
1088
|
+
//#endregion
|
|
1089
|
+
export { styleTransform as A, createStyleData as B, weightValue as C, classNameTransform as D, isAtRuleRef as E, createScopeTargetData as F, createSelectorData as I, createSelectorOverrideData as L, isStyleImportantValue as M, mergeScopeData as N, classNameValue as O, createScopeData as P, createSlotData as R, isStyleWeightValue as S, createAtRuleRef as T, createThemeData as V, mergeSlotOverrideData as _, createTransformElement as a, SELECTOR_MEDIA as b, normalizeManualSelectors as c, FnPrefixSlot as d, FnPrefixStyle as f, mergeSlotData as g, mergeSelectorOverrideData as h, withGlobalSheetPayload as i, importantValue as j, isClassNameValue as k, FnPrefixScope as l, transformStyle as m, resetGlobalSheetModule as n, createSheet as o, resolveCallsite as p, setGlobalSheetSeedComponent as r, assertManualSelectorSyntax as s, createGlobalSheet as t, FnPrefixSelector as u, mergeStyleData as v, AT_RULE_REF as w, normalizeSelectorArg as x, SELECTOR_CONTAINER as y, createSlotOverrideData as z };
|
|
1090
|
+
|
|
1091
|
+
//# sourceMappingURL=globalSheet-2ozCV1Zm.js.map
|