@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
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as splitElementMarkerStyleProp, n as createElementMarkerClassName } from "./elementMarker-
|
|
1
|
+
import { t as CSS_CONFIG } from "./css-GtUPEO9U.js";
|
|
2
|
+
import { a as RUNTIME_CONFIG } from "./debug-DycdGrul.js";
|
|
3
|
+
import { c as splitElementMarkerStyleProp, n as createElementMarkerClassName, x as LayerDefaultLayers } from "./elementMarker-CqhU_l_m.js";
|
|
4
|
+
import { C as getGlobalSheet, E as isServerRSC, a as resolveStylePropRuntime, n as walkStylePropItemsSheetRules, r as insertRuntimeThemeRule } from "./rules-B0_rKPfB.js";
|
|
5
|
+
//#region runtime/sheet/insert.ts
|
|
6
|
+
function insertStylePropRuntimeItems(sheet, items) {
|
|
7
|
+
if (!items.length) return;
|
|
8
|
+
sheet.updateLayers(CSS_CONFIG.layers || LayerDefaultLayers);
|
|
9
|
+
walkStylePropItemsSheetRules(items, (rule) => sheet.insert(rule), (theme) => insertRuntimeThemeRule(sheet, theme));
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
4
12
|
//#region runtime/core/className.ts
|
|
5
13
|
function mergeClassName(className) {
|
|
6
14
|
if (!className) return void 0;
|
|
@@ -60,70 +68,25 @@ function resolveClassNameRuntime(styleProp, props = {}) {
|
|
|
60
68
|
};
|
|
61
69
|
}
|
|
62
70
|
//#endregion
|
|
63
|
-
//#region runtime/core/
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
type,
|
|
77
|
-
props: rest
|
|
78
|
-
};
|
|
79
|
-
const marker = splitElementMarkerStyleProp(css);
|
|
80
|
-
if (marker.styleProp) Object.assign(rest, getClassName(marker.styleProp, rest));
|
|
81
|
-
prependClassName(rest, createElementMarkerClassName(marker.debug));
|
|
82
|
-
return {
|
|
83
|
-
type,
|
|
84
|
-
props: rest
|
|
85
|
-
};
|
|
86
|
-
};
|
|
71
|
+
//#region runtime/core/getClassName.ts
|
|
72
|
+
function getClassName(styleProp, props = {}) {
|
|
73
|
+
const marker = splitElementMarkerStyleProp(styleProp);
|
|
74
|
+
const resolved = resolveClassNameRuntime(marker.styleProp, props);
|
|
75
|
+
if (resolved.items.length) {
|
|
76
|
+
if (!RUNTIME_CONFIG.isExtracted && !isServerRSC()) {
|
|
77
|
+
const sheet = getGlobalSheet();
|
|
78
|
+
insertStylePropRuntimeItems(sheet, resolved.items);
|
|
79
|
+
sheet.flush();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
prependClassName(resolved.result, createElementMarkerClassName(marker.debug));
|
|
83
|
+
return resolved.result;
|
|
87
84
|
}
|
|
88
|
-
function prependClassName(
|
|
85
|
+
function prependClassName(result, className) {
|
|
89
86
|
if (!className) return;
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region jsx/utils.ts
|
|
94
|
-
function wrapCreateElement(createElement, transformElement) {
|
|
95
|
-
const fn = (type, props, ...children) => {
|
|
96
|
-
const result = transformElement({
|
|
97
|
-
type,
|
|
98
|
-
props
|
|
99
|
-
});
|
|
100
|
-
return createElement(result.type, result.props, ...children);
|
|
101
|
-
};
|
|
102
|
-
return fn;
|
|
103
|
-
}
|
|
104
|
-
function wrapFragment(fragment) {
|
|
105
|
-
return fragment;
|
|
106
|
-
}
|
|
107
|
-
function createJsxDEV(fn, transformElement) {
|
|
108
|
-
return (type, props, key, isStatic, source, self) => {
|
|
109
|
-
const result = transformElement({
|
|
110
|
-
type,
|
|
111
|
-
props,
|
|
112
|
-
source
|
|
113
|
-
});
|
|
114
|
-
return fn(result.type, result.props, key, isStatic, source, self);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function createJsx(fn, transformElement) {
|
|
118
|
-
return (type, props, key) => {
|
|
119
|
-
const result = transformElement({
|
|
120
|
-
type,
|
|
121
|
-
props
|
|
122
|
-
});
|
|
123
|
-
return fn(result.type, result.props, key);
|
|
124
|
-
};
|
|
87
|
+
result.className = result.className ? `${className} ${result.className}` : className;
|
|
125
88
|
}
|
|
126
89
|
//#endregion
|
|
127
|
-
export {
|
|
90
|
+
export { resolveClassNameRuntime as n, getClassName as t };
|
|
128
91
|
|
|
129
|
-
//# sourceMappingURL=
|
|
92
|
+
//# sourceMappingURL=getClassName-DaZF5nfJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getClassName-DaZF5nfJ.js","names":[],"sources":["../runtime/sheet/insert.ts","../runtime/core/className.ts","../runtime/core/resolveClassNameRuntime.ts","../runtime/core/getClassName.ts"],"sourcesContent":["import { LayerDefaultLayers } from '../../atomic/layer';\nimport { CSS_CONFIG } from '../../config/config/css';\nimport type { StyleSheet } from '../../sheet/types';\nimport type { StylePropItem } from '../core/cache/prop';\nimport type { StyleProp } from '../types';\nimport { walkStylePropItemsSheetRules, walkStylePropSheetRules } from './rules';\nimport { insertRuntimeThemeRule } from './theme';\n\nexport function insertStylePropRuntimeRules(\n sheet: StyleSheet,\n styleProp: StyleProp | undefined,\n) {\n if (!styleProp) return;\n\n sheet.updateLayers(CSS_CONFIG.layers || LayerDefaultLayers);\n\n walkStylePropSheetRules(\n styleProp,\n (rule) => sheet.insert(rule),\n (theme) => insertRuntimeThemeRule(sheet, theme),\n );\n}\n\nexport function insertStylePropRuntimeItems(\n sheet: StyleSheet,\n items: readonly StylePropItem[],\n) {\n if (!items.length) return;\n\n sheet.updateLayers(CSS_CONFIG.layers || LayerDefaultLayers);\n\n walkStylePropItemsSheetRules(\n items,\n (rule) => sheet.insert(rule),\n (theme) => insertRuntimeThemeRule(sheet, theme),\n );\n}\n","import type { CSSProperties } from 'react';\nimport type { RecursiveArray } from '../../utils/type';\n\ntype Items<T = string> = T | false | null | undefined | RecursiveArray<T | false | null | undefined>;\n\nexport type ClassNameProps = {\n className?: Items<string>;\n style?: Items<CSSProperties>;\n};\n\nexport type ClassNameResult = {\n className?: string | undefined;\n style?: CSSProperties | undefined;\n};\n\nexport function mergeClassName(className: Items<string>) {\n if (!className) return undefined;\n if (!Array.isArray(className)) return className as string;\n\n let nextClassName = '';\n\n const stack: unknown[] = [className];\n\n while (stack.length) {\n const item = stack.pop();\n\n if (!item) continue;\n\n if (Array.isArray(item)) {\n for (let index = item.length - 1; index >= 0; index--) {\n stack.push(item[index]);\n }\n } else {\n nextClassName = nextClassName\n ? `${nextClassName} ${item}`\n : item as string;\n }\n }\n\n return nextClassName || undefined;\n}\n\nexport function mergeStyle(style: Items<CSSProperties>) {\n if (!style) return undefined;\n if (!Array.isArray(style)) return style as CSSProperties;\n\n const nextStyle = {};\n\n const stack: unknown[] = [style];\n\n while (stack.length) {\n const item = stack.pop();\n\n if (!item) continue;\n\n if (Array.isArray(item)) {\n for (let index = item.length - 1; index >= 0; index--) {\n stack.push(item[index]);\n }\n } else {\n Object.assign(nextStyle, item);\n }\n }\n\n return nextStyle;\n}\n\nexport function mergeResolvedClassName(\n result: ClassNameResult,\n resolvedClassName: string,\n) {\n if (!resolvedClassName) return;\n\n result.className = result.className\n ? result.className + ' ' + resolvedClassName\n : resolvedClassName;\n}\n\nexport function mergeResolvedStyle(\n result: ClassNameResult,\n resolvedStyle: CSSProperties | undefined,\n) {\n if (!resolvedStyle) return;\n\n result.style = result.style\n ? Object.assign({}, resolvedStyle, result.style)\n : resolvedStyle;\n}\n\nexport function createClassNameResult(\n props: ClassNameProps = {},\n): ClassNameResult {\n return {\n className: props.className ? mergeClassName(props.className) : undefined,\n style: props.style ? mergeStyle(props.style) : undefined,\n };\n}\n\nexport function finishClassNameResult(result: ClassNameResult): ClassNameResult {\n return result.className || result.style ? result : {};\n}\n","import { type StyleProp } from '../types';\nimport { resolveStylePropRuntime, type StylePropItem } from './cache/prop';\nimport {\n type ClassNameProps,\n type ClassNameResult,\n createClassNameResult,\n finishClassNameResult,\n mergeResolvedClassName,\n mergeResolvedStyle,\n} from './className';\n\nexport type RuntimeClassNameResolution = {\n result: ClassNameResult;\n items: StylePropItem[];\n};\n\nexport function resolveClassNameRuntime(\n styleProp: StyleProp,\n props: ClassNameProps = {},\n): RuntimeClassNameResolution {\n const result = createClassNameResult(props);\n const resolved = resolveStylePropRuntime(styleProp);\n\n if (resolved) {\n mergeResolvedClassName(result, resolved.result.className);\n mergeResolvedStyle(result, resolved.result.style);\n }\n\n return {\n result: finishClassNameResult(result),\n items: resolved?.items ?? [],\n };\n}\n","import { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport { isServerRSC } from '../env';\nimport { getGlobalSheet } from '../sheet/global';\nimport { insertStylePropRuntimeItems } from '../sheet/insert';\nimport { type StyleProp } from '../types';\nimport { type ClassNameProps, type ClassNameResult } from './className';\nimport { createElementMarkerClassName, splitElementMarkerStyleProp } from './elementMarker';\nimport { resolveClassNameRuntime } from './resolveClassNameRuntime';\n\nexport {\n //\n type ClassNameProps,\n type ClassNameResult,\n mergeClassName,\n mergeStyle,\n} from './className';\n\nexport function getClassName(\n styleProp: StyleProp,\n props: ClassNameProps = {},\n): ClassNameResult {\n const marker = splitElementMarkerStyleProp(styleProp);\n const resolved = resolveClassNameRuntime(marker.styleProp as StyleProp, props);\n\n if (resolved.items.length) {\n if (!RUNTIME_CONFIG.isExtracted && !isServerRSC()) {\n const sheet = getGlobalSheet();\n insertStylePropRuntimeItems(sheet, resolved.items);\n sheet.flush();\n }\n }\n\n prependClassName(resolved.result, createElementMarkerClassName(marker.debug));\n\n return resolved.result;\n}\n\nfunction prependClassName(\n result: ClassNameResult,\n className: string | null,\n) {\n if (!className) return;\n\n result.className = result.className\n ? `${className} ${result.className}`\n : className;\n}\n"],"mappings":";;;;;AAuBA,SAAgB,4BACd,OACA,OACA;CACA,IAAI,CAAC,MAAM,QAAQ;CAEnB,MAAM,aAAa,WAAW,UAAU,kBAAkB;CAE1D,6BACE,QACC,SAAS,MAAM,OAAO,IAAI,IAC1B,UAAU,uBAAuB,OAAO,KAAK,CAChD;AACF;;;ACrBA,SAAgB,eAAe,WAA0B;CACvD,IAAI,CAAC,WAAW,OAAO,KAAA;CACvB,IAAI,CAAC,MAAM,QAAQ,SAAS,GAAG,OAAO;CAEtC,IAAI,gBAAgB;CAEpB,MAAM,QAAmB,CAAC,SAAS;CAEnC,OAAO,MAAM,QAAQ;EACnB,MAAM,OAAO,MAAM,IAAI;EAEvB,IAAI,CAAC,MAAM;EAEX,IAAI,MAAM,QAAQ,IAAI,GACpB,KAAK,IAAI,QAAQ,KAAK,SAAS,GAAG,SAAS,GAAG,SAC5C,MAAM,KAAK,KAAK,MAAM;OAGxB,gBAAgB,gBACZ,GAAG,cAAc,GAAG,SACpB;CAER;CAEA,OAAO,iBAAiB,KAAA;AAC1B;AAEA,SAAgB,WAAW,OAA6B;CACtD,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO;CAElC,MAAM,YAAY,CAAC;CAEnB,MAAM,QAAmB,CAAC,KAAK;CAE/B,OAAO,MAAM,QAAQ;EACnB,MAAM,OAAO,MAAM,IAAI;EAEvB,IAAI,CAAC,MAAM;EAEX,IAAI,MAAM,QAAQ,IAAI,GACpB,KAAK,IAAI,QAAQ,KAAK,SAAS,GAAG,SAAS,GAAG,SAC5C,MAAM,KAAK,KAAK,MAAM;OAGxB,OAAO,OAAO,WAAW,IAAI;CAEjC;CAEA,OAAO;AACT;AAEA,SAAgB,uBACd,QACA,mBACA;CACA,IAAI,CAAC,mBAAmB;CAExB,OAAO,YAAY,OAAO,YACtB,OAAO,YAAY,MAAM,oBACzB;AACN;AAEA,SAAgB,mBACd,QACA,eACA;CACA,IAAI,CAAC,eAAe;CAEpB,OAAO,QAAQ,OAAO,QAClB,OAAO,OAAO,CAAC,GAAG,eAAe,OAAO,KAAK,IAC7C;AACN;AAEA,SAAgB,sBACd,QAAwB,CAAC,GACR;CACjB,OAAO;EACL,WAAW,MAAM,YAAY,eAAe,MAAM,SAAS,IAAI,KAAA;EAC/D,OAAO,MAAM,QAAQ,WAAW,MAAM,KAAK,IAAI,KAAA;CACjD;AACF;AAEA,SAAgB,sBAAsB,QAA0C;CAC9E,OAAO,OAAO,aAAa,OAAO,QAAQ,SAAS,CAAC;AACtD;;;ACpFA,SAAgB,wBACd,WACA,QAAwB,CAAC,GACG;CAC5B,MAAM,SAAS,sBAAsB,KAAK;CAC1C,MAAM,WAAW,wBAAwB,SAAS;CAElD,IAAI,UAAU;EACZ,uBAAuB,QAAQ,SAAS,OAAO,SAAS;EACxD,mBAAmB,QAAQ,SAAS,OAAO,KAAK;CAClD;CAEA,OAAO;EACL,QAAQ,sBAAsB,MAAM;EACpC,OAAO,UAAU,SAAS,CAAC;CAC7B;AACF;;;ACfA,SAAgB,aACd,WACA,QAAwB,CAAC,GACR;CACjB,MAAM,SAAS,4BAA4B,SAAS;CACpD,MAAM,WAAW,wBAAwB,OAAO,WAAwB,KAAK;CAE7E,IAAI,SAAS,MAAM;MACb,CAAC,eAAe,eAAe,CAAC,YAAY,GAAG;GACjD,MAAM,QAAQ,eAAe;GAC7B,4BAA4B,OAAO,SAAS,KAAK;GACjD,MAAM,MAAM;EACd;;CAGF,iBAAiB,SAAS,QAAQ,6BAA6B,OAAO,KAAK,CAAC;CAE5E,OAAO,SAAS;AAClB;AAEA,SAAS,iBACP,QACA,WACA;CACA,IAAI,CAAC,WAAW;CAEhB,OAAO,YAAY,OAAO,YACtB,GAAG,UAAU,GAAG,OAAO,cACvB;AACN"}
|
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
//#region utils/symbol.ts
|
|
2
|
+
function symbol(name) {
|
|
3
|
+
return Symbol.for(`@fluentic/style.${name}`);
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region utils/global.ts
|
|
7
|
+
function globalData(key, data) {
|
|
8
|
+
const id = symbol(key);
|
|
9
|
+
const root = globalThis;
|
|
10
|
+
if (root[id] === void 0) assign(root, id, data());
|
|
11
|
+
return root[id];
|
|
12
|
+
}
|
|
13
|
+
function assign(target, id, value) {
|
|
14
|
+
Object.defineProperty(target, id, {
|
|
15
|
+
value,
|
|
16
|
+
configurable: true,
|
|
17
|
+
enumerable: false,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region config/config/css.ts
|
|
23
|
+
const CSS_CONFIG_DEFAULT = {
|
|
24
|
+
layer: true,
|
|
25
|
+
layers: ["$layer"],
|
|
26
|
+
layerNamespace: "css"
|
|
27
|
+
};
|
|
28
|
+
const CSS_CONFIG = globalData("config.css", () => ({ ...CSS_CONFIG_DEFAULT }));
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region config/utils.ts
|
|
31
|
+
function getCacheTTL(cache) {
|
|
32
|
+
return cache === true ? 3e5 : cache === false ? 0 : Math.max(cache, 0);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region config/config/runtime.ts
|
|
36
|
+
const RUNTIME_CONFIG_DEFAULT = {
|
|
37
|
+
changes: 0,
|
|
38
|
+
isPlugin: false,
|
|
39
|
+
isHoist: false,
|
|
40
|
+
isExtracted: false,
|
|
41
|
+
isRSC: false,
|
|
42
|
+
runtimeCacheTTL: getCacheTTL(true)
|
|
43
|
+
};
|
|
44
|
+
const RUNTIME_CONFIG = globalData("config.runtime", () => ({ ...RUNTIME_CONFIG_DEFAULT }));
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region config/build.ts
|
|
47
|
+
const BUILD_CONFIG = globalData("config.build", () => ({ current: null }));
|
|
48
|
+
function setBuildConfig(config) {
|
|
49
|
+
BUILD_CONFIG.current = config;
|
|
50
|
+
RUNTIME_CONFIG.isHoist = config.hoist;
|
|
51
|
+
if (config.css) {
|
|
52
|
+
const { debugClassName: _debugClassName, ...css } = config.css;
|
|
53
|
+
Object.assign(CSS_CONFIG, css);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region entry/shared/config.ts
|
|
58
|
+
setBuildConfig(JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG));
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region entry/shared/prod.ts
|
|
61
|
+
RUNTIME_CONFIG.isPlugin = true;
|
|
62
|
+
RUNTIME_CONFIG.isExtracted = true;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region builder/data/const.ts
|
|
65
|
+
const BUILDER_TYPE = symbol("builder.type");
|
|
66
|
+
const BUILDER_STATE = symbol("builder.state");
|
|
67
|
+
symbol("builder.callsite");
|
|
68
|
+
const BUILDER_SLOT_ID = symbol("builder.slotId");
|
|
69
|
+
const BUILDER_SCOPE_ID = symbol("builder.scopeId");
|
|
70
|
+
const BUILDER_SCOPE = symbol("builder.scope");
|
|
71
|
+
symbol("builder.selector");
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region builder/extract/withTokens.ts
|
|
74
|
+
const tokenBoundData = /* @__PURE__ */ new WeakMap();
|
|
75
|
+
function isExtractedTokenBoundData(value) {
|
|
76
|
+
return !!value && (typeof value === "object" || typeof value === "function") && tokenBoundData.has(value);
|
|
77
|
+
}
|
|
78
|
+
function getExtractedTokenBoundData(value) {
|
|
79
|
+
return tokenBoundData.get(value);
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region utils/object.ts
|
|
83
|
+
function hasOwn(target, field) {
|
|
84
|
+
return Object.prototype.hasOwnProperty.call(target, field);
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region builder/token/symbols.ts
|
|
88
|
+
const TOKEN_ID = symbol("style:token");
|
|
89
|
+
const TOKEN_OVERRIDE = symbol("style:token.override");
|
|
90
|
+
symbol("style:token.name");
|
|
91
|
+
const TOKEN_VAR_NAME = symbol("style:token.varName");
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region builder/token/data.ts
|
|
94
|
+
function isStyleTokenData(value) {
|
|
95
|
+
return !!value && typeof value[TOKEN_ID] === "string" && value[TOKEN_OVERRIDE] !== true;
|
|
96
|
+
}
|
|
97
|
+
function isStyleTokenOverrideData(value) {
|
|
98
|
+
return !!value && typeof value[TOKEN_ID] === "string" && value[TOKEN_OVERRIDE] === true;
|
|
99
|
+
}
|
|
100
|
+
function getStyleTokenId(token) {
|
|
101
|
+
return token[TOKEN_ID];
|
|
102
|
+
}
|
|
103
|
+
function getStyleTokenVarName(token) {
|
|
104
|
+
return token[TOKEN_VAR_NAME] ?? null;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region runtime/core/cache/resolvedItem.ts
|
|
108
|
+
const resolvedStyleItems = globalData("runtime.resolvedStyleItems", () => /* @__PURE__ */ new WeakSet());
|
|
109
|
+
const resolvedStyleItemTokenValues = globalData("runtime.styleItemTokenValues", () => /* @__PURE__ */ new WeakMap());
|
|
110
|
+
function markResolvedStyleItem(item) {
|
|
111
|
+
resolvedStyleItems.add(item);
|
|
112
|
+
}
|
|
113
|
+
function isResolvedStyleItem(value) {
|
|
114
|
+
return !!value && typeof value === "object" && resolvedStyleItems.has(value);
|
|
115
|
+
}
|
|
116
|
+
function setResolvedStyleItemTokenValues(item, tokens) {
|
|
117
|
+
resolvedStyleItemTokenValues.set(item, tokens);
|
|
118
|
+
}
|
|
119
|
+
function getResolvedStyleItemTokenValues(item) {
|
|
120
|
+
return resolvedStyleItemTokenValues.get(item) ?? null;
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region runtime/core/cache/utils/tree.ts
|
|
124
|
+
function createCacheTreeNode(value) {
|
|
125
|
+
return {
|
|
126
|
+
children: /* @__PURE__ */ new Map(),
|
|
127
|
+
value
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function getCacheTreeChild(node, key, createValue) {
|
|
131
|
+
let child = node.children.get(key);
|
|
132
|
+
if (!child) {
|
|
133
|
+
child = createCacheTreeNode(createValue());
|
|
134
|
+
node.children.set(key, child);
|
|
135
|
+
}
|
|
136
|
+
return child;
|
|
137
|
+
}
|
|
138
|
+
function createWeakCacheTreeNode(value) {
|
|
139
|
+
return {
|
|
140
|
+
children: /* @__PURE__ */ new WeakMap(),
|
|
141
|
+
value
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function getWeakCacheTreeChild(node, key, createValue) {
|
|
145
|
+
let child = node.children.get(key);
|
|
146
|
+
if (!child) {
|
|
147
|
+
child = createWeakCacheTreeNode(createValue());
|
|
148
|
+
node.children.set(key, child);
|
|
149
|
+
}
|
|
150
|
+
return child;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region atomic/utils/cssVar.ts
|
|
154
|
+
function getCssVar(varName, value) {
|
|
155
|
+
return "var(" + varName + ", " + escapeCssValue(value) + ")";
|
|
156
|
+
}
|
|
157
|
+
function getCssVarRawFallback(varName, fallbackCss) {
|
|
158
|
+
return "var(" + varName + ", " + fallbackCss + ")";
|
|
159
|
+
}
|
|
160
|
+
function escapeCssValue(value) {
|
|
161
|
+
if (!value) return "";
|
|
162
|
+
return value.trim().replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\'").replace(/;/g, "\\;");
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region runtime/extract/token.ts
|
|
166
|
+
function getToken(value) {
|
|
167
|
+
if (isStyleTokenData(value)) return getExtractedTokenVar(value);
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
function getExtractedTokenVarName(token) {
|
|
171
|
+
const varName = getStyleTokenVarName(token);
|
|
172
|
+
if (varName) return varName;
|
|
173
|
+
throw new Error(`Missing extracted token var name for token "${getStyleTokenId(token)}"`);
|
|
174
|
+
}
|
|
175
|
+
function getExtractedTokenVar(token) {
|
|
176
|
+
return getExtractedTokenVarFallback(token);
|
|
177
|
+
}
|
|
178
|
+
function getExtractedTokenOverrideValue(token) {
|
|
179
|
+
return token.ref ? getExtractedTokenVar(token.ref) : token.value;
|
|
180
|
+
}
|
|
181
|
+
function getExtractedTokenVarFallback(token) {
|
|
182
|
+
const varName = getExtractedTokenVarName(token);
|
|
183
|
+
if (token.ref) return getCssVarRawFallback(varName, getExtractedTokenVarFallback(token.ref));
|
|
184
|
+
return getCssVar(varName, String(token.value ?? ""));
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region runtime/core/cache/propCache.ts
|
|
188
|
+
const root = createWeakCacheTreeNode(createCacheValue());
|
|
189
|
+
function getStylePropCacheValue(styleProp, walk, onUnsupported) {
|
|
190
|
+
let node = root;
|
|
191
|
+
let hasItem = false;
|
|
192
|
+
let canCache = true;
|
|
193
|
+
walk(styleProp, (item) => {
|
|
194
|
+
hasItem = true;
|
|
195
|
+
node = getWeakCacheTreeChild(node, item, createCacheValue);
|
|
196
|
+
}, () => {
|
|
197
|
+
canCache = false;
|
|
198
|
+
onUnsupported?.();
|
|
199
|
+
});
|
|
200
|
+
if (!hasItem || !canCache) return null;
|
|
201
|
+
const value = node.value;
|
|
202
|
+
if (value.c !== RUNTIME_CONFIG.changes) {
|
|
203
|
+
value.d = null;
|
|
204
|
+
value.c = RUNTIME_CONFIG.changes;
|
|
205
|
+
}
|
|
206
|
+
return value;
|
|
207
|
+
}
|
|
208
|
+
function createCacheValue() {
|
|
209
|
+
return {
|
|
210
|
+
d: null,
|
|
211
|
+
c: RUNTIME_CONFIG.changes
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region runtime/core/cache/utils/walk.ts
|
|
216
|
+
function walkRecursiveItems(root, fn) {
|
|
217
|
+
if (!root) return;
|
|
218
|
+
const stack = [root];
|
|
219
|
+
while (stack.length > 0) {
|
|
220
|
+
const item = stack.pop();
|
|
221
|
+
if (!item) continue;
|
|
222
|
+
if (Array.isArray(item)) {
|
|
223
|
+
for (let i = item.length - 1; i >= 0; i--) stack.push(item[i]);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
fn(item);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region runtime/core/className.ts
|
|
231
|
+
function mergeClassName(className) {
|
|
232
|
+
if (!className) return void 0;
|
|
233
|
+
if (!Array.isArray(className)) return className;
|
|
234
|
+
let nextClassName = "";
|
|
235
|
+
const stack = [className];
|
|
236
|
+
while (stack.length) {
|
|
237
|
+
const item = stack.pop();
|
|
238
|
+
if (!item) continue;
|
|
239
|
+
if (Array.isArray(item)) for (let index = item.length - 1; index >= 0; index--) stack.push(item[index]);
|
|
240
|
+
else nextClassName = nextClassName ? `${nextClassName} ${item}` : item;
|
|
241
|
+
}
|
|
242
|
+
return nextClassName || void 0;
|
|
243
|
+
}
|
|
244
|
+
function mergeStyle(style) {
|
|
245
|
+
if (!style) return void 0;
|
|
246
|
+
if (!Array.isArray(style)) return style;
|
|
247
|
+
const nextStyle = {};
|
|
248
|
+
const stack = [style];
|
|
249
|
+
while (stack.length) {
|
|
250
|
+
const item = stack.pop();
|
|
251
|
+
if (!item) continue;
|
|
252
|
+
if (Array.isArray(item)) for (let index = item.length - 1; index >= 0; index--) stack.push(item[index]);
|
|
253
|
+
else Object.assign(nextStyle, item);
|
|
254
|
+
}
|
|
255
|
+
return nextStyle;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region runtime/extract/getClassName.ts
|
|
259
|
+
let runId = 0;
|
|
260
|
+
const dedupeRun = Object.create(null);
|
|
261
|
+
const dedupeIndex = Object.create(null);
|
|
262
|
+
const resolvedItemCache = /* @__PURE__ */ new WeakMap();
|
|
263
|
+
const stylePropObjectCache = /* @__PURE__ */ new WeakMap();
|
|
264
|
+
function getClassName(styleProp, props) {
|
|
265
|
+
const resolved = resolveExtractedStyleProp(styleProp);
|
|
266
|
+
if (!props?.className && !props?.style) return resolved ?? {};
|
|
267
|
+
let className = props.className ? mergeClassName(props.className) : void 0;
|
|
268
|
+
let style = props.style ? mergeStyle(props.style) : void 0;
|
|
269
|
+
if (resolved) {
|
|
270
|
+
if (resolved.className) className = className ? className + " " + resolved.className : resolved.className;
|
|
271
|
+
if (resolved.style) style = style ? Object.assign({}, resolved.style, style) : resolved.style;
|
|
272
|
+
}
|
|
273
|
+
return className || style ? {
|
|
274
|
+
className,
|
|
275
|
+
style
|
|
276
|
+
} : {};
|
|
277
|
+
}
|
|
278
|
+
function resolveExtractedStyleProp(styleProp) {
|
|
279
|
+
if (!styleProp) return null;
|
|
280
|
+
if (RUNTIME_CONFIG.runtimeCacheTTL === 0) return resolveExtractedStylePropUncached(styleProp);
|
|
281
|
+
const objectCacheable = typeof styleProp === "object" || typeof styleProp === "function";
|
|
282
|
+
if (objectCacheable) {
|
|
283
|
+
const objectCached = stylePropObjectCache.get(styleProp);
|
|
284
|
+
if (objectCached && objectCached.c === RUNTIME_CONFIG.changes) return objectCached.r;
|
|
285
|
+
}
|
|
286
|
+
const directCached = resolveDirectCachedExtractedStyleProp(styleProp);
|
|
287
|
+
const cached = directCached !== void 0 ? directCached : resolveCachedExtractedStyleProp(styleProp);
|
|
288
|
+
const result = cached !== void 0 ? cached : resolveExtractedStylePropUncached(styleProp);
|
|
289
|
+
if (objectCacheable) stylePropObjectCache.set(styleProp, {
|
|
290
|
+
c: RUNTIME_CONFIG.changes,
|
|
291
|
+
r: result
|
|
292
|
+
});
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
295
|
+
function resolveDirectCachedExtractedStyleProp(styleProp) {
|
|
296
|
+
if (!isResolvedStyleItem(styleProp)) return void 0;
|
|
297
|
+
if (getResolvedStyleItemTokenValues(styleProp)) return void 0;
|
|
298
|
+
const cached = resolvedItemCache.get(styleProp);
|
|
299
|
+
if (cached !== void 0 || resolvedItemCache.has(styleProp)) return cached ?? null;
|
|
300
|
+
const result = resolveExtractedStylePropUncached(styleProp);
|
|
301
|
+
resolvedItemCache.set(styleProp, result);
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
function resolveCachedExtractedStyleProp(styleProp) {
|
|
305
|
+
let unsupported = false;
|
|
306
|
+
const tokenBindings = [];
|
|
307
|
+
const cache = getStylePropCacheValue(styleProp, (item, fn, onUnsupported) => walkExtractedStylePropCachePath(item, fn, tokenBindings, () => {
|
|
308
|
+
unsupported = true;
|
|
309
|
+
onUnsupported();
|
|
310
|
+
}));
|
|
311
|
+
if (!cache || unsupported) return void 0;
|
|
312
|
+
const data = cache.d;
|
|
313
|
+
if (data) {
|
|
314
|
+
if (!tokenBindings.length) return data.r;
|
|
315
|
+
return resolveExtractedStateItemTokens(data, mergeTokenBindings(tokenBindings));
|
|
316
|
+
}
|
|
317
|
+
const items = [];
|
|
318
|
+
const result = resolveExtractedStylePropUncached(styleProp, items, !!tokenBindings.length);
|
|
319
|
+
const nextData = {
|
|
320
|
+
i: items,
|
|
321
|
+
r: result
|
|
322
|
+
};
|
|
323
|
+
cache.d = nextData;
|
|
324
|
+
if (tokenBindings.length) return resolveExtractedStateItemTokens(nextData, mergeTokenBindings(tokenBindings));
|
|
325
|
+
return result;
|
|
326
|
+
}
|
|
327
|
+
function walkExtractedStylePropCachePath(styleProp, fn, tokenBindings, onUnsupported) {
|
|
328
|
+
walkRecursiveItems(styleProp, (item) => {
|
|
329
|
+
if (isExtractedTokenBoundData(item)) {
|
|
330
|
+
const bound = getExtractedTokenBoundData(item);
|
|
331
|
+
if (bound.tokens.length) tokenBindings.push(createTokenValues(bound.tokens));
|
|
332
|
+
fn(bound.data);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (isResolvedStyleItem(item)) {
|
|
336
|
+
const tokens = getResolvedStyleItemTokenValues(item);
|
|
337
|
+
if (tokens) {
|
|
338
|
+
const resolved = item;
|
|
339
|
+
tokenBindings.push(tokens.lookup);
|
|
340
|
+
fn(resolved.data);
|
|
341
|
+
fn(resolved.items);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (item && (typeof item === "object" || typeof item === "function")) {
|
|
346
|
+
fn(item);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
onUnsupported();
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
function resolveExtractedStylePropUncached(styleProp, collectedItems, ignoreTokenStyle) {
|
|
353
|
+
runId++;
|
|
354
|
+
const classNames = [];
|
|
355
|
+
let style;
|
|
356
|
+
const stack = [styleProp];
|
|
357
|
+
while (stack.length) {
|
|
358
|
+
const item = stack.pop();
|
|
359
|
+
if (!item) continue;
|
|
360
|
+
if (Array.isArray(item)) {
|
|
361
|
+
for (let i = item.length - 1; i >= 0; i--) stack.push(item[i]);
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
if (isExtractedTokenBoundData(item)) {
|
|
365
|
+
const bound = getExtractedTokenBoundData(item);
|
|
366
|
+
style = appendExtractedData(classNames, style, bound.data, ignoreTokenStyle ? null : createTokenValues(bound.tokens), collectedItems, ignoreTokenStyle);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
style = appendExtractedData(classNames, style, item, null, collectedItems, ignoreTokenStyle);
|
|
370
|
+
}
|
|
371
|
+
if (!classNames.length && !style) return null;
|
|
372
|
+
return {
|
|
373
|
+
className: classNames.join(" "),
|
|
374
|
+
style
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function appendExtractedData(classNames, style, data, tokens, collectedItems, ignoreTokenStyle) {
|
|
378
|
+
if (!data || typeof data !== "object" && typeof data !== "function") return style;
|
|
379
|
+
const resolvedItems = data.items;
|
|
380
|
+
if (resolvedItems) {
|
|
381
|
+
tokens = mergeResolvedTokenValues(!ignoreTokenStyle && isResolvedStyleItem(data) ? getResolvedStyleItemTokenValues(data) : null, tokens);
|
|
382
|
+
for (let i = 0, len = resolvedItems.length; i < len; i++) {
|
|
383
|
+
collectedItems?.push(resolvedItems[i]);
|
|
384
|
+
style = addStateItem(classNames, style, resolvedItems[i], tokens);
|
|
385
|
+
}
|
|
386
|
+
return style;
|
|
387
|
+
}
|
|
388
|
+
const type = data[BUILDER_TYPE];
|
|
389
|
+
if (type === 6) {
|
|
390
|
+
const className = data.className;
|
|
391
|
+
if (className) classNames.push(className);
|
|
392
|
+
return style;
|
|
393
|
+
}
|
|
394
|
+
if (type !== 1 && type !== 9 && type !== 2) return style;
|
|
395
|
+
const items = data[BUILDER_STATE]?.items;
|
|
396
|
+
if (!items) return style;
|
|
397
|
+
tokens = mergeTokenValuesFromItems(tokens, items);
|
|
398
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
399
|
+
collectedItems?.push(items[i]);
|
|
400
|
+
style = addStateItem(classNames, style, items[i], tokens);
|
|
401
|
+
}
|
|
402
|
+
return style;
|
|
403
|
+
}
|
|
404
|
+
function mergeTokenValuesFromItems(tokens, items) {
|
|
405
|
+
let next = tokens;
|
|
406
|
+
for (let i = 0, len = items.length; i < len; i++) {
|
|
407
|
+
const item = items[i];
|
|
408
|
+
if (!isStyleTokenOverrideData(item)) continue;
|
|
409
|
+
next = mergeTokenValues(next, createTokenValues([item]));
|
|
410
|
+
}
|
|
411
|
+
return next;
|
|
412
|
+
}
|
|
413
|
+
function mergeTokenValues(base, next) {
|
|
414
|
+
if (!next) return base;
|
|
415
|
+
if (!base) return next;
|
|
416
|
+
return {
|
|
417
|
+
...base,
|
|
418
|
+
...next
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function resolveExtractedStateItemTokens(data, tokens) {
|
|
422
|
+
if (!data.r || !data.i.length) return null;
|
|
423
|
+
let style;
|
|
424
|
+
for (let i = 0, len = data.i.length; i < len; i++) style = addStateItemStyle(style, data.i[i], tokens);
|
|
425
|
+
return {
|
|
426
|
+
className: data.r.className,
|
|
427
|
+
style
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function mergeTokenBindings(bindings) {
|
|
431
|
+
if (!bindings.length) return null;
|
|
432
|
+
if (bindings.length === 1) return bindings[0];
|
|
433
|
+
const tokens = Object.create(null);
|
|
434
|
+
for (let i = 0, len = bindings.length; i < len; i++) {
|
|
435
|
+
const next = bindings[i];
|
|
436
|
+
if (next) Object.assign(tokens, next);
|
|
437
|
+
}
|
|
438
|
+
return tokens;
|
|
439
|
+
}
|
|
440
|
+
function addStateItem(classNames, style, item, tokens) {
|
|
441
|
+
const dedupe = getStateItemDedupe(item);
|
|
442
|
+
const className = getStateItemClassName(item);
|
|
443
|
+
if (!dedupe || !className) return addStateItemStyle(style, item, tokens);
|
|
444
|
+
if (dedupeRun[dedupe] === runId) classNames[dedupeIndex[dedupe]] = className;
|
|
445
|
+
else {
|
|
446
|
+
dedupeRun[dedupe] = runId;
|
|
447
|
+
dedupeIndex[dedupe] = classNames.push(className) - 1;
|
|
448
|
+
}
|
|
449
|
+
return addStateItemStyle(style, item, tokens);
|
|
450
|
+
}
|
|
451
|
+
function addStateItemStyle(style, item, tokens) {
|
|
452
|
+
if (isStyleTokenOverrideData(item)) {
|
|
453
|
+
const id = getStyleTokenId(item);
|
|
454
|
+
const value = tokens && tokens[id] !== void 0 ? tokens[id] : item.ref ? getTokenVar(item.ref) : item.value;
|
|
455
|
+
return setStyleValue(style, getTokenVarName(item), value);
|
|
456
|
+
}
|
|
457
|
+
const value = getStateItemValue(item);
|
|
458
|
+
if (Array.isArray(value)) {
|
|
459
|
+
if (value[0] === 1) {
|
|
460
|
+
if (!tokens && isStyleTokenData(value[2])) return style;
|
|
461
|
+
return setStyleValue(style, value[1], normalizeValue(resolveValue(value[2], tokens), value[3]));
|
|
462
|
+
}
|
|
463
|
+
if (value[0] === 3) {
|
|
464
|
+
const refTokens = value[1]?.tokens;
|
|
465
|
+
if (!tokens || !refTokens?.length) return style;
|
|
466
|
+
let next = style;
|
|
467
|
+
for (let i = 0, len = refTokens.length; i < len; i++) {
|
|
468
|
+
const token = refTokens[i];
|
|
469
|
+
const id = getStyleTokenId(token);
|
|
470
|
+
if (tokens[id] !== void 0) next = setStyleValue(next, getTokenVarName(token), tokens[id]);
|
|
471
|
+
}
|
|
472
|
+
return next;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return style;
|
|
476
|
+
}
|
|
477
|
+
function getStateItemDedupe(item) {
|
|
478
|
+
if (Array.isArray(item)) return typeof item[0] === "number" ? item[0] === 1 || item[0] === 9 ? item[1] : item[2] : item[0];
|
|
479
|
+
return "";
|
|
480
|
+
}
|
|
481
|
+
function getStateItemClassName(item) {
|
|
482
|
+
if (Array.isArray(item)) return typeof item[0] === "number" ? item[0] === 1 || item[0] === 9 ? item[2] : item[3] : item[1];
|
|
483
|
+
return "";
|
|
484
|
+
}
|
|
485
|
+
function getStateItemValue(item) {
|
|
486
|
+
if (!Array.isArray(item)) return void 0;
|
|
487
|
+
if (typeof item[0] !== "number") return item[2];
|
|
488
|
+
if (item[0] === 1 || item[0] === 9) return item[3];
|
|
489
|
+
if (item[0] === 2 || item[0] === 3) return item[4];
|
|
490
|
+
}
|
|
491
|
+
function resolveValue(value, tokens) {
|
|
492
|
+
if (isStyleTokenData(value)) {
|
|
493
|
+
if (tokens) {
|
|
494
|
+
const id = getStyleTokenId(value);
|
|
495
|
+
if (tokens[id] !== void 0) return tokens[id];
|
|
496
|
+
}
|
|
497
|
+
return getTokenVar(value);
|
|
498
|
+
}
|
|
499
|
+
return value;
|
|
500
|
+
}
|
|
501
|
+
function normalizeValue(value, valueMode) {
|
|
502
|
+
if (typeof value !== "number") return value;
|
|
503
|
+
return valueMode === 1 ? value + "px" : String(value);
|
|
504
|
+
}
|
|
505
|
+
function createTokenValues(tokens) {
|
|
506
|
+
const values = Object.create(null);
|
|
507
|
+
for (let i = 0, len = tokens.length; i < len; i++) {
|
|
508
|
+
const token = tokens[i];
|
|
509
|
+
if (!isStyleTokenOverrideData(token)) continue;
|
|
510
|
+
values[getStyleTokenId(token)] = token.ref ? getTokenVar(token.ref) : token.value;
|
|
511
|
+
}
|
|
512
|
+
return values;
|
|
513
|
+
}
|
|
514
|
+
function mergeResolvedTokenValues(resolved, tokens) {
|
|
515
|
+
if (!resolved) return tokens;
|
|
516
|
+
if (!tokens) return resolved.lookup;
|
|
517
|
+
return {
|
|
518
|
+
...resolved.lookup,
|
|
519
|
+
...tokens
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function getTokenVarName(token) {
|
|
523
|
+
return getExtractedTokenVarName(token);
|
|
524
|
+
}
|
|
525
|
+
function getTokenVar(token) {
|
|
526
|
+
return getExtractedTokenVar(token);
|
|
527
|
+
}
|
|
528
|
+
function setStyleValue(style, name, value) {
|
|
529
|
+
const next = style ?? {};
|
|
530
|
+
next[name] = value;
|
|
531
|
+
return next;
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
export { CSS_CONFIG as C, RUNTIME_CONFIG as S, BUILDER_SCOPE as _, getToken as a, BUILDER_STATE as b, getResolvedStyleItemTokenValues as c, setResolvedStyleItemTokenValues as d, getStyleTokenId as f, isExtractedTokenBoundData as g, getExtractedTokenBoundData as h, getExtractedTokenOverrideValue as i, isResolvedStyleItem as l, hasOwn as m, mergeClassName as n, createCacheTreeNode as o, isStyleTokenOverrideData as p, mergeStyle as r, getCacheTreeChild as s, getClassName as t, markResolvedStyleItem as u, BUILDER_SCOPE_ID as v, globalData as w, BUILDER_TYPE as x, BUILDER_SLOT_ID as y };
|
|
535
|
+
|
|
536
|
+
//# sourceMappingURL=getClassName-a6p2uMFM.js.map
|