@symbo.ls/scratch 2.10.274 → 2.11.5

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,6 +66,45 @@ var require_cjs = __commonJS({
66
66
  }
67
67
  });
68
68
 
69
+ // ../../node_modules/@domql/key/dist/cjs/index.js
70
+ var require_cjs2 = __commonJS({
71
+ "../../node_modules/@domql/key/dist/cjs/index.js"(exports, module2) {
72
+ "use strict";
73
+ var __defProp2 = Object.defineProperty;
74
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
75
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
76
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
77
+ var __export2 = (target, all) => {
78
+ for (var name in all)
79
+ __defProp2(target, name, { get: all[name], enumerable: true });
80
+ };
81
+ var __copyProps2 = (to, from, except, desc) => {
82
+ if (from && typeof from === "object" || typeof from === "function") {
83
+ for (let key of __getOwnPropNames2(from))
84
+ if (!__hasOwnProp2.call(to, key) && key !== except)
85
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
86
+ }
87
+ return to;
88
+ };
89
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
90
+ var key_exports = {};
91
+ __export2(key_exports, {
92
+ createKey: () => createKey,
93
+ createSnapshotId: () => createSnapshotId
94
+ });
95
+ module2.exports = __toCommonJS2(key_exports);
96
+ var createKey = function() {
97
+ let index = 0;
98
+ function newId() {
99
+ index++;
100
+ return index;
101
+ }
102
+ return newId;
103
+ }();
104
+ var createSnapshotId = createKey;
105
+ }
106
+ });
107
+
69
108
  // ../../node_modules/@domql/tags/dist/cjs/htmlTags.js
