@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
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { S as isAtRuleRef, c as createIdCounter, l as getId, r as createKeyframes, w as shouldAppendCssPx } from "./css-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a as symbol } from "./symbols-Cp4ymzKF.js";
|
|
2
|
+
import { _ as globalData, c as isStyleTokenOverrideData, i as getStyleTokenId, m as CSS_CONFIG, r as getCssVarRawFallback, s as isStyleTokenData, t as escapeCssValue, u as setBuildConfig } from "./cssVar-DGgQ2GIK.js";
|
|
3
|
+
import { D as getTokenVarName, E as getTokenVar, F as createNameFormatter, I as hashString, N as getChildStyleTokenName, P as getIdentifierSafeHash, R as DEBUG_CONFIG, S as isAtRuleRef, T as getTokenOverrideValue, c as createIdCounter, k as createStyleToken, l as getId, r as createKeyframes, w as shouldAppendCssPx, z as setBuildDebugClassName } from "./css-CiTI58yl.js";
|
|
4
|
+
import { c as BUILDER_CALLSITE, d as BUILDER_SLOT_ID, f as BUILDER_STATE, l as BUILDER_SCOPE, p as BUILDER_TYPE, u as BUILDER_SCOPE_ID } from "./withTokens-DAzUIPvA.js";
|
|
5
|
+
import { f as isScopeData, g as isStyleData, h as isSlotOverrideData, m as isSlotData } from "./combine-C9vjpKCs.js";
|
|
6
6
|
import { SelectorType, parse } from "css-what";
|
|
7
|
+
//#region entry/shared/config_debug.ts
|
|
8
|
+
const buildConfig = JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG);
|
|
9
|
+
setBuildConfig(buildConfig);
|
|
10
|
+
setBuildDebugClassName(buildConfig.css?.debugClassName, false);
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region config/config/dev.ts
|
|
13
|
+
const DEV_CONFIG_DEFAULT = {
|
|
14
|
+
isDev: false,
|
|
15
|
+
isCheckSelectorEnabled: true,
|
|
16
|
+
isSourcemapEnabled: true,
|
|
17
|
+
isLocalClassNameEnabled: true,
|
|
18
|
+
sheetMaxRules: 1e3,
|
|
19
|
+
sheetStyleTagNonce: null,
|
|
20
|
+
hashLength: null,
|
|
21
|
+
stylePriorityMode: "sort",
|
|
22
|
+
sourcemapLocationMode: "style",
|
|
23
|
+
isElementClassNameEnabled: true
|
|
24
|
+
};
|
|
25
|
+
globalData("config.dev.isDev", () => ({ isDev: false }));
|
|
26
|
+
const DEV_CONFIG = globalData("config.dev", () => ({ ...DEV_CONFIG_DEFAULT }));
|
|
27
|
+
globalData("config.dev.plugin", () => ({ config: null }));
|
|
28
|
+
globalData("config.dev.base", () => ({ config: null }));
|
|
29
|
+
globalData("config.dev.utils", () => ({ config: null }));
|
|
30
|
+
//#endregion
|
|
7
31
|
//#region utils/trace.ts
|
|
8
32
|
const FN_MARKER = "$fn_";
|
|
9
33
|
function traceMarker(fn, name) {
|
|
@@ -359,17 +383,265 @@ function createDebugCallsite(loc, debug) {
|
|
|
359
383
|
column
|
|
360
384
|
};
|
|
361
385
|
}
|
|
386
|
+
const formatClassName = createNameFormatter([
|
|
387
|
+
"atRule",
|
|
388
|
+
"scopeSelector",
|
|
389
|
+
"property",
|
|
390
|
+
"selector",
|
|
391
|
+
"value"
|
|
392
|
+
]);
|
|
393
|
+
const formatTransformClassName = createNameFormatter(["className"]);
|
|
394
|
+
function getDebugClassName(format, hash, info) {
|
|
395
|
+
return formatClassName(format || "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash", hash, info);
|
|
396
|
+
}
|
|
397
|
+
function getDebugTransformClassName(format, hash, info) {
|
|
398
|
+
return formatTransformClassName(format || "(className)--$hash", hash, info);
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region atomic/utils/cssIdent.ts
|
|
402
|
+
function escapeCssIdent(ident) {
|
|
403
|
+
let result = "";
|
|
404
|
+
for (let i = 0; i < ident.length; i++) {
|
|
405
|
+
const char = ident.charAt(i);
|
|
406
|
+
const code = ident.charCodeAt(i);
|
|
407
|
+
const nextCode = ident.charCodeAt(i + 1);
|
|
408
|
+
if (code === 0) {
|
|
409
|
+
result += "�";
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
if (code >= 1 && code <= 31 || code === 127 || i === 0 && code >= 48 && code <= 57 || i === 1 && code >= 48 && code <= 57 && ident.charCodeAt(0) === 45) {
|
|
413
|
+
result += "\\" + code.toString(16) + " ";
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
if (i === 0 && code === 45 && ident.length === 1) {
|
|
417
|
+
result += "\\-";
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
if (code >= 55296 && code <= 56319 && nextCode >= 56320 && nextCode <= 57343) {
|
|
421
|
+
result += char + ident.charAt(++i);
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
if (code >= 128 || code === 45 || code === 95 || code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122) {
|
|
425
|
+
result += char;
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
result += "\\" + char;
|
|
429
|
+
}
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
function sanitizeCssIdentName(value, fallback = "") {
|
|
433
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || fallback;
|
|
434
|
+
}
|
|
362
435
|
//#endregion
|
|
363
|
-
//#region
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
436
|
+
//#region atomic/utils/debug.ts
|
|
437
|
+
function normalizeDebugKeywordValue(value) {
|
|
438
|
+
const normalized = value.trim().toLowerCase();
|
|
439
|
+
return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : null;
|
|
440
|
+
}
|
|
441
|
+
function sanitizeDebugName$1(value) {
|
|
442
|
+
if (!value) return "";
|
|
443
|
+
return sanitizeCssIdentName(value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), "");
|
|
444
|
+
}
|
|
445
|
+
function normalizePropertyName(property) {
|
|
446
|
+
return property.trim().replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
|
|
447
|
+
}
|
|
448
|
+
function sanitizeDebugPropertyName(property) {
|
|
449
|
+
let name = property;
|
|
450
|
+
if (name.charCodeAt(0) === 45 && name.charCodeAt(1) === 45) name = name.slice(2);
|
|
451
|
+
return name.replace(/[^a-z0-9_-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
|
|
452
|
+
}
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region atomic/debug/value.ts
|
|
455
|
+
function getDebugValueName(value) {
|
|
456
|
+
if (!value) return {
|
|
457
|
+
value: null,
|
|
458
|
+
arbitraryValue: null
|
|
459
|
+
};
|
|
460
|
+
const normalized = value.trim().toLowerCase();
|
|
461
|
+
if (!normalized) return {
|
|
462
|
+
value: null,
|
|
463
|
+
arbitraryValue: null
|
|
464
|
+
};
|
|
465
|
+
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 {
|
|
466
|
+
value: null,
|
|
467
|
+
arbitraryValue: null
|
|
468
|
+
};
|
|
469
|
+
if (/^[a-z][a-z0-9-]*$/.test(normalized)) return {
|
|
470
|
+
value: normalized,
|
|
471
|
+
arbitraryValue: null
|
|
472
|
+
};
|
|
473
|
+
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, "");
|
|
474
|
+
if (!name) return {
|
|
475
|
+
value: null,
|
|
476
|
+
arbitraryValue: null
|
|
477
|
+
};
|
|
478
|
+
return {
|
|
479
|
+
value: null,
|
|
480
|
+
arbitraryValue: name
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region atomic/debug/property/data.ts
|
|
485
|
+
const PROPERTY_ALIASES = {
|
|
486
|
+
"border-radius": "radius",
|
|
487
|
+
"flex-direction": "flex",
|
|
488
|
+
"font-style": "font",
|
|
489
|
+
"font-weight": "font",
|
|
490
|
+
"grid-template-columns": "grid-cols",
|
|
491
|
+
"grid-template-rows": "grid-rows",
|
|
492
|
+
"align-items": "items",
|
|
493
|
+
"justify-content": "justify",
|
|
494
|
+
"z-index": "zindex",
|
|
495
|
+
"pointer-events": "pointer"
|
|
371
496
|
};
|
|
372
|
-
const
|
|
497
|
+
const KEYWORD_VALUE_PROPERTIES = new Set([
|
|
498
|
+
"align-content",
|
|
499
|
+
"align-items",
|
|
500
|
+
"align-self",
|
|
501
|
+
"background-repeat",
|
|
502
|
+
"background-size",
|
|
503
|
+
"border-collapse",
|
|
504
|
+
"border-style",
|
|
505
|
+
"box-sizing",
|
|
506
|
+
"clear",
|
|
507
|
+
"cursor",
|
|
508
|
+
"display",
|
|
509
|
+
"flex-direction",
|
|
510
|
+
"flex-wrap",
|
|
511
|
+
"float",
|
|
512
|
+
"font-weight",
|
|
513
|
+
"font-style",
|
|
514
|
+
"justify-content",
|
|
515
|
+
"justify-items",
|
|
516
|
+
"justify-self",
|
|
517
|
+
"list-style-position",
|
|
518
|
+
"list-style-type",
|
|
519
|
+
"object-fit",
|
|
520
|
+
"object-position",
|
|
521
|
+
"overflow",
|
|
522
|
+
"overflow-x",
|
|
523
|
+
"overflow-y",
|
|
524
|
+
"pointer-events",
|
|
525
|
+
"place-content",
|
|
526
|
+
"place-items",
|
|
527
|
+
"place-self",
|
|
528
|
+
"position",
|
|
529
|
+
"resize",
|
|
530
|
+
"table-layout",
|
|
531
|
+
"text-align",
|
|
532
|
+
"text-decoration-line",
|
|
533
|
+
"text-transform",
|
|
534
|
+
"user-select",
|
|
535
|
+
"vertical-align",
|
|
536
|
+
"visibility",
|
|
537
|
+
"white-space"
|
|
538
|
+
]);
|
|
539
|
+
const ARBITRARY_VALUE_PROPERTIES = new Set(["font-weight"]);
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region atomic/debug/property/property.ts
|
|
542
|
+
function getDebugPropertyName(property, value) {
|
|
543
|
+
if (!property) return null;
|
|
544
|
+
const normalized = normalizePropertyName(property);
|
|
545
|
+
const name = PROPERTY_ALIASES[normalized] || sanitizeDebugPropertyName(normalized);
|
|
546
|
+
if (!name) return null;
|
|
547
|
+
return {
|
|
548
|
+
property: name,
|
|
549
|
+
...withKeywordValueFallback(normalized, value, withArbitraryValueFallback(normalized, getDebugValueName(value)))
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function withArbitraryValueFallback(property, valueName) {
|
|
553
|
+
if (!valueName.arbitraryValue || ARBITRARY_VALUE_PROPERTIES.has(property)) return valueName;
|
|
554
|
+
return {
|
|
555
|
+
value: valueName.value,
|
|
556
|
+
arbitraryValue: null
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
function withKeywordValueFallback(property, value, valueName) {
|
|
560
|
+
if (valueName.value || valueName.arbitraryValue) return valueName;
|
|
561
|
+
if (!KEYWORD_VALUE_PROPERTIES.has(property)) return valueName;
|
|
562
|
+
const normalized = normalizeDebugKeywordValue(value);
|
|
563
|
+
if (!normalized) return valueName;
|
|
564
|
+
return {
|
|
565
|
+
value: normalized,
|
|
566
|
+
arbitraryValue: null
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region atomic/debug/selector.ts
|
|
571
|
+
function getDebugSelectorName(selector) {
|
|
572
|
+
if (!selector) return null;
|
|
573
|
+
const normalized = selector.trim().toLowerCase();
|
|
574
|
+
if (/^[a-z0-9]+$/.test(normalized)) return null;
|
|
575
|
+
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, ""));
|
|
576
|
+
}
|
|
577
|
+
function getDebugAtRuleName(selector) {
|
|
578
|
+
if (!selector || Array.isArray(selector) && selector.length === 0) return null;
|
|
579
|
+
return validateName((Array.isArray(selector) ? selector.map(parseAtRule).filter(Boolean).join("-") : parseAtRule(selector)).replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
|
|
580
|
+
}
|
|
581
|
+
function compressQuery(query) {
|
|
582
|
+
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, "");
|
|
583
|
+
}
|
|
584
|
+
function validateName(name) {
|
|
585
|
+
if (!name || name === "selector" || name.length < 2) return null;
|
|
586
|
+
return name;
|
|
587
|
+
}
|
|
588
|
+
function parseAtRule(rule) {
|
|
589
|
+
const normalized = rule.trim().toLowerCase();
|
|
590
|
+
if (normalized.startsWith("@media")) return compressQuery(normalized.slice(6));
|
|
591
|
+
if (normalized.startsWith("@container")) return compressQuery(normalized.slice(10));
|
|
592
|
+
if (normalized.startsWith("@supports")) return compressQuery(normalized.slice(9));
|
|
593
|
+
return compressQuery(normalized);
|
|
594
|
+
}
|
|
595
|
+
//#endregion
|
|
596
|
+
//#region atomic/utils/selector.ts
|
|
597
|
+
function getSelectorText(selector) {
|
|
598
|
+
return Array.isArray(selector) ? selector[0] : selector;
|
|
599
|
+
}
|
|
600
|
+
function getSelectorHash(selector) {
|
|
601
|
+
return Array.isArray(selector) ? selector.join("|") : selector;
|
|
602
|
+
}
|
|
603
|
+
function getSelectorPriority(selector) {
|
|
604
|
+
if (!selector) return 0;
|
|
605
|
+
return Array.isArray(selector) ? selector[1] : 0;
|
|
606
|
+
}
|
|
607
|
+
//#endregion
|
|
608
|
+
//#region atomic/className.ts
|
|
609
|
+
function getAtomicClassName(property, priority, value, selector, parentSelector, atRule, callsite, localClassName, debugClassName, classNameFormat, transformClassName, transformClassNameFormat, hashLength = null) {
|
|
610
|
+
let hash = property;
|
|
611
|
+
hash += "\n" + (priority || "");
|
|
612
|
+
hash += "\n" + value;
|
|
613
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
614
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
615
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
616
|
+
hash += "\n" + getCallsiteHash(callsite, localClassName);
|
|
617
|
+
hash = getIdentifierSafeHash(hash, hashLength ?? getRuntimeClassNameHashLength(debugClassName));
|
|
618
|
+
if (!debugClassName) return hash;
|
|
619
|
+
if (transformClassName) return getDebugTransformClassName(transformClassNameFormat, hash, { className: transformClassName });
|
|
620
|
+
const propertyName = getDebugPropertyName(property, value);
|
|
621
|
+
return getDebugClassName(classNameFormat, hash, {
|
|
622
|
+
atRule: atRule ? getDebugAtRuleName(atRule.map(getSelectorText)) : null,
|
|
623
|
+
scopeSelector: parentSelector ? getDebugSelectorName(getSelectorText(parentSelector)) : null,
|
|
624
|
+
selector: selector ? getDebugSelectorName(getSelectorText(selector)) : null,
|
|
625
|
+
property: propertyName ? propertyName.property : property,
|
|
626
|
+
value: propertyName ? propertyName.value ?? propertyName.arbitraryValue : null
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
function getRuntimeClassNameHashLength(debugClassName) {
|
|
630
|
+
if (debugClassName && DEV_CONFIG.isDev) return DEV_CONFIG.hashLength ?? CSS_CONFIG.hashLength ?? 3;
|
|
631
|
+
return CSS_CONFIG.hashLength ?? 7;
|
|
632
|
+
}
|
|
633
|
+
function getClassNameDedupe(property, priority, selector, parentSelector, atRule) {
|
|
634
|
+
let hash = property;
|
|
635
|
+
hash += "\n" + (priority || "");
|
|
636
|
+
hash += "\n" + (selector ? getSelectorHash(selector) : "");
|
|
637
|
+
hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
|
|
638
|
+
hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
|
|
639
|
+
return hashString(hash);
|
|
640
|
+
}
|
|
641
|
+
function getCallsiteHash(callsite, localClassName) {
|
|
642
|
+
if (!localClassName || !callsite) return "";
|
|
643
|
+
return callsite.filePath + "\n" + callsite.line + ":" + callsite.column;
|
|
644
|
+
}
|
|
373
645
|
//#endregion
|
|
374
646
|
//#region builder/data/merge/utils.ts
|
|
375
647
|
function cloneData(data, source, debug, merge = true) {
|
|
@@ -1492,7 +1764,7 @@ function createClassNameFn(args) {
|
|
|
1492
1764
|
}
|
|
1493
1765
|
const formatThemeName = createNameFormatter(["name"]);
|
|
1494
1766
|
function createThemeClassName(name, id, themeNameFormat) {
|
|
1495
|
-
return formatThemeName(themeNameFormat || "theme[-(name)]-$hash", getIdentifierSafeHash(id, CSS_CONFIG.hashLength), { name });
|
|
1767
|
+
return formatThemeName(themeNameFormat || "theme[-(name)]-$hash", getIdentifierSafeHash(id, CSS_CONFIG.hashLength), { name: normalizeThemeName(name) });
|
|
1496
1768
|
}
|
|
1497
1769
|
function getThemeRuleCss(className, tokens, tokenNameFormat) {
|
|
1498
1770
|
const declarations = [];
|
|
@@ -1504,6 +1776,29 @@ function getThemeDeclaration(token, tokenNameFormat) {
|
|
|
1504
1776
|
const value = token.ref ? getTokenOverrideValue(token, tokenNameFormat) : escapeCssValue(String(token.value ?? ""));
|
|
1505
1777
|
return name + ":" + value;
|
|
1506
1778
|
}
|
|
1779
|
+
function normalizeThemeName(value) {
|
|
1780
|
+
if (!value) return null;
|
|
1781
|
+
value = value.trim();
|
|
1782
|
+
if (!value) return null;
|
|
1783
|
+
if (/^\d+$/.test(value)) return null;
|
|
1784
|
+
if (isGeneratedNameHash(value)) return null;
|
|
1785
|
+
const stableSuffix = value.match(/^(.+)-[a-z0-9]{7}$/);
|
|
1786
|
+
if (stableSuffix?.[1] && isGeneratedNameHash(value.slice(-7))) return normalizeThemeName(stableSuffix[1]);
|
|
1787
|
+
value = stripGenericThemePrefix(value);
|
|
1788
|
+
if (!value) return null;
|
|
1789
|
+
return value;
|
|
1790
|
+
}
|
|
1791
|
+
function stripGenericThemePrefix(value) {
|
|
1792
|
+
const parts = value.split("--");
|
|
1793
|
+
while (parts[0] === "theme" || parts[0] === "themes") parts.shift();
|
|
1794
|
+
value = parts.join("--");
|
|
1795
|
+
if (value.startsWith("theme-")) return value.slice(6);
|
|
1796
|
+
if (value.startsWith("themes-")) return value.slice(7);
|
|
1797
|
+
return value;
|
|
1798
|
+
}
|
|
1799
|
+
function isGeneratedNameHash(value) {
|
|
1800
|
+
return /^[a-z0-9]{7}$/.test(value) && /\d/.test(value);
|
|
1801
|
+
}
|
|
1507
1802
|
//#endregion
|
|
1508
1803
|
//#region style/theme.ts
|
|
1509
1804
|
const idCounter = createIdCounter("theme");
|
|
@@ -1519,22 +1814,47 @@ function createTheme(tokens, stableId, callsite) {
|
|
|
1519
1814
|
return createThemeData(callsite ?? null, id, className, tokens);
|
|
1520
1815
|
}
|
|
1521
1816
|
//#endregion
|
|
1817
|
+
//#region style/tokens.ts
|
|
1818
|
+
function createTokens(values, stableId) {
|
|
1819
|
+
const tokens = {};
|
|
1820
|
+
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1821
|
+
const value = values[i];
|
|
1822
|
+
tokens[value] = createStyleToken(value, getChildStableId$1(stableId, String(i)), getChildStyleTokenName(stableId, String(i)));
|
|
1823
|
+
}
|
|
1824
|
+
else assignTokenRecord(tokens, values, stableId, stableId ?? null);
|
|
1825
|
+
return tokens;
|
|
1826
|
+
}
|
|
1827
|
+
function assignTokenRecord(target, values, stableId, debugName) {
|
|
1828
|
+
for (let key in values) {
|
|
1829
|
+
const value = values[key];
|
|
1830
|
+
const childName = getChildStyleTokenName(debugName, key);
|
|
1831
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1832
|
+
const child = {};
|
|
1833
|
+
target[key] = child;
|
|
1834
|
+
assignTokenRecord(child, value, getChildStableId$1(stableId, key), childName);
|
|
1835
|
+
} else target[key] = createStyleToken(value, getChildStableId$1(stableId, key), childName);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
function getChildStableId$1(stableId, child) {
|
|
1839
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1840
|
+
}
|
|
1841
|
+
//#endregion
|
|
1522
1842
|
//#region style/value.ts
|
|
1523
|
-
function createToken(value,
|
|
1524
|
-
return createStyleToken(value,
|
|
1843
|
+
function createToken(value, stableId) {
|
|
1844
|
+
return createStyleToken(value, stableId);
|
|
1525
1845
|
}
|
|
1526
1846
|
function createValues(...args) {
|
|
1527
1847
|
let values = args[0];
|
|
1528
1848
|
let isNumber = false;
|
|
1529
|
-
let
|
|
1849
|
+
let stableId = args[1];
|
|
1530
1850
|
if (args[0] === Number) {
|
|
1531
1851
|
values = args[1];
|
|
1532
|
-
|
|
1852
|
+
stableId = args[2];
|
|
1533
1853
|
isNumber = true;
|
|
1534
1854
|
}
|
|
1535
1855
|
if (!values.length) throw new Error("[Style.values] NO_VALUES");
|
|
1536
1856
|
const tokens = /* @__PURE__ */ new Map();
|
|
1537
|
-
for (let value of values) tokens.set(value,
|
|
1857
|
+
for (let value of values) tokens.set(value, createStyleToken(parseValue(value, isNumber), getChildStableId(stableId, hashString(String(value))), getChildStyleTokenName(stableId ?? null, getValueDebugName(value))));
|
|
1538
1858
|
return function ValueFn(...args) {
|
|
1539
1859
|
const [value, provide, debug] = args;
|
|
1540
1860
|
const token = tokens.get(value);
|
|
@@ -1544,8 +1864,18 @@ function createValues(...args) {
|
|
|
1544
1864
|
return token;
|
|
1545
1865
|
};
|
|
1546
1866
|
}
|
|
1547
|
-
function
|
|
1548
|
-
return
|
|
1867
|
+
function getChildStableId(stableId, child) {
|
|
1868
|
+
return stableId ? stableId + "--" + child : void 0;
|
|
1869
|
+
}
|
|
1870
|
+
function getValueDebugName(value) {
|
|
1871
|
+
if (typeof value === "number") return String(value);
|
|
1872
|
+
const parts = String(value).split(/[;|]/);
|
|
1873
|
+
const label = parts[1]?.trim();
|
|
1874
|
+
if (label) return sanitizeDebugName(label);
|
|
1875
|
+
return sanitizeDebugName(parts[0]?.trim() ?? "");
|
|
1876
|
+
}
|
|
1877
|
+
function sanitizeDebugName(value) {
|
|
1878
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || null;
|
|
1549
1879
|
}
|
|
1550
1880
|
function parseValue(value, isNumber) {
|
|
1551
1881
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -1556,30 +1886,6 @@ function parseValue(value, isNumber) {
|
|
|
1556
1886
|
return number;
|
|
1557
1887
|
}
|
|
1558
1888
|
//#endregion
|
|
1559
|
-
|
|
1560
|
-
function createTokens(values, debugId) {
|
|
1561
|
-
const tokens = {};
|
|
1562
|
-
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1563
|
-
const value = values[i];
|
|
1564
|
-
tokens[value] = createToken(value, getChildDebugId(debugId, String(i)));
|
|
1565
|
-
}
|
|
1566
|
-
else assignTokenRecord(tokens, values, debugId);
|
|
1567
|
-
return tokens;
|
|
1568
|
-
}
|
|
1569
|
-
function assignTokenRecord(target, values, debugId) {
|
|
1570
|
-
for (let key in values) {
|
|
1571
|
-
const value = values[key];
|
|
1572
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1573
|
-
const child = {};
|
|
1574
|
-
target[key] = child;
|
|
1575
|
-
assignTokenRecord(child, value, getChildDebugId(debugId, key));
|
|
1576
|
-
} else target[key] = createToken(value, getChildDebugId(debugId, key));
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
function getChildDebugId(debugId, child) {
|
|
1580
|
-
return debugId ? debugId + "--" + child : void 0;
|
|
1581
|
-
}
|
|
1582
|
-
//#endregion
|
|
1583
|
-
export { isClassNameValue as _, resetStyleThemeIdCounter as a, normalizeCallsiteSourceUrl as b, assignStyleFnMeta as c, style as d, createStyleKeyframes as f, classNameValue as g, classNameTransform as h, createTheme as i, createStyleFn as l, type as m, createToken as n, getThemeRuleCss as o, transformKeyframes as p, createValues as r, createClassNameFn as s, createTokens as t, getStyleFnMeta as u, styleTransform as v, getDebugFieldLoc as y };
|
|
1889
|
+
export { getDebugFieldLoc as C, escapeCssIdent as S, DEV_CONFIG as T, isClassNameValue as _, resetStyleThemeIdCounter as a, getSelectorText as b, assignStyleFnMeta as c, style as d, createStyleKeyframes as f, classNameValue as g, classNameTransform as h, createTheme as i, createStyleFn as l, type as m, createValues as n, getThemeRuleCss as o, transformKeyframes as p, createTokens as r, createClassNameFn as s, createToken as t, getStyleFnMeta as u, styleTransform as v, normalizeCallsiteSourceUrl as w, sanitizeDebugName$1 as x, getSelectorPriority as y };
|
|
1584
1890
|
|
|
1585
|
-
//# sourceMappingURL=style-
|
|
1891
|
+
//# sourceMappingURL=style-DDxjKdX0.js.map
|