@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) {
@@ -289,16 +358,16 @@ __export(system_exports, {
289
358
  });
290
359
  module.exports = __toCommonJS(system_exports);
291
360
 
292
- // node_modules/@domql/utils/dist/esm/globals.js
361
+ // ../../node_modules/@domql/utils/globals.js
293
362
  var window2 = globalThis;
294
363
  var document2 = window2.document;
295
364
 
296
- // node_modules/@domql/utils/dist/esm/node.js
365
+ // ../../node_modules/@domql/utils/node.js
297
366
  var isDOMNode = (obj) => {
298
367
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
299
368
  };
300
369
 
301
- // node_modules/@domql/utils/dist/esm/types.js
370
+ // ../../node_modules/@domql/utils/types.js
302
371
  var isObject = (arg) => {
303
372
  if (arg === null) return false;
304
373
  return typeof arg === "object" && arg.constructor === Object;
@@ -316,35 +385,92 @@ var isUndefined = (arg) => {
316
385
  return arg === void 0;
317
386
  };
318
387
 
319
- // node_modules/@domql/utils/dist/esm/array.js
320
- var mergeArray = (arr, exclude = []) => {
321
- return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
388
+ // ../../node_modules/@domql/utils/array.js
389
+ var unstackArrayOfObjects = (arr, exclude = []) => {
390
+ return arr.reduce(
391
+ (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
392
+ {}
393
+ );
322
394
  };
323
395
 
324
- // node_modules/@domql/utils/dist/esm/object.js
325
- var __defProp2 = Object.defineProperty;
326
- var __defProps = Object.defineProperties;
327
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
328
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
329
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
330
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
331
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
332
- var __spreadValues = (a, b) => {
333
- for (var prop in b || (b = {}))
334
- if (__hasOwnProp2.call(b, prop))
335
- __defNormalProp(a, prop, b[prop]);
336
- if (__getOwnPropSymbols)
337
- for (var prop of __getOwnPropSymbols(b)) {
338
- if (__propIsEnum.call(b, prop))
339
- __defNormalProp(a, prop, b[prop]);
340
- }
341
- return a;
342
- };
343
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
396
+ // ../../node_modules/@domql/utils/keys.js
397
+ var STATE_METHODS = [
398
+ "update",
399
+ "parse",
400
+ "clean",
401
+ "create",
402
+ "destroy",
403
+ "add",
404
+ "toggle",
405
+ "remove",
406
+ "apply",
407
+ "set",
408
+ "reset",
409
+ "replace",
410
+ "quietReplace",
411
+ "quietUpdate",
412
+ "applyReplace",
413
+ "applyFunction",
414
+ "keys",
415
+ "values",
416
+ "ref",
417
+ "rootUpdate",
418
+ "parentUpdate",
419
+ "parent",
420
+ "__element",
421
+ "__depends",
422
+ "__ref",
423
+ "__children",
424
+ "root",
425
+ "setByPath",
426
+ "setPathCollection",
427
+ "removeByPath",
428
+ "removePathCollection",
429
+ "getByPath"
430
+ ];
431
+ var PROPS_METHODS = ["update", "__element"];
432
+ var METHODS = [
433
+ "set",
434
+ "reset",
435
+ "update",
436
+ "remove",
437
+ "updateContent",
438
+ "removeContent",
439
+ "lookup",
440
+ "lookdown",
441
+ "lookdownAll",
442
+ "getRef",
443
+ "getPath",
444
+ "setNodeStyles",
445
+ "spotByPath",
446
+ "keys",
447
+ "parse",
448
+ "setProps",
449
+ "parseDeep",
450
+ "variables",
451
+ "if",
452
+ "log",
453
+ "verbose",
454
+ "warn",
455
+ "error",
456
+ "call",
457
+ "nextElement",
458
+ "previousElement"
459
+ ];
460
+ var METHODS_EXL = [
461
+ ...["node", "context", "extends", "__element", "__ref"],
462
+ ...METHODS,
463
+ ...STATE_METHODS,
464
+ ...PROPS_METHODS
465
+ ];
466
+
467
+ // ../../node_modules/@domql/utils/object.js
344
468
  var merge = (element, obj, excludeFrom = []) => {
345
469
  for (const e in obj) {
346
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
347
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
470
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
471
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
472
+ continue;
473
+ }
348
474
  const elementProp = element[e];
349
475
  const objProp = obj[e];
350
476
  if (elementProp === void 0) {
@@ -353,10 +479,12 @@ var merge = (element, obj, excludeFrom = []) => {
353
479
  }
354
480
  return element;
355
481
  };
356
- var deepMerge = (element, extend, excludeFrom = []) => {
482
+ var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
357
483
  for (const e in extend) {
358
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
359
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
484
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
485
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
486
+ continue;
487
+ }
360
488
  const elementProp = element[e];
361
489
  const extendProp = extend[e];
362
490
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -374,7 +502,7 @@ var deepClone = (obj, options = {}) => {
374
502
  cleanNull = false,
375
503
  window: targetWindow,
376
504
  visited = /* @__PURE__ */ new WeakMap(),
377
- handleExtend = false
505
+ handleExtends = false
378
506
  } = options;
379
507
  if (!isObjectLike(obj) || isDOMNode(obj)) {
380
508
  return obj;
@@ -382,34 +510,39 @@ var deepClone = (obj, options = {}) => {
382
510
  if (visited.has(obj)) {
383
511
  return visited.get(obj);
384
512
  }
385
- const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
386
- visited.set(obj, clone2);
513
+ const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
514
+ visited.set(obj, clone);
387
515
  for (const key in obj) {
388
516
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
389
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
517
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
518
+ continue;
519
+ }
390
520
  const value = obj[key];
391
- if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
521
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
522
+ continue;
523
+ }
392
524
  if (isDOMNode(value)) {
393
- clone2[key] = value;
525
+ clone[key] = value;
394
526
  continue;
395
527
  }
396
- if (handleExtend && key === "extend" && isArray(value)) {
397
- clone2[key] = mergeArray(value, exclude);
528
+ if (handleExtends && key === "extends" && isArray(value)) {
529
+ clone[key] = unstackArrayOfObjects(value, exclude);
398
530
  continue;
399
531
  }
400
532
  if (isFunction(value) && targetWindow) {
401
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
533
+ clone[key] = targetWindow.eval("(" + value.toString() + ")");
402
534
  continue;
403
535
  }
404
536
  if (isObjectLike(value)) {
405
- clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
537
+ clone[key] = deepClone(value, {
538
+ ...options,
406
539
  visited
407
- }));
540
+ });
408
541
  } else {
409
- clone2[key] = value;
542
+ clone[key] = value;
410
543
  }
411
544
  }
412
- return clone2;
545
+ return clone;
413
546
  };
414
547
  var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
415
548
  const excl = opts.exclude || [];
@@ -435,7 +568,7 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
435
568
  return obj;
436
569
  };
437
570
 
438
- // node_modules/@domql/utils/dist/esm/cookie.js
571
+ // ../../node_modules/@domql/utils/cookie.js
439
572
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
440
573
 
441
574
  // src/defaultConfig/index.js
@@ -777,7 +910,7 @@ var getFontFaceEach = (name, weights) => {
777
910
  };
778
911
 
779
912
  // src/utils/sequence.js
780
- var import_utils4 = __toESM(require_cjs(), 1);
913
+ var import_utils6 = __toESM(require_cjs(), 1);
781
914
  var numToLetterMap = {
782
915
  "-6": "U",
783
916
  "-5": "V",
@@ -916,7 +1049,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
916
1049
  useVariable
917
1050
  } = sequenceProps;
918
1051
  if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
919
- const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
1052
+ const prefix = `--${(0, import_utils6.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
920
1053
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
921
1054
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
922
1055
  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;
@@ -1421,7 +1554,7 @@ var getMediaTheme = (value, modifier) => {
1421
1554
  };
1422
1555
 
1423
1556
  // src/system/font.js
1424
- var import_utils11 = __toESM(require_cjs(), 1);
1557
+ var import_utils13 = __toESM(require_cjs(), 1);
1425
1558
  var setFont = (val, key) => {
1426
1559
  const CSSvar = `--font-${key}`;
1427
1560
  if (!val || isArray(val) && !val[0]) return;
@@ -1438,7 +1571,7 @@ var setFontFamily = (val, key) => {
1438
1571
  const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
1439
1572
  let { value, type } = val;
1440
1573
  if (val.isDefault) FONT_FAMILY2.default = key;
1441
- if (isObject(value)) value = (0, import_utils11.arrayzeValue)(value);
1574
+ if (isObject(value)) value = (0, import_utils13.arrayzeValue)(value);
1442
1575
  const CSSvar = `--font-family-${key}`;
1443
1576
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
1444
1577
  return { var: CSSvar, value: str, arr: value, type };
@@ -1529,7 +1662,7 @@ var getFontSizeByKey = (value) => {
1529
1662
  };
1530
1663
 
1531
1664
  // src/system/spacing.js
1532
- var import_utils15 = __toESM(require_cjs(), 1);
1665
+ var import_utils17 = __toESM(require_cjs(), 1);
1533
1666
  var runThroughMedia2 = (FACTORY2) => {
1534
1667
  for (const prop in FACTORY2) {
1535
1668
  const mediaProps = FACTORY2[prop];
@@ -1580,7 +1713,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
1580
1713
  if (isString(value) && (value.includes("calc") || value.includes("var"))) {
1581
1714
  return { [propertyName]: value };
1582
1715
  }
1583
- const stack = (0, import_utils15.arrayzeValue)(value);
1716
+ const stack = (0, import_utils17.arrayzeValue)(value);
1584
1717
  if (!isArray(stack)) return;
1585
1718
  if (stack.length > 1) {
1586
1719
  let suffix = "";
@@ -1712,7 +1845,7 @@ var getShadow = (value, globalTheme) => {
1712
1845
  };
1713
1846
 
1714
1847
  // src/system/timing.js
1715
- var import_utils19 = __toESM(require_cjs(), 1);
1848
+ var import_utils21 = __toESM(require_cjs(), 1);
1716
1849
  var applyTimingSequence = () => {
1717
1850
  const CONFIG2 = getActiveConfig();
1718
1851
  const { TIMING: TIMING2 } = CONFIG2;
@@ -1722,7 +1855,7 @@ var applyTimingSequence = () => {
1722
1855
  var getTimingFunction = (value) => {
1723
1856
  const CONFIG2 = getActiveConfig();
1724
1857
  const { TIMING: TIMING2 } = CONFIG2;
1725
- return TIMING2[value] || TIMING2[(0, import_utils19.toCamelCase)(value)] || value;
1858
+ return TIMING2[value] || TIMING2[(0, import_utils21.toCamelCase)(value)] || value;
1726
1859
  };
1727
1860
  var getTimingByKey = (value, property = "timing") => {
1728
1861
  const CONFIG2 = getActiveConfig();