70
109
  var require_htmlTags = __commonJS({
71
110
  "../../node_modules/@domql/tags/dist/cjs/htmlTags.js"(exports, module2) {
@@ -230,7 +269,7 @@ var require_htmlTags = __commonJS({
230
269
  });
231
270
 
232
271
  // ../../node_modules/@domql/tags/dist/cjs/index.js
233
- var require_cjs2 = __commonJS({
272
+ var require_cjs3 = __commonJS({
234
273
  "../../node_modules/@domql/tags/dist/cjs/index.js"(exports, module2) {
235
274
  "use strict";
236
275
  var __defProp2 = Object.defineProperty;
@@ -253,6 +292,43 @@ var require_cjs2 = __commonJS({
253
292
  }
254
293
  });
255
294
 
295
+ // ../../node_modules/@domql/utils/dist/cjs/node.js
296
+ var require_node = __commonJS({
297
+ "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
298
+ "use strict";
299
+ var __defProp2 = Object.defineProperty;
300
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
301
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
302
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
303
+ var __export2 = (target, all) => {
304
+ for (var name in all)
305
+ __defProp2(target, name, { get: all[name], enumerable: true });
306
+ };
307
+ var __copyProps2 = (to, from, except, desc) => {
308
+ if (from && typeof from === "object" || typeof from === "function") {
309
+ for (let key of __getOwnPropNames2(from))
310
+ if (!__hasOwnProp2.call(to, key) && key !== except)
311
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
312
+ }
313
+ return to;
314
+ };
315
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
316
+ var node_exports = {};
317
+ __export2(node_exports, {
318
+ isHtmlElement: () => isHtmlElement,
319
+ isNode: () => isNode
320
+ });
321
+ module2.exports = __toCommonJS2(node_exports);
322
+ var import_globals3 = require_cjs();
323
+ var isNode = (obj) => {
324
+ return (typeof Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string") || false;
325
+ };
326
+ var isHtmlElement = (obj) => {
327
+ return (typeof HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
328
+ };
329
+ }
330
+ });
331
+
256
332
  // ../../node_modules/@domql/utils/dist/cjs/types.js
257
333
  var require_types = __commonJS({
258
334
  "../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
@@ -282,8 +358,6 @@ var require_types = __commonJS({
282
358
  isBoolean: () => isBoolean,
283
359
  isDefined: () => isDefined2,
284
360
  isFunction: () => isFunction2,
285
- isHtmlElement: () => isHtmlElement,
286
- isNode: () => isNode,
287
361
  isNot: () => isNot,
288
362
  isNull: () => isNull,
289
363
  isNumber: () => isNumber,
@@ -294,9 +368,9 @@ var require_types = __commonJS({
294
368
  isValidHtmlTag: () => isValidHtmlTag
295
369
  });
296
370
  module2.exports = __toCommonJS2(types_exports);
297
- var import_globals3 = require_cjs();
298
- var import_tags = require_cjs2();
299
- var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.indexOf(arg);
371
+ var import_tags = require_cjs3();
372
+ var import_node = require_node();
373
+ var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.includes(arg);
300
374
  var isObject7 = (arg) => {
301
375
  if (arg === null)
302
376
  return false;
@@ -313,12 +387,6 @@ var require_types = __commonJS({
313
387
  return false;
314
388
  return typeof arg === "object";
315
389
  };
316
- var isNode = (obj) => {
317
- return typeof import_globals3.window.Node === "object" ? obj instanceof import_globals3.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
318
- };
319
- var isHtmlElement = (obj) => {
320
- return typeof import_globals3.window.HTMLElement === "object" ? obj instanceof import_globals3.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string";
321
- };
322
390
  var isDefined2 = (arg) => {
323
391
  return isObject7(arg) || isObjectLike3(arg) || isString8(arg) || isNumber(arg) || isFunction2(arg) || isArray5(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
324
392
  };
@@ -334,8 +402,8 @@ var require_types = __commonJS({
334
402
  null: isNull,
335
403
  function: isFunction2,
336
404
  objectLike: isObjectLike3,
337
- node: isNode,
338
- htmlElement: isHtmlElement,
405
+ node: import_node.isNode,
406
+ htmlElement: import_node.isHtmlElement,
339
407
  defined: isDefined2
340
408
  };
341
409
  var is = (arg) => {
@@ -382,6 +450,8 @@ var require_object = __commonJS({
382
450
  deepStringify: () => deepStringify,
383
451
  detachFunctionsFromObject: () => detachFunctionsFromObject,
384
452
  diff: () => diff,
453
+ diffArrays: () => diffArrays,
454
+ diffObjects: () => diffObjects,
385
455
  exec: () => exec,
386
456
  flattenRecursive: () => flattenRecursive,
387
457
  isEqualDeep: () => isEqualDeep,
@@ -393,7 +463,8 @@ var require_object = __commonJS({
393
463
  mergeIfExisted: () => mergeIfExisted,
394
464
  overwrite: () => overwrite,
395
465
  overwriteDeep: () => overwriteDeep,
396
- overwriteObj: () => overwriteObj
466
+ overwriteObj: () => overwriteObj,
467
+ removeFromObject: () => removeFromObject
397
468
  });
398
469
  module2.exports = __toCommonJS2(object_exports);
399
470
  var import_globals3 = require_cjs();
@@ -425,14 +496,13 @@ var require_object = __commonJS({
425
496
  };
426
497
  var deepMerge3 = (element, extend) => {
427
498
  for (const e in extend) {
499
+ const elementProp = element[e];
428
500
  const extendProp = extend[e];
429
501
  if (e === "parent" || e === "props")
430
502
  continue;
431
- if (element[e] === void 0) {
432
- element[e] = extendProp;
433
- } else if ((0, import_types.isObjectLike)(element[e]) && (0, import_types.isObjectLike)(extendProp)) {
434
- deepMerge3(element[e], extendProp);
435
- } else {
503
+ if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
504
+ deepMerge3(elementProp, extendProp);
505
+ } else if (elementProp === void 0) {
436
506
  element[e] = extendProp;
437
507
  }
438
508
  }
@@ -601,21 +671,46 @@ var require_object = __commonJS({
601
671
  }
602
672
  return changes;
603
673
  };
604
- var diff = (obj, original, cache) => {
605
- const changes = cache || {};
606
- for (const e in obj) {
674
+ var diffObjects = (original, objToDiff, cache) => {
675
+ for (const e in objToDiff) {
607
676
  if (e === "ref")
608
677
  continue;
609
678
  const originalProp = original[e];
610
- const objProp = obj[e];
611
- if ((0, import_types.isObjectLike)(originalProp) && (0, import_types.isObjectLike)(objProp)) {
612
- changes[e] = {};
613
- diff(originalProp, objProp, changes[e]);
614
- } else if (objProp !== void 0) {
615
- changes[e] = objProp;
679
+ const objToDiffProp = objToDiff[e];
680
+ if ((0, import_types.isObject)(originalProp) && (0, import_types.isObject)(objToDiffProp)) {
681
+ cache[e] = {};
682
+ diff(originalProp, objToDiffProp, cache[e]);
683
+ } else if (objToDiffProp !== void 0) {
684
+ cache[e] = objToDiffProp;
616
685
  }
617
686
  }
618
- return changes;
687
+ return cache;
688
+ };
689
+ var diffArrays = (original, objToDiff, cache) => {
690
+ if (original.length !== objToDiff.length) {
691
+ cache = objToDiff;
692
+ } else {
693
+ const diffArr = [];
694
+ for (let i = 0; i < original.length; i++) {
695
+ const diffObj = diff(original[i], objToDiff[i]);
696
+ if (Object.keys(diffObj).length > 0) {
697
+ diffArr.push(diffObj);
698
+ }
699
+ }
700
+ if (diffArr.length > 0) {
701
+ cache = diffArr;
702
+ }
703
+ }
704
+ return cache;
705
+ };
706
+ var diff = (original, objToDiff, cache = {}) => {
707
+ if ((0, import_types.isArray)(original) && (0, import_types.isArray)(objToDiff)) {
708
+ cache = [];
709
+ diffArrays(original, objToDiff, cache);
710
+ } else {
711
+ diffObjects(original, objToDiff, cache);
712
+ }
713
+ return cache;
619
714
  };
620
715
  var overwriteObj = (params, obj) => {
621
716
  const changes = {};
@@ -680,6 +775,18 @@ var require_object = __commonJS({
680
775
  }
681
776
  return true;
682
777
  };
778
+ var removeFromObject = (obj, props) => {
779
+ if (props === void 0 || props === null)
780
+ return obj;
781
+ if ((0, import_types.is)(props)("string", "number")) {
782
+ delete obj[props];
783
+ } else if ((0, import_types.isArray)(props)) {
784
+ props.forEach((prop) => delete obj[prop]);
785
+ } else {
786
+ throw new Error("Invalid input: props must be a string or an array of strings");
787
+ }
788
+ return obj;
789
+ };
683
790
  }
684
791
  });
685
792
 
@@ -737,14 +844,7 @@ var require_function = __commonJS({
737
844
 
738
845
  // ../../node_modules/@domql/utils/dist/cjs/array.js
739
846
  var require_array = __commonJS({
740
- "../../node_modules/@domql/utils/dist/cjs/array.js"() {
741
- "use strict";
742
- }
743
- });
744
-
745
- // ../../node_modules/@domql/utils/dist/cjs/node.js
746
- var require_node = __commonJS({
747
- "../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
847
+ "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
748
848
  "use strict";
749
849
  var __defProp2 = Object.defineProperty;
750
850
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -763,23 +863,39 @@ var require_node = __commonJS({
763
863
  return to;
764
864
  };
765
865
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
766
- var node_exports = {};
767
- __export2(node_exports, {
768
- cleanWithNode: () => cleanWithNode,
769
- createID: () => createID,
770
- createSnapshotId: () => createSnapshotId
866
+ var array_exports = {};
867
+ __export2(array_exports, {
868
+ arrayContainsOtherArray: () => arrayContainsOtherArray,
869
+ joinArrays: () => joinArrays,
870
+ removeFromArray: () => removeFromArray,
871
+ swapItemsInArray: () => swapItemsInArray
771
872
  });
772
- module2.exports = __toCommonJS2(node_exports);
773
- var cleanWithNode = (extend) => delete extend.node && extend;
774
- var createID = function() {
775
- let index = 0;
776
- function newId() {
777
- index++;
778
- return index;
873
+ module2.exports = __toCommonJS2(array_exports);
874
+ var import_types = require_types();
875
+ var arrayContainsOtherArray = (arr1, arr2) => {
876
+ return arr2.every((val) => arr1.includes(val));
877
+ };
878
+ var removeFromArray = (arr, index) => {
879
+ if ((0, import_types.isString)(index))
880
+ index = parseInt(index);
881
+ if ((0, import_types.isNumber)(index)) {
882
+ if (index < 0 || index >= arr.length || isNaN(index)) {
883
+ throw new Error("Invalid index");
884
+ }
885
+ arr.splice(index, 1);
886
+ } else if ((0, import_types.isArray)(index)) {
887
+ index.forEach((idx) => removeFromArray(arr, idx));
888
+ } else {
889
+ throw new Error("Invalid index");
779
890
  }
780
- return newId;
781
- }();
782
- var createSnapshotId = createID;
891
+ return arr;
892
+ };
893
+ var swapItemsInArray = (arr, i, j) => {
894
+ [arr[i], arr[j]] = [arr[j], arr[i]];
895
+ };
896
+ var joinArrays = (...arrays) => {
897
+ return [].concat(...arrays);
898
+ };
783
899
  }
784
900
  });
785
901
 
@@ -825,7 +941,7 @@ var require_log = __commonJS({
825
941
  });
826
942
 
827
943
  // ../../node_modules/@domql/utils/dist/cjs/index.js
828
- var require_cjs3 = __commonJS({
944
+ var require_cjs4 = __commonJS({
829
945
  "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
830
946
  "use strict";
831
947
  var __defProp2 = Object.defineProperty;
@@ -844,6 +960,7 @@ var require_cjs3 = __commonJS({
844
960
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
845
961
  var utils_exports2 = {};
846
962
  module2.exports = __toCommonJS2(utils_exports2);
963
+ __reExport(utils_exports2, require_cjs2(), module2.exports);
847
964
  __reExport(utils_exports2, require_types(), module2.exports);
848
965
  __reExport(utils_exports2, require_object(), module2.exports);
849
966
  __reExport(utils_exports2, require_function(), module2.exports);
@@ -1185,13 +1302,13 @@ var getFontFaceString = (LIBRARY) => {
1185
1302
  };
1186
1303
 
1187
1304
  // src/utils/sequence.js
1188
- var import_utils4 = __toESM(require_cjs3(), 1);
1305
+ var import_utils4 = __toESM(require_cjs4(), 1);
1189
1306
 
1190
1307
  // ../utils/src/index.js
1191
- var import_utils2 = __toESM(require_cjs3());
1308
+ var import_utils2 = __toESM(require_cjs4());
1192
1309
 
1193
1310
  // ../utils/src/scaling.js
1194
- var import_utils = __toESM(require_cjs3());
1311
+ var import_utils = __toESM(require_cjs4());
1195
1312
 
1196
1313
  // ../utils/src/index.js
1197
1314
  var toCamelCase = (str) => {
@@ -1210,7 +1327,7 @@ var arrayzeValue = (val) => {
1210
1327
  };
1211
1328
 
1212
1329
  // src/factory.js
1213
- var import_utils3 = __toESM(require_cjs3(), 1);
1330
+ var import_utils3 = __toESM(require_cjs4(), 1);
1214
1331
 
1215
1332
  // src/defaultConfig/index.js
1216
1333
  var defaultConfig_exports = {};
@@ -1610,7 +1727,7 @@ var findHeadings = (propertyNames) => {
1610
1727
  };
1611
1728
 
1612
1729
  // src/utils/var.js
1613
- var import_utils6 = __toESM(require_cjs3(), 1);
1730
+ var import_utils6 = __toESM(require_cjs4(), 1);
1614
1731
  var setVariables = (result, key) => {
1615
1732
  const CONFIG2 = getActiveConfig();
1616
1733
  const { CSS_VARS: CSS_VARS2 } = CONFIG2;
@@ -1650,7 +1767,7 @@ var applySequenceVars = (props, mediaName, options = {}) => {
1650
1767
  };
1651
1768
 
1652
1769
  // src/utils/sprite.js
1653
- var import_utils7 = __toESM(require_cjs3(), 1);
1770
+ var import_utils7 = __toESM(require_cjs4(), 1);
1654
1771
  var generateSprite = (icons) => {
1655
1772
  const CONFIG2 = getActiveConfig();
1656
1773
  let sprite = "";
@@ -1727,7 +1844,7 @@ __export(system_exports, {
1727
1844
  });
1728
1845
 
1729
1846
  // src/system/color.js
1730
- var import_utils8 = __toESM(require_cjs3(), 1);
1847
+ var import_utils8 = __toESM(require_cjs4(), 1);
1731
1848
  var getColor = (value, key) => {
1732
1849
  const CONFIG2 = getActiveConfig();
1733
1850
  if (!(0, import_utils8.isString)(value)) {
@@ -1873,7 +1990,7 @@ var setGradient = (val, key, suffix) => {
1873
1990
  };
1874
1991
 
1875
1992
  // src/system/theme.js
1876
- var import_utils10 = __toESM(require_cjs3(), 1);
1993
+ var import_utils10 = __toESM(require_cjs4(), 1);
1877
1994
  var setThemeValue = (theme) => {
1878
1995
  const value = {};
1879
1996
  const { state, media, helpers, ...rest } = theme;
@@ -2089,7 +2206,7 @@ var getMediaTheme = (val, mod) => {
2089
2206
  };
2090
2207
 
2091
2208
  // src/system/font.js
2092
- var import_utils11 = __toESM(require_cjs3(), 1);
2209
+ var import_utils11 = __toESM(require_cjs4(), 1);
2093
2210
  var setFont = (val, key) => {
2094
2211
  const CSSvar = `--font-${key}`;
2095
2212
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
@@ -2114,7 +2231,7 @@ var setFontFamily = (val, key) => {
2114
2231
  };
2115
2232
 
2116
2233
  // src/system/typography.js
2117
- var import_utils14 = __toESM(require_cjs3(), 1);
2234
+ var import_utils14 = __toESM(require_cjs4(), 1);
2118
2235
  var runThroughMedia = (props) => {
2119
2236
  const CONFIG2 = getActiveConfig();
2120
2237
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
@@ -2183,7 +2300,7 @@ var getFontSizeByKey = (value) => {
2183
2300
  };
2184
2301
 
2185
2302
  // src/system/spacing.js
2186
- var import_utils17 = __toESM(require_cjs3(), 1);
2303
+ var import_utils17 = __toESM(require_cjs4(), 1);
2187
2304
  var runThroughMedia2 = (sequenceProps) => {
2188
2305
  for (const prop in sequenceProps) {
2189
2306
  const mediaProps = sequenceProps[prop];
@@ -2309,7 +2426,7 @@ var getTimingByKey = (value, property = "timing") => {
2309
2426
  };
2310
2427
 
2311
2428
  // src/system/document.js
2312
- var import_utils21 = __toESM(require_cjs3(), 1);
2429
+ var import_utils21 = __toESM(require_cjs4(), 1);
2313
2430
  var applyDocument = () => {
2314
2431
  const CONFIG2 = getActiveConfig();
2315
2432
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
@@ -2393,7 +2510,7 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
2393
2510
  };
2394
2511
 
2395
2512
  // src/system/reset.js
2396
- var import_utils24 = __toESM(require_cjs3(), 1);
2513
+ var import_utils24 = __toESM(require_cjs4(), 1);
2397
2514
  var applyReset = (reset = {}) => {
2398
2515
  const CONFIG2 = getActiveConfig();
2399
2516
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
@@ -2452,7 +2569,7 @@ var applyReset = (reset = {}) => {
2452
2569
  };
2453
2570
 
2454
2571
  // src/transforms/index.js
2455
- var import_utils25 = __toESM(require_cjs3(), 1);
2572
+ var import_utils25 = __toESM(require_cjs4(), 1);
2456
2573
  var isBorderStyle = (str) => [
2457
2574
  "none",
2458
2575
  "hidden",
@@ -2553,7 +2670,7 @@ var splitTransition = (transition) => {
2553
2670
  };
2554
2671
 
2555
2672
  // src/set.js
2556
- var import_utils26 = __toESM(require_cjs3(), 1);
2673
+ var import_utils26 = __toESM(require_cjs4(), 1);
2557
2674
  var setCases = (val, key) => {
2558
2675
  if ((0, import_utils26.isFunction)(val))
2559
2676
  return val();