@antdv-next/cssinjs 0.0.2 → 1.0.0-alpha.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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -141
  3. package/dist/Cache.d.ts +22 -0
  4. package/dist/Cache.js +45 -0
  5. package/dist/Keyframes.d.ts +12 -0
  6. package/dist/Keyframes.js +17 -0
  7. package/dist/StyleContext.d.ts +118 -0
  8. package/dist/StyleContext.js +64 -0
  9. package/dist/cssinjs-utils/_util/hooks/useUniqueMemo.js +62 -0
  10. package/dist/cssinjs-utils/hooks/useCSP.d.ts +8 -0
  11. package/dist/cssinjs-utils/hooks/useCSP.js +8 -0
  12. package/dist/cssinjs-utils/hooks/usePrefix.d.ts +9 -0
  13. package/dist/cssinjs-utils/hooks/useToken.d.ts +25 -0
  14. package/dist/cssinjs-utils/index.d.ts +4 -0
  15. package/dist/cssinjs-utils/index.js +4 -0
  16. package/dist/cssinjs-utils/interface/components.d.ts +12 -0
  17. package/dist/cssinjs-utils/util/genStyleUtils.d.ts +127 -0
  18. package/dist/cssinjs-utils/util/genStyleUtils.js +188 -0
  19. package/dist/cssinjs-utils/util/getCompVarPrefix.js +8 -0
  20. package/dist/cssinjs-utils/util/getComponentToken.js +22 -0
  21. package/dist/cssinjs-utils/util/getDefaultComponentToken.js +11 -0
  22. package/dist/cssinjs-utils/util/maxmin.js +17 -0
  23. package/dist/cssinjs-utils/util/statistic.d.ts +15 -0
  24. package/dist/cssinjs-utils/util/statistic.js +52 -0
  25. package/dist/extractStyle.d.ts +18 -0
  26. package/dist/extractStyle.js +54 -0
  27. package/dist/hooks/useCSSVarRegister.d.ts +19 -0
  28. package/dist/hooks/useCSSVarRegister.js +74 -0
  29. package/dist/hooks/useCacheToken.d.ts +60 -0
  30. package/dist/hooks/useCacheToken.js +120 -0
  31. package/dist/hooks/useGlobalCache.d.ts +9 -0
  32. package/dist/hooks/useGlobalCache.js +70 -0
  33. package/dist/hooks/useStyleRegister.d.ts +47 -0
  34. package/dist/hooks/useStyleRegister.js +237 -0
  35. package/dist/index.d.ts +34 -0
  36. package/dist/index.js +29 -0
  37. package/dist/linters/NaNLinter.d.ts +6 -0
  38. package/dist/linters/NaNLinter.js +10 -0
  39. package/dist/linters/contentQuotesLinter.js +18 -0
  40. package/dist/linters/hashedAnimationLinter.js +12 -0
  41. package/dist/linters/index.d.ts +5 -0
  42. package/dist/linters/index.js +8 -0
  43. package/dist/linters/interface.d.ts +11 -0
  44. package/dist/linters/legacyNotSelectorLinter.d.ts +6 -0
  45. package/dist/linters/legacyNotSelectorLinter.js +20 -0
  46. package/dist/linters/logicalPropertiesLinter.d.ts +6 -0
  47. package/dist/linters/logicalPropertiesLinter.js +57 -0
  48. package/dist/linters/parentSelectorLinter.d.ts +7 -0
  49. package/dist/linters/parentSelectorLinter.js +12 -0
  50. package/dist/linters/utils.js +10 -0
  51. package/dist/theme/Theme.d.ts +16 -0
  52. package/dist/theme/Theme.js +24 -0
  53. package/dist/theme/ThemeCache.js +79 -0
  54. package/dist/theme/calc/CSSCalculator.d.ts +19 -0
  55. package/dist/theme/calc/CSSCalculator.js +63 -0
  56. package/dist/theme/calc/NumCalculator.d.ts +14 -0
  57. package/dist/theme/calc/NumCalculator.js +37 -0
  58. package/dist/theme/calc/calculator.d.ts +32 -0
  59. package/dist/theme/calc/calculator.js +6 -0
  60. package/dist/theme/calc/index.d.ts +8 -0
  61. package/dist/theme/calc/index.js +12 -0
  62. package/dist/theme/createTheme.d.ts +11 -0
  63. package/dist/theme/createTheme.js +16 -0
  64. package/dist/theme/index.js +6 -0
  65. package/dist/theme/interface.d.ts +5 -0
  66. package/dist/transformers/autoPrefix.d.ts +6 -0
  67. package/dist/transformers/autoPrefix.js +7 -0
  68. package/dist/transformers/interface.d.ts +9 -0
  69. package/dist/transformers/legacyLogicalProperties.d.ts +16 -0
  70. package/dist/transformers/legacyLogicalProperties.js +123 -0
  71. package/dist/transformers/px2rem.d.ts +23 -0
  72. package/dist/transformers/px2rem.js +37 -0
  73. package/dist/util/cacheMapUtil.js +60 -0
  74. package/dist/util/css-variables.d.ts +7 -0
  75. package/dist/util/css-variables.js +35 -0
  76. package/dist/util/index.d.ts +8 -0
  77. package/dist/util/index.js +108 -0
  78. package/package.json +33 -63
  79. package/dist/cssinjs.umd.js +0 -3
  80. package/es/Cache.js +0 -33
  81. package/es/Keyframes.js +0 -14
  82. package/es/StyleContext.js +0 -100
  83. package/es/extractStyle.js +0 -43
  84. package/es/hooks/useCSSVarRegister.js +0 -59
  85. package/es/hooks/useCacheToken.js +0 -106
  86. package/es/hooks/useEffectCleanupRegister.js +0 -8
  87. package/es/hooks/useGlobalCache.js +0 -41
  88. package/es/hooks/useHMR.js +0 -20
  89. package/es/hooks/useStyleRegister.js +0 -216
  90. package/es/index.js +0 -44
  91. package/es/linters/NaNLinter.js +0 -7
  92. package/es/linters/contentQuotesLinter.js +0 -13
  93. package/es/linters/hashedAnimationLinter.js +0 -10
  94. package/es/linters/legacyNotSelectorLinter.js +0 -14
  95. package/es/linters/logicalPropertiesLinter.js +0 -61
  96. package/es/linters/parentSelectorLinter.js +0 -7
  97. package/es/linters/utils.js +0 -11
  98. package/es/theme/Theme.js +0 -21
  99. package/es/theme/ThemeCache.js +0 -74
  100. package/es/theme/calc/CSSCalculator.js +0 -40
  101. package/es/theme/calc/NumCalculator.js +0 -25
  102. package/es/theme/calc/calculator.js +0 -5
  103. package/es/theme/calc/index.js +0 -9
  104. package/es/theme/createTheme.js +0 -10
  105. package/es/transformers/legacyLogicalProperties.js +0 -108
  106. package/es/transformers/px2rem.js +0 -32
  107. package/es/util/cacheMapUtil.js +0 -48
  108. package/es/util/css-variables.js +0 -22
  109. package/es/util/index.js +0 -85
  110. package/lib/Cache.js +0 -1
  111. package/lib/Keyframes.js +0 -1
  112. package/lib/StyleContext.js +0 -1
  113. package/lib/extractStyle.js +0 -1
  114. package/lib/hooks/useCSSVarRegister.js +0 -1
  115. package/lib/hooks/useCacheToken.js +0 -1
  116. package/lib/hooks/useEffectCleanupRegister.js +0 -1
  117. package/lib/hooks/useGlobalCache.js +0 -1
  118. package/lib/hooks/useHMR.js +0 -1
  119. package/lib/hooks/useStyleRegister.js +0 -3
  120. package/lib/index.js +0 -1
  121. package/lib/linters/NaNLinter.js +0 -1
  122. package/lib/linters/contentQuotesLinter.js +0 -1
  123. package/lib/linters/hashedAnimationLinter.js +0 -1
  124. package/lib/linters/legacyNotSelectorLinter.js +0 -1
  125. package/lib/linters/logicalPropertiesLinter.js +0 -1
  126. package/lib/linters/parentSelectorLinter.js +0 -1
  127. package/lib/linters/utils.js +0 -1
  128. package/lib/theme/Theme.js +0 -1
  129. package/lib/theme/ThemeCache.js +0 -1
  130. package/lib/theme/calc/CSSCalculator.js +0 -1
  131. package/lib/theme/calc/NumCalculator.js +0 -1
  132. package/lib/theme/calc/calculator.js +0 -1
  133. package/lib/theme/calc/index.js +0 -1
  134. package/lib/theme/createTheme.js +0 -1
  135. package/lib/transformers/legacyLogicalProperties.js +0 -1
  136. package/lib/transformers/px2rem.js +0 -1
  137. package/lib/util/cacheMapUtil.js +0 -1
  138. package/lib/util/css-variables.js +0 -1
  139. package/lib/util/index.js +0 -1
