@antdv-next/cssinjs 1.0.0-alpha.3 → 1.0.0-beta.2
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/{Keyframes.d.ts → Keyframes.d.mts} +1 -1
- package/dist/{StyleContext.d.ts → StyleContext.d.mts} +6 -6
- package/dist/{StyleContext.js → StyleContext.mjs} +17 -3
- package/dist/cssinjs-utils/hooks/{useToken.d.ts → useToken.d.mts} +3 -3
- package/dist/cssinjs-utils/{index.d.ts → index.d.mts} +3 -3
- package/dist/cssinjs-utils/{index.js → index.mjs} +2 -2
- package/dist/cssinjs-utils/interface/{components.d.ts → components.d.mts} +1 -1
- package/dist/cssinjs-utils/util/{genStyleUtils.d.ts → genStyleUtils.d.mts} +13 -13
- package/dist/cssinjs-utils/util/{genStyleUtils.js → genStyleUtils.mjs} +12 -12
- package/dist/cssinjs-utils/util/{getDefaultComponentToken.js → getDefaultComponentToken.mjs} +1 -1
- package/dist/cssinjs-utils/util/{maxmin.js → maxmin.mjs} +1 -1
- package/dist/cssinjs-utils/util/{statistic.d.ts → statistic.d.mts} +1 -1
- package/dist/{extractStyle.d.ts → extractStyle.d.mts} +3 -3
- package/dist/{extractStyle.js → extractStyle.mjs} +7 -7
- package/dist/hooks/{useCSSVarRegister.d.ts → useCSSVarRegister.d.mts} +2 -2
- package/dist/hooks/{useCSSVarRegister.js → useCSSVarRegister.mjs} +6 -6
- package/dist/hooks/{useCacheToken.d.ts → useCacheToken.d.mts} +2 -2
- package/dist/hooks/{useCacheToken.js → useCacheToken.mjs} +9 -9
- package/dist/hooks/{useGlobalCache.js → useGlobalCache.mjs} +6 -4
- package/dist/hooks/{useStyleRegister.d.ts → useStyleRegister.d.mts} +6 -6
- package/dist/hooks/{useStyleRegister.js → useStyleRegister.mjs} +15 -13
- package/dist/{index.d.ts → index.d.mts} +28 -28
- package/dist/{index.js → index.mjs} +24 -24
- package/dist/linters/{NaNLinter.d.ts → NaNLinter.d.mts} +1 -1
- package/dist/linters/{NaNLinter.js → NaNLinter.mjs} +1 -1
- package/dist/linters/{contentQuotesLinter.js → contentQuotesLinter.mjs} +1 -1
- package/dist/linters/{hashedAnimationLinter.js → hashedAnimationLinter.mjs} +1 -1
- package/dist/linters/index.d.mts +5 -0
- package/dist/linters/{index.js → index.mjs} +6 -6
- package/dist/linters/{legacyNotSelectorLinter.d.ts → legacyNotSelectorLinter.d.mts} +1 -1
- package/dist/linters/{legacyNotSelectorLinter.js → legacyNotSelectorLinter.mjs} +1 -1
- package/dist/linters/{logicalPropertiesLinter.d.ts → logicalPropertiesLinter.d.mts} +1 -1
- package/dist/linters/{logicalPropertiesLinter.js → logicalPropertiesLinter.mjs} +1 -1
- package/dist/linters/{parentSelectorLinter.d.ts → parentSelectorLinter.d.mts} +2 -2
- package/dist/linters/{parentSelectorLinter.js → parentSelectorLinter.mjs} +1 -1
- package/dist/theme/{Theme.d.ts → Theme.d.mts} +1 -1
- package/dist/theme/calc/{CSSCalculator.d.ts → CSSCalculator.d.mts} +1 -1
- package/dist/theme/calc/{CSSCalculator.js → CSSCalculator.mjs} +1 -1
- package/dist/theme/calc/{NumCalculator.d.ts → NumCalculator.d.mts} +1 -1
- package/dist/theme/calc/{NumCalculator.js → NumCalculator.mjs} +1 -1
- package/dist/theme/calc/{index.d.ts → index.d.mts} +3 -3
- package/dist/theme/calc/{index.js → index.mjs} +2 -2
- package/dist/theme/{createTheme.d.ts → createTheme.d.mts} +2 -2
- package/dist/theme/{createTheme.js → createTheme.mjs} +2 -2
- package/dist/theme/index.mjs +6 -0
- package/dist/transformers/{autoPrefix.d.ts → autoPrefix.d.mts} +1 -1
- package/dist/transformers/{autoPrefix.js → autoPrefix.mjs} +1 -1
- package/dist/transformers/{interface.d.ts → interface.d.mts} +2 -2
- package/dist/transformers/{legacyLogicalProperties.d.ts → legacyLogicalProperties.d.mts} +1 -1
- package/dist/transformers/{px2rem.d.ts → px2rem.d.mts} +1 -1
- package/dist/transformers/{px2rem.js → px2rem.mjs} +3 -0
- package/dist/util/{cacheMapUtil.js → cacheMapUtil.mjs} +1 -1
- package/dist/util/{css-variables.d.ts → css-variables.d.mts} +1 -1
- package/dist/util/{css-variables.js → css-variables.mjs} +1 -1
- package/dist/util/{index.d.ts → index.d.mts} +2 -2
- package/dist/util/{index.js → index.mjs} +11 -8
- package/dist/util/resolveHash.mjs +7 -0
- package/package.json +14 -14
- package/dist/linters/index.d.ts +0 -5
- package/dist/theme/index.js +0 -6
- /package/dist/{Cache.d.ts → Cache.d.mts} +0 -0
- /package/dist/{Cache.js → Cache.mjs} +0 -0
- /package/dist/{Keyframes.js → Keyframes.mjs} +0 -0
- /package/dist/cssinjs-utils/_util/hooks/{useUniqueMemo.js → useUniqueMemo.mjs} +0 -0
- /package/dist/cssinjs-utils/hooks/{useCSP.d.ts → useCSP.d.mts} +0 -0
- /package/dist/cssinjs-utils/hooks/{useCSP.js → useCSP.mjs} +0 -0
- /package/dist/cssinjs-utils/hooks/{usePrefix.d.ts → usePrefix.d.mts} +0 -0
- /package/dist/cssinjs-utils/util/{getCompVarPrefix.js → getCompVarPrefix.mjs} +0 -0
- /package/dist/cssinjs-utils/util/{getComponentToken.js → getComponentToken.mjs} +0 -0
- /package/dist/cssinjs-utils/util/{statistic.js → statistic.mjs} +0 -0
- /package/dist/hooks/{useGlobalCache.d.ts → useGlobalCache.d.mts} +0 -0
- /package/dist/linters/{interface.d.ts → interface.d.mts} +0 -0
- /package/dist/linters/{utils.js → utils.mjs} +0 -0
- /package/dist/ssr/{styleCollector.d.ts → styleCollector.d.mts} +0 -0
- /package/dist/ssr/{styleCollector.js → styleCollector.mjs} +0 -0
- /package/dist/theme/{Theme.js → Theme.mjs} +0 -0
- /package/dist/theme/{ThemeCache.js → ThemeCache.mjs} +0 -0
- /package/dist/theme/calc/{calculator.d.ts → calculator.d.mts} +0 -0
- /package/dist/theme/calc/{calculator.js → calculator.mjs} +0 -0
- /package/dist/theme/{interface.d.ts → interface.d.mts} +0 -0
- /package/dist/transformers/{legacyLogicalProperties.js → legacyLogicalProperties.mjs} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Linter } from "./linters/interface.
|
|
2
|
-
import "./linters/index.
|
|
3
|
-
import { Entity, KeyType } from "./Cache.
|
|
4
|
-
import * as
|
|
1
|
+
import { Linter } from "./linters/interface.mjs";
|
|
2
|
+
import "./linters/index.mjs";
|
|
3
|
+
import { Entity, KeyType } from "./Cache.mjs";
|
|
4
|
+
import * as vue0 from "vue";
|
|
5
5
|
import { App, Ref } from "vue";
|
|
6
6
|
|
|
7
7
|
//#region src/StyleContext.d.ts
|
|
8
8
|
|
|
9
|
-
declare function createCache():
|
|
9
|
+
declare function createCache(): vue0.Raw<Entity>;
|
|
10
10
|
declare function useStyleContextProvide(props: Ref<StyleContextProps>): void;
|
|
11
11
|
declare function provideStyleContext(app: App, props: Ref<StyleContextProps>): void;
|
|
12
12
|
declare function useStyleContext(): Ref<{
|
|
@@ -114,6 +114,6 @@ interface StyleContextProps {
|
|
|
114
114
|
autoPrefix?: boolean;
|
|
115
115
|
}
|
|
116
116
|
type StyleProviderProps = StyleContextProps;
|
|
117
|
-
declare const StyleProvider:
|
|
117
|
+
declare const StyleProvider: vue0.DefineSetupFnComponent<Partial<StyleContextProps>, {}, {}, Partial<StyleContextProps> & {}, vue0.PublicProps>;
|
|
118
118
|
//#endregion
|
|
119
119
|
export { StyleProvider, StyleProviderProps, createCache, provideStyleContext, useStyleContext, useStyleContextProvide };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import Cache_default from "./Cache.
|
|
1
|
+
import Cache_default from "./Cache.mjs";
|
|
2
|
+
import { AUTO_PREFIX } from "./transformers/autoPrefix.mjs";
|
|
2
3
|
import { computed, defineComponent, inject, markRaw, provide, ref } from "vue";
|
|
3
|
-
import defu from "defu";
|
|
4
4
|
|
|
5
5
|
//#region src/StyleContext.ts
|
|
6
|
+
/**
|
|
7
|
+
* @description Style Context
|
|
8
|
+
* vue3 版本的 Style Context实现
|
|
9
|
+
*/
|
|
6
10
|
const ATTR_TOKEN = "data-token-hash";
|
|
7
11
|
const ATTR_MARK = "data-css-hash";
|
|
8
12
|
const ATTR_CACHE_PATH = "data-cache-path";
|
|
@@ -45,7 +49,17 @@ function useStyleContext() {
|
|
|
45
49
|
const StyleProvider = defineComponent((props, { slots }) => {
|
|
46
50
|
const parentContext = useStyleContext();
|
|
47
51
|
useStyleContextProvide(computed(() => {
|
|
48
|
-
|
|
52
|
+
const restProps = props;
|
|
53
|
+
const mergedContext = { ...parentContext.value };
|
|
54
|
+
Object.keys(restProps).forEach((key) => {
|
|
55
|
+
const value = restProps[key];
|
|
56
|
+
if (restProps[key] !== void 0) mergedContext[key] = value;
|
|
57
|
+
});
|
|
58
|
+
const { cache, transformers = [] } = restProps;
|
|
59
|
+
mergedContext.cache = mergedContext.cache || createCache();
|
|
60
|
+
mergedContext.defaultCache = !cache && parentContext.value?.defaultCache;
|
|
61
|
+
if (transformers.includes(AUTO_PREFIX)) mergedContext.autoPrefix = true;
|
|
62
|
+
return mergedContext;
|
|
49
63
|
}));
|
|
50
64
|
return () => {
|
|
51
65
|
return slots?.default?.();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TokenType } from "../../theme/interface.
|
|
2
|
-
import { Theme } from "../../theme/Theme.
|
|
3
|
-
import { GlobalToken, OverrideTokenMap, TokenMap } from "../interface/components.
|
|
1
|
+
import { TokenType } from "../../theme/interface.mjs";
|
|
2
|
+
import { Theme } from "../../theme/Theme.mjs";
|
|
3
|
+
import { GlobalToken, OverrideTokenMap, TokenMap } from "../interface/components.mjs";
|
|
4
4
|
import { Ref } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/cssinjs-utils/hooks/useToken.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./interface/components.
|
|
2
|
-
import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./util/genStyleUtils.
|
|
3
|
-
import { merge, statistic, statisticToken } from "./util/statistic.
|
|
1
|
+
import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./interface/components.mjs";
|
|
2
|
+
import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./util/genStyleUtils.mjs";
|
|
3
|
+
import { merge, statistic, statisticToken } from "./util/statistic.mjs";
|
|
4
4
|
export { type CSSUtil, type CSSVarRegisterProps, type ComponentToken, type ComponentTokenKey, type FullToken, type GenStyleFn, type GetCompUnitless, type GetDefaultToken, type GetDefaultTokenFn, type GetResetStyles, type GlobalToken, type GlobalTokenWithComponent, type OverrideTokenMap, type StyleInfo, type SubStyleComponentProps, type TokenMap, type TokenMapKey, type TokenWithCommonCls, genStyleUtils, merge as mergeToken, statistic, statisticToken };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import statistic_default, { merge, statistic } from "./util/statistic.
|
|
2
|
-
import genStyleUtils_default from "./util/genStyleUtils.
|
|
1
|
+
import statistic_default, { merge, statistic } from "./util/statistic.mjs";
|
|
2
|
+
import genStyleUtils_default from "./util/genStyleUtils.mjs";
|
|
3
3
|
|
|
4
4
|
export { genStyleUtils_default as genStyleUtils, merge as mergeToken, statistic, statistic_default as statisticToken };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AbstractCalculator } from "../../theme/calc/calculator.
|
|
2
|
-
import { TokenType } from "../../theme/interface.
|
|
3
|
-
import { ComponentTokenKey, GlobalTokenWithComponent, TokenMap, TokenMapKey } from "../interface/components.
|
|
4
|
-
import { CSSInterpolation, CSSObject, useStyleRegister } from "../../hooks/useStyleRegister.
|
|
5
|
-
import "../../index.
|
|
6
|
-
import { UseCSP } from "../hooks/useCSP.
|
|
7
|
-
import { UsePrefix } from "../hooks/usePrefix.
|
|
8
|
-
import { UseToken } from "../hooks/useToken.
|
|
9
|
-
import * as
|
|
1
|
+
import { AbstractCalculator } from "../../theme/calc/calculator.mjs";
|
|
2
|
+
import { TokenType } from "../../theme/interface.mjs";
|
|
3
|
+
import { ComponentTokenKey, GlobalTokenWithComponent, TokenMap, TokenMapKey } from "../interface/components.mjs";
|
|
4
|
+
import { CSSInterpolation, CSSObject, useStyleRegister } from "../../hooks/useStyleRegister.mjs";
|
|
5
|
+
import "../../index.mjs";
|
|
6
|
+
import { UseCSP } from "../hooks/useCSP.mjs";
|
|
7
|
+
import { UsePrefix } from "../hooks/usePrefix.mjs";
|
|
8
|
+
import { UseToken } from "../hooks/useToken.mjs";
|
|
9
|
+
import * as vue2 from "vue";
|
|
10
10
|
import { Ref, UnwrapRef } from "vue";
|
|
11
11
|
|
|
12
12
|
//#region src/cssinjs-utils/util/genStyleUtils.d.ts
|
|
@@ -85,7 +85,7 @@ declare function genStyleUtils<CompTokenMap extends TokenMap, AliasToken extends
|
|
|
85
85
|
* @default true
|
|
86
86
|
*/
|
|
87
87
|
injectStyle?: boolean;
|
|
88
|
-
}) => (prefixCls: Ref<string>, rootCls?: Ref<string | undefined>) => readonly [Ref<string, string>,
|
|
88
|
+
}) => (prefixCls: Ref<string>, rootCls?: Ref<string | undefined>) => readonly [Ref<string, string>, vue2.ComputedRef<string | undefined>];
|
|
89
89
|
genSubStyleComponent: <C extends TokenMapKey<CompTokenMap>>(componentName: C | [C, string], styleFn: GenStyleFn<CompTokenMap, AliasToken, C>, getDefaultToken?: GetDefaultToken<CompTokenMap, AliasToken, C>, options?: {
|
|
90
90
|
resetStyle?: boolean;
|
|
91
91
|
resetFont?: boolean;
|
|
@@ -100,13 +100,13 @@ declare function genStyleUtils<CompTokenMap extends TokenMap, AliasToken extends
|
|
|
100
100
|
order?: number;
|
|
101
101
|
injectStyle?: boolean;
|
|
102
102
|
unitless?: Partial<Record<ComponentTokenKey<CompTokenMap, AliasToken, C>, boolean>>;
|
|
103
|
-
}) =>
|
|
103
|
+
}) => vue2.DefineComponent<vue2.ExtractPropTypes<{
|
|
104
104
|
prefixCls: StringConstructor;
|
|
105
105
|
rootCls: StringConstructor;
|
|
106
|
-
}>, () => null, {}, {}, {},
|
|
106
|
+
}>, () => null, {}, {}, {}, vue2.ComponentOptionsMixin, vue2.ComponentOptionsMixin, {}, string, vue2.PublicProps, Readonly<vue2.ExtractPropTypes<{
|
|
107
107
|
prefixCls: StringConstructor;
|
|
108
108
|
rootCls: StringConstructor;
|
|
109
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
109
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue2.ComponentProvideOptions, true, {}, any>;
|
|
110
110
|
genComponentStyleHook: <C extends TokenMapKey<CompTokenMap>>(componentName: C | [C, string], styleFn: GenStyleFn<CompTokenMap, AliasToken, C>, getDefaultToken?: GetDefaultToken<CompTokenMap, AliasToken, C>, options?: {
|
|
111
111
|
resetStyle?: boolean;
|
|
112
112
|
resetFont?: boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import calc_default from "../../theme/calc/index.
|
|
2
|
-
import { token2CSSVar } from "../../util/css-variables.
|
|
3
|
-
import useStyleRegister from "../../hooks/useStyleRegister.
|
|
4
|
-
import useCSSVarRegister from "../../hooks/useCSSVarRegister.
|
|
5
|
-
import useUniqueMemo_default from "../_util/hooks/useUniqueMemo.
|
|
6
|
-
import useCSP_default from "../hooks/useCSP.
|
|
7
|
-
import getComponentToken_default from "./getComponentToken.
|
|
8
|
-
import getCompVarPrefix_default from "./getCompVarPrefix.
|
|
9
|
-
import statistic_default, { merge } from "./statistic.
|
|
10
|
-
import getDefaultComponentToken_default from "./getDefaultComponentToken.
|
|
11
|
-
import maxmin_default from "./maxmin.
|
|
12
|
-
import "../../index.
|
|
1
|
+
import calc_default from "../../theme/calc/index.mjs";
|
|
2
|
+
import { token2CSSVar } from "../../util/css-variables.mjs";
|
|
3
|
+
import useStyleRegister from "../../hooks/useStyleRegister.mjs";
|
|
4
|
+
import useCSSVarRegister from "../../hooks/useCSSVarRegister.mjs";
|
|
5
|
+
import useUniqueMemo_default from "../_util/hooks/useUniqueMemo.mjs";
|
|
6
|
+
import useCSP_default from "../hooks/useCSP.mjs";
|
|
7
|
+
import getComponentToken_default from "./getComponentToken.mjs";
|
|
8
|
+
import getCompVarPrefix_default from "./getCompVarPrefix.mjs";
|
|
9
|
+
import statistic_default, { merge } from "./statistic.mjs";
|
|
10
|
+
import getDefaultComponentToken_default from "./getDefaultComponentToken.mjs";
|
|
11
|
+
import maxmin_default from "./maxmin.mjs";
|
|
12
|
+
import "../../index.mjs";
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
//#region src/cssinjs-utils/util/genStyleUtils.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Entity } from "./Cache.
|
|
2
|
-
import { ExtractStyle } from "./hooks/useGlobalCache.
|
|
3
|
-
import { CSSVarCacheValue } from "./hooks/useCSSVarRegister.
|
|
1
|
+
import { Entity } from "./Cache.mjs";
|
|
2
|
+
import { ExtractStyle } from "./hooks/useGlobalCache.mjs";
|
|
3
|
+
import { CSSVarCacheValue } from "./hooks/useCSSVarRegister.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/extractStyle.d.ts
|
|
6
6
|
declare const ExtractStyleFns: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { toStyleStr } from "./util/index.
|
|
2
|
-
import { TOKEN_PREFIX, extract } from "./hooks/useCacheToken.
|
|
3
|
-
import { ATTR_CACHE_MAP, serialize } from "./util/cacheMapUtil.
|
|
4
|
-
import { STYLE_PREFIX, extract as extract$
|
|
5
|
-
import { CSS_VAR_PREFIX, extract as extract$
|
|
1
|
+
import { toStyleStr } from "./util/index.mjs";
|
|
2
|
+
import { TOKEN_PREFIX, extract } from "./hooks/useCacheToken.mjs";
|
|
3
|
+
import { ATTR_CACHE_MAP, serialize } from "./util/cacheMapUtil.mjs";
|
|
4
|
+
import { STYLE_PREFIX, extract as extract$1 } from "./hooks/useStyleRegister.mjs";
|
|
5
|
+
import { CSS_VAR_PREFIX, extract as extract$2 } from "./hooks/useCSSVarRegister.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/extractStyle.ts
|
|
8
8
|
const ExtractStyleFns = {
|
|
9
|
-
[STYLE_PREFIX]: extract$
|
|
9
|
+
[STYLE_PREFIX]: extract$1,
|
|
10
10
|
[TOKEN_PREFIX]: extract,
|
|
11
|
-
[CSS_VAR_PREFIX]: extract$
|
|
11
|
+
[CSS_VAR_PREFIX]: extract$2
|
|
12
12
|
};
|
|
13
13
|
function isNotNull(value) {
|
|
14
14
|
return value !== null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { collectStyleText } from "../ssr/styleCollector.
|
|
2
|
-
import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.
|
|
3
|
-
import { transformToken } from "../util/css-variables.
|
|
4
|
-
import { isClientSide, toStyleStr } from "../util/index.
|
|
5
|
-
import { useGlobalCache } from "./useGlobalCache.
|
|
6
|
-
import { uniqueHash } from "./useStyleRegister.
|
|
1
|
+
import { collectStyleText } from "../ssr/styleCollector.mjs";
|
|
2
|
+
import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.mjs";
|
|
3
|
+
import { transformToken } from "../util/css-variables.mjs";
|
|
4
|
+
import { isClientSide, toStyleStr } from "../util/index.mjs";
|
|
5
|
+
import { useGlobalCache } from "./useGlobalCache.mjs";
|
|
6
|
+
import { uniqueHash } from "./useStyleRegister.mjs";
|
|
7
7
|
import canUseDom from "@v-c/util/dist/Dom/canUseDom";
|
|
8
8
|
import { removeCSS, updateCSS } from "@v-c/util/dist/Dom/dynamicCSS";
|
|
9
9
|
import { computed } from "vue";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { collectStyleText } from "../ssr/styleCollector.
|
|
2
|
-
import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { collectStyleText } from "../ssr/styleCollector.mjs";
|
|
2
|
+
import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.mjs";
|
|
3
|
+
import resolveHash_default from "../util/resolveHash.mjs";
|
|
4
|
+
import { transformToken } from "../util/css-variables.mjs";
|
|
5
|
+
import { flattenToken, memoResult, toStyleStr, token2key } from "../util/index.mjs";
|
|
6
|
+
import { useGlobalCache } from "./useGlobalCache.mjs";
|
|
7
7
|
import canUseDom from "@v-c/util/dist/Dom/canUseDom";
|
|
8
8
|
import { updateCSS } from "@v-c/util/dist/Dom/dynamicCSS";
|
|
9
9
|
import { computed } from "vue";
|
|
@@ -85,8 +85,8 @@ function useCacheToken(theme, tokens, option) {
|
|
|
85
85
|
const mergedDerivativeToken = compute.value ? compute.value(mergedToken.value, override.value, theme.value) : getComputedToken(mergedToken.value, override.value, theme.value, formatToken.value);
|
|
86
86
|
const actualToken = { ...mergedDerivativeToken };
|
|
87
87
|
const mergedSalt = `${salt.value}_${cssVar.value.prefix || ""}`;
|
|
88
|
-
const hashId =
|
|
89
|
-
const hashCls = `${hashPrefix}-${
|
|
88
|
+
const hashId = resolveHash_default(mergedSalt);
|
|
89
|
+
const hashCls = `${hashPrefix}-${hashId}`;
|
|
90
90
|
actualToken._tokenKey = token2key(actualToken, mergedSalt);
|
|
91
91
|
const [tokenWithCssVar, cssVarsStr] = transformToken(mergedDerivativeToken, cssVar.value.key, {
|
|
92
92
|
prefix: cssVar.value.prefix,
|
|
@@ -118,7 +118,7 @@ function useCacheToken(theme, tokens, option) {
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
if (!cssVarsStr) return;
|
|
121
|
-
const style = updateCSS(cssVarsStr,
|
|
121
|
+
const style = updateCSS(cssVarsStr, resolveHash_default(`css-var-${themeKey}`), {
|
|
122
122
|
mark: ATTR_MARK,
|
|
123
123
|
prepend: "queue",
|
|
124
124
|
attachTo: styleContext.value.container,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { pathKey } from "../Cache.
|
|
2
|
-
import { useStyleContext } from "../StyleContext.
|
|
1
|
+
import { pathKey } from "../Cache.mjs";
|
|
2
|
+
import { useStyleContext } from "../StyleContext.mjs";
|
|
3
|
+
import { isClientSide } from "../util/index.mjs";
|
|
3
4
|
import { computed, watch } from "vue";
|
|
4
5
|
|
|
5
6
|
//#region src/hooks/useGlobalCache.ts
|
|
6
|
-
const isDev = process.env.NODE_ENV !== "production";
|
|
7
7
|
const effectMap = /* @__PURE__ */ new Map();
|
|
8
8
|
/**
|
|
9
9
|
* Global cache for CSS-in-JS styles
|
|
@@ -32,7 +32,7 @@ function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect)
|
|
|
32
32
|
buildCache();
|
|
33
33
|
const cacheContent = computed(() => {
|
|
34
34
|
let entity = styleContext.value.cache.opGet(fullPathStr.value);
|
|
35
|
-
if (
|
|
35
|
+
if (!entity) {
|
|
36
36
|
buildCache();
|
|
37
37
|
entity = getCacheEntity();
|
|
38
38
|
}
|
|
@@ -49,7 +49,9 @@ function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect)
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
const globalCache = styleContext.value.cache;
|
|
52
|
+
const isServerSide = styleContext.value.mock !== void 0 ? styleContext.value.mock === "server" : !isClientSide;
|
|
52
53
|
onCleanup(() => {
|
|
54
|
+
if (isServerSide) return;
|
|
53
55
|
globalCache.opUpdate(currentPath, (prevCache) => {
|
|
54
56
|
const [times = 0, cache] = prevCache || [];
|
|
55
57
|
if (times - 1 === 0) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Theme } from "../theme/Theme.
|
|
2
|
-
import { Keyframe } from "../Keyframes.
|
|
3
|
-
import "../linters/index.
|
|
4
|
-
import "../StyleContext.
|
|
5
|
-
import "../transformers/interface.
|
|
6
|
-
import "./useGlobalCache.
|
|
1
|
+
import { Theme } from "../theme/Theme.mjs";
|
|
2
|
+
import { Keyframe } from "../Keyframes.mjs";
|
|
3
|
+
import "../linters/index.mjs";
|
|
4
|
+
import "../StyleContext.mjs";
|
|
5
|
+
import "../transformers/interface.mjs";
|
|
6
|
+
import "./useGlobalCache.mjs";
|
|
7
7
|
import { Ref } from "vue";
|
|
8
8
|
import * as CSS from "csstype";
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ATTR_CACHE_PATH, ATTR_MARK, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "../linters/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { ATTR_CACHE_PATH, ATTR_MARK, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.mjs";
|
|
2
|
+
import resolveHash_default from "../util/resolveHash.mjs";
|
|
3
|
+
import { isClientSide, isNonNullable, toStyleStr, where } from "../util/index.mjs";
|
|
4
|
+
import { useGlobalCache } from "./useGlobalCache.mjs";
|
|
5
|
+
import contentQuotesLinter_default from "../linters/contentQuotesLinter.mjs";
|
|
6
|
+
import hashedAnimationLinter_default from "../linters/hashedAnimationLinter.mjs";
|
|
7
|
+
import "../linters/index.mjs";
|
|
8
|
+
import { CSS_FILE_STYLE, existPath, getStyleAndHash } from "../util/cacheMapUtil.mjs";
|
|
9
9
|
import { removeCSS, updateCSS } from "@v-c/util/dist/Dom/dynamicCSS";
|
|
10
10
|
import { computed } from "vue";
|
|
11
11
|
import unitless from "@emotion/unitless";
|
|
@@ -21,10 +21,12 @@ function normalizeStyle(styleStr, autoPrefix) {
|
|
|
21
21
|
function isCompoundCSSProperty(value) {
|
|
22
22
|
return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
|
|
23
23
|
}
|
|
24
|
-
function injectSelectorHash(key, hashId, hashPriority) {
|
|
24
|
+
function injectSelectorHash(key, hashId, hashPriority = "high") {
|
|
25
25
|
if (!hashId) return key;
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const hashSelector = where({
|
|
27
|
+
hashCls: hashId,
|
|
28
|
+
hashPriority
|
|
29
|
+
});
|
|
28
30
|
return key.split(",").map((k) => {
|
|
29
31
|
const fullPath = k.trim().split(/\s+/);
|
|
30
32
|
let firstPath = fullPath[0] || "";
|
|
@@ -110,7 +112,7 @@ function parseStyle(interpolation, config = {}, { root, injectHash, parentSelect
|
|
|
110
112
|
if (typeof value === "object" && value?.[MULTI_VALUE] && Array.isArray(actualValue)) actualValue.forEach((item) => {
|
|
111
113
|
appendStyle(key, item);
|
|
112
114
|
});
|
|
113
|
-
else appendStyle(key, actualValue);
|
|
115
|
+
else if (isNonNullable(actualValue)) appendStyle(key, actualValue);
|
|
114
116
|
}
|
|
115
117
|
});
|
|
116
118
|
}
|
|
@@ -123,7 +125,7 @@ function parseStyle(interpolation, config = {}, { root, injectHash, parentSelect
|
|
|
123
125
|
return [styleStr, effectStyle];
|
|
124
126
|
}
|
|
125
127
|
function uniqueHash(path, styleStr) {
|
|
126
|
-
return
|
|
128
|
+
return resolveHash_default(`${path.join("%")}${styleStr}`);
|
|
127
129
|
}
|
|
128
130
|
const STYLE_PREFIX = "style";
|
|
129
131
|
function useStyleRegister(info, styleFn) {
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AbstractCalculator } from "./theme/calc/calculator.
|
|
2
|
-
import { genCalc } from "./theme/calc/index.
|
|
3
|
-
import { DerivativeFunc, TokenType } from "./theme/interface.
|
|
4
|
-
import { Theme } from "./theme/Theme.
|
|
5
|
-
import { createTheme } from "./theme/createTheme.
|
|
6
|
-
import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./cssinjs-utils/interface/components.
|
|
7
|
-
import { Keyframe } from "./Keyframes.
|
|
8
|
-
import { Linter } from "./linters/interface.
|
|
9
|
-
import { linter as linter$1 } from "./linters/legacyNotSelectorLinter.
|
|
10
|
-
import { linter as linter$2 } from "./linters/logicalPropertiesLinter.
|
|
11
|
-
import { linter } from "./linters/NaNLinter.
|
|
12
|
-
import { linter as linter$3 } from "./linters/parentSelectorLinter.
|
|
13
|
-
import "./linters/index.
|
|
14
|
-
import { StyleProvider, StyleProviderProps, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.
|
|
15
|
-
import { Transformer } from "./transformers/interface.
|
|
16
|
-
import { CSSInterpolation, CSSObject, useStyleRegister } from "./hooks/useStyleRegister.
|
|
17
|
-
import { token2CSSVar } from "./util/css-variables.
|
|
18
|
-
import { useCSSVarRegister } from "./hooks/useCSSVarRegister.
|
|
19
|
-
import { extractStyle } from "./extractStyle.
|
|
20
|
-
import { getComputedToken, useCacheToken } from "./hooks/useCacheToken.
|
|
21
|
-
import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.
|
|
22
|
-
import { transform } from "./transformers/autoPrefix.
|
|
23
|
-
import { transform as transform$1 } from "./transformers/legacyLogicalProperties.
|
|
24
|
-
import { transform as transform$2 } from "./transformers/px2rem.
|
|
25
|
-
import { unit } from "./util/index.
|
|
26
|
-
import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./cssinjs-utils/util/genStyleUtils.
|
|
27
|
-
import { merge, statistic, statisticToken } from "./cssinjs-utils/util/statistic.
|
|
28
|
-
import "./cssinjs-utils/index.
|
|
1
|
+
import { AbstractCalculator } from "./theme/calc/calculator.mjs";
|
|
2
|
+
import { genCalc } from "./theme/calc/index.mjs";
|
|
3
|
+
import { DerivativeFunc, TokenType } from "./theme/interface.mjs";
|
|
4
|
+
import { Theme } from "./theme/Theme.mjs";
|
|
5
|
+
import { createTheme } from "./theme/createTheme.mjs";
|
|
6
|
+
import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./cssinjs-utils/interface/components.mjs";
|
|
7
|
+
import { Keyframe } from "./Keyframes.mjs";
|
|
8
|
+
import { Linter } from "./linters/interface.mjs";
|
|
9
|
+
import { linter as linter$1 } from "./linters/legacyNotSelectorLinter.mjs";
|
|
10
|
+
import { linter as linter$2 } from "./linters/logicalPropertiesLinter.mjs";
|
|
11
|
+
import { linter } from "./linters/NaNLinter.mjs";
|
|
12
|
+
import { linter as linter$3 } from "./linters/parentSelectorLinter.mjs";
|
|
13
|
+
import "./linters/index.mjs";
|
|
14
|
+
import { StyleProvider, StyleProviderProps, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.mjs";
|
|
15
|
+
import { Transformer } from "./transformers/interface.mjs";
|
|
16
|
+
import { CSSInterpolation, CSSObject, useStyleRegister } from "./hooks/useStyleRegister.mjs";
|
|
17
|
+
import { token2CSSVar } from "./util/css-variables.mjs";
|
|
18
|
+
import { useCSSVarRegister } from "./hooks/useCSSVarRegister.mjs";
|
|
19
|
+
import { extractStyle } from "./extractStyle.mjs";
|
|
20
|
+
import { getComputedToken, useCacheToken } from "./hooks/useCacheToken.mjs";
|
|
21
|
+
import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.mjs";
|
|
22
|
+
import { transform } from "./transformers/autoPrefix.mjs";
|
|
23
|
+
import { transform as transform$1 } from "./transformers/legacyLogicalProperties.mjs";
|
|
24
|
+
import { transform as transform$2 } from "./transformers/px2rem.mjs";
|
|
25
|
+
import { unit } from "./util/index.mjs";
|
|
26
|
+
import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./cssinjs-utils/util/genStyleUtils.mjs";
|
|
27
|
+
import { merge, statistic, statisticToken } from "./cssinjs-utils/util/statistic.mjs";
|
|
28
|
+
import "./cssinjs-utils/index.mjs";
|
|
29
29
|
|
|
30
30
|
//#region src/index.d.ts
|
|
31
31
|
declare const _experimental: {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./theme/
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import "./linters/
|
|
15
|
-
import
|
|
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 { collectStyleText, setStyleCollector } from "./ssr/styleCollector.mjs";
|
|
2
|
+
import autoPrefix_default from "./transformers/autoPrefix.mjs";
|
|
3
|
+
import { StyleProvider, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.mjs";
|
|
4
|
+
import calc_default from "./theme/calc/index.mjs";
|
|
5
|
+
import Theme from "./theme/Theme.mjs";
|
|
6
|
+
import createTheme from "./theme/createTheme.mjs";
|
|
7
|
+
import "./theme/index.mjs";
|
|
8
|
+
import { token2CSSVar } from "./util/css-variables.mjs";
|
|
9
|
+
import { supportLogicProps, supportWhere, unit } from "./util/index.mjs";
|
|
10
|
+
import useCacheToken, { getComputedToken } from "./hooks/useCacheToken.mjs";
|
|
11
|
+
import legacyNotSelectorLinter_default from "./linters/legacyNotSelectorLinter.mjs";
|
|
12
|
+
import logicalPropertiesLinter_default from "./linters/logicalPropertiesLinter.mjs";
|
|
13
|
+
import NaNLinter_default from "./linters/NaNLinter.mjs";
|
|
14
|
+
import parentSelectorLinter_default from "./linters/parentSelectorLinter.mjs";
|
|
15
|
+
import "./linters/index.mjs";
|
|
16
|
+
import useStyleRegister from "./hooks/useStyleRegister.mjs";
|
|
17
|
+
import useCSSVarRegister from "./hooks/useCSSVarRegister.mjs";
|
|
18
|
+
import extractStyle from "./extractStyle.mjs";
|
|
19
|
+
import Keyframes_default from "./Keyframes.mjs";
|
|
20
|
+
import legacyLogicalProperties_default from "./transformers/legacyLogicalProperties.mjs";
|
|
21
|
+
import px2rem_default from "./transformers/px2rem.mjs";
|
|
22
|
+
import statistic_default, { merge, statistic } from "./cssinjs-utils/util/statistic.mjs";
|
|
23
|
+
import genStyleUtils_default from "./cssinjs-utils/util/genStyleUtils.mjs";
|
|
24
|
+
import "./cssinjs-utils/index.mjs";
|
|
25
25
|
|
|
26
26
|
//#region src/index.ts
|
|
27
27
|
const _experimental = { supportModernCSS: () => supportWhere() && supportLogicProps() };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Linter } from "./interface.mjs";
|
|
2
|
+
import { linter } from "./legacyNotSelectorLinter.mjs";
|
|
3
|
+
import { linter as linter$1 } from "./logicalPropertiesLinter.mjs";
|
|
4
|
+
import { linter as linter$2 } from "./NaNLinter.mjs";
|
|
5
|
+
import { linter as linter$3 } from "./parentSelectorLinter.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import contentQuotesLinter_default from "./contentQuotesLinter.
|
|
2
|
-
import hashedAnimationLinter_default from "./hashedAnimationLinter.
|
|
3
|
-
import legacyNotSelectorLinter_default from "./legacyNotSelectorLinter.
|
|
4
|
-
import logicalPropertiesLinter_default from "./logicalPropertiesLinter.
|
|
5
|
-
import NaNLinter_default from "./NaNLinter.
|
|
6
|
-
import parentSelectorLinter_default from "./parentSelectorLinter.
|
|
1
|
+
import contentQuotesLinter_default from "./contentQuotesLinter.mjs";
|
|
2
|
+
import hashedAnimationLinter_default from "./hashedAnimationLinter.mjs";
|
|
3
|
+
import legacyNotSelectorLinter_default from "./legacyNotSelectorLinter.mjs";
|
|
4
|
+
import logicalPropertiesLinter_default from "./logicalPropertiesLinter.mjs";
|
|
5
|
+
import NaNLinter_default from "./NaNLinter.mjs";
|
|
6
|
+
import parentSelectorLinter_default from "./parentSelectorLinter.mjs";
|
|
7
7
|
|
|
8
8
|
export { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractCalculator } from "./calculator.
|
|
2
|
-
import { CSSCalculator } from "./CSSCalculator.
|
|
3
|
-
import { NumCalculator } from "./NumCalculator.
|
|
1
|
+
import { AbstractCalculator } from "./calculator.mjs";
|
|
2
|
+
import { CSSCalculator } from "./CSSCalculator.mjs";
|
|
3
|
+
import { NumCalculator } from "./NumCalculator.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/theme/calc/index.d.ts
|
|
6
6
|
declare function genCalc(type: 'css' | 'js', unitlessCssVar: Set<string>): (num: number | string | AbstractCalculator) => CSSCalculator | NumCalculator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CSSCalculator from "./CSSCalculator.
|
|
2
|
-
import NumCalculator from "./NumCalculator.
|
|
1
|
+
import CSSCalculator from "./CSSCalculator.mjs";
|
|
2
|
+
import NumCalculator from "./NumCalculator.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/theme/calc/index.ts
|
|
5
5
|
function genCalc(type, unitlessCssVar) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import unitless from "@emotion/unitless";
|
|
2
2
|
|
|
3
3
|
//#region src/transformers/px2rem.ts
|
|
4
|
+
/**
|
|
5
|
+
* respect https://github.com/cuth/postcss-pxtorem
|
|
6
|
+
*/
|
|
4
7
|
const pxRegex = /url\([^)]+\)|var\([^)]+\)|(\d+(?:\.\d+)?|\.\d+)px/g;
|
|
5
8
|
function toFixed(number, precision) {
|
|
6
9
|
const multiplier = 10 ** (precision + 1);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ATTR_MARK, ATTR_TOKEN } from "../StyleContext.
|
|
2
|
-
import Theme from "../theme/Theme.
|
|
3
|
-
import "../theme/index.
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ATTR_MARK, ATTR_TOKEN } from "../StyleContext.mjs";
|
|
2
|
+
import Theme from "../theme/Theme.mjs";
|
|
3
|
+
import "../theme/index.mjs";
|
|
4
|
+
import resolveHash_default from "./resolveHash.mjs";
|
|
5
|
+
import { token2CSSVar } from "./css-variables.mjs";
|
|
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
|
|
|
@@ -33,7 +33,7 @@ function flattenToken(token) {
|
|
|
33
33
|
else if (value && typeof value === "object") str += flattenToken(value);
|
|
34
34
|
else str += value;
|
|
35
35
|
});
|
|
36
|
-
str =
|
|
36
|
+
str = resolveHash_default(str);
|
|
37
37
|
flattenTokenCache.set(token, str);
|
|
38
38
|
}
|
|
39
39
|
return str;
|
|
@@ -42,7 +42,7 @@ function flattenToken(token) {
|
|
|
42
42
|
* Convert derivative token to key string
|
|
43
43
|
*/
|
|
44
44
|
function token2key(token, salt) {
|
|
45
|
-
return
|
|
45
|
+
return resolveHash_default(`${salt}_${flattenToken(token)}`);
|
|
46
46
|
}
|
|
47
47
|
const randomSelectorKey = `random-${Date.now()}-${Math.random()}`.replace(/\./g, "");
|
|
48
48
|
const checkContent = "_bAmBoO_";
|
|
@@ -103,6 +103,9 @@ function where(options) {
|
|
|
103
103
|
const hashSelector = `.${hashCls}`;
|
|
104
104
|
return hashPriority === "low" ? `:where(${hashSelector})` : hashSelector;
|
|
105
105
|
}
|
|
106
|
+
function isNonNullable(val) {
|
|
107
|
+
return val !== void 0 && val !== null;
|
|
108
|
+
}
|
|
106
109
|
|
|
107
110
|
//#endregion
|
|
108
|
-
export { flattenToken, isClientSide, memoResult, supportLogicProps, supportWhere, toStyleStr, token2key, unit, where };
|
|
111
|
+
export { flattenToken, isClientSide, isNonNullable, memoResult, supportLogicProps, supportWhere, toStyleStr, token2key, unit, where };
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antdv-next/cssinjs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
5
|
"description": "cssinjs solution for ant-design-vue",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"types": "./dist/index.d.
|
|
9
|
-
"import": "./dist/index.
|
|
10
|
-
"default": "./dist/index.
|
|
8
|
+
"types": "./dist/index.d.mts",
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"default": "./dist/index.mjs"
|
|
11
11
|
},
|
|
12
12
|
"./cssinjs-utils": {
|
|
13
|
-
"types": "./dist/cssinjs-utils/index.d.
|
|
14
|
-
"import": "./dist/cssinjs-utils/index.
|
|
15
|
-
"default": "./dist/cssinjs-utils/index.
|
|
13
|
+
"types": "./dist/cssinjs-utils/index.d.mts",
|
|
14
|
+
"import": "./dist/cssinjs-utils/index.mjs",
|
|
15
|
+
"default": "./dist/cssinjs-utils/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"./dist/*": {
|
|
18
|
-
"types": "./dist/*.d.
|
|
19
|
-
"import": "./dist/*.
|
|
20
|
-
"default": "./dist/*.
|
|
18
|
+
"types": "./dist/*.d.mts",
|
|
19
|
+
"import": "./dist/*.mjs",
|
|
20
|
+
"default": "./dist/*.mjs"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@emotion/hash": "^0.8.0",
|
|
32
32
|
"@emotion/unitless": "^0.7.5",
|
|
33
|
-
"@v-c/util": "^1.0.
|
|
33
|
+
"@v-c/util": "^1.0.8",
|
|
34
34
|
"csstype": "^3.2.3",
|
|
35
35
|
"defu": "^6.1.4",
|
|
36
36
|
"stylis": "^4.3.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@testing-library/jest-dom": "^5.17.0",
|
|
40
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^25.0.10",
|
|
41
41
|
"@types/stylis": "^4.2.7",
|
|
42
|
-
"@types/testing-library__jest-dom": "^
|
|
42
|
+
"@types/testing-library__jest-dom": "^6.0.0",
|
|
43
43
|
"@vue/test-utils": "^2.4.6",
|
|
44
|
-
"vue": "^3.5.
|
|
44
|
+
"vue": "^3.5.27"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"test": "vitest run",
|
package/dist/linters/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Linter } from "./interface.js";
|
|
2
|
-
import { linter } from "./legacyNotSelectorLinter.js";
|
|
3
|
-
import { linter as linter$1 } from "./logicalPropertiesLinter.js";
|
|
4
|
-
import { linter as linter$2 } from "./NaNLinter.js";
|
|
5
|
-
import { linter as linter$3 } from "./parentSelectorLinter.js";
|
package/dist/theme/index.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|