@symbo.ls/scratch 2.11.522 → 3.0.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/dist/cjs/factory.js +13 -20
- package/dist/cjs/index.js +192 -382
- package/dist/cjs/set.js +132 -282
- package/dist/cjs/system/color.js +61 -142
- package/dist/cjs/system/document.js +28 -84
- package/dist/cjs/system/font.js +29 -88
- package/dist/cjs/system/index.js +135 -285
- package/dist/cjs/system/reset.js +35 -98
- package/dist/cjs/system/shadow.js +77 -173
- package/dist/cjs/system/spacing.js +41 -112
- package/dist/cjs/system/svg.js +34 -94
- package/dist/cjs/system/theme.js +74 -168
- package/dist/cjs/system/timing.js +33 -96
- package/dist/cjs/system/typography.js +41 -110
- package/dist/cjs/transforms/index.js +112 -228
- package/dist/cjs/utils/color.js +22 -85
- package/dist/cjs/utils/font.js +3 -6
- package/dist/cjs/utils/index.js +66 -154
- package/dist/cjs/utils/sequence.js +33 -57
- package/dist/cjs/utils/sprite.js +13 -20
- package/dist/cjs/utils/theme.js +3 -6
- package/dist/cjs/utils/var.js +27 -45
- package/package.json +3 -3
- package/src/system/svg.js +1 -1
- package/src/transforms/index.js +9 -2
- package/src/utils/color.js +1 -2
package/dist/cjs/system/reset.js
CHANGED
|
@@ -30,44 +30,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
34
|
-
var require_cjs = __commonJS({
|
|
35
|
-
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var __defProp3 = Object.defineProperty;
|
|
38
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
|
-
var __export2 = (target, all) => {
|
|
42
|
-
for (var name in all)
|
|
43
|
-
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
|
-
};
|
|
45
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
-
}
|
|
51
|
-
return to;
|
|
52
|
-
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var globals_exports = {};
|
|
55
|
-
__export2(globals_exports, {
|
|
56
|
-
document: () => document4,
|
|
57
|
-
global: () => global,
|
|
58
|
-
self: () => self,
|
|
59
|
-
window: () => window4
|
|
60
|
-
});
|
|
61
|
-
module2.exports = __toCommonJS2(globals_exports);
|
|
62
|
-
var global = globalThis;
|
|
63
|
-
var self = globalThis;
|
|
64
|
-
var window4 = globalThis;
|
|
65
|
-
var document4 = window4.document;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
33
|
// ../utils/dist/cjs/index.js
|
|
70
|
-
var
|
|
34
|
+
var require_cjs = __commonJS({
|
|
71
35
|
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
72
36
|
"use strict";
|
|
73
37
|
var __defProp3 = Object.defineProperty;
|
|
@@ -87,8 +51,8 @@ var require_cjs2 = __commonJS({
|
|
|
87
51
|
return to;
|
|
88
52
|
};
|
|
89
53
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
90
|
-
var
|
|
91
|
-
__export2(
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
92
56
|
arrayzeValue: () => arrayzeValue,
|
|
93
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
94
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -109,12 +73,11 @@ var require_cjs2 = __commonJS({
|
|
|
109
73
|
toTitleCase: () => toTitleCase,
|
|
110
74
|
toggleFullscreen: () => toggleFullscreen
|
|
111
75
|
});
|
|
112
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
113
77
|
var window22 = globalThis;
|
|
114
78
|
var document22 = window22.document;
|
|
115
79
|
var isObject2 = (arg) => {
|
|
116
|
-
if (arg === null)
|
|
117
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
118
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
119
82
|
};
|
|
120
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
@@ -139,13 +102,11 @@ var require_cjs2 = __commonJS({
|
|
|
139
102
|
};
|
|
140
103
|
var findClosestNumberInFactory = (val, factory) => {
|
|
141
104
|
val = parseFloat(val);
|
|
142
|
-
if (isObject2(factory))
|
|
143
|
-
factory = Object.values(factory);
|
|
105
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
144
106
|
return findClosestNumber(val, factory);
|
|
145
107
|
};
|
|
146
108
|
var formatDate = (timestamp) => {
|
|
147
|
-
if (!timestamp)
|
|
148
|
-
return "";
|
|
109
|
+
if (!timestamp) return "";
|
|
149
110
|
const d = new Date(timestamp);
|
|
150
111
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
151
112
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -212,8 +173,7 @@ var require_cjs2 = __commonJS({
|
|
|
212
173
|
scriptEle.type = type;
|
|
213
174
|
scriptEle.text = xhr.responseText;
|
|
214
175
|
doc.body.appendChild(scriptEle);
|
|
215
|
-
if (typeof fallback === "function")
|
|
216
|
-
fallback();
|
|
176
|
+
if (typeof fallback === "function") fallback();
|
|
217
177
|
} else {
|
|
218
178
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
219
179
|
}
|
|
@@ -281,20 +241,15 @@ var require_cjs2 = __commonJS({
|
|
|
281
241
|
);
|
|
282
242
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
283
243
|
var toDescriptionCase = (str = "") => {
|
|
284
|
-
if (typeof str !== "string")
|
|
285
|
-
return;
|
|
244
|
+
if (typeof str !== "string") return;
|
|
286
245
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
287
246
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
288
247
|
};
|
|
289
248
|
var arrayzeValue = (val) => {
|
|
290
|
-
if (isArray2(val))
|
|
291
|
-
|
|
292
|
-
if (
|
|
293
|
-
|
|
294
|
-
if (isObject2(val))
|
|
295
|
-
return Object.values(val);
|
|
296
|
-
if (isNumber2(val))
|
|
297
|
-
return [val];
|
|
249
|
+
if (isArray2(val)) return val;
|
|
250
|
+
if (isString2(val)) return val.split(" ");
|
|
251
|
+
if (isObject2(val)) return Object.values(val);
|
|
252
|
+
if (isNumber2(val)) return [val];
|
|
298
253
|
};
|
|
299
254
|
}
|
|
300
255
|
});
|
|
@@ -306,35 +261,34 @@ __export(reset_exports, {
|
|
|
306
261
|
});
|
|
307
262
|
module.exports = __toCommonJS(reset_exports);
|
|
308
263
|
|
|
309
|
-
//
|
|
264
|
+
// node_modules/@domql/utils/dist/esm/globals.js
|
|
310
265
|
var window2 = globalThis;
|
|
311
266
|
var document2 = window2.document;
|
|
312
267
|
|
|
313
|
-
//
|
|
268
|
+
// node_modules/@domql/utils/dist/esm/node.js
|
|
314
269
|
var isDOMNode = (obj) => {
|
|
315
270
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
316
271
|
};
|
|
317
272
|
|
|
318
|
-
//
|
|
273
|
+
// node_modules/@domql/utils/dist/esm/types.js
|
|
319
274
|
var isString = (arg) => typeof arg === "string";
|
|
320
275
|
var isFunction = (arg) => typeof arg === "function";
|
|
321
276
|
var isNull = (arg) => arg === null;
|
|
322
277
|
var isArray = (arg) => Array.isArray(arg);
|
|
323
278
|
var isObjectLike = (arg) => {
|
|
324
|
-
if (arg === null)
|
|
325
|
-
return false;
|
|
279
|
+
if (arg === null) return false;
|
|
326
280
|
return typeof arg === "object";
|
|
327
281
|
};
|
|
328
282
|
var isUndefined = (arg) => {
|
|
329
283
|
return arg === void 0;
|
|
330
284
|
};
|
|
331
285
|
|
|
332
|
-
//
|
|
286
|
+
// node_modules/@domql/utils/dist/esm/array.js
|
|
333
287
|
var mergeArray = (arr, exclude = []) => {
|
|
334
288
|
return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
|
|
335
289
|
};
|
|
336
290
|
|
|
337
|
-
//
|
|
291
|
+
// node_modules/@domql/utils/dist/esm/object.js
|
|
338
292
|
var __defProp2 = Object.defineProperty;
|
|
339
293
|
var __defProps = Object.defineProperties;
|
|
340
294
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -357,8 +311,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
357
311
|
var merge = (element, obj, excludeFrom = []) => {
|
|
358
312
|
for (const e in obj) {
|
|
359
313
|
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
|
|
360
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
361
|
-
continue;
|
|
314
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
|
|
362
315
|
const elementProp = element[e];
|
|
363
316
|
const objProp = obj[e];
|
|
364
317
|
if (elementProp === void 0) {
|
|
@@ -370,8 +323,7 @@ var merge = (element, obj, excludeFrom = []) => {
|
|
|
370
323
|
var deepMerge = (element, extend, excludeFrom = []) => {
|
|
371
324
|
for (const e in extend) {
|
|
372
325
|
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
373
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
|
|
374
|
-
continue;
|
|
326
|
+
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
|
|
375
327
|
const elementProp = element[e];
|
|
376
328
|
const extendProp = extend[e];
|
|
377
329
|
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
@@ -400,13 +352,10 @@ var deepClone = (obj, options = {}) => {
|
|
|
400
352
|
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
401
353
|
visited.set(obj, clone2);
|
|
402
354
|
for (const key in obj) {
|
|
403
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
404
|
-
|
|
405
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
406
|
-
continue;
|
|
355
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
356
|
+
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
|
|
407
357
|
const value = obj[key];
|
|
408
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
409
|
-
continue;
|
|
358
|
+
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
|
|
410
359
|
if (isDOMNode(value)) {
|
|
411
360
|
clone2[key] = value;
|
|
412
361
|
continue;
|
|
@@ -435,14 +384,11 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
|
|
|
435
384
|
if (!isObjectLike(obj) || !isObjectLike(params) || isDOMNode(obj) || isDOMNode(params)) {
|
|
436
385
|
return params;
|
|
437
386
|
}
|
|
438
|
-
if (visited.has(obj))
|
|
439
|
-
return visited.get(obj);
|
|
387
|
+
if (visited.has(obj)) return visited.get(obj);
|
|
440
388
|
visited.set(obj, obj);
|
|
441
389
|
for (const e in params) {
|
|
442
|
-
if (!Object.hasOwnProperty.call(params, e))
|
|
443
|
-
|
|
444
|
-
if (excl.includes(e) || forcedExclude && e.startsWith("__"))
|
|
445
|
-
continue;
|
|
390
|
+
if (!Object.hasOwnProperty.call(params, e)) continue;
|
|
391
|
+
if (excl.includes(e) || forcedExclude && e.startsWith("__")) continue;
|
|
446
392
|
const objProp = obj[e];
|
|
447
393
|
const paramsProp = params[e];
|
|
448
394
|
if (isDOMNode(paramsProp)) {
|
|
@@ -456,7 +402,7 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
|
|
|
456
402
|
return obj;
|
|
457
403
|
};
|
|
458
404
|
|
|
459
|
-
//
|
|
405
|
+
// node_modules/@domql/utils/dist/esm/cookie.js
|
|
460
406
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
461
407
|
|
|
462
408
|
// src/defaultConfig/index.js
|
|
@@ -680,11 +626,8 @@ var getActiveConfig = (def) => {
|
|
|
680
626
|
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
681
627
|
};
|
|
682
628
|
|
|
683
|
-
// src/utils/color.js
|
|
684
|
-
var import_globals4 = __toESM(require_cjs(), 1);
|
|
685
|
-
|
|
686
629
|
// src/utils/sequence.js
|
|
687
|
-
var import_utils4 = __toESM(
|
|
630
|
+
var import_utils4 = __toESM(require_cjs(), 1);
|
|
688
631
|
|
|
689
632
|
// src/system/theme.js
|
|
690
633
|
var recursiveTheme = (val) => {
|
|
@@ -700,24 +643,19 @@ var recursiveTheme = (val) => {
|
|
|
700
643
|
} else if (symb === ":") {
|
|
701
644
|
obj[`&${param}`] = recursiveTheme(val[param]);
|
|
702
645
|
}
|
|
703
|
-
} else
|
|
704
|
-
obj[param] = val[param];
|
|
646
|
+
} else obj[param] = val[param];
|
|
705
647
|
}
|
|
706
648
|
return obj;
|
|
707
649
|
};
|
|
708
650
|
var findModifierFromArray = (val, modifierArray) => {
|
|
709
651
|
const currentMod = modifierArray.shift();
|
|
710
|
-
if (val[currentMod])
|
|
711
|
-
return findModifierFromArray(val[currentMod], modifierArray);
|
|
652
|
+
if (val[currentMod]) return findModifierFromArray(val[currentMod], modifierArray);
|
|
712
653
|
return val;
|
|
713
654
|
};
|
|
714
655
|
var findModifier = (val, modifier) => {
|
|
715
|
-
if (isArray(modifier))
|
|
716
|
-
|
|
717
|
-
else
|
|
718
|
-
return val[modifier];
|
|
719
|
-
else
|
|
720
|
-
return val;
|
|
656
|
+
if (isArray(modifier)) return findModifierFromArray(val, modifier);
|
|
657
|
+
else if (isString(modifier) && val[modifier]) return val[modifier];
|
|
658
|
+
else return val;
|
|
721
659
|
};
|
|
722
660
|
var getMediaTheme = (value, modifier) => {
|
|
723
661
|
const activeConfig = getActiveConfig();
|
|
@@ -760,8 +698,7 @@ var applyReset = (reset = {}) => {
|
|
|
760
698
|
}
|
|
761
699
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
762
700
|
const globalTheme = CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {};
|
|
763
|
-
if (RESET2.html)
|
|
764
|
-
overwriteDeep(RESET2.html, globalTheme);
|
|
701
|
+
if (RESET2.html) overwriteDeep(RESET2.html, globalTheme);
|
|
765
702
|
return deepMerge(merge(RESET2, reset), {
|
|
766
703
|
html: {
|
|
767
704
|
position: "absolute",
|