@bamboocss/shared 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +16 -0
- package/dist/astish.js +46 -0
- package/dist/astish.mjs +21 -0
- package/dist/index.js +1557 -0
- package/dist/index.mjs +1461 -0
- package/dist/normalize-html.js +37 -0
- package/dist/normalize-html.mjs +12 -0
- package/dist/shared.js +373 -0
- package/dist/shared.mjs +328 -0
- package/package.json +40 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1557 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
BAMBOO_CONFIG_NAME: () => BAMBOO_CONFIG_NAME,
|
|
24
|
+
BambooError: () => BambooError,
|
|
25
|
+
CacheMap: () => CacheMap,
|
|
26
|
+
assign: () => assign,
|
|
27
|
+
astish: () => astish,
|
|
28
|
+
calc: () => calc,
|
|
29
|
+
camelCaseProperty: () => camelCaseProperty,
|
|
30
|
+
capitalize: () => capitalize,
|
|
31
|
+
compact: () => compact,
|
|
32
|
+
createCss: () => createCss,
|
|
33
|
+
createMergeCss: () => createMergeCss,
|
|
34
|
+
createRegex: () => createRegex,
|
|
35
|
+
cssVar: () => cssVar,
|
|
36
|
+
dashCase: () => dashCase,
|
|
37
|
+
deepSet: () => deepSet,
|
|
38
|
+
entries: () => entries,
|
|
39
|
+
esc: () => esc2,
|
|
40
|
+
filterBaseConditions: () => filterBaseConditions,
|
|
41
|
+
flatten: () => flatten,
|
|
42
|
+
fromEntries: () => fromEntries,
|
|
43
|
+
getArbitraryValue: () => getArbitraryValue,
|
|
44
|
+
getDotPath: () => getDotPath,
|
|
45
|
+
getNegativePath: () => getNegativePath,
|
|
46
|
+
getOrCreateSet: () => getOrCreateSet,
|
|
47
|
+
getPatternStyles: () => getPatternStyles,
|
|
48
|
+
getPropertyPriority: () => getPropertyPriority,
|
|
49
|
+
getSlotCompoundVariant: () => getSlotCompoundVariant,
|
|
50
|
+
getSlotRecipes: () => getSlotRecipes,
|
|
51
|
+
getUnit: () => getUnit,
|
|
52
|
+
hypenateProperty: () => hypenateProperty,
|
|
53
|
+
isBaseCondition: () => isBaseCondition,
|
|
54
|
+
isBoolean: () => isBoolean,
|
|
55
|
+
isCssFunction: () => isCssFunction,
|
|
56
|
+
isCssUnit: () => isCssUnit,
|
|
57
|
+
isCssVar: () => isCssVar2,
|
|
58
|
+
isFunction: () => isFunction,
|
|
59
|
+
isImportant: () => isImportant,
|
|
60
|
+
isObject: () => isObject,
|
|
61
|
+
isObjectOrArray: () => isObjectOrArray,
|
|
62
|
+
isString: () => isString,
|
|
63
|
+
isSymbol: () => isSymbol,
|
|
64
|
+
mapEntries: () => mapEntries,
|
|
65
|
+
mapObject: () => mapObject,
|
|
66
|
+
mapToJson: () => mapToJson,
|
|
67
|
+
markImportant: () => markImportant,
|
|
68
|
+
memo: () => memo,
|
|
69
|
+
mergeAndConcat: () => mergeAndConcat,
|
|
70
|
+
mergeProps: () => mergeProps,
|
|
71
|
+
mergeWith: () => mergeWith,
|
|
72
|
+
normalizeStyleObject: () => normalizeStyleObject,
|
|
73
|
+
omit: () => omit,
|
|
74
|
+
parseJson: () => parseJson,
|
|
75
|
+
patternFns: () => patternFns,
|
|
76
|
+
pick: () => pick,
|
|
77
|
+
splitBy: () => splitBy,
|
|
78
|
+
splitDotPath: () => splitDotPath,
|
|
79
|
+
splitProps: () => splitProps,
|
|
80
|
+
stringifyJson: () => stringifyJson,
|
|
81
|
+
toEm: () => toEm,
|
|
82
|
+
toHash: () => toHash,
|
|
83
|
+
toPx: () => toPx,
|
|
84
|
+
toRem: () => toRem,
|
|
85
|
+
toResponsiveObject: () => toResponsiveObject,
|
|
86
|
+
traverse: () => traverse,
|
|
87
|
+
uncapitalize: () => uncapitalize,
|
|
88
|
+
unionType: () => unionType,
|
|
89
|
+
uniq: () => uniq,
|
|
90
|
+
walkObject: () => walkObject,
|
|
91
|
+
withoutImportant: () => withoutImportant,
|
|
92
|
+
withoutSpace: () => withoutSpace
|
|
93
|
+
});
|
|
94
|
+
module.exports = __toCommonJS(index_exports);
|
|
95
|
+
|
|
96
|
+
// src/arbitrary-value.ts
|
|
97
|
+
var getArbitraryValue = (_value) => {
|
|
98
|
+
if (!_value || typeof _value !== "string") return _value;
|
|
99
|
+
const value = _value.trim();
|
|
100
|
+
if (value[0] === "[" && value[value.length - 1] === "]") {
|
|
101
|
+
const innerValue = value.slice(1, -1);
|
|
102
|
+
let bracketCount = 0;
|
|
103
|
+
for (let i = 0; i < innerValue.length; i++) {
|
|
104
|
+
if (innerValue[i] === "[") {
|
|
105
|
+
bracketCount++;
|
|
106
|
+
} else if (innerValue[i] === "]") {
|
|
107
|
+
if (bracketCount === 0) {
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
bracketCount--;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (bracketCount === 0) {
|
|
114
|
+
return innerValue.trim();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// src/assert.ts
|
|
121
|
+
var isString = (v) => typeof v === "string";
|
|
122
|
+
var isBoolean = (v) => typeof v === "boolean";
|
|
123
|
+
var isFunction = (v) => typeof v === "function";
|
|
124
|
+
function isObject(value) {
|
|
125
|
+
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
126
|
+
}
|
|
127
|
+
var isSymbol = (v) => typeof v === "symbol";
|
|
128
|
+
var isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
|
|
129
|
+
|
|
130
|
+
// src/assign.ts
|
|
131
|
+
function assign(target, ...sources) {
|
|
132
|
+
for (const source of sources) {
|
|
133
|
+
for (const key in source) {
|
|
134
|
+
if (!target?.hasOwnProperty?.(key)) {
|
|
135
|
+
target[key] = source[key];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return target;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// src/astish.ts
|
|
143
|
+
var newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
|
|
144
|
+
var ruleClean = /\/\*[^]*?\*\/| +/g;
|
|
145
|
+
var ruleNewline = /\n+/g;
|
|
146
|
+
var empty = " ";
|
|
147
|
+
var astish = (val, tree = [{}]) => {
|
|
148
|
+
if (!val) return tree[0];
|
|
149
|
+
let block, left;
|
|
150
|
+
while (block = newRule.exec(val.replace(ruleClean, ""))) {
|
|
151
|
+
if (block[4]) tree.shift();
|
|
152
|
+
else if (block[3]) {
|
|
153
|
+
left = block[3].replace(ruleNewline, empty).trim();
|
|
154
|
+
if (!left.includes("&") && !left.startsWith("@")) left = "& " + left;
|
|
155
|
+
tree.unshift(tree[0][left] = tree[0][left] || {});
|
|
156
|
+
} else tree[0][block[1]] = block[2].replace(ruleNewline, empty).trim();
|
|
157
|
+
}
|
|
158
|
+
return tree[0];
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// src/cache-map.ts
|
|
162
|
+
var CacheMap = class {
|
|
163
|
+
cache;
|
|
164
|
+
keysInUse;
|
|
165
|
+
maxCacheSize;
|
|
166
|
+
constructor(maxCacheSize = 1e3) {
|
|
167
|
+
this.maxCacheSize = maxCacheSize;
|
|
168
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
169
|
+
this.keysInUse = [];
|
|
170
|
+
}
|
|
171
|
+
get(key) {
|
|
172
|
+
if (!this.cache.has(key)) {
|
|
173
|
+
return void 0;
|
|
174
|
+
}
|
|
175
|
+
this.updateKeyUsage(key);
|
|
176
|
+
return this.cache.get(key);
|
|
177
|
+
}
|
|
178
|
+
set(key, value) {
|
|
179
|
+
if (!this.cache.has(key) && this.cache.size === this.maxCacheSize) {
|
|
180
|
+
this.evictLeastRecentlyUsed();
|
|
181
|
+
}
|
|
182
|
+
this.cache.set(key, value);
|
|
183
|
+
this.updateKeyUsage(key);
|
|
184
|
+
return this;
|
|
185
|
+
}
|
|
186
|
+
delete(key) {
|
|
187
|
+
const result = this.cache.delete(key);
|
|
188
|
+
if (result) {
|
|
189
|
+
const index = this.keysInUse.indexOf(key);
|
|
190
|
+
if (index !== -1) {
|
|
191
|
+
this.keysInUse.splice(index, 1);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return result;
|
|
195
|
+
}
|
|
196
|
+
updateKeyUsage(key) {
|
|
197
|
+
const index = this.keysInUse.indexOf(key);
|
|
198
|
+
if (index !== -1) {
|
|
199
|
+
this.keysInUse.splice(index, 1);
|
|
200
|
+
}
|
|
201
|
+
this.keysInUse.push(key);
|
|
202
|
+
}
|
|
203
|
+
evictLeastRecentlyUsed() {
|
|
204
|
+
const keyToEvict = this.keysInUse.shift();
|
|
205
|
+
if (keyToEvict !== void 0) {
|
|
206
|
+
this.cache.delete(keyToEvict);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
clear() {
|
|
210
|
+
this.cache.clear();
|
|
211
|
+
this.keysInUse = [];
|
|
212
|
+
}
|
|
213
|
+
has(key) {
|
|
214
|
+
return this.cache.has(key);
|
|
215
|
+
}
|
|
216
|
+
get size() {
|
|
217
|
+
return this.cache.size;
|
|
218
|
+
}
|
|
219
|
+
forEach(callback2, thisArg) {
|
|
220
|
+
this.cache.forEach(callback2, thisArg);
|
|
221
|
+
}
|
|
222
|
+
keys() {
|
|
223
|
+
return this.cache.keys();
|
|
224
|
+
}
|
|
225
|
+
values() {
|
|
226
|
+
return this.cache.values();
|
|
227
|
+
}
|
|
228
|
+
entries() {
|
|
229
|
+
return this.cache.entries();
|
|
230
|
+
}
|
|
231
|
+
getOrInsert(key, defaultValue) {
|
|
232
|
+
if (this.cache.has(key)) {
|
|
233
|
+
this.updateKeyUsage(key);
|
|
234
|
+
return this.cache.get(key);
|
|
235
|
+
}
|
|
236
|
+
this.set(key, defaultValue);
|
|
237
|
+
return defaultValue;
|
|
238
|
+
}
|
|
239
|
+
getOrInsertComputed(key, callback2) {
|
|
240
|
+
if (this.cache.has(key)) {
|
|
241
|
+
this.updateKeyUsage(key);
|
|
242
|
+
return this.cache.get(key);
|
|
243
|
+
}
|
|
244
|
+
const value = callback2(key);
|
|
245
|
+
this.set(key, value);
|
|
246
|
+
return value;
|
|
247
|
+
}
|
|
248
|
+
[Symbol.iterator]() {
|
|
249
|
+
return this.cache[Symbol.iterator]();
|
|
250
|
+
}
|
|
251
|
+
[Symbol.toStringTag] = "CacheMap";
|
|
252
|
+
toJSON = () => {
|
|
253
|
+
return this.cache;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// src/calc.ts
|
|
258
|
+
function isCssVar(value) {
|
|
259
|
+
return isObject(value) && "ref" in value;
|
|
260
|
+
}
|
|
261
|
+
function getRef(operand) {
|
|
262
|
+
return isCssVar(operand) ? operand.ref : operand.toString();
|
|
263
|
+
}
|
|
264
|
+
var calcRegex = /calc/g;
|
|
265
|
+
var toExpression = (operator, ...operands) => operands.map(getRef).join(` ${operator} `).replace(calcRegex, "");
|
|
266
|
+
var multiply = (...operands) => `calc(${toExpression("*", ...operands)})`;
|
|
267
|
+
var calc = {
|
|
268
|
+
negate(x) {
|
|
269
|
+
const value = getRef(x);
|
|
270
|
+
if (value != null && !Number.isNaN(parseFloat(value))) {
|
|
271
|
+
return String(value).startsWith("-") ? String(value).slice(1) : `-${value}`;
|
|
272
|
+
}
|
|
273
|
+
return multiply(value, -1);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
// src/memo.ts
|
|
278
|
+
var memo = (fn) => {
|
|
279
|
+
const cache = /* @__PURE__ */ new Map();
|
|
280
|
+
const get = (...args) => {
|
|
281
|
+
const key = JSON.stringify(args);
|
|
282
|
+
if (cache.has(key)) {
|
|
283
|
+
return cache.get(key);
|
|
284
|
+
}
|
|
285
|
+
const result = fn(...args);
|
|
286
|
+
cache.set(key, result);
|
|
287
|
+
return result;
|
|
288
|
+
};
|
|
289
|
+
return get;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
// src/camelcase-property.ts
|
|
293
|
+
var regex = /-(\w|$)/g;
|
|
294
|
+
var callback = (_dashChar, char) => char.toUpperCase();
|
|
295
|
+
var camelCaseProperty = memo((property) => {
|
|
296
|
+
if (property.startsWith("--")) return property;
|
|
297
|
+
let str = property.toLowerCase();
|
|
298
|
+
str = str.startsWith("-ms-") ? str.substring(1) : str;
|
|
299
|
+
return str.replace(regex, callback);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// src/capitalize.ts
|
|
303
|
+
var capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
304
|
+
var camelCaseRegex = /([a-z])([A-Z])/g;
|
|
305
|
+
var dashCase = (s) => s.replace(camelCaseRegex, "$1-$2").toLowerCase();
|
|
306
|
+
var uncapitalize = (s) => s.charAt(0).toLowerCase() + s.slice(1);
|
|
307
|
+
|
|
308
|
+
// src/compact.ts
|
|
309
|
+
function compact(value) {
|
|
310
|
+
return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// src/condition.ts
|
|
314
|
+
var isBaseCondition = (v) => v === "base";
|
|
315
|
+
function filterBaseConditions(c) {
|
|
316
|
+
return c.slice().filter((v) => !isBaseCondition(v));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// src/hash.ts
|
|
320
|
+
function toChar(code) {
|
|
321
|
+
return String.fromCharCode(code + (code > 25 ? 39 : 97));
|
|
322
|
+
}
|
|
323
|
+
function toName(code) {
|
|
324
|
+
let name = "";
|
|
325
|
+
let x;
|
|
326
|
+
for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toChar(x % 52) + name;
|
|
327
|
+
return toChar(x % 52) + name;
|
|
328
|
+
}
|
|
329
|
+
function toPhash(h, x) {
|
|
330
|
+
let i = x.length;
|
|
331
|
+
while (i) h = h * 33 ^ x.charCodeAt(--i);
|
|
332
|
+
return h;
|
|
333
|
+
}
|
|
334
|
+
function toHash(value) {
|
|
335
|
+
return toName(toPhash(5381, value) >>> 0);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// src/important.ts
|
|
339
|
+
var importantRegex = /\s*!(important)?/i;
|
|
340
|
+
function isImportant(value) {
|
|
341
|
+
return typeof value === "string" ? importantRegex.test(value) : false;
|
|
342
|
+
}
|
|
343
|
+
function withoutImportant(value) {
|
|
344
|
+
return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
|
|
345
|
+
}
|
|
346
|
+
function withoutSpace(str) {
|
|
347
|
+
return typeof str === "string" ? str.replaceAll(" ", "_") : str;
|
|
348
|
+
}
|
|
349
|
+
function markImportant(obj) {
|
|
350
|
+
if (typeof obj !== "object" || obj === null) {
|
|
351
|
+
return obj;
|
|
352
|
+
}
|
|
353
|
+
const result = Array.isArray(obj) ? [] : {};
|
|
354
|
+
const stack = [{ obj, result }];
|
|
355
|
+
while (stack.length > 0) {
|
|
356
|
+
const { obj: obj2, result: result2 } = stack.pop();
|
|
357
|
+
for (const [key, value] of Object.entries(obj2)) {
|
|
358
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
359
|
+
result2[key] = `${value} !important`;
|
|
360
|
+
} else if (typeof value === "object" && value !== null) {
|
|
361
|
+
const next = Array.isArray(value) ? [] : {};
|
|
362
|
+
result2[key] = next;
|
|
363
|
+
stack.push({ obj: value, result: next });
|
|
364
|
+
} else {
|
|
365
|
+
result2[key] = value;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return result;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// src/merge-props.ts
|
|
373
|
+
var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
374
|
+
function mergeProps(...sources) {
|
|
375
|
+
return sources.reduce((prev, obj) => {
|
|
376
|
+
if (!obj) return prev;
|
|
377
|
+
Object.keys(obj).forEach((key) => {
|
|
378
|
+
if (MERGE_OMIT.has(key)) return;
|
|
379
|
+
const prevValue = prev[key];
|
|
380
|
+
const value = obj[key];
|
|
381
|
+
if (isObject(prevValue) && isObject(value)) {
|
|
382
|
+
prev[key] = mergeProps(prevValue, value);
|
|
383
|
+
} else {
|
|
384
|
+
prev[key] = value;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
return prev;
|
|
388
|
+
}, {});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// src/walk-object.ts
|
|
392
|
+
var isNotNullish = (element) => element != null;
|
|
393
|
+
function walkObject(target, predicate, options = {}) {
|
|
394
|
+
const { stop, getKey } = options;
|
|
395
|
+
function inner(value, path = []) {
|
|
396
|
+
if (isObjectOrArray(value)) {
|
|
397
|
+
const result = {};
|
|
398
|
+
for (const [prop, child] of Object.entries(value)) {
|
|
399
|
+
const key = getKey?.(prop, child) ?? prop;
|
|
400
|
+
const childPath = [...path, key];
|
|
401
|
+
if (stop?.(value, childPath)) {
|
|
402
|
+
return predicate(value, path);
|
|
403
|
+
}
|
|
404
|
+
const next = inner(child, childPath);
|
|
405
|
+
if (isNotNullish(next)) {
|
|
406
|
+
result[key] = next;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
return predicate(value, path);
|
|
412
|
+
}
|
|
413
|
+
return inner(target);
|
|
414
|
+
}
|
|
415
|
+
function mapObject(obj, fn) {
|
|
416
|
+
if (Array.isArray(obj)) return obj.map((value) => fn(value));
|
|
417
|
+
if (!isObject(obj)) return fn(obj);
|
|
418
|
+
return walkObject(obj, (value) => fn(value));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// src/normalize-style-object.ts
|
|
422
|
+
function toResponsiveObject(values, breakpoints) {
|
|
423
|
+
return values.reduce(
|
|
424
|
+
(acc, current, index) => {
|
|
425
|
+
const key = breakpoints[index];
|
|
426
|
+
if (current != null) {
|
|
427
|
+
acc[key] = current;
|
|
428
|
+
}
|
|
429
|
+
return acc;
|
|
430
|
+
},
|
|
431
|
+
{}
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
function normalizeStyleObject(styles, context, shorthand = true) {
|
|
435
|
+
const { utility, conditions } = context;
|
|
436
|
+
const { hasShorthand, resolveShorthand } = utility;
|
|
437
|
+
return walkObject(
|
|
438
|
+
styles,
|
|
439
|
+
(value) => {
|
|
440
|
+
return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
stop: (value) => Array.isArray(value),
|
|
444
|
+
getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// src/classname.ts
|
|
450
|
+
var fallbackCondition = {
|
|
451
|
+
shift: (v) => v,
|
|
452
|
+
finalize: (v) => v,
|
|
453
|
+
breakpoints: { keys: [] }
|
|
454
|
+
};
|
|
455
|
+
var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
|
|
456
|
+
var ENTRY_SEP = "]___[";
|
|
457
|
+
var COND_SEP = "<___>";
|
|
458
|
+
function createCss(context) {
|
|
459
|
+
const { utility, hash, grouped, conditions: conds = fallbackCondition } = context;
|
|
460
|
+
const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
|
|
461
|
+
const hashFn = (conditions, className) => {
|
|
462
|
+
let result;
|
|
463
|
+
if (hash) {
|
|
464
|
+
const baseArray = [...conds.finalize(conditions), className];
|
|
465
|
+
result = formatClassName(utility.toHash(baseArray, toHash));
|
|
466
|
+
} else {
|
|
467
|
+
const baseArray = [...conds.finalize(conditions), formatClassName(className)];
|
|
468
|
+
result = baseArray.join(":");
|
|
469
|
+
}
|
|
470
|
+
return result;
|
|
471
|
+
};
|
|
472
|
+
if (grouped) {
|
|
473
|
+
return memo(({ base, ...styles } = {}) => {
|
|
474
|
+
const styleObject = Object.assign(styles, base);
|
|
475
|
+
const normalizedObject = normalizeStyleObject(styleObject, context);
|
|
476
|
+
const hashes = [];
|
|
477
|
+
walkObject(normalizedObject, (value, paths) => {
|
|
478
|
+
if (value == null) return;
|
|
479
|
+
const [prop, ...allConditions] = conds.shift(paths);
|
|
480
|
+
const conditions = filterBaseConditions(allConditions);
|
|
481
|
+
const parts = [`${prop}${ENTRY_SEP}value:${value}`];
|
|
482
|
+
if (conditions.length) {
|
|
483
|
+
parts.push(`cond:${conditions.join(COND_SEP)}`);
|
|
484
|
+
}
|
|
485
|
+
hashes.push(parts.join(ENTRY_SEP));
|
|
486
|
+
});
|
|
487
|
+
if (hashes.length === 0) return "";
|
|
488
|
+
hashes.sort();
|
|
489
|
+
const groupId = hashes.join("|");
|
|
490
|
+
const shortHash = utility.toHash(["grouped", groupId], toHash);
|
|
491
|
+
return formatClassName(shortHash);
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
return memo(({ base, ...styles } = {}) => {
|
|
495
|
+
const styleObject = Object.assign(styles, base);
|
|
496
|
+
const normalizedObject = normalizeStyleObject(styleObject, context);
|
|
497
|
+
const classNames = /* @__PURE__ */ new Set();
|
|
498
|
+
walkObject(normalizedObject, (value, paths) => {
|
|
499
|
+
if (value == null) return;
|
|
500
|
+
const important = isImportant(value);
|
|
501
|
+
const [prop, ...allConditions] = conds.shift(paths);
|
|
502
|
+
const conditions = filterBaseConditions(allConditions);
|
|
503
|
+
const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
|
|
504
|
+
let className = hashFn(conditions, transformed.className);
|
|
505
|
+
if (important) className = `${className}!`;
|
|
506
|
+
classNames.add(className);
|
|
507
|
+
});
|
|
508
|
+
return Array.from(classNames).join(" ");
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
function compactStyles(...styles) {
|
|
512
|
+
return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
|
|
513
|
+
}
|
|
514
|
+
function createMergeCss(context) {
|
|
515
|
+
function resolve(styles) {
|
|
516
|
+
const allStyles = compactStyles(...styles);
|
|
517
|
+
if (allStyles.length === 1) return allStyles;
|
|
518
|
+
return allStyles.map((style) => normalizeStyleObject(style, context));
|
|
519
|
+
}
|
|
520
|
+
function mergeCss(...styles) {
|
|
521
|
+
return mergeProps(...resolve(styles));
|
|
522
|
+
}
|
|
523
|
+
function assignCss(...styles) {
|
|
524
|
+
return Object.assign({}, ...resolve(styles));
|
|
525
|
+
}
|
|
526
|
+
return { mergeCss: memo(mergeCss), assignCss };
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// src/css-var.ts
|
|
530
|
+
var escRegex = /[^a-zA-Z0-9_\u0081-\uffff-]/g;
|
|
531
|
+
function esc(string) {
|
|
532
|
+
return `${string}`.replace(escRegex, (s) => `\\${s}`);
|
|
533
|
+
}
|
|
534
|
+
var dashCaseRegex = /[A-Z]/g;
|
|
535
|
+
function dashCase2(string) {
|
|
536
|
+
return string.replace(dashCaseRegex, (match) => `-${match.toLowerCase()}`);
|
|
537
|
+
}
|
|
538
|
+
function cssVar(name, options = {}) {
|
|
539
|
+
const { fallback = "", prefix = "", hash } = options;
|
|
540
|
+
const variable = hash ? ["-", prefix, toHash(name)].filter(Boolean).join("-") : dashCase2(["-", prefix, esc(name)].filter(Boolean).join("-"));
|
|
541
|
+
const result = {
|
|
542
|
+
var: variable,
|
|
543
|
+
ref: `var(${variable}${fallback ? `, ${fallback}` : ""})`
|
|
544
|
+
};
|
|
545
|
+
return result;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// src/deep-set.ts
|
|
549
|
+
var deepSet = (target, path, value) => {
|
|
550
|
+
const isValueObject = isObject(value);
|
|
551
|
+
if (!path.length && isValueObject) {
|
|
552
|
+
return mergeProps(target, value);
|
|
553
|
+
}
|
|
554
|
+
let current = target;
|
|
555
|
+
for (let i = 0; i < path.length; i++) {
|
|
556
|
+
const key = path[i];
|
|
557
|
+
current[key] ||= {};
|
|
558
|
+
if (i === path.length - 1) {
|
|
559
|
+
if (isValueObject && isObject(current[key])) {
|
|
560
|
+
current[key] = mergeProps(current[key], value);
|
|
561
|
+
} else {
|
|
562
|
+
current[key] = value;
|
|
563
|
+
}
|
|
564
|
+
} else {
|
|
565
|
+
current = current[key];
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return target;
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
// src/entries.ts
|
|
572
|
+
function fromEntries(entries2) {
|
|
573
|
+
const result = {};
|
|
574
|
+
entries2.forEach((kv) => {
|
|
575
|
+
result[kv[0]] = kv[1];
|
|
576
|
+
});
|
|
577
|
+
return result;
|
|
578
|
+
}
|
|
579
|
+
function entries(obj) {
|
|
580
|
+
const result = [];
|
|
581
|
+
for (const key in obj) {
|
|
582
|
+
result.push([key, obj[key]]);
|
|
583
|
+
}
|
|
584
|
+
return result;
|
|
585
|
+
}
|
|
586
|
+
function mapEntries(obj, f) {
|
|
587
|
+
const result = {};
|
|
588
|
+
for (const key in obj) {
|
|
589
|
+
const kv = f(key, obj[key]);
|
|
590
|
+
result[kv[0]] = kv[1];
|
|
591
|
+
}
|
|
592
|
+
return result;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// src/error.ts
|
|
596
|
+
var BambooError = class extends Error {
|
|
597
|
+
code;
|
|
598
|
+
hint;
|
|
599
|
+
constructor(code, message, opts) {
|
|
600
|
+
super(message, { cause: opts?.cause });
|
|
601
|
+
this.code = `ERR_BAMBOO_${code}`;
|
|
602
|
+
this.hint = opts?.hint;
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
// src/esc.ts
|
|
607
|
+
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g;
|
|
608
|
+
var fcssescape = function(ch, asCodePoint) {
|
|
609
|
+
if (!asCodePoint) return "\\" + ch;
|
|
610
|
+
if (ch === "\0") return "\uFFFD";
|
|
611
|
+
if (ch === "-" && ch.length === 1) return "\\-";
|
|
612
|
+
return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16);
|
|
613
|
+
};
|
|
614
|
+
var esc2 = (sel) => {
|
|
615
|
+
return (sel + "").replace(rcssescape, fcssescape);
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/flatten.ts
|
|
619
|
+
function filterDefault(path) {
|
|
620
|
+
if (path[0] === "DEFAULT") return path;
|
|
621
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
622
|
+
}
|
|
623
|
+
function flatten(values, stop) {
|
|
624
|
+
const result = {};
|
|
625
|
+
walkObject(
|
|
626
|
+
values,
|
|
627
|
+
(token, paths) => {
|
|
628
|
+
paths = filterDefault(paths);
|
|
629
|
+
if (token) {
|
|
630
|
+
result[paths.join(".")] = token.value;
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
stop: stop ?? ((v) => {
|
|
635
|
+
return isObject(v) && "value" in v;
|
|
636
|
+
})
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
return result;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// src/get-or-create-set.ts
|
|
643
|
+
function getOrCreateSet(map, key) {
|
|
644
|
+
let set = map.get(key);
|
|
645
|
+
if (!set) {
|
|
646
|
+
map.set(key, /* @__PURE__ */ new Set());
|
|
647
|
+
set = map.get(key);
|
|
648
|
+
}
|
|
649
|
+
return set;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// src/hypenate-property.ts
|
|
653
|
+
var wordRegex = /([A-Z])/g;
|
|
654
|
+
var msRegex = /^ms-/;
|
|
655
|
+
var hypenateProperty = memo((property) => {
|
|
656
|
+
if (property.startsWith("--")) return property;
|
|
657
|
+
return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
// src/is-css-function.ts
|
|
661
|
+
var fns = ["min", "max", "clamp", "calc"];
|
|
662
|
+
var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
|
|
663
|
+
var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
|
|
664
|
+
|
|
665
|
+
// src/is-css-unit.ts
|
|
666
|
+
var lengthUnits = "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,%";
|
|
667
|
+
var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
|
|
668
|
+
var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
|
|
669
|
+
var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
|
|
670
|
+
|
|
671
|
+
// src/is-css-var.ts
|
|
672
|
+
var isCssVar2 = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
|
|
673
|
+
|
|
674
|
+
// src/merge-anything.ts
|
|
675
|
+
var MERGE_OMIT2 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
676
|
+
function concatArrays(originVal, newVal) {
|
|
677
|
+
if (Array.isArray(originVal) && Array.isArray(newVal)) {
|
|
678
|
+
return originVal.concat(newVal);
|
|
679
|
+
}
|
|
680
|
+
return newVal;
|
|
681
|
+
}
|
|
682
|
+
function assignProp(carry, key, newVal, originalObject) {
|
|
683
|
+
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
684
|
+
if (propType === "enumerable") carry[key] = newVal;
|
|
685
|
+
if (propType === "nonenumerable") {
|
|
686
|
+
Object.defineProperty(carry, key, {
|
|
687
|
+
value: newVal,
|
|
688
|
+
enumerable: false,
|
|
689
|
+
writable: true,
|
|
690
|
+
configurable: true
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function mergeRecursively(origin, newComer, compareFn) {
|
|
695
|
+
if (!isObject(newComer)) return newComer;
|
|
696
|
+
let newObject = {};
|
|
697
|
+
if (isObject(origin)) {
|
|
698
|
+
const props2 = Object.getOwnPropertyNames(origin);
|
|
699
|
+
const symbols2 = Object.getOwnPropertySymbols(origin);
|
|
700
|
+
newObject = [...props2, ...symbols2].reduce(
|
|
701
|
+
(carry, key) => {
|
|
702
|
+
if (isString(key) && MERGE_OMIT2.has(key)) return carry;
|
|
703
|
+
const targetVal = origin[key];
|
|
704
|
+
if (!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key) || isSymbol(key) && !Object.getOwnPropertySymbols(newComer).includes(key)) {
|
|
705
|
+
assignProp(carry, key, targetVal, origin);
|
|
706
|
+
}
|
|
707
|
+
return carry;
|
|
708
|
+
},
|
|
709
|
+
{}
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
const props = Object.getOwnPropertyNames(newComer);
|
|
713
|
+
const symbols = Object.getOwnPropertySymbols(newComer);
|
|
714
|
+
const result = [...props, ...symbols].reduce((carry, key) => {
|
|
715
|
+
if (isString(key) && MERGE_OMIT2.has(key)) return carry;
|
|
716
|
+
let newVal = newComer[key];
|
|
717
|
+
const targetVal = isObject(origin) ? origin[key] : void 0;
|
|
718
|
+
if (targetVal !== void 0 && isObject(newVal)) {
|
|
719
|
+
newVal = mergeRecursively(targetVal, newVal, compareFn);
|
|
720
|
+
}
|
|
721
|
+
const propToAssign = compareFn ? compareFn(targetVal, newVal, key) : newVal;
|
|
722
|
+
assignProp(carry, key, propToAssign, newComer);
|
|
723
|
+
return carry;
|
|
724
|
+
}, newObject);
|
|
725
|
+
return result;
|
|
726
|
+
}
|
|
727
|
+
function mergeAndConcat(object, ...otherObjects) {
|
|
728
|
+
return otherObjects.reduce((result, newComer) => {
|
|
729
|
+
return mergeRecursively(result, newComer, concatArrays);
|
|
730
|
+
}, object);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// src/merge-with.ts
|
|
734
|
+
var MERGE_OMIT3 = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
735
|
+
function mergeWith(target, ...sources) {
|
|
736
|
+
const customizer = sources.pop();
|
|
737
|
+
for (const source of sources) {
|
|
738
|
+
for (const key in source) {
|
|
739
|
+
if (isString(key) && MERGE_OMIT3.has(key)) continue;
|
|
740
|
+
const merged = customizer(target[key], source[key]);
|
|
741
|
+
if (merged === void 0) {
|
|
742
|
+
if (isObject(target[key]) && isObject(source[key])) {
|
|
743
|
+
target[key] = mergeWith({}, target[key], source[key], customizer);
|
|
744
|
+
} else {
|
|
745
|
+
target[key] = source[key];
|
|
746
|
+
}
|
|
747
|
+
} else {
|
|
748
|
+
target[key] = merged;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return target;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
// src/traverse.ts
|
|
756
|
+
var defaultOptions = {
|
|
757
|
+
separator: ".",
|
|
758
|
+
maxDepth: Infinity
|
|
759
|
+
};
|
|
760
|
+
function traverse(obj, callback2, options = defaultOptions) {
|
|
761
|
+
const maxDepth = options.maxDepth ?? defaultOptions.maxDepth;
|
|
762
|
+
const separator = options.separator ?? defaultOptions.separator;
|
|
763
|
+
const stack = [{ value: obj, path: "", paths: [], depth: -1, parent: null, key: "" }];
|
|
764
|
+
while (stack.length > 0) {
|
|
765
|
+
const currentItem = stack.pop();
|
|
766
|
+
if (currentItem.parent !== null) {
|
|
767
|
+
callback2(currentItem);
|
|
768
|
+
}
|
|
769
|
+
if (options.stop?.(currentItem)) {
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
if (isObjectOrArray(currentItem.value) && currentItem.depth < maxDepth) {
|
|
773
|
+
const keys = Object.keys(currentItem.value);
|
|
774
|
+
for (let i = keys.length - 1; i >= 0; i--) {
|
|
775
|
+
const key = keys[i];
|
|
776
|
+
const value = currentItem.value[key];
|
|
777
|
+
const path = currentItem.path ? currentItem.path + separator + key : key;
|
|
778
|
+
const paths = currentItem.paths.concat(key);
|
|
779
|
+
stack.push({
|
|
780
|
+
value,
|
|
781
|
+
path,
|
|
782
|
+
paths,
|
|
783
|
+
depth: currentItem.depth + 1,
|
|
784
|
+
parent: currentItem.value,
|
|
785
|
+
key
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// src/omit.ts
|
|
793
|
+
var omit = (obj, paths) => {
|
|
794
|
+
const result = { ...obj };
|
|
795
|
+
traverse(result, ({ path, parent, key }) => {
|
|
796
|
+
if (paths.includes(path)) {
|
|
797
|
+
delete parent[key];
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
return result;
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
// src/bamboo-config-name.ts
|
|
804
|
+
var BAMBOO_CONFIG_NAME = "__bamboo.config__";
|
|
805
|
+
|
|
806
|
+
// src/pattern-fns.ts
|
|
807
|
+
var patternFns = {
|
|
808
|
+
map: mapObject,
|
|
809
|
+
isCssFunction,
|
|
810
|
+
isCssVar: isCssVar2,
|
|
811
|
+
isCssUnit
|
|
812
|
+
};
|
|
813
|
+
var getPatternStyles = (pattern, styles) => {
|
|
814
|
+
if (!pattern?.defaultValues) return styles;
|
|
815
|
+
const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
|
|
816
|
+
return Object.assign({}, defaults, compact(styles));
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
// src/split.ts
|
|
820
|
+
function splitBy(value, separator = ",") {
|
|
821
|
+
const result = [];
|
|
822
|
+
let current = "";
|
|
823
|
+
let depth = 0;
|
|
824
|
+
for (let i = 0; i < value.length; i++) {
|
|
825
|
+
const char = value[i];
|
|
826
|
+
if (char === "(") {
|
|
827
|
+
depth++;
|
|
828
|
+
} else if (char === ")") {
|
|
829
|
+
depth--;
|
|
830
|
+
} else if (char === separator && depth === 0) {
|
|
831
|
+
result.push(current);
|
|
832
|
+
current = "";
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
current += char;
|
|
836
|
+
}
|
|
837
|
+
result.push(current);
|
|
838
|
+
return result;
|
|
839
|
+
}
|
|
840
|
+
function splitDotPath(path) {
|
|
841
|
+
return path.split(".").reduce((acc, curr) => {
|
|
842
|
+
const last = acc[acc.length - 1];
|
|
843
|
+
if (last != null && !isNaN(Number(last)) && !isNaN(Number(curr))) {
|
|
844
|
+
acc[acc.length - 1] = `${last}.${curr}`;
|
|
845
|
+
} else {
|
|
846
|
+
acc.push(curr);
|
|
847
|
+
}
|
|
848
|
+
return acc;
|
|
849
|
+
}, []);
|
|
850
|
+
}
|
|
851
|
+
function getNegativePath(path) {
|
|
852
|
+
return path.slice(0, -1).concat(`-${path.at(-1)}`);
|
|
853
|
+
}
|
|
854
|
+
function getDotPath(obj, path, fallback) {
|
|
855
|
+
if (typeof path !== "string") return fallback;
|
|
856
|
+
const idx = path.indexOf(".");
|
|
857
|
+
if (idx === -1) {
|
|
858
|
+
return obj?.[path] ?? fallback;
|
|
859
|
+
}
|
|
860
|
+
const key = path.slice(0, idx);
|
|
861
|
+
const nextPath = path.slice(idx + 1);
|
|
862
|
+
const checkValue = obj?.[key]?.[nextPath];
|
|
863
|
+
if (checkValue) {
|
|
864
|
+
return checkValue;
|
|
865
|
+
}
|
|
866
|
+
return getDotPath(obj?.[key], nextPath, fallback) ?? fallback;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// src/pick.ts
|
|
870
|
+
var pick = (obj, paths) => {
|
|
871
|
+
const result = {};
|
|
872
|
+
traverse(obj, ({ path, value }) => {
|
|
873
|
+
if (paths.includes(path)) {
|
|
874
|
+
const pathParts = splitDotPath(path);
|
|
875
|
+
deepSet(result, pathParts, value);
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
return result;
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
// src/property-priority.ts
|
|
882
|
+
var longHandPhysical = /* @__PURE__ */ new Set();
|
|
883
|
+
var longHandLogical = /* @__PURE__ */ new Set();
|
|
884
|
+
var shorthandsOfLonghands = /* @__PURE__ */ new Set();
|
|
885
|
+
var shorthandsOfShorthands = /* @__PURE__ */ new Set();
|
|
886
|
+
longHandLogical.add("backgroundBlendMode");
|
|
887
|
+
longHandLogical.add("isolation");
|
|
888
|
+
longHandLogical.add("mixBlendMode");
|
|
889
|
+
shorthandsOfShorthands.add("animation");
|
|
890
|
+
longHandLogical.add("animationComposition");
|
|
891
|
+
longHandLogical.add("animationDelay");
|
|
892
|
+
longHandLogical.add("animationDirection");
|
|
893
|
+
longHandLogical.add("animationDuration");
|
|
894
|
+
longHandLogical.add("animationFillMode");
|
|
895
|
+
longHandLogical.add("animationIterationCount");
|
|
896
|
+
longHandLogical.add("animationName");
|
|
897
|
+
longHandLogical.add("animationPlayState");
|
|
898
|
+
shorthandsOfLonghands.add("animationRange");
|
|
899
|
+
longHandLogical.add("animationRangeEnd");
|
|
900
|
+
longHandLogical.add("animationRangeStart");
|
|
901
|
+
longHandLogical.add("animationTimingFunction");
|
|
902
|
+
longHandLogical.add("animationTimeline");
|
|
903
|
+
shorthandsOfLonghands.add("scrollTimeline");
|
|
904
|
+
longHandLogical.add("scrollTimelineAxis");
|
|
905
|
+
longHandLogical.add("scrollTimelineName");
|
|
906
|
+
longHandLogical.add("timelineScope");
|
|
907
|
+
shorthandsOfLonghands.add("viewTimeline");
|
|
908
|
+
longHandLogical.add("viewTimelineAxis");
|
|
909
|
+
longHandLogical.add("viewTimelineInset");
|
|
910
|
+
longHandLogical.add("viewTimelineName");
|
|
911
|
+
shorthandsOfShorthands.add("background");
|
|
912
|
+
longHandLogical.add("backgroundAttachment");
|
|
913
|
+
longHandLogical.add("backgroundClip");
|
|
914
|
+
longHandLogical.add("backgroundColor");
|
|
915
|
+
longHandLogical.add("backgroundImage");
|
|
916
|
+
longHandLogical.add("backgroundOrigin");
|
|
917
|
+
longHandLogical.add("backgroundRepeat");
|
|
918
|
+
longHandLogical.add("backgroundSize");
|
|
919
|
+
shorthandsOfLonghands.add("backgroundPosition");
|
|
920
|
+
longHandLogical.add("backgroundPositionX");
|
|
921
|
+
longHandLogical.add("backgroundPositionY");
|
|
922
|
+
shorthandsOfShorthands.add("border");
|
|
923
|
+
shorthandsOfLonghands.add("borderColor");
|
|
924
|
+
shorthandsOfLonghands.add("borderStyle");
|
|
925
|
+
shorthandsOfLonghands.add("borderWidth");
|
|
926
|
+
shorthandsOfShorthands.add("borderBlock");
|
|
927
|
+
longHandLogical.add("borderBlockColor");
|
|
928
|
+
longHandLogical.add("borderBlockStyle");
|
|
929
|
+
longHandLogical.add("borderBlockWidth");
|
|
930
|
+
shorthandsOfLonghands.add("borderBlockStart");
|
|
931
|
+
shorthandsOfLonghands.add("borderTop");
|
|
932
|
+
longHandLogical.add("borderBlockStartColor");
|
|
933
|
+
longHandPhysical.add("borderTopColor");
|
|
934
|
+
longHandLogical.add("borderBlockStartStyle");
|
|
935
|
+
longHandPhysical.add("borderTopStyle");
|
|
936
|
+
longHandLogical.add("borderBlockStartWidth");
|
|
937
|
+
longHandPhysical.add("borderTopWidth");
|
|
938
|
+
shorthandsOfLonghands.add("borderBlockEnd");
|
|
939
|
+
shorthandsOfLonghands.add("borderBottom");
|
|
940
|
+
longHandLogical.add("borderBlockEndColor");
|
|
941
|
+
longHandPhysical.add("borderBottomColor");
|
|
942
|
+
longHandLogical.add("borderBlockEndStyle");
|
|
943
|
+
longHandPhysical.add("borderBottomStyle");
|
|
944
|
+
longHandLogical.add("borderBlockEndWidth");
|
|
945
|
+
longHandPhysical.add("borderBottomWidth");
|
|
946
|
+
shorthandsOfShorthands.add("borderInline");
|
|
947
|
+
shorthandsOfLonghands.add("borderInlineColor");
|
|
948
|
+
shorthandsOfLonghands.add("borderInlineStyle");
|
|
949
|
+
shorthandsOfLonghands.add("borderInlineWidth");
|
|
950
|
+
shorthandsOfLonghands.add("borderInlineStart");
|
|
951
|
+
shorthandsOfLonghands.add("borderLeft");
|
|
952
|
+
longHandLogical.add("borderInlineStartColor");
|
|
953
|
+
longHandPhysical.add("borderLeftColor");
|
|
954
|
+
longHandLogical.add("borderInlineStartStyle");
|
|
955
|
+
longHandPhysical.add("borderLeftStyle");
|
|
956
|
+
longHandLogical.add("borderInlineStartWidth");
|
|
957
|
+
longHandPhysical.add("borderLeftWidth");
|
|
958
|
+
shorthandsOfLonghands.add("borderInlineEnd");
|
|
959
|
+
shorthandsOfLonghands.add("borderRight");
|
|
960
|
+
longHandLogical.add("borderInlineEndColor");
|
|
961
|
+
longHandPhysical.add("borderRightColor");
|
|
962
|
+
longHandLogical.add("borderInlineEndStyle");
|
|
963
|
+
longHandPhysical.add("borderRightStyle");
|
|
964
|
+
longHandLogical.add("borderInlineEndWidth");
|
|
965
|
+
longHandPhysical.add("borderRightWidth");
|
|
966
|
+
shorthandsOfLonghands.add("borderImage");
|
|
967
|
+
longHandLogical.add("borderImageOutset");
|
|
968
|
+
longHandLogical.add("borderImageRepeat");
|
|
969
|
+
longHandLogical.add("borderImageSlice");
|
|
970
|
+
longHandLogical.add("borderImageSource");
|
|
971
|
+
longHandLogical.add("borderImageWidth");
|
|
972
|
+
shorthandsOfLonghands.add("borderRadius");
|
|
973
|
+
longHandLogical.add("borderStartEndRadius");
|
|
974
|
+
longHandLogical.add("borderStartStartRadius");
|
|
975
|
+
longHandLogical.add("borderEndEndRadius");
|
|
976
|
+
longHandLogical.add("borderEndStartRadius");
|
|
977
|
+
longHandPhysical.add("borderTopLeftRadius");
|
|
978
|
+
longHandPhysical.add("borderTopRightRadius");
|
|
979
|
+
longHandPhysical.add("borderBottomLeftRadius");
|
|
980
|
+
longHandPhysical.add("borderBottomRightRadius");
|
|
981
|
+
longHandLogical.add("boxShadow");
|
|
982
|
+
longHandLogical.add("accentColor");
|
|
983
|
+
longHandLogical.add("appearance");
|
|
984
|
+
longHandLogical.add("aspectRatio");
|
|
985
|
+
shorthandsOfLonghands.add("caret");
|
|
986
|
+
longHandLogical.add("caretColor");
|
|
987
|
+
longHandLogical.add("caretShape");
|
|
988
|
+
longHandLogical.add("cursor");
|
|
989
|
+
longHandLogical.add("imeMode");
|
|
990
|
+
longHandLogical.add("inputSecurity");
|
|
991
|
+
shorthandsOfLonghands.add("outline");
|
|
992
|
+
longHandLogical.add("outlineColor");
|
|
993
|
+
longHandLogical.add("outlineOffset");
|
|
994
|
+
longHandLogical.add("outlineStyle");
|
|
995
|
+
longHandLogical.add("outlineWidth");
|
|
996
|
+
longHandLogical.add("pointerEvents");
|
|
997
|
+
longHandLogical.add("resize");
|
|
998
|
+
longHandLogical.add("textOverflow");
|
|
999
|
+
longHandLogical.add("userSelect");
|
|
1000
|
+
shorthandsOfLonghands.add("gridGap");
|
|
1001
|
+
shorthandsOfLonghands.add("gap");
|
|
1002
|
+
longHandLogical.add("gridRowGap");
|
|
1003
|
+
longHandLogical.add("rowGap");
|
|
1004
|
+
longHandLogical.add("gridColumnGap");
|
|
1005
|
+
longHandLogical.add("columnGap");
|
|
1006
|
+
shorthandsOfLonghands.add("placeContent");
|
|
1007
|
+
longHandLogical.add("alignContent");
|
|
1008
|
+
longHandLogical.add("justifyContent");
|
|
1009
|
+
shorthandsOfLonghands.add("placeItems");
|
|
1010
|
+
longHandLogical.add("alignItems");
|
|
1011
|
+
longHandLogical.add("justifyItems");
|
|
1012
|
+
shorthandsOfLonghands.add("placeSelf");
|
|
1013
|
+
longHandLogical.add("alignSelf");
|
|
1014
|
+
longHandLogical.add("justifySelf");
|
|
1015
|
+
longHandLogical.add("boxSizing");
|
|
1016
|
+
longHandLogical.add("fieldSizing");
|
|
1017
|
+
longHandLogical.add("blockSize");
|
|
1018
|
+
longHandPhysical.add("height");
|
|
1019
|
+
longHandLogical.add("inlineSize");
|
|
1020
|
+
longHandPhysical.add("width");
|
|
1021
|
+
longHandLogical.add("maxBlockSize");
|
|
1022
|
+
longHandPhysical.add("maxHeight");
|
|
1023
|
+
longHandLogical.add("maxInlineSize");
|
|
1024
|
+
longHandPhysical.add("maxWidth");
|
|
1025
|
+
longHandLogical.add("minBlockSize");
|
|
1026
|
+
longHandPhysical.add("minHeight");
|
|
1027
|
+
longHandLogical.add("minInlineSize");
|
|
1028
|
+
longHandPhysical.add("minWidth");
|
|
1029
|
+
shorthandsOfShorthands.add("margin");
|
|
1030
|
+
shorthandsOfLonghands.add("marginBlock");
|
|
1031
|
+
longHandLogical.add("marginBlockStart");
|
|
1032
|
+
longHandPhysical.add("marginTop");
|
|
1033
|
+
longHandLogical.add("marginBlockEnd");
|
|
1034
|
+
longHandPhysical.add("marginBottom");
|
|
1035
|
+
shorthandsOfLonghands.add("marginInline");
|
|
1036
|
+
longHandLogical.add("marginInlineStart");
|
|
1037
|
+
longHandPhysical.add("marginLeft");
|
|
1038
|
+
longHandLogical.add("marginInlineEnd");
|
|
1039
|
+
longHandPhysical.add("marginRight");
|
|
1040
|
+
longHandLogical.add("marginTrim");
|
|
1041
|
+
shorthandsOfLonghands.add("overscrollBehavior");
|
|
1042
|
+
longHandLogical.add("overscrollBehaviorBlock");
|
|
1043
|
+
longHandPhysical.add("overscrollBehaviorY");
|
|
1044
|
+
longHandLogical.add("overscrollBehaviorInline");
|
|
1045
|
+
longHandPhysical.add("overscrollBehaviorX");
|
|
1046
|
+
shorthandsOfShorthands.add("padding");
|
|
1047
|
+
shorthandsOfLonghands.add("paddingBlock");
|
|
1048
|
+
longHandLogical.add("paddingBlockStart");
|
|
1049
|
+
longHandPhysical.add("paddingTop");
|
|
1050
|
+
longHandLogical.add("paddingBlockEnd");
|
|
1051
|
+
longHandPhysical.add("paddingBottom");
|
|
1052
|
+
shorthandsOfLonghands.add("paddingInline");
|
|
1053
|
+
longHandLogical.add("paddingInlineStart");
|
|
1054
|
+
longHandPhysical.add("paddingLeft");
|
|
1055
|
+
longHandLogical.add("paddingInlineEnd");
|
|
1056
|
+
longHandPhysical.add("paddingRight");
|
|
1057
|
+
longHandLogical.add("visibility");
|
|
1058
|
+
longHandLogical.add("color");
|
|
1059
|
+
longHandLogical.add("colorScheme");
|
|
1060
|
+
longHandLogical.add("forcedColorAdjust");
|
|
1061
|
+
longHandLogical.add("opacity");
|
|
1062
|
+
longHandLogical.add("printColorAdjust");
|
|
1063
|
+
shorthandsOfLonghands.add("columns");
|
|
1064
|
+
longHandLogical.add("columnCount");
|
|
1065
|
+
longHandLogical.add("columnWidth");
|
|
1066
|
+
longHandLogical.add("columnFill");
|
|
1067
|
+
longHandLogical.add("columnSpan");
|
|
1068
|
+
shorthandsOfLonghands.add("columnRule");
|
|
1069
|
+
longHandLogical.add("columnRuleColor");
|
|
1070
|
+
longHandLogical.add("columnRuleStyle");
|
|
1071
|
+
longHandLogical.add("columnRuleWidth");
|
|
1072
|
+
longHandLogical.add("contain");
|
|
1073
|
+
shorthandsOfLonghands.add("containIntrinsicSize");
|
|
1074
|
+
longHandLogical.add("containIntrinsicBlockSize");
|
|
1075
|
+
longHandLogical.add("containIntrinsicWidth");
|
|
1076
|
+
longHandLogical.add("containIntrinsicHeight");
|
|
1077
|
+
longHandLogical.add("containIntrinsicInlineSize");
|
|
1078
|
+
shorthandsOfLonghands.add("container");
|
|
1079
|
+
longHandLogical.add("containerName");
|
|
1080
|
+
longHandLogical.add("containerType");
|
|
1081
|
+
longHandLogical.add("contentVisibility");
|
|
1082
|
+
longHandLogical.add("counterIncrement");
|
|
1083
|
+
longHandLogical.add("counterReset");
|
|
1084
|
+
longHandLogical.add("counterSet");
|
|
1085
|
+
longHandLogical.add("display");
|
|
1086
|
+
shorthandsOfLonghands.add("flex");
|
|
1087
|
+
longHandLogical.add("flexBasis");
|
|
1088
|
+
longHandLogical.add("flexGrow");
|
|
1089
|
+
longHandLogical.add("flexShrink");
|
|
1090
|
+
shorthandsOfLonghands.add("flexFlow");
|
|
1091
|
+
longHandLogical.add("flexDirection");
|
|
1092
|
+
longHandLogical.add("flexWrap");
|
|
1093
|
+
longHandLogical.add("order");
|
|
1094
|
+
shorthandsOfShorthands.add("font");
|
|
1095
|
+
longHandLogical.add("fontFamily");
|
|
1096
|
+
longHandLogical.add("fontSize");
|
|
1097
|
+
longHandLogical.add("fontStretch");
|
|
1098
|
+
longHandLogical.add("fontStyle");
|
|
1099
|
+
longHandLogical.add("fontWeight");
|
|
1100
|
+
longHandLogical.add("lineHeight");
|
|
1101
|
+
shorthandsOfLonghands.add("fontVariant");
|
|
1102
|
+
longHandLogical.add("fontVariantAlternates");
|
|
1103
|
+
longHandLogical.add("fontVariantCaps");
|
|
1104
|
+
longHandLogical.add("fontVariantEastAsian");
|
|
1105
|
+
longHandLogical.add("fontVariantEmoji");
|
|
1106
|
+
longHandLogical.add("fontVariantLigatures");
|
|
1107
|
+
longHandLogical.add("fontVariantNumeric");
|
|
1108
|
+
longHandLogical.add("fontVariantPosition");
|
|
1109
|
+
longHandLogical.add("fontFeatureSettings");
|
|
1110
|
+
longHandLogical.add("fontKerning");
|
|
1111
|
+
longHandLogical.add("fontLanguageOverride");
|
|
1112
|
+
longHandLogical.add("fontOpticalSizing");
|
|
1113
|
+
longHandLogical.add("fontPalette");
|
|
1114
|
+
longHandLogical.add("fontVariationSettings");
|
|
1115
|
+
longHandLogical.add("fontSizeAdjust");
|
|
1116
|
+
longHandLogical.add("fontSmooth");
|
|
1117
|
+
longHandLogical.add("fontSynthesisPosition");
|
|
1118
|
+
longHandLogical.add("fontSynthesisSmallCaps");
|
|
1119
|
+
longHandLogical.add("fontSynthesisStyle");
|
|
1120
|
+
longHandLogical.add("fontSynthesisWeight");
|
|
1121
|
+
shorthandsOfLonghands.add("fontSynthesis");
|
|
1122
|
+
longHandLogical.add("lineHeightStep");
|
|
1123
|
+
longHandLogical.add("boxDecorationBreak");
|
|
1124
|
+
longHandLogical.add("breakAfter");
|
|
1125
|
+
longHandLogical.add("breakBefore");
|
|
1126
|
+
longHandLogical.add("breakInside");
|
|
1127
|
+
longHandLogical.add("orphans");
|
|
1128
|
+
longHandLogical.add("widows");
|
|
1129
|
+
longHandLogical.add("content");
|
|
1130
|
+
longHandLogical.add("quotes");
|
|
1131
|
+
shorthandsOfShorthands.add("grid");
|
|
1132
|
+
longHandLogical.add("gridAutoFlow");
|
|
1133
|
+
longHandLogical.add("gridAutoRows");
|
|
1134
|
+
longHandLogical.add("gridAutoColumns");
|
|
1135
|
+
shorthandsOfShorthands.add("gridTemplate");
|
|
1136
|
+
shorthandsOfLonghands.add("gridTemplateAreas");
|
|
1137
|
+
longHandLogical.add("gridTemplateColumns");
|
|
1138
|
+
longHandLogical.add("gridTemplateRows");
|
|
1139
|
+
shorthandsOfShorthands.add("gridArea");
|
|
1140
|
+
shorthandsOfLonghands.add("gridRow");
|
|
1141
|
+
longHandLogical.add("gridRowStart");
|
|
1142
|
+
longHandLogical.add("gridRowEnd");
|
|
1143
|
+
shorthandsOfLonghands.add("gridColumn");
|
|
1144
|
+
longHandLogical.add("gridColumnStart");
|
|
1145
|
+
longHandLogical.add("gridColumnEnd");
|
|
1146
|
+
longHandLogical.add("alignTracks");
|
|
1147
|
+
longHandLogical.add("justifyTracks");
|
|
1148
|
+
longHandLogical.add("masonryAutoFlow");
|
|
1149
|
+
longHandLogical.add("imageOrientation");
|
|
1150
|
+
longHandLogical.add("imageRendering");
|
|
1151
|
+
longHandLogical.add("imageResolution");
|
|
1152
|
+
longHandLogical.add("objectFit");
|
|
1153
|
+
longHandLogical.add("objectPosition");
|
|
1154
|
+
longHandLogical.add("initialLetter");
|
|
1155
|
+
longHandLogical.add("initialLetterAlign");
|
|
1156
|
+
shorthandsOfLonghands.add("listStyle");
|
|
1157
|
+
longHandLogical.add("listStyleImage");
|
|
1158
|
+
longHandLogical.add("listStylePosition");
|
|
1159
|
+
longHandLogical.add("listStyleType");
|
|
1160
|
+
longHandLogical.add("clip");
|
|
1161
|
+
longHandLogical.add("clipPath");
|
|
1162
|
+
shorthandsOfLonghands.add("mask");
|
|
1163
|
+
longHandLogical.add("maskClip");
|
|
1164
|
+
longHandLogical.add("maskComposite");
|
|
1165
|
+
longHandLogical.add("maskImage");
|
|
1166
|
+
longHandLogical.add("maskMode");
|
|
1167
|
+
longHandLogical.add("maskOrigin");
|
|
1168
|
+
longHandLogical.add("maskPosition");
|
|
1169
|
+
longHandLogical.add("maskRepeat");
|
|
1170
|
+
longHandLogical.add("maskSize");
|
|
1171
|
+
longHandLogical.add("maskType");
|
|
1172
|
+
shorthandsOfLonghands.add("maskBorder");
|
|
1173
|
+
longHandLogical.add("maskBorderMode");
|
|
1174
|
+
longHandLogical.add("maskBorderOutset");
|
|
1175
|
+
longHandLogical.add("maskBorderRepeat");
|
|
1176
|
+
longHandLogical.add("maskBorderSlice");
|
|
1177
|
+
longHandLogical.add("maskBorderSource");
|
|
1178
|
+
longHandLogical.add("maskBorderWidth");
|
|
1179
|
+
shorthandsOfShorthands.add("all");
|
|
1180
|
+
longHandLogical.add("textRendering");
|
|
1181
|
+
longHandLogical.add("zoom");
|
|
1182
|
+
shorthandsOfLonghands.add("offset");
|
|
1183
|
+
longHandLogical.add("offsetAnchor");
|
|
1184
|
+
longHandLogical.add("offsetDistance");
|
|
1185
|
+
longHandLogical.add("offsetPath");
|
|
1186
|
+
longHandLogical.add("offsetPosition");
|
|
1187
|
+
longHandLogical.add("offsetRotate");
|
|
1188
|
+
longHandLogical.add("WebkitBoxOrient");
|
|
1189
|
+
longHandLogical.add("WebkitLineClamp");
|
|
1190
|
+
longHandPhysical.add("lineClamp");
|
|
1191
|
+
longHandPhysical.add("maxLines");
|
|
1192
|
+
longHandLogical.add("blockOverflow");
|
|
1193
|
+
shorthandsOfLonghands.add("overflow");
|
|
1194
|
+
longHandLogical.add("overflowBlock");
|
|
1195
|
+
longHandPhysical.add("overflowY");
|
|
1196
|
+
longHandLogical.add("overflowInline");
|
|
1197
|
+
longHandPhysical.add("overflowX");
|
|
1198
|
+
longHandLogical.add("overflowClipMargin");
|
|
1199
|
+
longHandLogical.add("scrollGutter");
|
|
1200
|
+
longHandLogical.add("scrollBehavior");
|
|
1201
|
+
longHandLogical.add("page");
|
|
1202
|
+
longHandLogical.add("pageBreakAfter");
|
|
1203
|
+
longHandLogical.add("pageBreakBefore");
|
|
1204
|
+
longHandLogical.add("pageBreakInside");
|
|
1205
|
+
shorthandsOfShorthands.add("inset");
|
|
1206
|
+
shorthandsOfLonghands.add("insetBlock");
|
|
1207
|
+
longHandLogical.add("insetBlockStart");
|
|
1208
|
+
longHandPhysical.add("top");
|
|
1209
|
+
longHandLogical.add("insetBlockEnd");
|
|
1210
|
+
longHandPhysical.add("bottom");
|
|
1211
|
+
shorthandsOfLonghands.add("insetInline");
|
|
1212
|
+
longHandLogical.add("insetInlineStart");
|
|
1213
|
+
longHandPhysical.add("left");
|
|
1214
|
+
longHandLogical.add("insetInlineEnd");
|
|
1215
|
+
longHandPhysical.add("right");
|
|
1216
|
+
longHandLogical.add("clear");
|
|
1217
|
+
longHandLogical.add("float");
|
|
1218
|
+
longHandLogical.add("overlay");
|
|
1219
|
+
longHandLogical.add("position");
|
|
1220
|
+
longHandLogical.add("zIndex");
|
|
1221
|
+
longHandLogical.add("rubyAlign");
|
|
1222
|
+
longHandLogical.add("rubyMerge");
|
|
1223
|
+
longHandLogical.add("rubyPosition");
|
|
1224
|
+
longHandLogical.add("overflowAnchor");
|
|
1225
|
+
shorthandsOfShorthands.add("scrollMargin");
|
|
1226
|
+
shorthandsOfLonghands.add("scrollMarginBlock");
|
|
1227
|
+
longHandLogical.add("scrollMarginBlockStart");
|
|
1228
|
+
longHandPhysical.add("scrollMarginTop");
|
|
1229
|
+
longHandLogical.add("scrollMarginBlockEnd");
|
|
1230
|
+
longHandPhysical.add("scrollMarginBottom");
|
|
1231
|
+
shorthandsOfLonghands.add("scrollMarginInline");
|
|
1232
|
+
longHandLogical.add("scrollMarginInlineStart");
|
|
1233
|
+
longHandPhysical.add("scrollMarginLeft");
|
|
1234
|
+
longHandLogical.add("scrollMarginInlineEnd");
|
|
1235
|
+
longHandPhysical.add("scrollMarginRight");
|
|
1236
|
+
shorthandsOfShorthands.add("scrollPadding");
|
|
1237
|
+
shorthandsOfLonghands.add("scrollPaddingBlock");
|
|
1238
|
+
longHandLogical.add("scrollPaddingBlockStart");
|
|
1239
|
+
longHandPhysical.add("scrollPaddingTop");
|
|
1240
|
+
longHandLogical.add("scrollPaddingBlockEnd");
|
|
1241
|
+
longHandPhysical.add("scrollPaddingBottom");
|
|
1242
|
+
shorthandsOfLonghands.add("scrollPaddingInline");
|
|
1243
|
+
longHandLogical.add("scrollPaddingInlineStart");
|
|
1244
|
+
longHandPhysical.add("scrollPaddingLeft");
|
|
1245
|
+
longHandLogical.add("scrollPaddingInlineEnd");
|
|
1246
|
+
longHandPhysical.add("scrollPaddingRight");
|
|
1247
|
+
longHandLogical.add("scrollSnapAlign");
|
|
1248
|
+
longHandLogical.add("scrollSnapStop");
|
|
1249
|
+
shorthandsOfLonghands.add("scrollSnapType");
|
|
1250
|
+
longHandLogical.add("scrollbarColor");
|
|
1251
|
+
longHandLogical.add("scrollbarWidth");
|
|
1252
|
+
longHandLogical.add("shapeImageThreshold");
|
|
1253
|
+
longHandLogical.add("shapeMargin");
|
|
1254
|
+
longHandLogical.add("shapeOutside");
|
|
1255
|
+
longHandLogical.add("azimuth");
|
|
1256
|
+
longHandLogical.add("borderCollapse");
|
|
1257
|
+
longHandLogical.add("borderSpacing");
|
|
1258
|
+
longHandLogical.add("captionSide");
|
|
1259
|
+
longHandLogical.add("emptyCells");
|
|
1260
|
+
longHandLogical.add("tableLayout");
|
|
1261
|
+
longHandLogical.add("verticalAlign");
|
|
1262
|
+
shorthandsOfLonghands.add("textDecoration");
|
|
1263
|
+
longHandLogical.add("textDecorationColor");
|
|
1264
|
+
longHandLogical.add("textDecorationLine");
|
|
1265
|
+
longHandLogical.add("textDecorationSkip");
|
|
1266
|
+
longHandLogical.add("textDecorationSkipInk");
|
|
1267
|
+
longHandLogical.add("textDecorationStyle");
|
|
1268
|
+
longHandLogical.add("textDecorationThickness");
|
|
1269
|
+
shorthandsOfLonghands.add("WebkitTextStroke");
|
|
1270
|
+
longHandLogical.add("WebkitTextStrokeColor");
|
|
1271
|
+
longHandLogical.add("WebkitTextStrokeWidth");
|
|
1272
|
+
longHandLogical.add("WebkitTextFillColor");
|
|
1273
|
+
shorthandsOfLonghands.add("textEmphasis");
|
|
1274
|
+
longHandLogical.add("textEmphasisColor");
|
|
1275
|
+
longHandLogical.add("textEmphasisPosition");
|
|
1276
|
+
longHandLogical.add("textEmphasisStyle");
|
|
1277
|
+
longHandLogical.add("textShadow");
|
|
1278
|
+
longHandLogical.add("textUnderlineOffset");
|
|
1279
|
+
longHandLogical.add("textUnderlinePosition");
|
|
1280
|
+
longHandLogical.add("hangingPunctuation");
|
|
1281
|
+
longHandLogical.add("hyphenateCharacter");
|
|
1282
|
+
longHandLogical.add("hyphenateLimitChars");
|
|
1283
|
+
longHandLogical.add("hyphens");
|
|
1284
|
+
longHandLogical.add("letterSpacing");
|
|
1285
|
+
longHandLogical.add("lineBreak");
|
|
1286
|
+
longHandLogical.add("overflowWrap");
|
|
1287
|
+
longHandLogical.add("paintOrder");
|
|
1288
|
+
longHandLogical.add("tabSize");
|
|
1289
|
+
longHandLogical.add("textAlign");
|
|
1290
|
+
longHandLogical.add("textAlignLast");
|
|
1291
|
+
longHandLogical.add("textIndent");
|
|
1292
|
+
longHandLogical.add("textJustify");
|
|
1293
|
+
longHandLogical.add("textSizeAdjust");
|
|
1294
|
+
longHandLogical.add("textTransform");
|
|
1295
|
+
shorthandsOfLonghands.add("textWrap");
|
|
1296
|
+
longHandLogical.add("textWrapMode");
|
|
1297
|
+
longHandLogical.add("textWrapStyle");
|
|
1298
|
+
longHandLogical.add("whiteSpace");
|
|
1299
|
+
longHandLogical.add("whiteSpaceCollapse");
|
|
1300
|
+
longHandLogical.add("whiteSpaceTrim");
|
|
1301
|
+
longHandLogical.add("wordBreak");
|
|
1302
|
+
longHandLogical.add("wordSpacing");
|
|
1303
|
+
longHandLogical.add("wordWrap");
|
|
1304
|
+
longHandLogical.add("backfaceVisibility");
|
|
1305
|
+
longHandLogical.add("perspective");
|
|
1306
|
+
longHandLogical.add("perspectiveOrigin");
|
|
1307
|
+
longHandLogical.add("rotate");
|
|
1308
|
+
longHandLogical.add("scale");
|
|
1309
|
+
longHandLogical.add("transform");
|
|
1310
|
+
longHandLogical.add("transformBox");
|
|
1311
|
+
longHandLogical.add("transformOrigin");
|
|
1312
|
+
longHandLogical.add("transformStyle");
|
|
1313
|
+
longHandLogical.add("translate");
|
|
1314
|
+
shorthandsOfLonghands.add("transition");
|
|
1315
|
+
longHandLogical.add("transitionBehavior");
|
|
1316
|
+
longHandLogical.add("transitionDelay");
|
|
1317
|
+
longHandLogical.add("transitionDuration");
|
|
1318
|
+
longHandLogical.add("transitionProperty");
|
|
1319
|
+
longHandLogical.add("transitionTimingFunction");
|
|
1320
|
+
longHandLogical.add("viewTransitionName");
|
|
1321
|
+
longHandLogical.add("willChange");
|
|
1322
|
+
longHandLogical.add("direction");
|
|
1323
|
+
longHandLogical.add("textCombineUpright");
|
|
1324
|
+
longHandLogical.add("textOrientation");
|
|
1325
|
+
longHandLogical.add("unicodeBidi");
|
|
1326
|
+
longHandLogical.add("writingMode");
|
|
1327
|
+
longHandLogical.add("backdropFilter");
|
|
1328
|
+
longHandLogical.add("filter");
|
|
1329
|
+
longHandLogical.add("mathDepth");
|
|
1330
|
+
longHandLogical.add("mathShift");
|
|
1331
|
+
longHandLogical.add("mathStyle");
|
|
1332
|
+
longHandLogical.add("touchAction");
|
|
1333
|
+
function getPropertyPriority(key) {
|
|
1334
|
+
if (key === "all") return 0;
|
|
1335
|
+
if (key.startsWith("--")) return 1;
|
|
1336
|
+
if (longHandPhysical.has(key)) return 4e3;
|
|
1337
|
+
if (longHandLogical.has(key)) return 3e3;
|
|
1338
|
+
if (shorthandsOfLonghands.has(key)) return 2e3;
|
|
1339
|
+
if (shorthandsOfShorthands.has(key)) return 1e3;
|
|
1340
|
+
return 3e3;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// src/regex.ts
|
|
1344
|
+
var createRegex = (item) => {
|
|
1345
|
+
const regex2 = item.map((item2) => typeof item2 === "string" ? `^${item2}$` : item2.source).join("|");
|
|
1346
|
+
return new RegExp(regex2);
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
// src/serialize.ts
|
|
1350
|
+
var stringifyJson = (config) => {
|
|
1351
|
+
return JSON.stringify(config, (_key, value) => {
|
|
1352
|
+
if (typeof value === "function") return value.toString();
|
|
1353
|
+
return value;
|
|
1354
|
+
});
|
|
1355
|
+
};
|
|
1356
|
+
var parseJson = (config) => {
|
|
1357
|
+
return JSON.parse(config);
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1360
|
+
// src/slot.ts
|
|
1361
|
+
var getSlotRecipes = (recipe = {}) => {
|
|
1362
|
+
const init = (slot) => ({
|
|
1363
|
+
className: [recipe.className, slot].filter(Boolean).join("__"),
|
|
1364
|
+
base: recipe.base?.[slot] ?? {},
|
|
1365
|
+
variants: {},
|
|
1366
|
+
defaultVariants: recipe.defaultVariants ?? {},
|
|
1367
|
+
compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
|
|
1368
|
+
});
|
|
1369
|
+
const slots = recipe.slots ?? [];
|
|
1370
|
+
const recipeParts = slots.map((slot) => [slot, init(slot)]);
|
|
1371
|
+
for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
|
|
1372
|
+
for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
|
|
1373
|
+
recipeParts.forEach(([slot, slotRecipe]) => {
|
|
1374
|
+
slotRecipe.variants[variantsKey] ??= {};
|
|
1375
|
+
slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
return Object.fromEntries(recipeParts);
|
|
1380
|
+
};
|
|
1381
|
+
var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
|
|
1382
|
+
|
|
1383
|
+
// src/split-props.ts
|
|
1384
|
+
function splitProps(props, ...keys) {
|
|
1385
|
+
const descriptors = Object.getOwnPropertyDescriptors(props);
|
|
1386
|
+
const dKeys = Object.keys(descriptors);
|
|
1387
|
+
const split = (k) => {
|
|
1388
|
+
const clone = {};
|
|
1389
|
+
for (let i = 0; i < k.length; i++) {
|
|
1390
|
+
const key = k[i];
|
|
1391
|
+
if (descriptors[key]) {
|
|
1392
|
+
Object.defineProperty(clone, key, descriptors[key]);
|
|
1393
|
+
delete descriptors[key];
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
return clone;
|
|
1397
|
+
};
|
|
1398
|
+
const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
|
|
1399
|
+
return keys.map(fn).concat(split(dKeys));
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
// src/to-json.ts
|
|
1403
|
+
function mapToJson(map) {
|
|
1404
|
+
const obj = {};
|
|
1405
|
+
map.forEach((value, key) => {
|
|
1406
|
+
if (value instanceof Map) {
|
|
1407
|
+
obj[key] = Object.fromEntries(value);
|
|
1408
|
+
} else {
|
|
1409
|
+
obj[key] = value;
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
return obj;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// src/typegen.ts
|
|
1416
|
+
function unionType(values, opts = {}) {
|
|
1417
|
+
const { fallback, stringify = JSON.stringify } = opts;
|
|
1418
|
+
const arr = Array.from(values);
|
|
1419
|
+
if (fallback != null && !arr.length) return fallback;
|
|
1420
|
+
return arr.map((v) => stringify(v)).join(" | ");
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
// src/uniq.ts
|
|
1424
|
+
var uniq = (...items) => {
|
|
1425
|
+
const set = items.reduce((acc, currItems) => {
|
|
1426
|
+
if (currItems) {
|
|
1427
|
+
currItems.forEach((item) => acc.add(item));
|
|
1428
|
+
}
|
|
1429
|
+
return acc;
|
|
1430
|
+
}, /* @__PURE__ */ new Set([]));
|
|
1431
|
+
return Array.from(set);
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
// src/unit-conversion.ts
|
|
1435
|
+
var BASE_FONT_SIZE = 16;
|
|
1436
|
+
var UNIT_PX = "px";
|
|
1437
|
+
var UNIT_EM = "em";
|
|
1438
|
+
var UNIT_REM = "rem";
|
|
1439
|
+
var DIGIT_REGEX = new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`);
|
|
1440
|
+
var UNIT_REGEX = new RegExp(`${UNIT_PX}|${UNIT_EM}|${UNIT_REM}`);
|
|
1441
|
+
var VALUE_REGEX = new RegExp(`${DIGIT_REGEX.source}(${UNIT_REGEX.source})`);
|
|
1442
|
+
function getUnit(value = "") {
|
|
1443
|
+
const unit = value.match(VALUE_REGEX);
|
|
1444
|
+
return unit?.[1];
|
|
1445
|
+
}
|
|
1446
|
+
function toPx(value = "") {
|
|
1447
|
+
if (typeof value === "number") {
|
|
1448
|
+
return `${value}px`;
|
|
1449
|
+
}
|
|
1450
|
+
const unit = getUnit(value);
|
|
1451
|
+
if (!unit) return value;
|
|
1452
|
+
if (unit === UNIT_PX) {
|
|
1453
|
+
return value;
|
|
1454
|
+
}
|
|
1455
|
+
if (unit === UNIT_EM || unit === UNIT_REM) {
|
|
1456
|
+
return `${parseFloat(value) * BASE_FONT_SIZE}${UNIT_PX}`;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
function toEm(value = "", fontSize = BASE_FONT_SIZE) {
|
|
1460
|
+
const unit = getUnit(value);
|
|
1461
|
+
if (!unit) return value;
|
|
1462
|
+
if (unit === UNIT_EM) {
|
|
1463
|
+
return value;
|
|
1464
|
+
}
|
|
1465
|
+
if (unit === UNIT_PX) {
|
|
1466
|
+
return `${parseFloat(value) / fontSize}${UNIT_EM}`;
|
|
1467
|
+
}
|
|
1468
|
+
if (unit === UNIT_REM) {
|
|
1469
|
+
return `${parseFloat(value) * BASE_FONT_SIZE / fontSize}${UNIT_EM}`;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function toRem(value = "") {
|
|
1473
|
+
const unit = getUnit(value);
|
|
1474
|
+
if (!unit) return value;
|
|
1475
|
+
if (unit === UNIT_REM) {
|
|
1476
|
+
return value;
|
|
1477
|
+
}
|
|
1478
|
+
if (unit === UNIT_EM) {
|
|
1479
|
+
return `${parseFloat(value)}${UNIT_REM}`;
|
|
1480
|
+
}
|
|
1481
|
+
if (unit === UNIT_PX) {
|
|
1482
|
+
return `${parseFloat(value) / BASE_FONT_SIZE}${UNIT_REM}`;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1486
|
+
0 && (module.exports = {
|
|
1487
|
+
BAMBOO_CONFIG_NAME,
|
|
1488
|
+
BambooError,
|
|
1489
|
+
CacheMap,
|
|
1490
|
+
assign,
|
|
1491
|
+
astish,
|
|
1492
|
+
calc,
|
|
1493
|
+
camelCaseProperty,
|
|
1494
|
+
capitalize,
|
|
1495
|
+
compact,
|
|
1496
|
+
createCss,
|
|
1497
|
+
createMergeCss,
|
|
1498
|
+
createRegex,
|
|
1499
|
+
cssVar,
|
|
1500
|
+
dashCase,
|
|
1501
|
+
deepSet,
|
|
1502
|
+
entries,
|
|
1503
|
+
esc,
|
|
1504
|
+
filterBaseConditions,
|
|
1505
|
+
flatten,
|
|
1506
|
+
fromEntries,
|
|
1507
|
+
getArbitraryValue,
|
|
1508
|
+
getDotPath,
|
|
1509
|
+
getNegativePath,
|
|
1510
|
+
getOrCreateSet,
|
|
1511
|
+
getPatternStyles,
|
|
1512
|
+
getPropertyPriority,
|
|
1513
|
+
getSlotCompoundVariant,
|
|
1514
|
+
getSlotRecipes,
|
|
1515
|
+
getUnit,
|
|
1516
|
+
hypenateProperty,
|
|
1517
|
+
isBaseCondition,
|
|
1518
|
+
isBoolean,
|
|
1519
|
+
isCssFunction,
|
|
1520
|
+
isCssUnit,
|
|
1521
|
+
isCssVar,
|
|
1522
|
+
isFunction,
|
|
1523
|
+
isImportant,
|
|
1524
|
+
isObject,
|
|
1525
|
+
isObjectOrArray,
|
|
1526
|
+
isString,
|
|
1527
|
+
isSymbol,
|
|
1528
|
+
mapEntries,
|
|
1529
|
+
mapObject,
|
|
1530
|
+
mapToJson,
|
|
1531
|
+
markImportant,
|
|
1532
|
+
memo,
|
|
1533
|
+
mergeAndConcat,
|
|
1534
|
+
mergeProps,
|
|
1535
|
+
mergeWith,
|
|
1536
|
+
normalizeStyleObject,
|
|
1537
|
+
omit,
|
|
1538
|
+
parseJson,
|
|
1539
|
+
patternFns,
|
|
1540
|
+
pick,
|
|
1541
|
+
splitBy,
|
|
1542
|
+
splitDotPath,
|
|
1543
|
+
splitProps,
|
|
1544
|
+
stringifyJson,
|
|
1545
|
+
toEm,
|
|
1546
|
+
toHash,
|
|
1547
|
+
toPx,
|
|
1548
|
+
toRem,
|
|
1549
|
+
toResponsiveObject,
|
|
1550
|
+
traverse,
|
|
1551
|
+
uncapitalize,
|
|
1552
|
+
unionType,
|
|
1553
|
+
uniq,
|
|
1554
|
+
walkObject,
|
|
1555
|
+
withoutImportant,
|
|
1556
|
+
withoutSpace
|
|
1557
|
+
});
|