@symbo.ls/scratch 3.0.1 → 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 +105 -43
- package/dist/cjs/index.js +192 -59
- package/dist/cjs/set.js +191 -58
- package/dist/cjs/system/color.js +183 -52
- package/dist/cjs/system/document.js +185 -52
- package/dist/cjs/system/font.js +183 -52
- package/dist/cjs/system/index.js +192 -59
- package/dist/cjs/system/reset.js +185 -52
- package/dist/cjs/system/shadow.js +184 -53
- package/dist/cjs/system/spacing.js +189 -56
- package/dist/cjs/system/svg.js +182 -51
- package/dist/cjs/system/theme.js +182 -51
- package/dist/cjs/system/timing.js +185 -54
- package/dist/cjs/system/typography.js +187 -54
- package/dist/cjs/transforms/index.js +191 -58
- package/dist/cjs/utils/color.js +74 -3
- package/dist/cjs/utils/index.js +182 -51
- package/dist/cjs/utils/sequence.js +184 -53
- package/dist/cjs/utils/sprite.js +105 -43
- package/dist/cjs/utils/var.js +181 -50
- package/package.json +4 -4
package/dist/cjs/system/font.js
CHANGED
|
@@ -34,23 +34,23 @@ 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(
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var index_exports = {};
|
|
55
55
|
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue2,
|
|
@@ -83,6 +83,75 @@ var require_cjs = __commonJS({
|
|
|
83
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
84
84
|
var isNumber2 = (arg) => typeof arg === "number";
|
|
85
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
|
+
];
|
|
86
155
|
var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
87
156
|
async function toggleFullscreen(opts) {
|
|
88
157
|
if (!document.fullscreenElement) {
|
|
@@ -263,16 +332,16 @@ __export(font_exports, {
|
|
|
263
332
|
});
|
|
264
333
|
module.exports = __toCommonJS(font_exports);
|
|
265
334
|
|
|
266
|
-
// node_modules/@domql/utils/
|
|
335
|
+
// ../../node_modules/@domql/utils/globals.js
|
|
267
336
|
var window2 = globalThis;
|
|
268
337
|
var document2 = window2.document;
|
|
269
338
|
|
|
270
|
-
// node_modules/@domql/utils/
|
|
339
|
+
// ../../node_modules/@domql/utils/node.js
|
|
271
340
|
var isDOMNode = (obj) => {
|
|
272
341
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
273
342
|
};
|
|
274
343
|
|
|
275
|
-
// node_modules/@domql/utils/
|
|
344
|
+
// ../../node_modules/@domql/utils/types.js
|
|
276
345
|
var isObject = (arg) => {
|
|
277
346
|
if (arg === null) return false;
|
|
278
347
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -288,35 +357,92 @@ var isUndefined = (arg) => {
|
|
|
288
357
|
return arg === void 0;
|
|
289
358
|
};
|
|
290
359
|
|
|
291
|
-
// node_modules/@domql/utils/
|
|
292
|
-
var
|
|
293
|
-
return arr.reduce(
|
|
360
|
+
// ../../node_modules/@domql/utils/array.js
|
|
361
|
+
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
362
|
+
return arr.reduce(
|
|
363
|
+
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
364
|
+
{}
|
|
365
|
+
);
|
|
294
366
|
};
|
|
295
367
|
|
|
296
|
-
// node_modules/@domql/utils/
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
368
|
+
// ../../node_modules/@domql/utils/keys.js
|
|
369
|
+
var STATE_METHODS = [
|
|
370
|
+
"update",
|
|
371
|
+
"parse",
|
|
372
|
+
"clean",
|
|
373
|
+
"create",
|
|
374
|
+
"destroy",
|
|
375
|
+
"add",
|
|
376
|
+
"toggle",
|
|
377
|
+
"remove",
|
|
378
|
+
"apply",
|
|
379
|
+
"set",
|
|
380
|
+
"reset",
|
|
381
|
+
"replace",
|
|
382
|
+
"quietReplace",
|
|
383
|
+
"quietUpdate",
|
|
384
|
+
"applyReplace",
|
|
385
|
+
"applyFunction",
|
|
386
|
+
"keys",
|
|
387
|
+
"values",
|
|
388
|
+
"ref",
|
|
389
|
+
"rootUpdate",
|
|
390
|
+
"parentUpdate",
|
|
391
|
+
"parent",
|
|
392
|
+
"__element",
|
|
393
|
+
"__depends",
|
|
394
|
+
"__ref",
|
|
395
|
+
"__children",
|
|
396
|
+
"root",
|
|
397
|
+
"setByPath",
|
|
398
|
+
"setPathCollection",
|
|
399
|
+
"removeByPath",
|
|
400
|
+
"removePathCollection",
|
|
401
|
+
"getByPath"
|
|
402
|
+
];
|
|
403
|
+
var PROPS_METHODS = ["update", "__element"];
|
|
404
|
+
var METHODS = [
|
|
405
|
+
"set",
|
|
406
|
+
"reset",
|
|
407
|
+
"update",
|
|
408
|
+
"remove",
|
|
409
|
+
"updateContent",
|
|
410
|
+
"removeContent",
|
|
411
|
+
"lookup",
|
|
412
|
+
"lookdown",
|
|
413
|
+
"lookdownAll",
|
|
414
|
+
"getRef",
|
|
415
|
+
"getPath",
|
|
416
|
+
"setNodeStyles",
|
|
417
|
+
"spotByPath",
|
|
418
|
+
"keys",
|
|
419
|
+
"parse",
|
|
420
|
+
"setProps",
|
|
421
|
+
"parseDeep",
|
|
422
|
+
"variables",
|
|
423
|
+
"if",
|
|
424
|
+
"log",
|
|
425
|
+
"verbose",
|
|
426
|
+
"warn",
|
|
427
|
+
"error",
|
|
428
|
+
"call",
|
|
429
|
+
"nextElement",
|
|
430
|
+
"previousElement"
|
|
431
|
+
];
|
|
432
|
+
var METHODS_EXL = [
|
|
433
|
+
...["node", "context", "extends", "__element", "__ref"],
|
|
434
|
+
...METHODS,
|
|
435
|
+
...STATE_METHODS,
|
|
436
|
+
...PROPS_METHODS
|
|
437
|
+
];
|
|
438
|
+
|
|
439
|
+
// ../../node_modules/@domql/utils/object.js
|
|
440
|
+
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
317
441
|
for (const e in extend) {
|
|
318
|
-
const
|
|
319
|
-
if (!
|
|
442
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
|
|
443
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
320
446
|
const elementProp = element[e];
|
|
321
447
|
const extendProp = extend[e];
|
|
322
448
|
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
@@ -334,7 +460,7 @@ var deepClone = (obj, options = {}) => {
|
|
|
334
460
|
cleanNull = false,
|
|
335
461
|
window: targetWindow,
|
|
336
462
|
visited = /* @__PURE__ */ new WeakMap(),
|
|
337
|
-
|
|
463
|
+
handleExtends = false
|
|
338
464
|
} = options;
|
|
339
465
|
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
340
466
|
return obj;
|
|
@@ -342,41 +468,46 @@ var deepClone = (obj, options = {}) => {
|
|
|
342
468
|
if (visited.has(obj)) {
|
|
343
469
|
return visited.get(obj);
|
|
344
470
|
}
|
|
345
|
-
const
|
|
346
|
-
visited.set(obj,
|
|
471
|
+
const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
472
|
+
visited.set(obj, clone);
|
|
347
473
|
for (const key in obj) {
|
|
348
474
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
349
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
475
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
350
478
|
const value = obj[key];
|
|
351
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
479
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
352
482
|
if (isDOMNode(value)) {
|
|
353
|
-
|
|
483
|
+
clone[key] = value;
|
|
354
484
|
continue;
|
|
355
485
|
}
|
|
356
|
-
if (
|
|
357
|
-
|
|
486
|
+
if (handleExtends && key === "extends" && isArray(value)) {
|
|
487
|
+
clone[key] = unstackArrayOfObjects(value, exclude);
|
|
358
488
|
continue;
|
|
359
489
|
}
|
|
360
490
|
if (isFunction(value) && targetWindow) {
|
|
361
|
-
|
|
491
|
+
clone[key] = targetWindow.eval("(" + value.toString() + ")");
|
|
362
492
|
continue;
|
|
363
493
|
}
|
|
364
494
|
if (isObjectLike(value)) {
|
|
365
|
-
|
|
495
|
+
clone[key] = deepClone(value, {
|
|
496
|
+
...options,
|
|
366
497
|
visited
|
|
367
|
-
})
|
|
498
|
+
});
|
|
368
499
|
} else {
|
|
369
|
-
|
|
500
|
+
clone[key] = value;
|
|
370
501
|
}
|
|
371
502
|
}
|
|
372
|
-
return
|
|
503
|
+
return clone;
|
|
373
504
|
};
|
|
374
505
|
|
|
375
|
-
// node_modules/@domql/utils/
|
|
506
|
+
// ../../node_modules/@domql/utils/cookie.js
|
|
376
507
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
377
508
|
|
|
378
509
|
// src/system/font.js
|
|
379
|
-
var
|
|
510
|
+
var import_utils10 = __toESM(require_cjs(), 1);
|
|
380
511
|
|
|
381
512
|
// src/defaultConfig/index.js
|
|
382
513
|
var defaultConfig_exports = {};
|
|
@@ -624,7 +755,7 @@ var getFontFaceEach = (name, weights) => {
|
|
|
624
755
|
};
|
|
625
756
|
|
|
626
757
|
// src/utils/sequence.js
|
|
627
|
-
var
|
|
758
|
+
var import_utils6 = __toESM(require_cjs(), 1);
|
|
628
759
|
|
|
629
760
|
// src/system/font.js
|
|
630
761
|
var setFont = (val, key) => {
|
|
@@ -643,7 +774,7 @@ var setFontFamily = (val, key) => {
|
|
|
643
774
|
const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
|
|
644
775
|
let { value, type } = val;
|
|
645
776
|
if (val.isDefault) FONT_FAMILY2.default = key;
|
|
646
|
-
if (isObject(value)) value = (0,
|
|
777
|
+
if (isObject(value)) value = (0, import_utils10.arrayzeValue)(value);
|
|
647
778
|
const CSSvar = `--font-family-${key}`;
|
|
648
779
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
649
780
|
return { var: CSSvar, value: str, arr: value, type };
|