@symbo.ls/scratch 3.0.1 → 3.1.1

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
@@ -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_exports2 = {};
55
55
  __export2(index_exports2, {
56
56
  arrayzeValue: () => arrayzeValue3,
@@ -83,7 +83,147 @@ 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_METHODS3 = [
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_METHODS3 = ["update", "__element"];
121
+ var METHODS3 = [
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_EXL3 = [
150
+ ...["node", "context", "extends", "__element", "__ref"],
151
+ ...METHODS3,
152
+ ...STATE_METHODS3,
153
+ ...PROPS_METHODS3
154
+ ];
86
155
  var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
156
+ var STATE_METHODS22 = [
157
+ "update",
158
+ "parse",
159
+ "clean",
160
+ "create",
161
+ "destroy",
162
+ "add",
163
+ "toggle",
164
+ "remove",
165
+ "apply",
166
+ "set",
167
+ "reset",
168
+ "replace",
169
+ "quietReplace",
170
+ "quietUpdate",
171
+ "applyReplace",
172
+ "applyFunction",
173
+ "keys",
174
+ "values",
175
+ "ref",
176
+ "rootUpdate",
177
+ "parentUpdate",
178
+ "parent",
179
+ "__element",
180
+ "__depends",
181
+ "__ref",
182
+ "__children",
183
+ "root",
184
+ "setByPath",
185
+ "setPathCollection",
186
+ "removeByPath",
187
+ "removePathCollection",
188
+ "getByPath"
189
+ ];
190
+ var PROPS_METHODS22 = ["update", "__element"];
191
+ var METHODS22 = [
192
+ "set",
193
+ "reset",
194
+ "update",
195
+ "remove",
196
+ "updateContent",
197
+ "removeContent",
198
+ "lookup",
199
+ "lookdown",
200
+ "lookdownAll",
201
+ "getRef",
202
+ "getPath",
203
+ "setNodeStyles",
204
+ "spotByPath",
205
+ "keys",
206
+ "parse",
207
+ "setProps",
208
+ "parseDeep",
209
+ "variables",
210
+ "if",
211
+ "log",
212
+ "verbose",
213
+ "warn",
214
+ "error",
215
+ "call",
216
+ "nextElement",
217
+ "previousElement"
218
+ ];
219
+ var METHODS_EXL22 = [
220
+ ...["node", "context", "extends", "__element", "__ref"],
221
+ ...METHODS22,
222
+ ...STATE_METHODS22,
223
+ ...PROPS_METHODS22
224
+ ];
225
+ var window32 = globalThis;
226
+ var document32 = window32.document;
87
227
  async function toggleFullscreen(opts) {
88
228
  if (!document.fullscreenElement) {
89
229
  try {
@@ -439,16 +579,16 @@ var isScalingUnit = (unit) => {
439
579
  return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
440
580
  };
441
581
 
442
- // node_modules/@domql/utils/dist/esm/globals.js
582
+ // ../../../domql/packages/utils/globals.js
443
583
  var window2 = globalThis;
444
584
  var document2 = window2.document;
445
585
 
446
- // node_modules/@domql/utils/dist/esm/node.js
586
+ // ../../../domql/packages/utils/node.js
447
587
  var isDOMNode = (obj) => {
448
588
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
449
589
  };
450
590
 
451
- // node_modules/@domql/utils/dist/esm/types.js
591
+ // ../../../domql/packages/utils/types.js
452
592
  var isObject = (arg) => {
453
593
  if (arg === null) return false;
454
594
  return typeof arg === "object" && arg.constructor === Object;
@@ -471,35 +611,92 @@ var isUndefined = (arg) => {
471
611
  return arg === void 0;
472
612
  };
473
613
 
474
- // node_modules/@domql/utils/dist/esm/array.js
475
- var mergeArray = (arr, exclude = []) => {
476
- return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
614
+ // ../../../domql/packages/utils/array.js
615
+ var unstackArrayOfObjects = (arr, exclude = []) => {
616
+ return arr.reduce(
617
+ (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
618
+ {}
619
+ );
477
620
  };
478
621
 
479
- // node_modules/@domql/utils/dist/esm/object.js
480
- var __defProp2 = Object.defineProperty;
481
- var __defProps = Object.defineProperties;
482
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
483
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
484
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
485
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
486
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
487
- var __spreadValues = (a, b) => {
488
- for (var prop in b || (b = {}))
489
- if (__hasOwnProp2.call(b, prop))
490
- __defNormalProp(a, prop, b[prop]);
491
- if (__getOwnPropSymbols)
492
- for (var prop of __getOwnPropSymbols(b)) {
493
- if (__propIsEnum.call(b, prop))
494
- __defNormalProp(a, prop, b[prop]);
495
- }
496
- return a;
497
- };
498
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
622
+ // ../../../domql/packages/utils/keys.js
623
+ var STATE_METHODS = [
624
+ "update",
625
+ "parse",
626
+ "clean",
627
+ "create",
628
+ "destroy",
629
+ "add",
630
+ "toggle",
631
+ "remove",
632
+ "apply",
633
+ "set",
634
+ "reset",
635
+ "replace",
636
+ "quietReplace",
637
+ "quietUpdate",
638
+ "applyReplace",
639
+ "applyFunction",
640
+ "keys",
641
+ "values",
642
+ "ref",
643
+ "rootUpdate",
644
+ "parentUpdate",
645
+ "parent",
646
+ "__element",
647
+ "__depends",
648
+ "__ref",
649
+ "__children",
650
+ "root",
651
+ "setByPath",
652
+ "setPathCollection",
653
+ "removeByPath",
654
+ "removePathCollection",
655
+ "getByPath"
656
+ ];
657
+ var PROPS_METHODS = ["update", "__element"];
658
+ var METHODS = [
659
+ "set",
660
+ "reset",
661
+ "update",
662
+ "remove",
663
+ "updateContent",
664
+ "removeContent",
665
+ "lookup",
666
+ "lookdown",
667
+ "lookdownAll",
668
+ "getRef",
669
+ "getPath",
670
+ "setNodeStyles",
671
+ "spotByPath",
672
+ "keys",
673
+ "parse",
674
+ "setProps",
675
+ "parseDeep",
676
+ "variables",
677
+ "if",
678
+ "log",
679
+ "verbose",
680
+ "warn",
681
+ "error",
682
+ "call",
683
+ "nextElement",
684
+ "previousElement"
685
+ ];
686
+ var METHODS_EXL = [
687
+ ...["node", "context", "extends", "__element", "__ref"],
688
+ ...METHODS,
689
+ ...STATE_METHODS,
690
+ ...PROPS_METHODS
691
+ ];
692
+
693
+ // ../../../domql/packages/utils/object.js
499
694
  var merge = (element, obj, excludeFrom = []) => {
500
695
  for (const e in obj) {
501
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj, e);
502
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
696
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
697
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
698
+ continue;
699
+ }
503
700
  const elementProp = element[e];
504
701
  const objProp = obj[e];
505
702
  if (elementProp === void 0) {
@@ -508,10 +705,12 @@ var merge = (element, obj, excludeFrom = []) => {
508
705
  }
509
706
  return element;
510
707
  };
511
- var deepMerge = (element, extend, excludeFrom = []) => {
708
+ var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
512
709
  for (const e in extend) {
513
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
514
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
710
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
711
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
712
+ continue;
713
+ }
515
714
  const elementProp = element[e];
516
715
  const extendProp = extend[e];
517
716
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -529,7 +728,7 @@ var deepClone = (obj, options = {}) => {
529
728
  cleanNull = false,
530
729
  window: targetWindow,
531
730
  visited = /* @__PURE__ */ new WeakMap(),
532
- handleExtend = false
731
+ handleExtends = false
533
732
  } = options;
534
733
  if (!isObjectLike(obj) || isDOMNode(obj)) {
535
734
  return obj;
@@ -537,34 +736,39 @@ var deepClone = (obj, options = {}) => {
537
736
  if (visited.has(obj)) {
538
737
  return visited.get(obj);
539
738
  }
540
- const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
541
- visited.set(obj, clone2);
739
+ const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
740
+ visited.set(obj, clone);
542
741
  for (const key in obj) {
543
742
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
544
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
743
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
744
+ continue;
745
+ }
545
746
  const value = obj[key];
546
- if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
747
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
748
+ continue;
749
+ }
547
750
  if (isDOMNode(value)) {
548
- clone2[key] = value;
751
+ clone[key] = value;
549
752
  continue;
550
753
  }
551
- if (handleExtend && key === "extend" && isArray(value)) {
552
- clone2[key] = mergeArray(value, exclude);
754
+ if (handleExtends && key === "extends" && isArray(value)) {
755
+ clone[key] = unstackArrayOfObjects(value, exclude);
553
756
  continue;
554
757
  }
555
758
  if (isFunction(value) && targetWindow) {
556
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
759
+ clone[key] = targetWindow.eval("(" + value.toString() + ")");
557
760
  continue;
558
761
  }
559
762
  if (isObjectLike(value)) {
560
- clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
763
+ clone[key] = deepClone(value, {
764
+ ...options,
561
765
  visited
562
- }));
766
+ });
563
767
  } else {
564
- clone2[key] = value;
768
+ clone[key] = value;
565
769
  }
566
770
  }
567
- return clone2;
771
+ return clone;
568
772
  };
569
773
  var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
570
774
  const excl = opts.exclude || [];
@@ -590,9 +794,84 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
590
794
  return obj;
591
795
  };
592
796
 
593
- // node_modules/@domql/utils/dist/esm/cookie.js
797
+ // ../../../domql/packages/utils/cookie.js
594
798
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
595
799
 
800
+ // ../../../domql/packages/event/dist/esm/keys.js
801
+ var STATE_METHODS2 = [
802
+ "update",
803
+ "parse",
804
+ "clean",
805
+ "create",
806
+ "destroy",
807
+ "add",
808
+ "toggle",
809
+ "remove",
810
+ "apply",
811
+ "set",
812
+ "reset",
813
+ "replace",
814
+ "quietReplace",
815
+ "quietUpdate",
816
+ "applyReplace",
817
+ "applyFunction",
818
+ "keys",
819
+ "values",
820
+ "ref",
821
+ "rootUpdate",
822
+ "parentUpdate",
823
+ "parent",
824
+ "__element",
825
+ "__depends",
826
+ "__ref",
827
+ "__children",
828
+ "root",
829
+ "setByPath",
830
+ "setPathCollection",
831
+ "removeByPath",
832
+ "removePathCollection",
833
+ "getByPath"
834
+ ];
835
+ var PROPS_METHODS2 = ["update", "__element"];
836
+ var METHODS2 = [
837
+ "set",
838
+ "reset",
839
+ "update",
840
+ "remove",
841
+ "updateContent",
842
+ "removeContent",
843
+ "lookup",
844
+ "lookdown",
845
+ "lookdownAll",
846
+ "getRef",
847
+ "getPath",
848
+ "setNodeStyles",
849
+ "spotByPath",
850
+ "keys",
851
+ "parse",
852
+ "setProps",
853
+ "parseDeep",
854
+ "variables",
855
+ "if",
856
+ "log",
857
+ "verbose",
858
+ "warn",
859
+ "error",
860
+ "call",
861
+ "nextElement",
862
+ "previousElement"
863
+ ];
864
+ var METHODS_EXL2 = [
865
+ ...["node", "context", "extends", "__element", "__ref"],
866
+ ...METHODS2,
867
+ ...STATE_METHODS2,
868
+ ...PROPS_METHODS2
869
+ ];
870
+
871
+ // ../../../domql/packages/event/dist/esm/globals.js
872
+ var window3 = globalThis;
873
+ var document3 = window3.document;
874
+
596
875
  // src/utils/color.js
597
876
  var ENV = "development";
598
877
  var colorStringToRgbaArray = (color) => {
@@ -708,7 +987,7 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
708
987
  var opacify = (color, opacity) => {
709
988
  const arr = colorStringToRgbaArray(color);
710
989
  if (!arr) {
711
- if (ENV === "test" || ENV === "development") console.warn(color + " color is not rgba");
990
+ if (ENV === "testing" || ENV === "development") console.warn(color + " color is not rgba");
712
991
  return;
713
992
  }
714
993
  arr[3] = opacity;
@@ -779,7 +1058,7 @@ var getFontFaceString = (LIBRARY) => {
779
1058
  };
780
1059
 
781
1060
  // src/utils/sequence.js
782
- var import_utils4 = __toESM(require_cjs(), 1);
1061
+ var import_utils5 = __toESM(require_cjs(), 1);
783
1062
 
784
1063
  // src/defaultConfig/index.js
785
1064
  var defaultConfig_exports = {};
@@ -1145,8 +1424,12 @@ var generateSequence = (sequenceProps) => {
1145
1424
  return sequenceProps;
1146
1425
  };
1147
1426
  var generateSequencePosition = (sequenceProps, position = 0) => {
1427
+ var _a;
1148
1428
  const { type, base, ratio, subSequence } = sequenceProps;
1149
- const letterKey = (void 0).call("isString", position) ? position : numToLetterMap[position];
1429
+ const letterKey = isString(position) ? position : numToLetterMap[position];
1430
+ const index = isString(position) ? (_a = Object.entries(numToLetterMap).find(
1431
+ ([, value2]) => value2 === position
1432
+ )) == null ? void 0 : _a[0] : position;
1150
1433
  if (!letterKey) {
1151
1434
  console.warn(`Position ${position} is out of range in numToLetterMap`);
1152
1435
  return null;
@@ -1157,11 +1440,11 @@ var generateSequencePosition = (sequenceProps, position = 0) => {
1157
1440
  vars: {},
1158
1441
  ...sequenceProps
1159
1442
  };
1160
- const value = base * Math.pow(ratio, position);
1443
+ const value = base * Math.pow(ratio, index);
1161
1444
  const scaling = ~~(value / base * 100) / 100;
1162
1445
  const prefix = "--" + (type && type.replace(".", "-")) + "-";
1163
1446
  const variable = prefix + letterKey;
1164
- const scalingVariable = setScalingVar(position, sequenceProps);
1447
+ const scalingVariable = setScalingVar(index, sequenceProps);
1165
1448
  const props = {
1166
1449
  key: letterKey,
1167
1450
  variable,
@@ -1170,7 +1453,7 @@ var generateSequencePosition = (sequenceProps, position = 0) => {
1170
1453
  scaling,
1171
1454
  scalingVariable,
1172
1455
  ratio,
1173
- index: position
1456
+ index
1174
1457
  };
1175
1458
  setSequenceValue(props, result);
1176
1459
  if (subSequence) {
@@ -1187,7 +1470,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
1187
1470
  useVariable
1188
1471
  } = sequenceProps;
1189
1472
  if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
1190
- const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
1473
+ const prefix = `--${(0, import_utils5.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
1191
1474
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
1192
1475
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
1193
1476
  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;
@@ -1321,6 +1604,8 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
1321
1604
  };
1322
1605
 
1323
1606
  // src/utils/sprite.js
1607
+ var ENV2 = "development";
1608
+ var isDev = ENV2 === "development" || ENV2 === "testing";
1324
1609
  var generateSprite = (icons) => {
1325
1610
  const CONFIG2 = getActiveConfig();
1326
1611
  let sprite = "";
@@ -1334,7 +1619,8 @@ var generateSprite = (icons) => {
1334
1619
  var parseRootAttributes = (htmlString) => {
1335
1620
  const val = htmlString.default || htmlString;
1336
1621
  if (!isString(val)) {
1337
- return console.warn(`parseRootAttributes: ${val} is not a string`);
1622
+ if (isDev) console.warn("parseRootAttributes:", val, "is not a string");
1623
+ return;
1338
1624
  }
1339
1625
  const match = val.match(/<svg\s+(.*?)>/);
1340
1626
  if (!match || !match[1]) {
@@ -1734,7 +2020,7 @@ var getMediaTheme = (value, modifier) => {
1734
2020
  };
1735
2021
 
1736
2022
  // src/system/font.js
1737
- var import_utils11 = __toESM(require_cjs(), 1);
2023
+ var import_utils12 = __toESM(require_cjs(), 1);
1738
2024
  var setFont = (val, key) => {
1739
2025
  const CSSvar = `--font-${key}`;
1740
2026
  if (!val || isArray(val) && !val[0]) return;
@@ -1751,7 +2037,7 @@ var setFontFamily = (val, key) => {
1751
2037
  const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
1752
2038
  let { value, type } = val;
1753
2039
  if (val.isDefault) FONT_FAMILY2.default = key;
1754
- if (isObject(value)) value = (0, import_utils11.arrayzeValue)(value);
2040
+ if (isObject(value)) value = (0, import_utils12.arrayzeValue)(value);
1755
2041
  const CSSvar = `--font-family-${key}`;
1756
2042
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
1757
2043
  return { var: CSSvar, value: str, arr: value, type };
@@ -1805,6 +2091,7 @@ var runThroughMedia = (FACTORY2) => {
1805
2091
  }
1806
2092
  };
1807
2093
  var applyHeadings = (props) => {
2094
+ var _a;
1808
2095
  const CONFIG2 = getActiveConfig();
1809
2096
  if (props.h1Matches) {
1810
2097
  const unit = props.unit;
@@ -1813,8 +2100,9 @@ var applyHeadings = (props) => {
1813
2100
  for (const k in HEADINGS) {
1814
2101
  const headerName = `h${parseInt(k) + 1}`;
1815
2102
  const headerStyle = templates[headerName];
2103
+ if (!HEADINGS[k]) continue;
1816
2104
  templates[headerName] = {
1817
- fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
2105
+ fontSize: CONFIG2.useVariable ? `var(${(_a = HEADINGS[k]) == null ? void 0 : _a.variable})` : `${HEADINGS[k].scaling}${unit}`,
1818
2106
  margin: headerStyle ? headerStyle.margin : 0,
1819
2107
  lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
1820
2108
  letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
@@ -1842,7 +2130,7 @@ var getFontSizeByKey = (value) => {
1842
2130
  };
1843
2131
 
1844
2132
  // src/system/spacing.js
1845
- var import_utils15 = __toESM(require_cjs(), 1);
2133
+ var import_utils16 = __toESM(require_cjs(), 1);
1846
2134
  var runThroughMedia2 = (FACTORY2) => {
1847
2135
  for (const prop in FACTORY2) {
1848
2136
  const mediaProps = FACTORY2[prop];
@@ -1893,7 +2181,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
1893
2181
  if (isString(value) && (value.includes("calc") || value.includes("var"))) {
1894
2182
  return { [propertyName]: value };
1895
2183
  }
1896
- const stack = (0, import_utils15.arrayzeValue)(value);
2184
+ const stack = (0, import_utils16.arrayzeValue)(value);
1897
2185
  if (!isArray(stack)) return;
1898
2186
  if (stack.length > 1) {
1899
2187
  let suffix = "";
@@ -2025,7 +2313,7 @@ var getShadow = (value, globalTheme) => {
2025
2313
  };
2026
2314
 
2027
2315
  // src/system/timing.js
2028
- var import_utils19 = __toESM(require_cjs(), 1);
2316
+ var import_utils20 = __toESM(require_cjs(), 1);
2029
2317
  var applyTimingSequence = () => {
2030
2318
  const CONFIG2 = getActiveConfig();
2031
2319
  const { TIMING: TIMING2 } = CONFIG2;
@@ -2035,7 +2323,7 @@ var applyTimingSequence = () => {
2035
2323
  var getTimingFunction = (value) => {
2036
2324
  const CONFIG2 = getActiveConfig();
2037
2325
  const { TIMING: TIMING2 } = CONFIG2;
2038
- return TIMING2[value] || TIMING2[(0, import_utils19.toCamelCase)(value)] || value;
2326
+ return TIMING2[value] || TIMING2[(0, import_utils20.toCamelCase)(value)] || value;
2039
2327
  };
2040
2328
  var getTimingByKey = (value, property = "timing") => {
2041
2329
  const CONFIG2 = getActiveConfig();
@@ -2357,7 +2645,13 @@ var setEach = (factoryName, props) => {
2357
2645
  const CONFIG2 = getActiveConfig();
2358
2646
  const FACTORY_NAME = factoryName.toUpperCase();
2359
2647
  const keys = Object.keys(props);
2360
- keys.map((key) => setValue(FACTORY_NAME, props[key], key));
2648
+ keys.forEach((key) => {
2649
+ try {
2650
+ return setValue(FACTORY_NAME, props[key], key);
2651
+ } catch (error) {
2652
+ if (CONFIG2.verbose) console.warn("Error setting", FACTORY_NAME, "value", props[key], key, error);
2653
+ }
2654
+ });
2361
2655
  return CONFIG2[FACTORY_NAME];
2362
2656
  };
2363
2657
  var SET_OPTIONS = {};
@@ -2394,9 +2688,27 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
2394
2688
  if (!CONFIG2.__svg_cache) CONFIG2.__svg_cache = {};
2395
2689
  const keys = Object.keys(config);
2396
2690
  keys.map((key) => setEach(key, config[key]));
2397
- if (config.TYPOGRAPHY) applyTypographySequence();
2398
- if (config.SPACING) applySpacingSequence();
2399
- if (config.TIMING) applyTimingSequence();
2691
+ if (config.TYPOGRAPHY) {
2692
+ try {
2693
+ applyTypographySequence();
2694
+ } catch (e) {
2695
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2696
+ }
2697
+ }
2698
+ if (config.SPACING) {
2699
+ try {
2700
+ applySpacingSequence();
2701
+ } catch (e) {
2702
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2703
+ }
2704
+ }
2705
+ if (config.TIMING) {
2706
+ try {
2707
+ applyTimingSequence();
2708
+ } catch (e) {
2709
+ if (CONFIG2.verbose) console.warn("Error applying typography sequence", e);
2710
+ }
2711
+ }
2400
2712
  applyDocument();
2401
2713
  applyReset();
2402
2714
  return CONFIG2;