@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.
@@ -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 __defProp3 = Object.defineProperty;
37
+ var __defProp2 = Object.defineProperty;
38
38
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
39
39
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
40
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
40
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
41
41
  var __export2 = (target, all) => {
42
42
  for (var name in all)
43
- __defProp3(target, name, { get: all[name], enumerable: true });
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 (!__hasOwnProp3.call(to, key) && key !== except)
49
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
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(__defProp3({}, "__esModule", { value: true }), mod);
53
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
54
54
  var index_exports = {};
55
55
  __export2(index_exports, {
56
56
  arrayzeValue: () => arrayzeValue3,
@@ -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) {
@@ -273,16 +342,16 @@ __export(transforms_exports, {
273
342
  });
274
343
  module.exports = __toCommonJS(transforms_exports);
275
344
 
276
- // node_modules/@domql/utils/dist/esm/globals.js
345
+ // ../../node_modules/@domql/utils/globals.js
277
346
  var window2 = globalThis;
278
347
  var document2 = window2.document;
279
348
 
280
- // node_modules/@domql/utils/dist/esm/node.js
349
+ // ../../node_modules/@domql/utils/node.js
281
350
  var isDOMNode = (obj) => {
282
351
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
283
352
  };
284
353
 
285
- // node_modules/@domql/utils/dist/esm/types.js
354
+ // ../../node_modules/@domql/utils/types.js
286
355
  var isObject = (arg) => {
287
356
  if (arg === null) return false;
288
357
  return typeof arg === "object" && arg.constructor === Object;
@@ -300,35 +369,92 @@ var isUndefined = (arg) => {
300
369
  return arg === void 0;
301
370
  };
302
371
 
303
- // node_modules/@domql/utils/dist/esm/array.js
304
- var mergeArray = (arr, exclude = []) => {
305
- return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
372
+ // ../../node_modules/@domql/utils/array.js
373
+ var unstackArrayOfObjects = (arr, exclude = []) => {
374
+ return arr.reduce(
375
+ (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
376
+ {}
377
+ );
306
378
  };
307
379
 
308
- // node_modules/@domql/utils/dist/esm/object.js
309
- var __defProp2 = Object.defineProperty;
310
- var __defProps = Object.defineProperties;
311
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
312
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
313
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
314
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
315
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
316
- var __spreadValues = (a, b) => {
317
- for (var prop in b || (b = {}))
318
- if (__hasOwnProp2.call(b, prop))
319
- __defNormalProp(a, prop, b[prop]);
320
- if (__getOwnPropSymbols)
321
- for (var prop of __getOwnPropSymbols(b)) {
322
- if (__propIsEnum.call(b, prop))
323
- __defNormalProp(a, prop, b[prop]);
324
- }
325
- return a;
326
- };
327
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
380
+ // ../../node_modules/@domql/utils/keys.js
381
+ var STATE_METHODS = [
382
+ "update",
383
+ "parse",
384
+ "clean",
385
+ "create",
386
+ "destroy",
387
+ "add",
388
+ "toggle",
389
+ "remove",
390
+ "apply",
391
+ "set",
392
+ "reset",
393
+ "replace",
394
+ "quietReplace",
395
+ "quietUpdate",
396
+ "applyReplace",
397
+ "applyFunction",
398
+ "keys",
399
+ "values",
400
+ "ref",
401
+ "rootUpdate",
402
+ "parentUpdate",
403
+ "parent",
404
+ "__element",
405
+ "__depends",
406
+ "__ref",
407
+ "__children",
408
+ "root",
409
+ "setByPath",
410
+ "setPathCollection",
411
+ "removeByPath",
412
+ "removePathCollection",
413
+ "getByPath"
414
+ ];
415
+ var PROPS_METHODS = ["update", "__element"];
416
+ var METHODS = [
417
+ "set",
418
+ "reset",
419
+ "update",
420
+ "remove",
421
+ "updateContent",
422
+ "removeContent",
423
+ "lookup",
424
+ "lookdown",
425
+ "lookdownAll",
426
+ "getRef",
427
+ "getPath",
428
+ "setNodeStyles",
429
+ "spotByPath",
430
+ "keys",
431
+ "parse",
432
+ "setProps",
433
+ "parseDeep",
434
+ "variables",
435
+ "if",
436
+ "log",
437
+ "verbose",
438
+ "warn",
439
+ "error",
440
+ "call",
441
+ "nextElement",
442
+ "previousElement"
443
+ ];
444
+ var METHODS_EXL = [
445
+ ...["node", "context", "extends", "__element", "__ref"],
446
+ ...METHODS,
447
+ ...STATE_METHODS,
448
+ ...PROPS_METHODS
449
+ ];
450
+
451
+ // ../../node_modules/@domql/utils/object.js
328
452
  var merge = (element, obj, excludeFrom = []) => {
329
453
  for (const e in obj) {
330
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
331
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
454
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
455
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
456
+ continue;
457
+ }
332
458
  const elementProp = element[e];
333
459
  const objProp = obj[e];
334
460
  if (elementProp === void 0) {
@@ -337,10 +463,12 @@ var merge = (element, obj, excludeFrom = []) => {
337
463
  }
338
464
  return element;
339
465
  };
340
- var deepMerge = (element, extend, excludeFrom = []) => {
466
+ var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
341
467
  for (const e in extend) {
342
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
343
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
468
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
469
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
470
+ continue;
471
+ }
344
472
  const elementProp = element[e];
345
473
  const extendProp = extend[e];
346
474
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -358,7 +486,7 @@ var deepClone = (obj, options = {}) => {
358
486
  cleanNull = false,
359
487
  window: targetWindow,
360
488
  visited = /* @__PURE__ */ new WeakMap(),
361
- handleExtend = false
489
+ handleExtends = false
362
490
  } = options;
363
491
  if (!isObjectLike(obj) || isDOMNode(obj)) {
364
492
  return obj;
@@ -366,37 +494,42 @@ var deepClone = (obj, options = {}) => {
366
494
  if (visited.has(obj)) {
367
495
  return visited.get(obj);
368
496
  }
369
- const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
370
- visited.set(obj, clone2);
497
+ const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
498
+ visited.set(obj, clone);
371
499
  for (const key in obj) {
372
500
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
373
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
501
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
502
+ continue;
503
+ }
374
504
  const value = obj[key];
375
- if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
505
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
506
+ continue;
507
+ }
376
508
  if (isDOMNode(value)) {
377
- clone2[key] = value;
509
+ clone[key] = value;
378
510
  continue;
379
511
  }
380
- if (handleExtend && key === "extend" && isArray(value)) {
381
- clone2[key] = mergeArray(value, exclude);
512
+ if (handleExtends && key === "extends" && isArray(value)) {
513
+ clone[key] = unstackArrayOfObjects(value, exclude);
382
514
  continue;
383
515
  }
384
516
  if (isFunction(value) && targetWindow) {
385
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
517
+ clone[key] = targetWindow.eval("(" + value.toString() + ")");
386
518
  continue;
387
519
  }
388
520
  if (isObjectLike(value)) {
389
- clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
521
+ clone[key] = deepClone(value, {
522
+ ...options,
390
523
  visited
391
- }));
524
+ });
392
525
  } else {
393
- clone2[key] = value;
526
+ clone[key] = value;
394
527
  }
395
528
  }
396
- return clone2;
529
+ return clone;
397
530
  };
398
531
 
399
- // node_modules/@domql/utils/dist/esm/cookie.js
532
+ // ../../node_modules/@domql/utils/cookie.js
400
533
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
401
534
 
402
535
  // src/defaultConfig/index.js
@@ -714,7 +847,7 @@ var getRgbTone = (rgb, tone) => {
714
847
  };
715
848
 
716
849
  // src/utils/sequence.js
717
- var import_utils4 = __toESM(require_cjs(), 1);
850
+ var import_utils6 = __toESM(require_cjs(), 1);
718
851
  var numToLetterMap = {
719
852
  "-6": "U",
720
853
  "-5": "V",
@@ -853,7 +986,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
853
986
  useVariable
854
987
  } = sequenceProps;
855
988
  if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
856
- const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
989
+ const prefix = `--${(0, import_utils6.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
857
990
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
858
991
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
859
992
  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;
@@ -1008,10 +1141,10 @@ var getMediaColor = (value, globalTheme, config) => {
1008
1141
  };
1009
1142
 
1010
1143
  // src/system/font.js
1011
- var import_utils11 = __toESM(require_cjs(), 1);
1144
+ var import_utils13 = __toESM(require_cjs(), 1);
1012
1145
 
1013
1146
  // src/system/spacing.js
1014
- var import_utils15 = __toESM(require_cjs(), 1);
1147
+ var import_utils17 = __toESM(require_cjs(), 1);
1015
1148
  var getSequence = (sequenceProps) => {
1016
1149
  const CONFIG2 = getActiveConfig();
1017
1150
  const { SPACING: SPACING2 } = CONFIG2;
@@ -1024,7 +1157,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
1024
1157
  if (isString(value) && (value.includes("calc") || value.includes("var"))) {
1025
1158
  return { [propertyName]: value };
1026
1159
  }
1027
- const stack = (0, import_utils15.arrayzeValue)(value);
1160
+ const stack = (0, import_utils17.arrayzeValue)(value);
1028
1161
  if (!isArray(stack)) return;
1029
1162
  if (stack.length > 1) {
1030
1163
  let suffix = "";
@@ -1117,11 +1250,11 @@ var getShadow = (value, globalTheme) => {
1117
1250
  };
1118
1251
 
1119
1252
  // src/system/timing.js
1120
- var import_utils19 = __toESM(require_cjs(), 1);
1253
+ var import_utils21 = __toESM(require_cjs(), 1);
1121
1254
  var getTimingFunction = (value) => {
1122
1255
  const CONFIG2 = getActiveConfig();
1123
1256
  const { TIMING: TIMING2 } = CONFIG2;
1124
- return TIMING2[value] || TIMING2[(0, import_utils19.toCamelCase)(value)] || value;
1257
+ return TIMING2[value] || TIMING2[(0, import_utils21.toCamelCase)(value)] || value;
1125
1258
  };
1126
1259
  var getTimingByKey = (value, property = "timing") => {
1127
1260
  const CONFIG2 = getActiveConfig();
@@ -38,15 +38,86 @@ __export(color_exports, {
38
38
  });
39
39
  module.exports = __toCommonJS(color_exports);
40
40
 
41
- // node_modules/@domql/utils/dist/esm/globals.js
41
+ // ../../node_modules/@domql/utils/globals.js
42
42
  var window2 = globalThis;
43
43
  var document2 = window2.document;
44
44
 
45
- // node_modules/@domql/utils/dist/esm/types.js
45
+ // ../../node_modules/@domql/utils/types.js
46
46
  var isString = (arg) => typeof arg === "string";
47
47
  var isNumber = (arg) => typeof arg === "number";
48
48
 
49
- // node_modules/@domql/utils/dist/esm/cookie.js
49
+ // ../../node_modules/@domql/utils/keys.js
50
+ var STATE_METHODS = [
51
+ "update",
52
+ "parse",
53
+ "clean",
54
+ "create",
55
+ "destroy",
56
+ "add",
57
+ "toggle",
58
+ "remove",
59
+ "apply",
60
+ "set",
61
+ "reset",
62
+ "replace",
63
+ "quietReplace",
64
+ "quietUpdate",
65
+ "applyReplace",
66
+ "applyFunction",
67
+ "keys",
68
+ "values",
69
+ "ref",
70
+ "rootUpdate",
71
+ "parentUpdate",
72
+ "parent",
73
+ "__element",
74
+ "__depends",
75
+ "__ref",
76
+ "__children",
77
+ "root",
78
+ "setByPath",
79
+ "setPathCollection",
80
+ "removeByPath",
81
+ "removePathCollection",
82
+ "getByPath"
83
+ ];
84
+ var PROPS_METHODS = ["update", "__element"];
85
+ var METHODS = [
86
+ "set",
87
+ "reset",
88
+ "update",
89
+ "remove",
90
+ "updateContent",
91
+ "removeContent",
92
+ "lookup",
93
+ "lookdown",
94
+ "lookdownAll",
95
+ "getRef",
96
+ "getPath",
97
+ "setNodeStyles",
98
+ "spotByPath",
99
+ "keys",
100
+ "parse",
101
+ "setProps",
102
+ "parseDeep",
103
+ "variables",
104
+ "if",
105
+ "log",
106
+ "verbose",
107
+ "warn",
108
+ "error",
109
+ "call",
110
+ "nextElement",
111
+ "previousElement"
112
+ ];
113
+ var METHODS_EXL = [
114
+ ...["node", "context", "extends", "__element", "__ref"],
115
+ ...METHODS,
116
+ ...STATE_METHODS,
117
+ ...PROPS_METHODS
118
+ ];
119
+
120
+ // ../../node_modules/@domql/utils/cookie.js
50
121
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
51
122
 
52
123
  // src/utils/color.js