@symbo.ls/scratch 2.11.204 → 2.11.213

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;
@@ -303,9 +303,9 @@ var require_types = __commonJS({
303
303
  }
304
304
  });
305
305
 
306
- // ../../node_modules/@domql/utils/dist/cjs/array.js
306
+ // ../../../domql/packages/utils/dist/cjs/array.js
307
307
  var require_array = __commonJS({
308
- "../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
308
+ "../../../domql/packages/utils/dist/cjs/array.js"(exports, module2) {
309
309
  "use strict";
310
310
  var __defProp2 = Object.defineProperty;
311
311
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -402,9 +402,9 @@ var require_array = __commonJS({
402
402
  }
403
403
  });
404
404
 
405
- // ../../node_modules/@domql/utils/dist/cjs/string.js
405
+ // ../../../domql/packages/utils/dist/cjs/string.js
406
406
  var require_string = __commonJS({
407
- "../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
407
+ "../../../domql/packages/utils/dist/cjs/string.js"(exports, module2) {
408
408
  "use strict";
409
409
  var __defProp2 = Object.defineProperty;
410
410
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -462,9 +462,9 @@ var require_string = __commonJS({
462
462
  }
463
463
  });
464
464
 
465
- // ../../node_modules/@domql/utils/dist/cjs/object.js
465
+ // ../../../domql/packages/utils/dist/cjs/object.js
466
466
  var require_object = __commonJS({
467
- "../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
467
+ "../../../domql/packages/utils/dist/cjs/object.js"(exports, module2) {
468
468
  "use strict";
469
469
  var __defProp2 = Object.defineProperty;
470
470
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -488,6 +488,7 @@ var require_object = __commonJS({
488
488
  clone: () => clone,
489
489
  deepClone: () => deepClone2,
490
490
  deepCloneExclude: () => deepCloneExclude,
491
+ deepContains: () => deepContains,
491
492
  deepDestringify: () => deepDestringify,
492
493
  deepMerge: () => deepMerge3,
493
494
  deepStringify: () => deepStringify,
@@ -550,7 +551,7 @@ var require_object = __commonJS({
550
551
  const elementProp = element[e];
551
552
  const extendProp = extend[e];
552
553
  if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObjectLike)(extendProp)) {
553
- deepMerge3(elementProp, extendProp);
554
+ deepMerge3(elementProp, extendProp, excludeFrom);
554
555
  } else if (elementProp === void 0) {
555
556
  element[e] = extendProp;
556
557
  }
@@ -640,8 +641,8 @@ var require_object = __commonJS({
640
641
  const spaces = " ".repeat(indent);
641
642
  let str = "{\n";
642
643
  for (const [key, value] of Object.entries(obj)) {
643
- const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
644
- const stringedKey = keyAllowdChars ? `'${key}'` : key;
644
+ const keyNotAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "/", "!"]);
645
+ const stringedKey = keyNotAllowdChars ? `'${key}'` : key;
645
646
  str += `${spaces} ${stringedKey}: `;
646
647
  if ((0, import_types.isArray)(value)) {
647
648
  str += "[\n";
@@ -696,7 +697,7 @@ var require_object = __commonJS({
696
697
  }
697
698
  return detached;
698
699
  };
699
- var deepDestringify = (obj, stringified = {}) => {
700
+ var deepDestringify = (obj, destringified = {}) => {
700
701
  for (const prop in obj) {
701
702
  const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
702
703
  if (!hasOwnProperty)
@@ -706,52 +707,50 @@ var require_object = __commonJS({
706
707
  if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
707
708
  try {
708
709
  const evalProp = import_globals3.window.eval(`(${objProp})`);
709
- stringified[prop] = evalProp;
710
+ destringified[prop] = evalProp;
710
711
  } catch (e) {
711
712
  if (e)
712
- stringified[prop] = objProp;
713
+ destringified[prop] = objProp;
713
714
  }
714
715
  } else {
715
- stringified[prop] = objProp;
716
+ destringified[prop] = objProp;
716
717
  }
717
718
  } else if ((0, import_types.isArray)(objProp)) {
718
- stringified[prop] = [];
719
+ destringified[prop] = [];
719
720
  objProp.forEach((arrProp) => {
720
721
  if ((0, import_types.isString)(arrProp)) {
721
722
  if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
722
723
  try {
723
724
  const evalProp = import_globals3.window.eval(`(${arrProp})`);
724
- stringified[prop].push(evalProp);
725
+ destringified[prop].push(evalProp);
725
726
  } catch (e) {
726
727
  if (e)
727
- stringified[prop].push(arrProp);
728
+ destringified[prop].push(arrProp);
728
729
  }
729
730
  } else {
730
- stringified[prop].push(arrProp);
731
+ destringified[prop].push(arrProp);
731
732
  }
732
733
  } else if ((0, import_types.isObject)(arrProp)) {
733
- stringified[prop].push(deepDestringify(arrProp));
734
+ destringified[prop].push(deepDestringify(arrProp));
734
735
  } else {
735
- stringified[prop].push(arrProp);
736
+ destringified[prop].push(arrProp);
736
737
  }
737
738
  });
738
739
  } else if ((0, import_types.isObject)(objProp)) {
739
- stringified[prop] = deepDestringify(objProp, stringified[prop]);
740
+ destringified[prop] = deepDestringify(objProp, destringified[prop]);
740
741
  } else {
741
- stringified[prop] = objProp;
742
+ destringified[prop] = objProp;
742
743
  }
743
744
  }
744
- return stringified;
745
+ return destringified;
745
746
  };
746
- var stringToObject = (str) => {
747
- let obj;
747
+ var stringToObject = (str, verbose) => {
748
748
  try {
749
- obj = import_globals3.window.eval("(" + str + ")");
749
+ return import_globals3.window.eval("(" + str + ")");
750
750
  } catch (e) {
751
- console.warn(e);
751
+ if (verbose)
752
+ console.warn(e);
752
753
  }
753
- if (obj)
754
- return obj;
755
754
  };
756
755
  var diffObjects = (original, objToDiff, cache) => {
757
756
  for (const e in objToDiff) {
@@ -873,6 +872,33 @@ var require_object = __commonJS({
873
872
  }
874
873
  return true;
875
874
  };
875
+ var deepContains = (obj1, obj2) => {
876
+ if (typeof obj1 !== typeof obj2) {
877
+ return false;
878
+ }
879
+ if ((0, import_types.isObjectLike)(obj1)) {
880
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
881
+ if (obj1.length !== obj2.length) {
882
+ return false;
883
+ }
884
+ for (let i = 0; i < obj1.length; i++) {
885
+ if (!deepContains(obj1[i], obj2[i])) {
886
+ return false;
887
+ }
888
+ }
889
+ } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
890
+ for (const key in obj1) {
891
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj2, key);
892
+ if (!hasOwnProperty || !deepContains(obj1[key], obj2[key])) {
893
+ return false;
894
+ }
895
+ }
896
+ }
897
+ } else {
898
+ return obj2 === obj1;
899
+ }
900
+ return true;
901
+ };
876
902
  var removeFromObject = (obj, props) => {
877
903
  if (props === void 0 || props === null)
878
904
  return obj;
@@ -888,9 +914,9 @@ var require_object = __commonJS({
888
914
  }
889
915
  });
890
916
 
891
- // ../../node_modules/@domql/utils/dist/cjs/function.js
917
+ // ../../../domql/packages/utils/dist/cjs/function.js
892
918
  var require_function = __commonJS({
893
- "../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
919
+ "../../../domql/packages/utils/dist/cjs/function.js"(exports, module2) {
894
920
  "use strict";
895
921
  var __defProp2 = Object.defineProperty;
896
922
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -912,11 +938,29 @@ var require_function = __commonJS({
912
938
  var function_exports = {};
913
939
  __export2(function_exports, {
914
940
  debounce: () => debounce,
941
+ debounceOnContext: () => debounceOnContext,
915
942
  isStringFunction: () => isStringFunction,
916
943
  memoize: () => memoize
917
944
  });
918
945
  module2.exports = __toCommonJS2(function_exports);
919
- var debounce = (element, func, timeout = 300) => {
946
+ function debounce(func, wait, immediate) {
947
+ let timeout;
948
+ return function() {
949
+ const context = this;
950
+ const args = arguments;
951
+ const later = function() {
952
+ timeout = null;
953
+ if (!immediate)
954
+ func.apply(context, args);
955
+ };
956
+ const callNow = immediate && !timeout;
957
+ clearTimeout(timeout);
958
+ timeout = setTimeout(later, wait);
959
+ if (callNow)
960
+ func.apply(context, args);
961
+ };
962
+ }
963
+ var debounceOnContext = (element, func, timeout = 300) => {
920
964
  let timer;
921
965
  return (...args) => {
922
966
  clearTimeout(timer);
@@ -945,9 +989,9 @@ var require_function = __commonJS({
945
989
  }
946
990
  });
947
991
 
948
- // ../../node_modules/@domql/utils/dist/cjs/log.js
992
+ // ../../../domql/packages/utils/dist/cjs/log.js
949
993
  var require_log = __commonJS({
950
- "../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
994
+ "../../../domql/packages/utils/dist/cjs/log.js"(exports, module2) {
951
995
  "use strict";
952
996
  var __defProp2 = Object.defineProperty;
953
997
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -986,9 +1030,9 @@ var require_log = __commonJS({
986
1030
  }
987
1031
  });
988
1032
 
989
- // ../../node_modules/@domql/utils/dist/cjs/cookie.js
1033
+ // ../../../domql/packages/utils/dist/cjs/cookie.js
990
1034
  var require_cookie = __commonJS({
991
- "../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
1035
+ "../../../domql/packages/utils/dist/cjs/cookie.js"(exports, module2) {
992
1036
  "use strict";
993
1037
  var __defProp2 = Object.defineProperty;
994
1038
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1042,9 +1086,9 @@ var require_cookie = __commonJS({
1042
1086
  }
1043
1087
  });
1044
1088
 
1045
- // ../../node_modules/@domql/utils/dist/cjs/tags.js
1089
+ // ../../../domql/packages/utils/dist/cjs/tags.js
1046
1090
  var require_tags = __commonJS({
1047
- "../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
1091
+ "../../../domql/packages/utils/dist/cjs/tags.js"(exports, module2) {
1048
1092
  "use strict";
1049
1093
  var __defProp2 = Object.defineProperty;
1050
1094
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1207,9 +1251,9 @@ var require_tags = __commonJS({
1207
1251
  }
1208
1252
  });
1209
1253
 
1210
- // ../../node_modules/@domql/utils/dist/cjs/index.js
1254
+ // ../../../domql/packages/utils/dist/cjs/index.js
1211
1255
  var require_cjs2 = __commonJS({
1212
- "../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
1256
+ "../../../domql/packages/utils/dist/cjs/index.js"(exports, module2) {
1213
1257
  "use strict";
1214
1258
  var __defProp2 = Object.defineProperty;
1215
1259
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -1974,19 +2018,21 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1974
2018
  const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
1975
2019
  let absValue = isNegative ? letterVal.slice(1) : letterVal;
1976
2020
  let mediaName = "";
1977
- if (absValue.includes("-")) {
1978
- mediaName = "-" + absValue.split("-")[1].toLowerCase();
1979
- absValue = absValue.split("-")[0];
2021
+ if (absValue.includes("_")) {
2022
+ mediaName = "_" + absValue.split("_")[1].toLowerCase();
2023
+ absValue = absValue.split("_")[0];
1980
2024
  }
1981
- const varValue = (v) => `var(${prefix}${v}${mediaName})`;
2025
+ const varValue = (v) => startsWithDashOrLetterRegex.test(v) ? `var(${prefix}${v}${mediaName})` : v;
1982
2026
  if (absValue.includes("+")) {
1983
- const args = absValue.split("+");
1984
- const [first, second] = args;
2027
+ const [first, second] = absValue.split("+");
1985
2028
  const joint = `${varValue(first)} + ${varValue(second)}`;
1986
2029
  return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
2030
+ } else if (absValue.includes("*")) {
2031
+ const [first, second] = absValue.split("*");
2032
+ const joint = `${varValue(first)} * ${varValue(second)}`;
2033
+ return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1987
2034
  } else if (absValue.includes("-")) {
1988
- const args = absValue.split("-");
1989
- const [first, second] = args;
2035
+ const [first, second] = absValue.split("-");
1990
2036
  const joint = `${varValue(first)} - ${varValue(second)}`;
1991
2037
  return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
1992
2038
  }
@@ -2052,14 +2098,14 @@ var applySequenceVars = (props, mediaName, options = {}) => {
2052
2098
  let underMediaQuery = CSS_VARS2[`@media ${query}`];
2053
2099
  if (!underMediaQuery)
2054
2100
  underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
2055
- underMediaQuery[item.variable] = `var(${item.variable + "-" + mediaName})`;
2056
- CSS_VARS2[item.variable + "-" + mediaName] = value;
2101
+ underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
2102
+ CSS_VARS2[item.variable + "_" + mediaName] = value;
2057
2103
  } else {
2058
2104
  if (options.useDefault === false) {
2059
2105
  CSS_VARS2[item.variable] = value;
2060
2106
  } else {
2061
- CSS_VARS2[item.variable + "-default"] = value;
2062
- CSS_VARS2[item.variable] = `var(${item.variable + "-default"})`;
2107
+ CSS_VARS2[item.variable + "_default"] = value;
2108
+ CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
2063
2109
  }
2064
2110
  }
2065
2111
  }