@symbo.ls/scratch 2.11.410 → 2.11.430

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.
@@ -130,7 +130,7 @@ var require_globals = __commonJS({
130
130
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
131
131
  var globals_exports = {};
132
132
  __export2(globals_exports, {
133
- document: () => document,
133
+ document: () => document2,
134
134
  global: () => global,
135
135
  self: () => self,
136
136
  window: () => window
@@ -139,7 +139,7 @@ var require_globals = __commonJS({
139
139
  var global = globalThis;
140
140
  var self = globalThis;
141
141
  var window = globalThis;
142
- var document = window.document;
142
+ var document2 = window.document;
143
143
  }
144
144
  });
145
145
 
@@ -166,6 +166,7 @@ var require_node = __commonJS({
166
166
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
167
167
  var node_exports = {};
168
168
  __export2(node_exports, {
169
+ isDOMNode: () => isDOMNode,
169
170
  isHtmlElement: () => isHtmlElement,
170
171
  isNode: () => isNode
171
172
  });
@@ -177,6 +178,9 @@ var require_node = __commonJS({
177
178
  var isHtmlElement = (obj) => {
178
179
  return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
179
180
  };
181
+ var isDOMNode = (obj) => {
182
+ return typeof import_globals.window !== "undefined" && (obj instanceof import_globals.window.Node || obj instanceof import_globals.window.Window || obj === import_globals.window || obj === document);
183
+ };
180
184
  }
181
185
  });
182
186
 
@@ -342,10 +346,10 @@ var require_array = __commonJS({
342
346
  return [].concat(...arrays);
343
347
  };
344
348
  var mergeArray = (arr, excludeFrom = []) => {
345
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
349
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
346
350
  };
347
351
  var mergeAndCloneIfArray = (obj) => {
348
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
352
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
349
353
  };
350
354
  var cutArrayBeforeValue = (arr, value) => {
351
355
  const index = arr.indexOf(value);
@@ -451,6 +455,8 @@ var require_string = __commonJS({
451
455
  __export2(string_exports, {
452
456
  customDecodeURIComponent: () => customDecodeURIComponent,
453
457
  customEncodeURIComponent: () => customEncodeURIComponent,
458
+ decodeNewlines: () => decodeNewlines,
459
+ encodeNewlines: () => encodeNewlines,
454
460
  findKeyPosition: () => findKeyPosition,
455
461
  lowercaseFirstLetter: () => lowercaseFirstLetter,
456
462
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
@@ -554,6 +560,12 @@ var require_string = __commonJS({
554
560
  return char;
555
561
  });
556
562
  };
563
+ var encodeNewlines = (str) => {
564
+ return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
565
+ };
566
+ var decodeNewlines = (encodedStr) => {
567
+ return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
568
+ };
557
569
  var customEncodeURIComponent = (str) => {
558
570
  return str.split("").map((char) => {
559
571
  if (/[^a-zA-Z0-9\s]/.test(char)) {
@@ -631,6 +643,7 @@ var require_object = __commonJS({
631
643
  var import_types = require_types();
632
644
  var import_array = require_array();
633
645
  var import_string = require_string();
646
+ var import_node = require_node();
634
647
  var exec = (param, element, state, context) => {
635
648
  if ((0, import_types.isFunction)(param)) {
636
649
  return param(
@@ -709,30 +722,31 @@ var require_object = __commonJS({
709
722
  var mergeArrayExclude = (arr, excl = []) => {
710
723
  return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
711
724
  };
712
- var deepClone2 = (obj, excludeFrom = [], cleanUndefined = false) => {
713
- const o = (0, import_types.isArray)(obj) ? [] : {};
714
- for (const prop in obj) {
715
- if (!Object.prototype.hasOwnProperty.call(obj, prop))
716
- continue;
717
- if (prop === "__proto__")
718
- continue;
719
- if (excludeFrom.includes(prop) || prop.startsWith("__"))
720
- continue;
721
- let objProp = obj[prop];
722
- if (cleanUndefined && (0, import_types.isUndefined)(objProp))
723
- continue;
724
- if (prop === "extend" && (0, import_types.isArray)(objProp)) {
725
- objProp = (0, import_array.mergeArray)(objProp);
725
+ var deepClone2 = (obj, exclude = [], cleanUndefined = false, visited = /* @__PURE__ */ new WeakMap()) => {
726
+ if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj))
727
+ return obj;
728
+ if (visited.has(obj))
729
+ return visited.get(obj);
730
+ const clone2 = (0, import_types.isArray)(obj) ? [] : {};
731
+ visited.set(obj, clone2);
732
+ for (const key in obj) {
733
+ if (Object.prototype.hasOwnProperty.call(obj, key) && !exclude.includes(key)) {
734
+ const value = obj[key];
735
+ if ((0, import_node.isDOMNode)(value)) {
736
+ clone2[key] = value;
737
+ } else if (key === "extend" && (0, import_types.isArray)(value)) {
738
+ clone2[key] = (0, import_array.mergeArray)(value, exclude);
739
+ } else if ((0, import_types.isObjectLike)(value)) {
740
+ clone2[key] = deepClone2(value, exclude, cleanUndefined, visited);
741
+ } else {
742
+ clone2[key] = value;
743
+ }
726
744
  }
727
- if ((0, import_types.isObjectLike)(objProp)) {
728
- o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
729
- } else
730
- o[prop] = objProp;
731
745
  }
732
- return o;
746
+ return clone2;
733
747
  };
734
748
  var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
735
- const o = (0, import_types.isArray)(obj) ? [] : {};
749
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
736
750
  for (const prop in obj) {
737
751
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
738
752
  continue;
@@ -986,7 +1000,7 @@ var require_object = __commonJS({
986
1000
  };
987
1001
  var overwriteDeep = (obj, params, excludeFrom = []) => {
988
1002
  for (const e in params) {
989
- if (e === "__proto__")
1003
+ if (e === "__ref")
990
1004
  continue;
991
1005
  if (excludeFrom.includes(e) || e.startsWith("__"))
992
1006
  continue;
@@ -1040,30 +1054,40 @@ var require_object = __commonJS({
1040
1054
  }
1041
1055
  return true;
1042
1056
  };
1043
- var deepContains = (obj1, obj2) => {
1044
- if (typeof obj1 !== typeof obj2) {
1057
+ var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
1058
+ if (obj1 === obj2)
1059
+ return true;
1060
+ if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
1045
1061
  return false;
1046
- }
1047
- if ((0, import_types.isObjectLike)(obj1)) {
1048
- if (Array.isArray(obj1) && Array.isArray(obj2)) {
1049
- if (obj1.length !== obj2.length) {
1062
+ if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
1063
+ return obj1 === obj2;
1064
+ const stack = [[obj1, obj2]];
1065
+ const visited = /* @__PURE__ */ new WeakSet();
1066
+ while (stack.length > 0) {
1067
+ const [current1, current2] = stack.pop();
1068
+ if (visited.has(current1))
1069
+ continue;
1070
+ visited.add(current1);
1071
+ const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
1072
+ const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
1073
+ if (keys1.length !== keys2.length)
1074
+ return false;
1075
+ for (const key of keys1) {
1076
+ if (!Object.prototype.hasOwnProperty.call(current2, key))
1050
1077
  return false;
1051
- }
1052
- for (let i = 0; i < obj1.length; i++) {
1053
- if (!deepContains(obj1[i], obj2[i])) {
1054
- return false;
1055
- }
1056
- }
1057
- } else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
1058
- for (const key in obj1) {
1059
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
1060
- if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
1078
+ const value1 = current1[key];
1079
+ const value2 = current2[key];
1080
+ if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
1081
+ if (value1 !== value2)
1061
1082
  return false;
1083
+ } else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
1084
+ if (value1 !== value2) {
1085
+ stack.push([value1, value2]);
1062
1086
  }
1087
+ } else if (value1 !== value2) {
1088
+ return false;
1063
1089
  }
1064
1090
  }
1065
- } else {
1066
- return obj2 === obj1;
1067
1091
  }
1068
1092
  return true;
1069
1093
  };
@@ -1108,6 +1132,12 @@ var require_object = __commonJS({
1108
1132
  if (foundString || foundInArray)
1109
1133
  return el;
1110
1134
  }
1135
+ if (el.parent && el.parent.childExtend) {
1136
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
1137
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
1138
+ if (foundString || foundInArray)
1139
+ return el;
1140
+ }
1111
1141
  };
1112
1142
  var getExtendsInElement = (obj) => {
1113
1143
  let result = [];
@@ -1688,9 +1718,11 @@ var BREAKPOINTS = {
1688
1718
  mobileXS: 375
1689
1719
  };
1690
1720
  var DEVICES = {
1721
+ screenXXL: [2560, 1440],
1722
+ screenXL: [2240, 1260],
1691
1723
  screenL: [1920, 1024],
1692
1724
  screenM: [1680, 1024],
1693
- screenS: [1440, 978],
1725
+ screenS: [1440, 720],
1694
1726
  tabletL: [1366, 926],
1695
1727
  tabletM: [1280, 768],
1696
1728
  tabletS: [1024, 768],