@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
package/dist/config/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as configureStyleRuntime } from "../config-
|
|
1
|
+
import { r as LayerPlaceholder } from "../css-GtUPEO9U.js";
|
|
2
|
+
import { t as configureStyleRuntime } from "../config-BtANtGAh.js";
|
|
3
3
|
export { LayerPlaceholder, configureStyleRuntime };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { a as globalData, t as CSS_CONFIG } from "./css-GtUPEO9U.js";
|
|
2
|
+
import { a as RUNTIME_CONFIG, i as setDebugClassNameEnabled, s as getCacheTTL } from "./debug-DycdGrul.js";
|
|
3
3
|
//#region config/build.ts
|
|
4
4
|
const BUILD_CONFIG = globalData("config.build", () => ({ current: null }));
|
|
5
5
|
function setBuildConfig(config) {
|
|
6
6
|
BUILD_CONFIG.current = config;
|
|
7
7
|
RUNTIME_CONFIG.isHoist = config.hoist;
|
|
8
8
|
if (config.css) {
|
|
9
|
-
const { debugClassName, ...css } = config.css;
|
|
9
|
+
const { debugClassName: _debugClassName, ...css } = config.css;
|
|
10
10
|
Object.assign(CSS_CONFIG, css);
|
|
11
|
-
if (typeof debugClassName === "boolean") setDebugClassNameEnabled(debugClassName);
|
|
12
|
-
else setDebugClassNameDefault(false);
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
13
|
//#endregion
|
|
@@ -30,4 +28,4 @@ function checkBuildConfig(field) {
|
|
|
30
28
|
//#endregion
|
|
31
29
|
export { setBuildConfig as n, configureStyleRuntime as t };
|
|
32
30
|
|
|
33
|
-
//# sourceMappingURL=config-
|
|
31
|
+
//# sourceMappingURL=config-BtANtGAh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-BtANtGAh.js","names":[],"sources":["../config/build.ts","../config/configure.ts"],"sourcesContent":["import { globalData } from '../utils/global';\nimport type { ReplaceProps } from '../utils/type';\nimport { CSS_CONFIG, type CssConfig } from './config/css';\nimport type { DevRuntimeOptions } from './config/dev';\nimport { RUNTIME_CONFIG } from './config/runtime';\nimport type { CheckSelectorMode } from './types';\n\nexport type BuildCssConfig = Partial<CssConfig> & {\n debugClassName?: boolean;\n};\n\nexport type BuildDevConfig = ReplaceProps<DevRuntimeOptions, {\n checkSelector?: CheckSelectorMode;\n}>;\n\nexport type BuildConfig = {\n hoist: boolean;\n css: BuildCssConfig;\n};\n\nexport const BUILD_CONFIG = globalData(\n 'config.build',\n () => ({ current: null as BuildConfig | null }),\n);\n\nexport function setBuildConfig(config: BuildConfig) {\n BUILD_CONFIG.current = config;\n\n RUNTIME_CONFIG.isHoist = config.hoist;\n\n if (config.css) {\n const { debugClassName: _debugClassName, ...css } = config.css;\n Object.assign(CSS_CONFIG, css);\n }\n}\n","import { BUILD_CONFIG } from './build';\nimport { CSS_CONFIG, type CssConfig } from './config/css';\nimport { setDebugClassNameEnabled } from './config/debug';\nimport { RUNTIME_CONFIG } from './config/runtime';\nimport { getCacheTTL } from './utils';\n\nexport type RuntimeCssOptions = Partial<CssConfig> & {\n debugClassName?: boolean;\n};\n\nexport type ConfigureStyleRuntimeOptions = {\n css?: RuntimeCssOptions;\n cacheTTL?: boolean | number;\n};\n\nexport function configureStyleRuntime(options: ConfigureStyleRuntimeOptions = {}) {\n if (options.css) {\n checkBuildConfig('css');\n const { debugClassName, ...css } = options.css;\n Object.assign(CSS_CONFIG, css);\n\n if (typeof debugClassName === 'boolean') {\n setDebugClassNameEnabled(debugClassName);\n }\n }\n\n if (options.cacheTTL !== undefined) {\n RUNTIME_CONFIG.runtimeCacheTTL = getCacheTTL(options.cacheTTL);\n }\n}\n\nfunction checkBuildConfig(field: string) {\n if (!BUILD_CONFIG.current) return;\n\n throw new Error(`Configure \"${field}\" via plugin options.`);\n}\n"],"mappings":";;;AAoBA,MAAa,eAAe,WAC1B,uBACO,EAAE,SAAS,KAA2B,EAC/C;AAEA,SAAgB,eAAe,QAAqB;CAClD,aAAa,UAAU;CAEvB,eAAe,UAAU,OAAO;CAEhC,IAAI,OAAO,KAAK;EACd,MAAM,EAAE,gBAAgB,iBAAiB,GAAG,QAAQ,OAAO;EAC3D,OAAO,OAAO,YAAY,GAAG;CAC/B;AACF;;;ACnBA,SAAgB,sBAAsB,UAAwC,CAAC,GAAG;CAChF,IAAI,QAAQ,KAAK;EACf,iBAAiB,KAAK;EACtB,MAAM,EAAE,gBAAgB,GAAG,QAAQ,QAAQ;EAC3C,OAAO,OAAO,YAAY,GAAG;EAE7B,IAAI,OAAO,mBAAmB,WAC5B,yBAAyB,cAAc;CAE3C;CAEA,IAAI,QAAQ,aAAa,KAAA,GACvB,eAAe,kBAAkB,YAAY,QAAQ,QAAQ;AAEjE;AAEA,SAAS,iBAAiB,OAAe;CACvC,IAAI,CAAC,aAAa,SAAS;CAE3B,MAAM,IAAI,MAAM,cAAc,MAAM,sBAAsB;AAC5D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as setBuildConfig } from "./config-
|
|
3
|
-
import { c as set, r as setBuildDevConfig } from "./dev-
|
|
1
|
+
import { a as RUNTIME_CONFIG, n as setBuildDebugClassName, o as SIDECAR_URL_GLOBAL_SYMBOL } from "./debug-DycdGrul.js";
|
|
2
|
+
import { n as setBuildConfig } from "./config-BtANtGAh.js";
|
|
3
|
+
import { c as set, r as setBuildDevConfig } from "./dev-px0_6TNq.js";
|
|
4
4
|
//#region entry/shared/utils.ts
|
|
5
5
|
function readEntryDefine(key, readDefine, fallback) {
|
|
6
6
|
let defineValue;
|
|
@@ -18,10 +18,12 @@ function readEntryJsonDefine(key, readDefine, fallback) {
|
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region entry/shared/config_dev.ts
|
|
21
|
-
|
|
21
|
+
const buildConfig = readEntryJsonDefine("FLUENTIC_STYLE_BUILD_CONFIG", () => FLUENTIC_STYLE_BUILD_CONFIG, {
|
|
22
22
|
hoist: true,
|
|
23
23
|
css: {}
|
|
24
|
-
})
|
|
24
|
+
});
|
|
25
|
+
setBuildConfig(buildConfig);
|
|
26
|
+
setBuildDebugClassName(buildConfig.css?.debugClassName, false);
|
|
25
27
|
//#endregion
|
|
26
28
|
//#region entry/shared/dev.ts
|
|
27
29
|
set(globalThis, Symbol.for(SIDECAR_URL_GLOBAL_SYMBOL), readEntryDefine("FLUENTIC_STYLE_SIDECAR_SERVER_URL", () => FLUENTIC_STYLE_SIDECAR_SERVER_URL, ""));
|
|
@@ -29,4 +31,4 @@ setBuildDevConfig(readEntryJsonDefine("FLUENTIC_STYLE_DEV_CONFIG", () => FLUENTI
|
|
|
29
31
|
RUNTIME_CONFIG.isPlugin = true;
|
|
30
32
|
//#endregion
|
|
31
33
|
|
|
32
|
-
//# sourceMappingURL=config-
|
|
34
|
+
//# sourceMappingURL=config-CduqubI8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CduqubI8.js","names":[],"sources":["../entry/shared/utils.ts","../entry/shared/config_dev.ts","../entry/shared/dev.ts"],"sourcesContent":["export function readEntryDefine(\n key: string,\n readDefine: () => unknown,\n fallback: string,\n) {\n let defineValue: unknown;\n\n try {\n defineValue = readDefine();\n } catch {\n defineValue = undefined;\n }\n\n if (typeof defineValue === 'string') return defineValue;\n\n const value = (globalThis as Record<string, unknown>)[key];\n return typeof value === 'string' ? value : fallback;\n}\n\nexport function readEntryJsonDefine<T>(\n key: string,\n readDefine: () => unknown,\n fallback: T,\n): T {\n return JSON.parse(\n readEntryDefine(key, readDefine, JSON.stringify(fallback)),\n ) as T;\n}\n","import { type BuildConfig, setBuildConfig } from '../../config/build';\nimport { setBuildDebugClassName } from '../../config/config/debug';\nimport { readEntryJsonDefine } from './utils';\n\ndeclare const FLUENTIC_STYLE_BUILD_CONFIG: string;\n\nconst buildConfig = readEntryJsonDefine<BuildConfig>(\n 'FLUENTIC_STYLE_BUILD_CONFIG',\n () => FLUENTIC_STYLE_BUILD_CONFIG,\n { hoist: true, css: {} } satisfies BuildConfig,\n);\n\nsetBuildConfig(buildConfig);\nsetBuildDebugClassName(buildConfig.css?.debugClassName, false);\n","import { setBuildDevConfig } from '../../config/config/dev';\nimport { RUNTIME_CONFIG } from '../../config/config/runtime';\nimport { SIDECAR_URL_GLOBAL_SYMBOL } from '../../config/utils';\nimport { set } from '../../utils/object';\nimport { readEntryDefine, readEntryJsonDefine } from './utils';\n\ndeclare const FLUENTIC_STYLE_SIDECAR_SERVER_URL: string;\ndeclare const FLUENTIC_STYLE_DEV_CONFIG: string;\n\nset(\n globalThis,\n Symbol.for(SIDECAR_URL_GLOBAL_SYMBOL),\n readEntryDefine(\n 'FLUENTIC_STYLE_SIDECAR_SERVER_URL',\n () => FLUENTIC_STYLE_SIDECAR_SERVER_URL,\n '',\n ),\n);\n\nsetBuildDevConfig(\n readEntryJsonDefine(\n 'FLUENTIC_STYLE_DEV_CONFIG',\n () => FLUENTIC_STYLE_DEV_CONFIG,\n {},\n ),\n);\n\nRUNTIME_CONFIG.isPlugin = true;\n"],"mappings":";;;;AAAA,SAAgB,gBACd,KACA,YACA,UACA;CACA,IAAI;CAEJ,IAAI;EACF,cAAc,WAAW;CAC3B,QAAQ;EACN,cAAc,KAAA;CAChB;CAEA,IAAI,OAAO,gBAAgB,UAAU,OAAO;CAE5C,MAAM,QAAS,WAAuC;CACtD,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAgB,oBACd,KACA,YACA,UACG;CACH,OAAO,KAAK,MACV,gBAAgB,KAAK,YAAY,KAAK,UAAU,QAAQ,CAAC,CAC3D;AACF;;;ACrBA,MAAM,cAAc,oBAClB,qCACM,6BACN;CAAE,OAAO;CAAM,KAAK,CAAC;AAAE,CACzB;AAEA,eAAe,WAAW;AAC1B,uBAAuB,YAAY,KAAK,gBAAgB,KAAK;;;ACJ7D,IACE,YACA,OAAO,IAAI,yBAAyB,GACpC,gBACE,2CACM,mCACN,EACF,CACF;AAEA,kBACE,oBACE,mCACM,2BACN,CAAC,CACH,CACF;AAEA,eAAe,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-lJNLh7eM.js","names":[],"sources":["../entry/shared/config.ts"],"sourcesContent":["import { setBuildConfig } from '../../config/build';\n\ndeclare const FLUENTIC_STYLE_BUILD_CONFIG: string;\n\nsetBuildConfig(JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG));\n"],"mappings":";;AAIA,eAAe,KAAK,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
1
|
+
{"version":3,"file":"config-oKOjOTWi.js","names":[],"sources":["../entry/rsc_prod/config.ts"],"sourcesContent":["import { RUNTIME_CONFIG } from '../../config/config/runtime';\n\nimport '../shared/config';\nimport '../shared/prod';\n\nRUNTIME_CONFIG.isRSC = true;\n"],"mappings":";;;AAKA,eAAe,QAAQ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CSS_EXTRA_CONFIG } from "./css_extra-
|
|
1
|
+
import { F as createNameFormatter, P as getIdentifierSafeHash, U as CSS_CONFIG, X as symbol, Y as globalData, g as getStyleTokenId, o as getTokenVar, r as getCssPropertyName, t as getCssPropertyValue, y as isStyleTokenData } from "./value-D08AocUs.js";
|
|
2
|
+
import { t as CSS_EXTRA_CONFIG } from "./css_extra-DYtS3g6Z.js";
|
|
3
3
|
//#region style/valueRef.ts
|
|
4
4
|
const AT_RULE_REF = symbol("atRule.ref");
|
|
5
5
|
function createAtRuleRef(data) {
|
|
@@ -240,4 +240,4 @@ function createProperty(nameOrDescriptors, descriptorsOrStableId) {
|
|
|
240
240
|
//#endregion
|
|
241
241
|
export { createFontFace as a, createIdCounter as c, createAtRuleRef as d, isAtRuleRef as f, createFontPaletteValues as i, getId as l, createPositionTry as n, fontSrc as o, createKeyframes as r, createCounterStyle as s, createProperty as t, AT_RULE_REF as u };
|
|
242
242
|
|
|
243
|
-
//# sourceMappingURL=css-
|
|
243
|
+
//# sourceMappingURL=css-BewrRz3_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-DcuJ_jSH.js","names":["idCounter","idCounter","idCounter","idCounter","idCounter"],"sources":["../style/valueRef.ts","../atomic/atRule/utils.ts","../atomic/atRule/counterStyle.ts","../utils/id.ts","../css/utils.ts","../css/counterStyle.ts","../atomic/atRule/fontFace.ts","../atomic/atRule/fontSrc.ts","../css/fontFace.ts","../atomic/atRule/fontPaletteValues.ts","../css/fontPaletteValues.ts","../atomic/atRule/keyframes.ts","../css/keyframes.ts","../atomic/atRule/positionTry.ts","../css/positionTry.ts","../atomic/atRule/property.ts","../css/property.ts"],"sourcesContent":["import { symbol } from '../utils/global';\nimport type { StyleTokenData } from './token';\n\nexport const AT_RULE_REF: unique symbol = symbol('atRule.ref');\n\nexport type AtRuleRefData = {\n key: string;\n value: string;\n css: string | null;\n tokens?: readonly StyleTokenData[];\n};\n\nexport type AtRuleRef = AtRuleRefData & {\n [AT_RULE_REF]: true;\n};\n\nexport function createAtRuleRef(data: AtRuleRefData): AtRuleRef {\n return { [AT_RULE_REF]: true, ...data };\n}\n\nexport function isAtRuleRef(value: unknown): value is AtRuleRef {\n return !!value &&\n typeof value === 'object' &&\n (value as AtRuleRef)[AT_RULE_REF] === true;\n}\n","import { CSS_CONFIG } from '../../config/config/css';\nimport { type NamedAtRuleFormat, type NamedAtRuleInfo, type TokenNameFormat } from '../../config/types';\nimport { getStyleTokenId, isStyleTokenData, type StyleTokenData } from '../../style/token';\nimport { getCssPropertyName } from '../property';\nimport { getTokenVar } from '../token';\nimport { createNameFormatter } from '../utils/format';\nimport { getIdentifierSafeHash } from '../utils/hash';\nimport { getCssPropertyValue } from '../value';\n\nexport function createAtRuleNameFormatter(defaultFormat: NamedAtRuleFormat, prefix?: string) {\n const formatter = createNameFormatter<NamedAtRuleInfo>(['name']);\n\n return (\n format: NamedAtRuleFormat | null,\n id: string,\n info: NamedAtRuleInfo,\n ) => {\n const hash = getIdentifierSafeHash(id, CSS_CONFIG.hashLength);\n const name = formatter(format || defaultFormat, hash, info);\n\n if (!prefix) return name;\n\n return name.startsWith(prefix) ? name : prefix + name;\n };\n}\n\nexport function buildNamedAtRuleCss(\n atRule: string,\n name: string,\n descriptors: object,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n return `@${atRule} ${name} {${\n buildAtRuleDeclarationCss(\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n true,\n )\n }}`;\n}\n\nexport function buildAtRuleDeclarationCss(\n style: Record<string, any>,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n rawValue: boolean,\n shouldInclude?: (property: string) => boolean,\n) {\n let css = '';\n\n for (const property in style) {\n if (shouldInclude && !shouldInclude(property)) continue;\n\n let value = style[property];\n\n if (Array.isArray(value) && value.length === 2 && typeof value[0] === 'number') {\n value = value[1];\n }\n\n if (isStyleTokenData(value)) {\n const tokenId = getStyleTokenId(value);\n if (!tokenLookup.has(tokenId)) {\n tokenLookup.add(tokenId);\n tokens.push(value);\n }\n\n css += `${getCssPropertyName(property)}: ${getTokenVar(value, tokenNameFormat)};`;\n continue;\n }\n\n const valueString = String(value ?? '');\n\n css += `${getCssPropertyName(property)}: ${rawValue ? valueString : getCssPropertyValue(property, valueString)};`;\n }\n\n return css;\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type CounterStyleObject = CSS.AtRule.CounterStyle;\n\nexport const COUNTER_STYLE_AT_RULE = 'counter-style';\n\nexport const formatCounterStyleName = createAtRuleNameFormatter(\n 'counter-style[-(name)]-$hash',\n);\n\nexport function buildCounterStyleCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: CounterStyleObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatCounterStyleName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n COUNTER_STYLE_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { globalData } from './global';\n\nexport type StableId = {\n name: string | null;\n id: string;\n};\n\nexport type IdCounter = { value: number; };\n\nexport function createIdCounter(name: string) {\n return globalData('idCounter.' + name, () => ({ value: 0 }));\n}\n\nexport function resetIdCounter(idCounter: IdCounter) {\n idCounter.value = 0;\n}\n\nexport function getId(idCounter: IdCounter, stableId: StableId | null): StableId {\n return stableId || { name: null, id: String(idCounter.value++) };\n}\n","import { CSS_CONFIG } from '../config/config/css';\nimport type { NamedAtRuleFormat, TokenNameFormat } from '../config/types';\nimport type { StyleTokenData } from '../style/token';\nimport { type AtRuleRef, createAtRuleRef } from '../style/valueRef';\nimport { getId, type IdCounter, type StableId } from '../utils/id';\n\nexport type StableIdInput = StableId;\n\nexport type BuiltAtRuleCss = {\n name: string;\n css: string;\n};\n\nexport type BuildNamedAtRuleCss<Value> = (\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n value: Value,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) => BuiltAtRuleCss;\n\ntype CreateNamedAtRuleRefConfig<Value> = {\n format: NamedAtRuleFormat | null | undefined;\n value: Value;\n buildCss: BuildNamedAtRuleCss<Value>;\n idCounter: IdCounter;\n stableId: StableId | null | undefined;\n};\n\nexport function createNamedAtRuleRef<Value>(\n config: CreateNamedAtRuleRefConfig<Value>,\n): AtRuleRef {\n const { id, name } = getId(config.idCounter, config.stableId || null);\n\n const tokens: StyleTokenData[] = [];\n const tokenLookup = new Set<string>();\n\n const css = config.buildCss(\n config.format || null,\n name,\n id,\n config.value,\n tokens,\n tokenLookup,\n CSS_CONFIG.tokenNameFormat || null,\n );\n\n return createAtRuleRef({\n key: css.name,\n value: css.name,\n css: css.css,\n tokens: tokens.length ? tokens : undefined,\n });\n}\n","import { buildCounterStyleCss, type CounterStyleObject } from '../atomic/atRule/counterStyle';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { CounterStyleObject };\n\nconst idCounter = createIdCounter('counterStyle');\n\nexport function createCounterStyle(descriptors: CounterStyleObject): AtRuleRef;\nexport function createCounterStyle(descriptors: CounterStyleObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.counterStyle,\n buildCss: buildCounterStyleCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';\n\nexport type FontFaceObject = CSS.AtRule.FontFace;\n\nexport const FONT_FACE_AT_RULE = 'font-face';\n\nexport const formatFontFaceName = createAtRuleNameFormatter(\n 'font[-(name)]-$hash',\n);\n\nexport function buildFontFaceCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: FontFaceObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatFontFaceName(format, id, { name });\n\n let css = buildAtRuleDeclarationCss(\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n true,\n (property) => property !== 'fontFamily',\n );\n\n css = `@${FONT_FACE_AT_RULE} { font-family: ${name}; ${css} }`;\n\n return { name, css };\n}\n","export function fontSrc(url: string, format?: string) {\n if (typeof url !== 'string') {\n throw new Error('fontSrc url must be a static string');\n }\n\n const src = `url(\"${escapeFontSrcPart(url)}\")`;\n\n return format ? `${src} format(\"${escapeFontSrcPart(format)}\")` : src;\n}\n\nfunction escapeFontSrcPart(value: string) {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n}\n","import { buildFontFaceCss, type FontFaceObject } from '../atomic/atRule/fontFace';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport { fontSrc } from '../atomic/atRule/fontSrc';\nexport type { FontFaceObject };\n\nconst idCounter = createIdCounter('fontFace');\n\nexport function createFontFace(descriptors: FontFaceObject): AtRuleRef;\nexport function createFontFace(descriptors: FontFaceObject, stableId?: StableId): AtRuleRef {\n if (typeof descriptors.src !== 'string') {\n throw new Error('createFontFace \"src\" must be a static string');\n }\n\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.fontFace,\n buildCss: buildFontFaceCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type FontPaletteValuesObject = CSS.AtRule.FontPaletteValues;\n\nexport const FONT_PALETTE_VALUES_AT_RULE = 'font-palette-values';\n\nexport const formatFontPaletteValuesName = createAtRuleNameFormatter(\n 'font-palettle[-(name)]-$hash',\n '--',\n);\n\nexport function buildFontPaletteValuesCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: FontPaletteValuesObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatFontPaletteValuesName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n FONT_PALETTE_VALUES_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { buildFontPaletteValuesCss, type FontPaletteValuesObject } from '../atomic/atRule/fontPaletteValues';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { FontPaletteValuesObject };\n\nconst idCounter = createIdCounter('fontPaletteValues');\n\nexport function createFontPaletteValues(descriptors: FontPaletteValuesObject): AtRuleRef;\nexport function createFontPaletteValues(descriptors: FontPaletteValuesObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.fontPaletteValues,\n buildCss: buildFontPaletteValuesCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { AtRuleStyleObject, CSSProperties } from '../../style/types';\nimport { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';\n\nexport type KeyframeSelector = 'from' | 'to' | `${number}%` | (string & {});\n\nexport type KeyframesObject<Style = CSSProperties> = {\n [Selector in KeyframeSelector]?: AtRuleStyleObject<Style>;\n};\n\nexport const KEYFRAMES_AT_RULE = 'keyframes';\n\nexport const formatKeyFramesName = createAtRuleNameFormatter(\n 'keyframes[-(name)]-$hash',\n);\n\nexport function buildKeyframesCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n frames: KeyframesObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatKeyFramesName(format, id, { name });\n\n let css = `@${KEYFRAMES_AT_RULE} ${name} {`;\n\n for (const selector in frames) {\n const frame = frames[selector];\n if (!frame) continue;\n\n css += selector + '{';\n css += buildAtRuleDeclarationCss(frame, tokens, tokenLookup, tokenNameFormat, false);\n css += '}';\n }\n\n css += '}';\n\n return { name, css };\n}\n","import { buildKeyframesCss, type KeyframesObject } from '../atomic/atRule/keyframes';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { KeyframesObject };\n\nconst idCounter = createIdCounter('keyframes');\n\nexport function createKeyframes(frames: KeyframesObject): AtRuleRef;\nexport function createKeyframes(frames: KeyframesObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.keyframes,\n buildCss: buildKeyframesCss,\n value: frames,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { AtRuleStyleObject } from '../../style';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSSProperties } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\ntype Properties = Pick<\n CSSProperties,\n | 'positionArea'\n | 'insetArea'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'inset'\n | 'insetBlock'\n | 'insetBlockStart'\n | 'insetBlockEnd'\n | 'insetInline'\n | 'insetInlineStart'\n | 'insetInlineEnd'\n | 'width'\n | 'minWidth'\n | 'maxWidth'\n | 'height'\n | 'minHeight'\n | 'maxHeight'\n | 'blockSize'\n | 'minBlockSize'\n | 'maxBlockSize'\n | 'inlineSize'\n | 'minInlineSize'\n | 'maxInlineSize'\n | 'margin'\n | 'marginBlock'\n | 'marginBlockStart'\n | 'marginBlockEnd'\n | 'marginInline'\n | 'marginInlineStart'\n | 'marginInlineEnd'\n>;\n\nexport type PositionTryObject = AtRuleStyleObject<Properties>;\n\nexport const POSITION_TRY_AT_RULE = 'position-try';\n\nexport const formatPositionTryName = createAtRuleNameFormatter(\n 'position-try[-(name)]-$hash',\n '--',\n);\n\nexport function buildPositionTryCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: PositionTryObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatPositionTryName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n POSITION_TRY_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { buildPositionTryCss, type PositionTryObject } from '../atomic/atRule/positionTry';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { PositionTryObject };\n\nconst idCounter = createIdCounter('positionTry');\n\nexport function createPositionTry(descriptors: PositionTryObject): AtRuleRef;\nexport function createPositionTry(descriptors: PositionTryObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.positionTry,\n buildCss: buildPositionTryCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type PropertyObject = {\n syntax: string;\n inherits: boolean;\n initialValue: string | number;\n};\n\nexport const PROPERTY_AT_RULE = 'property';\n\nexport const formatPropertyName = createAtRuleNameFormatter(\n '[-(name)]-$hash',\n '--',\n);\n\nexport function buildPropertyCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: PropertyObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatPropertyName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n PROPERTY_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { css, name };\n}\n","import { buildPropertyCss, type PropertyObject } from '../atomic/atRule/property';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { PropertyObject };\n\nconst idCounter = createIdCounter('property');\n\nexport function createProperty(descriptors: PropertyObject): AtRuleRef;\nexport function createProperty(descriptors: PropertyObject, stableId?: StableId): AtRuleRef;\nexport function createProperty(name: string, descriptors: PropertyObject): AtRuleRef;\nexport function createProperty(\n nameOrDescriptors: string | PropertyObject,\n descriptorsOrStableId?: PropertyObject | StableId,\n): AtRuleRef {\n const descriptors = typeof nameOrDescriptors === 'string'\n ? descriptorsOrStableId as PropertyObject\n : nameOrDescriptors;\n const stableId = typeof nameOrDescriptors === 'string'\n ? { name: nameOrDescriptors, id: nameOrDescriptors }\n : descriptorsOrStableId as StableId | undefined;\n\n return createNamedAtRuleRef({\n idCounter,\n stableId,\n format: CSS_EXTRA_CONFIG.namedRuleFormat.property,\n value: descriptors,\n buildCss: buildPropertyCss,\n });\n}\n"],"mappings":";;;AAGA,MAAa,cAA6B,OAAO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AAgB,eACd,mBACA,uBACW;CACX,MAAM,cAAc,OAAO,sBAAsB,WAC7C,wBACA;CAKJ,OAAO,qBAAqB;EAC1B;EACA,UANe,OAAO,sBAAsB,WAC1C;GAAE,MAAM;GAAmB,IAAI;EAAkB,IACjD;EAKF,QAAQ,iBAAiB,gBAAgB;EACzC,OAAO;EACP,UAAU;CACZ,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"css-BewrRz3_.js","names":["idCounter","idCounter","idCounter","idCounter","idCounter"],"sources":["../style/valueRef.ts","../atomic/atRule/utils.ts","../atomic/atRule/counterStyle.ts","../utils/id.ts","../css/utils.ts","../css/counterStyle.ts","../atomic/atRule/fontFace.ts","../atomic/atRule/fontSrc.ts","../css/fontFace.ts","../atomic/atRule/fontPaletteValues.ts","../css/fontPaletteValues.ts","../atomic/atRule/keyframes.ts","../css/keyframes.ts","../atomic/atRule/positionTry.ts","../css/positionTry.ts","../atomic/atRule/property.ts","../css/property.ts"],"sourcesContent":["import { symbol } from '../utils/symbol';\nimport type { StyleTokenData } from './token';\n\nexport const AT_RULE_REF: unique symbol = symbol('atRule.ref');\n\nexport type AtRuleRefData = {\n key: string;\n value: string;\n css: string | null;\n tokens?: readonly StyleTokenData[];\n};\n\nexport type AtRuleRef = AtRuleRefData & {\n [AT_RULE_REF]: true;\n};\n\nexport function createAtRuleRef(data: AtRuleRefData): AtRuleRef {\n return { [AT_RULE_REF]: true, ...data };\n}\n\nexport function isAtRuleRef(value: unknown): value is AtRuleRef {\n return !!value &&\n typeof value === 'object' &&\n (value as AtRuleRef)[AT_RULE_REF] === true;\n}\n","import { CSS_CONFIG } from '../../config/config/css';\nimport { type NamedAtRuleFormat, type NamedAtRuleInfo, type TokenNameFormat } from '../../config/types';\nimport { getStyleTokenId, isStyleTokenData, type StyleTokenData } from '../../style/token';\nimport { getCssPropertyName } from '../property';\nimport { getTokenVar } from '../token';\nimport { createNameFormatter } from '../utils/format';\nimport { getIdentifierSafeHash } from '../utils/hash';\nimport { getCssPropertyValue } from '../value';\n\nexport function createAtRuleNameFormatter(defaultFormat: NamedAtRuleFormat, prefix?: string) {\n const formatter = createNameFormatter<NamedAtRuleInfo>(['name']);\n\n return (\n format: NamedAtRuleFormat | null,\n id: string,\n info: NamedAtRuleInfo,\n ) => {\n const hash = getIdentifierSafeHash(id, CSS_CONFIG.hashLength);\n const name = formatter(format || defaultFormat, hash, info);\n\n if (!prefix) return name;\n\n return name.startsWith(prefix) ? name : prefix + name;\n };\n}\n\nexport function buildNamedAtRuleCss(\n atRule: string,\n name: string,\n descriptors: object,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n return `@${atRule} ${name} {${\n buildAtRuleDeclarationCss(\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n true,\n )\n }}`;\n}\n\nexport function buildAtRuleDeclarationCss(\n style: Record<string, any>,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n rawValue: boolean,\n shouldInclude?: (property: string) => boolean,\n) {\n let css = '';\n\n for (const property in style) {\n if (shouldInclude && !shouldInclude(property)) continue;\n\n let value = style[property];\n\n if (Array.isArray(value) && value.length === 2 && typeof value[0] === 'number') {\n value = value[1];\n }\n\n if (isStyleTokenData(value)) {\n const tokenId = getStyleTokenId(value);\n if (!tokenLookup.has(tokenId)) {\n tokenLookup.add(tokenId);\n tokens.push(value);\n }\n\n css += `${getCssPropertyName(property)}: ${getTokenVar(value, tokenNameFormat)};`;\n continue;\n }\n\n const valueString = String(value ?? '');\n\n css += `${getCssPropertyName(property)}: ${rawValue ? valueString : getCssPropertyValue(property, valueString)};`;\n }\n\n return css;\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type CounterStyleObject = CSS.AtRule.CounterStyle;\n\nexport const COUNTER_STYLE_AT_RULE = 'counter-style';\n\nexport const formatCounterStyleName = createAtRuleNameFormatter(\n 'counter-style[-(name)]-$hash',\n);\n\nexport function buildCounterStyleCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: CounterStyleObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatCounterStyleName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n COUNTER_STYLE_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { globalData } from './global';\n\nexport type StableId = {\n name: string | null;\n id: string;\n};\n\nexport type IdCounter = { value: number; };\n\nexport function createIdCounter(name: string) {\n return globalData('idCounter.' + name, () => ({ value: 0 }));\n}\n\nexport function resetIdCounter(idCounter: IdCounter) {\n idCounter.value = 0;\n}\n\nexport function getId(idCounter: IdCounter, stableId: StableId | null): StableId {\n return stableId || { name: null, id: String(idCounter.value++) };\n}\n","import { CSS_CONFIG } from '../config/config/css';\nimport type { NamedAtRuleFormat, TokenNameFormat } from '../config/types';\nimport type { StyleTokenData } from '../style/token';\nimport { type AtRuleRef, createAtRuleRef } from '../style/valueRef';\nimport { getId, type IdCounter, type StableId } from '../utils/id';\n\nexport type StableIdInput = StableId;\n\nexport type BuiltAtRuleCss = {\n name: string;\n css: string;\n};\n\nexport type BuildNamedAtRuleCss<Value> = (\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n value: Value,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) => BuiltAtRuleCss;\n\ntype CreateNamedAtRuleRefConfig<Value> = {\n format: NamedAtRuleFormat | null | undefined;\n value: Value;\n buildCss: BuildNamedAtRuleCss<Value>;\n idCounter: IdCounter;\n stableId: StableId | null | undefined;\n};\n\nexport function createNamedAtRuleRef<Value>(\n config: CreateNamedAtRuleRefConfig<Value>,\n): AtRuleRef {\n const { id, name } = getId(config.idCounter, config.stableId || null);\n\n const tokens: StyleTokenData[] = [];\n const tokenLookup = new Set<string>();\n\n const css = config.buildCss(\n config.format || null,\n name,\n id,\n config.value,\n tokens,\n tokenLookup,\n CSS_CONFIG.tokenNameFormat || null,\n );\n\n return createAtRuleRef({\n key: css.name,\n value: css.name,\n css: css.css,\n tokens: tokens.length ? tokens : undefined,\n });\n}\n","import { buildCounterStyleCss, type CounterStyleObject } from '../atomic/atRule/counterStyle';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { CounterStyleObject };\n\nconst idCounter = createIdCounter('counterStyle');\n\nexport function createCounterStyle(descriptors: CounterStyleObject): AtRuleRef;\nexport function createCounterStyle(descriptors: CounterStyleObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.counterStyle,\n buildCss: buildCounterStyleCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';\n\nexport type FontFaceObject = CSS.AtRule.FontFace;\n\nexport const FONT_FACE_AT_RULE = 'font-face';\n\nexport const formatFontFaceName = createAtRuleNameFormatter(\n 'font[-(name)]-$hash',\n);\n\nexport function buildFontFaceCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: FontFaceObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatFontFaceName(format, id, { name });\n\n let css = buildAtRuleDeclarationCss(\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n true,\n (property) => property !== 'fontFamily',\n );\n\n css = `@${FONT_FACE_AT_RULE} { font-family: ${name}; ${css} }`;\n\n return { name, css };\n}\n","export function fontSrc(url: string, format?: string) {\n if (typeof url !== 'string') {\n throw new Error('fontSrc url must be a static string');\n }\n\n const src = `url(\"${escapeFontSrcPart(url)}\")`;\n\n return format ? `${src} format(\"${escapeFontSrcPart(format)}\")` : src;\n}\n\nfunction escapeFontSrcPart(value: string) {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n}\n","import { buildFontFaceCss, type FontFaceObject } from '../atomic/atRule/fontFace';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport { fontSrc } from '../atomic/atRule/fontSrc';\nexport type { FontFaceObject };\n\nconst idCounter = createIdCounter('fontFace');\n\nexport function createFontFace(descriptors: FontFaceObject): AtRuleRef;\nexport function createFontFace(descriptors: FontFaceObject, stableId?: StableId): AtRuleRef {\n if (typeof descriptors.src !== 'string') {\n throw new Error('createFontFace \"src\" must be a static string');\n }\n\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.fontFace,\n buildCss: buildFontFaceCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSS } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type FontPaletteValuesObject = CSS.AtRule.FontPaletteValues;\n\nexport const FONT_PALETTE_VALUES_AT_RULE = 'font-palette-values';\n\nexport const formatFontPaletteValuesName = createAtRuleNameFormatter(\n 'font-palettle[-(name)]-$hash',\n '--',\n);\n\nexport function buildFontPaletteValuesCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: FontPaletteValuesObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatFontPaletteValuesName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n FONT_PALETTE_VALUES_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { buildFontPaletteValuesCss, type FontPaletteValuesObject } from '../atomic/atRule/fontPaletteValues';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { FontPaletteValuesObject };\n\nconst idCounter = createIdCounter('fontPaletteValues');\n\nexport function createFontPaletteValues(descriptors: FontPaletteValuesObject): AtRuleRef;\nexport function createFontPaletteValues(descriptors: FontPaletteValuesObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.fontPaletteValues,\n buildCss: buildFontPaletteValuesCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport type { AtRuleStyleObject, CSSProperties } from '../../style/types';\nimport { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';\n\nexport type KeyframeSelector = 'from' | 'to' | `${number}%` | (string & {});\n\nexport type KeyframesObject<Style = CSSProperties> = {\n [Selector in KeyframeSelector]?: AtRuleStyleObject<Style>;\n};\n\nexport const KEYFRAMES_AT_RULE = 'keyframes';\n\nexport const formatKeyFramesName = createAtRuleNameFormatter(\n 'keyframes[-(name)]-$hash',\n);\n\nexport function buildKeyframesCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n frames: KeyframesObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatKeyFramesName(format, id, { name });\n\n let css = `@${KEYFRAMES_AT_RULE} ${name} {`;\n\n for (const selector in frames) {\n const frame = frames[selector];\n if (!frame) continue;\n\n css += selector + '{';\n css += buildAtRuleDeclarationCss(frame, tokens, tokenLookup, tokenNameFormat, false);\n css += '}';\n }\n\n css += '}';\n\n return { name, css };\n}\n","import { buildKeyframesCss, type KeyframesObject } from '../atomic/atRule/keyframes';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { KeyframesObject };\n\nconst idCounter = createIdCounter('keyframes');\n\nexport function createKeyframes(frames: KeyframesObject): AtRuleRef;\nexport function createKeyframes(frames: KeyframesObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.keyframes,\n buildCss: buildKeyframesCss,\n value: frames,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { AtRuleStyleObject } from '../../style';\nimport type { StyleTokenData } from '../../style/token';\nimport type { CSSProperties } from '../utils/types';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\ntype Properties = Pick<\n CSSProperties,\n | 'positionArea'\n | 'insetArea'\n | 'top'\n | 'right'\n | 'bottom'\n | 'left'\n | 'inset'\n | 'insetBlock'\n | 'insetBlockStart'\n | 'insetBlockEnd'\n | 'insetInline'\n | 'insetInlineStart'\n | 'insetInlineEnd'\n | 'width'\n | 'minWidth'\n | 'maxWidth'\n | 'height'\n | 'minHeight'\n | 'maxHeight'\n | 'blockSize'\n | 'minBlockSize'\n | 'maxBlockSize'\n | 'inlineSize'\n | 'minInlineSize'\n | 'maxInlineSize'\n | 'margin'\n | 'marginBlock'\n | 'marginBlockStart'\n | 'marginBlockEnd'\n | 'marginInline'\n | 'marginInlineStart'\n | 'marginInlineEnd'\n>;\n\nexport type PositionTryObject = AtRuleStyleObject<Properties>;\n\nexport const POSITION_TRY_AT_RULE = 'position-try';\n\nexport const formatPositionTryName = createAtRuleNameFormatter(\n 'position-try[-(name)]-$hash',\n '--',\n);\n\nexport function buildPositionTryCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: PositionTryObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatPositionTryName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n POSITION_TRY_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { name, css };\n}\n","import { buildPositionTryCss, type PositionTryObject } from '../atomic/atRule/positionTry';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { PositionTryObject };\n\nconst idCounter = createIdCounter('positionTry');\n\nexport function createPositionTry(descriptors: PositionTryObject): AtRuleRef;\nexport function createPositionTry(descriptors: PositionTryObject, stableId?: StableId): AtRuleRef {\n return createNamedAtRuleRef({\n format: CSS_EXTRA_CONFIG.namedRuleFormat.positionTry,\n buildCss: buildPositionTryCss,\n value: descriptors,\n idCounter,\n stableId,\n });\n}\n","import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';\nimport type { StyleTokenData } from '../../style/token';\nimport { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';\n\nexport type PropertyObject = {\n syntax: string;\n inherits: boolean;\n initialValue: string | number;\n};\n\nexport const PROPERTY_AT_RULE = 'property';\n\nexport const formatPropertyName = createAtRuleNameFormatter(\n '[-(name)]-$hash',\n '--',\n);\n\nexport function buildPropertyCss(\n format: NamedAtRuleFormat | null,\n name: string | null,\n id: string,\n descriptors: PropertyObject,\n tokens: StyleTokenData[],\n tokenLookup: Set<string>,\n tokenNameFormat: TokenNameFormat | null,\n) {\n name = formatPropertyName(format, id, { name });\n\n const css = buildNamedAtRuleCss(\n PROPERTY_AT_RULE,\n name,\n descriptors,\n tokens,\n tokenLookup,\n tokenNameFormat,\n );\n\n return { css, name };\n}\n","import { buildPropertyCss, type PropertyObject } from '../atomic/atRule/property';\nimport { CSS_EXTRA_CONFIG } from '../config/config/css_extra';\nimport type { AtRuleRef } from '../style/valueRef';\nimport { createIdCounter, type StableId } from '../utils/id';\nimport { createNamedAtRuleRef } from './utils';\n\nexport type { PropertyObject };\n\nconst idCounter = createIdCounter('property');\n\nexport function createProperty(descriptors: PropertyObject): AtRuleRef;\nexport function createProperty(descriptors: PropertyObject, stableId?: StableId): AtRuleRef;\nexport function createProperty(name: string, descriptors: PropertyObject): AtRuleRef;\nexport function createProperty(\n nameOrDescriptors: string | PropertyObject,\n descriptorsOrStableId?: PropertyObject | StableId,\n): AtRuleRef {\n const descriptors = typeof nameOrDescriptors === 'string'\n ? descriptorsOrStableId as PropertyObject\n : nameOrDescriptors;\n const stableId = typeof nameOrDescriptors === 'string'\n ? { name: nameOrDescriptors, id: nameOrDescriptors }\n : descriptorsOrStableId as StableId | undefined;\n\n return createNamedAtRuleRef({\n idCounter,\n stableId,\n format: CSS_EXTRA_CONFIG.namedRuleFormat.property,\n value: descriptors,\n buildCss: buildPropertyCss,\n });\n}\n"],"mappings":";;;AAGA,MAAa,cAA6B,OAAO,YAAY;AAa7D,SAAgB,gBAAgB,MAAgC;CAC9D,OAAO;GAAG,cAAc;EAAM,GAAG;CAAK;AACxC;AAEA,SAAgB,YAAY,OAAoC;CAC9D,OAAO,CAAC,CAAC,SACP,OAAO,UAAU,YAChB,MAAoB,iBAAiB;AAC1C;;;ACfA,SAAgB,0BAA0B,eAAkC,QAAiB;CAC3F,MAAM,YAAY,oBAAqC,CAAC,MAAM,CAAC;CAE/D,QACE,QACA,IACA,SACG;EACH,MAAM,OAAO,sBAAsB,IAAI,WAAW,UAAU;EAC5D,MAAM,OAAO,UAAU,UAAU,eAAe,MAAM,IAAI;EAE1D,IAAI,CAAC,QAAQ,OAA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AC1B,QAAQ,iBAAiB,gBAAgB;EACzC,UAAU;EACV,OAAO;EACP,WAAA;EACA;CACF,CAAC;AACH;;;ACyBA,MAAa,uBAAuB;AAEpC,MAAa,wBAAwB,0BACnC,+BACA,IACF;AAEA,SAAgB,oBACd,QACA,MACA,IACA,aACA,QACA,aACA,iBACA;CACA,OAAO,sBAAsB,QAAQ,IAAI,EAAE,KAAK,CAAC;CAEjD,MAAM,MAAM,oBACV,sBACA,MACA,aACA,QACA,aACA,eACF;CAEA,OAAO;EAAE;EAAM;CAAI;AACrB;;;AChEA,MAAMC,cAAY,gBAAgB,aAAa;AAG/C,SAAgB,kBAAkB,aAAgC,UAAgC;CAChG,OAAO,qBAAqB;EAC1B,QAAQ,iBAAiB,gBAAgB;EACzC,UAAU;EACV,OAAO;EACP,WAAA;EACA;CACF,CAAC;AACH;;;ACTA,MAAa,mBAAmB;AAEhC,MAAa,qBAAqB,0BAChC,mBACA,IACF;AAEA,SAAgB,iBACd,QACA,MACA,IACA,aACA,QACA,aACA,iBACA;CACA,OAAO,mBAAmB,QAAQ,IAAI,EAAE,KAAK,CAAC;CAW9C,OAAO;EAAE,KATG,oBACV,kBACA,MACA,aACA,QACA,aACA,eAGS;EAAG;CAAK;AACrB;;;AC9BA,MAAM,YAAY,gBAAgB,UAAU;AAK5C,SAAgB,eACd,mBACA,uBACW;CACX,MAAM,cAAc,OAAO,sBAAsB,WAC7C,wBACA;CAKJ,OAAO,qBAAqB;EAC1B;EACA,UANe,OAAO,sBAAsB,WAC1C;GAAE,MAAM;GAAmB,IAAI;EAAkB,IACjD;EAKF,QAAQ,iBAAiB,gBAAgB;EACzC,OAAO;EACP,UAAU;CACZ,CAAC;AACH"}
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as
|
|
1
|
+
import { a as symbol, n as TOKEN_NAME, r as TOKEN_OVERRIDE, t as TOKEN_ID } from "./symbols-Cp4ymzKF.js";
|
|
2
|
+
import { _ as globalData, a as getStyleTokenName, d as RUNTIME_CONFIG, g as LayerPlaceholder, i as getStyleTokenId, l as BUILD_CONFIG, m as CSS_CONFIG, n as getCssVar, p as getCacheTTL, r as getCssVarRawFallback, s as isStyleTokenData } from "./cssVar-DGgQ2GIK.js";
|
|
3
|
+
//#region config/config/debug.ts
|
|
4
|
+
const DEFAULT_DEBUG_CONFIG = {
|
|
5
|
+
isDebugClassNameEnabled: false,
|
|
6
|
+
isDebugClassNameConfigured: false,
|
|
7
|
+
maxPropertyLength: 24,
|
|
8
|
+
maxValueLength: 8,
|
|
9
|
+
maxSelectorLength: 8,
|
|
10
|
+
maxParentSelectorLength: 8,
|
|
11
|
+
maxAtRuleLength: 10
|
|
12
|
+
};
|
|
13
|
+
const DEBUG_CONFIG = globalData("config.debug", () => ({ ...DEFAULT_DEBUG_CONFIG }));
|
|
14
|
+
function setDebugClassNameEnabled(value) {
|
|
15
|
+
DEBUG_CONFIG.isDebugClassNameEnabled = value;
|
|
16
|
+
DEBUG_CONFIG.isDebugClassNameConfigured = true;
|
|
17
|
+
}
|
|
18
|
+
function setDebugClassNameDefault(value) {
|
|
19
|
+
if (DEBUG_CONFIG.isDebugClassNameConfigured) return;
|
|
20
|
+
DEBUG_CONFIG.isDebugClassNameEnabled = value;
|
|
21
|
+
}
|
|
22
|
+
function setBuildDebugClassName(value, fallback) {
|
|
23
|
+
if (typeof value === "boolean") setDebugClassNameEnabled(value);
|
|
24
|
+
else setDebugClassNameDefault(fallback);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
3
27
|
//#region config/configure.ts
|
|
4
28
|
function configureStyleRuntime(options = {}) {
|
|
5
29
|
if (options.css) {
|
|
@@ -15,6 +39,269 @@ function checkBuildConfig(field) {
|
|
|
15
39
|
throw new Error(`Configure "${field}" via plugin options.`);
|
|
16
40
|
}
|
|
17
41
|
//#endregion
|
|
42
|
+
//#region utils/hash.ts
|
|
43
|
+
function hashString(str) {
|
|
44
|
+
let hash = 2166136261;
|
|
45
|
+
for (let i = 0; i < str.length; i++) hash = Math.imul(hash ^ str.charCodeAt(i), 16777619);
|
|
46
|
+
return (hash >>> 0).toString(36).padEnd(7, "0");
|
|
47
|
+
}
|
|
48
|
+
function normalizeHashLength(length) {
|
|
49
|
+
return Number.isFinite(length) ? Math.max(1, Math.floor(length)) : 7;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region atomic/utils/format.ts
|
|
53
|
+
const TOKEN_REGEX = /\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\)/g;
|
|
54
|
+
const OPTIONAL_REGEX = /\[([^[\]]*)\]/g;
|
|
55
|
+
const HASH_TOKEN = "$hash";
|
|
56
|
+
function createNameFormatter(keys) {
|
|
57
|
+
const keySet = new Set(keys);
|
|
58
|
+
const cache = /* @__PURE__ */ new Map();
|
|
59
|
+
function getFormatFn(format) {
|
|
60
|
+
if (typeof format === "function") return format;
|
|
61
|
+
let fn = cache.get(format);
|
|
62
|
+
if (!fn) {
|
|
63
|
+
fn = compileFormat(format, keySet);
|
|
64
|
+
cache.set(format, fn);
|
|
65
|
+
}
|
|
66
|
+
return fn;
|
|
67
|
+
}
|
|
68
|
+
return function format(format, hash, info) {
|
|
69
|
+
const name = getFormatFn(format)(info);
|
|
70
|
+
if (!hash) return name;
|
|
71
|
+
if (name.includes(HASH_TOKEN)) return name.replace(HASH_TOKEN, hash);
|
|
72
|
+
return name ? name + "--" + hash : hash;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function compileFormat(format, keySet) {
|
|
76
|
+
const segments = compileSegments(format, keySet);
|
|
77
|
+
return (info) => {
|
|
78
|
+
let name = "";
|
|
79
|
+
for (const segment of segments) {
|
|
80
|
+
const text = formatSegment(info, segment);
|
|
81
|
+
if (text === null) {
|
|
82
|
+
if (!segment.optional) return "";
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
name += text;
|
|
86
|
+
}
|
|
87
|
+
return name;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function compileSegments(format, keySet) {
|
|
91
|
+
const segments = [];
|
|
92
|
+
let lastIndex = 0;
|
|
93
|
+
for (const match of format.matchAll(OPTIONAL_REGEX)) {
|
|
94
|
+
const index = match.index ?? 0;
|
|
95
|
+
if (index > lastIndex) segments.push({
|
|
96
|
+
optional: false,
|
|
97
|
+
parts: compileParts(format.slice(lastIndex, index), keySet)
|
|
98
|
+
});
|
|
99
|
+
segments.push({
|
|
100
|
+
optional: true,
|
|
101
|
+
parts: compileParts(match[1], keySet)
|
|
102
|
+
});
|
|
103
|
+
lastIndex = index + match[0].length;
|
|
104
|
+
}
|
|
105
|
+
if (lastIndex < format.length) segments.push({
|
|
106
|
+
optional: false,
|
|
107
|
+
parts: compileParts(format.slice(lastIndex), keySet)
|
|
108
|
+
});
|
|
109
|
+
return segments;
|
|
110
|
+
}
|
|
111
|
+
function compileParts(segment, keySet) {
|
|
112
|
+
const parts = [];
|
|
113
|
+
let lastIndex = 0;
|
|
114
|
+
for (const match of segment.matchAll(TOKEN_REGEX)) {
|
|
115
|
+
const index = match.index ?? 0;
|
|
116
|
+
const key = match[1];
|
|
117
|
+
if (!keySet.has(key)) continue;
|
|
118
|
+
if (index > lastIndex) parts.push({
|
|
119
|
+
type: "text",
|
|
120
|
+
value: segment.slice(lastIndex, index)
|
|
121
|
+
});
|
|
122
|
+
parts.push({
|
|
123
|
+
type: "token",
|
|
124
|
+
key,
|
|
125
|
+
maxLength: match[2] ? Number(match[2]) : null,
|
|
126
|
+
truncate: Boolean(match[3])
|
|
127
|
+
});
|
|
128
|
+
lastIndex = index + match[0].length;
|
|
129
|
+
}
|
|
130
|
+
if (lastIndex < segment.length) parts.push({
|
|
131
|
+
type: "text",
|
|
132
|
+
value: segment.slice(lastIndex)
|
|
133
|
+
});
|
|
134
|
+
return parts;
|
|
135
|
+
}
|
|
136
|
+
function formatSegment(info, segment) {
|
|
137
|
+
let text = "";
|
|
138
|
+
for (const part of segment.parts) {
|
|
139
|
+
if (part.type === "text") {
|
|
140
|
+
text += part.value;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const value = formatTokenValue(info[part.key], part.maxLength, part.truncate);
|
|
144
|
+
if (value === null) {
|
|
145
|
+
if (segment.optional) return null;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
text += value;
|
|
149
|
+
}
|
|
150
|
+
return text;
|
|
151
|
+
}
|
|
152
|
+
function formatTokenValue(value, maxLength, truncate) {
|
|
153
|
+
if (!value) return null;
|
|
154
|
+
if (!maxLength) return value;
|
|
155
|
+
if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;
|
|
156
|
+
return truncate ? value.slice(0, maxLength) : null;
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region atomic/utils/hash.ts
|
|
160
|
+
const POOLED_HASH_STATE = globalData("atomic.hashPool", () => ({
|
|
161
|
+
byValue: /* @__PURE__ */ new Map(),
|
|
162
|
+
byHash: /* @__PURE__ */ new Map(),
|
|
163
|
+
usedByLength: []
|
|
164
|
+
}));
|
|
165
|
+
function getIdentifierSafeHash(value, startLength = 7) {
|
|
166
|
+
return getPooledHash(value, startLength);
|
|
167
|
+
}
|
|
168
|
+
function getPooledHash(value, startLength) {
|
|
169
|
+
const normalizedStartLength = normalizeHashLength(startLength);
|
|
170
|
+
const valueKey = normalizedStartLength + "\0" + value;
|
|
171
|
+
const existing = POOLED_HASH_STATE.byValue.get(valueKey);
|
|
172
|
+
if (existing) return existing;
|
|
173
|
+
let length = normalizedStartLength;
|
|
174
|
+
while (true) {
|
|
175
|
+
if (getPooledHashUsedCount(length) >= getIdentifierSafeHashPoolSize(length)) {
|
|
176
|
+
length++;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
for (let index = 0; index < getIdentifierSafeHashPoolSize(length); index++) {
|
|
180
|
+
const hash = getPooledHashCandidate(value, length, index);
|
|
181
|
+
const owner = POOLED_HASH_STATE.byHash.get(hash);
|
|
182
|
+
if (owner !== void 0 && owner !== valueKey) continue;
|
|
183
|
+
POOLED_HASH_STATE.byValue.set(valueKey, hash);
|
|
184
|
+
POOLED_HASH_STATE.byHash.set(hash, valueKey);
|
|
185
|
+
POOLED_HASH_STATE.usedByLength[length] = getPooledHashUsedCount(length) + 1;
|
|
186
|
+
return hash;
|
|
187
|
+
}
|
|
188
|
+
length++;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function getPooledHashCandidate(value, length, index) {
|
|
192
|
+
return getIdentifierSafeHashValue(hashString(index === 0 ? value : value + "::" + index)).slice(0, length);
|
|
193
|
+
}
|
|
194
|
+
function getPooledHashUsedCount(length) {
|
|
195
|
+
return POOLED_HASH_STATE.usedByLength[length] ?? 0;
|
|
196
|
+
}
|
|
197
|
+
function getIdentifierSafeHashPoolSize(length) {
|
|
198
|
+
if (length <= 0) return 0;
|
|
199
|
+
return 26 * 36 ** (length - 1);
|
|
200
|
+
}
|
|
201
|
+
function getIdentifierSafeHashValue(hash) {
|
|
202
|
+
const first = hash.charCodeAt(0);
|
|
203
|
+
if (first < 48 || first > 57) return hash;
|
|
204
|
+
return String.fromCharCode(97 + first - 48) + hash.slice(1);
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region builder/token/name.ts
|
|
208
|
+
function getStyleTokenNameFromId(id) {
|
|
209
|
+
if (!id) return null;
|
|
210
|
+
const parts = id.split("--");
|
|
211
|
+
const first = normalizeStyleTokenName(parts[0]);
|
|
212
|
+
if (!first) return parts.length > 1 ? normalizeStyleTokenName(parts.slice(1).join("--")) : null;
|
|
213
|
+
return normalizeStyleTokenName([first, ...parts.slice(1)].join("--"));
|
|
214
|
+
}
|
|
215
|
+
function getChildStyleTokenName(name, child) {
|
|
216
|
+
const childName = normalizeStyleTokenName(child);
|
|
217
|
+
if (!childName) return normalizeStyleTokenName(name);
|
|
218
|
+
const parentName = normalizeStyleTokenName(name);
|
|
219
|
+
return parentName ? parentName + "--" + childName : childName;
|
|
220
|
+
}
|
|
221
|
+
function normalizeStyleTokenName(value) {
|
|
222
|
+
if (!value) return null;
|
|
223
|
+
value = value.trim();
|
|
224
|
+
if (!value) return null;
|
|
225
|
+
if (/^\d+$/.test(value)) return null;
|
|
226
|
+
if (isGeneratedTokenHash(value)) return null;
|
|
227
|
+
value = stripGenericTokenPrefix(value);
|
|
228
|
+
if (!value) return null;
|
|
229
|
+
const stableSuffix = value.match(/^(.+)-[a-z0-9]{7}$/);
|
|
230
|
+
if (stableSuffix?.[1] && isGeneratedTokenHash(value.slice(-7))) return normalizeStyleTokenName(stableSuffix[1]);
|
|
231
|
+
return value;
|
|
232
|
+
}
|
|
233
|
+
function isGeneratedTokenHash(value) {
|
|
234
|
+
return /^[a-z0-9]{7}$/.test(value) && /\d/.test(value);
|
|
235
|
+
}
|
|
236
|
+
function stripGenericTokenPrefix(value) {
|
|
237
|
+
const parts = value.split("--");
|
|
238
|
+
while (parts[0] === "token" || parts[0] === "tokens") parts.shift();
|
|
239
|
+
return parts.join("--");
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region style/token.ts
|
|
243
|
+
const TOKEN_DEBUG = symbol("style:token.debug");
|
|
244
|
+
const idCounter$6 = globalData("style.token.idCounter", () => ({ value: 0 }));
|
|
245
|
+
function resetStyleTokenIdCounter() {
|
|
246
|
+
idCounter$6.value = 0;
|
|
247
|
+
}
|
|
248
|
+
function createStyleToken(value, stableId, debugName) {
|
|
249
|
+
const token = (value, debug) => {
|
|
250
|
+
return createStyleTokenOverride(token, value, debug);
|
|
251
|
+
};
|
|
252
|
+
token[TOKEN_ID] = stableId || String(idCounter$6.value++);
|
|
253
|
+
token[TOKEN_NAME] = debugName === void 0 ? getStyleTokenNameFromId(stableId) : normalizeStyleTokenName(debugName);
|
|
254
|
+
if (isStyleTokenData(value)) {
|
|
255
|
+
token.value = value.value;
|
|
256
|
+
token.ref = value;
|
|
257
|
+
} else {
|
|
258
|
+
token.value = value;
|
|
259
|
+
token.ref = null;
|
|
260
|
+
}
|
|
261
|
+
return token;
|
|
262
|
+
}
|
|
263
|
+
function createStyleTokenOverride(token, value, debug) {
|
|
264
|
+
const override = isStyleTokenData(value) ? {
|
|
265
|
+
[TOKEN_ID]: getStyleTokenId(token),
|
|
266
|
+
[TOKEN_OVERRIDE]: true,
|
|
267
|
+
[TOKEN_NAME]: getStyleTokenName(token),
|
|
268
|
+
value: value.value,
|
|
269
|
+
ref: value
|
|
270
|
+
} : {
|
|
271
|
+
[TOKEN_ID]: getStyleTokenId(token),
|
|
272
|
+
[TOKEN_OVERRIDE]: true,
|
|
273
|
+
[TOKEN_NAME]: getStyleTokenName(token),
|
|
274
|
+
value,
|
|
275
|
+
ref: null
|
|
276
|
+
};
|
|
277
|
+
if (debug) Object.defineProperty(override, TOKEN_DEBUG, {
|
|
278
|
+
configurable: true,
|
|
279
|
+
enumerable: false,
|
|
280
|
+
value: debug
|
|
281
|
+
});
|
|
282
|
+
return override;
|
|
283
|
+
}
|
|
284
|
+
function getStyleTokenOverrideDebug(token) {
|
|
285
|
+
return token[TOKEN_DEBUG] ?? null;
|
|
286
|
+
}
|
|
287
|
+
const formatTokenName = createNameFormatter(["name"]);
|
|
288
|
+
function getTokenVarName(token, format) {
|
|
289
|
+
const id = getStyleTokenId(token);
|
|
290
|
+
const debugName = getStyleTokenName(token);
|
|
291
|
+
return "--" + formatTokenName(format || "token[-(name)]-$hash", getIdentifierSafeHash(id, CSS_CONFIG.hashLength), { name: debugName });
|
|
292
|
+
}
|
|
293
|
+
function getTokenVar(token, format) {
|
|
294
|
+
return getTokenVarFallback(token, format);
|
|
295
|
+
}
|
|
296
|
+
function getTokenOverrideValue(token, format) {
|
|
297
|
+
return token.ref ? getTokenVar(token.ref, format) : token.value;
|
|
298
|
+
}
|
|
299
|
+
function getTokenVarFallback(token, tokenNameFormat) {
|
|
300
|
+
const varName = getTokenVarName(token, tokenNameFormat);
|
|
301
|
+
if (token.ref) return getCssVarRawFallback(varName, getTokenVarFallback(token.ref, tokenNameFormat));
|
|
302
|
+
return getCssVar(varName, String(token.value ?? ""));
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
18
305
|
//#region atomic/value/unitless.ts
|
|
19
306
|
const UnitlessProperties = [
|
|
20
307
|
"animationIterationCount",
|
|
@@ -802,6 +1089,6 @@ function createProperty(nameOrDescriptors, descriptorsOrStableId) {
|
|
|
802
1089
|
});
|
|
803
1090
|
}
|
|
804
1091
|
//#endregion
|
|
805
|
-
export { getCssPropertyValue as C, isAtRuleRef as S,
|
|
1092
|
+
export { createStyleTokenOverride as A, getCssPropertyValue as C, getTokenVarName as D, getTokenVar as E, createNameFormatter as F, hashString as I, configureStyleRuntime as L, resetStyleTokenIdCounter as M, getChildStyleTokenName as N, TOKEN_DEBUG as O, getIdentifierSafeHash as P, DEBUG_CONFIG as R, isAtRuleRef as S, getTokenOverrideValue as T, LayerSelectorPriorities as _, createFontFace as a, AT_RULE_REF as b, createIdCounter as c, getPropertyPriority as d, getLayerBlockCss as f, LayerMediaPriorities as g, LayerDefaultPriority as h, createFontPaletteValues as i, getStyleTokenOverrideDebug as j, createStyleToken as k, getId as l, LayerDefaultLayers as m, createPositionTry as n, fontSrc as o, getLayerOrderCss as p, createKeyframes as r, createCounterStyle as s, createProperty as t, getCssPropertyName as u, compareLayerPriority as v, shouldAppendCssPx as w, createAtRuleRef as x, createLayerPool as y, setBuildDebugClassName as z };
|
|
806
1093
|
|
|
807
|
-
//# sourceMappingURL=css-
|
|
1094
|
+
//# sourceMappingURL=css-CiTI58yl.js.map
|