@fluentic/style 0.1.0-beta.4 → 0.1.0-beta.5
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 +42 -1
- package/README.md +10 -9
- package/atomic/className.ts +10 -4
- package/atomic/debug/className/className.ts +10 -0
- package/atomic/rule.ts +6 -3
- package/atomic/utils/selector.ts +14 -1
- 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 +6 -0
- package/builder/data/create.ts +42 -0
- package/builder/data/data.ts +20 -1
- package/builder/data/index.ts +0 -1
- package/builder/data/is.ts +23 -0
- package/builder/data/merge/scope.ts +20 -19
- package/builder/data/merge/style.ts +70 -20
- package/builder/data/state.ts +16 -2
- package/builder/extract/index.ts +1 -0
- package/builder/extract/sheet.ts +26 -0
- 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 +30 -0
- package/builder/selector_override_core.ts +66 -0
- package/builder/style_builder.ts +127 -3
- package/builder/style_data.ts +24 -0
- package/builder/style_fns.ts +24 -24
- 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/compiler.ts +4 -7
- package/compiler/compiler/constants.ts +6 -0
- package/compiler/compiler/index.ts +1 -0
- package/compiler/compiler/types.ts +2 -0
- package/compiler/cssProp.ts +35 -0
- package/compiler/index.ts +1 -0
- package/compiler/transform/cssProp/index.ts +1 -0
- package/compiler/transform/cssProp/plugin.ts +129 -0
- package/compiler/transform/debug/plugin.ts +6 -0
- package/compiler/transform/debug/transform.ts +2 -1
- package/compiler/transform/evaluator/evaluator.ts +32 -4
- package/compiler/transform/evaluator/tracer.ts +30 -2
- package/compiler/transform/extract/chain/chain.ts +540 -62
- package/compiler/transform/extract/chain/extract_chain.ts +12 -4
- package/compiler/transform/extract/chain/types.ts +1 -1
- package/compiler/transform/extract/plugin.ts +20 -4
- package/compiler/transform/extract/transform.ts +2 -1
- package/compiler/transform/extract/utils/replacement.ts +47 -2
- package/compiler/transform/extract/utils/state.ts +2 -0
- package/compiler/transform/index.ts +1 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
- package/compiler/utils/constants.ts +8 -1
- package/compiler/utils/imports.ts +11 -1
- package/config/config/css.ts +1 -0
- package/css/index.ts +2 -0
- package/css/sheet.ts +119 -0
- package/css/styleTarget.ts +251 -0
- package/dist/adapter/preact.js +2 -0
- package/dist/adapter/react.js +2 -0
- package/dist/adapter/solid.js +2 -0
- package/dist/className-hiAsQ9V6.js +303 -0
- package/dist/className-hiAsQ9V6.js.map +1 -0
- package/dist/combine-Ca6LfFxv.js +1279 -0
- package/dist/combine-Ca6LfFxv.js.map +1 -0
- package/dist/compiler/index.mjs +2 -2
- package/dist/{compiler-CE0ZgkdH.mjs → compiler-OgDBuqfs.mjs} +1427 -546
- package/dist/compiler-OgDBuqfs.mjs.map +1 -0
- package/dist/config-B-KbXpIh.js +6 -0
- package/dist/{config-oKOjOTWi.js.map → config-B-KbXpIh.js.map} +1 -1
- package/dist/config-Barf8f4B.js +35 -0
- package/dist/config-Barf8f4B.js.map +1 -0
- package/dist/{config-lJNLh7eM.js → config-CsB4MuFI.js} +2 -2
- package/dist/{config-lJNLh7eM.js.map → config-CsB4MuFI.js.map} +1 -1
- package/dist/config-DOWSNV8w.js +1 -0
- package/dist/{config-CduqubI8.js → config-t76UljYv.js} +3 -3
- package/dist/config-t76UljYv.js.map +1 -0
- package/dist/createTransformElement-DDqld3RF.js +34 -0
- package/dist/createTransformElement-DDqld3RF.js.map +1 -0
- package/dist/css-CZwrac6F.js +3923 -0
- package/dist/css-CZwrac6F.js.map +1 -0
- package/dist/css-GtUPEO9U.js.map +1 -1
- package/dist/css-YfHN_8Nk.js +479 -0
- package/dist/css-YfHN_8Nk.js.map +1 -0
- package/dist/css-a9O5so0b.js +1246 -0
- package/dist/css-a9O5so0b.js.map +1 -0
- package/dist/css.js +2 -2
- package/dist/{css_extra-DYtS3g6Z.js → css_extra-CXXZAylc.js} +2 -2
- package/dist/{css_extra-DYtS3g6Z.js.map → css_extra-CXXZAylc.js.map} +1 -1
- package/dist/{data-D7NFt4JG.js → data-CzHJg147.js} +145 -59
- package/dist/data-CzHJg147.js.map +1 -0
- package/dist/{debug-Cvpo5cVu.js → debug-DkrxyknP.js} +80 -5
- package/dist/debug-DkrxyknP.js.map +1 -0
- package/dist/dev/rsc.js +5 -8
- package/dist/dev/rsc.js.map +1 -1
- package/dist/{dev-DdRWa6dJ.js → dev-z4laBwlS.js} +4 -4
- package/dist/{dev-DdRWa6dJ.js.map → dev-z4laBwlS.js.map} +1 -1
- package/dist/dev.js +1 -1
- package/dist/dialect/extracted/index.js +1 -1
- package/dist/dialect/index.js +1 -1
- package/dist/{elementMarker-ng0y3fN0.js → elementMarker-CqhU_l_m.js} +94 -8
- package/dist/elementMarker-CqhU_l_m.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 +10 -8
- 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 +240 -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 -5
- package/dist/entry/prod.js +84 -1229
- package/dist/entry/prod.js.map +1 -1
- package/dist/entry/rsc-dev/adapter/preact.js +12 -0
- package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/react.js +12 -0
- package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/solid.js +12 -0
- package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +3 -3
- package/dist/entry/rsc-dev/dev.js +6 -10
- package/dist/entry/rsc-dev/dev.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
- package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
- package/dist/entry/rsc-dev.js +252 -750
- 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 -5
- package/dist/entry/rsc-prod.js +236 -11
- package/dist/entry/rsc-prod.js.map +1 -1
- package/dist/{styleStore-CajcAEPO.js → env-Db2cRt-h.js} +1185 -162
- package/dist/env-Db2cRt-h.js.map +1 -0
- package/dist/{jsx-DL-DEAz8.js → getClassName-DKtQl5ZX.js} +5 -12
- package/dist/getClassName-DKtQl5ZX.js.map +1 -0
- package/dist/{utils-B_VhPBHH.js → getClassName-DaZF5nfJ.js} +28 -65
- package/dist/getClassName-DaZF5nfJ.js.map +1 -0
- package/dist/getClassName-a6p2uMFM.js +536 -0
- package/dist/getClassName-a6p2uMFM.js.map +1 -0
- package/dist/{getClassName-CrNVjAoJ.js → getClassName-aD9zqg9U.js} +31 -10
- package/dist/getClassName-aD9zqg9U.js.map +1 -0
- package/dist/global-zYTvWskP.js +10 -0
- package/dist/{global-CZBlA9E7.js.map → global-zYTvWskP.js.map} +1 -1
- package/dist/{hash-BfeJDf5U.js → hash-BOlQThNz.js} +37 -2
- package/dist/hash-BOlQThNz.js.map +1 -0
- package/dist/index.js +7 -6
- package/dist/jsx/jsx-dev-runtime.js +2 -2
- package/dist/jsx/jsx-dev-runtime.server.js +1 -1
- package/dist/jsx/jsx-runtime.js +2 -2
- package/dist/jsx/jsx-runtime.server.js +1 -1
- package/dist/jsx-C2pnWLcb.js +39 -0
- package/dist/jsx-C2pnWLcb.js.map +1 -0
- package/dist/{jsx_dev_runtime-aAhNYDeS.js → jsx_dev_runtime-kSrmu6b1.js} +2 -3
- package/dist/{jsx_dev_runtime-aAhNYDeS.js.map → jsx_dev_runtime-kSrmu6b1.js.map} +1 -1
- package/dist/{jsx_runtime-D7Y5up6H.js → jsx_runtime-BgK90E2O.js} +2 -3
- package/dist/{jsx_runtime-D7Y5up6H.js.map → jsx_runtime-BgK90E2O.js.map} +1 -1
- package/dist/{jsx_runtime-C6i1bWlu.js → jsx_runtime-XJSHujgI.js} +2 -2
- package/dist/{jsx_runtime-C6i1bWlu.js.map → jsx_runtime-XJSHujgI.js.map} +1 -1
- package/dist/{loader-BmYS_Rju.mjs → loader-DHvgp0fK.mjs} +3 -3
- package/dist/{loader-BmYS_Rju.mjs.map → loader-DHvgp0fK.mjs.map} +1 -1
- package/dist/{misc-BIS_c7BJ.mjs → misc-BuSLnvx0.mjs} +4 -4
- package/dist/misc-BuSLnvx0.mjs.map +1 -0
- package/dist/{namedTokens-CN_yhhik.js → namedTokens-D3tt-joz.js} +3 -3
- package/dist/{namedTokens-CN_yhhik.js.map → namedTokens-D3tt-joz.js.map} +1 -1
- package/dist/plugin/farm/index.mjs +4 -3
- package/dist/plugin/farm/index.mjs.map +1 -1
- package/dist/plugin/nextjs/index.mjs +5 -5
- package/dist/plugin/nextjs/index.mjs.map +1 -1
- package/dist/plugin/nextjs/loader.mjs +4 -4
- package/dist/plugin/parcel/index.cjs +2 -0
- package/dist/plugin/parcel/index.mjs +3 -1
- package/dist/plugin/parcel/optimizer.cjs +1 -1
- package/dist/plugin/parcel/optimizer.mjs +2 -2
- 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 +6 -6
- 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 +3 -4
- 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-IaXmLQzA.mjs → registry-r3BKWqpI.mjs} +2 -2
- package/dist/{registry-IaXmLQzA.mjs.map → registry-r3BKWqpI.mjs.map} +1 -1
- package/dist/resolveClassNameRuntime-D5a37GNr.js +63 -0
- package/dist/resolveClassNameRuntime-D5a37GNr.js.map +1 -0
- package/dist/{rules-CxVzovt-.js → rules-B0_rKPfB.js} +583 -154
- package/dist/rules-B0_rKPfB.js.map +1 -0
- package/dist/{combine-C9vjpKCs.js → scope-BSuRLice.js} +239 -150
- package/dist/scope-BSuRLice.js.map +1 -0
- package/dist/selector/index.js +1 -2
- package/dist/server.js +12 -9
- package/dist/server.js.map +1 -1
- package/dist/{shared-CaJuvw03.cjs → shared-8_Msr7Q5.cjs} +1352 -466
- package/dist/shared-8_Msr7Q5.cjs.map +1 -0
- package/dist/{shared-DdPTZ0O3.mjs → shared-BGO_05rW.mjs} +4 -4
- package/dist/{shared-DdPTZ0O3.mjs.map → shared-BGO_05rW.mjs.map} +1 -1
- package/dist/sheet-BpLZIIuO.js +7 -0
- package/dist/{sheet-BWBzuy4D.js.map → sheet-BpLZIIuO.js.map} +1 -1
- package/dist/{sidecar-B3oCK9vC.mjs → sidecar-Bu2x35JE.mjs} +3 -3
- package/dist/{sidecar-B3oCK9vC.mjs.map → sidecar-Bu2x35JE.mjs.map} +1 -1
- package/dist/{styleStore-0fARJlZV.js → styleStore-BDy5TH6N.js} +3 -4
- package/dist/{styleStore-0fARJlZV.js.map → styleStore-BDy5TH6N.js.map} +1 -1
- package/dist/styleStore-DX3z_UVK.js +51 -0
- package/dist/styleStore-DX3z_UVK.js.map +1 -0
- package/dist/{token-D-S-4_mN.js → token-BsW_S8fN.js} +2 -2
- package/dist/{token-D-S-4_mN.js.map → token-BsW_S8fN.js.map} +1 -1
- package/dist/{trace-CFnhyCVf.js → trace-BdKEpgME.js} +2 -2
- package/dist/{trace-CFnhyCVf.js.map → trace-BdKEpgME.js.map} +1 -1
- package/dist/{trace-ZtgeY-8s.js → trace-DcuMxR45.js} +3 -3
- package/dist/{trace-ZtgeY-8s.js.map → trace-DcuMxR45.js.map} +1 -1
- package/dist/{style-CGaJndOl.js → types-BEUgXuu2.js} +268 -89
- package/dist/types-BEUgXuu2.js.map +1 -0
- package/dist/{utils-B5Xqf1lV.mjs → utils-BPDxr-oc.mjs} +4 -4
- package/dist/{utils-B5Xqf1lV.mjs.map → utils-BPDxr-oc.mjs.map} +1 -1
- package/dist/utils-CLnpwhJd.js +83 -0
- package/dist/utils-CLnpwhJd.js.map +1 -0
- package/dist/utils-CUl1BU40.js +72 -0
- package/dist/utils-CUl1BU40.js.map +1 -0
- package/dist/{utils-DaAiEEIG.mjs → utils-DZjLTV4D.mjs} +3 -3
- package/dist/{utils-DaAiEEIG.mjs.map → utils-DZjLTV4D.mjs.map} +1 -1
- package/dist/utils-okFWrQsg.js +41 -0
- package/dist/utils-okFWrQsg.js.map +1 -0
- package/dist/{utils-DzydRwYo.js → utils-sBVZEq4u.js} +141 -111
- package/dist/utils-sBVZEq4u.js.map +1 -0
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/dist/value-CpJpQ00y.js +145 -0
- package/dist/value-CpJpQ00y.js.map +1 -0
- package/dist/{webpack-CHydnRXB.mjs → webpack-DTKgR-HY.mjs} +5 -5
- package/dist/webpack-DTKgR-HY.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/prod/adapter/preact.ts +8 -0
- package/entry/prod/adapter/react.ts +8 -0
- package/entry/prod/adapter/solid.ts +8 -0
- package/entry/rsc_dev/adapter/preact.ts +1 -0
- package/entry/rsc_dev/adapter/react.ts +1 -0
- package/entry/rsc_dev/adapter/solid.ts +1 -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/shared/config_dev.ts +1 -1
- package/jsx/types/index.ts +3 -0
- package/jsx/types/preact.ts +14 -0
- package/jsx/{types.ts → types/react.ts} +2 -2
- package/jsx/types/solid.ts +32 -0
- package/package.json +78 -12
- package/plugin/bundler/farm/plugin.ts +2 -0
- package/plugin/bundler/parcel/plugin.ts +2 -0
- package/plugin/bundler/rspack/plugin.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +3 -8
- package/plugin/bundler/vite/state.ts +2 -2
- package/plugin/bundler/webpack/plugin.ts +2 -1
- package/plugin/nextjs/plugin.ts +3 -0
- package/plugin/utils/compiler.ts +2 -0
- package/plugin/utils/runtimeEntry.ts +2 -2
- package/runtime/adapter/utils.ts +94 -0
- package/runtime/core/cache/combine.ts +33 -4
- package/runtime/core/cache/item.ts +31 -12
- package/runtime/core/cache/itemWithResolver.ts +44 -0
- package/runtime/core/cache/prop.ts +7 -6
- package/runtime/core/cache/result.ts +2 -2
- package/runtime/core/cache/stateItem.ts +16 -1
- package/runtime/core/combinedStyle.ts +4 -4
- package/runtime/extract/combineStyle.ts +179 -5
- package/runtime/extract/getClassName.ts +49 -6
- package/runtime/sheet/rule.ts +3 -10
- package/runtime/style/scope.ts +0 -24
- package/runtime/style/style.ts +179 -5
- package/runtime/types.ts +3 -3
- package/style/classname.ts +12 -6
- package/style/important.ts +19 -0
- package/style/index.ts +2 -0
- package/style/style.ts +16 -4
- package/style/types.ts +6 -4
- package/style/utils/expose.ts +4 -3
- package/style/weight.ts +21 -0
- package/dist/assert-BGdigdr5.js.map +0 -1
- package/dist/className-Do2Crx4b.js +0 -143
- package/dist/className-Do2Crx4b.js.map +0 -1
- package/dist/combine-C9vjpKCs.js.map +0 -1
- package/dist/combineStyle-DwAhsOmS.js +0 -26
- package/dist/combineStyle-DwAhsOmS.js.map +0 -1
- package/dist/compiler-CE0ZgkdH.mjs.map +0 -1
- package/dist/config-BE5D5x2N.js +0 -2
- package/dist/config-CduqubI8.js.map +0 -1
- package/dist/config-oKOjOTWi.js +0 -7
- package/dist/css-BewrRz3_.js +0 -243
- package/dist/css-BewrRz3_.js.map +0 -1
- package/dist/css-CiTI58yl.js +0 -1094
- package/dist/css-CiTI58yl.js.map +0 -1
- package/dist/css-Rc7ILf-3.js +0 -236
- package/dist/css-Rc7ILf-3.js.map +0 -1
- package/dist/cssIdent-BsyUXNNk.js +0 -38
- package/dist/cssIdent-BsyUXNNk.js.map +0 -1
- package/dist/cssVar-DGgQ2GIK.js +0 -92
- package/dist/cssVar-DGgQ2GIK.js.map +0 -1
- package/dist/data-D7NFt4JG.js.map +0 -1
- package/dist/debug-Cvpo5cVu.js.map +0 -1
- package/dist/dev-px0_6TNq.js +0 -81
- package/dist/dev-px0_6TNq.js.map +0 -1
- package/dist/elementMarker-ng0y3fN0.js.map +0 -1
- package/dist/extract-B-Vs88ME.js +0 -3
- package/dist/extract-CM8Fk2eK.js +0 -130
- package/dist/extract-CM8Fk2eK.js.map +0 -1
- package/dist/getClassName-CrNVjAoJ.js.map +0 -1
- package/dist/global-CZBlA9E7.js +0 -14
- package/dist/hash-BfeJDf5U.js.map +0 -1
- package/dist/jsx-BY1iFewe.js +0 -39
- package/dist/jsx-BY1iFewe.js.map +0 -1
- package/dist/jsx-DL-DEAz8.js.map +0 -1
- package/dist/layer-BSxAr-hy.js +0 -94
- package/dist/layer-BSxAr-hy.js.map +0 -1
- package/dist/misc-BIS_c7BJ.mjs.map +0 -1
- package/dist/presets-BhXa232U.js +0 -108
- package/dist/presets-BhXa232U.js.map +0 -1
- package/dist/property-BuLbzviK.js +0 -406
- package/dist/property-BuLbzviK.js.map +0 -1
- package/dist/rules-CxVzovt-.js.map +0 -1
- package/dist/selector-A-mRmMnI.js +0 -64
- package/dist/selector-A-mRmMnI.js.map +0 -1
- package/dist/shared-CaJuvw03.cjs.map +0 -1
- package/dist/sheet-BWBzuy4D.js +0 -7
- package/dist/style-CGaJndOl.js.map +0 -1
- package/dist/style-DDxjKdX0.js +0 -1891
- package/dist/style-DDxjKdX0.js.map +0 -1
- package/dist/style-S7LTQbRu.js +0 -5
- package/dist/styleStore-CajcAEPO.js.map +0 -1
- package/dist/symbols-Cp4ymzKF.js +0 -14
- package/dist/symbols-Cp4ymzKF.js.map +0 -1
- package/dist/utils-B_VhPBHH.js.map +0 -1
- package/dist/utils-CDUaX81o.js +0 -170
- package/dist/utils-CDUaX81o.js.map +0 -1
- package/dist/utils-DzydRwYo.js.map +0 -1
- package/dist/value-C0JRsyax.js +0 -64
- package/dist/value-C0JRsyax.js.map +0 -1
- package/dist/value-D08AocUs.js +0 -1053
- package/dist/value-D08AocUs.js.map +0 -1
- package/dist/valueRef-M3E1oza7.js +0 -16
- package/dist/valueRef-M3E1oza7.js.map +0 -1
- package/dist/webpack-CHydnRXB.mjs.map +0 -1
- package/dist/withTokens-DAzUIPvA.js +0 -95
- package/dist/withTokens-DAzUIPvA.js.map +0 -1
|
@@ -8,6 +8,7 @@ import { buildPropertyCss, formatPropertyName, type PropertyObject } from '../..
|
|
|
8
8
|
import { TRACE_STYLE, TRACE_VALUE } from '../../../builder/data/debug';
|
|
9
9
|
import {
|
|
10
10
|
createExtractedScope,
|
|
11
|
+
createExtractedSheet,
|
|
11
12
|
createExtractedSlot,
|
|
12
13
|
createExtractedStyle,
|
|
13
14
|
createExtractedStyleMerge,
|
|
@@ -18,6 +19,7 @@ import { CSS_CONFIG } from '../../../config/config/css';
|
|
|
18
19
|
import { CSS_EXTRA_CONFIG } from '../../../config/config/css_extra';
|
|
19
20
|
import type { NamedAtRuleFormat, TokenNameFormat } from '../../../config/types';
|
|
20
21
|
import { createNamedToken, createNamedTokens } from '../../../dialect';
|
|
22
|
+
import { importantValue } from '../../../style/important';
|
|
21
23
|
import { transformKeyframes } from '../../../style/keyframes';
|
|
22
24
|
import type { StyleFnMeta } from '../../../style/style';
|
|
23
25
|
import {
|
|
@@ -33,12 +35,14 @@ import {
|
|
|
33
35
|
import type { StyleTransform } from '../../../style/transform';
|
|
34
36
|
import { exposeStyle } from '../../../style/utils';
|
|
35
37
|
import { type AtRuleRef, createAtRuleRef } from '../../../style/valueRef';
|
|
38
|
+
import { weightValue } from '../../../style/weight';
|
|
36
39
|
import { hashString } from '../../../utils/hash';
|
|
37
40
|
import type { StableId } from '../../../utils/id';
|
|
38
41
|
import type { CompilerRuntimeMode } from '../../compiler';
|
|
39
42
|
import {
|
|
40
43
|
FN_CREATE_COUNTER_STYLE,
|
|
41
44
|
FN_CREATE_EXTRACTED_SCOPE,
|
|
45
|
+
FN_CREATE_EXTRACTED_SHEET,
|
|
42
46
|
FN_CREATE_EXTRACTED_SLOT,
|
|
43
47
|
FN_CREATE_EXTRACTED_STYLE,
|
|
44
48
|
FN_CREATE_EXTRACTED_STYLE_MERGE,
|
|
@@ -55,10 +59,11 @@ import {
|
|
|
55
59
|
FN_EXPOSE_STYLE,
|
|
56
60
|
FN_FONT_SRC,
|
|
57
61
|
FN_GET_EXTRACTED_STYLE_ITEMS,
|
|
62
|
+
FN_STYLE_IMPORTANT,
|
|
58
63
|
FN_STYLE_KEYFRAMES,
|
|
59
64
|
FN_STYLE_PLAIN,
|
|
60
65
|
FN_STYLE_RAW,
|
|
61
|
-
|
|
66
|
+
FN_STYLE_WEIGHT,
|
|
62
67
|
IMPORT_EXTRACT,
|
|
63
68
|
IMPORT_PATHS,
|
|
64
69
|
STYLE_UTILS_IMPORT_PATH,
|
|
@@ -107,6 +112,7 @@ export type EvalScope = {
|
|
|
107
112
|
filePath: string;
|
|
108
113
|
styleFilePath?: string;
|
|
109
114
|
styleNames?: Set<string>;
|
|
115
|
+
sheetNames?: Set<string>;
|
|
110
116
|
styleMetas?: Map<string, StyleFnMeta>;
|
|
111
117
|
bindingNodes?: Map<string, BabelTypes.Node>;
|
|
112
118
|
styleTransform?: StyleTransform | null;
|
|
@@ -433,6 +439,14 @@ function evaluateCall(node: BabelTypes.CallExpression, scope: EvalScope): EvalRe
|
|
|
433
439
|
return evalOk(createExtractedStyle(items.value as Parameters<typeof createExtractedStyle>[0]));
|
|
434
440
|
}
|
|
435
441
|
|
|
442
|
+
if (imp && imp.source === IMPORT_EXTRACT && imp.name === FN_CREATE_EXTRACTED_SHEET) {
|
|
443
|
+
const items = evaluateNode(node.arguments[0] as BabelTypes.Node, scope);
|
|
444
|
+
if (!items.ok) return items;
|
|
445
|
+
if (!Array.isArray(items.value)) return evalFail('createExtractedSheet items must be an array');
|
|
446
|
+
|
|
447
|
+
return evalOk(createExtractedSheet(items.value as Parameters<typeof createExtractedSheet>[0]));
|
|
448
|
+
}
|
|
449
|
+
|
|
436
450
|
if (imp && imp.source === IMPORT_EXTRACT && imp.name === FN_GET_EXTRACTED_STYLE_ITEMS) {
|
|
437
451
|
const style = evaluateNode(node.arguments[0] as BabelTypes.Node, scope);
|
|
438
452
|
if (!style.ok) return style;
|
|
@@ -744,7 +758,7 @@ function evaluateCall(node: BabelTypes.CallExpression, scope: EvalScope): EvalRe
|
|
|
744
758
|
node.callee.type === 'MemberExpression' &&
|
|
745
759
|
!node.callee.computed &&
|
|
746
760
|
node.callee.property.type === 'Identifier' &&
|
|
747
|
-
node.callee.property.name ===
|
|
761
|
+
node.callee.property.name === FN_STYLE_WEIGHT &&
|
|
748
762
|
node.callee.object.type === 'Identifier' &&
|
|
749
763
|
scope.styleNames?.has(node.callee.object.name)
|
|
750
764
|
) {
|
|
@@ -755,10 +769,24 @@ function evaluateCall(node: BabelTypes.CallExpression, scope: EvalScope): EvalRe
|
|
|
755
769
|
if (!weight.ok) return weight;
|
|
756
770
|
|
|
757
771
|
if (typeof weight.value !== 'number') {
|
|
758
|
-
return evalFail(
|
|
772
|
+
return evalFail(`${node.callee.property.name} weight must be a number`);
|
|
759
773
|
}
|
|
760
774
|
|
|
761
|
-
return evalOk(
|
|
775
|
+
return evalOk(weightValue(value.value, weight.value));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (
|
|
779
|
+
node.callee.type === 'MemberExpression' &&
|
|
780
|
+
!node.callee.computed &&
|
|
781
|
+
node.callee.property.type === 'Identifier' &&
|
|
782
|
+
node.callee.property.name === FN_STYLE_IMPORTANT &&
|
|
783
|
+
node.callee.object.type === 'Identifier' &&
|
|
784
|
+
scope.styleNames?.has(node.callee.object.name)
|
|
785
|
+
) {
|
|
786
|
+
const value = evaluateNode(node.arguments[0] as BabelTypes.Node, scope);
|
|
787
|
+
if (!value.ok) return value;
|
|
788
|
+
|
|
789
|
+
return evalOk(importantValue(value.value));
|
|
762
790
|
}
|
|
763
791
|
|
|
764
792
|
if (
|
|
@@ -2,8 +2,8 @@ import * as crypto from 'node:crypto';
|
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import { BUILDER_TYPE_SCOPE } from '../../../builder/data';
|
|
4
4
|
import { TRACE_STYLE, TRACE_VALUE } from '../../../builder/data/debug';
|
|
5
|
-
import { createExtractedScope, createExtractedStyle } from '../../../builder/extract';
|
|
6
|
-
import type { ExtractedStyleTuple } from '../../../builder/extract';
|
|
5
|
+
import { createExtractedScope, createExtractedSheet, createExtractedStyle } from '../../../builder/extract';
|
|
6
|
+
import type { ExtractedSheetTuple, ExtractedStyleTuple } from '../../../builder/extract';
|
|
7
7
|
import type { CompilerInternal } from '../../compiler';
|
|
8
8
|
import type { CompilerOptions } from '../../compiler/types';
|
|
9
9
|
import { resolveFile } from '../../utils/file_resolver';
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
computeSlotId,
|
|
17
17
|
extractStyleChain,
|
|
18
18
|
} from '../extract/chain';
|
|
19
|
+
import { annotateAtRuleDeclaration, annotateTokenDeclaration } from '../syntax/static_ids';
|
|
19
20
|
import type { BabelCore, BabelTypes } from '../utils/babel';
|
|
20
21
|
import { babelTransformOptions } from '../utils/babel';
|
|
21
22
|
import { getProjectFileId } from '../utils/path';
|
|
@@ -167,6 +168,8 @@ function parseAndExtractModule(
|
|
|
167
168
|
const styleMetas = new Map();
|
|
168
169
|
const fileId = getProjectFileId(projectDir, filePath);
|
|
169
170
|
const importSourceMatcher = createImportSourceMatcher(options.importSources ?? null);
|
|
171
|
+
const staticIdState = { fileId, imports, styleNames };
|
|
172
|
+
const t = babel.types;
|
|
170
173
|
|
|
171
174
|
for (const stmt of ast.program.body) {
|
|
172
175
|
if (stmt.type === 'ImportDeclaration') {
|
|
@@ -194,6 +197,7 @@ function parseAndExtractModule(
|
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
if (stmt.type === 'VariableDeclaration') {
|
|
200
|
+
annotateVariableDeclaration(stmt, staticIdState, t);
|
|
197
201
|
collectVariableBindings(rawBindings, stmt);
|
|
198
202
|
continue;
|
|
199
203
|
}
|
|
@@ -226,6 +230,7 @@ function parseAndExtractModule(
|
|
|
226
230
|
}
|
|
227
231
|
|
|
228
232
|
if (stmt.declaration?.type === 'VariableDeclaration') {
|
|
233
|
+
annotateVariableDeclaration(stmt.declaration, staticIdState, t);
|
|
229
234
|
collectVariableBindings(rawBindings, stmt.declaration);
|
|
230
235
|
continue;
|
|
231
236
|
}
|
|
@@ -282,6 +287,17 @@ function parseAndExtractModule(
|
|
|
282
287
|
return bindings;
|
|
283
288
|
}
|
|
284
289
|
|
|
290
|
+
function annotateVariableDeclaration(
|
|
291
|
+
declaration: BabelTypes.VariableDeclaration,
|
|
292
|
+
state: Parameters<typeof annotateTokenDeclaration>[1],
|
|
293
|
+
t: typeof BabelTypes,
|
|
294
|
+
) {
|
|
295
|
+
for (const decl of declaration.declarations) {
|
|
296
|
+
annotateTokenDeclaration(decl, state, t);
|
|
297
|
+
annotateAtRuleDeclaration(decl, state, t);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
285
301
|
function collectVariableBindings(
|
|
286
302
|
bindings: Map<string, BabelTypes.Node>,
|
|
287
303
|
declaration: BabelTypes.VariableDeclaration,
|
|
@@ -450,6 +466,18 @@ function createExtractedChainValue(
|
|
|
450
466
|
return style;
|
|
451
467
|
}
|
|
452
468
|
|
|
469
|
+
if (result.type === 'sheet') {
|
|
470
|
+
const sheet = createExtractedSheet(
|
|
471
|
+
result.items
|
|
472
|
+
.filter(Array.isArray)
|
|
473
|
+
.map((item) => toExtractedStyleTuple(item as CompiledCssItem) as ExtractedSheetTuple),
|
|
474
|
+
);
|
|
475
|
+
|
|
476
|
+
defineCompiledStyleLocations(sheet, traceResult);
|
|
477
|
+
|
|
478
|
+
return sheet;
|
|
479
|
+
}
|
|
480
|
+
|
|
453
481
|
if (result.type === 'scope') {
|
|
454
482
|
return createExtractedScope(
|
|
455
483
|
result.items
|