@bamboocss/shared 1.11.1 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astish.cjs +19 -0
- package/dist/astish.d.cts +4 -0
- package/dist/astish.d.mts +4 -0
- package/dist/astish.mjs +17 -20
- package/dist/index.cjs +1357 -0
- package/dist/index.d.cts +284 -0
- package/dist/index.d.mts +284 -0
- package/dist/index.mjs +724 -898
- package/dist/normalize-html.cjs +17 -0
- package/dist/normalize-html.d.cts +9 -0
- package/dist/normalize-html.d.mts +9 -0
- package/dist/normalize-html.mjs +11 -7
- package/dist/shared.cjs +304 -0
- package/dist/shared.d.cts +102 -0
- package/dist/shared.d.mts +102 -0
- package/dist/shared.mjs +240 -283
- package/package.json +9 -9
- package/dist/astish.js +0 -46
- package/dist/index.js +0 -1557
- package/dist/normalize-html.js +0 -37
- package/dist/shared.js +0 -373
package/dist/index.mjs
CHANGED
|
@@ -1,793 +1,715 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (bracketCount === 0) {
|
|
19
|
-
return innerValue.trim();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return value;
|
|
1
|
+
//#region src/arbitrary-value.ts
|
|
2
|
+
const getArbitraryValue = (_value) => {
|
|
3
|
+
if (!_value || typeof _value !== "string") return _value;
|
|
4
|
+
const value = _value.trim();
|
|
5
|
+
if (value[0] === "[" && value[value.length - 1] === "]") {
|
|
6
|
+
const innerValue = value.slice(1, -1);
|
|
7
|
+
let bracketCount = 0;
|
|
8
|
+
for (let i = 0; i < innerValue.length; i++) if (innerValue[i] === "[") bracketCount++;
|
|
9
|
+
else if (innerValue[i] === "]") {
|
|
10
|
+
if (bracketCount === 0) return value;
|
|
11
|
+
bracketCount--;
|
|
12
|
+
}
|
|
13
|
+
if (bracketCount === 0) return innerValue.trim();
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
23
16
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/assert.ts
|
|
19
|
+
const isString = (v) => typeof v === "string";
|
|
20
|
+
const isBoolean = (v) => typeof v === "boolean";
|
|
21
|
+
const isFunction = (v) => typeof v === "function";
|
|
29
22
|
function isObject(value) {
|
|
30
|
-
|
|
23
|
+
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
31
24
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
const isSymbol = (v) => typeof v === "symbol";
|
|
26
|
+
const isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/assign.ts
|
|
36
29
|
function assign(target, ...sources) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!target?.hasOwnProperty?.(key)) {
|
|
40
|
-
target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return target;
|
|
30
|
+
for (const source of sources) for (const key in source) if (!target?.hasOwnProperty?.(key)) target[key] = source[key];
|
|
31
|
+
return target;
|
|
45
32
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
return tree[0];
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/astish.ts
|
|
35
|
+
const newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
|
|
36
|
+
const ruleClean = /\/\*[^]*?\*\/| +/g;
|
|
37
|
+
const ruleNewline = /\n+/g;
|
|
38
|
+
const empty = " ";
|
|
39
|
+
const astish = (val, tree = [{}]) => {
|
|
40
|
+
if (!val) return tree[0];
|
|
41
|
+
let block, left;
|
|
42
|
+
while (block = newRule.exec(val.replace(ruleClean, ""))) if (block[4]) tree.shift();
|
|
43
|
+
else if (block[3]) {
|
|
44
|
+
left = block[3].replace(ruleNewline, empty).trim();
|
|
45
|
+
if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
|
|
46
|
+
tree.unshift(tree[0][left] = tree[0][left] || {});
|
|
47
|
+
} else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
|
|
48
|
+
return tree[0];
|
|
64
49
|
};
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/cache-map.ts
|
|
67
52
|
var CacheMap = class {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.set(key, value);
|
|
151
|
-
return value;
|
|
152
|
-
}
|
|
153
|
-
[Symbol.iterator]() {
|
|
154
|
-
return this.cache[Symbol.iterator]();
|
|
155
|
-
}
|
|
156
|
-
[Symbol.toStringTag] = "CacheMap";
|
|
157
|
-
toJSON = () => {
|
|
158
|
-
return this.cache;
|
|
159
|
-
};
|
|
53
|
+
cache;
|
|
54
|
+
keysInUse;
|
|
55
|
+
maxCacheSize;
|
|
56
|
+
constructor(maxCacheSize = 1e3) {
|
|
57
|
+
this.maxCacheSize = maxCacheSize;
|
|
58
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
59
|
+
this.keysInUse = [];
|
|
60
|
+
}
|
|
61
|
+
get(key) {
|
|
62
|
+
if (!this.cache.has(key)) return;
|
|
63
|
+
this.updateKeyUsage(key);
|
|
64
|
+
return this.cache.get(key);
|
|
65
|
+
}
|
|
66
|
+
set(key, value) {
|
|
67
|
+
if (!this.cache.has(key) && this.cache.size === this.maxCacheSize) this.evictLeastRecentlyUsed();
|
|
68
|
+
this.cache.set(key, value);
|
|
69
|
+
this.updateKeyUsage(key);
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
delete(key) {
|
|
73
|
+
const result = this.cache.delete(key);
|
|
74
|
+
if (result) {
|
|
75
|
+
const index = this.keysInUse.indexOf(key);
|
|
76
|
+
if (index !== -1) this.keysInUse.splice(index, 1);
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
updateKeyUsage(key) {
|
|
81
|
+
const index = this.keysInUse.indexOf(key);
|
|
82
|
+
if (index !== -1) this.keysInUse.splice(index, 1);
|
|
83
|
+
this.keysInUse.push(key);
|
|
84
|
+
}
|
|
85
|
+
evictLeastRecentlyUsed() {
|
|
86
|
+
const keyToEvict = this.keysInUse.shift();
|
|
87
|
+
if (keyToEvict !== void 0) this.cache.delete(keyToEvict);
|
|
88
|
+
}
|
|
89
|
+
clear() {
|
|
90
|
+
this.cache.clear();
|
|
91
|
+
this.keysInUse = [];
|
|
92
|
+
}
|
|
93
|
+
has(key) {
|
|
94
|
+
return this.cache.has(key);
|
|
95
|
+
}
|
|
96
|
+
get size() {
|
|
97
|
+
return this.cache.size;
|
|
98
|
+
}
|
|
99
|
+
forEach(callback, thisArg) {
|
|
100
|
+
this.cache.forEach(callback, thisArg);
|
|
101
|
+
}
|
|
102
|
+
keys() {
|
|
103
|
+
return this.cache.keys();
|
|
104
|
+
}
|
|
105
|
+
values() {
|
|
106
|
+
return this.cache.values();
|
|
107
|
+
}
|
|
108
|
+
entries() {
|
|
109
|
+
return this.cache.entries();
|
|
110
|
+
}
|
|
111
|
+
getOrInsert(key, defaultValue) {
|
|
112
|
+
if (this.cache.has(key)) {
|
|
113
|
+
this.updateKeyUsage(key);
|
|
114
|
+
return this.cache.get(key);
|
|
115
|
+
}
|
|
116
|
+
this.set(key, defaultValue);
|
|
117
|
+
return defaultValue;
|
|
118
|
+
}
|
|
119
|
+
getOrInsertComputed(key, callback) {
|
|
120
|
+
if (this.cache.has(key)) {
|
|
121
|
+
this.updateKeyUsage(key);
|
|
122
|
+
return this.cache.get(key);
|
|
123
|
+
}
|
|
124
|
+
const value = callback(key);
|
|
125
|
+
this.set(key, value);
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
[Symbol.iterator]() {
|
|
129
|
+
return this.cache[Symbol.iterator]();
|
|
130
|
+
}
|
|
131
|
+
[Symbol.toStringTag] = "CacheMap";
|
|
132
|
+
toJSON = () => {
|
|
133
|
+
return this.cache;
|
|
134
|
+
};
|
|
160
135
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
function isCssVar(value) {
|
|
164
|
-
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/calc.ts
|
|
138
|
+
function isCssVar$1(value) {
|
|
139
|
+
return isObject(value) && "ref" in value;
|
|
165
140
|
}
|
|
166
141
|
function getRef(operand) {
|
|
167
|
-
|
|
142
|
+
return isCssVar$1(operand) ? operand.ref : operand.toString();
|
|
168
143
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
144
|
+
const calcRegex = /calc/g;
|
|
145
|
+
const toExpression = (operator, ...operands) => operands.map(getRef).join(` ${operator} `).replace(calcRegex, "");
|
|
146
|
+
const multiply = (...operands) => `calc(${toExpression("*", ...operands)})`;
|
|
147
|
+
const calc = { negate(x) {
|
|
148
|
+
const value = getRef(x);
|
|
149
|
+
if (value != null && !Number.isNaN(parseFloat(value))) return String(value).startsWith("-") ? String(value).slice(1) : `-${value}`;
|
|
150
|
+
return multiply(value, -1);
|
|
151
|
+
} };
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/memo.ts
|
|
154
|
+
const memo = (fn) => {
|
|
155
|
+
const cache = /* @__PURE__ */ new Map();
|
|
156
|
+
const get = (...args) => {
|
|
157
|
+
const key = JSON.stringify(args);
|
|
158
|
+
if (cache.has(key)) return cache.get(key);
|
|
159
|
+
const result = fn(...args);
|
|
160
|
+
cache.set(key, result);
|
|
161
|
+
return result;
|
|
162
|
+
};
|
|
163
|
+
return get;
|
|
180
164
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const result = fn(...args);
|
|
191
|
-
cache.set(key, result);
|
|
192
|
-
return result;
|
|
193
|
-
};
|
|
194
|
-
return get;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// src/camelcase-property.ts
|
|
198
|
-
var regex = /-(\w|$)/g;
|
|
199
|
-
var callback = (_dashChar, char) => char.toUpperCase();
|
|
200
|
-
var camelCaseProperty = memo((property) => {
|
|
201
|
-
if (property.startsWith("--")) return property;
|
|
202
|
-
let str = property.toLowerCase();
|
|
203
|
-
str = str.startsWith("-ms-") ? str.substring(1) : str;
|
|
204
|
-
return str.replace(regex, callback);
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/camelcase-property.ts
|
|
167
|
+
const regex = /-(\w|$)/g;
|
|
168
|
+
const callback = (_dashChar, char) => char.toUpperCase();
|
|
169
|
+
const camelCaseProperty = memo((property) => {
|
|
170
|
+
if (property.startsWith("--")) return property;
|
|
171
|
+
let str = property.toLowerCase();
|
|
172
|
+
str = str.startsWith("-ms-") ? str.substring(1) : str;
|
|
173
|
+
return str.replace(regex, callback);
|
|
205
174
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/capitalize.ts
|
|
177
|
+
const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
178
|
+
const camelCaseRegex = /([a-z])([A-Z])/g;
|
|
179
|
+
const dashCase = (s) => s.replace(camelCaseRegex, "$1-$2").toLowerCase();
|
|
180
|
+
const uncapitalize = (s) => s.charAt(0).toLowerCase() + s.slice(1);
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/compact.ts
|
|
214
183
|
function compact(value) {
|
|
215
|
-
|
|
184
|
+
return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value]) => value !== void 0));
|
|
216
185
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/condition.ts
|
|
188
|
+
const isBaseCondition = (v) => v === "base";
|
|
220
189
|
function filterBaseConditions(c) {
|
|
221
|
-
|
|
190
|
+
return c.slice().filter((v) => !isBaseCondition(v));
|
|
222
191
|
}
|
|
223
|
-
|
|
224
|
-
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/hash.ts
|
|
225
194
|
function toChar(code) {
|
|
226
|
-
|
|
195
|
+
return String.fromCharCode(code + (code > 25 ? 39 : 97));
|
|
227
196
|
}
|
|
228
197
|
function toName(code) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
198
|
+
let name = "";
|
|
199
|
+
let x;
|
|
200
|
+
for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
|
|
201
|
+
return toChar(x % 52) + name;
|
|
233
202
|
}
|
|
234
203
|
function toPhash(h, x) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
204
|
+
let i = x.length;
|
|
205
|
+
while (i) h = h * 33 ^ x.charCodeAt(--i);
|
|
206
|
+
return h;
|
|
238
207
|
}
|
|
239
208
|
function toHash(value) {
|
|
240
|
-
|
|
209
|
+
return toName(toPhash(5381, value) >>> 0);
|
|
241
210
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/important.ts
|
|
213
|
+
const importantRegex = /\s*!(important)?/i;
|
|
245
214
|
function isImportant(value) {
|
|
246
|
-
|
|
215
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
247
216
|
}
|
|
248
217
|
function withoutImportant(value) {
|
|
249
|
-
|
|
218
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
250
219
|
}
|
|
251
220
|
function withoutSpace(str) {
|
|
252
|
-
|
|
221
|
+
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
253
222
|
}
|
|
254
223
|
function markImportant(obj) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
return result;
|
|
224
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
225
|
+
const result = Array.isArray(obj) ? [] : {};
|
|
226
|
+
const stack = [{
|
|
227
|
+
obj,
|
|
228
|
+
result
|
|
229
|
+
}];
|
|
230
|
+
while (stack.length > 0) {
|
|
231
|
+
const { obj, result } = stack.pop();
|
|
232
|
+
for (const [key, value] of Object.entries(obj)) if (typeof value === "string" || typeof value === "number") result[key] = `${value} !important`;
|
|
233
|
+
else if (typeof value === "object" && value !== null) {
|
|
234
|
+
const next = Array.isArray(value) ? [] : {};
|
|
235
|
+
result[key] = next;
|
|
236
|
+
stack.push({
|
|
237
|
+
obj: value,
|
|
238
|
+
result: next
|
|
239
|
+
});
|
|
240
|
+
} else result[key] = value;
|
|
241
|
+
}
|
|
242
|
+
return result;
|
|
275
243
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/merge-props.ts
|
|
246
|
+
const MERGE_OMIT$2 = new Set([
|
|
247
|
+
"__proto__",
|
|
248
|
+
"constructor",
|
|
249
|
+
"prototype"
|
|
250
|
+
]);
|
|
279
251
|
function mergeProps(...sources) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
});
|
|
292
|
-
return prev;
|
|
293
|
-
}, {});
|
|
252
|
+
return sources.reduce((prev, obj) => {
|
|
253
|
+
if (!obj) return prev;
|
|
254
|
+
Object.keys(obj).forEach((key) => {
|
|
255
|
+
if (MERGE_OMIT$2.has(key)) return;
|
|
256
|
+
const prevValue = prev[key];
|
|
257
|
+
const value = obj[key];
|
|
258
|
+
if (isObject(prevValue) && isObject(value)) prev[key] = mergeProps(prevValue, value);
|
|
259
|
+
else prev[key] = value;
|
|
260
|
+
});
|
|
261
|
+
return prev;
|
|
262
|
+
}, {});
|
|
294
263
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/walk-object.ts
|
|
266
|
+
const isNotNullish = (element) => element != null;
|
|
298
267
|
function walkObject(target, predicate, options = {}) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
return predicate(value, path);
|
|
317
|
-
}
|
|
318
|
-
return inner(target);
|
|
268
|
+
const { stop, getKey } = options;
|
|
269
|
+
function inner(value, path = []) {
|
|
270
|
+
if (isObjectOrArray(value)) {
|
|
271
|
+
const result = {};
|
|
272
|
+
for (const [prop, child] of Object.entries(value)) {
|
|
273
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
274
|
+
const childPath = [...path, key];
|
|
275
|
+
if (stop?.(value, childPath)) return predicate(value, path);
|
|
276
|
+
const next = inner(child, childPath);
|
|
277
|
+
if (isNotNullish(next)) result[key] = next;
|
|
278
|
+
}
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
return predicate(value, path);
|
|
282
|
+
}
|
|
283
|
+
return inner(target);
|
|
319
284
|
}
|
|
320
285
|
function mapObject(obj, fn) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
286
|
+
if (Array.isArray(obj)) return obj.map((value) => fn(value));
|
|
287
|
+
if (!isObject(obj)) return fn(obj);
|
|
288
|
+
return walkObject(obj, (value) => fn(value));
|
|
324
289
|
}
|
|
325
|
-
|
|
326
|
-
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/normalize-style-object.ts
|
|
327
292
|
function toResponsiveObject(values, breakpoints) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
return acc;
|
|
335
|
-
},
|
|
336
|
-
{}
|
|
337
|
-
);
|
|
293
|
+
return values.reduce((acc, current, index) => {
|
|
294
|
+
const key = breakpoints[index];
|
|
295
|
+
if (current != null) acc[key] = current;
|
|
296
|
+
return acc;
|
|
297
|
+
}, {});
|
|
338
298
|
}
|
|
339
299
|
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
stop: (value) => Array.isArray(value),
|
|
349
|
-
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
|
350
|
-
}
|
|
351
|
-
);
|
|
300
|
+
const { utility, conditions } = context;
|
|
301
|
+
const { hasShorthand, resolveShorthand } = utility;
|
|
302
|
+
return walkObject(styles, (value) => {
|
|
303
|
+
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
|
|
304
|
+
}, {
|
|
305
|
+
stop: (value) => Array.isArray(value),
|
|
306
|
+
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
|
307
|
+
});
|
|
352
308
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/classname.ts
|
|
311
|
+
const fallbackCondition = {
|
|
312
|
+
shift: (v) => v,
|
|
313
|
+
finalize: (v) => v,
|
|
314
|
+
breakpoints: { keys: [] }
|
|
359
315
|
};
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
316
|
+
const sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
|
|
317
|
+
const ENTRY_SEP = "]___[";
|
|
318
|
+
const COND_SEP = "<___>";
|
|
363
319
|
function createCss(context) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
walkObject(normalizedObject, (value, paths) => {
|
|
404
|
-
if (value == null) return;
|
|
405
|
-
const important = isImportant(value);
|
|
406
|
-
const [prop, ...allConditions] = conds.shift(paths);
|
|
407
|
-
const conditions = filterBaseConditions(allConditions);
|
|
408
|
-
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
|
|
409
|
-
let className = hashFn(conditions, transformed.className);
|
|
410
|
-
if (important) className = `${className}!`;
|
|
411
|
-
classNames.add(className);
|
|
412
|
-
});
|
|
413
|
-
return Array.from(classNames).join(" ");
|
|
414
|
-
});
|
|
320
|
+
const { utility, hash, grouped, conditions: conds = fallbackCondition } = context;
|
|
321
|
+
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
|
|
322
|
+
const hashFn = (conditions, className) => {
|
|
323
|
+
let result;
|
|
324
|
+
if (hash) {
|
|
325
|
+
const baseArray = [...conds.finalize(conditions), className];
|
|
326
|
+
result = formatClassName(utility.toHash(baseArray, toHash));
|
|
327
|
+
} else result = [...conds.finalize(conditions), formatClassName(className)].join(":");
|
|
328
|
+
return result;
|
|
329
|
+
};
|
|
330
|
+
if (grouped) return memo(({ base, ...styles } = {}) => {
|
|
331
|
+
const normalizedObject = normalizeStyleObject(Object.assign(styles, base), context);
|
|
332
|
+
const hashes = [];
|
|
333
|
+
walkObject(normalizedObject, (value, paths) => {
|
|
334
|
+
if (value == null) return;
|
|
335
|
+
const [prop, ...allConditions] = conds.shift(paths);
|
|
336
|
+
const conditions = filterBaseConditions(allConditions);
|
|
337
|
+
const parts = [`${prop}${ENTRY_SEP}value:${value}`];
|
|
338
|
+
if (conditions.length) parts.push(`cond:${conditions.join(COND_SEP)}`);
|
|
339
|
+
hashes.push(parts.join(ENTRY_SEP));
|
|
340
|
+
});
|
|
341
|
+
if (hashes.length === 0) return "";
|
|
342
|
+
hashes.sort();
|
|
343
|
+
const groupId = hashes.join("|");
|
|
344
|
+
return formatClassName(utility.toHash(["grouped", groupId], toHash));
|
|
345
|
+
});
|
|
346
|
+
return memo(({ base, ...styles } = {}) => {
|
|
347
|
+
const normalizedObject = normalizeStyleObject(Object.assign(styles, base), context);
|
|
348
|
+
const classNames = /* @__PURE__ */ new Set();
|
|
349
|
+
walkObject(normalizedObject, (value, paths) => {
|
|
350
|
+
if (value == null) return;
|
|
351
|
+
const important = isImportant(value);
|
|
352
|
+
const [prop, ...allConditions] = conds.shift(paths);
|
|
353
|
+
let className = hashFn(filterBaseConditions(allConditions), utility.transform(prop, withoutImportant(sanitize(value))).className);
|
|
354
|
+
if (important) className = `${className}!`;
|
|
355
|
+
classNames.add(className);
|
|
356
|
+
});
|
|
357
|
+
return Array.from(classNames).join(" ");
|
|
358
|
+
});
|
|
415
359
|
}
|
|
416
360
|
function compactStyles(...styles) {
|
|
417
|
-
|
|
361
|
+
return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
|
|
418
362
|
}
|
|
419
363
|
function createMergeCss(context) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
364
|
+
function resolve(styles) {
|
|
365
|
+
const allStyles = compactStyles(...styles);
|
|
366
|
+
if (allStyles.length === 1) return allStyles;
|
|
367
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
368
|
+
}
|
|
369
|
+
function mergeCss(...styles) {
|
|
370
|
+
return mergeProps(...resolve(styles));
|
|
371
|
+
}
|
|
372
|
+
function assignCss(...styles) {
|
|
373
|
+
return Object.assign({}, ...resolve(styles));
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
mergeCss: memo(mergeCss),
|
|
377
|
+
assignCss
|
|
378
|
+
};
|
|
432
379
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
function esc(string) {
|
|
437
|
-
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/css-var.ts
|
|
382
|
+
const escRegex = /[^a-zA-Z0-9_\u0081-\uffff-]/g;
|
|
383
|
+
function esc$1(string) {
|
|
384
|
+
return `${string}`.replace(escRegex, (s) => `\\${s}`);
|
|
438
385
|
}
|
|
439
|
-
|
|
440
|
-
function
|
|
441
|
-
|
|
386
|
+
const dashCaseRegex = /[A-Z]/g;
|
|
387
|
+
function dashCase$1(string) {
|
|
388
|
+
return string.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
442
389
|
}
|
|
443
390
|
function cssVar(name, options = {}) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
391
|
+
const { fallback = "", prefix = "", hash } = options;
|
|
392
|
+
const variable = hash ? [
|
|
393
|
+
"-",
|
|
394
|
+
prefix,
|
|
395
|
+
toHash(name)
|
|
396
|
+
].filter(Boolean).join("-") : dashCase$1([
|
|
397
|
+
"-",
|
|
398
|
+
prefix,
|
|
399
|
+
esc$1(name)
|
|
400
|
+
].filter(Boolean).join("-"));
|
|
401
|
+
return {
|
|
402
|
+
var: variable,
|
|
403
|
+
ref: `var(${variable}${fallback ? `, ${fallback}` : ""})`
|
|
404
|
+
};
|
|
451
405
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
} else {
|
|
467
|
-
current[key] = value;
|
|
468
|
-
}
|
|
469
|
-
} else {
|
|
470
|
-
current = current[key];
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
return target;
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/deep-set.ts
|
|
408
|
+
const deepSet = (target, path, value) => {
|
|
409
|
+
const isValueObject = isObject(value);
|
|
410
|
+
if (!path.length && isValueObject) return mergeProps(target, value);
|
|
411
|
+
let current = target;
|
|
412
|
+
for (let i = 0; i < path.length; i++) {
|
|
413
|
+
const key = path[i];
|
|
414
|
+
current[key] ||= {};
|
|
415
|
+
if (i === path.length - 1) if (isValueObject && isObject(current[key])) current[key] = mergeProps(current[key], value);
|
|
416
|
+
else current[key] = value;
|
|
417
|
+
else current = current[key];
|
|
418
|
+
}
|
|
419
|
+
return target;
|
|
474
420
|
};
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
function fromEntries(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region src/entries.ts
|
|
423
|
+
function fromEntries(entries) {
|
|
424
|
+
const result = {};
|
|
425
|
+
entries.forEach((kv) => {
|
|
426
|
+
result[kv[0]] = kv[1];
|
|
427
|
+
});
|
|
428
|
+
return result;
|
|
483
429
|
}
|
|
484
430
|
function entries(obj) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
return result;
|
|
431
|
+
const result = [];
|
|
432
|
+
for (const key in obj) result.push([key, obj[key]]);
|
|
433
|
+
return result;
|
|
490
434
|
}
|
|
491
435
|
function mapEntries(obj, f) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
436
|
+
const result = {};
|
|
437
|
+
for (const key in obj) {
|
|
438
|
+
const kv = f(key, obj[key]);
|
|
439
|
+
result[kv[0]] = kv[1];
|
|
440
|
+
}
|
|
441
|
+
return result;
|
|
498
442
|
}
|
|
499
|
-
|
|
500
|
-
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/error.ts
|
|
501
445
|
var BambooError = class extends Error {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
446
|
+
code;
|
|
447
|
+
hint;
|
|
448
|
+
constructor(code, message, opts) {
|
|
449
|
+
super(message, { cause: opts?.cause });
|
|
450
|
+
this.code = `ERR_BAMBOO_${code}`;
|
|
451
|
+
this.hint = opts?.hint;
|
|
452
|
+
}
|
|
509
453
|
};
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/esc.ts
|
|
456
|
+
const rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
|
|
457
|
+
const fcssescape = function(ch, asCodePoint) {
|
|
458
|
+
if (!asCodePoint) return "\\" + ch;
|
|
459
|
+
if (ch === "\0") return "�";
|
|
460
|
+
if (ch === "-" && ch.length === 1) return "\\-";
|
|
461
|
+
return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16);
|
|
518
462
|
};
|
|
519
|
-
|
|
520
|
-
|
|
463
|
+
const esc = (sel) => {
|
|
464
|
+
return (sel + "").replace(rcssescape, fcssescape);
|
|
521
465
|
};
|
|
522
|
-
|
|
523
|
-
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/flatten.ts
|
|
524
468
|
function filterDefault(path) {
|
|
525
|
-
|
|
526
|
-
|
|
469
|
+
if (path[0] === "DEFAULT") return path;
|
|
470
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
527
471
|
}
|
|
528
472
|
function flatten(values, stop) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
stop: stop ?? ((v) => {
|
|
540
|
-
return isObject(v) && "value" in v;
|
|
541
|
-
})
|
|
542
|
-
}
|
|
543
|
-
);
|
|
544
|
-
return result;
|
|
473
|
+
const result = {};
|
|
474
|
+
walkObject(values, (token, paths) => {
|
|
475
|
+
paths = filterDefault(paths);
|
|
476
|
+
if (token) result[paths.join(".")] = token.value;
|
|
477
|
+
}, { stop: stop ?? ((v) => {
|
|
478
|
+
return isObject(v) && "value" in v;
|
|
479
|
+
}) });
|
|
480
|
+
return result;
|
|
545
481
|
}
|
|
546
|
-
|
|
547
|
-
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/get-or-create-set.ts
|
|
548
484
|
function getOrCreateSet(map, key) {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
485
|
+
let set = map.get(key);
|
|
486
|
+
if (!set) {
|
|
487
|
+
map.set(key, /* @__PURE__ */ new Set());
|
|
488
|
+
set = map.get(key);
|
|
489
|
+
}
|
|
490
|
+
return set;
|
|
555
491
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/hypenate-property.ts
|
|
494
|
+
const wordRegex = /([A-Z])/g;
|
|
495
|
+
const msRegex = /^ms-/;
|
|
496
|
+
const hypenateProperty = memo((property) => {
|
|
497
|
+
if (property.startsWith("--")) return property;
|
|
498
|
+
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
|
|
563
499
|
});
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/is-css-function.ts
|
|
502
|
+
const fnRegExp = new RegExp(`^(${[
|
|
503
|
+
"min",
|
|
504
|
+
"max",
|
|
505
|
+
"clamp",
|
|
506
|
+
"calc"
|
|
507
|
+
].join("|")})\\(.*\\)`);
|
|
508
|
+
const isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region src/is-css-unit.ts
|
|
511
|
+
const lengthUnitsPattern = `(?:${"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|")})`;
|
|
512
|
+
const lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
|
|
513
|
+
const isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/is-css-var.ts
|
|
516
|
+
const isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region src/merge-anything.ts
|
|
519
|
+
/**
|
|
520
|
+
* Credits: https://github.com/mesqueeb/merge-anything
|
|
521
|
+
*/
|
|
522
|
+
const MERGE_OMIT$1 = new Set([
|
|
523
|
+
"__proto__",
|
|
524
|
+
"constructor",
|
|
525
|
+
"prototype"
|
|
526
|
+
]);
|
|
581
527
|
function concatArrays(originVal, newVal) {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
return newVal;
|
|
528
|
+
if (Array.isArray(originVal) && Array.isArray(newVal)) return originVal.concat(newVal);
|
|
529
|
+
return newVal;
|
|
586
530
|
}
|
|
587
531
|
function assignProp(carry, key, newVal, originalObject) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
});
|
|
597
|
-
}
|
|
532
|
+
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
533
|
+
if (propType === "enumerable") carry[key] = newVal;
|
|
534
|
+
if (propType === "nonenumerable") Object.defineProperty(carry, key, {
|
|
535
|
+
value: newVal,
|
|
536
|
+
enumerable: false,
|
|
537
|
+
writable: true,
|
|
538
|
+
configurable: true
|
|
539
|
+
});
|
|
598
540
|
}
|
|
599
541
|
function mergeRecursively(origin, newComer, compareFn) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
const targetVal = isObject(origin) ? origin[key] : void 0;
|
|
623
|
-
if (targetVal !== void 0 && isObject(newVal)) {
|
|
624
|
-
newVal = mergeRecursively(targetVal, newVal, compareFn);
|
|
625
|
-
}
|
|
626
|
-
const propToAssign = compareFn ? compareFn(targetVal, newVal, key) : newVal;
|
|
627
|
-
assignProp(carry, key, propToAssign, newComer);
|
|
628
|
-
return carry;
|
|
629
|
-
}, newObject);
|
|
630
|
-
return result;
|
|
542
|
+
if (!isObject(newComer)) return newComer;
|
|
543
|
+
let newObject = {};
|
|
544
|
+
if (isObject(origin)) {
|
|
545
|
+
const props = Object.getOwnPropertyNames(origin);
|
|
546
|
+
const symbols = Object.getOwnPropertySymbols(origin);
|
|
547
|
+
newObject = [...props, ...symbols].reduce((carry, key) => {
|
|
548
|
+
if (isString(key) && MERGE_OMIT$1.has(key)) return carry;
|
|
549
|
+
const targetVal = origin[key];
|
|
550
|
+
if (!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key) || isSymbol(key) && !Object.getOwnPropertySymbols(newComer).includes(key)) assignProp(carry, key, targetVal, origin);
|
|
551
|
+
return carry;
|
|
552
|
+
}, {});
|
|
553
|
+
}
|
|
554
|
+
const props = Object.getOwnPropertyNames(newComer);
|
|
555
|
+
const symbols = Object.getOwnPropertySymbols(newComer);
|
|
556
|
+
return [...props, ...symbols].reduce((carry, key) => {
|
|
557
|
+
if (isString(key) && MERGE_OMIT$1.has(key)) return carry;
|
|
558
|
+
let newVal = newComer[key];
|
|
559
|
+
const targetVal = isObject(origin) ? origin[key] : void 0;
|
|
560
|
+
if (targetVal !== void 0 && isObject(newVal)) newVal = mergeRecursively(targetVal, newVal, compareFn);
|
|
561
|
+
assignProp(carry, key, compareFn ? compareFn(targetVal, newVal, key) : newVal, newComer);
|
|
562
|
+
return carry;
|
|
563
|
+
}, newObject);
|
|
631
564
|
}
|
|
632
565
|
function mergeAndConcat(object, ...otherObjects) {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
566
|
+
return otherObjects.reduce((result, newComer) => {
|
|
567
|
+
return mergeRecursively(result, newComer, concatArrays);
|
|
568
|
+
}, object);
|
|
636
569
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/merge-with.ts
|
|
572
|
+
const MERGE_OMIT = new Set([
|
|
573
|
+
"__proto__",
|
|
574
|
+
"constructor",
|
|
575
|
+
"prototype"
|
|
576
|
+
]);
|
|
640
577
|
function mergeWith(target, ...sources) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
target[key] = source[key];
|
|
651
|
-
}
|
|
652
|
-
} else {
|
|
653
|
-
target[key] = merged;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
return target;
|
|
578
|
+
const customizer = sources.pop();
|
|
579
|
+
for (const source of sources) for (const key in source) {
|
|
580
|
+
if (isString(key) && MERGE_OMIT.has(key)) continue;
|
|
581
|
+
const merged = customizer(target[key], source[key]);
|
|
582
|
+
if (merged === void 0) if (isObject(target[key]) && isObject(source[key])) target[key] = mergeWith({}, target[key], source[key], customizer);
|
|
583
|
+
else target[key] = source[key];
|
|
584
|
+
else target[key] = merged;
|
|
585
|
+
}
|
|
586
|
+
return target;
|
|
658
587
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/traverse.ts
|
|
590
|
+
const defaultOptions = {
|
|
591
|
+
separator: ".",
|
|
592
|
+
maxDepth: Infinity
|
|
664
593
|
};
|
|
665
|
-
function traverse(obj,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
594
|
+
function traverse(obj, callback, options = defaultOptions) {
|
|
595
|
+
const maxDepth = options.maxDepth ?? defaultOptions.maxDepth;
|
|
596
|
+
const separator = options.separator ?? defaultOptions.separator;
|
|
597
|
+
const stack = [{
|
|
598
|
+
value: obj,
|
|
599
|
+
path: "",
|
|
600
|
+
paths: [],
|
|
601
|
+
depth: -1,
|
|
602
|
+
parent: null,
|
|
603
|
+
key: ""
|
|
604
|
+
}];
|
|
605
|
+
while (stack.length > 0) {
|
|
606
|
+
const currentItem = stack.pop();
|
|
607
|
+
if (currentItem.parent !== null) callback(currentItem);
|
|
608
|
+
if (options.stop?.(currentItem)) continue;
|
|
609
|
+
if (isObjectOrArray(currentItem.value) && currentItem.depth < maxDepth) {
|
|
610
|
+
const keys = Object.keys(currentItem.value);
|
|
611
|
+
for (let i = keys.length - 1; i >= 0; i--) {
|
|
612
|
+
const key = keys[i];
|
|
613
|
+
const value = currentItem.value[key];
|
|
614
|
+
const path = currentItem.path ? currentItem.path + separator + key : key;
|
|
615
|
+
const paths = currentItem.paths.concat(key);
|
|
616
|
+
stack.push({
|
|
617
|
+
value,
|
|
618
|
+
path,
|
|
619
|
+
paths,
|
|
620
|
+
depth: currentItem.depth + 1,
|
|
621
|
+
parent: currentItem.value,
|
|
622
|
+
key
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
695
627
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
});
|
|
705
|
-
return result;
|
|
628
|
+
//#endregion
|
|
629
|
+
//#region src/omit.ts
|
|
630
|
+
const omit = (obj, paths) => {
|
|
631
|
+
const result = { ...obj };
|
|
632
|
+
traverse(result, ({ path, parent, key }) => {
|
|
633
|
+
if (paths.includes(path)) delete parent[key];
|
|
634
|
+
});
|
|
635
|
+
return result;
|
|
706
636
|
};
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/bamboo-config-name.ts
|
|
639
|
+
const BAMBOO_CONFIG_NAME = "__bamboo.config__";
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/pattern-fns.ts
|
|
642
|
+
const patternFns = {
|
|
643
|
+
map: mapObject,
|
|
644
|
+
isCssFunction,
|
|
645
|
+
isCssVar,
|
|
646
|
+
isCssUnit
|
|
717
647
|
};
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
648
|
+
const getPatternStyles = (pattern, styles) => {
|
|
649
|
+
if (!pattern?.defaultValues) return styles;
|
|
650
|
+
const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
|
|
651
|
+
return Object.assign({}, defaults, compact(styles));
|
|
722
652
|
};
|
|
723
|
-
|
|
724
|
-
|
|
653
|
+
//#endregion
|
|
654
|
+
//#region src/split.ts
|
|
725
655
|
function splitBy(value, separator = ",") {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
result.push(current);
|
|
743
|
-
return result;
|
|
656
|
+
const result = [];
|
|
657
|
+
let current = "";
|
|
658
|
+
let depth = 0;
|
|
659
|
+
for (let i = 0; i < value.length; i++) {
|
|
660
|
+
const char = value[i];
|
|
661
|
+
if (char === "(") depth++;
|
|
662
|
+
else if (char === ")") depth--;
|
|
663
|
+
else if (char === separator && depth === 0) {
|
|
664
|
+
result.push(current);
|
|
665
|
+
current = "";
|
|
666
|
+
continue;
|
|
667
|
+
}
|
|
668
|
+
current += char;
|
|
669
|
+
}
|
|
670
|
+
result.push(current);
|
|
671
|
+
return result;
|
|
744
672
|
}
|
|
745
673
|
function splitDotPath(path) {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
return acc;
|
|
754
|
-
}, []);
|
|
674
|
+
return path.split(".").reduce((acc, curr) => {
|
|
675
|
+
const last = acc[acc.length - 1];
|
|
676
|
+
if (last != null && !isNaN(Number(last)) && !isNaN(Number(curr))) acc[acc.length - 1] = `${last}.${curr}`;
|
|
677
|
+
else acc.push(curr);
|
|
678
|
+
return acc;
|
|
679
|
+
}, []);
|
|
755
680
|
}
|
|
756
681
|
function getNegativePath(path) {
|
|
757
|
-
|
|
682
|
+
return path.slice(0, -1).concat(`-${path.at(-1)}`);
|
|
758
683
|
}
|
|
759
684
|
function getDotPath(obj, path, fallback) {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
if (checkValue) {
|
|
769
|
-
return checkValue;
|
|
770
|
-
}
|
|
771
|
-
return getDotPath(obj?.[key], nextPath, fallback) ?? fallback;
|
|
685
|
+
if (typeof path !== "string") return fallback;
|
|
686
|
+
const idx = path.indexOf(".");
|
|
687
|
+
if (idx === -1) return obj?.[path] ?? fallback;
|
|
688
|
+
const key = path.slice(0, idx);
|
|
689
|
+
const nextPath = path.slice(idx + 1);
|
|
690
|
+
const checkValue = obj?.[key]?.[nextPath];
|
|
691
|
+
if (checkValue) return checkValue;
|
|
692
|
+
return getDotPath(obj?.[key], nextPath, fallback) ?? fallback;
|
|
772
693
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
return result;
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region src/pick.ts
|
|
696
|
+
const pick = (obj, paths) => {
|
|
697
|
+
const result = {};
|
|
698
|
+
traverse(obj, ({ path, value }) => {
|
|
699
|
+
if (paths.includes(path)) deepSet(result, splitDotPath(path), value);
|
|
700
|
+
});
|
|
701
|
+
return result;
|
|
784
702
|
};
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region src/property-priority.ts
|
|
705
|
+
/**
|
|
706
|
+
* Slightly modified from https://github.com/facebook/stylex/blob/main/packages/%40stylexjs/babel-plugin/src/shared/utils/property-priorities.js
|
|
707
|
+
* License: MIT
|
|
708
|
+
*/
|
|
709
|
+
const longHandPhysical = /* @__PURE__ */ new Set();
|
|
710
|
+
const longHandLogical = /* @__PURE__ */ new Set();
|
|
711
|
+
const shorthandsOfLonghands = /* @__PURE__ */ new Set();
|
|
712
|
+
const shorthandsOfShorthands = /* @__PURE__ */ new Set();
|
|
791
713
|
longHandLogical.add("backgroundBlendMode");
|
|
792
714
|
longHandLogical.add("isolation");
|
|
793
715
|
longHandLogical.add("mixBlendMode");
|
|
@@ -1236,226 +1158,130 @@ longHandLogical.add("mathShift");
|
|
|
1236
1158
|
longHandLogical.add("mathStyle");
|
|
1237
1159
|
longHandLogical.add("touchAction");
|
|
1238
1160
|
function getPropertyPriority(key) {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1161
|
+
if (key === "all") return 0;
|
|
1162
|
+
if (key.startsWith("--")) return 1;
|
|
1163
|
+
if (longHandPhysical.has(key)) return 4e3;
|
|
1164
|
+
if (longHandLogical.has(key)) return 3e3;
|
|
1165
|
+
if (shorthandsOfLonghands.has(key)) return 2e3;
|
|
1166
|
+
if (shorthandsOfShorthands.has(key)) return 1e3;
|
|
1167
|
+
return 3e3;
|
|
1246
1168
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/regex.ts
|
|
1171
|
+
const createRegex = (item) => {
|
|
1172
|
+
const regex = item.map((item) => typeof item === "string" ? `^${item}$` : item.source).join("|");
|
|
1173
|
+
return new RegExp(regex);
|
|
1252
1174
|
};
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1175
|
+
//#endregion
|
|
1176
|
+
//#region src/serialize.ts
|
|
1177
|
+
const stringifyJson = (config) => {
|
|
1178
|
+
return JSON.stringify(config, (_key, value) => {
|
|
1179
|
+
if (typeof value === "function") return value.toString();
|
|
1180
|
+
return value;
|
|
1181
|
+
});
|
|
1260
1182
|
};
|
|
1261
|
-
|
|
1262
|
-
|
|
1183
|
+
const parseJson = (config) => {
|
|
1184
|
+
return JSON.parse(config);
|
|
1263
1185
|
};
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
return Object.fromEntries(recipeParts);
|
|
1186
|
+
//#endregion
|
|
1187
|
+
//#region src/slot.ts
|
|
1188
|
+
const getSlotRecipes = (recipe = {}) => {
|
|
1189
|
+
const init = (slot) => ({
|
|
1190
|
+
className: [recipe.className, slot].filter(Boolean).join("__"),
|
|
1191
|
+
base: recipe.base?.[slot] ?? {},
|
|
1192
|
+
variants: {},
|
|
1193
|
+
defaultVariants: recipe.defaultVariants ?? {},
|
|
1194
|
+
compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
|
|
1195
|
+
});
|
|
1196
|
+
const recipeParts = (recipe.slots ?? []).map((slot) => [slot, init(slot)]);
|
|
1197
|
+
for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) recipeParts.forEach(([slot, slotRecipe]) => {
|
|
1198
|
+
slotRecipe.variants[variantsKey] ??= {};
|
|
1199
|
+
slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
|
|
1200
|
+
});
|
|
1201
|
+
return Object.fromEntries(recipeParts);
|
|
1285
1202
|
};
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1203
|
+
const getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({
|
|
1204
|
+
...compoundVariant,
|
|
1205
|
+
css: compoundVariant.css[slotName]
|
|
1206
|
+
}));
|
|
1207
|
+
//#endregion
|
|
1208
|
+
//#region src/split-props.ts
|
|
1289
1209
|
function splitProps(props, ...keys) {
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1210
|
+
const descriptors = Object.getOwnPropertyDescriptors(props);
|
|
1211
|
+
const dKeys = Object.keys(descriptors);
|
|
1212
|
+
const split = (k) => {
|
|
1213
|
+
const clone = {};
|
|
1214
|
+
for (let i = 0; i < k.length; i++) {
|
|
1215
|
+
const key = k[i];
|
|
1216
|
+
if (descriptors[key]) {
|
|
1217
|
+
Object.defineProperty(clone, key, descriptors[key]);
|
|
1218
|
+
delete descriptors[key];
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
return clone;
|
|
1222
|
+
};
|
|
1223
|
+
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
|
1224
|
+
return keys.map(fn).concat(split(dKeys));
|
|
1305
1225
|
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region src/to-json.ts
|
|
1308
1228
|
function mapToJson(map) {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
return obj;
|
|
1229
|
+
const obj = {};
|
|
1230
|
+
map.forEach((value, key) => {
|
|
1231
|
+
if (value instanceof Map) obj[key] = Object.fromEntries(value);
|
|
1232
|
+
else obj[key] = value;
|
|
1233
|
+
});
|
|
1234
|
+
return obj;
|
|
1318
1235
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region src/typegen.ts
|
|
1321
1238
|
function unionType(values, opts = {}) {
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1239
|
+
const { fallback, stringify = JSON.stringify } = opts;
|
|
1240
|
+
const arr = Array.from(values);
|
|
1241
|
+
if (fallback != null && !arr.length) return fallback;
|
|
1242
|
+
return arr.map((v) => stringify(v)).join(" | ");
|
|
1326
1243
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}, /* @__PURE__ */ new Set([]));
|
|
1336
|
-
return Array.from(set);
|
|
1244
|
+
//#endregion
|
|
1245
|
+
//#region src/uniq.ts
|
|
1246
|
+
const uniq = (...items) => {
|
|
1247
|
+
const set = items.reduce((acc, currItems) => {
|
|
1248
|
+
if (currItems) currItems.forEach((item) => acc.add(item));
|
|
1249
|
+
return acc;
|
|
1250
|
+
}, /* @__PURE__ */ new Set([]));
|
|
1251
|
+
return Array.from(set);
|
|
1337
1252
|
};
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1253
|
+
//#endregion
|
|
1254
|
+
//#region src/unit-conversion.ts
|
|
1255
|
+
const BASE_FONT_SIZE = 16;
|
|
1256
|
+
const UNIT_PX = "px";
|
|
1257
|
+
const UNIT_EM = "em";
|
|
1258
|
+
const UNIT_REM = "rem";
|
|
1259
|
+
const DIGIT_REGEX = new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`);
|
|
1260
|
+
const UNIT_REGEX = new RegExp(`${UNIT_PX}|${UNIT_EM}|${UNIT_REM}`);
|
|
1261
|
+
const VALUE_REGEX = new RegExp(`${DIGIT_REGEX.source}(${UNIT_REGEX.source})`);
|
|
1347
1262
|
function getUnit(value = "") {
|
|
1348
|
-
|
|
1349
|
-
return unit?.[1];
|
|
1263
|
+
return value.match(VALUE_REGEX)?.[1];
|
|
1350
1264
|
}
|
|
1351
1265
|
function toPx(value = "") {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
if (unit === UNIT_PX) {
|
|
1358
|
-
return value;
|
|
1359
|
-
}
|
|
1360
|
-
if (unit === UNIT_EM || unit === UNIT_REM) {
|
|
1361
|
-
return `${parseFloat(value) * BASE_FONT_SIZE}${UNIT_PX}`;
|
|
1362
|
-
}
|
|
1266
|
+
if (typeof value === "number") return `${value}px`;
|
|
1267
|
+
const unit = getUnit(value);
|
|
1268
|
+
if (!unit) return value;
|
|
1269
|
+
if (unit === UNIT_PX) return value;
|
|
1270
|
+
if (unit === UNIT_EM || unit === UNIT_REM) return `${parseFloat(value) * BASE_FONT_SIZE}${UNIT_PX}`;
|
|
1363
1271
|
}
|
|
1364
1272
|
function toEm(value = "", fontSize = BASE_FONT_SIZE) {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
if (unit === UNIT_PX) {
|
|
1371
|
-
return `${parseFloat(value) / fontSize}${UNIT_EM}`;
|
|
1372
|
-
}
|
|
1373
|
-
if (unit === UNIT_REM) {
|
|
1374
|
-
return `${parseFloat(value) * BASE_FONT_SIZE / fontSize}${UNIT_EM}`;
|
|
1375
|
-
}
|
|
1273
|
+
const unit = getUnit(value);
|
|
1274
|
+
if (!unit) return value;
|
|
1275
|
+
if (unit === UNIT_EM) return value;
|
|
1276
|
+
if (unit === UNIT_PX) return `${parseFloat(value) / fontSize}${UNIT_EM}`;
|
|
1277
|
+
if (unit === UNIT_REM) return `${parseFloat(value) * BASE_FONT_SIZE / fontSize}${UNIT_EM}`;
|
|
1376
1278
|
}
|
|
1377
1279
|
function toRem(value = "") {
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
if (unit === UNIT_EM) {
|
|
1384
|
-
return `${parseFloat(value)}${UNIT_REM}`;
|
|
1385
|
-
}
|
|
1386
|
-
if (unit === UNIT_PX) {
|
|
1387
|
-
return `${parseFloat(value) / BASE_FONT_SIZE}${UNIT_REM}`;
|
|
1388
|
-
}
|
|
1280
|
+
const unit = getUnit(value);
|
|
1281
|
+
if (!unit) return value;
|
|
1282
|
+
if (unit === UNIT_REM) return value;
|
|
1283
|
+
if (unit === UNIT_EM) return `${parseFloat(value)}${UNIT_REM}`;
|
|
1284
|
+
if (unit === UNIT_PX) return `${parseFloat(value) / BASE_FONT_SIZE}${UNIT_REM}`;
|
|
1389
1285
|
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
BambooError,
|
|
1393
|
-
CacheMap,
|
|
1394
|
-
assign,
|
|
1395
|
-
astish,
|
|
1396
|
-
calc,
|
|
1397
|
-
camelCaseProperty,
|
|
1398
|
-
capitalize,
|
|
1399
|
-
compact,
|
|
1400
|
-
createCss,
|
|
1401
|
-
createMergeCss,
|
|
1402
|
-
createRegex,
|
|
1403
|
-
cssVar,
|
|
1404
|
-
dashCase,
|
|
1405
|
-
deepSet,
|
|
1406
|
-
entries,
|
|
1407
|
-
esc2 as esc,
|
|
1408
|
-
filterBaseConditions,
|
|
1409
|
-
flatten,
|
|
1410
|
-
fromEntries,
|
|
1411
|
-
getArbitraryValue,
|
|
1412
|
-
getDotPath,
|
|
1413
|
-
getNegativePath,
|
|
1414
|
-
getOrCreateSet,
|
|
1415
|
-
getPatternStyles,
|
|
1416
|
-
getPropertyPriority,
|
|
1417
|
-
getSlotCompoundVariant,
|
|
1418
|
-
getSlotRecipes,
|
|
1419
|
-
getUnit,
|
|
1420
|
-
hypenateProperty,
|
|
1421
|
-
isBaseCondition,
|
|
1422
|
-
isBoolean,
|
|
1423
|
-
isCssFunction,
|
|
1424
|
-
isCssUnit,
|
|
1425
|
-
isCssVar2 as isCssVar,
|
|
1426
|
-
isFunction,
|
|
1427
|
-
isImportant,
|
|
1428
|
-
isObject,
|
|
1429
|
-
isObjectOrArray,
|
|
1430
|
-
isString,
|
|
1431
|
-
isSymbol,
|
|
1432
|
-
mapEntries,
|
|
1433
|
-
mapObject,
|
|
1434
|
-
mapToJson,
|
|
1435
|
-
markImportant,
|
|
1436
|
-
memo,
|
|
1437
|
-
mergeAndConcat,
|
|
1438
|
-
mergeProps,
|
|
1439
|
-
mergeWith,
|
|
1440
|
-
normalizeStyleObject,
|
|
1441
|
-
omit,
|
|
1442
|
-
parseJson,
|
|
1443
|
-
patternFns,
|
|
1444
|
-
pick,
|
|
1445
|
-
splitBy,
|
|
1446
|
-
splitDotPath,
|
|
1447
|
-
splitProps,
|
|
1448
|
-
stringifyJson,
|
|
1449
|
-
toEm,
|
|
1450
|
-
toHash,
|
|
1451
|
-
toPx,
|
|
1452
|
-
toRem,
|
|
1453
|
-
toResponsiveObject,
|
|
1454
|
-
traverse,
|
|
1455
|
-
uncapitalize,
|
|
1456
|
-
unionType,
|
|
1457
|
-
uniq,
|
|
1458
|
-
walkObject,
|
|
1459
|
-
withoutImportant,
|
|
1460
|
-
withoutSpace
|
|
1461
|
-
};
|
|
1286
|
+
//#endregion
|
|
1287
|
+
export { BAMBOO_CONFIG_NAME, BambooError, CacheMap, assign, astish, calc, camelCaseProperty, capitalize, compact, createCss, createMergeCss, createRegex, cssVar, dashCase, deepSet, entries, esc, filterBaseConditions, flatten, fromEntries, getArbitraryValue, getDotPath, getNegativePath, getOrCreateSet, getPatternStyles, getPropertyPriority, getSlotCompoundVariant, getSlotRecipes, getUnit, hypenateProperty, isBaseCondition, isBoolean, isCssFunction, isCssUnit, isCssVar, isFunction, isImportant, isObject, isObjectOrArray, isString, isSymbol, mapEntries, mapObject, mapToJson, markImportant, memo, mergeAndConcat, mergeProps, mergeWith, normalizeStyleObject, omit, parseJson, patternFns, pick, splitBy, splitDotPath, splitProps, stringifyJson, toEm, toHash, toPx, toRem, toResponsiveObject, traverse, uncapitalize, unionType, uniq, walkObject, withoutImportant, withoutSpace };
|