@symbo.ls/scratch 2.11.523 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/factory.js +106 -51
- package/dist/cjs/index.js +366 -423
- package/dist/cjs/set.js +304 -321
- package/dist/cjs/system/color.js +231 -181
- package/dist/cjs/system/document.js +198 -121
- package/dist/cjs/system/font.js +199 -127
- package/dist/cjs/system/index.js +308 -325
- package/dist/cjs/system/reset.js +205 -135
- package/dist/cjs/system/shadow.js +247 -212
- package/dist/cjs/system/spacing.js +215 -153
- package/dist/cjs/system/svg.js +203 -132
- package/dist/cjs/system/theme.js +243 -206
- package/dist/cjs/system/timing.js +206 -138
- package/dist/cjs/system/typography.js +212 -148
- package/dist/cjs/transforms/index.js +285 -268
- package/dist/cjs/utils/color.js +93 -85
- package/dist/cjs/utils/font.js +3 -6
- package/dist/cjs/utils/index.js +236 -193
- package/dist/cjs/utils/sequence.js +206 -99
- package/dist/cjs/utils/sprite.js +106 -51
- package/dist/cjs/utils/theme.js +3 -6
- package/dist/cjs/utils/var.js +196 -83
- package/package.json +4 -4
- package/src/system/svg.js +1 -1
- package/src/transforms/index.js +9 -2
- package/src/utils/color.js +1 -2
- package/src/utils/sequence.js +1 -1
|
@@ -34,25 +34,25 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var require_cjs = __commonJS({
|
|
35
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
|
-
var
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
39
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
41
|
var __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
43
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
44
|
};
|
|
45
45
|
var __copyProps2 = (to, from, except, desc) => {
|
|
46
46
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
47
|
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!
|
|
49
|
-
|
|
48
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
49
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
50
|
}
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(
|
|
54
|
-
var
|
|
55
|
-
__export2(
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue,
|
|
57
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
58
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -73,17 +73,85 @@ var require_cjs = __commonJS({
|
|
|
73
73
|
toTitleCase: () => toTitleCase,
|
|
74
74
|
toggleFullscreen: () => toggleFullscreen
|
|
75
75
|
});
|
|
76
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
77
77
|
var window22 = globalThis;
|
|
78
78
|
var document22 = window22.document;
|
|
79
79
|
var isObject2 = (arg) => {
|
|
80
|
-
if (arg === null)
|
|
81
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
82
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
83
82
|
};
|
|
84
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
85
84
|
var isNumber2 = (arg) => typeof arg === "number";
|
|
86
85
|
var isArray2 = (arg) => Array.isArray(arg);
|
|
86
|
+
var STATE_METHODS2 = [
|
|
87
|
+
"update",
|
|
88
|
+
"parse",
|
|
89
|
+
"clean",
|
|
90
|
+
"create",
|
|
91
|
+
"destroy",
|
|
92
|
+
"add",
|
|
93
|
+
"toggle",
|
|
94
|
+
"remove",
|
|
95
|
+
"apply",
|
|
96
|
+
"set",
|
|
97
|
+
"reset",
|
|
98
|
+
"replace",
|
|
99
|
+
"quietReplace",
|
|
100
|
+
"quietUpdate",
|
|
101
|
+
"applyReplace",
|
|
102
|
+
"applyFunction",
|
|
103
|
+
"keys",
|
|
104
|
+
"values",
|
|
105
|
+
"ref",
|
|
106
|
+
"rootUpdate",
|
|
107
|
+
"parentUpdate",
|
|
108
|
+
"parent",
|
|
109
|
+
"__element",
|
|
110
|
+
"__depends",
|
|
111
|
+
"__ref",
|
|
112
|
+
"__children",
|
|
113
|
+
"root",
|
|
114
|
+
"setByPath",
|
|
115
|
+
"setPathCollection",
|
|
116
|
+
"removeByPath",
|
|
117
|
+
"removePathCollection",
|
|
118
|
+
"getByPath"
|
|
119
|
+
];
|
|
120
|
+
var PROPS_METHODS2 = ["update", "__element"];
|
|
121
|
+
var METHODS2 = [
|
|
122
|
+
"set",
|
|
123
|
+
"reset",
|
|
124
|
+
"update",
|
|
125
|
+
"remove",
|
|
126
|
+
"updateContent",
|
|
127
|
+
"removeContent",
|
|
128
|
+
"lookup",
|
|
129
|
+
"lookdown",
|
|
130
|
+
"lookdownAll",
|
|
131
|
+
"getRef",
|
|
132
|
+
"getPath",
|
|
133
|
+
"setNodeStyles",
|
|
134
|
+
"spotByPath",
|
|
135
|
+
"keys",
|
|
136
|
+
"parse",
|
|
137
|
+
"setProps",
|
|
138
|
+
"parseDeep",
|
|
139
|
+
"variables",
|
|
140
|
+
"if",
|
|
141
|
+
"log",
|
|
142
|
+
"verbose",
|
|
143
|
+
"warn",
|
|
144
|
+
"error",
|
|
145
|
+
"call",
|
|
146
|
+
"nextElement",
|
|
147
|
+
"previousElement"
|
|
148
|
+
];
|
|
149
|
+
var METHODS_EXL2 = [
|
|
150
|
+
...["node", "context", "extends", "__element", "__ref"],
|
|
151
|
+
...METHODS2,
|
|
152
|
+
...STATE_METHODS2,
|
|
153
|
+
...PROPS_METHODS2
|
|
154
|
+
];
|
|
87
155
|
var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
88
156
|
async function toggleFullscreen(opts) {
|
|
89
157
|
if (!document.fullscreenElement) {
|
|
@@ -103,13 +171,11 @@ var require_cjs = __commonJS({
|
|
|
103
171
|
};
|
|
104
172
|
var findClosestNumberInFactory = (val, factory) => {
|
|
105
173
|
val = parseFloat(val);
|
|
106
|
-
if (isObject2(factory))
|
|
107
|
-
factory = Object.values(factory);
|
|
174
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
108
175
|
return findClosestNumber(val, factory);
|
|
109
176
|
};
|
|
110
177
|
var formatDate = (timestamp) => {
|
|
111
|
-
if (!timestamp)
|
|
112
|
-
return "";
|
|
178
|
+
if (!timestamp) return "";
|
|
113
179
|
const d = new Date(timestamp);
|
|
114
180
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
115
181
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -176,8 +242,7 @@ var require_cjs = __commonJS({
|
|
|
176
242
|
scriptEle.type = type;
|
|
177
243
|
scriptEle.text = xhr.responseText;
|
|
178
244
|
doc.body.appendChild(scriptEle);
|
|
179
|
-
if (typeof fallback === "function")
|
|
180
|
-
fallback();
|
|
245
|
+
if (typeof fallback === "function") fallback();
|
|
181
246
|
} else {
|
|
182
247
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
183
248
|
}
|
|
@@ -245,20 +310,15 @@ var require_cjs = __commonJS({
|
|
|
245
310
|
);
|
|
246
311
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
247
312
|
var toDescriptionCase = (str = "") => {
|
|
248
|
-
if (typeof str !== "string")
|
|
249
|
-
return;
|
|
313
|
+
if (typeof str !== "string") return;
|
|
250
314
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
251
315
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
252
316
|
};
|
|
253
317
|
var arrayzeValue = (val) => {
|
|
254
|
-
if (isArray2(val))
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
if (isObject2(val))
|
|
259
|
-
return Object.values(val);
|
|
260
|
-
if (isNumber2(val))
|
|
261
|
-
return [val];
|
|
318
|
+
if (isArray2(val)) return val;
|
|
319
|
+
if (isString2(val)) return val.split(" ");
|
|
320
|
+
if (isObject2(val)) return Object.values(val);
|
|
321
|
+
if (isNumber2(val)) return [val];
|
|
262
322
|
};
|
|
263
323
|
}
|
|
264
324
|
});
|
|
@@ -281,59 +341,114 @@ __export(sequence_exports, {
|
|
|
281
341
|
});
|
|
282
342
|
module.exports = __toCommonJS(sequence_exports);
|
|
283
343
|
|
|
284
|
-
// ../../node_modules/@domql/utils/
|
|
344
|
+
// ../../node_modules/@domql/utils/globals.js
|
|
285
345
|
var window2 = globalThis;
|
|
286
346
|
var document2 = window2.document;
|
|
287
347
|
|
|
288
|
-
// ../../node_modules/@domql/utils/
|
|
348
|
+
// ../../node_modules/@domql/utils/node.js
|
|
289
349
|
var isDOMNode = (obj) => {
|
|
290
350
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
291
351
|
};
|
|
292
352
|
|
|
293
|
-
// ../../node_modules/@domql/utils/
|
|
353
|
+
// ../../node_modules/@domql/utils/types.js
|
|
294
354
|
var isString = (arg) => typeof arg === "string";
|
|
295
355
|
var isFunction = (arg) => typeof arg === "function";
|
|
296
356
|
var isNull = (arg) => arg === null;
|
|
297
357
|
var isArray = (arg) => Array.isArray(arg);
|
|
298
358
|
var isObjectLike = (arg) => {
|
|
299
|
-
if (arg === null)
|
|
300
|
-
return false;
|
|
359
|
+
if (arg === null) return false;
|
|
301
360
|
return typeof arg === "object";
|
|
302
361
|
};
|
|
303
362
|
var isUndefined = (arg) => {
|
|
304
363
|
return arg === void 0;
|
|
305
364
|
};
|
|
306
365
|
|
|
307
|
-
// ../../node_modules/@domql/utils/
|
|
308
|
-
var
|
|
309
|
-
return arr.reduce(
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
366
|
+
// ../../node_modules/@domql/utils/array.js
|
|
367
|
+
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
368
|
+
return arr.reduce(
|
|
369
|
+
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
370
|
+
{}
|
|
371
|
+
);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// ../../node_modules/@domql/utils/keys.js
|
|
375
|
+
var STATE_METHODS = [
|
|
376
|
+
"update",
|
|
377
|
+
"parse",
|
|
378
|
+
"clean",
|
|
379
|
+
"create",
|
|
380
|
+
"destroy",
|
|
381
|
+
"add",
|
|
382
|
+
"toggle",
|
|
383
|
+
"remove",
|
|
384
|
+
"apply",
|
|
385
|
+
"set",
|
|
386
|
+
"reset",
|
|
387
|
+
"replace",
|
|
388
|
+
"quietReplace",
|
|
389
|
+
"quietUpdate",
|
|
390
|
+
"applyReplace",
|
|
391
|
+
"applyFunction",
|
|
392
|
+
"keys",
|
|
393
|
+
"values",
|
|
394
|
+
"ref",
|
|
395
|
+
"rootUpdate",
|
|
396
|
+
"parentUpdate",
|
|
397
|
+
"parent",
|
|
398
|
+
"__element",
|
|
399
|
+
"__depends",
|
|
400
|
+
"__ref",
|
|
401
|
+
"__children",
|
|
402
|
+
"root",
|
|
403
|
+
"setByPath",
|
|
404
|
+
"setPathCollection",
|
|
405
|
+
"removeByPath",
|
|
406
|
+
"removePathCollection",
|
|
407
|
+
"getByPath"
|
|
408
|
+
];
|
|
409
|
+
var PROPS_METHODS = ["update", "__element"];
|
|
410
|
+
var METHODS = [
|
|
411
|
+
"set",
|
|
412
|
+
"reset",
|
|
413
|
+
"update",
|
|
414
|
+
"remove",
|
|
415
|
+
"updateContent",
|
|
416
|
+
"removeContent",
|
|
417
|
+
"lookup",
|
|
418
|
+
"lookdown",
|
|
419
|
+
"lookdownAll",
|
|
420
|
+
"getRef",
|
|
421
|
+
"getPath",
|
|
422
|
+
"setNodeStyles",
|
|
423
|
+
"spotByPath",
|
|
424
|
+
"keys",
|
|
425
|
+
"parse",
|
|
426
|
+
"setProps",
|
|
427
|
+
"parseDeep",
|
|
428
|
+
"variables",
|
|
429
|
+
"if",
|
|
430
|
+
"log",
|
|
431
|
+
"verbose",
|
|
432
|
+
"warn",
|
|
433
|
+
"error",
|
|
434
|
+
"call",
|
|
435
|
+
"nextElement",
|
|
436
|
+
"previousElement"
|
|
437
|
+
];
|
|
438
|
+
var METHODS_EXL = [
|
|
439
|
+
...["node", "context", "extends", "__element", "__ref"],
|
|
440
|
+
...METHODS,
|
|
441
|
+
...STATE_METHODS,
|
|
442
|
+
...PROPS_METHODS
|
|
443
|
+
];
|
|
444
|
+
|
|
445
|
+
// ../../node_modules/@domql/utils/object.js
|
|
446
|
+
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
333
447
|
for (const e in extend) {
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
448
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
|
|
449
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
336
450
|
continue;
|
|
451
|
+
}
|
|
337
452
|
const elementProp = element[e];
|
|
338
453
|
const extendProp = extend[e];
|
|
339
454
|
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
@@ -351,7 +466,7 @@ var deepClone = (obj, options = {}) => {
|
|
|
351
466
|
cleanNull = false,
|
|
352
467
|
window: targetWindow,
|
|
353
468
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
354
|
-
|
|
469
|
+
handleExtends = false
|
|
355
470
|
} = options;
|
|
356
471
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
357
472
|
return obj;
|
|
@@ -359,44 +474,46 @@ var deepClone = (obj, options = {}) => {
|
|
|
359
474
|
if (visited.has(obj)) {
|
|
360
475
|
return visited.get(obj);
|
|
361
476
|
}
|
|
362
|
-
const
|
|
363
|
-
visited.set(obj,
|
|
477
|
+
const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
478
|
+
visited.set(obj, clone);
|
|
364
479
|
for (const key in obj) {
|
|
365
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
366
|
-
|
|
367
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
480
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
481
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
368
482
|
continue;
|
|
483
|
+
}
|
|
369
484
|
const value = obj[key];
|
|
370
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
485
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
|
|
371
486
|
continue;
|
|
487
|
+
}
|
|
372
488
|
if (isDOMNode(value)) {
|
|
373
|
-
|
|
489
|
+
clone[key] = value;
|
|
374
490
|
continue;
|
|
375
491
|
}
|
|
376
|
-
if (
|
|
377
|
-
|
|
492
|
+
if (handleExtends && key === "extends" && isArray(value)) {
|
|
493
|
+
clone[key] = unstackArrayOfObjects(value, exclude);
|
|
378
494
|
continue;
|
|
379
495
|
}
|
|
380
496
|
if (isFunction(value) && targetWindow) {
|
|
381
|
-
|
|
497
|
+
clone[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
382
498
|
continue;
|
|
383
499
|
}
|
|
384
500
|
if (isObjectLike(value)) {
|
|
385
|
-
|
|
501
|
+
clone[key] = deepClone(value, {
|
|
502
|
+
...options,
|
|
386
503
|
visited
|
|
387
|
-
})
|
|
504
|
+
});
|
|
388
505
|
} else {
|
|
389
|
-
|
|
506
|
+
clone[key] = value;
|
|
390
507
|
}
|
|
391
508
|
}
|
|
392
|
-
return
|
|
509
|
+
return clone;
|
|
393
510
|
};
|
|
394
511
|
|
|
395
|
-
// ../../node_modules/@domql/utils/
|
|
512
|
+
// ../../node_modules/@domql/utils/cookie.js
|
|
396
513
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
397
514
|
|
|
398
515
|
// src/utils/sequence.js
|
|
399
|
-
var
|
|
516
|
+
var import_utils5 = __toESM(require_cjs(), 1);
|
|
400
517
|
|
|
401
518
|
// src/defaultConfig/index.js
|
|
402
519
|
var defaultConfig_exports = {};
|
|
@@ -670,8 +787,7 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
670
787
|
var setScalingVar = (key, sequenceProps) => {
|
|
671
788
|
const { base, type, unit } = sequenceProps;
|
|
672
789
|
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
673
|
-
if (key === 0)
|
|
674
|
-
return defaultVal;
|
|
790
|
+
if (key === 0) return defaultVal;
|
|
675
791
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
676
792
|
const ratioVar = `${prefix}-ratio`;
|
|
677
793
|
if (key > 0) {
|
|
@@ -708,10 +824,8 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
708
824
|
const diffRounded = ~~next - ~~value;
|
|
709
825
|
let arr;
|
|
710
826
|
const [first, middle, second] = getSubratioDifference(value, ratio);
|
|
711
|
-
if (diffRounded > 16)
|
|
712
|
-
|
|
713
|
-
else
|
|
714
|
-
arr = [first, second];
|
|
827
|
+
if (diffRounded > 16) arr = [first, middle, second];
|
|
828
|
+
else arr = [first, second];
|
|
715
829
|
arr.forEach((v, k) => {
|
|
716
830
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
717
831
|
const newVar = variable + (k + 1);
|
|
@@ -753,14 +867,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
753
867
|
index: key
|
|
754
868
|
};
|
|
755
869
|
setSequenceValue(props, sequenceProps);
|
|
756
|
-
if (subSequence)
|
|
757
|
-
generateSubSequence(props, sequenceProps);
|
|
870
|
+
if (subSequence) generateSubSequence(props, sequenceProps);
|
|
758
871
|
}
|
|
759
872
|
return sequenceProps;
|
|
760
873
|
};
|
|
761
874
|
var generateSequencePosition = (sequenceProps, position = 0) => {
|
|
762
875
|
const { type, base, ratio, subSequence } = sequenceProps;
|
|
763
|
-
const letterKey = isString
|
|
876
|
+
const letterKey = (void 0).call("isString", position) ? position : numToLetterMap[position];
|
|
764
877
|
if (!letterKey) {
|
|
765
878
|
console.warn(`Position ${position} is out of range in numToLetterMap`);
|
|
766
879
|
return null;
|
|
@@ -800,13 +913,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
800
913
|
unit = UNIT2.default,
|
|
801
914
|
useVariable
|
|
802
915
|
} = sequenceProps;
|
|
803
|
-
if (isString(value) && value.slice(0, 2) === "--")
|
|
804
|
-
|
|
805
|
-
const prefix = `--${(0, import_utils3.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
916
|
+
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
917
|
+
const prefix = `--${(0, import_utils5.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
806
918
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
807
919
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
808
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
809
|
-
return value;
|
|
920
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter) return value;
|
|
810
921
|
const letterVal = value.toUpperCase();
|
|
811
922
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
812
923
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -830,8 +941,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
830
941
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
831
942
|
}
|
|
832
943
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
833
|
-
if (CONFIG2.verbose)
|
|
834
|
-
console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
944
|
+
if (CONFIG2.verbose) console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
835
945
|
absValue = absValue.slice(0, 1);
|
|
836
946
|
}
|
|
837
947
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -839,8 +949,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
839
949
|
return isNegative ? `calc(${varValue2} * -1)` : varValue2;
|
|
840
950
|
}
|
|
841
951
|
const sequenceItem = sequence ? sequence[absValue] : null;
|
|
842
|
-
if (!sequenceItem)
|
|
843
|
-
return console.warn("can't find", sequence, absValue);
|
|
952
|
+
if (!sequenceItem) return console.warn("can't find", sequence, absValue);
|
|
844
953
|
if (unit === "ms" || unit === "s") {
|
|
845
954
|
return isNegative + sequenceItem.val + unit;
|
|
846
955
|
}
|
|
@@ -849,12 +958,10 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
849
958
|
var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
850
959
|
if (typeof value !== "string") {
|
|
851
960
|
const CONFIG2 = getActiveConfig();
|
|
852
|
-
if (CONFIG2.verbose)
|
|
853
|
-
console.warn(propertyName, value, "is not a string");
|
|
961
|
+
if (CONFIG2.verbose) console.warn(propertyName, value, "is not a string");
|
|
854
962
|
return { [propertyName]: value };
|
|
855
963
|
}
|
|
856
|
-
if (value === "-" || value === "")
|
|
857
|
-
return {};
|
|
964
|
+
if (value === "-" || value === "") return {};
|
|
858
965
|
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
859
966
|
};
|
|
860
967
|
var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
|