@symbo.ls/scratch 2.11.220 → 2.11.224

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/index.js CHANGED
@@ -66,9 +66,9 @@ var require_cjs = __commonJS({
66
66
  }
67
67
  });
68
68
 
69
- // ../../node_modules/@domql/utils/dist/cjs/key.js
69
+ // ../../../domql/packages/utils/dist/cjs/key.js
70
70
  var require_key = __commonJS({
71
- "../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
71
+ "../../../domql/packages/utils/dist/cjs/key.js"(exports, module2) {
72
72
  "use strict";
73
73
  var __defProp2 = Object.defineProperty;
74
74
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -105,9 +105,9 @@ var require_key = __commonJS({
105
105
  }
106
106
  });
107
107
 
108
- // ../../node_modules/@domql/utils/dist/cjs/env.js
108
+ // ../../../domql/packages/utils/dist/cjs/env.js
109
109
  var require_env = __commonJS({
110
- "../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
110
+ "../../../domql/packages/utils/dist/cjs/env.js"(exports, module2) {
111
111
  "use strict";
112
112
  var __defProp2 = Object.defineProperty;
113
113
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -143,9 +143,9 @@ var require_env = __commonJS({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/@domql/utils/dist/cjs/globals.js
146
+ // ../../../domql/packages/utils/dist/cjs/globals.js
147
147
  var require_globals = __commonJS({
148
- "../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
148
+ "../../../domql/packages/utils/dist/cjs/globals.js"(exports, module2) {
149
149
  "use strict";
150
150
  var __defProp2 = Object.defineProperty;
151
151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -179,9 +179,9 @@ var require_globals = __commonJS({
179
179
  }
180
180
  });
181
181
 
182
- // ../../node_modules/@domql/utils/dist/cjs/node.js
182
+ // ../../../domql/packages/utils/dist/cjs/node.js
183
183
  var require_node = __commonJS({
184
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
184
+ "../../../domql/packages/utils/dist/cjs/node.js"(exports, module2) {
185
185
  "use strict";
186
186
  var __defProp2 = Object.defineProperty;
187
187
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -216,9 +216,9 @@ var require_node = __commonJS({
216
216
  }
217
217
  });
218
218
 
219
- // ../../node_modules/@domql/utils/dist/cjs/types.js
219
+ // ../../../domql/packages/utils/dist/cjs/types.js
220
220
  var require_types = __commonJS({
221
- "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
221
+ "../../../domql/packages/utils/dist/cjs/types.js"(exports, module2) {
222
222
  "use strict";
223
223
  var __defProp2 = Object.defineProperty;
224
224
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -241,8 +241,9 @@ var require_types = __commonJS({
241
241
  __export2(types_exports, {
242
242
  TYPES: () => TYPES,
243
243
  is: () => is,
244
- isArray: () => isArray7,
244
+ isArray: () => isArray8,
245
245
  isBoolean: () => isBoolean,
246
+ isDate: () => isDate,
246
247
  isDefined: () => isDefined2,
247
248
  isFunction: () => isFunction2,
248
249
  isNot: () => isNot,
@@ -265,23 +266,25 @@ var require_types = __commonJS({
265
266
  var isFunction2 = (arg) => typeof arg === "function";
266
267
  var isBoolean = (arg) => arg === true || arg === false;
267
268
  var isNull = (arg) => arg === null;
268
- var isArray7 = (arg) => Array.isArray(arg);
269
+ var isArray8 = (arg) => Array.isArray(arg);
270
+ var isDate = (d) => d instanceof Date;
269
271
  var isObjectLike3 = (arg) => {
270
272
  if (arg === null)
271
273
  return false;
272
274
  return typeof arg === "object";
273
275
  };
274
276
  var isDefined2 = (arg) => {
275
- return isObject8(arg) || isObjectLike3(arg) || isString10(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
277
+ return isObject8(arg) || isObjectLike3(arg) || isString10(arg) || isNumber2(arg) || isFunction2(arg) || isArray8(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull(arg);
276
278
  };
277
279
  var isUndefined = (arg) => {
278
280
  return arg === void 0;
279
281
  };
280
282
  var TYPES = {
281
283
  boolean: isBoolean,
282
- array: isArray7,
284
+ array: isArray8,
283
285
  object: isObject8,
284
286
  string: isString10,
287
+ date: isDate,
285
288
  number: isNumber2,
286
289
  null: isNull,
287
290
  function: isFunction2,
@@ -303,9 +306,9 @@ var require_types = __commonJS({
303
306
  }
304
307
  });
305
308
 
306
- // ../../node_modules/@domql/utils/dist/cjs/array.js
309
+ // ../../../domql/packages/utils/dist/cjs/array.js
307
310
  var require_array = __commonJS({
308
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
311
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
309
312
  "use strict";
310
313
  var __defProp2 = Object.defineProperty;
311
314
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -334,6 +337,8 @@ var require_array = __commonJS({
334
337
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
335
338
  mergeArray: () => mergeArray,
336
339
  removeFromArray: () => removeFromArray,
340
+ removeValueFromArray: () => removeValueFromArray,
341
+ removeValueFromArrayAll: () => removeValueFromArrayAll,
337
342
  swapItemsInArray: () => swapItemsInArray
338
343
  });
339
344
  module2.exports = __toCommonJS2(array_exports);
@@ -399,12 +404,24 @@ var require_array = __commonJS({
399
404
  }, nestedObject);
400
405
  return nestedObject;
401
406
  };
407
+ var removeValueFromArray = (arr, value) => {
408
+ const index = arr.indexOf(value);
409
+ if (index > -1) {
410
+ const newArray = [...arr];
411
+ newArray.splice(index, 1);
412
+ return newArray;
413
+ }
414
+ return arr.slice();
415
+ };
416
+ var removeValueFromArrayAll = (arr, value) => {
417
+ return arr.filter((item) => item !== value);
418
+ };
402
419
  }
403
420
  });
404
421
 
405
- // ../../node_modules/@domql/utils/dist/cjs/string.js
422
+ // ../../../domql/packages/utils/dist/cjs/string.js
406
423
  var require_string = __commonJS({
407
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
424
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
408
425
  "use strict";
409
426
  var __defProp2 = Object.defineProperty;
410
427
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -462,9 +479,9 @@ var require_string = __commonJS({
462
479
  }
463
480
  });
464
481
 
465
- // ../../node_modules/@domql/utils/dist/cjs/object.js
482
+ // ../../../domql/packages/utils/dist/cjs/object.js
466
483
  var require_object = __commonJS({
467
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
484
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
468
485
  "use strict";
469
486
  var __defProp2 = Object.defineProperty;
470
487
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -490,6 +507,7 @@ var require_object = __commonJS({
490
507
  deepCloneExclude: () => deepCloneExclude,
491
508
  deepContains: () => deepContains,
492
509
  deepDestringify: () => deepDestringify,
510
+ deepDiff: () => deepDiff,
493
511
  deepMerge: () => deepMerge3,
494
512
  deepStringify: () => deepStringify,
495
513
  detachFunctionsFromObject: () => detachFunctionsFromObject,
@@ -498,7 +516,11 @@ var require_object = __commonJS({
498
516
  diffObjects: () => diffObjects,
499
517
  exec: () => exec,
500
518
  flattenRecursive: () => flattenRecursive,
519
+ hasOwnProperty: () => hasOwnProperty,
520
+ isEmpty: () => isEmpty,
521
+ isEmptyObject: () => isEmptyObject,
501
522
  isEqualDeep: () => isEqualDeep,
523
+ makeObjectWithoutPrototype: () => makeObjectWithoutPrototype,
502
524
  map: () => map,
503
525
  merge: () => merge5,
504
526
  mergeArrayExclude: () => mergeArrayExclude,
@@ -532,8 +554,8 @@ var require_object = __commonJS({
532
554
  };
533
555
  var merge5 = (element, obj, excludeFrom = []) => {
534
556
  for (const e in obj) {
535
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
536
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
557
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
558
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
537
559
  continue;
538
560
  const elementProp = element[e];
539
561
  const objProp = obj[e];
@@ -545,8 +567,8 @@ var require_object = __commonJS({
545
567
  };
546
568
  var deepMerge3 = (element, extend, excludeFrom = []) => {
547
569
  for (const e in extend) {
548
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
549
- if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
570
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
571
+ if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__"))
550
572
  continue;
551
573
  const elementProp = element[e];
552
574
  const extendProp = extend[e];
@@ -561,8 +583,8 @@ var require_object = __commonJS({
561
583
  var clone = (obj, excludeFrom = []) => {
562
584
  const o = {};
563
585
  for (const prop in obj) {
564
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
565
- if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
586
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
587
+ if (!hasOwnProperty2 || excludeFrom.includes(prop) || prop.startsWith("__"))
566
588
  continue;
567
589
  o[prop] = obj[prop];
568
590
  }
@@ -574,8 +596,8 @@ var require_object = __commonJS({
574
596
  }
575
597
  const o = {};
576
598
  for (const k in obj) {
577
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, k);
578
- if (!hasOwnProperty || excludeFrom.includes(k) || k.startsWith("__"))
599
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, k);
600
+ if (!hasOwnProperty2 || excludeFrom.includes(k) || k.startsWith("__"))
579
601
  continue;
580
602
  let v = obj[k];
581
603
  if (k === "extend" && (0, import_types.isArray)(v)) {
@@ -593,7 +615,7 @@ var require_object = __commonJS({
593
615
  var mergeArrayExclude = (arr, excl = []) => {
594
616
  return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude(curr, excl)), {});
595
617
  };
596
- var deepClone2 = (obj, excludeFrom = []) => {
618
+ var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
597
619
  const o = (0, import_types.isArray)(obj) ? [] : {};
598
620
  for (const prop in obj) {
599
621
  if (prop === "__proto__")
@@ -601,11 +623,13 @@ var require_object = __commonJS({
601
623
  if (excludeFrom.includes(prop) || prop.startsWith("__"))
602
624
  continue;
603
625
  let objProp = obj[prop];
626
+ if (cleanUndefined && (0, import_types.isUndefined)(objProp))
627
+ continue;
604
628
  if (prop === "extend" && (0, import_types.isArray)(objProp)) {
605
629
  objProp = (0, import_array.mergeArray)(objProp);
606
630
  }
607
631
  if ((0, import_types.isObjectLike)(objProp)) {
608
- o[prop] = deepClone2(objProp, excludeFrom);
632
+ o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
609
633
  } else
610
634
  o[prop] = objProp;
611
635
  }
@@ -659,7 +683,7 @@ var require_object = __commonJS({
659
683
  }
660
684
  }
661
685
  str += `${spaces} ]`;
662
- } else if ((0, import_types.isObject)(value)) {
686
+ } else if ((0, import_types.isObjectLike)(value)) {
663
687
  str += objectToString(value, indent + 1);
664
688
  } else if ((0, import_types.isString)(value)) {
665
689
  str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
@@ -699,8 +723,8 @@ var require_object = __commonJS({
699
723
  };
700
724
  var deepDestringify = (obj, destringified = {}) => {
701
725
  for (const prop in obj) {
702
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
703
- if (!hasOwnProperty)
726
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, prop);
727
+ if (!hasOwnProperty2)
704
728
  continue;
705
729
  const objProp = obj[prop];
706
730
  if ((0, import_types.isString)(objProp)) {
@@ -793,6 +817,39 @@ var require_object = __commonJS({
793
817
  }
794
818
  return cache;
795
819
  };
820
+ var hasOwnProperty = (o, ...args) => Object.prototype.hasOwnProperty.call(o, ...args);
821
+ var isEmpty = (o) => Object.keys(o).length === 0;
822
+ var isEmptyObject = (o) => (0, import_types.isObject)(o) && isEmpty(o);
823
+ var makeObjectWithoutPrototype = () => /* @__PURE__ */ Object.create(null);
824
+ var deepDiff = (lhs, rhs) => {
825
+ if (lhs === rhs)
826
+ return {};
827
+ if (!(0, import_types.isObjectLike)(lhs) || !(0, import_types.isObjectLike)(rhs))
828
+ return rhs;
829
+ const deletedValues = Object.keys(lhs).reduce((acc, key) => {
830
+ if (!hasOwnProperty(rhs, key)) {
831
+ acc[key] = void 0;
832
+ }
833
+ return acc;
834
+ }, makeObjectWithoutPrototype());
835
+ if ((0, import_types.isDate)(lhs) || (0, import_types.isDate)(rhs)) {
836
+ if (lhs.valueOf() === rhs.valueOf())
837
+ return {};
838
+ return rhs;
839
+ }
840
+ return Object.keys(rhs).reduce((acc, key) => {
841
+ if (!hasOwnProperty(lhs, key)) {
842
+ acc[key] = rhs[key];
843
+ return acc;
844
+ }
845
+ const difference = diff(lhs[key], rhs[key]);
846
+ if (isEmptyObject(difference) && !(0, import_types.isDate)(difference) && (isEmptyObject(lhs[key]) || !isEmptyObject(rhs[key]))) {
847
+ return acc;
848
+ }
849
+ acc[key] = difference;
850
+ return acc;
851
+ }, deletedValues);
852
+ };
796
853
  var overwrite = (element, params, excludeFrom = []) => {
797
854
  const { ref } = element;
798
855
  const changes = {};
@@ -888,8 +945,8 @@ var require_object = __commonJS({
888
945
  }
889
946
  } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
890
947
  for (const key in obj1) {
891
- const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key);
892
- if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
948
+ const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
949
+ if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
893
950
  return false;
894
951
  }
895
952
  }
@@ -914,9 +971,9 @@ var require_object = __commonJS({
914
971
  }
915
972
  });
916
973
 
917
- // ../../node_modules/@domql/utils/dist/cjs/function.js
974
+ // ../../../domql/packages/utils/dist/cjs/function.js
918
975
  var require_function = __commonJS({
919
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
976
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
920
977
  "use strict";
921
978
  var __defProp2 = Object.defineProperty;
922
979
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -989,9 +1046,9 @@ var require_function = __commonJS({
989
1046
  }
990
1047
  });
991
1048
 
992
- // ../../node_modules/@domql/utils/dist/cjs/log.js
1049
+ // ../../../domql/packages/utils/dist/cjs/log.js
993
1050
  var require_log = __commonJS({
994
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
1051
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
995
1052
  "use strict";
996
1053
  var __defProp2 = Object.defineProperty;
997
1054
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1030,9 +1087,9 @@ var require_log = __commonJS({
1030
1087
  }
1031
1088
  });
1032
1089
 
1033
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1090
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
1034
1091
  var require_cookie = __commonJS({
1035
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1092
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
1036
1093
  "use strict";
1037
1094
  var __defProp2 = Object.defineProperty;
1038
1095
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1086,9 +1143,9 @@ var require_cookie = __commonJS({
1086
1143
  }
1087
1144
  });
1088
1145
 
1089
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1146
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1090
1147
  var require_tags = __commonJS({
1091
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1148
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1092
1149
  "use strict";
1093
1150
  var __defProp2 = Object.defineProperty;
1094
1151
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1251,9 +1308,9 @@ var require_tags = __commonJS({
1251
1308
  }
1252
1309
  });
1253
1310
 
1254
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1311
+ // ../../../domql/packages/utils/dist/cjs/index.js
1255
1312
  var require_cjs2 = __commonJS({
1256
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1313
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1257
1314
  "use strict";
1258
1315
  var __defProp2 = Object.defineProperty;
1259
1316
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1566,7 +1623,7 @@ var opacify = (color, opacity) => {
1566
1623
  const arr = colorStringToRgbaArray(color);
1567
1624
  if (!arr) {
1568
1625
  if (ENV === "test" || ENV === "development")
1569
- console.warn(color + "color is not rgba");
1626
+ console.warn(color + " color is not rgba");
1570
1627
  return;
1571
1628
  }
1572
1629
  arr[3] = opacity;
@@ -2570,6 +2627,8 @@ var getMediaTheme = (val, mod) => {
2570
2627
  var import_utils12 = __toESM(require_cjs2(), 1);
2571
2628
  var setFont = (val, key) => {
2572
2629
  const CSSvar = `--font-${key}`;
2630
+ if (!val || (0, import_utils12.isArray)(val) && !val[0])
2631
+ return;
2573
2632
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
2574
2633
  return { var: CSSvar, value: val, fontFace };
2575
2634
  };