@antdv-next/cssinjs 1.0.0-beta.1 → 1.0.0-rc.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.
Files changed (83) hide show
  1. package/dist/{Cache.d.ts → Cache.d.mts} +0 -1
  2. package/dist/{Keyframes.d.ts → Keyframes.d.mts} +1 -1
  3. package/dist/{StyleContext.d.ts → StyleContext.d.mts} +17 -26
  4. package/dist/{StyleContext.js → StyleContext.mjs} +6 -2
  5. package/dist/cssinjs-utils/hooks/{useToken.d.ts → useToken.d.mts} +3 -3
  6. package/dist/cssinjs-utils/{index.d.ts → index.d.mts} +3 -3
  7. package/dist/cssinjs-utils/{index.js → index.mjs} +2 -2
  8. package/dist/cssinjs-utils/interface/{components.d.ts → components.d.mts} +1 -1
  9. package/dist/cssinjs-utils/util/{genStyleUtils.d.ts → genStyleUtils.d.mts} +11 -15
  10. package/dist/cssinjs-utils/util/{genStyleUtils.js → genStyleUtils.mjs} +17 -17
  11. package/dist/cssinjs-utils/util/{getDefaultComponentToken.js → getDefaultComponentToken.mjs} +1 -1
  12. package/dist/cssinjs-utils/util/{maxmin.js → maxmin.mjs} +1 -1
  13. package/dist/cssinjs-utils/util/{statistic.d.ts → statistic.d.mts} +1 -1
  14. package/dist/{extractStyle.d.ts → extractStyle.d.mts} +3 -3
  15. package/dist/{extractStyle.js → extractStyle.mjs} +8 -8
  16. package/dist/hooks/{useCSSVarRegister.d.ts → useCSSVarRegister.d.mts} +2 -2
  17. package/dist/hooks/{useCSSVarRegister.js → useCSSVarRegister.mjs} +6 -6
  18. package/dist/hooks/{useCacheToken.d.ts → useCacheToken.d.mts} +7 -12
  19. package/dist/hooks/{useCacheToken.js → useCacheToken.mjs} +8 -8
  20. package/dist/hooks/{useGlobalCache.js → useGlobalCache.mjs} +5 -2
  21. package/dist/hooks/{useStyleRegister.d.ts → useStyleRegister.d.mts} +6 -6
  22. package/dist/hooks/{useStyleRegister.js → useStyleRegister.mjs} +13 -13
  23. package/dist/{index.d.ts → index.d.mts} +28 -28
  24. package/dist/{index.js → index.mjs} +24 -24
  25. package/dist/linters/{NaNLinter.d.ts → NaNLinter.d.mts} +1 -1
  26. package/dist/linters/{NaNLinter.js → NaNLinter.mjs} +1 -1
  27. package/dist/linters/{contentQuotesLinter.js → contentQuotesLinter.mjs} +1 -1
  28. package/dist/linters/{hashedAnimationLinter.js → hashedAnimationLinter.mjs} +1 -1
  29. package/dist/linters/index.d.mts +5 -0
  30. package/dist/linters/{index.js → index.mjs} +6 -6
  31. package/dist/linters/{legacyNotSelectorLinter.d.ts → legacyNotSelectorLinter.d.mts} +1 -1
  32. package/dist/linters/{legacyNotSelectorLinter.js → legacyNotSelectorLinter.mjs} +1 -1
  33. package/dist/linters/{logicalPropertiesLinter.d.ts → logicalPropertiesLinter.d.mts} +1 -1
  34. package/dist/linters/{logicalPropertiesLinter.js → logicalPropertiesLinter.mjs} +1 -1
  35. package/dist/linters/{parentSelectorLinter.d.ts → parentSelectorLinter.d.mts} +2 -2
  36. package/dist/linters/{parentSelectorLinter.js → parentSelectorLinter.mjs} +1 -1
  37. package/dist/theme/{Theme.d.ts → Theme.d.mts} +1 -2
  38. package/dist/theme/calc/{CSSCalculator.d.ts → CSSCalculator.d.mts} +1 -1
  39. package/dist/theme/calc/{CSSCalculator.js → CSSCalculator.mjs} +1 -1
  40. package/dist/theme/calc/{NumCalculator.d.ts → NumCalculator.d.mts} +1 -1
  41. package/dist/theme/calc/{NumCalculator.js → NumCalculator.mjs} +1 -1
  42. package/dist/theme/calc/{index.d.ts → index.d.mts} +3 -3
  43. package/dist/theme/calc/{index.js → index.mjs} +2 -2
  44. package/dist/theme/{createTheme.d.ts → createTheme.d.mts} +2 -3
  45. package/dist/theme/{createTheme.js → createTheme.mjs} +2 -2
  46. package/dist/theme/index.mjs +6 -0
  47. package/dist/transformers/{autoPrefix.d.ts → autoPrefix.d.mts} +1 -1
  48. package/dist/transformers/{interface.d.ts → interface.d.mts} +2 -2
  49. package/dist/transformers/{legacyLogicalProperties.d.ts → legacyLogicalProperties.d.mts} +1 -2
  50. package/dist/transformers/{px2rem.d.ts → px2rem.d.mts} +1 -1
  51. package/dist/transformers/{px2rem.js → px2rem.mjs} +3 -0
  52. package/dist/util/{cacheMapUtil.js → cacheMapUtil.mjs} +4 -4
  53. package/dist/util/{css-variables.d.ts → css-variables.d.mts} +1 -1
  54. package/dist/util/{css-variables.js → css-variables.mjs} +1 -1
  55. package/dist/util/index.d.mts +7 -0
  56. package/dist/util/{index.js → index.mjs} +7 -7
  57. package/dist/util/resolveHash.mjs +7 -0
  58. package/dist/util/resolveUnitless.mjs +7 -0
  59. package/package.json +15 -15
  60. package/dist/linters/index.d.ts +0 -5
  61. package/dist/theme/index.js +0 -6
  62. package/dist/util/index.d.ts +0 -8
  63. /package/dist/{Cache.js → Cache.mjs} +0 -0
  64. /package/dist/{Keyframes.js → Keyframes.mjs} +0 -0
  65. /package/dist/cssinjs-utils/_util/hooks/{useUniqueMemo.js → useUniqueMemo.mjs} +0 -0
  66. /package/dist/cssinjs-utils/hooks/{useCSP.d.ts → useCSP.d.mts} +0 -0
  67. /package/dist/cssinjs-utils/hooks/{useCSP.js → useCSP.mjs} +0 -0
  68. /package/dist/cssinjs-utils/hooks/{usePrefix.d.ts → usePrefix.d.mts} +0 -0
  69. /package/dist/cssinjs-utils/util/{getCompVarPrefix.js → getCompVarPrefix.mjs} +0 -0
  70. /package/dist/cssinjs-utils/util/{getComponentToken.js → getComponentToken.mjs} +0 -0
  71. /package/dist/cssinjs-utils/util/{statistic.js → statistic.mjs} +0 -0
  72. /package/dist/hooks/{useGlobalCache.d.ts → useGlobalCache.d.mts} +0 -0
  73. /package/dist/linters/{interface.d.ts → interface.d.mts} +0 -0
  74. /package/dist/linters/{utils.js → utils.mjs} +0 -0
  75. /package/dist/ssr/{styleCollector.d.ts → styleCollector.d.mts} +0 -0
  76. /package/dist/ssr/{styleCollector.js → styleCollector.mjs} +0 -0
  77. /package/dist/theme/{Theme.js → Theme.mjs} +0 -0
  78. /package/dist/theme/{ThemeCache.js → ThemeCache.mjs} +0 -0
  79. /package/dist/theme/calc/{calculator.d.ts → calculator.d.mts} +0 -0
  80. /package/dist/theme/calc/{calculator.js → calculator.mjs} +0 -0
  81. /package/dist/theme/{interface.d.ts → interface.d.mts} +0 -0
  82. /package/dist/transformers/{autoPrefix.js → autoPrefix.mjs} +0 -0
  83. /package/dist/transformers/{legacyLogicalProperties.js → legacyLogicalProperties.mjs} +0 -0
