@antdv-next/cssinjs 1.0.0 → 1.0.1
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/dist/{Cache.d.mts → Cache.d.ts} +2 -1
- package/dist/{Keyframes.d.mts → Keyframes.d.ts} +2 -2
- package/dist/{StyleContext.d.mts → StyleContext.d.ts} +56 -8
- package/dist/{StyleContext.mjs → StyleContext.js} +3 -3
- package/dist/cssinjs-utils/_util/hooks/useUniqueMemo.d.ts +7 -0
- package/dist/cssinjs-utils/hooks/{useCSP.d.mts → useCSP.d.ts} +2 -1
- package/dist/cssinjs-utils/hooks/usePrefix.js +1 -0
- package/dist/cssinjs-utils/hooks/{useToken.d.mts → useToken.d.ts} +4 -4
- package/dist/cssinjs-utils/hooks/useToken.js +1 -0
- package/dist/cssinjs-utils/{index.d.mts → index.d.ts} +3 -3
- package/dist/cssinjs-utils/{index.mjs → index.js} +2 -2
- package/dist/cssinjs-utils/interface/{components.d.mts → components.d.ts} +1 -1
- package/dist/cssinjs-utils/interface/components.js +1 -0
- package/dist/cssinjs-utils/interface/index.d.ts +2 -0
- package/dist/cssinjs-utils/interface/index.js +1 -0
- package/dist/cssinjs-utils/util/{genStyleUtils.d.mts → genStyleUtils.d.ts} +14 -14
- package/dist/cssinjs-utils/util/{genStyleUtils.mjs → genStyleUtils.js} +12 -12
- package/dist/cssinjs-utils/util/getCompVarPrefix.d.ts +4 -0
- package/dist/cssinjs-utils/util/getComponentToken.d.ts +9 -0
- package/dist/cssinjs-utils/util/getDefaultComponentToken.d.ts +8 -0
- package/dist/cssinjs-utils/util/{getDefaultComponentToken.mjs → getDefaultComponentToken.js} +1 -1
- package/dist/cssinjs-utils/util/maxmin.d.ts +10 -0
- package/dist/cssinjs-utils/util/{maxmin.mjs → maxmin.js} +1 -1
- package/dist/cssinjs-utils/util/{statistic.d.mts → statistic.d.ts} +3 -2
- package/dist/cssinjs-utils/util/{statistic.mjs → statistic.js} +2 -1
- package/dist/{extractStyle.d.mts → extractStyle.d.ts} +4 -4
- package/dist/{extractStyle.mjs → extractStyle.js} +5 -5
- package/dist/hooks/{useCSSVarRegister.d.mts → useCSSVarRegister.d.ts} +5 -3
- package/dist/hooks/{useCSSVarRegister.mjs → useCSSVarRegister.js} +7 -7
- package/dist/hooks/{useCacheToken.d.mts → useCacheToken.d.ts} +5 -3
- package/dist/hooks/{useCacheToken.mjs → useCacheToken.js} +7 -7
- package/dist/hooks/useGlobalCache.d.ts +24 -0
- package/dist/hooks/{useGlobalCache.mjs → useGlobalCache.js} +3 -3
- package/dist/hooks/{useStyleRegister.d.mts → useStyleRegister.d.ts} +31 -7
- package/dist/hooks/{useStyleRegister.mjs → useStyleRegister.js} +11 -11
- package/dist/index.d.ts +35 -0
- package/dist/{index.mjs → index.js} +24 -24
- package/dist/linters/{NaNLinter.d.mts → NaNLinter.d.ts} +2 -2
- package/dist/linters/{NaNLinter.mjs → NaNLinter.js} +1 -1
- package/dist/linters/contentQuotesLinter.d.ts +6 -0
- package/dist/linters/{contentQuotesLinter.mjs → contentQuotesLinter.js} +1 -1
- package/dist/linters/hashedAnimationLinter.d.ts +6 -0
- package/dist/linters/{hashedAnimationLinter.mjs → hashedAnimationLinter.js} +1 -1
- package/dist/linters/index.d.ts +8 -0
- package/dist/linters/index.js +8 -0
- package/dist/linters/{interface.d.mts → interface.d.ts} +1 -1
- package/dist/linters/interface.js +1 -0
- package/dist/linters/{legacyNotSelectorLinter.d.mts → legacyNotSelectorLinter.d.ts} +2 -2
- package/dist/linters/{legacyNotSelectorLinter.mjs → legacyNotSelectorLinter.js} +1 -1
- package/dist/linters/{logicalPropertiesLinter.d.mts → logicalPropertiesLinter.d.ts} +2 -2
- package/dist/linters/{logicalPropertiesLinter.mjs → logicalPropertiesLinter.js} +1 -1
- package/dist/linters/{parentSelectorLinter.d.mts → parentSelectorLinter.d.ts} +3 -3
- package/dist/linters/{parentSelectorLinter.mjs → parentSelectorLinter.js} +1 -1
- package/dist/linters/utils.d.ts +6 -0
- package/dist/theme/{Theme.d.mts → Theme.d.ts} +2 -2
- package/dist/theme/ThemeCache.d.ts +23 -0
- package/dist/theme/{ThemeCache.mjs → ThemeCache.js} +1 -1
- package/dist/theme/calc/{CSSCalculator.d.mts → CSSCalculator.d.ts} +2 -2
- package/dist/theme/calc/{CSSCalculator.mjs → CSSCalculator.js} +1 -1
- package/dist/theme/calc/{NumCalculator.d.mts → NumCalculator.d.ts} +2 -2
- package/dist/theme/calc/{NumCalculator.mjs → NumCalculator.js} +1 -1
- package/dist/theme/calc/{calculator.d.mts → calculator.d.ts} +1 -1
- package/dist/theme/calc/index.d.ts +8 -0
- package/dist/theme/calc/{index.mjs → index.js} +2 -2
- package/dist/theme/{createTheme.d.mts → createTheme.d.ts} +3 -3
- package/dist/theme/{createTheme.mjs → createTheme.js} +2 -2
- package/dist/theme/index.d.ts +7 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/interface.js +1 -0
- package/dist/transformers/autoPrefix.d.ts +7 -0
- package/dist/transformers/{interface.d.mts → interface.d.ts} +2 -2
- package/dist/transformers/interface.js +1 -0
- package/dist/transformers/{legacyLogicalProperties.d.mts → legacyLogicalProperties.d.ts} +2 -2
- package/dist/transformers/{px2rem.d.mts → px2rem.d.ts} +2 -2
- package/dist/util/cacheMapUtil.d.ts +17 -0
- package/dist/util/{cacheMapUtil.mjs → cacheMapUtil.js} +9 -2
- package/dist/util/css-variables.d.ts +21 -0
- package/dist/util/{css-variables.mjs → css-variables.js} +2 -2
- package/dist/util/index.d.ts +26 -0
- package/dist/util/{index.mjs → index.js} +13 -6
- package/dist/util/resolveHash.d.ts +4 -0
- package/dist/util/resolveUnitless.d.ts +4 -0
- package/package.json +11 -11
- package/dist/hooks/useGlobalCache.d.mts +0 -9
- package/dist/index.d.mts +0 -35
- package/dist/linters/index.d.mts +0 -5
- package/dist/linters/index.mjs +0 -8
- package/dist/theme/calc/index.d.mts +0 -8
- package/dist/theme/index.mjs +0 -6
- package/dist/transformers/autoPrefix.d.mts +0 -6
- package/dist/util/css-variables.d.mts +0 -7
- package/dist/util/index.d.mts +0 -7
- /package/dist/{Cache.mjs → Cache.js} +0 -0
- /package/dist/{Keyframes.mjs → Keyframes.js} +0 -0
- /package/dist/cssinjs-utils/_util/hooks/{useUniqueMemo.mjs → useUniqueMemo.js} +0 -0
- /package/dist/cssinjs-utils/hooks/{useCSP.mjs → useCSP.js} +0 -0
- /package/dist/cssinjs-utils/hooks/{usePrefix.d.mts → usePrefix.d.ts} +0 -0
- /package/dist/cssinjs-utils/util/{getCompVarPrefix.mjs → getCompVarPrefix.js} +0 -0
- /package/dist/cssinjs-utils/util/{getComponentToken.mjs → getComponentToken.js} +0 -0
- /package/dist/linters/{utils.mjs → utils.js} +0 -0
- /package/dist/ssr/{styleCollector.d.mts → styleCollector.d.ts} +0 -0
- /package/dist/ssr/{styleCollector.mjs → styleCollector.js} +0 -0
- /package/dist/theme/{Theme.mjs → Theme.js} +0 -0
- /package/dist/theme/calc/{calculator.mjs → calculator.js} +0 -0
- /package/dist/theme/{interface.d.mts → interface.d.ts} +0 -0
- /package/dist/transformers/{autoPrefix.mjs → autoPrefix.js} +0 -0
- /package/dist/transformers/{legacyLogicalProperties.mjs → legacyLogicalProperties.js} +0 -0
- /package/dist/transformers/{px2rem.mjs → px2rem.js} +0 -0
- /package/dist/util/{resolveHash.mjs → resolveHash.js} +0 -0
- /package/dist/util/{resolveUnitless.mjs → resolveUnitless.js} +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Linter } from "./linters/interface.js";
|
|
2
|
+
import linter$1 from "./linters/legacyNotSelectorLinter.js";
|
|
3
|
+
import linter$2 from "./linters/logicalPropertiesLinter.js";
|
|
4
|
+
import linter from "./linters/NaNLinter.js";
|
|
5
|
+
import { StyleProvider, StyleProviderProps, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.js";
|
|
6
|
+
import AbstractCalculator from "./theme/calc/calculator.js";
|
|
7
|
+
import genCalc from "./theme/calc/index.js";
|
|
8
|
+
import { DerivativeFunc, TokenType } from "./theme/interface.js";
|
|
9
|
+
import Theme from "./theme/Theme.js";
|
|
10
|
+
import createTheme from "./theme/createTheme.js";
|
|
11
|
+
import { Transformer } from "./transformers/interface.js";
|
|
12
|
+
import { token2CSSVar } from "./util/css-variables.js";
|
|
13
|
+
import useCSSVarRegister from "./hooks/useCSSVarRegister.js";
|
|
14
|
+
import extractStyle from "./extractStyle.js";
|
|
15
|
+
import useCacheToken, { getComputedToken } from "./hooks/useCacheToken.js";
|
|
16
|
+
import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.js";
|
|
17
|
+
import transform from "./transformers/autoPrefix.js";
|
|
18
|
+
import transform$1 from "./transformers/legacyLogicalProperties.js";
|
|
19
|
+
import transform$2 from "./transformers/px2rem.js";
|
|
20
|
+
import { unit } from "./util/index.js";
|
|
21
|
+
import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./cssinjs-utils/interface/components.js";
|
|
22
|
+
import genStyleUtils, { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls } from "./cssinjs-utils/util/genStyleUtils.js";
|
|
23
|
+
import statisticToken, { merge, statistic } from "./cssinjs-utils/util/statistic.js";
|
|
24
|
+
import "./cssinjs-utils/index.js";
|
|
25
|
+
import linter$3 from "./linters/parentSelectorLinter.js";
|
|
26
|
+
import "./linters/index.js";
|
|
27
|
+
import useStyleRegister, { CSSInterpolation, CSSObject } from "./hooks/useStyleRegister.js";
|
|
28
|
+
import Keyframe from "./Keyframes.js";
|
|
29
|
+
|
|
30
|
+
//#region src/index.d.ts
|
|
31
|
+
declare const _experimental: {
|
|
32
|
+
supportModernCSS: () => boolean;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { type AbstractCalculator, type CSSInterpolation, type CSSObject, CSSUtil, CSSVarRegisterProps, ComponentToken, ComponentTokenKey, type DerivativeFunc, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, GlobalToken, GlobalTokenWithComponent, Keyframe as Keyframes, type Linter, linter as NaNLinter, OverrideTokenMap, StyleInfo, StyleProvider, type StyleProviderProps, SubStyleComponentProps, Theme, TokenMap, TokenMapKey, type TokenType, TokenWithCommonCls, type Transformer, _experimental, transform as autoPrefixTransformer, collectStyleText, createCache, createTheme, extractStyle, genCalc, genStyleUtils, getComputedToken, transform$1 as legacyLogicalPropertiesTransformer, linter$1 as legacyNotSelectorLinter, linter$2 as logicalPropertiesLinter, merge as mergeToken, linter$3 as parentSelectorLinter, provideStyleContext, transform$2 as px2remTransformer, setStyleCollector, statistic, statisticToken, token2CSSVar, unit, useCSSVarRegister, useCacheToken, useStyleContext, useStyleContextProvide, useStyleRegister };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import autoPrefix_default from "./transformers/autoPrefix.
|
|
3
|
-
import { StyleProvider, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./theme/
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import "./linters/
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import legacyLogicalProperties_default from "./transformers/legacyLogicalProperties.
|
|
21
|
-
import px2rem_default from "./transformers/px2rem.
|
|
22
|
-
import statistic_default, { merge, statistic } from "./cssinjs-utils/util/statistic.
|
|
23
|
-
import genStyleUtils_default from "./cssinjs-utils/util/genStyleUtils.
|
|
24
|
-
import "./cssinjs-utils/index.
|
|
1
|
+
import Keyframes_default from "./Keyframes.js";
|
|
2
|
+
import autoPrefix_default from "./transformers/autoPrefix.js";
|
|
3
|
+
import { StyleProvider, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.js";
|
|
4
|
+
import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.js";
|
|
5
|
+
import calc_default from "./theme/calc/index.js";
|
|
6
|
+
import Theme from "./theme/Theme.js";
|
|
7
|
+
import createTheme from "./theme/createTheme.js";
|
|
8
|
+
import "./theme/index.js";
|
|
9
|
+
import { token2CSSVar } from "./util/css-variables.js";
|
|
10
|
+
import { supportLogicProps, supportWhere, unit } from "./util/index.js";
|
|
11
|
+
import useCacheToken, { getComputedToken } from "./hooks/useCacheToken.js";
|
|
12
|
+
import legacyNotSelectorLinter_default from "./linters/legacyNotSelectorLinter.js";
|
|
13
|
+
import logicalPropertiesLinter_default from "./linters/logicalPropertiesLinter.js";
|
|
14
|
+
import NaNLinter_default from "./linters/NaNLinter.js";
|
|
15
|
+
import parentSelectorLinter_default from "./linters/parentSelectorLinter.js";
|
|
16
|
+
import "./linters/index.js";
|
|
17
|
+
import useStyleRegister from "./hooks/useStyleRegister.js";
|
|
18
|
+
import useCSSVarRegister from "./hooks/useCSSVarRegister.js";
|
|
19
|
+
import extractStyle from "./extractStyle.js";
|
|
20
|
+
import legacyLogicalProperties_default from "./transformers/legacyLogicalProperties.js";
|
|
21
|
+
import px2rem_default from "./transformers/px2rem.js";
|
|
22
|
+
import statistic_default, { merge, statistic } from "./cssinjs-utils/util/statistic.js";
|
|
23
|
+
import genStyleUtils_default from "./cssinjs-utils/util/genStyleUtils.js";
|
|
24
|
+
import "./cssinjs-utils/index.js";
|
|
25
25
|
|
|
26
26
|
//#region src/index.ts
|
|
27
27
|
const _experimental = { supportModernCSS: () => supportWhere() && supportLogicProps() };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Linter } from "./interface.js";
|
|
2
|
+
import linter$1 from "./contentQuotesLinter.js";
|
|
3
|
+
import linter$2 from "./hashedAnimationLinter.js";
|
|
4
|
+
import linter$3 from "./legacyNotSelectorLinter.js";
|
|
5
|
+
import linter$4 from "./logicalPropertiesLinter.js";
|
|
6
|
+
import linter from "./NaNLinter.js";
|
|
7
|
+
import linter$5 from "./parentSelectorLinter.js";
|
|
8
|
+
export { type Linter, linter as NaNLinter, linter$1 as contentQuotesLinter, linter$2 as hashedAnimationLinter, linter$3 as legacyNotSelectorLinter, linter$4 as logicalPropertiesLinter, linter$5 as parentSelectorLinter };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import contentQuotesLinter_default from "./contentQuotesLinter.js";
|
|
2
|
+
import hashedAnimationLinter_default from "./hashedAnimationLinter.js";
|
|
3
|
+
import legacyNotSelectorLinter_default from "./legacyNotSelectorLinter.js";
|
|
4
|
+
import logicalPropertiesLinter_default from "./logicalPropertiesLinter.js";
|
|
5
|
+
import NaNLinter_default from "./NaNLinter.js";
|
|
6
|
+
import parentSelectorLinter_default from "./parentSelectorLinter.js";
|
|
7
|
+
|
|
8
|
+
export { NaNLinter_default as NaNLinter, contentQuotesLinter_default as contentQuotesLinter, hashedAnimationLinter_default as hashedAnimationLinter, legacyNotSelectorLinter_default as legacyNotSelectorLinter, logicalPropertiesLinter_default as logicalPropertiesLinter, parentSelectorLinter_default as parentSelectorLinter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Linter } from "./interface.
|
|
2
|
-
import "../index.
|
|
1
|
+
import { Linter } from "./interface.js";
|
|
2
|
+
import "../index.js";
|
|
3
3
|
|
|
4
4
|
//#region src/linters/parentSelectorLinter.d.ts
|
|
5
5
|
declare const linter: Linter;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { linter };
|
|
7
|
+
export { linter as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DerivativeFunc, TokenType } from "./interface.
|
|
1
|
+
import { DerivativeFunc, TokenType } from "./interface.js";
|
|
2
2
|
|
|
3
3
|
//#region src/theme/Theme.d.ts
|
|
4
4
|
/**
|
|
@@ -12,4 +12,4 @@ declare class Theme<DesignToken extends TokenType, DerivativeToken extends Token
|
|
|
12
12
|
getDerivativeToken(token: DesignToken): DerivativeToken;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
|
-
export { Theme };
|
|
15
|
+
export { Theme as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DerivativeFunc } from "./interface.js";
|
|
2
|
+
import Theme from "./Theme.js";
|
|
3
|
+
|
|
4
|
+
//#region src/theme/ThemeCache.d.ts
|
|
5
|
+
type DerivativeOptions = DerivativeFunc<any, any>[];
|
|
6
|
+
declare function sameDerivativeOption(left: DerivativeOptions, right: DerivativeOptions): boolean;
|
|
7
|
+
declare class ThemeCache {
|
|
8
|
+
static MAX_CACHE_SIZE: number;
|
|
9
|
+
static MAX_CACHE_OFFSET: number;
|
|
10
|
+
private readonly cache;
|
|
11
|
+
private keys;
|
|
12
|
+
private cacheCallTimes;
|
|
13
|
+
constructor();
|
|
14
|
+
size(): number;
|
|
15
|
+
private internalGet;
|
|
16
|
+
get(derivativeOption: DerivativeOptions): Theme<any, any> | undefined;
|
|
17
|
+
has(derivativeOption: DerivativeOptions): boolean;
|
|
18
|
+
set(derivativeOption: DerivativeOptions, value: Theme<any, any>): void;
|
|
19
|
+
private deleteByPath;
|
|
20
|
+
delete(derivativeOption: DerivativeOptions): Theme<any, any> | undefined;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ThemeCache as default, sameDerivativeOption };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AbstractCalculator from "./calculator.js";
|
|
2
2
|
|
|
3
3
|
//#region src/theme/calc/CSSCalculator.d.ts
|
|
4
4
|
declare class CSSCalculator extends AbstractCalculator {
|
|
@@ -16,4 +16,4 @@ declare class CSSCalculator extends AbstractCalculator {
|
|
|
16
16
|
}): string;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export { CSSCalculator };
|
|
19
|
+
export { CSSCalculator as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AbstractCalculator from "./calculator.js";
|
|
2
2
|
|
|
3
3
|
//#region src/theme/calc/NumCalculator.d.ts
|
|
4
4
|
declare class NumCalculator extends AbstractCalculator {
|
|
@@ -11,4 +11,4 @@ declare class NumCalculator extends AbstractCalculator {
|
|
|
11
11
|
equal(): number;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { NumCalculator };
|
|
14
|
+
export { NumCalculator as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import AbstractCalculator from "./calculator.js";
|
|
2
|
+
import CSSCalculator from "./CSSCalculator.js";
|
|
3
|
+
import NumCalculator from "./NumCalculator.js";
|
|
4
|
+
|
|
5
|
+
//#region src/theme/calc/index.d.ts
|
|
6
|
+
declare function genCalc(type: 'css' | 'js', unitlessCssVar: Set<string>): (num: number | string | AbstractCalculator) => NumCalculator | CSSCalculator;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { genCalc as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CSSCalculator from "./CSSCalculator.
|
|
2
|
-
import NumCalculator from "./NumCalculator.
|
|
1
|
+
import CSSCalculator from "./CSSCalculator.js";
|
|
2
|
+
import NumCalculator from "./NumCalculator.js";
|
|
3
3
|
|
|
4
4
|
//#region src/theme/calc/index.ts
|
|
5
5
|
function genCalc(type, unitlessCssVar) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DerivativeFunc, TokenType } from "./interface.
|
|
2
|
-
import
|
|
1
|
+
import { DerivativeFunc, TokenType } from "./interface.js";
|
|
2
|
+
import Theme from "./Theme.js";
|
|
3
3
|
|
|
4
4
|
//#region src/theme/createTheme.d.ts
|
|
5
5
|
/**
|
|
@@ -7,4 +7,4 @@ import { Theme } from "./Theme.mjs";
|
|
|
7
7
|
*/
|
|
8
8
|
declare function createTheme<DesignToken extends TokenType, DerivativeToken extends TokenType>(derivatives: DerivativeFunc<DesignToken, DerivativeToken>[] | DerivativeFunc<DesignToken, DerivativeToken>): Theme<any, any>;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { createTheme };
|
|
10
|
+
export { createTheme as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import AbstractCalculator from "./calc/calculator.js";
|
|
2
|
+
import genCalc from "./calc/index.js";
|
|
3
|
+
import { DerivativeFunc, TokenType } from "./interface.js";
|
|
4
|
+
import Theme from "./Theme.js";
|
|
5
|
+
import createTheme from "./createTheme.js";
|
|
6
|
+
import ThemeCache from "./ThemeCache.js";
|
|
7
|
+
export { type AbstractCalculator, type DerivativeFunc, Theme, ThemeCache, type TokenType, createTheme, genCalc };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transformer } from "./interface.
|
|
1
|
+
import { Transformer } from "./interface.js";
|
|
2
2
|
|
|
3
3
|
//#region src/transformers/legacyLogicalProperties.d.ts
|
|
4
4
|
/**
|
|
@@ -12,4 +12,4 @@ import { Transformer } from "./interface.mjs";
|
|
|
12
12
|
*/
|
|
13
13
|
declare const transform: Transformer;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { transform };
|
|
15
|
+
export { transform as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transformer } from "./interface.
|
|
1
|
+
import { Transformer } from "./interface.js";
|
|
2
2
|
|
|
3
3
|
//#region src/transformers/px2rem.d.ts
|
|
4
4
|
interface Options {
|
|
@@ -20,4 +20,4 @@ interface Options {
|
|
|
20
20
|
}
|
|
21
21
|
declare function transform(options?: Options): Transformer;
|
|
22
22
|
//#endregion
|
|
23
|
-
export { transform };
|
|
23
|
+
export { transform as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/util/cacheMapUtil.d.ts
|
|
2
|
+
declare const ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path";
|
|
3
|
+
/**
|
|
4
|
+
* This marks style from the css file.
|
|
5
|
+
* Which means not exist in `<style />` tag.
|
|
6
|
+
*/
|
|
7
|
+
declare const CSS_FILE_STYLE = "_FILE_STYLE__";
|
|
8
|
+
declare function serialize(cachePathMap: Record<string, string>): string;
|
|
9
|
+
/**
|
|
10
|
+
* @private Test usage only. Can save remove if no need.
|
|
11
|
+
*/
|
|
12
|
+
declare function reset(mockCache?: Record<string, string>, fromFile?: boolean): void;
|
|
13
|
+
declare function prepare(): void;
|
|
14
|
+
declare function existPath(path: string): boolean;
|
|
15
|
+
declare function getStyleAndHash(path: string): [style: string | null, hash: string];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ATTR_CACHE_MAP, CSS_FILE_STYLE, existPath, getStyleAndHash, prepare, reset, serialize };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ATTR_MARK } from "../StyleContext.
|
|
1
|
+
import { ATTR_MARK } from "../StyleContext.js";
|
|
2
2
|
import canUseDom from "@v-c/util/dist/Dom/canUseDom";
|
|
3
3
|
|
|
4
4
|
//#region src/util/cacheMapUtil.ts
|
|
@@ -15,6 +15,13 @@ function serialize(cachePathMap) {
|
|
|
15
15
|
}
|
|
16
16
|
let cachePathMap;
|
|
17
17
|
let fromCSSFile = true;
|
|
18
|
+
/**
|
|
19
|
+
* @private Test usage only. Can save remove if no need.
|
|
20
|
+
*/
|
|
21
|
+
function reset(mockCache, fromFile = true) {
|
|
22
|
+
cachePathMap = mockCache;
|
|
23
|
+
fromCSSFile = fromFile;
|
|
24
|
+
}
|
|
18
25
|
function prepare() {
|
|
19
26
|
if (!cachePathMap) {
|
|
20
27
|
cachePathMap = {};
|
|
@@ -57,4 +64,4 @@ function getStyleAndHash(path) {
|
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
//#endregion
|
|
60
|
-
export { ATTR_CACHE_MAP, CSS_FILE_STYLE, existPath, getStyleAndHash, serialize };
|
|
67
|
+
export { ATTR_CACHE_MAP, CSS_FILE_STYLE, existPath, getStyleAndHash, prepare, reset, serialize };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HashPriority } from "../StyleContext.js";
|
|
2
|
+
|
|
3
|
+
//#region src/util/css-variables.d.ts
|
|
4
|
+
declare function token2CSSVar(token: string, prefix?: string): string;
|
|
5
|
+
declare function serializeCSSVar<T extends Record<string, any>>(cssVars: T, hashId: string, options?: {
|
|
6
|
+
scope?: string;
|
|
7
|
+
hashCls?: string;
|
|
8
|
+
hashPriority?: HashPriority;
|
|
9
|
+
}): string;
|
|
10
|
+
type TokenWithCSSVar<V, T extends Record<string, V> = Record<string, V>> = { [key in keyof T]?: string | V };
|
|
11
|
+
declare function transformToken<V, T extends Record<string, V> = Record<string, V>>(token: T, themeKey: string, config?: {
|
|
12
|
+
prefix?: string;
|
|
13
|
+
ignore?: { [key in keyof T]?: boolean };
|
|
14
|
+
unitless?: { [key in keyof T]?: boolean };
|
|
15
|
+
preserve?: { [key in keyof T]?: boolean };
|
|
16
|
+
scope?: string;
|
|
17
|
+
hashCls?: string;
|
|
18
|
+
hashPriority?: HashPriority;
|
|
19
|
+
}): [TokenWithCSSVar<V, T>, string];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { TokenWithCSSVar, serializeCSSVar, token2CSSVar, transformToken };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { where } from "./index.
|
|
1
|
+
import { where } from "./index.js";
|
|
2
2
|
|
|
3
3
|
//#region src/util/css-variables.ts
|
|
4
4
|
function token2CSSVar(token, prefix = "") {
|
|
@@ -32,4 +32,4 @@ function transformToken(token, themeKey, config) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
export { token2CSSVar, transformToken };
|
|
35
|
+
export { serializeCSSVar, token2CSSVar, transformToken };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HashPriority } from "../StyleContext.js";
|
|
2
|
+
import { token2CSSVar } from "./css-variables.js";
|
|
3
|
+
|
|
4
|
+
//#region src/util/index.d.ts
|
|
5
|
+
declare function memoResult<T extends object, R>(callback: () => R, deps: T[]): R;
|
|
6
|
+
/**
|
|
7
|
+
* Flatten token to string, this will auto cache the result when token not change
|
|
8
|
+
*/
|
|
9
|
+
declare function flattenToken(token: any): string;
|
|
10
|
+
/**
|
|
11
|
+
* Convert derivative token to key string
|
|
12
|
+
*/
|
|
13
|
+
declare function token2key(token: any, salt: string): string;
|
|
14
|
+
declare function supportLayer(): boolean;
|
|
15
|
+
declare function supportWhere(): boolean;
|
|
16
|
+
declare function supportLogicProps(): boolean;
|
|
17
|
+
declare const isClientSide: boolean;
|
|
18
|
+
declare function unit(num: string | number): string;
|
|
19
|
+
declare function toStyleStr(style: string, tokenKey?: string, styleId?: string, customizeAttrs?: Record<string, string>, plain?: boolean): string;
|
|
20
|
+
declare function where(options?: {
|
|
21
|
+
hashPriority?: HashPriority;
|
|
22
|
+
hashCls?: string;
|
|
23
|
+
}): string;
|
|
24
|
+
declare function isNonNullable<T>(val: T): val is NonNullable<T>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { flattenToken, isClientSide, isNonNullable, memoResult, supportLayer, supportLogicProps, supportWhere, toStyleStr, token2CSSVar, token2key, unit, where };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ATTR_MARK, ATTR_TOKEN } from "../StyleContext.
|
|
2
|
-
import Theme from "../theme/Theme.
|
|
3
|
-
import "../theme/index.
|
|
4
|
-
import resolveHash_default from "./resolveHash.
|
|
5
|
-
import { token2CSSVar } from "./css-variables.
|
|
1
|
+
import { ATTR_MARK, ATTR_TOKEN } from "../StyleContext.js";
|
|
2
|
+
import Theme from "../theme/Theme.js";
|
|
3
|
+
import "../theme/index.js";
|
|
4
|
+
import resolveHash_default from "./resolveHash.js";
|
|
5
|
+
import { token2CSSVar } from "./css-variables.js";
|
|
6
6
|
import canUseDom from "@v-c/util/dist/Dom/canUseDom";
|
|
7
7
|
import { removeCSS, updateCSS } from "@v-c/util/dist/Dom/dynamicCSS";
|
|
8
8
|
|
|
@@ -66,6 +66,13 @@ function supportSelector(styleStr, handleElement, supportCheck) {
|
|
|
66
66
|
}
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
|
+
let canLayer;
|
|
70
|
+
function supportLayer() {
|
|
71
|
+
if (canLayer === void 0) canLayer = supportSelector(`@layer ${randomSelectorKey} { .${randomSelectorKey} { content: "${checkContent}"!important; } }`, (ele) => {
|
|
72
|
+
ele.className = randomSelectorKey;
|
|
73
|
+
});
|
|
74
|
+
return canLayer;
|
|
75
|
+
}
|
|
69
76
|
let canWhere;
|
|
70
77
|
function supportWhere() {
|
|
71
78
|
if (canWhere === void 0) canWhere = supportSelector(`:where(.${randomSelectorKey}) { content: "${checkContent}"!important; }`, (ele) => {
|
|
@@ -108,4 +115,4 @@ function isNonNullable(val) {
|
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
//#endregion
|
|
111
|
-
export { flattenToken, isClientSide, isNonNullable, memoResult, supportLogicProps, supportWhere, toStyleStr, token2key, unit, where };
|
|
118
|
+
export { flattenToken, isClientSide, isNonNullable, memoResult, supportLayer, supportLogicProps, supportWhere, toStyleStr, token2CSSVar, token2key, unit, where };
|