@fluentic/style 0.1.0-beta.3 → 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 +55 -1
- package/README.md +10 -9
- package/atomic/className.ts +12 -12
- package/atomic/debug/className/className.ts +10 -15
- package/atomic/element.ts +1 -1
- package/atomic/rule.ts +8 -5
- package/atomic/scope.ts +19 -0
- package/atomic/theme.ts +41 -2
- package/atomic/token.ts +4 -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/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 +7 -1
- 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 +71 -21
- package/builder/data/state.ts +16 -2
- package/builder/extract/index.ts +1 -0
- package/builder/extract/sheet.ts +26 -0
- package/builder/extract/token.ts +30 -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 +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/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/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 +85 -1
- package/compiler/transform/debug/transform.ts +2 -1
- package/compiler/transform/evaluator/evaluator.ts +106 -30
- package/compiler/transform/evaluator/tracer.ts +30 -2
- package/compiler/transform/extract/chain/chain.ts +541 -63
- 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 +52 -2
- package/compiler/transform/extract/utils/state.ts +2 -0
- package/compiler/transform/extract/utils/theme.ts +6 -6
- 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/utils/constants.ts +8 -1
- package/compiler/utils/imports.ts +11 -1
- package/config/build.ts +1 -8
- package/config/config/css.ts +1 -0
- package/config/config/debug.ts +11 -0
- package/css/index.ts +2 -0
- package/css/sheet.ts +119 -0
- package/css/styleTarget.ts +251 -0
- package/dialect/namedTokens.ts +22 -5
- 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/{style-Bw5ka-Nq.js → combine-Ca6LfFxv.js} +427 -722
- package/dist/combine-Ca6LfFxv.js.map +1 -0
- package/dist/compiler/index.mjs +2 -2
- package/dist/{compiler-D5v5tJXI.mjs → compiler-OgDBuqfs.mjs} +1635 -607
- package/dist/compiler-OgDBuqfs.mjs.map +1 -0
- package/dist/config/index.js +2 -2
- package/dist/config-B-KbXpIh.js +6 -0
- package/dist/{config-OXHoDUIo.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-BEvP7108.js → config-BtANtGAh.js} +4 -6
- package/dist/config-BtANtGAh.js.map +1 -0
- package/dist/config-CsB4MuFI.js +6 -0
- package/dist/config-CsB4MuFI.js.map +1 -0
- package/dist/config-DOWSNV8w.js +1 -0
- package/dist/{config-FIfi5aJ8.js → config-t76UljYv.js} +9 -7
- 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/{global-zaCE-g1C.js → css-GtUPEO9U.js} +16 -3
- package/dist/css-GtUPEO9U.js.map +1 -0
- 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-DeTuIlcO.js → css_extra-BiG57TKN.js} +2 -2
- package/dist/{css_extra-DQdCrYoC.js.map → css_extra-BiG57TKN.js.map} +1 -1
- package/dist/{css_extra-DQdCrYoC.js → css_extra-CXXZAylc.js} +2 -2
- package/dist/{css_extra-DeTuIlcO.js.map → css_extra-CXXZAylc.js.map} +1 -1
- package/dist/data-CzHJg147.js +763 -0
- package/dist/data-CzHJg147.js.map +1 -0
- package/dist/{debug-D96KGgpH.js → debug-DkrxyknP.js} +80 -4
- package/dist/debug-DkrxyknP.js.map +1 -0
- package/dist/{runtime-BKChZZ2-.js → debug-DycdGrul.js} +20 -27
- package/dist/debug-DycdGrul.js.map +1 -0
- package/dist/dev/rsc.js +6 -9
- package/dist/dev/rsc.js.map +1 -1
- package/dist/{dev-fOtWB5K3.js → dev-z4laBwlS.js} +7 -6
- package/dist/{dev-fOtWB5K3.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-CvqqIb7J.js → elementMarker-CqhU_l_m.js} +95 -9
- 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 +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 +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 -4
- package/dist/entry/prod.js +85 -1201
- 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 +323 -615
- 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 +241 -10
- package/dist/entry/rsc-prod.js.map +1 -0
- package/dist/{styleStore-ydQcDBD4.js → env-Db2cRt-h.js} +1256 -355
- package/dist/env-Db2cRt-h.js.map +1 -0
- package/dist/{jsx-A4cK517J.js → getClassName-DKtQl5ZX.js} +5 -11
- package/dist/getClassName-DKtQl5ZX.js.map +1 -0
- package/dist/{utils-hoYnMiA7.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-oiQ8CnkS.js → getClassName-aD9zqg9U.js} +56 -14
- package/dist/getClassName-aD9zqg9U.js.map +1 -0
- package/dist/global-zYTvWskP.js +10 -0
- package/dist/{global-Cul1dX8k.js.map → global-zYTvWskP.js.map} +1 -1
- package/dist/{hash-Bycpk3MR.js → hash-BOlQThNz.js} +48 -4
- package/dist/hash-BOlQThNz.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 +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-BQcRzl5D.js → jsx_dev_runtime-kSrmu6b1.js} +2 -3
- package/dist/{jsx_dev_runtime-BQcRzl5D.js.map → jsx_dev_runtime-kSrmu6b1.js.map} +1 -1
- package/dist/{jsx_runtime-BXcbW8Yp.js → jsx_runtime-BgK90E2O.js} +2 -3
- package/dist/{jsx_runtime-BXcbW8Yp.js.map → jsx_runtime-BgK90E2O.js.map} +1 -1
- package/dist/{jsx_runtime-B9KEoAQN.js → jsx_runtime-XJSHujgI.js} +2 -2
- package/dist/{jsx_runtime-B9KEoAQN.js.map → jsx_runtime-XJSHujgI.js.map} +1 -1
- package/dist/{loader-BAth2yZ1.mjs → loader-DHvgp0fK.mjs} +3 -3
- package/dist/{loader-BAth2yZ1.mjs.map → loader-DHvgp0fK.mjs.map} +1 -1
- package/dist/{misc-DFBKJGLT.mjs → misc-BuSLnvx0.mjs} +4 -4
- package/dist/misc-BuSLnvx0.mjs.map +1 -0
- package/dist/{namedTokens-BUa6raTb.js → namedTokens-D3tt-joz.js} +8 -6
- package/dist/namedTokens-D3tt-joz.js.map +1 -0
- 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 +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 +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 +9 -7
- 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-CiwvMfx8.mjs → registry-r3BKWqpI.mjs} +2 -2
- package/dist/{registry-CiwvMfx8.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-DlXcch7-.js → rules-B0_rKPfB.js} +598 -132
- package/dist/rules-B0_rKPfB.js.map +1 -0
- package/dist/scope-BSuRLice.js +601 -0
- package/dist/scope-BSuRLice.js.map +1 -0
- package/dist/selector/index.js +1 -2
- package/dist/server.js +15 -13
- package/dist/server.js.map +1 -1
- package/dist/{shared-yDD0nfm1.cjs → shared-8_Msr7Q5.cjs} +1630 -597
- package/dist/shared-8_Msr7Q5.cjs.map +1 -0
- package/dist/{shared-x59dI2NW.mjs → shared-BGO_05rW.mjs} +4 -4
- package/dist/{shared-x59dI2NW.mjs.map → shared-BGO_05rW.mjs.map} +1 -1
- package/dist/sheet-BpLZIIuO.js +7 -0
- package/dist/{sheet-B-uJfHRY.js.map → sheet-BpLZIIuO.js.map} +1 -1
- package/dist/{sidecar-CJ6i4wmn.mjs → sidecar-Bu2x35JE.mjs} +3 -3
- package/dist/{sidecar-CJ6i4wmn.mjs.map → sidecar-Bu2x35JE.mjs.map} +1 -1
- package/dist/{styleStore-DJ0Msgkh.js → styleStore-BDy5TH6N.js} +5 -6
- package/dist/{styleStore-DJ0Msgkh.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-BsW_S8fN.js +138 -0
- package/dist/token-BsW_S8fN.js.map +1 -0
- package/dist/{trace-D8j96G57.js → trace-BdKEpgME.js} +2 -2
- package/dist/{trace-D8j96G57.js.map → trace-BdKEpgME.js.map} +1 -1
- package/dist/{trace-CO36aenp.js → trace-DcuMxR45.js} +3 -3
- package/dist/{trace-CO36aenp.js.map → trace-DcuMxR45.js.map} +1 -1
- package/dist/{transform-BTJOg8Hg.js → transform-BkrLIiIR.js} +2 -2
- package/dist/{transform-BTJOg8Hg.js.map → transform-BkrLIiIR.js.map} +1 -1
- package/dist/{style-DFFK06Of.js → types-BEUgXuu2.js} +356 -129
- package/dist/types-BEUgXuu2.js.map +1 -0
- package/dist/{utils-D2fygyTm.mjs → utils-BPDxr-oc.mjs} +4 -4
- package/dist/{utils-D2fygyTm.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-DTXCTUlS.mjs → utils-DZjLTV4D.mjs} +3 -3
- package/dist/{utils-DTXCTUlS.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-DVFxZnVC.js → utils-sBVZEq4u.js} +190 -144
- 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-BOU7_xld.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/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 +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/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/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/optimizer.ts +1 -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/presets/tailwind/style/transform.ts +9 -3
- package/runtime/adapter/utils.ts +94 -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 +16 -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/extract/combineStyle.ts +211 -0
- package/runtime/extract/getClassName.ts +54 -17
- package/runtime/extract/index.ts +3 -1
- package/runtime/extract/token.ts +41 -0
- package/runtime/extract/tokenResolver.ts +17 -0
- package/runtime/sheet/rule.ts +3 -10
- package/runtime/style/scope.ts +0 -24
- package/runtime/style/style.ts +181 -6
- 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 +17 -5
- package/style/theme.ts +0 -1
- package/style/token.ts +26 -21
- package/style/tokens.ts +18 -12
- package/style/transform.ts +1 -1
- 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/dist/assert-BGdigdr5.js.map +0 -1
- package/dist/className-CKo4TxuT.js +0 -144
- package/dist/className-CKo4TxuT.js.map +0 -1
- package/dist/className-ZJ5pBA-o.js +0 -263
- package/dist/className-ZJ5pBA-o.js.map +0 -1
- package/dist/compiler-D5v5tJXI.mjs.map +0 -1
- package/dist/config-BEvP7108.js.map +0 -1
- package/dist/config-B_cbG3S6.js +0 -1
- package/dist/config-FIfi5aJ8.js.map +0 -1
- package/dist/config-OXHoDUIo.js +0 -6
- package/dist/css-CELBp6Gu.js +0 -58
- package/dist/css-CELBp6Gu.js.map +0 -1
- package/dist/css-DcuJ_jSH.js +0 -243
- package/dist/css-DcuJ_jSH.js.map +0 -1
- package/dist/css-dPoZJDQH.js +0 -807
- package/dist/css-dPoZJDQH.js.map +0 -1
- package/dist/css-oOt6ZR54.js +0 -237
- package/dist/css-oOt6ZR54.js.map +0 -1
- package/dist/data-CeYstKMP.js +0 -482
- package/dist/data-CeYstKMP.js.map +0 -1
- package/dist/debug-D96KGgpH.js.map +0 -1
- package/dist/dev-p8tW7X-A.js +0 -81
- package/dist/dev-p8tW7X-A.js.map +0 -1
- package/dist/elementMarker-CvqqIb7J.js.map +0 -1
- package/dist/extract-CzWJeQi8.js +0 -121
- package/dist/extract-CzWJeQi8.js.map +0 -1
- package/dist/extract-DeOytHKW.js +0 -2
- package/dist/getClassName-oiQ8CnkS.js.map +0 -1
- package/dist/global-Cul1dX8k.js +0 -14
- package/dist/global-zaCE-g1C.js.map +0 -1
- package/dist/hash-Bycpk3MR.js.map +0 -1
- package/dist/jsx-A4cK517J.js.map +0 -1
- package/dist/jsx-Ba-XV33u.js +0 -39
- package/dist/jsx-Ba-XV33u.js.map +0 -1
- package/dist/layer-CbQzwZF-.js +0 -94
- package/dist/layer-CbQzwZF-.js.map +0 -1
- package/dist/misc-DFBKJGLT.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-CF6JgpTq.js +0 -406
- package/dist/property-CF6JgpTq.js.map +0 -1
- package/dist/rules-DlXcch7-.js.map +0 -1
- package/dist/runtime-BKChZZ2-.js.map +0 -1
- package/dist/shared-yDD0nfm1.cjs.map +0 -1
- package/dist/sheet-B-uJfHRY.js +0 -7
- package/dist/style-91J0B5ef.js +0 -771
- package/dist/style-91J0B5ef.js.map +0 -1
- package/dist/style-Bw5ka-Nq.js.map +0 -1
- package/dist/style-DFFK06Of.js.map +0 -1
- package/dist/style-pz8e5To1.js +0 -5
- package/dist/styleStore-ydQcDBD4.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/token-DT_sCPtm.js +0 -298
- package/dist/token-DT_sCPtm.js.map +0 -1
- package/dist/utils-Bmw655wa.js +0 -170
- package/dist/utils-Bmw655wa.js.map +0 -1
- package/dist/utils-DVFxZnVC.js.map +0 -1
- package/dist/utils-hoYnMiA7.js.map +0 -1
- package/dist/value-D-ZcRzLA.js +0 -42
- package/dist/value-D-ZcRzLA.js.map +0 -1
- package/dist/value-DvFkGBy2.js +0 -1029
- package/dist/value-DvFkGBy2.js.map +0 -1
- package/dist/value-dG9LK0Gq.js +0 -85
- package/dist/value-dG9LK0Gq.js.map +0 -1
- package/dist/valueRef-CsLVJwjA.js +0 -16
- package/dist/valueRef-CsLVJwjA.js.map +0 -1
- package/dist/webpack-BOU7_xld.mjs.map +0 -1
- package/dist/withTokens-LRidu3Vc.js +0 -95
- package/dist/withTokens-LRidu3Vc.js.map +0 -1
|
@@ -3,10 +3,12 @@ function hasOwn(target, field) {
|
|
|
3
3
|
return Object.prototype.hasOwnProperty.call(target, field);
|
|
4
4
|
}
|
|
5
5
|
//#endregion
|
|
6
|
-
//#region utils/
|
|
6
|
+
//#region utils/symbol.ts
|
|
7
7
|
function symbol(name) {
|
|
8
8
|
return Symbol.for(`@fluentic/style.${name}`);
|
|
9
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region utils/global.ts
|
|
10
12
|
function globalData(key, data) {
|
|
11
13
|
const id = symbol(key);
|
|
12
14
|
const root = globalThis;
|
|
@@ -88,17 +90,7 @@ globalData("config.dev.plugin", () => ({ config: null }));
|
|
|
88
90
|
globalData("config.dev.base", () => ({ config: null }));
|
|
89
91
|
globalData("config.dev.utils", () => ({ config: null }));
|
|
90
92
|
//#endregion
|
|
91
|
-
//#region atomic/utils/
|
|
92
|
-
function getCssVar(varName, value) {
|
|
93
|
-
return "var(" + varName + ", " + escapeCssValue(value) + ")";
|
|
94
|
-
}
|
|
95
|
-
function getCssVarRawFallback(varName, fallbackCss) {
|
|
96
|
-
return "var(" + varName + ", " + fallbackCss + ")";
|
|
97
|
-
}
|
|
98
|
-
function escapeCssValue(value) {
|
|
99
|
-
if (!value) return "";
|
|
100
|
-
return value.trim().replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\'").replace(/;/g, "\\;");
|
|
101
|
-
}
|
|
93
|
+
//#region atomic/utils/cssIdent.ts
|
|
102
94
|
function escapeCssIdent(ident) {
|
|
103
95
|
let result = "";
|
|
104
96
|
for (let i = 0; i < ident.length; i++) {
|
|
@@ -1106,6 +1098,8 @@ const BUILDER_CALLSITE = symbol("builder.callsite");
|
|
|
1106
1098
|
const BUILDER_SLOT_ID = symbol("builder.slotId");
|
|
1107
1099
|
const BUILDER_SCOPE_ID = symbol("builder.scopeId");
|
|
1108
1100
|
const BUILDER_SCOPE = symbol("builder.scope");
|
|
1101
|
+
symbol("builder.selector");
|
|
1102
|
+
const SHEET_SELECTOR_ANCHOR = "\0sheet";
|
|
1109
1103
|
//#endregion
|
|
1110
1104
|
//#region builder/data/is.ts
|
|
1111
1105
|
function getSlotId(data) {
|
|
@@ -1126,6 +1120,9 @@ function isSlotData(value) {
|
|
|
1126
1120
|
function isSlotOverrideData(value) {
|
|
1127
1121
|
return getBuilderType(value) === 3;
|
|
1128
1122
|
}
|
|
1123
|
+
function isSheetData(value) {
|
|
1124
|
+
return getBuilderType(value) === 9;
|
|
1125
|
+
}
|
|
1129
1126
|
function isScopeData(value) {
|
|
1130
1127
|
return getBuilderType(value) === 4;
|
|
1131
1128
|
}
|
|
@@ -1149,11 +1146,13 @@ function getExtractedTokenBoundData(value) {
|
|
|
1149
1146
|
return tokenBoundData.get(value);
|
|
1150
1147
|
}
|
|
1151
1148
|
//#endregion
|
|
1152
|
-
//#region
|
|
1149
|
+
//#region builder/token/symbols.ts
|
|
1153
1150
|
const TOKEN_ID = symbol("style:token");
|
|
1154
1151
|
const TOKEN_OVERRIDE = symbol("style:token.override");
|
|
1155
|
-
symbol("style:token.
|
|
1156
|
-
|
|
1152
|
+
const TOKEN_NAME = symbol("style:token.name");
|
|
1153
|
+
symbol("style:token.varName");
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region builder/token/data.ts
|
|
1157
1156
|
function isStyleTokenData(value) {
|
|
1158
1157
|
return !!value && typeof value[TOKEN_ID] === "string" && value[TOKEN_OVERRIDE] !== true;
|
|
1159
1158
|
}
|
|
@@ -1163,32 +1162,11 @@ function isStyleTokenOverrideData(value) {
|
|
|
1163
1162
|
function getStyleTokenId(token) {
|
|
1164
1163
|
return token[TOKEN_ID];
|
|
1165
1164
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
"scopeSelector",
|
|
1169
|
-
"property",
|
|
1170
|
-
"selector",
|
|
1171
|
-
"value"
|
|
1172
|
-
]);
|
|
1173
|
-
const formatScopeClassName = createNameFormatter(["className"]);
|
|
1174
|
-
createNameFormatter(["className"]);
|
|
1175
|
-
function getDebugScopeClassName(format, info) {
|
|
1176
|
-
return formatScopeClassName(format || "-(className)", null, info);
|
|
1177
|
-
}
|
|
1178
|
-
//#endregion
|
|
1179
|
-
//#region atomic/utils/selector.ts
|
|
1180
|
-
function getSelectorText(selector) {
|
|
1181
|
-
return Array.isArray(selector) ? selector[0] : selector;
|
|
1182
|
-
}
|
|
1183
|
-
function getSelectorPriority(selector) {
|
|
1184
|
-
if (!selector) return 0;
|
|
1185
|
-
return Array.isArray(selector) ? selector[1] : 0;
|
|
1186
|
-
}
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region atomic/className.ts
|
|
1189
|
-
function getScopeClassName(className, scopeClassNameFormat) {
|
|
1190
|
-
return getDebugScopeClassName(scopeClassNameFormat, { className });
|
|
1165
|
+
function getStyleTokenName(token) {
|
|
1166
|
+
return token[TOKEN_NAME] ?? null;
|
|
1191
1167
|
}
|
|
1168
|
+
symbol("style:token.debug");
|
|
1169
|
+
globalData("style.token.idCounter", () => ({ value: 0 }));
|
|
1192
1170
|
//#endregion
|
|
1193
1171
|
//#region runtime/core/combinedStyle.ts
|
|
1194
1172
|
const targets = globalData("runtime.combinedStyle.targets", () => /* @__PURE__ */ new WeakMap());
|
|
@@ -1220,8 +1198,80 @@ function getResolvedStyleItemTokenValues(item) {
|
|
|
1220
1198
|
return resolvedStyleItemTokenValues.get(item) ?? null;
|
|
1221
1199
|
}
|
|
1222
1200
|
//#endregion
|
|
1223
|
-
//#region runtime/core/cache/
|
|
1224
|
-
|
|
1201
|
+
//#region runtime/core/cache/tokenValues.ts
|
|
1202
|
+
function createMutableTokenValues(base) {
|
|
1203
|
+
return {
|
|
1204
|
+
ids: base ? base.ids.slice() : null,
|
|
1205
|
+
values: base ? base.values.slice() : null,
|
|
1206
|
+
lookup: base ? { ...base.lookup } : null,
|
|
1207
|
+
index: base ? createTokenIndexLookup(base.ids) : null
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
function addTokenOverride(values, item, resolver) {
|
|
1211
|
+
if (!resolver.is(item)) return false;
|
|
1212
|
+
addTokenValue(values, resolver.id(item), resolver.value(item));
|
|
1213
|
+
return true;
|
|
1214
|
+
}
|
|
1215
|
+
function addTokenValue(values, id, value) {
|
|
1216
|
+
if (!values.ids) values.ids = [];
|
|
1217
|
+
if (!values.values) values.values = [];
|
|
1218
|
+
if (!values.lookup) values.lookup = Object.create(null);
|
|
1219
|
+
if (!values.index) values.index = Object.create(null);
|
|
1220
|
+
const ids = values.ids;
|
|
1221
|
+
const tokenValues = values.values;
|
|
1222
|
+
const lookup = values.lookup;
|
|
1223
|
+
const indexLookup = values.index;
|
|
1224
|
+
const index = indexLookup[id];
|
|
1225
|
+
if (index === void 0) {
|
|
1226
|
+
indexLookup[id] = ids.push(id) - 1;
|
|
1227
|
+
tokenValues.push(value);
|
|
1228
|
+
} else tokenValues[index] = value;
|
|
1229
|
+
lookup[id] = value;
|
|
1230
|
+
}
|
|
1231
|
+
function addTokenValues(values, next) {
|
|
1232
|
+
if (!next) return;
|
|
1233
|
+
for (let i = 0, len = next.ids.length; i < len; i++) addTokenValue(values, next.ids[i], next.values[i]);
|
|
1234
|
+
}
|
|
1235
|
+
function addTokenOverrides(values, overrides, resolver) {
|
|
1236
|
+
for (let i = 0, len = overrides.length; i < len; i++) addTokenOverride(values, overrides[i], resolver);
|
|
1237
|
+
}
|
|
1238
|
+
function finishTokenValues(base, values) {
|
|
1239
|
+
if (!values.ids || !values.values || !values.lookup) return null;
|
|
1240
|
+
if (isSameTokenValues(base, values.ids, values.values)) return base;
|
|
1241
|
+
return {
|
|
1242
|
+
ids: values.ids,
|
|
1243
|
+
values: values.values,
|
|
1244
|
+
lookup: values.lookup
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
function mergeTokenValues(base, next) {
|
|
1248
|
+
if (!next) return base;
|
|
1249
|
+
if (!base) return next;
|
|
1250
|
+
const values = createMutableTokenValues(base);
|
|
1251
|
+
addTokenValues(values, next);
|
|
1252
|
+
return finishTokenValues(base, values);
|
|
1253
|
+
}
|
|
1254
|
+
function mergeTokenOverrides(base, overrides, resolver) {
|
|
1255
|
+
if (!overrides.length) return base;
|
|
1256
|
+
const values = createMutableTokenValues(base);
|
|
1257
|
+
addTokenOverrides(values, overrides, resolver);
|
|
1258
|
+
return finishTokenValues(base, values);
|
|
1259
|
+
}
|
|
1260
|
+
function createTokenIndexLookup(ids) {
|
|
1261
|
+
const lookup = Object.create(null);
|
|
1262
|
+
for (let i = 0, len = ids.length; i < len; i++) lookup[ids[i]] = i;
|
|
1263
|
+
return lookup;
|
|
1264
|
+
}
|
|
1265
|
+
function isSameTokenValues(base, ids, values) {
|
|
1266
|
+
if (!base || base.ids.length !== ids.length) return false;
|
|
1267
|
+
const baseLookup = base.lookup;
|
|
1268
|
+
for (let i = 0, len = ids.length; i < len; i++) {
|
|
1269
|
+
if (!hasOwn(baseLookup, ids[i])) return false;
|
|
1270
|
+
if (baseLookup[ids[i]] !== values[i]) return false;
|
|
1271
|
+
}
|
|
1272
|
+
return true;
|
|
1273
|
+
}
|
|
1274
|
+
globalData("runtime.directStyleItemCache", () => /* @__PURE__ */ new WeakMap());
|
|
1225
1275
|
function isResolvedStyleItem(value) {
|
|
1226
1276
|
return isResolvedStyleItem$1(value);
|
|
1227
1277
|
}
|
|
@@ -1237,14 +1287,6 @@ function createResolvedStyleItemFromItems(item, tokens) {
|
|
|
1237
1287
|
items: item.items
|
|
1238
1288
|
}, tokens);
|
|
1239
1289
|
}
|
|
1240
|
-
function getDirectStyleItem(item) {
|
|
1241
|
-
let cached = directStyleItemCache.get(item);
|
|
1242
|
-
if (!cached) {
|
|
1243
|
-
cached = createResolvedStyleItem(item, []);
|
|
1244
|
-
directStyleItemCache.set(item, cached);
|
|
1245
|
-
}
|
|
1246
|
-
return cached;
|
|
1247
|
-
}
|
|
1248
1290
|
function getStyleTokenValues(value) {
|
|
1249
1291
|
if (isCombinedStyle(value)) return getCombinedStyleTokens(value);
|
|
1250
1292
|
return getResolvedStyleItemTokenValues(value);
|
|
@@ -1264,11 +1306,14 @@ function resolveItems(data, scopes) {
|
|
|
1264
1306
|
items.push(item);
|
|
1265
1307
|
continue;
|
|
1266
1308
|
}
|
|
1267
|
-
if (isStyleTokenOverrideData(item))
|
|
1309
|
+
if (isStyleTokenOverrideData(item)) {
|
|
1310
|
+
items.push(item);
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1268
1313
|
if (slotId && item.type !== 2) continue;
|
|
1269
1314
|
items.push(item);
|
|
1270
1315
|
}
|
|
1271
|
-
if (!slotId) return items;
|
|
1316
|
+
if (!slotId || isSheetData(data)) return items;
|
|
1272
1317
|
for (let i = 0, len = scopes.length; i < len; i++) {
|
|
1273
1318
|
const boundScope = scopes[i];
|
|
1274
1319
|
const scope = getScopeTargetScope(boundScope);
|
|
@@ -1293,13 +1338,33 @@ function resolveItems(data, scopes) {
|
|
|
1293
1338
|
return items;
|
|
1294
1339
|
}
|
|
1295
1340
|
function getScopeParentItem(className) {
|
|
1296
|
-
const parentClassName =
|
|
1341
|
+
const parentClassName = formatScopeClassName$1(className);
|
|
1297
1342
|
return [parentClassName, parentClassName];
|
|
1298
1343
|
}
|
|
1344
|
+
function formatScopeClassName$1(className) {
|
|
1345
|
+
const format = CSS_CONFIG.scopeClassNameFormat;
|
|
1346
|
+
if (!format) return "-" + className;
|
|
1347
|
+
if (typeof format === "function") return format({ className });
|
|
1348
|
+
return format.replace(/\[|\]/g, "").replace(/\(className\)/g, className);
|
|
1349
|
+
}
|
|
1299
1350
|
function isExtractedScopeParentMarker$1(value) {
|
|
1300
1351
|
return value === 1 || value === true;
|
|
1301
1352
|
}
|
|
1302
1353
|
//#endregion
|
|
1354
|
+
//#region runtime/core/cache/itemWithResolver.ts
|
|
1355
|
+
function createResolvedStyleItemWithResolver(data, tokens, resolver) {
|
|
1356
|
+
return createResolvedStyleItem(data, [], mergeTokenValues(getDataTokenValues(data, resolver), tokens));
|
|
1357
|
+
}
|
|
1358
|
+
function getDirectStyleItemWithResolver(item, resolver) {
|
|
1359
|
+
return createResolvedStyleItemWithResolver(item, null, resolver);
|
|
1360
|
+
}
|
|
1361
|
+
function getDataTokenValues(data, resolver) {
|
|
1362
|
+
const stateItems = data[BUILDER_STATE]?.items ?? [];
|
|
1363
|
+
const values = createMutableTokenValues(null);
|
|
1364
|
+
for (let i = 0, len = stateItems.length; i < len; i++) addTokenOverride(values, stateItems[i], resolver);
|
|
1365
|
+
return finishTokenValues(null, values);
|
|
1366
|
+
}
|
|
1367
|
+
//#endregion
|
|
1303
1368
|
//#region runtime/core/cache/utils/tree.ts
|
|
1304
1369
|
function createWeakCacheTreeNode(value) {
|
|
1305
1370
|
return {
|
|
@@ -1343,10 +1408,23 @@ function createCacheValue() {
|
|
|
1343
1408
|
c: RUNTIME_CONFIG.changes
|
|
1344
1409
|
};
|
|
1345
1410
|
}
|
|
1411
|
+
//#endregion
|
|
1412
|
+
//#region atomic/utils/cssVar.ts
|
|
1413
|
+
function getCssVar(varName, value) {
|
|
1414
|
+
return "var(" + varName + ", " + escapeCssValue(value) + ")";
|
|
1415
|
+
}
|
|
1416
|
+
function getCssVarRawFallback(varName, fallbackCss) {
|
|
1417
|
+
return "var(" + varName + ", " + fallbackCss + ")";
|
|
1418
|
+
}
|
|
1419
|
+
function escapeCssValue(value) {
|
|
1420
|
+
if (!value) return "";
|
|
1421
|
+
return value.trim().replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\'").replace(/;/g, "\\;");
|
|
1422
|
+
}
|
|
1346
1423
|
const formatTokenName = createNameFormatter(["name"]);
|
|
1347
1424
|
function getTokenVarName(token, format) {
|
|
1348
1425
|
const id = getStyleTokenId(token);
|
|
1349
|
-
|
|
1426
|
+
const debugName = getStyleTokenName(token);
|
|
1427
|
+
return "--" + formatTokenName(format || "token[-(name)]-$hash", getIdentifierSafeHash(id, CSS_CONFIG.hashLength), { name: debugName });
|
|
1350
1428
|
}
|
|
1351
1429
|
function getTokenVar(token, format) {
|
|
1352
1430
|
return getTokenVarFallback(token, format);
|
|
@@ -1364,7 +1442,8 @@ function getTokenVarFallback(token, tokenNameFormat) {
|
|
|
1364
1442
|
function getStateItemDedupe(item) {
|
|
1365
1443
|
if (Array.isArray(item)) {
|
|
1366
1444
|
if (typeof item[0] === "number") switch (item[0]) {
|
|
1367
|
-
case 1:
|
|
1445
|
+
case 1:
|
|
1446
|
+
case 9: return item[1];
|
|
1368
1447
|
case 2:
|
|
1369
1448
|
case 3:
|
|
1370
1449
|
case 4: return item[2];
|
|
@@ -1378,7 +1457,8 @@ function getStateItemDedupe(item) {
|
|
|
1378
1457
|
function getStateItemClassName(item) {
|
|
1379
1458
|
if (Array.isArray(item)) {
|
|
1380
1459
|
if (typeof item[0] === "number") switch (item[0]) {
|
|
1381
|
-
case 1:
|
|
1460
|
+
case 1:
|
|
1461
|
+
case 9: return item[2];
|
|
1382
1462
|
case 2:
|
|
1383
1463
|
case 3:
|
|
1384
1464
|
case 4: return item[3];
|
|
@@ -1390,6 +1470,10 @@ function getStateItemClassName(item) {
|
|
|
1390
1470
|
return item.className;
|
|
1391
1471
|
}
|
|
1392
1472
|
function getStateItemVariableValue(item, tokens) {
|
|
1473
|
+
if (isStyleTokenOverrideData(item)) {
|
|
1474
|
+
const id = getStyleTokenId(item);
|
|
1475
|
+
return [getTokenVarName(item, CSS_CONFIG.tokenNameFormat ?? null), tokens && hasOwn(tokens.lookup, id) ? tokens.lookup[id] : getTokenOverrideValue(item, CSS_CONFIG.tokenNameFormat ?? null)];
|
|
1476
|
+
}
|
|
1393
1477
|
const value = getStateItemValue(item);
|
|
1394
1478
|
if (Array.isArray(value) && value[0] === 1) return [value[1], resolveMarkedVariableValue(value[2], value[3], tokens)];
|
|
1395
1479
|
if (!Array.isArray(item) && !isStyleTokenOverrideData(item) && item.variable?.[0] === 1) return [item.variable[1], resolveMarkedVariableValue(item.variable[2], item.variable[3], tokens)];
|
|
@@ -1429,7 +1513,8 @@ function getStateItemAtRuleRefVariables(item, tokens) {
|
|
|
1429
1513
|
}
|
|
1430
1514
|
function getStateItemValue(item) {
|
|
1431
1515
|
if (Array.isArray(item)) if (typeof item[0] === "number") switch (item[0]) {
|
|
1432
|
-
case 1:
|
|
1516
|
+
case 1:
|
|
1517
|
+
case 9: return item[3];
|
|
1433
1518
|
case 2:
|
|
1434
1519
|
case 3: return item[4];
|
|
1435
1520
|
case 4: return isExtractedScopeParentMarker(item[4]) ? void 0 : item[4];
|
|
@@ -1474,7 +1559,7 @@ function createStylePropResult(items, getThemeClassName) {
|
|
|
1474
1559
|
const stateItems = item.items;
|
|
1475
1560
|
for (let j = 0, itemLen = stateItems.length; j < itemLen; j++) style = addItem(classNames, style, stateItems[j], tokens);
|
|
1476
1561
|
}
|
|
1477
|
-
if (!classNames.length) return emptyStylePropResult;
|
|
1562
|
+
if (!classNames.length && !style) return emptyStylePropResult;
|
|
1478
1563
|
return {
|
|
1479
1564
|
className: classNames.join(" "),
|
|
1480
1565
|
style
|
|
@@ -1483,7 +1568,7 @@ function createStylePropResult(items, getThemeClassName) {
|
|
|
1483
1568
|
function addItem(classNames, style, item, tokens) {
|
|
1484
1569
|
const dedupe = getStateItemDedupe(item);
|
|
1485
1570
|
const className = getStateItemClassName(item);
|
|
1486
|
-
if (!dedupe || !className) return style;
|
|
1571
|
+
if (!dedupe || !className) return addItemStyle(style, item, tokens);
|
|
1487
1572
|
if (dedupeRun[dedupe] === runId) {
|
|
1488
1573
|
classNames[dedupeIndex[dedupe]] = className;
|
|
1489
1574
|
return addItemStyle(style, item, tokens);
|
|
@@ -1506,79 +1591,19 @@ function setStyleValue(style, name, value) {
|
|
|
1506
1591
|
return next;
|
|
1507
1592
|
}
|
|
1508
1593
|
//#endregion
|
|
1509
|
-
//#region runtime/core/cache/
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
addTokenValue(values, getStyleTokenId(item), getTokenOverrideValue(item, CSS_CONFIG.tokenNameFormat ?? null));
|
|
1521
|
-
return true;
|
|
1522
|
-
}
|
|
1523
|
-
function addTokenValue(values, id, value) {
|
|
1524
|
-
if (!values.ids) values.ids = [];
|
|
1525
|
-
if (!values.values) values.values = [];
|
|
1526
|
-
if (!values.lookup) values.lookup = Object.create(null);
|
|
1527
|
-
if (!values.index) values.index = Object.create(null);
|
|
1528
|
-
const ids = values.ids;
|
|
1529
|
-
const tokenValues = values.values;
|
|
1530
|
-
const lookup = values.lookup;
|
|
1531
|
-
const indexLookup = values.index;
|
|
1532
|
-
const index = indexLookup[id];
|
|
1533
|
-
if (index === void 0) {
|
|
1534
|
-
indexLookup[id] = ids.push(id) - 1;
|
|
1535
|
-
tokenValues.push(value);
|
|
1536
|
-
} else tokenValues[index] = value;
|
|
1537
|
-
lookup[id] = value;
|
|
1538
|
-
}
|
|
1539
|
-
function addTokenValues(values, next) {
|
|
1540
|
-
if (!next) return;
|
|
1541
|
-
for (let i = 0, len = next.ids.length; i < len; i++) addTokenValue(values, next.ids[i], next.values[i]);
|
|
1542
|
-
}
|
|
1543
|
-
function addTokenOverrides(values, overrides) {
|
|
1544
|
-
for (let i = 0, len = overrides.length; i < len; i++) addTokenOverride(values, overrides[i]);
|
|
1545
|
-
}
|
|
1546
|
-
function finishTokenValues(base, values) {
|
|
1547
|
-
if (!values.ids || !values.values || !values.lookup) return null;
|
|
1548
|
-
if (isSameTokenValues(base, values.ids, values.values)) return base;
|
|
1549
|
-
return {
|
|
1550
|
-
ids: values.ids,
|
|
1551
|
-
values: values.values,
|
|
1552
|
-
lookup: values.lookup
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
|
-
function mergeTokenValues(base, next) {
|
|
1556
|
-
if (!next) return base;
|
|
1557
|
-
if (!base) return next;
|
|
1558
|
-
const values = createMutableTokenValues(base);
|
|
1559
|
-
addTokenValues(values, next);
|
|
1560
|
-
return finishTokenValues(base, values);
|
|
1561
|
-
}
|
|
1562
|
-
function mergeTokenOverrides(base, overrides) {
|
|
1563
|
-
if (!overrides.length) return base;
|
|
1564
|
-
const values = createMutableTokenValues(base);
|
|
1565
|
-
addTokenOverrides(values, overrides);
|
|
1566
|
-
return finishTokenValues(base, values);
|
|
1567
|
-
}
|
|
1568
|
-
function createTokenIndexLookup(ids) {
|
|
1569
|
-
const lookup = Object.create(null);
|
|
1570
|
-
for (let i = 0, len = ids.length; i < len; i++) lookup[ids[i]] = i;
|
|
1571
|
-
return lookup;
|
|
1572
|
-
}
|
|
1573
|
-
function isSameTokenValues(base, ids, values) {
|
|
1574
|
-
if (!base || base.ids.length !== ids.length) return false;
|
|
1575
|
-
const baseLookup = base.lookup;
|
|
1576
|
-
for (let i = 0, len = ids.length; i < len; i++) {
|
|
1577
|
-
if (!hasOwn(baseLookup, ids[i])) return false;
|
|
1578
|
-
if (baseLookup[ids[i]] !== values[i]) return false;
|
|
1594
|
+
//#region runtime/core/cache/token.ts
|
|
1595
|
+
const runtimeTokenValueResolver = {
|
|
1596
|
+
get key() {
|
|
1597
|
+
return CSS_CONFIG.tokenNameFormat;
|
|
1598
|
+
},
|
|
1599
|
+
is: isStyleTokenOverrideData,
|
|
1600
|
+
id(token) {
|
|
1601
|
+
return getStyleTokenId(token);
|
|
1602
|
+
},
|
|
1603
|
+
value(token) {
|
|
1604
|
+
return getTokenOverrideValue(token, CSS_CONFIG.tokenNameFormat ?? null);
|
|
1579
1605
|
}
|
|
1580
|
-
|
|
1581
|
-
}
|
|
1606
|
+
};
|
|
1582
1607
|
//#endregion
|
|
1583
1608
|
//#region runtime/core/cache/utils/walk.ts
|
|
1584
1609
|
function walkRecursiveItems(root, fn) {
|
|
@@ -1679,26 +1704,26 @@ function normalizeStylePropItem(item, stableTokenBound) {
|
|
|
1679
1704
|
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(item)) {
|
|
1680
1705
|
const bound = getExtractedTokenBoundData(item);
|
|
1681
1706
|
if (stableTokenBound) return normalizeStylePropItem(bound.data, true);
|
|
1682
|
-
const tokens = mergeTokenOverrides(null, bound.tokens);
|
|
1683
|
-
if (isStyleData(bound.data) || isSlotData(bound.data)) return
|
|
1707
|
+
const tokens = mergeTokenOverrides(null, bound.tokens, runtimeTokenValueResolver);
|
|
1708
|
+
if (isStyleData(bound.data) || isSheetData(bound.data) || isSlotData(bound.data)) return createResolvedStyleItemWithResolver(bound.data, tokens, runtimeTokenValueResolver);
|
|
1684
1709
|
return normalizeStylePropItem(bound.data, false);
|
|
1685
1710
|
}
|
|
1686
1711
|
if (isResolvedStyleItem(item) || isThemeData(item)) return item;
|
|
1687
|
-
if (isStyleData(item) || isSlotData(item)) return
|
|
1712
|
+
if (isStyleData(item) || isSheetData(item) || isSlotData(item)) return getDirectStyleItemWithResolver(item, runtimeTokenValueResolver);
|
|
1688
1713
|
return null;
|
|
1689
1714
|
}
|
|
1690
1715
|
function getStylePropCacheKey(item, tokenBindings) {
|
|
1691
1716
|
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(item)) {
|
|
1692
1717
|
const bound = getExtractedTokenBoundData(item);
|
|
1693
1718
|
const key = getStylePropCacheKey(bound.data, tokenBindings);
|
|
1694
|
-
const tokens = mergeTokenOverrides(null, bound.tokens);
|
|
1719
|
+
const tokens = mergeTokenOverrides(null, bound.tokens, runtimeTokenValueResolver);
|
|
1695
1720
|
if (key && tokens) tokenBindings.push({
|
|
1696
1721
|
data: key,
|
|
1697
1722
|
tokens
|
|
1698
1723
|
});
|
|
1699
1724
|
return key;
|
|
1700
1725
|
}
|
|
1701
|
-
if (isResolvedStyleItem(item) || isThemeData(item) || isStyleData(item) || isSlotData(item)) return item;
|
|
1726
|
+
if (isResolvedStyleItem(item) || isThemeData(item) || isStyleData(item) || isSheetData(item) || isSlotData(item)) return item;
|
|
1702
1727
|
return null;
|
|
1703
1728
|
}
|
|
1704
1729
|
function getThemeClassName(item) {
|
|
@@ -2183,6 +2208,28 @@ function getPropertyPriority(property) {
|
|
|
2183
2208
|
function getCssPropertyName(property) {
|
|
2184
2209
|
return property.replace(/^(webkit|moz|ms|o)([A-Z])/g, (_, prefix, c) => `-${prefix}-${c.toLowerCase()}`).replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
|
|
2185
2210
|
}
|
|
2211
|
+
function getScopeClassName(className, scopeClassNameFormat) {
|
|
2212
|
+
return formatScopeClassName(scopeClassNameFormat || "-(className)", { className });
|
|
2213
|
+
}
|
|
2214
|
+
function formatScopeClassName(format, info) {
|
|
2215
|
+
if (typeof format === "function") return format(info);
|
|
2216
|
+
return format.replace(/\[|\]/g, "").replace(/\(className\)/g, info.className);
|
|
2217
|
+
}
|
|
2218
|
+
//#endregion
|
|
2219
|
+
//#region atomic/utils/selector.ts
|
|
2220
|
+
function getSelectorText(selector) {
|
|
2221
|
+
return stripSheetSelectorAnchor(Array.isArray(selector) ? selector[0] : selector);
|
|
2222
|
+
}
|
|
2223
|
+
function getSelectorPriority(selector) {
|
|
2224
|
+
if (!selector) return 0;
|
|
2225
|
+
return Array.isArray(selector) ? selector[1] : 0;
|
|
2226
|
+
}
|
|
2227
|
+
function hasSheetSelectorAnchor(selector) {
|
|
2228
|
+
return (selector ? Array.isArray(selector) ? selector[0] : selector : "").startsWith(SHEET_SELECTOR_ANCHOR);
|
|
2229
|
+
}
|
|
2230
|
+
function stripSheetSelectorAnchor(selector) {
|
|
2231
|
+
return selector.startsWith("\0sheet") ? selector.slice(6) : selector;
|
|
2232
|
+
}
|
|
2186
2233
|
//#endregion
|
|
2187
2234
|
//#region atomic/value/unitless.ts
|
|
2188
2235
|
const UnitlessProperties = [
|
|
@@ -2246,10 +2293,11 @@ function shouldAppendCssPx(property) {
|
|
|
2246
2293
|
}
|
|
2247
2294
|
//#endregion
|
|
2248
2295
|
//#region atomic/rule.ts
|
|
2249
|
-
function buildAtomicRule(className, property, value, selector, parentSelector, atRules, scopeClassNameFormat) {
|
|
2296
|
+
function buildAtomicRule(className, property, value, important, selector, parentSelector, atRules, scopeClassNameFormat) {
|
|
2250
2297
|
const cssProp = getCssPropertyName(property);
|
|
2251
|
-
const cssValue = getCssPropertyValue(property, value);
|
|
2252
|
-
const
|
|
2298
|
+
const cssValue = getCssPropertyValue(property, value) + (important ? " !important" : "");
|
|
2299
|
+
const escapedClass = escapeCssIdent(className);
|
|
2300
|
+
const classSelector = hasSheetSelectorAnchor(selector) ? `:where(.${escapedClass})` : "." + escapedClass;
|
|
2253
2301
|
const itemSelector = selector ? getSelectorText(selector) : "";
|
|
2254
2302
|
let selectorStr = classSelector + itemSelector;
|
|
2255
2303
|
if (parentSelector) {
|
|
@@ -2300,11 +2348,9 @@ function createRuntimeSheetRules(item) {
|
|
|
2300
2348
|
if (Array.isArray(item)) return null;
|
|
2301
2349
|
if (isStyleTokenOverrideData(item)) return null;
|
|
2302
2350
|
const runtimeItem = item;
|
|
2303
|
-
const value = Array.isArray(runtimeItem.value) ? runtimeItem.value[0] : runtimeItem.value;
|
|
2304
|
-
const priority = Array.isArray(runtimeItem.value) ? runtimeItem.value[1] : null;
|
|
2305
2351
|
const parentSelector = runtimeItem.type === 4 ? runtimeItem.parentSelector : null;
|
|
2306
|
-
const layerPriority = getAtomicRuleLayerPriority(runtimeItem.property,
|
|
2307
|
-
const ruleCss = buildAtomicRule(runtimeItem.className, runtimeItem.property, value, runtimeItem.selector, parentSelector, runtimeItem.atRule, CSS_CONFIG.scopeClassNameFormat || null);
|
|
2352
|
+
const layerPriority = getAtomicRuleLayerPriority(runtimeItem.property, runtimeItem.weight, runtimeItem.selector, parentSelector, runtimeItem.atRule, runtimeItem.type === 4);
|
|
2353
|
+
const ruleCss = buildAtomicRule(runtimeItem.className, runtimeItem.property, runtimeItem.value, runtimeItem.important, runtimeItem.selector, parentSelector, runtimeItem.atRule, CSS_CONFIG.scopeClassNameFormat || null);
|
|
2308
2354
|
const rule = {
|
|
2309
2355
|
key: runtimeItem.className,
|
|
2310
2356
|
dedupe: runtimeItem.dedupe,
|
|
@@ -2495,4 +2541,4 @@ function createJsx(fn, transformElement) {
|
|
|
2495
2541
|
//#endregion
|
|
2496
2542
|
export { transformElement as a, wrapFragment as i, createJsxDEV as n, wrapCreateElement as r, createJsx as t };
|
|
2497
2543
|
|
|
2498
|
-
//# sourceMappingURL=utils-
|
|
2544
|
+
//# sourceMappingURL=utils-sBVZEq4u.js.map
|