@fluentic/style 0.1.0-beta.3 → 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 +13 -0
- package/README.md +1 -1
- 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/transform/debug/plugin.ts +79 -1
- package/compiler/transform/evaluator/evaluator.ts +74 -26
- package/compiler/transform/extract/chain/chain.ts +1 -1
- package/compiler/transform/extract/utils/replacement.ts +6 -1
- package/compiler/transform/extract/utils/theme.ts +6 -6
- package/compiler/transform/syntax/static_ids.ts +1 -1
- package/config/build.ts +1 -8
- package/config/config/debug.ts +11 -0
- package/dialect/namedTokens.ts +22 -5
- package/dist/{className-CKo4TxuT.js → className-Do2Crx4b.js} +2 -3
- package/dist/{className-CKo4TxuT.js.map → className-Do2Crx4b.js.map} +1 -1
- package/dist/{style-91J0B5ef.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-D5v5tJXI.mjs → compiler-CE0ZgkdH.mjs} +231 -84
- 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-BEvP7108.js → config-BtANtGAh.js} +4 -6
- package/dist/config-BtANtGAh.js.map +1 -0
- package/dist/{config-FIfi5aJ8.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-OXHoDUIo.js.map → config-oKOjOTWi.js.map} +1 -1
- package/dist/{css-DcuJ_jSH.js → css-BewrRz3_.js} +3 -3
- package/dist/{css-DcuJ_jSH.js.map → css-BewrRz3_.js.map} +1 -1
- package/dist/{css-dPoZJDQH.js → css-CiTI58yl.js} +291 -4
- 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-oOt6ZR54.js → css-Rc7ILf-3.js} +8 -9
- package/dist/{css-oOt6ZR54.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-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-DYtS3g6Z.js} +2 -2
- package/dist/{css_extra-DeTuIlcO.js.map → css_extra-DYtS3g6Z.js.map} +1 -1
- package/dist/{data-CeYstKMP.js → data-D7NFt4JG.js} +205 -10
- package/dist/data-D7NFt4JG.js.map +1 -0
- package/dist/{debug-D96KGgpH.js → debug-Cvpo5cVu.js} +4 -3
- package/dist/{debug-D96KGgpH.js.map → debug-Cvpo5cVu.js.map} +1 -1
- package/dist/{runtime-BKChZZ2-.js → debug-DycdGrul.js} +20 -27
- package/dist/debug-DycdGrul.js.map +1 -0
- package/dist/dev/rsc.js +9 -9
- package/dist/{dev-fOtWB5K3.js → dev-DdRWa6dJ.js} +7 -6
- package/dist/{dev-fOtWB5K3.js.map → dev-DdRWa6dJ.js.map} +1 -1
- package/dist/{dev-p8tW7X-A.js → dev-px0_6TNq.js} +4 -4
- package/dist/{dev-p8tW7X-A.js.map → dev-px0_6TNq.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-ng0y3fN0.js} +8 -8
- package/dist/{elementMarker-CvqqIb7J.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 -4
- 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 -68
- 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-oiQ8CnkS.js → getClassName-CrNVjAoJ.js} +29 -8
- package/dist/getClassName-CrNVjAoJ.js.map +1 -0
- package/dist/{global-Cul1dX8k.js → global-CZBlA9E7.js} +3 -3
- package/dist/{global-Cul1dX8k.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-Ba-XV33u.js → jsx-BY1iFewe.js} +3 -3
- package/dist/{jsx-Ba-XV33u.js.map → jsx-BY1iFewe.js.map} +1 -1
- package/dist/{jsx-A4cK517J.js → jsx-DL-DEAz8.js} +8 -7
- package/dist/{jsx-A4cK517J.js.map → jsx-DL-DEAz8.js.map} +1 -1
- package/dist/{jsx_dev_runtime-BQcRzl5D.js → jsx_dev_runtime-aAhNYDeS.js} +2 -2
- package/dist/{jsx_dev_runtime-BQcRzl5D.js.map → jsx_dev_runtime-aAhNYDeS.js.map} +1 -1
- package/dist/{jsx_runtime-B9KEoAQN.js → jsx_runtime-C6i1bWlu.js} +2 -2
- package/dist/{jsx_runtime-B9KEoAQN.js.map → jsx_runtime-C6i1bWlu.js.map} +1 -1
- package/dist/{jsx_runtime-BXcbW8Yp.js → jsx_runtime-D7Y5up6H.js} +2 -2
- package/dist/{jsx_runtime-BXcbW8Yp.js.map → jsx_runtime-D7Y5up6H.js.map} +1 -1
- package/dist/{layer-CbQzwZF-.js → layer-BSxAr-hy.js} +4 -4
- package/dist/{layer-CbQzwZF-.js.map → layer-BSxAr-hy.js.map} +1 -1
- package/dist/{loader-BAth2yZ1.mjs → loader-BmYS_Rju.mjs} +3 -3
- package/dist/{loader-BAth2yZ1.mjs.map → loader-BmYS_Rju.mjs.map} +1 -1
- package/dist/{misc-DFBKJGLT.mjs → misc-BIS_c7BJ.mjs} +2 -2
- package/dist/{misc-DFBKJGLT.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-CF6JgpTq.js → property-BuLbzviK.js} +2 -2
- package/dist/{property-CF6JgpTq.js.map → property-BuLbzviK.js.map} +1 -1
- package/dist/{registry-CiwvMfx8.mjs → registry-IaXmLQzA.mjs} +2 -2
- package/dist/{registry-CiwvMfx8.mjs.map → registry-IaXmLQzA.mjs.map} +1 -1
- package/dist/{rules-DlXcch7-.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-yDD0nfm1.cjs → shared-CaJuvw03.cjs} +231 -84
- package/dist/shared-CaJuvw03.cjs.map +1 -0
- package/dist/{shared-x59dI2NW.mjs → shared-DdPTZ0O3.mjs} +4 -4
- package/dist/{shared-x59dI2NW.mjs.map → shared-DdPTZ0O3.mjs.map} +1 -1
- package/dist/sheet-BWBzuy4D.js +7 -0
- package/dist/{sheet-B-uJfHRY.js.map → sheet-BWBzuy4D.js.map} +1 -1
- package/dist/{sidecar-CJ6i4wmn.mjs → sidecar-B3oCK9vC.mjs} +3 -3
- package/dist/{sidecar-CJ6i4wmn.mjs.map → sidecar-B3oCK9vC.mjs.map} +1 -1
- package/dist/{style-DFFK06Of.js → style-CGaJndOl.js} +102 -54
- package/dist/style-CGaJndOl.js.map +1 -0
- package/dist/{style-Bw5ka-Nq.js → style-DDxjKdX0.js} +356 -39
- package/dist/style-DDxjKdX0.js.map +1 -0
- package/dist/style-S7LTQbRu.js +5 -0
- package/dist/{styleStore-DJ0Msgkh.js → styleStore-0fARJlZV.js} +6 -6
- package/dist/{styleStore-DJ0Msgkh.js.map → styleStore-0fARJlZV.js.map} +1 -1
- package/dist/{styleStore-ydQcDBD4.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-D8j96G57.js → trace-CFnhyCVf.js} +2 -2
- package/dist/{trace-D8j96G57.js.map → trace-CFnhyCVf.js.map} +1 -1
- package/dist/{trace-CO36aenp.js → trace-ZtgeY-8s.js} +3 -3
- package/dist/{trace-CO36aenp.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-D2fygyTm.mjs → utils-B5Xqf1lV.mjs} +4 -4
- package/dist/{utils-D2fygyTm.mjs.map → utils-B5Xqf1lV.mjs.map} +1 -1
- package/dist/{utils-hoYnMiA7.js → utils-B_VhPBHH.js} +4 -4
- package/dist/{utils-hoYnMiA7.js.map → utils-B_VhPBHH.js.map} +1 -1
- package/dist/{utils-Bmw655wa.js → utils-CDUaX81o.js} +3 -3
- package/dist/{utils-Bmw655wa.js.map → utils-CDUaX81o.js.map} +1 -1
- package/dist/{utils-DTXCTUlS.mjs → utils-DaAiEEIG.mjs} +3 -3
- package/dist/{utils-DTXCTUlS.mjs.map → utils-DaAiEEIG.mjs.map} +1 -1
- package/dist/{utils-DVFxZnVC.js → utils-DzydRwYo.js} +65 -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-DvFkGBy2.js → value-D08AocUs.js} +96 -72
- 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-BOU7_xld.mjs → webpack-CHydnRXB.mjs} +5 -5
- package/dist/{webpack-BOU7_xld.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-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.map +0 -1
- package/dist/css-dPoZJDQH.js.map +0 -1
- package/dist/data-CeYstKMP.js.map +0 -1
- package/dist/extract-DeOytHKW.js +0 -2
- package/dist/getClassName-oiQ8CnkS.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-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.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-DVFxZnVC.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.map +0 -1
- package/dist/value-dG9LK0Gq.js +0 -85
- package/dist/value-dG9LK0Gq.js.map +0 -1
|
@@ -1,9 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as
|
|
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,6 +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
|
+
}
|
|
435
|
+
//#endregion
|
|
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"
|
|
496
|
+
};
|
|
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
|
+
}
|
|
362
645
|
//#endregion
|
|
363
646
|
//#region builder/data/merge/utils.ts
|
|
364
647
|
function cloneData(data, source, debug, merge = true) {
|
|
@@ -1481,7 +1764,7 @@ function createClassNameFn(args) {
|
|
|
1481
1764
|
}
|
|
1482
1765
|
const formatThemeName = createNameFormatter(["name"]);
|
|
1483
1766
|
function createThemeClassName(name, id, themeNameFormat) {
|
|
1484
|
-
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) });
|
|
1485
1768
|
}
|
|
1486
1769
|
function getThemeRuleCss(className, tokens, tokenNameFormat) {
|
|
1487
1770
|
const declarations = [];
|
|
@@ -1493,6 +1776,29 @@ function getThemeDeclaration(token, tokenNameFormat) {
|
|
|
1493
1776
|
const value = token.ref ? getTokenOverrideValue(token, tokenNameFormat) : escapeCssValue(String(token.value ?? ""));
|
|
1494
1777
|
return name + ":" + value;
|
|
1495
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
|
+
}
|
|
1496
1802
|
//#endregion
|
|
1497
1803
|
//#region style/theme.ts
|
|
1498
1804
|
const idCounter = createIdCounter("theme");
|
|
@@ -1508,22 +1814,47 @@ function createTheme(tokens, stableId, callsite) {
|
|
|
1508
1814
|
return createThemeData(callsite ?? null, id, className, tokens);
|
|
1509
1815
|
}
|
|
1510
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
|
|
1511
1842
|
//#region style/value.ts
|
|
1512
|
-
function createToken(value,
|
|
1513
|
-
return createStyleToken(value,
|
|
1843
|
+
function createToken(value, stableId) {
|
|
1844
|
+
return createStyleToken(value, stableId);
|
|
1514
1845
|
}
|
|
1515
1846
|
function createValues(...args) {
|
|
1516
1847
|
let values = args[0];
|
|
1517
1848
|
let isNumber = false;
|
|
1518
|
-
let
|
|
1849
|
+
let stableId = args[1];
|
|
1519
1850
|
if (args[0] === Number) {
|
|
1520
1851
|
values = args[1];
|
|
1521
|
-
|
|
1852
|
+
stableId = args[2];
|
|
1522
1853
|
isNumber = true;
|
|
1523
1854
|
}
|
|
1524
1855
|
if (!values.length) throw new Error("[Style.values] NO_VALUES");
|
|
1525
1856
|
const tokens = /* @__PURE__ */ new Map();
|
|
1526
|
-
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))));
|
|
1527
1858
|
return function ValueFn(...args) {
|
|
1528
1859
|
const [value, provide, debug] = args;
|
|
1529
1860
|
const token = tokens.get(value);
|
|
@@ -1533,8 +1864,18 @@ function createValues(...args) {
|
|
|
1533
1864
|
return token;
|
|
1534
1865
|
};
|
|
1535
1866
|
}
|
|
1536
|
-
function
|
|
1537
|
-
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;
|
|
1538
1879
|
}
|
|
1539
1880
|
function parseValue(value, isNumber) {
|
|
1540
1881
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -1545,30 +1886,6 @@ function parseValue(value, isNumber) {
|
|
|
1545
1886
|
return number;
|
|
1546
1887
|
}
|
|
1547
1888
|
//#endregion
|
|
1548
|
-
|
|
1549
|
-
function createTokens(values, debugId) {
|
|
1550
|
-
const tokens = {};
|
|
1551
|
-
if (Array.isArray(values)) for (let i = 0, len = values.length; i < len; i++) {
|
|
1552
|
-
const value = values[i];
|
|
1553
|
-
tokens[value] = createToken(value, getChildDebugId(debugId, String(i)));
|
|
1554
|
-
}
|
|
1555
|
-
else assignTokenRecord(tokens, values, debugId);
|
|
1556
|
-
return tokens;
|
|
1557
|
-
}
|
|
1558
|
-
function assignTokenRecord(target, values, debugId) {
|
|
1559
|
-
for (let key in values) {
|
|
1560
|
-
const value = values[key];
|
|
1561
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1562
|
-
const child = {};
|
|
1563
|
-
target[key] = child;
|
|
1564
|
-
assignTokenRecord(child, value, getChildDebugId(debugId, key));
|
|
1565
|
-
} else target[key] = createToken(value, getChildDebugId(debugId, key));
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
function getChildDebugId(debugId, child) {
|
|
1569
|
-
return debugId ? debugId + "--" + child : void 0;
|
|
1570
|
-
}
|
|
1571
|
-
//#endregion
|
|
1572
|
-
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 };
|
|
1573
1890
|
|
|
1574
|
-
//# sourceMappingURL=style-
|
|
1891
|
+
//# sourceMappingURL=style-DDxjKdX0.js.map
|