@@ -1,74 +0,0 @@
1
- function u(c, e) {
2
- if (c.length !== e.length)
3
- return !1;
4
- for (let s = 0; s < c.length; s++)
5
- if (c[s] !== e[s])
6
- return !1;
7
- return !0;
8
- }
9
- class n {
10
- static MAX_CACHE_SIZE = 20;
11
- static MAX_CACHE_OFFSET = 5;
12
- cache;
13
- keys;
14
- cacheCallTimes;
15
- constructor() {
16
- this.cache = /* @__PURE__ */ new Map(), this.keys = [], this.cacheCallTimes = 0;
17
- }
18
- size() {
19
- return this.keys.length;
20
- }
21
- internalGet(e, s = !1) {
22
- let t = { map: this.cache };
23
- return e.forEach((a) => {
24
- t ? t = t?.map?.get(a) : t = void 0;
25
- }), t?.value && s && (t.value[1] = this.cacheCallTimes++), t?.value;
26
- }
27
- get(e) {
28
- return this.internalGet(e, !0)?.[0];
29
- }
30
- has(e) {
31
- return !!this.internalGet(e);
32
- }
33
- set(e, s) {
34
- if (!this.has(e)) {
35
- if (this.size() + 1 > n.MAX_CACHE_SIZE + n.MAX_CACHE_OFFSET) {
36
- const [a] = this.keys.reduce(
37
- (h, l) => {
38
- const [, i] = h;
39
- return this.internalGet(l)[1] < i ? [l, this.internalGet(l)[1]] : h;
40
- },
41
- [this.keys[0], this.cacheCallTimes]
42
- );
43
- this.delete(a);
44
- }
45
- this.keys.push(e);
46
- }
47
- let t = this.cache;
48
- e.forEach((a, h) => {
49
- if (h === e.length - 1)
50
- t.set(a, { value: [s, this.cacheCallTimes++] });
51
- else {
52
- const l = t.get(a);
53
- l ? l.map || (l.map = /* @__PURE__ */ new Map()) : t.set(a, { map: /* @__PURE__ */ new Map() }), t = t.get(a).map;
54
- }
55
- });
56
- }
57
- deleteByPath(e, s) {
58
- const t = e.get(s[0]);
59
- if (s.length === 1)
60
- return t.map ? e.set(s[0], { map: t.map }) : e.delete(s[0]), t.value?.[0];
61
- const a = this.deleteByPath(t.map, s.slice(1));
62
- return (!t.map || t.map.size === 0) && !t.value && e.delete(s[0]), a;
63
- }
64
- delete(e) {
65
- if (this.has(e))
66
- return this.keys = this.keys.filter(
67
- (s) => !u(s, e)
68
- ), this.deleteByPath(this.cache, e);
69
- }
70
- }
71
- export {
72
- n as default,
73
- u as sameDerivativeOption
74
- };
@@ -1,40 +0,0 @@
1
- import h from "./calculator.js";
2
- const u = "CALC_UNIT", f = new RegExp(u, "g");
3
- function l(r) {
4
- return typeof r == "number" ? `${r}${u}` : r;
5
- }
6
- class e extends h {
7
- result = "";
8
- unitlessCssVar;
9
- lowPriority;
10
- constructor(t, i) {
11
- super();
12
- const s = typeof t;
13
- this.unitlessCssVar = i, t instanceof e ? this.result = `(${t.result})` : s === "number" ? this.result = l(t) : s === "string" && (this.result = t);
14
- }
15
- add(t) {
16
- return t instanceof e ? this.result = `${this.result} + ${t.getResult()}` : (typeof t == "number" || typeof t == "string") && (this.result = `${this.result} + ${l(t)}`), this.lowPriority = !0, this;
17
- }
18
- sub(t) {
19
- return t instanceof e ? this.result = `${this.result} - ${t.getResult()}` : (typeof t == "number" || typeof t == "string") && (this.result = `${this.result} - ${l(t)}`), this.lowPriority = !0, this;
20
- }
21
- mul(t) {
22
- return this.lowPriority && (this.result = `(${this.result})`), t instanceof e ? this.result = `${this.result} * ${t.getResult(!0)}` : (typeof t == "number" || typeof t == "string") && (this.result = `${this.result} * ${t}`), this.lowPriority = !1, this;
23
- }
24
- div(t) {
25
- return this.lowPriority && (this.result = `(${this.result})`), t instanceof e ? this.result = `${this.result} / ${t.getResult(!0)}` : (typeof t == "number" || typeof t == "string") && (this.result = `${this.result} / ${t}`), this.lowPriority = !1, this;
26
- }
27
- getResult(t) {
28
- return this.lowPriority || t ? `(${this.result})` : this.result;
29
- }
30
- equal(t) {
31
- const { unit: i } = t || {};
32
- let s = !0;
33
- return typeof i == "boolean" ? s = i : Array.from(this.unitlessCssVar).some(
34
- (o) => this.result.includes(o)
35
- ) && (s = !1), this.result = this.result.replace(f, s ? "px" : ""), typeof this.lowPriority < "u" ? `calc(${this.result})` : this.result;
36
- }
37
- }
38
- export {
39
- e as default
40
- };
@@ -1,25 +0,0 @@
1
- import s from "./calculator.js";
2
- class t extends s {
3
- result = 0;
4
- constructor(e) {
5
- super(), e instanceof t ? this.result = e.result : typeof e == "number" && (this.result = e);
6
- }
7
- add(e) {
8
- return e instanceof t ? this.result += e.result : typeof e == "number" && (this.result += e), this;
9
- }
10
- sub(e) {
11
- return e instanceof t ? this.result -= e.result : typeof e == "number" && (this.result -= e), this;
12
- }
13
- mul(e) {
14
- return e instanceof t ? this.result *= e.result : typeof e == "number" && (this.result *= e), this;
15
- }
16
- div(e) {
17
- return e instanceof t ? this.result /= e.result : typeof e == "number" && (this.result /= e), this;
18
- }
19
- equal() {
20
- return this.result;
21
- }
22
- }
23
- export {
24
- t as default
25
- };
@@ -1,5 +0,0 @@
1
- class t {
2
- }
3
- export {
4
- t as default
5
- };
@@ -1,9 +0,0 @@
1
- import l from "./CSSCalculator.js";
2
- import c from "./NumCalculator.js";
3
- function e(o, r) {
4
- const t = o === "css" ? l : c;
5
- return (a) => new t(a, r);
6
- }
7
- export {
8
- e as default
9
- };
@@ -1,10 +0,0 @@
1
- import m from "./Theme.js";
2
- import o from "./ThemeCache.js";
3
- const t = new o();
4
- function h(r) {
5
- const e = Array.isArray(r) ? r : [r];
6
- return t.has(e) || t.set(e, new m(e)), t.get(e);
7
- }
8
- export {
9
- h as default
10
- };
@@ -1,108 +0,0 @@
1
- function c(e) {
2
- if (typeof e == "number")
3
- return [[e], !1];
4
- const t = String(e).trim(), o = t.match(/(.*)(!important)/), i = (o ? o[1] : t).trim().split(/\s+/);
5
- let r = [], d = 0;
6
- return [
7
- i.reduce((l, n) => {
8
- if (n.includes("(") || n.includes(")")) {
9
- const a = n.split("(").length - 1, g = n.split(")").length - 1;
10
- d += a - g;
11
- }
12
- return d >= 0 && r.push(n), d === 0 && (l.push(r.join(" ")), r = []), l;
13
- }, []),
14
- !!o
15
- ];
16
- }
17
- function b(e) {
18
- return e.notSplit = !0, e;
19
- }
20
- const s = {
21
- // Inset
22
- inset: ["top", "right", "bottom", "left"],
23
- insetBlock: ["top", "bottom"],
24
- insetBlockStart: ["top"],
25
- insetBlockEnd: ["bottom"],
26
- insetInline: ["left", "right"],
27
- insetInlineStart: ["left"],
28
- insetInlineEnd: ["right"],
29
- // Margin
30
- marginBlock: ["marginTop", "marginBottom"],
31
- marginBlockStart: ["marginTop"],
32
- marginBlockEnd: ["marginBottom"],
33
- marginInline: ["marginLeft", "marginRight"],
34
- marginInlineStart: ["marginLeft"],
35
- marginInlineEnd: ["marginRight"],
36
- // Padding
37
- paddingBlock: ["paddingTop", "paddingBottom"],
38
- paddingBlockStart: ["paddingTop"],
39
- paddingBlockEnd: ["paddingBottom"],
40
- paddingInline: ["paddingLeft", "paddingRight"],
41
- paddingInlineStart: ["paddingLeft"],
42
- paddingInlineEnd: ["paddingRight"],
43
- // Border
44
- borderBlock: b(["borderTop", "borderBottom"]),
45
- borderBlockStart: b(["borderTop"]),
46
- borderBlockEnd: b(["borderBottom"]),
47
- borderInline: b(["borderLeft", "borderRight"]),
48
- borderInlineStart: b(["borderLeft"]),
49
- borderInlineEnd: b(["borderRight"]),
50
- // Border width
51
- borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
52
- borderBlockStartWidth: ["borderTopWidth"],
53
- borderBlockEndWidth: ["borderBottomWidth"],
54
- borderInlineWidth: ["borderLeftWidth", "borderRightWidth"],
55
- borderInlineStartWidth: ["borderLeftWidth"],
56
- borderInlineEndWidth: ["borderRightWidth"],
57
- // Border style
58
- borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
59
- borderBlockStartStyle: ["borderTopStyle"],
60
- borderBlockEndStyle: ["borderBottomStyle"],
61
- borderInlineStyle: ["borderLeftStyle", "borderRightStyle"],
62
- borderInlineStartStyle: ["borderLeftStyle"],
63
- borderInlineEndStyle: ["borderRightStyle"],
64
- // Border color
65
- borderBlockColor: ["borderTopColor", "borderBottomColor"],
66
- borderBlockStartColor: ["borderTopColor"],
67
- borderBlockEndColor: ["borderBottomColor"],
68
- borderInlineColor: ["borderLeftColor", "borderRightColor"],
69
- borderInlineStartColor: ["borderLeftColor"],
70
- borderInlineEndColor: ["borderRightColor"],
71
- // Border radius
72
- borderStartStartRadius: ["borderTopLeftRadius"],
73
- borderStartEndRadius: ["borderTopRightRadius"],
74
- borderEndStartRadius: ["borderBottomLeftRadius"],
75
- borderEndEndRadius: ["borderBottomRightRadius"]
76
- };
77
- function p(e, t) {
78
- let o = e;
79
- return t && (o = `${o} !important`), { _skip_check_: !0, value: o };
80
- }
81
- const h = {
82
- visit: (e) => {
83
- const t = {};
84
- return Object.keys(e).forEach((o) => {
85
- const i = e[o], r = s[o];
86
- if (r && (typeof i == "number" || typeof i == "string")) {
87
- const [d, l] = c(i);
88
- r.length && r.notSplit ? r.forEach((n) => {
89
- t[n] = p(i, l);
90
- }) : r.length === 1 ? t[r[0]] = p(d[0], l) : r.length === 2 ? r.forEach((n, a) => {
91
- t[n] = p(
92
- d[a] ?? d[0],
93
- l
94
- );
95
- }) : r.length === 4 ? r.forEach((n, a) => {
96
- t[n] = p(
97
- d[a] ?? d[a - 2] ?? d[0],
98
- l
99
- );
100
- }) : t[o] = i;
101
- } else
102
- t[o] = i;
103
- }), t;
104
- }
105
- };
106
- export {
107
- h as default
108
- };
@@ -1,32 +0,0 @@
1
- import a from "@emotion/unitless";
2
- const l = /url\([^)]+\)|var\([^)]+\)|(\d+(?:\.\d+)?|\.\d+)px/g;
3
- function d(i, s) {
4
- const o = 10 ** (s + 1), c = Math.floor(i * o);
5
- return Math.round(c / 10) * 10 / o;
6
- }
7
- function h(i = {}) {
8
- const { rootValue: s = 16, precision: o = 5, mediaQuery: c = !1 } = i, p = (n, e) => {
9
- if (!e)
10
- return n;
11
- const t = Number.parseFloat(e);
12
- return t <= 1 ? n : `${d(t / s, o)}rem`;
13
- };
14
- return { visit: (n) => {
15
- const e = { ...n };
16
- return Object.entries(n).forEach(([t, r]) => {
17
- if (typeof r == "string" && r.includes("px")) {
18
- const f = r.replace(l, p);
19
- e[t] = f;
20
- }
21
- !a[t] && typeof r == "number" && r !== 0 && (e[t] = `${r}px`.replace(l, p));
22
- const u = t.trim();
23
- if (u.startsWith("@") && u.includes("px") && c) {
24
- const f = t.replace(l, p);
25
- e[f] = e[t], delete e[t];
26
- }
27
- }), e;
28
- } };
29
- }
30
- export {
31
- h as default
32
- };
@@ -1,48 +0,0 @@
1
- import s from "@v-c/util/dist/Dom/canUseDom";
2
- import { ATTR_MARK as d } from "../StyleContext.js";
3
- const l = "data-ant-cssinjs-cache-path", u = "_FILE_STYLE__";
4
- function y(e) {
5
- return Object.keys(e).map((t) => {
6
- const n = e[t];
7
- return `${t}:${n}`;
8
- }).join(";");
9
- }
10
- let o, c = !0;
11
- function m() {
12
- if (!o && (o = {}, s())) {
13
- const e = document.createElement("div");
14
- e.className = l, e.style.position = "fixed", e.style.visibility = "hidden", e.style.top = "-9999px", document.body.appendChild(e);
15
- let t = getComputedStyle(e).content || "";
16
- t = t.replace(/^"/, "").replace(/"$/, ""), t.split(";").forEach((i) => {
17
- const [r, a] = i.split(":");
18
- o[r] = a;
19
- });
20
- const n = document.querySelector(`style[${l}]`);
21
- n && (c = !1, n.parentNode?.removeChild(n)), document.body.removeChild(e);
22
- }
23
- }
24
- function h(e) {
25
- return m(), !!o[e];
26
- }
27
- function S(e) {
28
- const t = o[e];
29
- let n = null;
30
- if (t && s())
31
- if (c)
32
- n = u;
33
- else {
34
- const i = document.querySelector(
35
- `style[${d}="${o[e]}"]`
36
- );
37
- i ? n = i.innerHTML : delete o[e];
38
- }
39
- return [n, t];
40
- }
41
- export {
42
- l as ATTR_CACHE_MAP,
43
- u as CSS_FILE_STYLE,
44
- h as existPath,
45
- S as getStyleAndHash,
46
- m as prepare,
47
- y as serialize
48
- };
@@ -1,22 +0,0 @@
1
- function p(r, t = "") {
2
- return `--${t ? `${t}-` : ""}${r}`.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, "$1-$2").replace(/([a-z])([A-Z0-9])/g, "$1-$2").toLowerCase();
3
- }
4
- function a(r, t, e) {
5
- return Object.keys(r).length ? `.${t}${e?.scope ? `.${e.scope}` : ""}{${Object.entries(r).map(([o, $]) => `${o}:${$};`).join("")}}` : "";
6
- }
7
- function i(r, t, e) {
8
- const o = {}, $ = {};
9
- return Object.entries(r).forEach(([n, s]) => {
10
- if (e?.preserve?.[n])
11
- $[n] = s;
12
- else if ((typeof s == "string" || typeof s == "number") && !e?.ignore?.[n]) {
13
- const c = p(n, e?.prefix);
14
- o[c] = typeof s == "number" && !e?.unitless?.[n] ? `${s}px` : String(s), $[n] = `var(${c})`;
15
- }
16
- }), [$, a(o, t, { scope: e?.scope })];
17
- }
18
- export {
19
- a as serializeCSSVar,
20
- p as token2CSSVar,
21
- i as transformToken
22
- };
package/es/util/index.js DELETED
@@ -1,85 +0,0 @@
1
- import m from "@emotion/hash";
2
- import d from "@v-c/util/dist/Dom/canUseDom";
3
- import { updateCSS as $, removeCSS as T } from "@v-c/util/dist/Dom/dynamicCSS";
4
- import { ATTR_MARK as g, ATTR_TOKEN as C } from "../StyleContext.js";
5
- import b from "../theme/Theme.js";
6
- const v = /* @__PURE__ */ new WeakMap(), c = {};
7
- function w(e, r) {
8
- let t = v;
9
- for (let n = 0; n < r.length; n += 1) {
10
- const o = r[n];
11
- t.has(o) || t.set(o, /* @__PURE__ */ new WeakMap()), t = t.get(o);
12
- }
13
- return t.has(c) || t.set(c, e()), t.get(c);
14
- }
15
- const p = /* @__PURE__ */ new WeakMap();
16
- function y(e, r = !1) {
17
- let t = p.get(e) || "";
18
- return t || (Object.keys(e).forEach((n) => {
19
- const o = e[n];
20
- t += n, o instanceof b ? t += o.id : o && typeof o == "object" ? t += y(o, r) : t += o;
21
- }), r && (t = m(t)), p.set(e, t)), t;
22
- }
23
- function A(e, r) {
24
- return m(`${r}_${y(e, !0)}`);
25
- }
26
- const i = `random-${Date.now()}-${Math.random()}`.replace(
27
- /\./g,
28
- ""
29
- ), S = "_bAmBoO_";
30
- function h(e, r, t) {
31
- if (d()) {
32
- $(e, i);
33
- const n = document.createElement("div");
34
- n.style.position = "fixed", n.style.left = "0", n.style.top = "0", r?.(n), document.body.appendChild(n), process.env.NODE_ENV !== "production" && (n.innerHTML = "Test", n.style.zIndex = "9999999");
35
- const o = t ? t(n) : getComputedStyle(n).content?.includes(S);
36
- return n.parentNode?.removeChild(n), T(i), o;
37
- }
38
- return !1;
39
- }
40
- let a;
41
- function L() {
42
- return a === void 0 && (a = h(
43
- `:where(.${i}) { content: "${S}"!important; }`,
44
- (e) => {
45
- e.className = i;
46
- }
47
- )), a;
48
- }
49
- let l;
50
- function O() {
51
- return l === void 0 && (l = h(
52
- `.${i} { inset-block: 93px !important; }`,
53
- (e) => {
54
- e.className = i;
55
- },
56
- (e) => getComputedStyle(e).bottom === "93px"
57
- )), l;
58
- }
59
- const R = d();
60
- function W(e) {
61
- return typeof e == "number" ? `${e}px` : e;
62
- }
63
- function j(e, r, t, n = {}, o = !1) {
64
- if (o)
65
- return e;
66
- const f = {
67
- ...n,
68
- [C]: r,
69
- [g]: t
70
- };
71
- return `<style ${Object.keys(f).map((s) => {
72
- const u = f[s];
73
- return u ? `${s}="${u}"` : null;
74
- }).filter((s) => s).join(" ")}>${e}</style>`;
75
- }
76
- export {
77
- y as flattenToken,
78
- R as isClientSide,
79
- w as memoResult,
80
- O as supportLogicProps,
81
- L as supportWhere,
82
- j as toStyleStr,
83
- A as token2key,
84
- W as unit
85
- };
package/lib/Cache.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u="%";function n(c){return c.join(u)}class i{instanceId;constructor(e){this.instanceId=e}cache=new Map;get(e){return this.opGet(n(e))}opGet(e){return this.cache.get(e)||null}update(e,t){return this.opUpdate(n(e),t)}opUpdate(e,t){const a=this.cache.get(e),s=t(a);s===null?this.cache.delete(e):this.cache.set(e,s)}}exports.default=i;exports.pathKey=n;
package/lib/Keyframes.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class r{name;style;constructor(e,t){this.name=e,this.style=t}getName(e=""){return e?`${e}-${this.name}`:this.name}_keyframe=!0}exports.default=r;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),C=require("./Cache.js"),S="data-token-hash",d="data-css-hash",p="data-cache-path",o="__cssinjs_instance__";function i(){const n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const u=document.body.querySelectorAll(`style[${d}]`)||[],{firstChild:r}=document.head;Array.from(u).forEach(e=>{e[o]=e[o]||n,e[o]===n&&document.head.insertBefore(e,r)});const c={};Array.from(document.querySelectorAll(`style[${d}]`)).forEach(e=>{const t=e.getAttribute(d);c[t]?e[o]===n&&e.parentNode?.removeChild(e):c[t]=!0})}return new C.default(n)}const l=Symbol("StyleContext"),A={hashPriority:"low",cache:i(),defaultCache:!0},m=a.defineComponent((n,{slots:u})=>{const r=f(),c=a.computed(()=>{const e=n,t={...r.value};Object.keys(e).forEach(s=>{const y=e[s];e[s]!==void 0&&(t[s]=y)});const{cache:h}=e;return t.cache=t.cache||i(),t.defaultCache=!h&&r.value.defaultCache,t});return a.provide(l,c),()=>u.default?.()},{name:"StyleProvider",name:"StyleProvider",inheritAttrs:!1,props:{autoClear:{type:Boolean,default:void 0},mock:{type:String,default:void 0},cache:{type:Object,default:void 0},defaultCache:{type:Boolean,default:void 0},hashPriority:{type:String,default:void 0},container:{type:Object,default:void 0},ssrInline:{type:Boolean,default:void 0},transformers:{type:Array,default:void 0},linters:{type:Array,default:void 0},layer:{type:Boolean,default:void 0}}});function f(){return a.inject(l,a.computed(()=>A))}exports.ATTR_CACHE_PATH=p;exports.ATTR_MARK=d;exports.ATTR_TOKEN=S;exports.CSS_IN_JS_INSTANCE=o;exports.StyleProvider=m;exports.createCache=i;exports.useStyleContext=f;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("./hooks/useCacheToken.js"),y=require("./hooks/useCSSVarRegister.js"),S=require("./hooks/useStyleRegister.js"),d=require("./util/index.js"),r=require("./util/cacheMapUtil.js"),h={[S.STYLE_PREFIX]:S.extract,[f.TOKEN_PREFIX]:f.extract,[y.CSS_VAR_PREFIX]:y.extract};function P(t){return t!==null}function g(t,s){const{plain:o=!1,types:c=["style","token","cssVar"]}=typeof s=="boolean"?{plain:s}:s||{},a=new RegExp(`^(${(typeof c=="string"?[c]:c).join("|")})%`),p=Array.from(t.cache.keys()).filter(e=>a.test(e)),x={},i={};let n="";return p.map(e=>{const l=e.replace(a,"").replace(/%/g,"|"),[_]=e.split("%"),A=h[_],u=A(t.cache.get(e)[1],x,{plain:o});if(!u)return null;const[E,R,T]=u;return e.startsWith("style")&&(i[l]=R),[E,T]}).filter(P).sort(([e],[l])=>e-l).forEach(([,e])=>{n+=e}),n+=d.toStyleStr(`.${r.ATTR_CACHE_MAP}{content:"${r.serialize(i)}";}`,void 0,void 0,{[r.ATTR_CACHE_MAP]:r.ATTR_CACHE_MAP},o),n}exports.default=g;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("@v-c/util/dist/Dom/dynamicCSS"),e=require("vue"),s=require("../StyleContext.js"),_=require("../util/index.js"),R=require("../util/css-variables.js"),h=require("./useGlobalCache.js"),x=require("./useStyleRegister.js"),C="cssVar";function A(t,v){const l=s.useStyleContext(),u=e.computed(()=>e.unref(t).path),r=e.computed(()=>e.unref(t).key),i=e.computed(()=>e.unref(t).prefix),d=e.computed(()=>e.unref(t).unitless),o=e.computed(()=>e.unref(t).ignore),c=e.computed(()=>e.unref(t).scope),p=e.computed(()=>e.unref(t).token),k=e.computed(()=>p.value._tokenKey),m=e.computed(()=>[...u.value,r.value,c.value,k.value]);return h.default(C,m,()=>{const n=e.unref(v)(),[S,a]=R.transformToken(n,r.value,{prefix:i.value,unitless:d.value,ignore:o.value,scope:c.value}),y=x.uniqueHash(m.value,a);return[S,a,y,r.value]},([,,n])=>{_.isClientSide&&T.removeCSS(n,{mark:s.ATTR_MARK})},([,n,S])=>{if(!n)return;const{container:a,cache:{instanceId:y}}=l.value,f=T.updateCSS(n,S,{mark:s.ATTR_MARK,prepend:"queue",attachTo:a,priority:-999});f[s.CSS_IN_JS_INSTANCE]=y,f.setAttribute(s.ATTR_TOKEN,r)})}const q=(t,v,l)=>{const[,u,r,i]=t,{plain:d}=l||{};if(!u)return null;const o=-999,c={"data-vc-order":"prependQueue","data-vc-priority":`${o}`},p=_.toStyleStr(u,i,r,c,d);return[o,r,p]};exports.CSS_VAR_PREFIX=C;exports.default=A;exports.extract=q;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@emotion/hash"),N=require("@v-c/util/dist/Dom/dynamicCSS"),e=require("vue"),v=require("../StyleContext.js"),l=require("../util/index.js"),I=require("../util/css-variables.js"),x=require("./useGlobalCache.js"),A={},O=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",i=new Map;function R(t){i.set(t,(i.get(t)||0)+1)}function q(t,a){typeof document<"u"&&document.querySelectorAll(`style[${v.ATTR_TOKEN}="${t}"]`).forEach(n=>{n[v.CSS_IN_JS_INSTANCE]===a&&n.parentNode?.removeChild(n)})}const b=0;function V(t,a){i.set(t,(i.get(t)||0)-1);const r=Array.from(i.keys()),n=r.filter(u=>(i.get(u)||0)<=0);r.length-n.length>b&&n.forEach(u=>{q(u,a),i.delete(u)})}function g(t,a,r,n){let c={...r.getDerivativeToken(t),...a};return n&&(c=n(c)),c}const E="token";function D(t,a,r=e.ref({})){const n=v.useStyleContext(),u=e.computed(()=>e.unref(r).salt??""),c=e.computed(()=>e.unref(r).override??A),k=e.unref(r).formatToken,f=e.unref(r).getComputedToken,o=e.computed(()=>e.unref(r).cssVar),T=e.computed(()=>l.memoResult(()=>Object.assign({},...e.unref(a)),e.unref(a))),m=e.computed(()=>l.flattenToken(T.value)),K=e.computed(()=>l.flattenToken(c.value)),C=e.computed(()=>o.value?l.flattenToken(o.value):"");return x.default(E,e.computed(()=>[u.value,e.unref(t).id,m.value,K.value,C.value]),()=>{let s=f?f(T.value,c.value,e.unref(t)):g(T.value,c.value,e.unref(t),k);const d={...s};let y="";o.value&&([s,y]=I.transformToken(s,o.value.key,{prefix:o.value.prefix,ignore:o.value.ignore,unitless:o.value.unitless,preserve:o.value.preserve}));const S=l.token2key(s,u.value);s._tokenKey=S,d._tokenKey=l.token2key(d,u.value);const p=o.value?.key??S;s._themeKey=p,R(p);const _=`${O}-${h(S)}`;return s._hashId=_,[s,_,d,y,o.value?.key||""]},s=>{V(s[0]._themeKey,n.value.cache.instanceId)},([s,,,d])=>{if(o.value&&d){const y=N.updateCSS(d,h(`css-variables-${s._themeKey}`),{mark:v.ATTR_MARK,prepend:"queue",attachTo:n.value.container,priority:-999});y[v.CSS_IN_JS_INSTANCE]=n.value.cache.instanceId,y.setAttribute(v.ATTR_TOKEN,s._themeKey)}})}const $=(t,a,r)=>{const[,,n,u,c]=t,{plain:k}=r||{};if(!u)return null;const f=n._tokenKey,o=-999,T={"data-vc-order":"prependQueue","data-vc-priority":`${o}`},m=l.toStyleStr(u,c,f,T,k);return[o,f,m]};exports.TOKEN_PREFIX=E;exports.default=D;exports.extract=$;exports.getComputedToken=g;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(){return function(e){e()}}exports.default=u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),E=require("../Cache.js"),S=require("../StyleContext.js"),_=require("./useEffectCleanupRegister.js"),G=require("./useHMR.js");function M(g,b,x,r,v){const n=S.useStyleContext(),q=e.computed(()=>[e.unref(g),...e.unref(b)]),o=e.computed(()=>E.pathKey(q.value)),y=_.default(),f=[],h=G.default(),d=l=>{n.value.cache.opUpdate(o.value,s=>{const[c=0,t]=s||[void 0,void 0];let a=t;process.env.NODE_ENV!=="production"&&t&&h&&(r?.(a,h),a=null);const C=a||x(),m=[c,C];return l?l(m):m})},u=e.shallowRef();u.value=n.value.cache.opGet(o.value),process.env.NODE_ENV!=="production"&&!u.value&&(d(),u.value=n.value.cache.opGet(o.value));const i=e.computed(()=>u.value[1]);return e.watch(o,(l,p)=>{const s=n.value.cache;v?.(i.value),d(([c,t])=>(c===0&&v?.(i.value),[c+1,t])),p&&s.opUpdate(p,c=>{const[t=0,a]=c||[];return t-1===0?(y(()=>{r?.(a,!1)}),null):[t-1,a]}),u.value=s.opGet(o.value),f.push(()=>{r?.(u.value[1],!1)})},{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>{f.map(l=>l())}),i}exports.default=M;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function u(){return!1}let t=!1;function i(){return t}const r=process.env.NODE_ENV==="production"?u:i;if(process.env.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){const e=window;if(typeof e.webpackHotUpdate=="function"){const o=e.webpackHotUpdate;e.webpackHotUpdate=(...n)=>(t=!0,setTimeout(()=>{t=!1},0),o(...n))}}exports.default=r;
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),V=require("@emotion/hash"),q=require("@v-c/util/dist/Dom/dynamicCSS"),w=require("@emotion/unitless"),O=require("stylis"),F=require("../linters/contentQuotesLinter.js"),D=require("../linters/hashedAnimationLinter.js");require("@v-c/util/dist/warning");const j=require("../StyleContext.js"),P=require("../util/index.js"),k=require("../util/cacheMapUtil.js"),U=require("./useGlobalCache.js"),x="_skip_check_",M="_multi_value_";function I(e){return O.serialize(O.compile(e),O.stringify).replace(/\{%%%:[^;];\}/g,";")}function W(e){return typeof e=="object"&&e&&(x in e||M in e)}function H(e,y,E){if(!y)return e;const C=`.${y}`,T=E==="low"?`:where(${C})`:C;return e.split(",").map(u=>{const A=u.trim().split(/\s+/);let h=A[0]||"";const r=h.match(/^\w+/)?.[0]||"";return h=`${r}${T}${h.slice(r.length)}`,[h,...A.slice(1)].join(" ")}).join(",")}function R(e,y={},{root:E,injectHash:C,parentSelectors:T}={root:!0,parentSelectors:[]}){const{hashId:d,layer:u,path:A,hashPriority:h,transformers:r=[],linters:m=[]}=y;let o="",f={};function N(s){const l=s.getName(d);if(!f[l]){const[i]=R(s.style,y,{root:!1,parentSelectors:T});f[l]=`@keyframes ${s.getName(d)}${i}`}}function g(s,l=[]){return s.forEach(i=>{Array.isArray(i)?g(i,l):i&&l.push(i)}),l}return g(Array.isArray(e)?e:[e]).forEach(s=>{const l=typeof s=="string"&&!E?{}:s;if(typeof l=="string")o+=`${l}
2
- `;else if(l._keyframe)N(l);else{const i=r.reduce((a,n)=>n?.visit?.(a)||a,l);Object.keys(i).forEach(a=>{const n=i[a];if(typeof n=="object"&&n&&(a!=="animationName"||!n._keyframe)&&!W(n)){let p=!1,c=a.trim(),v=!1;(E||C)&&d?c.startsWith("@")?p=!0:c==="&"?c=H("",d,h):c=H(a,d,h):E&&!d&&(c==="&"||c==="")&&(c="",v=!0);const[_,S]=R(n,y,{root:v,injectHash:p,parentSelectors:[...T,c]});f={...f,...S},o+=`${c}${_}`}else{let p=function(v,_){process.env.NODE_ENV!=="production"&&(typeof n!="object"||!n?.[x])&&[F.default,D.default,...m].forEach(L=>L(v,_,{path:A,hashId:d,parentSelectors:T}));const S=v.replace(/[A-Z]/g,L=>`-${L.toLowerCase()}`);let b=_;!w[v]&&typeof b=="number"&&b!==0&&(b=`${b}px`),v==="animationName"&&_?._keyframe&&(N(_),b=_.getName(d)),o+=`${S}:${b};`};const c=n?.value??n;typeof n=="object"&&n?.[M]&&Array.isArray(c)?c.forEach(v=>{p(a,v)}):p(a,c)}})}}),E?u&&(o=`@layer ${u.name} {${o}}`,u.dependencies&&(f[`@layer ${u.name}`]=u.dependencies.map(s=>`@layer ${s}, ${u.name};`).join(`
3
- `))):o=`{${o}}`,[o,f]}function K(e,y){return V(`${e.join("%")}${y}`)}function Y(){return null}const z="style";function Q(e,y){const E=t.computed(()=>t.unref(e).token),C=t.computed(()=>t.unref(e).path),T=t.computed(()=>t.unref(e).hashId),d=t.computed(()=>t.unref(e).layer),u=t.computed(()=>t.unref(e).nonce),A=t.computed(()=>t.unref(e).clientOnly),h=t.computed(()=>t.unref(e).order??0),r=j.useStyleContext(),m=t.computed(()=>E.value._tokenKey),o=[m.value];r.value.layer&&o.push("layer"),o.push(...C.value);const f=r.value.mock;let N=P.isClientSide;process.env.NODE_ENV!=="production"&&f!==void 0&&(N=f==="client");const g=U.default(z,o,()=>{const $=o.join("|");if(k.existPath($)){const[p,c]=k.getStyleAndHash($);if(p)return[p,m.value,c,{},A.value,h.value]}const s=t.unref(y)(),[l,i]=R(s,{hashId:T.value,hashPriority:r.value.hashPriority,layer:r.value.layer?d.value:void 0,path:C.value.join("-"),transformers:r.value.transformers,linters:r.value.linters}),a=I(l),n=K(o,a);return[a,m.value,n,i,A.value,h.value]},([,,$],s)=>{(s||r.value.autoClear)&&P.isClientSide&&q.removeCSS($,{mark:j.ATTR_MARK})},([$,s,l,i])=>{if(N&&$!==k.CSS_FILE_STYLE){const a={mark:j.ATTR_MARK,prepend:r.value.layer?!1:"queue",attachTo:r.value.container,priority:h.value},n=typeof u.value=="function"?u.value():u.value;n&&(a.csp={nonce:n});const p=[],c=[];Object.keys(i).forEach(S=>{S.startsWith("@layer")?p.push(S):c.push(S)}),p.forEach(S=>{q.updateCSS(I(i[S]),`_layer-${S}`,{...a,prepend:!0})});const v=r.value.cache,_=q.updateCSS($,l,a);_[j.CSS_IN_JS_INSTANCE]=v.instanceId,_.setAttribute(j.ATTR_TOKEN,t.unref(m)),process.env.NODE_ENV!=="production"&&_.setAttribute(j.ATTR_CACHE_PATH,o.join("|")),c.forEach(S=>{q.updateCSS(I(i[S]),`_effect-${S}`,a)})}});return $=>{let s;const{ssrInline:l,defaultCache:i}=r.value,[a,n,p]=g.value;return!l||N||!i?s=t.createVNode(Y,null,null):s=t.createVNode("style",t.mergeProps({[j.ATTR_TOKEN]:n,[j.ATTR_MARK]:p},{innerHTML:a}),null),t.createVNode(t.Fragment,null,[s,$])}}const X=(e,y,E)=>{const[C,T,d,u,A,h]=e,{plain:r}=E||{};if(A)return null;let m=C;const o={"data-vc-order":"prependQueue","data-vc-priority":`${h}`};return m=P.toStyleStr(C,T,d,o,r),u&&Object.keys(u).forEach(f=>{if(!y[f]){y[f]=!0;const N=I(u[f]),g=P.toStyleStr(N,T,`_effect-${f}`,o,r);f.startsWith("@layer")?m=g+m:m+=g}}),[h,d,m]};exports.STYLE_PREFIX=z;exports.default=Q;exports.extract=X;exports.normalizeStyle=I;exports.parseStyle=R;exports.uniqueHash=K;
package/lib/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./extractStyle.js"),r=require("./hooks/useCacheToken.js"),a=require("./hooks/useCSSVarRegister.js"),i=require("./hooks/useStyleRegister.js"),u=require("./Keyframes.js");require("@v-c/util/dist/warning");const n=require("./linters/legacyNotSelectorLinter.js"),c=require("./linters/logicalPropertiesLinter.js"),s=require("./linters/NaNLinter.js"),l=require("./linters/parentSelectorLinter.js"),t=require("./StyleContext.js"),d=require("./theme/calc/index.js"),S=require("./theme/createTheme.js"),p=require("./theme/Theme.js"),f=require("./transformers/legacyLogicalProperties.js"),g=require("./transformers/px2rem.js"),e=require("./util/index.js"),q=require("./util/css-variables.js"),m={supportModernCSS:()=>e.supportWhere()&&e.supportLogicProps()};exports.extractStyle=o.default;exports.getComputedToken=r.getComputedToken;exports.useCacheToken=r.default;exports.useCSSVarRegister=a.default;exports.useStyleRegister=i.default;exports.Keyframes=u.default;exports.legacyNotSelectorLinter=n.default;exports.logicalPropertiesLinter=c.default;exports.NaNLinter=s.default;exports.parentSelectorLinter=l.default;exports.StyleProvider=t.StyleProvider;exports.createCache=t.createCache;exports.genCalc=d.default;exports.createTheme=S.default;exports.Theme=p.default;exports.legacyLogicalPropertiesTransformer=f.default;exports.px2remTransformer=g.default;exports.unit=e.unit;exports.token2CSSVar=q.token2CSSVar;exports._experimental=m;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./utils.js"),n=(t,e,i)=>{(typeof e=="string"&&/NaN/.test(e)||Number.isNaN(e))&&r.lintWarning(`Unexpected 'NaN' in property '${t}: ${e}'.`,i)};exports.default=n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./utils.js"),r=(n,t,e)=>{if(n==="content"){const o=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;(typeof t!="string"||!["normal","none","initial","inherit","unset"].includes(t)&&!o.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||t.charAt(0)!=='"'&&t.charAt(0)!=="'"))&&i.lintWarning(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,e)}};exports.default=r;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./utils.js"),a=(n,e,i)=>{n==="animation"&&i.hashId&&e!=="none"&&t.lintWarning(`You seem to be using hashed animation '${e}', in which case 'animationName' with Keyframe as value is recommended.`,i)};exports.default=a;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./utils.js");function s(n){return(n.match(/:not\(([^)]*)\)/)?.[1]||"").split(/(\[[^[]*\])|(?=[.#])/).filter(o=>o).length>1}function c(n){return n.parentSelectors.reduce((e,t)=>e?t.includes("&")?t.replace(/&/g,e):`${e} ${t}`:t,"")}const i=(n,e,t)=>{const l=c(t).match(/:not\([^)]*\)/g)||[];l.length>0&&l.some(s)&&r.lintWarning("Concat ':not' selector not support in legacy browsers.",t)};exports.default=i;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./utils.js"),c=(t,r,o)=>{switch(t){case"marginLeft":case"marginRight":case"paddingLeft":case"paddingRight":case"left":case"right":case"borderLeft":case"borderLeftWidth":case"borderLeftStyle":case"borderLeftColor":case"borderRight":case"borderRightWidth":case"borderRightStyle":case"borderRightColor":case"borderTopLeftRadius":case"borderTopRightRadius":case"borderBottomLeftRadius":case"borderBottomRightRadius":a.lintWarning(`You seem to be using non-logical property '${t}' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,o);return;case"margin":case"padding":case"borderWidth":case"borderStyle":if(typeof r=="string"){const s=r.split(" ").map(n=>n.trim());s.length===4&&s[1]!==s[3]&&a.lintWarning(`You seem to be using '${t}' property with different left ${t} and right ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,o)}return;case"clear":case"textAlign":(r==="left"||r==="right")&&a.lintWarning(`You seem to be using non-logical value '${r}' of ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,o);return;case"borderRadius":typeof r=="string"&&r.split("/").map(i=>i.trim()).reduce((i,l)=>{if(i)return i;const e=l.split(" ").map(d=>d.trim());return e.length>=2&&e[0]!==e[1]||e.length===3&&e[1]!==e[2]||e.length===4&&e[2]!==e[3]?!0:i},!1)&&a.lintWarning(`You seem to be using non-logical value '${r}' of ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`,o)}};exports.default=c;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./utils.js"),o=(r,n,e)=>{e.parentSelectors.some(t=>t.split(",").some(s=>s.split("&").length>2))&&l.lintWarning("Should not use more than one `&` in a selector.",e)};exports.default=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@v-c/util/dist/warning");function o(t,r){const{path:n,parentSelectors:e}=r;i(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${t}${e.length?` Selector: ${e.join(" | ")}`:""}`)}exports.lintWarning=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@v-c/util/dist/warning");let t=0;class u{derivatives;id;constructor(e){this.derivatives=Array.isArray(e)?e:[e],this.id=t,e.length===0&&n.warning(e.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),t+=1}getDerivativeToken(e){return this.derivatives.reduce((i,r)=>r(e,i),void 0)}}exports.default=u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(i,e){if(i.length!==e.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==e[s])return!1;return!0}class c{static MAX_CACHE_SIZE=20;static MAX_CACHE_OFFSET=5;cache;keys;cacheCallTimes;constructor(){this.cache=new Map,this.keys=[],this.cacheCallTimes=0}size(){return this.keys.length}internalGet(e,s=!1){let t={map:this.cache};return e.forEach(l=>{t?t=t?.map?.get(l):t=void 0}),t?.value&&s&&(t.value[1]=this.cacheCallTimes++),t?.value}get(e){return this.internalGet(e,!0)?.[0]}has(e){return!!this.internalGet(e)}set(e,s){if(!this.has(e)){if(this.size()+1>c.MAX_CACHE_SIZE+c.MAX_CACHE_OFFSET){const[l]=this.keys.reduce((h,a)=>{const[,u]=h;return this.internalGet(a)[1]<u?[a,this.internalGet(a)[1]]:h},[this.keys[0],this.cacheCallTimes]);this.delete(l)}this.keys.push(e)}let t=this.cache;e.forEach((l,h)=>{if(h===e.length-1)t.set(l,{value:[s,this.cacheCallTimes++]});else{const a=t.get(l);a?a.map||(a.map=new Map):t.set(l,{map:new Map}),t=t.get(l).map}})}deleteByPath(e,s){const t=e.get(s[0]);if(s.length===1)return t.map?e.set(s[0],{map:t.map}):e.delete(s[0]),t.value?.[0];const l=this.deleteByPath(t.map,s.slice(1));return(!t.map||t.map.size===0)&&!t.value&&e.delete(s[0]),l}delete(e){if(this.has(e))return this.keys=this.keys.filter(s=>!n(s,e)),this.deleteByPath(this.cache,e)}}exports.default=c;exports.sameDerivativeOption=n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./calculator.js"),u="CALC_UNIT",f=new RegExp(u,"g");function l(r){return typeof r=="number"?`${r}${u}`:r}class e extends h.default{result="";unitlessCssVar;lowPriority;constructor(t,i){super();const s=typeof t;this.unitlessCssVar=i,t instanceof e?this.result=`(${t.result})`:s==="number"?this.result=l(t):s==="string"&&(this.result=t)}add(t){return t instanceof e?this.result=`${this.result} + ${t.getResult()}`:(typeof t=="number"||typeof t=="string")&&(this.result=`${this.result} + ${l(t)}`),this.lowPriority=!0,this}sub(t){return t instanceof e?this.result=`${this.result} - ${t.getResult()}`:(typeof t=="number"||typeof t=="string")&&(this.result=`${this.result} - ${l(t)}`),this.lowPriority=!0,this}mul(t){return this.lowPriority&&(this.result=`(${this.result})`),t instanceof e?this.result=`${this.result} * ${t.getResult(!0)}`:(typeof t=="number"||typeof t=="string")&&(this.result=`${this.result} * ${t}`),this.lowPriority=!1,this}div(t){return this.lowPriority&&(this.result=`(${this.result})`),t instanceof e?this.result=`${this.result} / ${t.getResult(!0)}`:(typeof t=="number"||typeof t=="string")&&(this.result=`${this.result} / ${t}`),this.lowPriority=!1,this}getResult(t){return this.lowPriority||t?`(${this.result})`:this.result}equal(t){const{unit:i}=t||{};let s=!0;return typeof i=="boolean"?s=i:Array.from(this.unitlessCssVar).some(o=>this.result.includes(o))&&(s=!1),this.result=this.result.replace(f,s?"px":""),typeof this.lowPriority<"u"?`calc(${this.result})`:this.result}}exports.default=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./calculator.js");class t extends s.default{result=0;constructor(e){super(),e instanceof t?this.result=e.result:typeof e=="number"&&(this.result=e)}add(e){return e instanceof t?this.result+=e.result:typeof e=="number"&&(this.result+=e),this}sub(e){return e instanceof t?this.result-=e.result:typeof e=="number"&&(this.result-=e),this}mul(e){return e instanceof t?this.result*=e.result:typeof e=="number"&&(this.result*=e),this}div(e){return e instanceof t?this.result/=e.result:typeof e=="number"&&(this.result/=e),this}equal(){return this.result}}exports.default=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class e{}exports.default=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./CSSCalculator.js"),a=require("./NumCalculator.js");function o(e,t){const u=e==="css"?r.default:a.default;return l=>new u(l,t)}exports.default=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./Theme.js"),a=require("./ThemeCache.js"),r=new a.default;function c(t){const e=Array.isArray(t)?t:[t];return r.has(e)||r.set(e,new u.default(e)),r.get(e)}exports.default=c;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function s(e){if(typeof e=="number")return[[e],!1];const t=String(e).trim(),o=t.match(/(.*)(!important)/),i=(o?o[1]:t).trim().split(/\s+/);let r=[],d=0;return[i.reduce((l,n)=>{if(n.includes("(")||n.includes(")")){const a=n.split("(").length-1,p=n.split(")").length-1;d+=a-p}return d>=0&&r.push(n),d===0&&(l.push(r.join(" ")),r=[]),l},[]),!!o]}function b(e){return e.notSplit=!0,e}const c={inset:["top","right","bottom","left"],insetBlock:["top","bottom"],insetBlockStart:["top"],insetBlockEnd:["bottom"],insetInline:["left","right"],insetInlineStart:["left"],insetInlineEnd:["right"],marginBlock:["marginTop","marginBottom"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],marginInline:["marginLeft","marginRight"],marginInlineStart:["marginLeft"],marginInlineEnd:["marginRight"],paddingBlock:["paddingTop","paddingBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"],paddingInline:["paddingLeft","paddingRight"],paddingInlineStart:["paddingLeft"],paddingInlineEnd:["paddingRight"],borderBlock:b(["borderTop","borderBottom"]),borderBlockStart:b(["borderTop"]),borderBlockEnd:b(["borderBottom"]),borderInline:b(["borderLeft","borderRight"]),borderInlineStart:b(["borderLeft"]),borderInlineEnd:b(["borderRight"]),borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndWidth:["borderBottomWidth"],borderInlineWidth:["borderLeftWidth","borderRightWidth"],borderInlineStartWidth:["borderLeftWidth"],borderInlineEndWidth:["borderRightWidth"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderBlockStartStyle:["borderTopStyle"],borderBlockEndStyle:["borderBottomStyle"],borderInlineStyle:["borderLeftStyle","borderRightStyle"],borderInlineStartStyle:["borderLeftStyle"],borderInlineEndStyle:["borderRightStyle"],borderBlockColor:["borderTopColor","borderBottomColor"],borderBlockStartColor:["borderTopColor"],borderBlockEndColor:["borderBottomColor"],borderInlineColor:["borderLeftColor","borderRightColor"],borderInlineStartColor:["borderLeftColor"],borderInlineEndColor:["borderRightColor"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"]};function g(e,t){let o=e;return t&&(o=`${o} !important`),{_skip_check_:!0,value:o}}const h={visit:e=>{const t={};return Object.keys(e).forEach(o=>{const i=e[o],r=c[o];if(r&&(typeof i=="number"||typeof i=="string")){const[d,l]=s(i);r.length&&r.notSplit?r.forEach(n=>{t[n]=g(i,l)}):r.length===1?t[r[0]]=g(d[0],l):r.length===2?r.forEach((n,a)=>{t[n]=g(d[a]??d[0],l)}):r.length===4?r.forEach((n,a)=>{t[n]=g(d[a]??d[a-2]??d[0],l)}):t[o]=i}else t[o]=i}),t}};exports.default=h;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@emotion/unitless"),a=/url\([^)]+\)|var\([^)]+\)|(\d+(?:\.\d+)?|\.\d+)px/g;function d(i,s){const o=10**(s+1),c=Math.floor(i*o);return Math.round(c/10)*10/o}function x(i={}){const{rootValue:s=16,precision:o=5,mediaQuery:c=!1}=i,u=(n,t)=>{if(!t)return n;const e=Number.parseFloat(t);return e<=1?n:`${d(e/s,o)}rem`};return{visit:n=>{const t={...n};return Object.entries(n).forEach(([e,r])=>{if(typeof r=="string"&&r.includes("px")){const l=r.replace(a,u);t[e]=l}!p[e]&&typeof r=="number"&&r!==0&&(t[e]=`${r}px`.replace(a,u));const f=e.trim();if(f.startsWith("@")&&f.includes("px")&&c){const l=e.replace(a,u);t[l]=t[e],delete t[e]}}),t}}}exports.default=x;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@v-c/util/dist/Dom/canUseDom"),y=require("../StyleContext.js"),l="data-ant-cssinjs-cache-path",r="_FILE_STYLE__";function S(e){return Object.keys(e).map(t=>{const n=e[t];return`${t}:${n}`}).join(";")}let i,c=!0;function a(){if(!i&&(i={},o())){const e=document.createElement("div");e.className=l,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);let t=getComputedStyle(e).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(s=>{const[d,u]=s.split(":");i[d]=u});const n=document.querySelector(`style[${l}]`);n&&(c=!1,n.parentNode?.removeChild(n)),document.body.removeChild(e)}}function p(e){return a(),!!i[e]}function f(e){const t=i[e];let n=null;if(t&&o())if(c)n=r;else{const s=document.querySelector(`style[${y.ATTR_MARK}="${i[e]}"]`);s?n=s.innerHTML:delete i[e]}return[n,t]}exports.ATTR_CACHE_MAP=l;exports.CSS_FILE_STYLE=r;exports.existPath=p;exports.getStyleAndHash=f;exports.prepare=a;exports.serialize=S;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(r,t=""){return`--${t?`${t}-`:""}${r}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()}function i(r,t,e){return Object.keys(r).length?`.${t}${e?.scope?`.${e.scope}`:""}{${Object.entries(r).map(([$,o])=>`${$}:${o};`).join("")}}`:""}function p(r,t,e){const $={},o={};return Object.entries(r).forEach(([n,s])=>{if(e?.preserve?.[n])o[n]=s;else if((typeof s=="string"||typeof s=="number")&&!e?.ignore?.[n]){const a=c(n,e?.prefix);$[a]=typeof s=="number"&&!e?.unitless?.[n]?`${s}px`:String(s),o[n]=`var(${a})`}}),[o,i($,t,{scope:e?.scope})]}exports.serializeCSSVar=i;exports.token2CSSVar=c;exports.transformToken=p;