@@ -2,7 +2,6 @@
2
2
  type KeyType = string | number;
3
3
  type ValueType = [number, any];
4
4
  /** Connect key with `SPLIT` */
5
-
6
5
  declare class Entity {
7
6
  instanceId: string;
8
7
  constructor(instanceId: string);
@@ -1,4 +1,4 @@
1
- import { CSSInterpolation } from "./hooks/useStyleRegister.js";
1
+ import { CSSInterpolation } from "./hooks/useStyleRegister.mjs";
2
2
 
3
3
  //#region src/Keyframes.d.ts
4
4
  declare class Keyframe {
@@ -1,22 +1,21 @@
1
- import { Linter } from "./linters/interface.js";
2
- import "./linters/index.js";
3
- import { Entity, KeyType } from "./Cache.js";
1
+ import { Linter } from "./linters/interface.mjs";
2
+ import "./linters/index.mjs";
3
+ import { Entity, KeyType } from "./Cache.mjs";
4
4
  import * as vue0 from "vue";
5
5
  import { App, Ref } from "vue";
6
6
 
7
7
  //#region src/StyleContext.d.ts
8
-
9
8
  declare function createCache(): vue0.Raw<Entity>;
10
9
  declare function useStyleContextProvide(props: Ref<StyleContextProps>): void;
11
10
  declare function provideStyleContext(app: App, props: Ref<StyleContextProps>): void;
12
11
  declare function useStyleContext(): Ref<{
13
- autoClear?: boolean
14
- /** @private Test only. Not work in production. */ | undefined;
12
+ autoClear?: boolean /** @private Test only. Not work in production. */ | undefined;
15
13
  mock?: "server" | "client"
16
14
  /**
17
15
  * Only set when you need ssr to extract style on you own.
18
16
  * If not provided, it will auto create <style /> on the end of Provider in server side.
19
- */ | undefined;
17
+ */
18
+ | undefined;
20
19
  cache: {
21
20
  instanceId: string;
22
21
  cache: Map<string, [number, any]> & Omit<Map<string, [number, any]>, keyof Map<any, any>>;
@@ -28,11 +27,9 @@ declare function useStyleContext(): Ref<{
28
27
  opUpdate: (keyPathStr: string, valueFn: (origin: [number, any] | null) => [number, any] | null) => void;
29
28
  };
30
29
  defaultCache: boolean;
31
- hashPriority?: HashPriority
32
- /** Tell cssinjs where to inject style in */ | undefined;
30
+ hashPriority?: HashPriority /** Tell cssinjs where to inject style in */ | undefined;
33
31
  container?: (Element | ShadowRoot) | undefined;
34
- ssrInline?: boolean
35
- /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */ | undefined;
32
+ ssrInline?: boolean /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */ | undefined;
36
33
  transformers?: {
37
34
  flush?: TransformerFlushCallback<any> | undefined;
38
35
  readableType?: undefined | undefined;
@@ -40,19 +37,17 @@ declare function useStyleContext(): Ref<{
40
37
  transform?: TransformerTransformCallback<any, any> | undefined;
41
38
  writableType?: undefined | undefined;
42
39
  }[] | undefined;
43
- linters?: Linter[]
44
- /** Wrap css in a layer to avoid global style conflict */ | undefined;
45
- layer?: boolean
46
- /** Hardcode here since transformer not support take effect on serialize currently */ | undefined;
40
+ linters?: Linter[] /** Wrap css in a layer to avoid global style conflict */ | undefined;
41
+ layer?: boolean /** Hardcode here since transformer not support take effect on serialize currently */ | undefined;
47
42
  autoPrefix?: boolean | undefined;
48
43
  }, StyleContextProps | {
49
- autoClear?: boolean
50
- /** @private Test only. Not work in production. */ | undefined;
44
+ autoClear?: boolean /** @private Test only. Not work in production. */ | undefined;
51
45
  mock?: "server" | "client"
52
46
  /**
53
47
  * Only set when you need ssr to extract style on you own.
54
48
  * If not provided, it will auto create <style /> on the end of Provider in server side.
55
- */ | undefined;
49
+ */
50
+ | undefined;
56
51
  cache: {
57
52
  instanceId: string;
58
53
  cache: Map<string, [number, any]> & Omit<Map<string, [number, any]>, keyof Map<any, any>>;
@@ -64,11 +59,9 @@ declare function useStyleContext(): Ref<{
64
59
  opUpdate: (keyPathStr: string, valueFn: (origin: [number, any] | null) => [number, any] | null) => void;
65
60
  };
66
61
  defaultCache: boolean;
67
- hashPriority?: HashPriority
68
- /** Tell cssinjs where to inject style in */ | undefined;
62
+ hashPriority?: HashPriority /** Tell cssinjs where to inject style in */ | undefined;
69
63
  container?: (Element | ShadowRoot) | undefined;
70
- ssrInline?: boolean
71
- /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */ | undefined;
64
+ ssrInline?: boolean /** Transform css before inject in document. Please note that `transformers` do not support dynamic update */ | undefined;
72
65
  transformers?: {
73
66
  flush?: TransformerFlushCallback<any> | undefined;
74
67
  readableType?: undefined | undefined;
@@ -76,10 +69,8 @@ declare function useStyleContext(): Ref<{
76
69
  transform?: TransformerTransformCallback<any, any> | undefined;
77
70
  writableType?: undefined | undefined;
78
71
  }[] | undefined;
79
- linters?: Linter[]
80
- /** Wrap css in a layer to avoid global style conflict */ | undefined;
81
- layer?: boolean
82
- /** Hardcode here since transformer not support take effect on serialize currently */ | undefined;
72
+ linters?: Linter[] /** Wrap css in a layer to avoid global style conflict */ | undefined;
73
+ layer?: boolean /** Hardcode here since transformer not support take effect on serialize currently */ | undefined;
83
74
  autoPrefix?: boolean | undefined;
84
75
  }>;
85
76
  type HashPriority = 'low' | 'high';
@@ -1,8 +1,12 @@
1
- import Cache_default from "./Cache.js";
2
- import { AUTO_PREFIX } from "./transformers/autoPrefix.js";
1
+ import Cache_default from "./Cache.mjs";
2
+ import { AUTO_PREFIX } from "./transformers/autoPrefix.mjs";
3
3
  import { computed, defineComponent, inject, markRaw, provide, ref } from "vue";
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";
@@ -1,6 +1,6 @@
1
- import { TokenType } from "../../theme/interface.js";
2
- import { Theme } from "../../theme/Theme.js";
3
- import { GlobalToken, OverrideTokenMap, TokenMap } from "../interface/components.js";
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.js";
2
- import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./util/genStyleUtils.js";
3
- import { merge, statistic, statisticToken } from "./util/statistic.js";
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.js";
2
- import genStyleUtils_default from "./util/genStyleUtils.js";
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,4 +1,4 @@
1
- import { TokenType } from "../../theme/interface.js";
1
+ import { TokenType } from "../../theme/interface.mjs";
2
2
 
3
3
  //#region src/cssinjs-utils/interface/components.d.ts
4
4
  type TokenMap = Record<PropertyKey, any>;
@@ -1,11 +1,11 @@
1
- import { AbstractCalculator } from "../../theme/calc/calculator.js";
2
- import { TokenType } from "../../theme/interface.js";
3
- import { ComponentTokenKey, GlobalTokenWithComponent, TokenMap, TokenMapKey } from "../interface/components.js";
4
- import { CSSInterpolation, CSSObject, useStyleRegister } from "../../hooks/useStyleRegister.js";
5
- import "../../index.js";
6
- import { UseCSP } from "../hooks/useCSP.js";
7
- import { UsePrefix } from "../hooks/usePrefix.js";
8
- import { UseToken } from "../hooks/useToken.js";
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
9
  import * as vue2 from "vue";
10
10
  import { Ref, UnwrapRef } from "vue";
11
11
 
@@ -23,13 +23,9 @@ interface CSSUtil {
23
23
  min: (...values: (number | string)[]) => number | string;
24
24
  }
25
25
  type TokenWithCommonCls<T> = T & {
26
- /** Wrap component class with `.` prefix */
27
- componentCls: string;
28
- /** Origin prefix which do not have `.` prefix */
29
- prefixCls: string;
30
- /** Wrap icon class with `.` prefix */
31
- iconCls: string;
32
- /** Wrap ant prefixCls class with `.` prefix */
26
+ /** Wrap component class with `.` prefix */componentCls: string; /** Origin prefix which do not have `.` prefix */
27
+ prefixCls: string; /** Wrap icon class with `.` prefix */
28
+ iconCls: string; /** Wrap ant prefixCls class with `.` prefix */
33
29
  antCls: string;
34
30
  } & CSSUtil;
35
31
  type FullToken<CompTokenMap extends TokenMap, AliasToken extends TokenType, C extends TokenMapKey<CompTokenMap>> = TokenWithCommonCls<GlobalTokenWithComponent<CompTokenMap, AliasToken, C>>;
@@ -1,15 +1,15 @@
1
- import calc_default from "../../theme/calc/index.js";
2
- import { token2CSSVar } from "../../util/css-variables.js";
3
- import useStyleRegister from "../../hooks/useStyleRegister.js";
4
- import useCSSVarRegister from "../../hooks/useCSSVarRegister.js";
5
- import useUniqueMemo_default from "../_util/hooks/useUniqueMemo.js";
6
- import useCSP_default from "../hooks/useCSP.js";
7
- import getComponentToken_default from "./getComponentToken.js";
8
- import getCompVarPrefix_default from "./getCompVarPrefix.js";
9
- import statistic_default, { merge } from "./statistic.js";
10
- import getDefaultComponentToken_default from "./getDefaultComponentToken.js";
11
- import maxmin_default from "./maxmin.js";
12
- import "../../index.js";
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
@@ -72,7 +72,7 @@ function genStyleUtils(config) {
72
72
  const concatComponent = cells.join("-");
73
73
  const mergedLayer = config.layer || { name: "antd" };
74
74
  return (prefixCls, rootCls) => {
75
- const { theme, realToken, hashId, token, cssVar, zeroRuntime } = useToken();
75
+ const { theme, hashId, token, cssVar, zeroRuntime } = useToken();
76
76
  if (computed(() => {
77
77
  return zeroRuntime?.value;
78
78
  }).value) return hashId;
@@ -127,14 +127,14 @@ function genStyleUtils(config) {
127
127
  };
128
128
  }), () => {
129
129
  if (options.injectStyle === false) return [];
130
- const { token: proxyToken, flush } = statistic_default(token);
131
- const defaultComponentToken = getDefaultComponentToken_default(component, realToken.value, getDefaultToken);
130
+ const { token: proxyToken, flush } = statistic_default(token.value);
131
+ const defaultComponentToken = getDefaultComponentToken_default(component, proxyToken, getDefaultToken);
132
132
  const componentCls = `.${prefixCls.value}`;
133
- const componentToken = getComponentToken_default(component, realToken.value, defaultComponentToken, { deprecatedTokens: options.deprecatedTokens });
133
+ const componentToken = getComponentToken_default(component, proxyToken, defaultComponentToken, { deprecatedTokens: options.deprecatedTokens });
134
134
  if (defaultComponentToken && typeof defaultComponentToken === "object") Object.keys(defaultComponentToken).forEach((key) => {
135
135
  defaultComponentToken[key] = `var(${token2CSSVar(key, getCompVarPrefix_default(component, cssVar?.value?.prefix))})`;
136
136
  });
137
- const mergedToken = merge(proxyToken.value, {
137
+ const mergedToken = merge(proxyToken, {
138
138
  componentCls,
139
139
  prefixCls: prefixCls.value,
140
140
  iconCls: `.${prefix.value.iconPrefixCls}`,
@@ -1,4 +1,4 @@
1
- import { merge } from "./statistic.js";
1
+ import { merge } from "./statistic.mjs";
2
2
 
3
3
  //#region src/cssinjs-utils/util/getDefaultComponentToken.ts
4
4
  function getDefaultComponentToken(component, token, getDefaultToken) {
@@ -1,4 +1,4 @@
1
- import { unit } from "../../util/index.js";
1
+ import { unit } from "../../util/index.mjs";
2
2
 
3
3
  //#region src/cssinjs-utils/util/maxmin.ts
4
4
  function genMaxMin(type) {
@@ -1,4 +1,4 @@
1
- import { TokenMap } from "../interface/components.js";
1
+ import { TokenMap } from "../interface/components.mjs";
2
2
 
3
3
  //#region src/cssinjs-utils/util/statistic.d.ts
4
4
  declare function merge<CompTokenMap extends TokenMap>(...objs: Partial<CompTokenMap>[]): CompTokenMap;
@@ -1,6 +1,6 @@
1
- import { Entity } from "./Cache.js";
2
- import { ExtractStyle } from "./hooks/useGlobalCache.js";
3
- import { CSSVarCacheValue } from "./hooks/useCSSVarRegister.js";
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.js";
2
- import { TOKEN_PREFIX, extract } from "./hooks/useCacheToken.js";
3
- import { ATTR_CACHE_MAP, serialize } from "./util/cacheMapUtil.js";
4
- import { STYLE_PREFIX, extract as extract$2 } from "./hooks/useStyleRegister.js";
5
- import { CSS_VAR_PREFIX, extract as extract$1 } from "./hooks/useCSSVarRegister.js";
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$2,
9
+ [STYLE_PREFIX]: extract$1,
10
10
  [TOKEN_PREFIX]: extract,
11
- [CSS_VAR_PREFIX]: extract$1
11
+ [CSS_VAR_PREFIX]: extract$2
12
12
  };
13
13
  function isNotNull(value) {
14
14
  return value !== null;
@@ -19,7 +19,7 @@ function extractStyle(cache, options) {
19
19
  "token",
20
20
  "cssVar"
21
21
  ], once = false } = typeof options === "boolean" ? { plain: options } : options || {};
22
- const matchPrefixRegexp = /* @__PURE__ */ new RegExp(`^(${(typeof types === "string" ? [types] : types).join("|")})%`);
22
+ const matchPrefixRegexp = new RegExp(`^(${(typeof types === "string" ? [types] : types).join("|")})%`);
23
23
  const styleKeys = Array.from(cache.cache.keys()).filter((key) => matchPrefixRegexp.test(key));
24
24
  const effectStyles = {};
25
25
  const cachePathMap = {};
@@ -1,5 +1,5 @@
1
- import "./useGlobalCache.js";
2
- import { TokenWithCSSVar } from "../util/css-variables.js";
1
+ import "./useGlobalCache.mjs";
2
+ import { TokenWithCSSVar } from "../util/css-variables.mjs";
3
3
  import { Ref } from "vue";
4
4
 
5
5
  //#region src/hooks/useCSSVarRegister.d.ts
@@ -1,9 +1,9 @@
1
- import { collectStyleText } from "../ssr/styleCollector.js";
2
- import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.js";
3
- import { transformToken } from "../util/css-variables.js";
4
- import { isClientSide, toStyleStr } from "../util/index.js";
5
- import { useGlobalCache } from "./useGlobalCache.js";
6
- import { uniqueHash } from "./useStyleRegister.js";
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,5 +1,5 @@
1
- import { Theme } from "../theme/Theme.js";
2
- import "./useGlobalCache.js";
1
+ import { Theme } from "../theme/Theme.mjs";
2
+ import "./useGlobalCache.mjs";
3
3
  import { Ref } from "vue";
4
4
 
5
5
  //#region src/hooks/useCacheToken.d.ts
@@ -33,16 +33,11 @@ interface Option<DerivativeToken, DesignToken> {
33
33
  * Transform token to css variables.
34
34
  */
35
35
  cssVar: {
36
- hashed?: boolean;
37
- /** Prefix for css variables */
38
- prefix?: string;
39
- /** Tokens that should not be appended with unit */
40
- unitless?: Record<string, boolean>;
41
- /** Tokens that should not be transformed to css variables */
42
- ignore?: Record<string, boolean>;
43
- /** Tokens that preserves origin value */
44
- preserve?: Record<string, boolean>;
45
- /** Key for current theme. Useful for customizing and should be unique */
36
+ hashed?: boolean; /** Prefix for css variables */
37
+ prefix?: string; /** Tokens that should not be appended with unit */
38
+ unitless?: Record<string, boolean>; /** Tokens that should not be transformed to css variables */
39
+ ignore?: Record<string, boolean>; /** Tokens that preserves origin value */
40
+ preserve?: Record<string, boolean>; /** Key for current theme. Useful for customizing and should be unique */
46
41
  key: string;
47
42
  };
48
43
  }
@@ -1,9 +1,9 @@
1
- import { collectStyleText } from "../ssr/styleCollector.js";
2
- import { ATTR_MARK, ATTR_TOKEN, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.js";
3
- import { transformToken } from "../util/css-variables.js";
4
- import { flattenToken, memoResult, toStyleStr, token2key } from "../util/index.js";
5
- import { useGlobalCache } from "./useGlobalCache.js";
6
- import hash from "@emotion/hash";
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,7 +85,7 @@ 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 = hash(mergedSalt);
88
+ const hashId = resolveHash_default(mergedSalt);
89
89
  const hashCls = `${hashPrefix}-${hashId}`;
90
90
  actualToken._tokenKey = token2key(actualToken, mergedSalt);
91
91
  const [tokenWithCssVar, cssVarsStr] = transformToken(mergedDerivativeToken, cssVar.value.key, {
@@ -118,7 +118,7 @@ function useCacheToken(theme, tokens, option) {
118
118
  return;
119
119
  }
120
120
  if (!cssVarsStr) return;
121
- const style = updateCSS(cssVarsStr, hash(`css-var-${themeKey}`), {
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,5 +1,6 @@
1
- import { pathKey } from "../Cache.js";
2
- import { useStyleContext } from "../StyleContext.js";
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
@@ -48,7 +49,9 @@ function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect)
48
49
  });
49
50
  }
50
51
  const globalCache = styleContext.value.cache;
52
+ const isServerSide = styleContext.value.mock !== void 0 ? styleContext.value.mock === "server" : !isClientSide;
51
53
  onCleanup(() => {
54
+ if (isServerSide) return;
52
55
  globalCache.opUpdate(currentPath, (prevCache) => {
53
56
  const [times = 0, cache] = prevCache || [];
54
57
  if (times - 1 === 0) {
@@ -1,9 +1,9 @@
1
- import { Theme } from "../theme/Theme.js";
2
- import { Keyframe } from "../Keyframes.js";
3
- import "../linters/index.js";
4
- import "../StyleContext.js";
5
- import "../transformers/interface.js";
6
- import "./useGlobalCache.js";
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,14 +1,14 @@
1
- import { ATTR_CACHE_PATH, ATTR_MARK, CSS_IN_JS_INSTANCE, useStyleContext } from "../StyleContext.js";
2
- import { isClientSide, isNonNullable, toStyleStr, where } from "../util/index.js";
3
- import { useGlobalCache } from "./useGlobalCache.js";
4
- import contentQuotesLinter_default from "../linters/contentQuotesLinter.js";
5
- import hashedAnimationLinter_default from "../linters/hashedAnimationLinter.js";
6
- import "../linters/index.js";
7
- import { CSS_FILE_STYLE, existPath, getStyleAndHash } from "../util/cacheMapUtil.js";
8
- import hash from "@emotion/hash";
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
+ import resolveUnitless_default from "../util/resolveUnitless.mjs";
9
10
  import { removeCSS, updateCSS } from "@v-c/util/dist/Dom/dynamicCSS";
10
11
  import { computed } from "vue";
11
- import unitless from "@emotion/unitless";
12
12
  import { compile, middleware, prefixer, serialize, stringify } from "stylis";
13
13
 
14
14
  //#region src/hooks/useStyleRegister.ts
@@ -101,7 +101,7 @@ function parseStyle(interpolation, config = {}, { root, injectHash, parentSelect
101
101
  }));
102
102
  const styleName = cssKey.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
103
103
  let formatValue = cssValue;
104
- if (!unitless[cssKey] && typeof formatValue === "number" && formatValue !== 0) formatValue = `${formatValue}px`;
104
+ if (!resolveUnitless_default[cssKey] && typeof formatValue === "number" && formatValue !== 0) formatValue = `${formatValue}px`;
105
105
  if (cssKey === "animationName" && cssValue?._keyframe) {
106
106
  parseKeyframes(cssValue);
107
107
  formatValue = cssValue.getName(hashId);
@@ -125,7 +125,7 @@ function parseStyle(interpolation, config = {}, { root, injectHash, parentSelect
125
125
  return [styleStr, effectStyle];
126
126
  }
127
127
  function uniqueHash(path, styleStr) {
128
- return hash(`${path.join("%")}${styleStr}`);
128
+ return resolveHash_default(`${path.join("%")}${styleStr}`);
129
129
  }
130
130
  const STYLE_PREFIX = "style";
131
131
  function useStyleRegister(info, styleFn) {
@@ -180,11 +180,11 @@ function useStyleRegister(info, styleFn) {
180
180
  }, (cacheValue) => {
181
181
  const [styleStr, styleId, effectStyle, , priority] = cacheValue;
182
182
  if (!isMergedClientSide.value || styleStr === CSS_FILE_STYLE) return;
183
- const { layer: enableLayer$1, container, autoPrefix, cache } = styleContext.value;
183
+ const { layer: enableLayer, container, autoPrefix, cache } = styleContext.value;
184
184
  const { nonce } = info.value;
185
185
  const mergedCSSConfig = {
186
186
  mark: ATTR_MARK,
187
- prepend: enableLayer$1 ? false : "queue",
187
+ prepend: enableLayer ? false : "queue",
188
188
  attachTo: container,
189
189
  priority
190
190
  };
@@ -1,31 +1,31 @@
1
- import { AbstractCalculator } from "./theme/calc/calculator.js";
2
- import { genCalc } from "./theme/calc/index.js";
3
- import { DerivativeFunc, TokenType } from "./theme/interface.js";
4
- import { Theme } from "./theme/Theme.js";
5
- import { createTheme } from "./theme/createTheme.js";
6
- import { ComponentToken, ComponentTokenKey, GlobalToken, GlobalTokenWithComponent, OverrideTokenMap, TokenMap, TokenMapKey } from "./cssinjs-utils/interface/components.js";
7
- import { Keyframe } from "./Keyframes.js";
8
- import { Linter } from "./linters/interface.js";
9
- import { linter as linter$1 } from "./linters/legacyNotSelectorLinter.js";
10
- import { linter as linter$2 } from "./linters/logicalPropertiesLinter.js";
11
- import { linter } from "./linters/NaNLinter.js";
12
- import { linter as linter$3 } from "./linters/parentSelectorLinter.js";
13
- import "./linters/index.js";
14
- import { StyleProvider, StyleProviderProps, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.js";
15
- import { Transformer } from "./transformers/interface.js";
16
- import { CSSInterpolation, CSSObject, useStyleRegister } from "./hooks/useStyleRegister.js";
17
- import { token2CSSVar } from "./util/css-variables.js";
18
- import { useCSSVarRegister } from "./hooks/useCSSVarRegister.js";
19
- import { extractStyle } from "./extractStyle.js";
20
- import { getComputedToken, useCacheToken } from "./hooks/useCacheToken.js";
21
- import { collectStyleText, setStyleCollector } from "./ssr/styleCollector.js";
22
- import { transform } from "./transformers/autoPrefix.js";
23
- import { transform as transform$1 } from "./transformers/legacyLogicalProperties.js";
24
- import { transform as transform$2 } from "./transformers/px2rem.js";
25
- import { unit } from "./util/index.js";
26
- import { CSSUtil, CSSVarRegisterProps, FullToken, GenStyleFn, GetCompUnitless, GetDefaultToken, GetDefaultTokenFn, GetResetStyles, StyleInfo, SubStyleComponentProps, TokenWithCommonCls, genStyleUtils } from "./cssinjs-utils/util/genStyleUtils.js";
27
- import { merge, statistic, statisticToken } from "./cssinjs-utils/util/statistic.js";
28
- import "./cssinjs-utils/index.js";
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.js";
2
- import autoPrefix_default from "./transformers/autoPrefix.js";
3
- import { StyleProvider, createCache, provideStyleContext, useStyleContext, useStyleContextProvide } from "./StyleContext.js";
4
- import calc_default from "./theme/calc/index.js";
5
- import Theme from "./theme/Theme.js";
6
- import createTheme from "./theme/createTheme.js";
7
- import "./theme/index.js";
8
- import { token2CSSVar } from "./util/css-variables.js";
9
- import { supportLogicProps, supportWhere, unit } from "./util/index.js";
10
- import useCacheToken, { getComputedToken } from "./hooks/useCacheToken.js";
11
- import legacyNotSelectorLinter_default from "./linters/legacyNotSelectorLinter.js";
12
- import logicalPropertiesLinter_default from "./linters/logicalPropertiesLinter.js";
13
- import NaNLinter_default from "./linters/NaNLinter.js";
14
- import parentSelectorLinter_default from "./linters/parentSelectorLinter.js";
15
- import "./linters/index.js";
16
- import useStyleRegister from "./hooks/useStyleRegister.js";
17
- import useCSSVarRegister from "./hooks/useCSSVarRegister.js";
18
- import extractStyle from "./extractStyle.js";
19
- import Keyframes_default from "./Keyframes.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";
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() };
@@ -1,4 +1,4 @@
1
- import { Linter } from "./interface.js";
1
+ import { Linter } from "./interface.mjs";
2
2
 
3
3
  //#region src/linters/NaNLinter.d.ts
4
4
  declare const linter: Linter;
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/NaNLinter.ts
4
4
  const linter = (key, value, info) => {
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/contentQuotesLinter.ts
4
4
  const linter = (key, value, info) => {
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/hashedAnimationLinter.ts
4
4
  const linter = (key, value, info) => {
@@ -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.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";
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,4 +1,4 @@
1
- import { Linter } from "./interface.js";
1
+ import { Linter } from "./interface.mjs";
2
2
 
3
3
  //#region src/linters/legacyNotSelectorLinter.d.ts
4
4
  declare const linter: Linter;
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/legacyNotSelectorLinter.ts
4
4
  function isConcatSelector(selector) {
@@ -1,4 +1,4 @@
1
- import { Linter } from "./interface.js";
1
+ import { Linter } from "./interface.mjs";
2
2
 
3
3
  //#region src/linters/logicalPropertiesLinter.d.ts
4
4
  declare const linter: Linter;
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/logicalPropertiesLinter.ts
4
4
  const linter = (key, value, info) => {
@@ -1,5 +1,5 @@
1
- import { Linter } from "./interface.js";
2
- import "../index.js";
1
+ import { Linter } from "./interface.mjs";
2
+ import "../index.mjs";
3
3
 
4
4
  //#region src/linters/parentSelectorLinter.d.ts
5
5
  declare const linter: Linter;
@@ -1,4 +1,4 @@
1
- import { lintWarning } from "./utils.js";
1
+ import { lintWarning } from "./utils.mjs";
2
2
 
3
3
  //#region src/linters/parentSelectorLinter.ts
4
4
  const linter = (_key, _value, info) => {
@@ -1,7 +1,6 @@
1
- import { DerivativeFunc, TokenType } from "./interface.js";
1
+ import { DerivativeFunc, TokenType } from "./interface.mjs";
2
2
 
3
3
  //#region src/theme/Theme.d.ts
4
-
5
4
  /**
6
5
  * Theme with algorithms to derive tokens from design tokens.
7
6
  * Use `createTheme` first which will help to manage the theme instance cache.
@@ -1,4 +1,4 @@
1
- import { AbstractCalculator } from "./calculator.js";
1
+ import { AbstractCalculator } from "./calculator.mjs";
2
2
 
3
3
  //#region src/theme/calc/CSSCalculator.d.ts
4
4
  declare class CSSCalculator extends AbstractCalculator {
@@ -1,4 +1,4 @@
1
- import calculator_default from "./calculator.js";
1
+ import calculator_default from "./calculator.mjs";
2
2
 
3
3
  //#region src/theme/calc/CSSCalculator.ts
4
4
  const CALC_UNIT = "CALC_UNIT";
@@ -1,4 +1,4 @@
1
- import { AbstractCalculator } from "./calculator.js";
1
+ import { AbstractCalculator } from "./calculator.mjs";
2
2
 
3
3
  //#region src/theme/calc/NumCalculator.d.ts
4
4
  declare class NumCalculator extends AbstractCalculator {
@@ -1,4 +1,4 @@
1
- import calculator_default from "./calculator.js";
1
+ import calculator_default from "./calculator.mjs";
2
2
 
3
3
  //#region src/theme/calc/NumCalculator.ts
4
4
  var NumCalculator = class NumCalculator extends calculator_default {
@@ -1,6 +1,6 @@
1
- import { AbstractCalculator } from "./calculator.js";
2
- import { CSSCalculator } from "./CSSCalculator.js";
3
- import { NumCalculator } from "./NumCalculator.js";
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.js";
2
- import NumCalculator from "./NumCalculator.js";
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,8 +1,7 @@
1
- import { DerivativeFunc, TokenType } from "./interface.js";
2
- import { Theme } from "./Theme.js";
1
+ import { DerivativeFunc, TokenType } from "./interface.mjs";
2
+ import { Theme } from "./Theme.mjs";
3
3
 
4
4
  //#region src/theme/createTheme.d.ts
5
-
6
5
  /**
7
6
  * Same as new Theme, but will always return same one if `derivative` not changed.
8
7
  */
@@ -1,5 +1,5 @@
1
- import Theme from "./Theme.js";
2
- import ThemeCache from "./ThemeCache.js";
1
+ import Theme from "./Theme.mjs";
2
+ import ThemeCache from "./ThemeCache.mjs";
3
3
 
4
4
  //#region src/theme/createTheme.ts
5
5
  const cacheThemes = new ThemeCache();
@@ -0,0 +1,6 @@
1
+ import calc_default from "./calc/index.mjs";
2
+ import Theme from "./Theme.mjs";
3
+ import ThemeCache from "./ThemeCache.mjs";
4
+ import createTheme from "./createTheme.mjs";
5
+
6
+ export { };
@@ -1,4 +1,4 @@
1
- import { Transformer } from "./interface.js";
1
+ import { Transformer } from "./interface.mjs";
2
2
 
3
3
  //#region src/transformers/autoPrefix.d.ts
4
4
  declare const transform: Transformer;
@@ -1,5 +1,5 @@
1
- import { CSSObject } from "../hooks/useStyleRegister.js";
2
- import "../index.js";
1
+ import { CSSObject } from "../hooks/useStyleRegister.mjs";
2
+ import "../index.mjs";
3
3
 
4
4
  //#region src/transformers/interface.d.ts
5
5
  interface Transformer {
@@ -1,7 +1,6 @@
1
- import { Transformer } from "./interface.js";
1
+ import { Transformer } from "./interface.mjs";
2
2
 
3
3
  //#region src/transformers/legacyLogicalProperties.d.ts
4
-
5
4
  /**
6
5
  * Convert css logical properties to legacy properties.
7
6
  * Such as: `margin-block-start` to `margin-top`.
@@ -1,4 +1,4 @@
1
- import { Transformer } from "./interface.js";
1
+ import { Transformer } from "./interface.mjs";
2
2
 
3
3
  //#region src/transformers/px2rem.d.ts
4
4
  interface Options {
@@ -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,4 +1,4 @@
1
- import { ATTR_MARK } from "../StyleContext.js";
1
+ import { ATTR_MARK } from "../StyleContext.mjs";
2
2
  import canUseDom from "@v-c/util/dist/Dom/canUseDom";
3
3
 
4
4
  //#region src/util/cacheMapUtil.ts
@@ -8,9 +8,9 @@ const ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path";
8
8
  * Which means not exist in `<style />` tag.
9
9
  */
10
10
  const CSS_FILE_STYLE = "_FILE_STYLE__";
11
- function serialize(cachePathMap$1) {
12
- return Object.keys(cachePathMap$1).map((path) => {
13
- return `${path}:${cachePathMap$1[path]}`;
11
+ function serialize(cachePathMap) {
12
+ return Object.keys(cachePathMap).map((path) => {
13
+ return `${path}:${cachePathMap[path]}`;
14
14
  }).join(";");
15
15
  }
16
16
  let cachePathMap;
@@ -1,4 +1,4 @@
1
- import "../StyleContext.js";
1
+ import "../StyleContext.mjs";
2
2
 
3
3
  //#region src/util/css-variables.d.ts
4
4
  declare function token2CSSVar(token: string, prefix?: string): string;
@@ -1,4 +1,4 @@
1
- import { where } from "./index.js";
1
+ import { where } from "./index.mjs";
2
2
 
3
3
  //#region src/util/css-variables.ts
4
4
  function token2CSSVar(token, prefix = "") {
@@ -0,0 +1,7 @@
1
+ import "../StyleContext.mjs";
2
+ import { token2CSSVar } from "./css-variables.mjs";
3
+
4
+ //#region src/util/index.d.ts
5
+ declare function unit(num: string | number): string;
6
+ //#endregion
7
+ export { unit };
@@ -1,8 +1,8 @@
1
- import { ATTR_MARK, ATTR_TOKEN } from "../StyleContext.js";
2
- import Theme from "../theme/Theme.js";
3
- import "../theme/index.js";
4
- import { token2CSSVar } from "./css-variables.js";
5
- import hash from "@emotion/hash";
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 = hash(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 hash(`${salt}_${flattenToken(token)}`);
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_";
@@ -0,0 +1,7 @@
1
+ import hash from "@emotion/hash";
2
+
3
+ //#region src/util/resolveHash.ts
4
+ var resolveHash_default = (src) => hash.default && typeof hash.default === "function" ? hash.default(src) : hash(src);
5
+
6
+ //#endregion
7
+ export { resolveHash_default as default };
@@ -0,0 +1,7 @@
1
+ import unitless from "@emotion/unitless";
2
+
3
+ //#region src/util/resolveUnitless.ts
4
+ var resolveUnitless_default = unitless.default ? unitless.default : unitless;
5
+
6
+ //#endregion
7
+ export { resolveUnitless_default as default };
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-beta.1",
4
+ "version": "1.0.0-rc.1",
5
5
  "description": "cssinjs solution for ant-design-vue",
6
6
  "exports": {
7
7
  ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js",
10
- "default": "./dist/index.js"
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.ts",
14
- "import": "./dist/cssinjs-utils/index.js",
15
- "default": "./dist/cssinjs-utils/index.js"
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.ts",
19
- "import": "./dist/*.js",
20
- "default": "./dist/*.js"
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.8",
33
+ "@v-c/util": "^1.0.9",
34
34
  "csstype": "^3.2.3",
35
35
  "defu": "^6.1.4",
36
36
  "stylis": "^4.3.6"
37
37
  },
38
38
  "devDependencies": {
39
- "@testing-library/jest-dom": "^5.17.0",
40
- "@types/node": "^24.10.3",
39
+ "@testing-library/jest-dom": "^6.9.1",
40
+ "@types/node": "^25.0.10",
41
41
  "@types/stylis": "^4.2.7",
42
- "@types/testing-library__jest-dom": "^5.14.9",
42
+ "@types/testing-library__jest-dom": "^6.0.0",
43
43
  "@vue/test-utils": "^2.4.6",
44
- "vue": "^3.5.25"
44
+ "vue": "^3.5.27"
45
45
  },
46
46
  "scripts": {
47
47
  "test": "vitest run",
@@ -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";
@@ -1,6 +0,0 @@
1
- import calc_default from "./calc/index.js";
2
- import Theme from "./Theme.js";
3
- import ThemeCache from "./ThemeCache.js";
4
- import createTheme from "./createTheme.js";
5
-
6
- export { };
@@ -1,8 +0,0 @@
1
- import "../StyleContext.js";
2
- import { token2CSSVar } from "./css-variables.js";
3
-
4
- //#region src/util/index.d.ts
5
-
6
- declare function unit(num: string | number): string;
7
- //#endregion
8
- export { unit };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes