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