@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.
@@ -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_exports = {};
55
55
  __export2(index_exports, {
56
56
  arrayzeValue: () => arrayzeValue,
@@ -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 {
@@ -262,18 +402,18 @@ __export(timing_exports, {
262
402
  getTimingFunction: () => getTimingFunction
263
403
  });
264
404
  module.exports = __toCommonJS(timing_exports);
265
- var import_utils7 = __toESM(require_cjs(), 1);
405
+ var import_utils8 = __toESM(require_cjs(), 1);
266
406
 
267
- // node_modules/@domql/utils/dist/esm/globals.js
407
+ // ../../../domql/packages/utils/globals.js
268
408
  var window2 = globalThis;
269
409
  var document2 = window2.document;
270
410
 
271
- // node_modules/@domql/utils/dist/esm/node.js
411
+ // ../../../domql/packages/utils/node.js
272
412
  var isDOMNode = (obj) => {
273
413
  return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
274
414
  };
275
415
 
276
- // node_modules/@domql/utils/dist/esm/types.js
416
+ // ../../../domql/packages/utils/types.js
277
417
  var isString = (arg) => typeof arg === "string";
278
418
  var isFunction = (arg) => typeof arg === "function";
279
419
  var isNull = (arg) => arg === null;
@@ -286,35 +426,92 @@ var isUndefined = (arg) => {
286
426
  return arg === void 0;
287
427
  };
288
428
 
289
- // node_modules/@domql/utils/dist/esm/array.js
290
- var mergeArray = (arr, exclude = []) => {
291
- return arr.reduce((a, c) => deepMerge(a, deepClone(c, { exclude }), exclude), {});
292
- };
293
-
294
- // node_modules/@domql/utils/dist/esm/object.js
295
- var __defProp2 = Object.defineProperty;
296
- var __defProps = Object.defineProperties;
297
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
298
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
299
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
300
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
301
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
302
- var __spreadValues = (a, b) => {
303
- for (var prop in b || (b = {}))
304
- if (__hasOwnProp2.call(b, prop))
305
- __defNormalProp(a, prop, b[prop]);
306
- if (__getOwnPropSymbols)
307
- for (var prop of __getOwnPropSymbols(b)) {
308
- if (__propIsEnum.call(b, prop))
309
- __defNormalProp(a, prop, b[prop]);
310
- }
311
- return a;
429
+ // ../../../domql/packages/utils/array.js
430
+ var unstackArrayOfObjects = (arr, exclude = []) => {
431
+ return arr.reduce(
432
+ (a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
433
+ {}
434
+ );
312
435
  };
313
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
314
- var deepMerge = (element, extend, excludeFrom = []) => {
436
+
437
+ // ../../../domql/packages/utils/keys.js
438
+ var STATE_METHODS = [
439
+ "update",
440
+ "parse",
441
+ "clean",
442
+ "create",
443
+ "destroy",
444
+ "add",
445
+ "toggle",
446
+ "remove",
447
+ "apply",
448
+ "set",
449
+ "reset",
450
+ "replace",
451
+ "quietReplace",
452
+ "quietUpdate",
453
+ "applyReplace",
454
+ "applyFunction",
455
+ "keys",
456
+ "values",
457
+ "ref",
458
+ "rootUpdate",
459
+ "parentUpdate",
460
+ "parent",
461
+ "__element",
462
+ "__depends",
463
+ "__ref",
464
+ "__children",
465
+ "root",
466
+ "setByPath",
467
+ "setPathCollection",
468
+ "removeByPath",
469
+ "removePathCollection",
470
+ "getByPath"
471
+ ];
472
+ var PROPS_METHODS = ["update", "__element"];
473
+ var METHODS = [
474
+ "set",
475
+ "reset",
476
+ "update",
477
+ "remove",
478
+ "updateContent",
479
+ "removeContent",
480
+ "lookup",
481
+ "lookdown",
482
+ "lookdownAll",
483
+ "getRef",
484
+ "getPath",
485
+ "setNodeStyles",
486
+ "spotByPath",
487
+ "keys",
488
+ "parse",
489
+ "setProps",
490
+ "parseDeep",
491
+ "variables",
492
+ "if",
493
+ "log",
494
+ "verbose",
495
+ "warn",
496
+ "error",
497
+ "call",
498
+ "nextElement",
499
+ "previousElement"
500
+ ];
501
+ var METHODS_EXL = [
502
+ ...["node", "context", "extends", "__element", "__ref"],
503
+ ...METHODS,
504
+ ...STATE_METHODS,
505
+ ...PROPS_METHODS
506
+ ];
507
+
508
+ // ../../../domql/packages/utils/object.js
509
+ var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
315
510
  for (const e in extend) {
316
- const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
317
- if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) continue;
511
+ const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
512
+ if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__")) {
513
+ continue;
514
+ }
318
515
  const elementProp = element[e];
319
516
  const extendProp = extend[e];
320
517
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -332,7 +529,7 @@ var deepClone = (obj, options = {}) => {
332
529
  cleanNull = false,
333
530
  window: targetWindow,
334
531
  visited = /* @__PURE__ */ new WeakMap(),
335
- handleExtend = false
532
+ handleExtends = false
336
533
  } = options;
337
534
  if (!isObjectLike(obj) || isDOMNode(obj)) {
338
535
  return obj;
@@ -340,39 +537,119 @@ var deepClone = (obj, options = {}) => {
340
537
  if (visited.has(obj)) {
341
538
  return visited.get(obj);
342
539
  }
343
- const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
344
- visited.set(obj, clone2);
540
+ const clone = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
541
+ visited.set(obj, clone);
345
542
  for (const key in obj) {
346
543
  if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
347
- if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") continue;
544
+ if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
545
+ continue;
546
+ }
348
547
  const value = obj[key];
349
- if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) continue;
548
+ if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
549
+ continue;
550
+ }
350
551
  if (isDOMNode(value)) {
351
- clone2[key] = value;
552
+ clone[key] = value;
352
553
  continue;
353
554
  }
354
- if (handleExtend && key === "extend" && isArray(value)) {
355
- clone2[key] = mergeArray(value, exclude);
555
+ if (handleExtends && key === "extends" && isArray(value)) {
556
+ clone[key] = unstackArrayOfObjects(value, exclude);
356
557
  continue;
357
558
  }
358
559
  if (isFunction(value) && targetWindow) {
359
- clone2[key] = targetWindow.eval("(" + value.toString() + ")");
560
+ clone[key] = targetWindow.eval("(" + value.toString() + ")");
360
561
  continue;
361
562
  }
362
563
  if (isObjectLike(value)) {
363
- clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
564
+ clone[key] = deepClone(value, {
565
+ ...options,
364
566
  visited
365
- }));
567
+ });
366
568
  } else {
367
- clone2[key] = value;
569
+ clone[key] = value;
368
570
  }
369
571
  }
370
- return clone2;
572
+ return clone;
371
573
  };
372
574
 
373
- // node_modules/@domql/utils/dist/esm/cookie.js
575
+ // ../../../domql/packages/utils/cookie.js
374
576
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
375
577
 
578
+ // ../../../domql/packages/event/dist/esm/keys.js
579
+ var STATE_METHODS2 = [
580
+ "update",
581
+ "parse",
582
+ "clean",
583
+ "create",
584
+ "destroy",
585
+ "add",
586
+ "toggle",
587
+ "remove",
588
+ "apply",
589
+ "set",
590
+ "reset",
591
+ "replace",
592
+ "quietReplace",
593
+ "quietUpdate",
594
+ "applyReplace",
595
+ "applyFunction",
596
+ "keys",
597
+ "values",
598
+ "ref",
599
+ "rootUpdate",
600
+ "parentUpdate",
601
+ "parent",
602
+ "__element",
603
+ "__depends",
604
+ "__ref",
605
+ "__children",
606
+ "root",
607
+ "setByPath",
608
+ "setPathCollection",
609
+ "removeByPath",
610
+ "removePathCollection",
611
+ "getByPath"
612
+ ];
613
+ var PROPS_METHODS2 = ["update", "__element"];
614
+ var METHODS2 = [
615
+ "set",
616
+ "reset",
617
+ "update",
618
+ "remove",
619
+ "updateContent",
620
+ "removeContent",
621
+ "lookup",
622
+ "lookdown",
623
+ "lookdownAll",
624
+ "getRef",
625
+ "getPath",
626
+ "setNodeStyles",
627
+ "spotByPath",
628
+ "keys",
629
+ "parse",
630
+ "setProps",
631
+ "parseDeep",
632
+ "variables",
633
+ "if",
634
+ "log",
635
+ "verbose",
636
+ "warn",
637
+ "error",
638
+ "call",
639
+ "nextElement",
640
+ "previousElement"
641
+ ];
642
+ var METHODS_EXL2 = [
643
+ ...["node", "context", "extends", "__element", "__ref"],
644
+ ...METHODS2,
645
+ ...STATE_METHODS2,
646
+ ...PROPS_METHODS2
647
+ ];
648
+
649
+ // ../../../domql/packages/event/dist/esm/globals.js
650
+ var window3 = globalThis;
651
+ var document3 = window3.document;
652
+
376
653
  // src/defaultConfig/index.js
377
654
  var defaultConfig_exports = {};
378
655
  __export(defaultConfig_exports, {
@@ -600,7 +877,7 @@ var isScalingUnit = (unit) => {
600
877
  };
601
878
 
602
879
  // src/utils/sequence.js
603
- var import_utils4 = __toESM(require_cjs(), 1);
880
+ var import_utils5 = __toESM(require_cjs(), 1);
604
881
  var numToLetterMap = {
605
882
  "-6": "U",
606
883
  "-5": "V",
@@ -739,7 +1016,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
739
1016
  useVariable
740
1017
  } = sequenceProps;
741
1018
  if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
742
- const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
1019
+ const prefix = `--${(0, import_utils5.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
743
1020
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
744
1021
  const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
745
1022
  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;
@@ -841,7 +1118,7 @@ var applyTimingSequence = () => {
841
1118
  var getTimingFunction = (value) => {
842
1119
  const CONFIG2 = getActiveConfig();
843
1120
  const { TIMING: TIMING2 } = CONFIG2;
844
- return TIMING2[value] || TIMING2[(0, import_utils7.toCamelCase)(value)] || value;
1121
+ return TIMING2[value] || TIMING2[(0, import_utils8.toCamelCase)(value)] || value;
845
1122
  };
846
1123
  var getTimingByKey = (value, property = "timing") => {
847
1124
  const CONFIG2 = getActiveConfig();