@fluentic/style 0.1.0-beta.2 → 0.1.0-beta.4
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 +38 -16
- package/README.md +80 -23
- package/atomic/className.ts +3 -9
- package/atomic/debug/className/className.ts +0 -15
- package/atomic/element.ts +1 -1
- package/atomic/rule.ts +2 -2
- 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/builder/data/const.ts +1 -1
- package/builder/data/merge/style.ts +1 -1
- package/builder/extract/token.ts +30 -14
- 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/compiler/compiler/types.ts +0 -1
- package/compiler/transform/debug/plugin.ts +79 -1
- package/compiler/transform/evaluator/evaluator.ts +76 -26
- package/compiler/transform/evaluator/tracer.ts +11 -1
- package/compiler/transform/extract/chain/chain.ts +8 -5
- package/compiler/transform/extract/plugin.ts +1 -1
- package/compiler/transform/extract/utils/replacement.ts +6 -1
- package/compiler/transform/extract/utils/state.ts +1 -0
- package/compiler/transform/extract/utils/theme.ts +6 -6
- package/compiler/transform/syntax/static_ids.ts +1 -1
- package/compiler/utils/constants.ts +0 -4
- package/config/build.ts +5 -2
- package/config/config/debug.ts +24 -1
- package/config/config/dev.ts +8 -0
- package/config/configure.ts +10 -2
- package/dev/config.ts +2 -3
- package/dialect/namedTokens.ts +22 -5
- package/dist/{className-W2kDyeVl.js → className-Do2Crx4b.js} +2 -3
- package/dist/{className-W2kDyeVl.js.map → className-Do2Crx4b.js.map} +1 -1
- package/dist/{style-CYXTs1iu.js → combine-C9vjpKCs.js} +45 -304
- package/dist/combine-C9vjpKCs.js.map +1 -0
- package/dist/combineStyle-DwAhsOmS.js +26 -0
- package/dist/combineStyle-DwAhsOmS.js.map +1 -0
- package/dist/compiler/index.mjs +1 -1
- package/dist/{compiler-BXcGyZUP.mjs → compiler-CE0ZgkdH.mjs} +274 -128
- package/dist/compiler-CE0ZgkdH.mjs.map +1 -0
- package/dist/config/index.js +2 -2
- package/dist/config-BE5D5x2N.js +2 -0
- package/dist/{config-CLYMN3_p.js → config-BtANtGAh.js} +10 -5
- package/dist/config-BtANtGAh.js.map +1 -0
- package/dist/{config-C1k9vUrM.js → config-CduqubI8.js} +8 -6
- package/dist/config-CduqubI8.js.map +1 -0
- package/dist/config-lJNLh7eM.js +6 -0
- package/dist/config-lJNLh7eM.js.map +1 -0
- package/dist/config-oKOjOTWi.js +7 -0
- package/dist/{config-DcYrUB-M.js.map → config-oKOjOTWi.js.map} +1 -1
- package/dist/{css-CohHH2tn.js → css-BewrRz3_.js} +3 -3
- package/dist/{css-CohHH2tn.js.map → css-BewrRz3_.js.map} +1 -1
- package/dist/{css-DfH4Gb1c.js → css-CiTI58yl.js} +294 -5
- package/dist/css-CiTI58yl.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-D_DL1yOz.js → css-Rc7ILf-3.js} +8 -9
- package/dist/{css-D_DL1yOz.js.map → css-Rc7ILf-3.js.map} +1 -1
- package/dist/css.js +1 -1
- package/dist/{css-CELBp6Gu.js → cssIdent-BsyUXNNk.js} +3 -23
- package/dist/cssIdent-BsyUXNNk.js.map +1 -0
- package/dist/cssVar-DGgQ2GIK.js +92 -0
- package/dist/cssVar-DGgQ2GIK.js.map +1 -0
- package/dist/{css_extra-9BZ_jVET.js → css_extra-BiG57TKN.js} +2 -2
- package/dist/{css_extra-9BZ_jVET.js.map → css_extra-BiG57TKN.js.map} +1 -1
- package/dist/{css_extra-DQdCrYoC.js → css_extra-DYtS3g6Z.js} +2 -2
- package/dist/{css_extra-DQdCrYoC.js.map → css_extra-DYtS3g6Z.js.map} +1 -1
- package/dist/{data-Ze8GNiJm.js → data-D7NFt4JG.js} +205 -11
- package/dist/data-D7NFt4JG.js.map +1 -0
- package/dist/{debug-DLmUG3Vh.js → debug-Cvpo5cVu.js} +4 -3
- package/dist/{debug-DLmUG3Vh.js.map → debug-Cvpo5cVu.js.map} +1 -1
- package/dist/debug-DycdGrul.js +45 -0
- package/dist/debug-DycdGrul.js.map +1 -0
- package/dist/dev/rsc.js +9 -9
- package/dist/{dev-C2u78xuv.js → dev-DdRWa6dJ.js} +8 -8
- package/dist/{dev-C2u78xuv.js.map → dev-DdRWa6dJ.js.map} +1 -1
- package/dist/{dev-4TqJORRn.js → dev-px0_6TNq.js} +11 -5
- package/dist/dev-px0_6TNq.js.map +1 -0
- package/dist/dev.js +1 -1
- package/dist/dialect/extracted/index.js +1 -1
- package/dist/dialect/index.js +1 -1
- package/dist/{elementMarker-BKzZyg5V.js → elementMarker-ng0y3fN0.js} +8 -8
- package/dist/{elementMarker-BKzZyg5V.js.map → elementMarker-ng0y3fN0.js.map} +1 -1
- package/dist/entry/dev/css.js +2 -2
- package/dist/entry/dev/jsx-dev-runtime.js +2 -2
- package/dist/entry/dev/jsx-runtime.js +2 -2
- package/dist/entry/dev.js +11 -12
- package/dist/entry/prod/css.js +2 -2
- package/dist/entry/prod/extract.js +2 -2
- 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 +5 -4
- package/dist/entry/prod.js +40 -11
- package/dist/entry/prod.js.map +1 -1
- package/dist/entry/rsc-dev/css.js +2 -2
- package/dist/entry/rsc-dev/dev.js +4 -5
- 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 +274 -69
- package/dist/entry/rsc-dev.js.map +1 -1
- package/dist/entry/rsc-prod/css.js +2 -2
- 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 +5 -4
- package/dist/entry/rsc-prod.js +16 -10
- package/dist/entry/rsc-prod.js.map +1 -0
- package/dist/extract-B-Vs88ME.js +3 -0
- package/dist/{extract-CzWJeQi8.js → extract-CM8Fk2eK.js} +24 -15
- package/dist/{extract-CzWJeQi8.js.map → extract-CM8Fk2eK.js.map} +1 -1
- package/dist/{getClassName-C6690_nr.js → getClassName-CrNVjAoJ.js} +29 -8
- package/dist/getClassName-CrNVjAoJ.js.map +1 -0
- package/dist/{global-C7GsCW6Y.js → global-CZBlA9E7.js} +3 -3
- package/dist/{global-C7GsCW6Y.js.map → global-CZBlA9E7.js.map} +1 -1
- package/dist/{hash-Bycpk3MR.js → hash-BfeJDf5U.js} +13 -4
- package/dist/hash-BfeJDf5U.js.map +1 -0
- package/dist/index.js +9 -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-Berx-L-r.js → jsx-BY1iFewe.js} +3 -3
- package/dist/{jsx-Berx-L-r.js.map → jsx-BY1iFewe.js.map} +1 -1
- package/dist/{jsx-DsMajv_M.js → jsx-DL-DEAz8.js} +8 -7
- package/dist/{jsx-DsMajv_M.js.map → jsx-DL-DEAz8.js.map} +1 -1
- package/dist/{jsx_dev_runtime-DXlSD6kV.js → jsx_dev_runtime-aAhNYDeS.js} +2 -2
- package/dist/{jsx_dev_runtime-DXlSD6kV.js.map → jsx_dev_runtime-aAhNYDeS.js.map} +1 -1
- package/dist/{jsx_runtime-DPWo5qvV.js → jsx_runtime-C6i1bWlu.js} +2 -2
- package/dist/{jsx_runtime-DPWo5qvV.js.map → jsx_runtime-C6i1bWlu.js.map} +1 -1
- package/dist/{jsx_runtime-CMdEXGNZ.js → jsx_runtime-D7Y5up6H.js} +2 -2
- package/dist/{jsx_runtime-CMdEXGNZ.js.map → jsx_runtime-D7Y5up6H.js.map} +1 -1
- package/dist/{layer-DiNeeTgG.js → layer-BSxAr-hy.js} +4 -4
- package/dist/{layer-DiNeeTgG.js.map → layer-BSxAr-hy.js.map} +1 -1
- package/dist/{loader-DCT1Q9yi.mjs → loader-BmYS_Rju.mjs} +3 -3
- package/dist/{loader-DCT1Q9yi.mjs.map → loader-BmYS_Rju.mjs.map} +1 -1
- package/dist/{misc-o8pviMUi.mjs → misc-BIS_c7BJ.mjs} +2 -2
- package/dist/{misc-o8pviMUi.mjs.map → misc-BIS_c7BJ.mjs.map} +1 -1
- package/dist/{namedTokens-BUa6raTb.js → namedTokens-CN_yhhik.js} +8 -6
- package/dist/namedTokens-CN_yhhik.js.map +1 -0
- package/dist/plugin/farm/index.mjs +2 -2
- package/dist/plugin/nextjs/index.mjs +4 -4
- package/dist/plugin/nextjs/loader.mjs +4 -4
- 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 +1 -1
- package/dist/plugin/vite/index.mjs +3 -3
- package/dist/plugin/webpack/index.mjs +1 -1
- package/dist/plugin/webpack/loader.mjs +2 -2
- package/dist/presets/tailwind/index.js +8 -5
- package/dist/presets/tailwind/index.js.map +1 -1
- package/dist/{property-BzZSTVIh.js → property-BuLbzviK.js} +2 -2
- package/dist/{property-BzZSTVIh.js.map → property-BuLbzviK.js.map} +1 -1
- package/dist/{registry-D3x1EDJm.mjs → registry-IaXmLQzA.mjs} +2 -2
- package/dist/{registry-D3x1EDJm.mjs.map → registry-IaXmLQzA.mjs.map} +1 -1
- package/dist/{rules-Dz7Pu2K6.js → rules-CxVzovt-.js} +60 -23
- package/dist/rules-CxVzovt-.js.map +1 -0
- package/dist/selector-A-mRmMnI.js +64 -0
- package/dist/selector-A-mRmMnI.js.map +1 -0
- package/dist/server.js +12 -13
- package/dist/server.js.map +1 -1
- package/dist/{shared-B_gJf5uj.cjs → shared-CaJuvw03.cjs} +270 -124
- package/dist/shared-CaJuvw03.cjs.map +1 -0
- package/dist/{shared-uAzFeq0x.mjs → shared-DdPTZ0O3.mjs} +4 -4
- package/dist/{shared-uAzFeq0x.mjs.map → shared-DdPTZ0O3.mjs.map} +1 -1
- package/dist/sheet-BWBzuy4D.js +7 -0
- package/dist/{sheet-DasbRnvy.js.map → sheet-BWBzuy4D.js.map} +1 -1
- package/dist/{sidecar-BUO1hKXu.mjs → sidecar-B3oCK9vC.mjs} +3 -3
- package/dist/{sidecar-BUO1hKXu.mjs.map → sidecar-B3oCK9vC.mjs.map} +1 -1
- package/dist/{style-BkeAZl0n.js → style-CGaJndOl.js} +102 -54
- package/dist/style-CGaJndOl.js.map +1 -0
- package/dist/{style-DUztHzBz.js → style-DDxjKdX0.js} +354 -48
- package/dist/style-DDxjKdX0.js.map +1 -0
- package/dist/style-S7LTQbRu.js +5 -0
- package/dist/{styleStore-DVDp-gI-.js → styleStore-0fARJlZV.js} +6 -6
- package/dist/{styleStore-DVDp-gI-.js.map → styleStore-0fARJlZV.js.map} +1 -1
- package/dist/{styleStore-BGJ2ZYtK.js → styleStore-CajcAEPO.js} +101 -223
- package/dist/styleStore-CajcAEPO.js.map +1 -0
- package/dist/symbols-Cp4ymzKF.js +14 -0
- package/dist/symbols-Cp4ymzKF.js.map +1 -0
- package/dist/token-D-S-4_mN.js +138 -0
- package/dist/token-D-S-4_mN.js.map +1 -0
- package/dist/{trace-D0IL6JT8.js → trace-CFnhyCVf.js} +2 -2
- package/dist/{trace-D0IL6JT8.js.map → trace-CFnhyCVf.js.map} +1 -1
- package/dist/{trace-DR7_Rpkg.js → trace-ZtgeY-8s.js} +3 -3
- package/dist/{trace-DR7_Rpkg.js.map → trace-ZtgeY-8s.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/{utils-CpA-dSpY.mjs → utils-B5Xqf1lV.mjs} +4 -4
- package/dist/{utils-CpA-dSpY.mjs.map → utils-B5Xqf1lV.mjs.map} +1 -1
- package/dist/{utils-D4YWF2K0.js → utils-B_VhPBHH.js} +4 -4
- package/dist/{utils-D4YWF2K0.js.map → utils-B_VhPBHH.js.map} +1 -1
- package/dist/{utils-R6QadAsY.js → utils-CDUaX81o.js} +3 -3
- package/dist/{utils-R6QadAsY.js.map → utils-CDUaX81o.js.map} +1 -1
- package/dist/{utils-DQGa0uzS.mjs → utils-DaAiEEIG.mjs} +3 -3
- package/dist/{utils-DQGa0uzS.mjs.map → utils-DaAiEEIG.mjs.map} +1 -1
- package/dist/{utils-BsbfH6cd.js → utils-DzydRwYo.js} +77 -49
- package/dist/utils-DzydRwYo.js.map +1 -0
- package/dist/utils.js +3 -3
- package/dist/value-C0JRsyax.js +64 -0
- package/dist/value-C0JRsyax.js.map +1 -0
- package/dist/{value-DBtSe-9B.js → value-D08AocUs.js} +115 -62
- package/dist/value-D08AocUs.js.map +1 -0
- package/dist/{valueRef-CsLVJwjA.js → valueRef-M3E1oza7.js} +2 -2
- package/dist/{valueRef-CsLVJwjA.js.map → valueRef-M3E1oza7.js.map} +1 -1
- package/dist/{webpack-Fb9xF5jS.mjs → webpack-CHydnRXB.mjs} +5 -5
- package/dist/{webpack-Fb9xF5jS.mjs.map → webpack-CHydnRXB.mjs.map} +1 -1
- package/dist/{withTokens-LRidu3Vc.js → withTokens-DAzUIPvA.js} +2 -2
- package/dist/{withTokens-LRidu3Vc.js.map → withTokens-DAzUIPvA.js.map} +1 -1
- 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_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/package.json +1 -1
- package/plugin/bundler/parcel/optimizer.ts +1 -0
- package/presets/tailwind/style/transform.ts +9 -3
- package/runtime/core/cache/combine.ts +44 -25
- package/runtime/core/cache/combineRuntime.ts +4 -0
- package/runtime/core/cache/index.ts +2 -1
- package/runtime/core/cache/item.ts +2 -2
- package/runtime/core/cache/pool.ts +15 -30
- package/runtime/core/cache/prop.ts +3 -2
- package/runtime/core/cache/token.ts +20 -0
- package/runtime/core/cache/tokenValues.ts +19 -11
- package/runtime/extract/combineStyle.ts +37 -0
- package/runtime/extract/getClassName.ts +5 -11
- package/runtime/extract/index.ts +3 -1
- package/runtime/extract/token.ts +41 -0
- package/runtime/extract/tokenResolver.ts +17 -0
- package/runtime/style/style.ts +2 -1
- package/style/style.ts +1 -1
- 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/value.ts +26 -11
- package/style/valueRef.ts +1 -1
- package/utils/global.ts +1 -3
- package/utils/symbol.ts +3 -0
- package/dist/className-Cuh2JNxO.js +0 -263
- package/dist/className-Cuh2JNxO.js.map +0 -1
- package/dist/compiler-BXcGyZUP.mjs.map +0 -1
- package/dist/config-C1k9vUrM.js.map +0 -1
- package/dist/config-CLYMN3_p.js.map +0 -1
- package/dist/config-DcYrUB-M.js +0 -6
- package/dist/config-oI_yS50f.js +0 -1
- package/dist/css-CELBp6Gu.js.map +0 -1
- package/dist/css-DfH4Gb1c.js.map +0 -1
- package/dist/data-Ze8GNiJm.js.map +0 -1
- package/dist/debug-BefbXMq1.js +0 -15
- package/dist/debug-BefbXMq1.js.map +0 -1
- package/dist/debug-OG2wSB5R.js +0 -15
- package/dist/debug-OG2wSB5R.js.map +0 -1
- package/dist/dev-4TqJORRn.js.map +0 -1
- package/dist/extract-B9j4TBkU.js +0 -2
- package/dist/getClassName-C6690_nr.js.map +0 -1
- package/dist/global-zaCE-g1C.js.map +0 -1
- package/dist/hash-Bycpk3MR.js.map +0 -1
- package/dist/namedTokens-BUa6raTb.js.map +0 -1
- package/dist/rules-Dz7Pu2K6.js.map +0 -1
- package/dist/runtime-B3jHW9B1.js +0 -32
- package/dist/runtime-B3jHW9B1.js.map +0 -1
- package/dist/shared-B_gJf5uj.cjs.map +0 -1
- package/dist/sheet-DasbRnvy.js +0 -7
- package/dist/style-B0F1sgRZ.js +0 -5
- package/dist/style-BkeAZl0n.js.map +0 -1
- package/dist/style-CYXTs1iu.js.map +0 -1
- package/dist/style-DUztHzBz.js.map +0 -1
- package/dist/styleStore-BGJ2ZYtK.js.map +0 -1
- package/dist/token-CA1j7suG.js +0 -273
- package/dist/token-CA1j7suG.js.map +0 -1
- package/dist/token-CKXUECuU.js +0 -76
- package/dist/token-CKXUECuU.js.map +0 -1
- package/dist/token-DTOyFLmp.js +0 -58
- package/dist/token-DTOyFLmp.js.map +0 -1
- package/dist/utils-BsbfH6cd.js.map +0 -1
- package/dist/value-CJG6EWe8.js +0 -85
- package/dist/value-CJG6EWe8.js.map +0 -1
- package/dist/value-D-ZcRzLA.js +0 -42
- package/dist/value-D-ZcRzLA.js.map +0 -1
- package/dist/value-DBtSe-9B.js.map +0 -1
package/dist/entry/rsc-dev.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { H as
|
|
2
|
-
import { A as
|
|
3
|
-
import { o as getClassName } from "../utils-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as createElement } from "../jsx_runtime-DPWo5qvV.js";
|
|
1
|
+
import { C as TOKEN_OVERRIDE, F as createNameFormatter, G as LayerPlaceholder, H as DEBUG_CONFIG, I as configureStyleRuntime, K as RUNTIME_CONFIG, L as DEV_CONFIG, P as getIdentifierSafeHash, S as TOKEN_NAME, U as CSS_CONFIG, V as hashString, X as symbol, _ as getStyleTokenName, b as isStyleTokenOverrideData, d as createStyleToken, f as createStyleTokenOverride, g as getStyleTokenId, h as getChildStyleTokenName, l as getCssVarRawFallback, m as resetStyleTokenIdCounter, n as shouldAppendCssPx, o as getTokenVar, p as getStyleTokenOverrideDebug, u as TOKEN_DEBUG, v as getStyleTokenVarName, w as TOKEN_VAR_NAME, x as TOKEN_ID, y as isStyleTokenData } from "../value-D08AocUs.js";
|
|
2
|
+
import { A as getScopeTargetSlotId, B as BUILDER_STATE, C as getStyleTokenValues, D as getExtractedTokenBoundData, E as isCombinedStyle, F as isStyleData, I as BUILDER_CALLSITE, L as BUILDER_SCOPE, M as isScopeTargetData, N as isSlotData, O as isExtractedTokenBoundData, P as isSlotOverrideData, R as BUILDER_SCOPE_ID, S as createCombinedStyleTokenWrapper, T as getCombinedStyleStyles, V as BUILDER_TYPE, _ as mergeTokenValues, at as getTraceCallsiteId, b as getCacheTreeChild, c as createThemeClassName, ct as traceCallsite, dt as normalizeDebugKeywordValue, f as addTokenOverride$1, ft as normalizePropertyName, g as mergeTokenOverrides, h as finishTokenValues, it as getDebugFieldVarName, j as isScopeData, k as getScopeTargetScope, l as getSelectorHash, lt as traceError, m as createMutableTokenValues, nt as getDebugCallsiteId, ot as isDebugData, p as addTokenValues, pt as sanitizeDebugPropertyName, rt as getDebugFieldCallsite, tt as getDebugCallsite, u as getSelectorText, ut as traceMarker, v as runtimeTokenValueResolver, w as getCombinedStyleScopes, x as createCombinedStyleFacade, y as createCacheTreeNode, z as BUILDER_SLOT_ID } from "../styleStore-CajcAEPO.js";
|
|
3
|
+
import { o as getClassName } from "../utils-CDUaX81o.js";
|
|
4
|
+
import { c as createIdCounter, d as createAtRuleRef, f as isAtRuleRef, l as getId, r as createKeyframes, u as AT_RULE_REF } from "../css-BewrRz3_.js";
|
|
5
|
+
import { n as createElement } from "../jsx_runtime-C6i1bWlu.js";
|
|
7
6
|
import { SelectorType, parse } from "css-what";
|
|
8
7
|
//#region runtime/style/scope.ts
|
|
9
8
|
function combineScope(...scopes) {
|
|
@@ -41,23 +40,13 @@ function resolveScopeTargets(target, scopes) {
|
|
|
41
40
|
//#region runtime/core/cache/pool.ts
|
|
42
41
|
const DEFAULT_TTL = 1e3 * 60 * 5;
|
|
43
42
|
const TOKEN_WRAPPER_CACHE_LIMIT = 32;
|
|
44
|
-
|
|
45
|
-
let configuredPoolTTL = -1;
|
|
46
|
-
function getCombinedStylePool() {
|
|
47
|
-
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
48
|
-
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
49
|
-
configuredPool = createCombinedStylePool(ttl);
|
|
50
|
-
configuredPoolTTL = ttl;
|
|
51
|
-
}
|
|
52
|
-
return configuredPool;
|
|
53
|
-
}
|
|
54
|
-
function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
43
|
+
function createCombinedStylePool(resolver, ttl = DEFAULT_TTL) {
|
|
55
44
|
const root = createPoolNode();
|
|
56
45
|
let timer = null;
|
|
57
46
|
return {
|
|
58
47
|
get(styles, inheritedScopes, items, prevTokensData = null) {
|
|
59
48
|
if (ttl === 0) {
|
|
60
|
-
const collected = collectItems(null, items, prevTokensData);
|
|
49
|
+
const collected = collectItems(null, items, prevTokensData, resolver);
|
|
61
50
|
return {
|
|
62
51
|
style: createCombinedStyleFacade(styles, concatScopes(inheritedScopes, collected.scopes)),
|
|
63
52
|
tokenCache: null,
|
|
@@ -67,7 +56,7 @@ function createCombinedStylePool(ttl = DEFAULT_TTL) {
|
|
|
67
56
|
const now = Date.now();
|
|
68
57
|
let node = getPoolChild(root, styles);
|
|
69
58
|
node = walkScopes(node, inheritedScopes);
|
|
70
|
-
const collected = collectItems(node, items, prevTokensData);
|
|
59
|
+
const collected = collectItems(node, items, prevTokensData, resolver);
|
|
71
60
|
node = collected.node ?? node;
|
|
72
61
|
node.value.updatedAt = now;
|
|
73
62
|
if (node.value.style) {
|
|
@@ -124,17 +113,17 @@ function getTokenWrapperCache(node) {
|
|
|
124
113
|
function getTokenWrapperCacheKey(tokens) {
|
|
125
114
|
return tokens.ids.join("") + "" + tokens.values.join("");
|
|
126
115
|
}
|
|
127
|
-
function collectItems(node, items, prevTokensData) {
|
|
116
|
+
function collectItems(node, items, prevTokensData, resolver) {
|
|
128
117
|
const scopes = [];
|
|
129
118
|
const tokens = createMutableTokenValues(prevTokensData);
|
|
130
119
|
let currentNode = node;
|
|
131
120
|
for (let i = 0, len = items.length; i < len; i++) {
|
|
132
121
|
const item = items[i];
|
|
133
|
-
if (addTokenOverride$1(tokens, item)) continue;
|
|
122
|
+
if (addTokenOverride$1(tokens, item, resolver)) continue;
|
|
134
123
|
if (isScopeTargetData(item)) {
|
|
135
124
|
scopes.push(item);
|
|
136
125
|
currentNode = currentNode ? walkScope(currentNode, item) : null;
|
|
137
|
-
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item)));
|
|
126
|
+
addTokenValues(tokens, getScopeTokenValues(currentNode, getScopeTargetScope(item), resolver));
|
|
138
127
|
}
|
|
139
128
|
}
|
|
140
129
|
const tokensData = finishTokenValues(prevTokensData, tokens);
|
|
@@ -162,17 +151,16 @@ function walkScope(node, scope) {
|
|
|
162
151
|
node = getPoolChild(node, getScopeTargetSlotId(scope));
|
|
163
152
|
return node;
|
|
164
153
|
}
|
|
165
|
-
function getScopeTokenValues(node, scope) {
|
|
166
|
-
|
|
167
|
-
if (node && node.value.h && node.value.f === tokenNameFormat) return node.value.s;
|
|
154
|
+
function getScopeTokenValues(node, scope, resolver) {
|
|
155
|
+
if (node && node.value.h && node.value.f === resolver.key) return node.value.s;
|
|
168
156
|
const values = createMutableTokenValues(null);
|
|
169
157
|
const items = scope[BUILDER_STATE].items;
|
|
170
|
-
for (let i = 0, len = items.length; i < len; i++) addTokenOverride$1(values, items[i]);
|
|
158
|
+
for (let i = 0, len = items.length; i < len; i++) addTokenOverride$1(values, items[i], resolver);
|
|
171
159
|
const tokens = finishTokenValues(null, values);
|
|
172
160
|
if (node) {
|
|
173
161
|
node.value.h = true;
|
|
174
162
|
node.value.s = tokens;
|
|
175
|
-
node.value.f =
|
|
163
|
+
node.value.f = resolver.key;
|
|
176
164
|
}
|
|
177
165
|
return tokens;
|
|
178
166
|
}
|
|
@@ -213,30 +201,39 @@ function cleanupNode(node, now, ttl) {
|
|
|
213
201
|
}
|
|
214
202
|
//#endregion
|
|
215
203
|
//#region runtime/core/cache/combine.ts
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return
|
|
204
|
+
function createCombinedStyleGetter(resolver) {
|
|
205
|
+
let configuredPool = null;
|
|
206
|
+
let configuredPoolTTL = -1;
|
|
207
|
+
return function getConfiguredCombinedStyle(styles, args) {
|
|
208
|
+
const ttl = RUNTIME_CONFIG.runtimeCacheTTL;
|
|
209
|
+
if (!configuredPool || configuredPoolTTL !== ttl) {
|
|
210
|
+
configuredPool = createCombinedStylePool(resolver, ttl);
|
|
211
|
+
configuredPoolTTL = ttl;
|
|
212
|
+
}
|
|
213
|
+
const normalized = normalizeStyleItems(styles, args, resolver);
|
|
214
|
+
const result = configuredPool.get(styles, normalized.inheritedScopes, normalized.items, normalized.tokens);
|
|
215
|
+
return result.tokens ? getCachedTokenWrapper(result.tokenCache, result.tokens, () => createCombinedStyleTokenWrapper(result.style, result.tokens)) : result.style;
|
|
216
|
+
};
|
|
220
217
|
}
|
|
221
|
-
function normalizeStyleItems(styles, args) {
|
|
218
|
+
function normalizeStyleItems(styles, args, resolver) {
|
|
222
219
|
const result = {
|
|
223
220
|
inheritedScopes: [],
|
|
224
221
|
items: [],
|
|
225
222
|
tokens: null
|
|
226
223
|
};
|
|
227
|
-
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result);
|
|
224
|
+
for (let i = 0, len = args.length; i < len; i++) collectStyleArg(styles, args[i], result, resolver);
|
|
228
225
|
return result;
|
|
229
226
|
}
|
|
230
|
-
function collectStyleArg(styles, arg, result) {
|
|
227
|
+
function collectStyleArg(styles, arg, result, resolver) {
|
|
231
228
|
if (!arg) return;
|
|
232
229
|
if (Array.isArray(arg)) {
|
|
233
|
-
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result);
|
|
230
|
+
for (let i = 0, len = arg.length; i < len; i++) collectStyleArg(styles, arg[i], result, resolver);
|
|
234
231
|
return;
|
|
235
232
|
}
|
|
236
233
|
if (RUNTIME_CONFIG.isHoist && isExtractedTokenBoundData(arg)) {
|
|
237
234
|
const bound = getExtractedTokenBoundData(arg);
|
|
238
|
-
result.tokens = mergeTokenOverrides(result.tokens, bound.tokens);
|
|
239
|
-
collectStyleArg(styles, bound.data, result);
|
|
235
|
+
result.tokens = mergeTokenOverrides(result.tokens, bound.tokens, resolver);
|
|
236
|
+
collectStyleArg(styles, bound.data, result, resolver);
|
|
240
237
|
return;
|
|
241
238
|
}
|
|
242
239
|
if (isCombinedStyle(arg)) {
|
|
@@ -249,6 +246,9 @@ function collectStyleArg(styles, arg, result) {
|
|
|
249
246
|
result.items.push(arg);
|
|
250
247
|
}
|
|
251
248
|
//#endregion
|
|
249
|
+
//#region runtime/core/cache/combineRuntime.ts
|
|
250
|
+
const getCombinedStyle = createCombinedStyleGetter(runtimeTokenValueResolver);
|
|
251
|
+
//#endregion
|
|
252
252
|
//#region runtime/style/style.ts
|
|
253
253
|
const combineStyleBase = (styles, ...args) => getCombinedStyle(styles, args);
|
|
254
254
|
const combineStyleFor = (styles) => {
|
|
@@ -468,6 +468,200 @@ function createThemeData(callsite, id, className, tokens) {
|
|
|
468
468
|
tokens
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
|
+
const formatClassName = createNameFormatter([
|
|
472
|
+
"atRule",
|
|
473
|
+
"scopeSelector",
|
|
474
|
+
"property",
|
|
475
|
+
"selector",
|
|
476
|
+
"value"
|
|
477
|
+
]);
|
|
478
|
+
const formatTransformClassName = createNameFormatter(["className"]);
|
|
479
|
+
function getDebugClassName(format, hash, info) {
|
|
480
|
+
return formatClassName(format || "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash", hash, info);
|
|
481
|
+
}
|
|
482
|
+
function getDebugTransformClassName(format, hash, info) {
|
|
483
|
+
return formatTransformClassName(format || "(className)--$hash", hash, info);
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region atomic/debug/value.ts
|
|
487
|
+
function getDebugValueName(value) {
|
|
488
|
+
if (!value) return {
|
|
489
|
+
value: null,
|
|
490
|
+
arbitraryValue: null
|
|
491
|
+
};
|
|
492
|
+
const normalized = value.trim().toLowerCase();
|
|
493
|
+
if (!normalized) return {
|
|
494
|
+
value: null,
|
|
495
|
+
arbitraryValue: null
|
|
496
|
+
};
|
|
497
|
+
if (normalized.startsWith("url") || normalized.includes("gradient") || normalized.startsWith("image") || normalized.startsWith("calc(") || normalized.startsWith("var(") || normalized.startsWith("env(") || normalized.startsWith("rgb") || normalized.startsWith("hsl")) return {
|
|
498
|
+
value: null,
|
|
499
|
+
arbitraryValue: null
|
|
500
|
+
};
|
|
501
|
+
if (/^[a-z][a-z0-9-]*$/.test(normalized)) return {
|
|
502
|
+
value: normalized,
|
|
503
|
+
arbitraryValue: null
|
|
504
|
+
};
|
|
505
|
+
const name = normalized.replace(/px/g, "").replace(/rem/g, "rem").replace(/em/g, "em").replace(/%/g, "pct").replace(/fr/g, "fr").replace(/[,()"'#]/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9._%-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
506
|
+
if (!name) return {
|
|
507
|
+
value: null,
|
|
508
|
+
arbitraryValue: null
|
|
509
|
+
};
|
|
510
|
+
return {
|
|
511
|
+
value: null,
|
|
512
|
+
arbitraryValue: name
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region atomic/debug/property/data.ts
|
|
517
|
+
const PROPERTY_ALIASES = {
|
|
518
|
+
"border-radius": "radius",
|
|
519
|
+
"flex-direction": "flex",
|
|
520
|
+
"font-style": "font",
|
|
521
|
+
"font-weight": "font",
|
|
522
|
+
"grid-template-columns": "grid-cols",
|
|
523
|
+
"grid-template-rows": "grid-rows",
|
|
524
|
+
"align-items": "items",
|
|
525
|
+
"justify-content": "justify",
|
|
526
|
+
"z-index": "zindex",
|
|
527
|
+
"pointer-events": "pointer"
|
|
528
|
+
};
|
|
529
|
+
const KEYWORD_VALUE_PROPERTIES = new Set([
|
|
530
|
+
"align-content",
|
|
531
|
+
"align-items",
|
|
532
|
+
"align-self",
|
|
533
|
+
"background-repeat",
|
|
534
|
+
"background-size",
|
|
535
|
+
"border-collapse",
|
|
536
|
+
"border-style",
|
|
537
|
+
"box-sizing",
|
|
538
|
+
"clear",
|
|
539
|
+
"cursor",
|
|
540
|
+
"display",
|
|
541
|
+
"flex-direction",
|
|
542
|
+
"flex-wrap",
|
|
543
|
+
"float",
|
|
544
|
+
"font-weight",
|
|
545
|
+
"font-style",
|
|
546
|
+
"justify-content",
|
|
547
|
+
"justify-items",
|
|
548
|
+
"justify-self",
|
|
549
|
+
"list-style-position",
|
|
550
|
+
"list-style-type",
|
|
551
|
+
"object-fit",
|
|
552
|
+
"object-position",
|
|
553
|
+
"overflow",
|
|
554
|
+
"overflow-x",
|
|
555
|
+
"overflow-y",
|
|
556
|
+
"pointer-events",
|
|
557
|
+
"place-content",
|
|
558
|
+
"place-items",
|
|
559
|
+
"place-self",
|
|
560
|
+
"position",
|
|
561
|
+
"resize",
|
|
562
|
+
"table-layout",
|
|
563
|
+
"text-align",
|
|
564
|
+
"text-decoration-line",
|
|
565
|
+
"text-transform",
|
|
566
|
+
"user-select",
|
|
567
|
+
"vertical-align",
|
|
568
|
+
"visibility",
|
|
569
|
+
"white-space"
|
|
570
|
+
]);
|
|
571
|
+
const ARBITRARY_VALUE_PROPERTIES = new Set(["font-weight"]);
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region atomic/debug/property/property.ts
|
|
574
|
+
function getDebugPropertyName(property, value) {
|
|
575
|
+
if (!property) return null;
|
|
576
|
+
const normalized = normalizePropertyName(property);
|
|
577
|
+
const name = PROPERTY_ALIASES[normalized] || sanitizeDebugPropertyName(normalized);
|
|
578
|
+
if (!name) return null;
|
|
579
|
+
return {
|
|
580
|
+
property: name,
|
|
581
|
+
...withKeywordValueFallback(normalized, value, withArbitraryValueFallback(normalized, getDebugValueName(value)))
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function withArbitraryValueFallback(property, valueName) {
|
|
585
|
+
if (!valueName.arbitraryValue || ARBITRARY_VALUE_PROPERTIES.has(property)) return valueName;
|
|
586
|
+
return {
|
|
587
|
+
value: valueName.value,
|
|
588
|
+
arbitraryValue: null
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function withKeywordValueFallback(property, value, valueName) {
|
|
592
|
+
if (valueName.value || valueName.arbitraryValue) return valueName;
|
|
593
|
+
if (!KEYWORD_VALUE_PROPERTIES.has(property)) return valueName;
|
|
594
|
+
const normalized = normalizeDebugKeywordValue(value);
|
|
595
|
+
if (!normalized) return valueName;
|
|
596
|
+
return {
|
|
597
|
+
value: normalized,
|
|
598
|
+
arbitraryValue: null
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region atomic/debug/selector.ts
|
|
603
|
+
function getDebugSelectorName(selector) {
|
|
604
|
+
if (!selector) return null;
|
|
605
|
+
const normalized = selector.trim().toLowerCase();
|
|
606
|
+
if (/^[a-z0-9]+$/.test(normalized)) return null;
|
|
607
|
+
return validateName(normalized.replace(/\$\$/g, "args").replace(/\$/g, "arg").replace(/\.\.\./g, "merge").replace(/:not\(/g, "not-").replace(/:(is|where|has)\(/g, "$1-").replace(/:nth-(child|of-type)\(/g, "nth-").replace(/[.#]/g, "-").replace(/[[\]()]/g, "-").replace(/:+/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9_-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
|
|
608
|
+
}
|
|
609
|
+
function getDebugAtRuleName(selector) {
|
|
610
|
+
if (!selector || Array.isArray(selector) && selector.length === 0) return null;
|
|
611
|
+
return validateName((Array.isArray(selector) ? selector.map(parseAtRule).filter(Boolean).join("-") : parseAtRule(selector)).replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
|
|
612
|
+
}
|
|
613
|
+
function compressQuery(query) {
|
|
614
|
+
return query.trim().toLowerCase().replace(/prefers-color-scheme\s*:\s*dark/g, "dark").replace(/prefers-color-scheme\s*:\s*light/g, "light").replace(/min-width\s*:\s*/g, "min-").replace(/max-width\s*:\s*/g, "max-").replace(/min-height\s*:\s*/g, "minh-").replace(/max-height\s*:\s*/g, "maxh-").replace(/inline-size/g, "inline").replace(/\b(and|or|only|not)\b/g, "").replace(/>=/g, "-gte-").replace(/<=/g, "-lte-").replace(/>/g, "-gt-").replace(/</g, "-lt-").replace(/[():=\s]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
615
|
+
}
|
|
616
|
+
function validateName(name) {
|
|
617
|
+
if (!name || name === "selector" || name.length < 2) return null;
|
|
618
|
+
return name;
|
|
619
|
+
}
|
|
620
|
+
function parseAtRule(rule) {
|
|
621
|
+
const normalized = rule.trim().toLowerCase();
|
|
622
|
+
if (normalized.startsWith("@media")) return compressQuery(normalized.slice(6));
|
|
623
|
+
if (normalized.startsWith("@container")) return compressQuery(normalized.slice(10));
|
|
624
|
+
if (normalized.startsWith("@supports")) return compressQuery(normalized.slice(9));
|
|
625
|
+
return compressQuery(normalized);
|
|
626
|
+
}
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region atomic/className.ts
|
|
629
|
+
function getAtomicClassName(property, priority, value, selector, parentSelector, atRule, callsite, localClassName, debugClassName, classNameFormat, transformClassName, transformClassNameFormat, hashLength = null) {
|
|
630
|
+
let hash = property;
|
|
631
|
+
hash += "\n" + (priority || "");
|
|
632
|
+
hash += "\n" + value;
|
|
633
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
634
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
635
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
636
|
+
hash += "\n" + getCallsiteHash(callsite, localClassName);
|
|
637
|
+
hash = getIdentifierSafeHash(hash, hashLength ?? getRuntimeClassNameHashLength(debugClassName));
|
|
638
|
+
if (!debugClassName) return hash;
|
|
639
|
+
if (transformClassName) return getDebugTransformClassName(transformClassNameFormat, hash, { className: transformClassName });
|
|
640
|
+
const propertyName = getDebugPropertyName(property, value);
|
|
641
|
+
return getDebugClassName(classNameFormat, hash, {
|
|
642
|
+
atRule: atRule ? getDebugAtRuleName(atRule.map(getSelectorText)) : null,
|
|
643
|
+
scopeSelector: parentSelector ? getDebugSelectorName(getSelectorText(parentSelector)) : null,
|
|
644
|
+
selector: selector ? getDebugSelectorName(getSelectorText(selector)) : null,
|
|
645
|
+
property: propertyName ? propertyName.property : property,
|
|
646
|
+
value: propertyName ? propertyName.value ?? propertyName.arbitraryValue : null
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function getRuntimeClassNameHashLength(debugClassName) {
|
|
650
|
+
if (debugClassName && DEV_CONFIG.isDev) return DEV_CONFIG.hashLength ?? CSS_CONFIG.hashLength ?? 3;
|
|
651
|
+
return CSS_CONFIG.hashLength ?? 7;
|
|
652
|
+
}
|
|
653
|
+
function getClassNameDedupe(property, priority, selector, parentSelector, atRule) {
|
|
654
|
+
let hash = property;
|
|
655
|
+
hash += "\n" + (priority || "");
|
|
656
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
657
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
658
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
659
|
+
return hashString(hash);
|
|
660
|
+
}
|
|
661
|
+
function getCallsiteHash(callsite, localClassName) {
|
|
662
|
+
if (!localClassName || !callsite) return "";
|
|
663
|
+
return callsite.filePath + "\n" + callsite.line + ":" + callsite.column;
|
|
664
|
+
}
|
|
471
665
|
//#endregion
|
|
472
666
|
//#region builder/data/merge/utils.ts
|
|
473
667
|
function cloneData(data, source, debug, merge = true) {
|
|
@@ -1603,22 +1797,47 @@ function createTheme(tokens, stableId, callsite) {
|
|
|
1603
1797
|
return createThemeData(callsite ?? null, id, className, tokens);
|
|
1604
1798
|
}
|
|
1605
1799
|
//#endregion
|
|
1800
|
+
//#region style/tokens.ts
|
|
1801
|
+
function createTokens(values, stableId) {
|
|
1802
|
+
const tokens = {};
|
|
1803
|
+
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1804
|
+
const value = values[i];
|
|
1805
|
+
tokens[value] = createStyleToken(value, getChildStableId$1(stableId, String(i)), getChildStyleTokenName(stableId, String(i)));
|
|
1806
|
+
}
|
|
1807
|
+
else assignTokenRecord(tokens, values, stableId, stableId ?? null);
|
|
1808
|
+
return tokens;
|
|
1809
|
+
}
|
|
1810
|
+
function assignTokenRecord(target, values, stableId, debugName) {
|
|
1811
|
+
for (let key in values) {
|
|
1812
|
+
const value = values[key];
|
|
1813
|
+
const childName = getChildStyleTokenName(debugName, key);
|
|
1814
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1815
|
+
const child = {};
|
|
1816
|
+
target[key] = child;
|
|
1817
|
+
assignTokenRecord(child, value, getChildStableId$1(stableId, key), childName);
|
|
1818
|
+
} else target[key] = createStyleToken(value, getChildStableId$1(stableId, key), childName);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
function getChildStableId$1(stableId, child) {
|
|
1822
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1823
|
+
}
|
|
1824
|
+
//#endregion
|
|
1606
1825
|
//#region style/value.ts
|
|
1607
|
-
function createToken(value,
|
|
1608
|
-
return createStyleToken(value,
|
|
1826
|
+
function createToken(value, stableId) {
|
|
1827
|
+
return createStyleToken(value, stableId);
|
|
1609
1828
|
}
|
|
1610
1829
|
function createValues(...args) {
|
|
1611
1830
|
let values = args[0];
|
|
1612
1831
|
let isNumber = false;
|
|
1613
|
-
let
|
|
1832
|
+
let stableId = args[1];
|
|
1614
1833
|
if (args[0] === Number) {
|
|
1615
1834
|
values = args[1];
|
|
1616
|
-
|
|
1835
|
+
stableId = args[2];
|
|
1617
1836
|
isNumber = true;
|
|
1618
1837
|
}
|
|
1619
1838
|
if (!values.length) throw new Error("[Style.values] NO_VALUES");
|
|
1620
1839
|
const tokens = /* @__PURE__ */ new Map();
|
|
1621
|
-
for (let value of values) tokens.set(value,
|
|
1840
|
+
for (let value of values) tokens.set(value, createStyleToken(parseValue(value, isNumber), getChildStableId(stableId, hashString(String(value))), getChildStyleTokenName(stableId ?? null, getValueDebugName(value))));
|
|
1622
1841
|
return function ValueFn(...args) {
|
|
1623
1842
|
const [value, provide, debug] = args;
|
|
1624
1843
|
const token = tokens.get(value);
|
|
@@ -1628,8 +1847,18 @@ function createValues(...args) {
|
|
|
1628
1847
|
return token;
|
|
1629
1848
|
};
|
|
1630
1849
|
}
|
|
1631
|
-
function
|
|
1632
|
-
return
|
|
1850
|
+
function getChildStableId(stableId, child) {
|
|
1851
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1852
|
+
}
|
|
1853
|
+
function getValueDebugName(value) {
|
|
1854
|
+
if (typeof value === "number") return String(value);
|
|
1855
|
+
const parts = String(value).split(/[;|]/);
|
|
1856
|
+
const label = parts[1]?.trim();
|
|
1857
|
+
if (label) return sanitizeDebugName(label);
|
|
1858
|
+
return sanitizeDebugName(parts[0]?.trim() ?? "");
|
|
1859
|
+
}
|
|
1860
|
+
function sanitizeDebugName(value) {
|
|
1861
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
1633
1862
|
}
|
|
1634
1863
|
function parseValue(value, isNumber) {
|
|
1635
1864
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -1640,30 +1869,6 @@ function parseValue(value, isNumber) {
|
|
|
1640
1869
|
return number;
|
|
1641
1870
|
}
|
|
1642
1871
|
//#endregion
|
|
1643
|
-
|
|
1644
|
-
function createTokens(values, debugId) {
|
|
1645
|
-
const tokens = {};
|
|
1646
|
-
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1647
|
-
const value = values[i];
|
|
1648
|
-
tokens[value] = createToken(value, getChildDebugId(debugId, String(i)));
|
|
1649
|
-
}
|
|
1650
|
-
else assignTokenRecord(tokens, values, debugId);
|
|
1651
|
-
return tokens;
|
|
1652
|
-
}
|
|
1653
|
-
function assignTokenRecord(target, values, debugId) {
|
|
1654
|
-
for (let key in values) {
|
|
1655
|
-
const value = values[key];
|
|
1656
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1657
|
-
const child = {};
|
|
1658
|
-
target[key] = child;
|
|
1659
|
-
assignTokenRecord(child, value, getChildDebugId(debugId, key));
|
|
1660
|
-
} else target[key] = createToken(value, getChildDebugId(debugId, key));
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
function getChildDebugId(debugId, child) {
|
|
1664
|
-
return debugId ? debugId + "--" + child : void 0;
|
|
1665
|
-
}
|
|
1666
|
-
//#endregion
|
|
1667
|
-
export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_OVERRIDE, assignStyleFnMeta, bindScope, classNameTransform, classNameValue, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createClassNameFn, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenOverrideDebug, getToken, isAtRuleRef, isClassNameValue, isStyleTokenData, isStyleTokenOverrideData, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformKeyframes, type };
|
|
1872
|
+
export { AT_RULE_REF, LayerPlaceholder, TOKEN_DEBUG, TOKEN_ID, TOKEN_NAME, TOKEN_OVERRIDE, TOKEN_VAR_NAME, assignStyleFnMeta, bindScope, classNameTransform, classNameValue, combineScope, combineStyle, configureStyleRuntime, createAtRuleRef, createClassNameFn, createElement, createStyleFn, createStyleKeyframes, createStyleToken, createStyleTokenOverride, createTheme, createToken, createTokens, createValues, getClassName, getStyleFnMeta, getStyleTokenId, getStyleTokenName, getStyleTokenOverrideDebug, getStyleTokenVarName, getToken, isAtRuleRef, isClassNameValue, isStyleTokenData, isStyleTokenOverrideData, resetStyleThemeIdCounter, resetStyleTokenIdCounter, style, styleTransform, transformKeyframes, type };
|
|
1668
1873
|
|
|
1669
1874
|
//# sourceMappingURL=rsc-dev.js.map
|