@symbo.ls/scratch 2.34.0 → 2.34.2
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/factory.js +18 -36
- package/dist/cjs/index.js +111 -172
- package/dist/cjs/set.js +111 -172
- package/dist/cjs/system/color.js +109 -170
- package/dist/cjs/system/document.js +111 -172
- package/dist/cjs/system/font.js +109 -170
- package/dist/cjs/system/index.js +111 -172
- package/dist/cjs/system/reset.js +111 -172
- package/dist/cjs/system/shadow.js +109 -170
- package/dist/cjs/system/spacing.js +111 -172
- package/dist/cjs/system/svg.js +109 -170
- package/dist/cjs/system/theme.js +109 -170
- package/dist/cjs/system/timing.js +109 -170
- package/dist/cjs/system/typography.js +111 -172
- package/dist/cjs/transforms/index.js +109 -170
- package/dist/cjs/utils/color.js +4 -4
- package/dist/cjs/utils/index.js +109 -170
- package/dist/cjs/utils/sequence.js +108 -169
- package/dist/cjs/utils/sprite.js +19 -37
- package/dist/cjs/utils/var.js +108 -169
- package/package.json +6 -6
package/dist/cjs/system/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
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
39
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
41
|
var __export2 = (target, all) => {
|
|
42
42
|
for (var name in all)
|
|
43
|
-
|
|
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 (!
|
|
49
|
-
|
|
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(
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
54
|
var index_exports = {};
|
|
55
55
|
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue3,
|
|
@@ -181,25 +181,6 @@ var require_cjs = __commonJS({
|
|
|
181
181
|
var lowercaseFirstLetter = (inputString) => {
|
|
182
182
|
return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
|
|
183
183
|
};
|
|
184
|
-
var __defProp22 = Object.defineProperty;
|
|
185
|
-
var __defProps2 = Object.defineProperties;
|
|
186
|
-
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
187
|
-
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
188
|
-
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
189
|
-
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
190
|
-
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
191
|
-
var __spreadValues2 = (a, b) => {
|
|
192
|
-
for (var prop in b || (b = {}))
|
|
193
|
-
if (__hasOwnProp22.call(b, prop))
|
|
194
|
-
__defNormalProp2(a, prop, b[prop]);
|
|
195
|
-
if (__getOwnPropSymbols2)
|
|
196
|
-
for (var prop of __getOwnPropSymbols2(b)) {
|
|
197
|
-
if (__propIsEnum2.call(b, prop))
|
|
198
|
-
__defNormalProp2(a, prop, b[prop]);
|
|
199
|
-
}
|
|
200
|
-
return a;
|
|
201
|
-
};
|
|
202
|
-
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
203
184
|
function exec2(param, element, state2, context, opts = {}) {
|
|
204
185
|
if (!element) element = this;
|
|
205
186
|
if (isFunction2(param)) {
|
|
@@ -228,8 +209,8 @@ var require_cjs = __commonJS({
|
|
|
228
209
|
};
|
|
229
210
|
var merge2 = (element, obj, excludeFrom = []) => {
|
|
230
211
|
for (const e in obj) {
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
212
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
|
|
213
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
|
|
233
214
|
continue;
|
|
234
215
|
const elementProp = element[e];
|
|
235
216
|
const objProp = obj[e];
|
|
@@ -241,8 +222,8 @@ var require_cjs = __commonJS({
|
|
|
241
222
|
};
|
|
242
223
|
var deepMerge2 = (element, extend, excludeFrom = [], level = Infinity) => {
|
|
243
224
|
for (const e in extend) {
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
225
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
|
|
226
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
|
|
246
227
|
continue;
|
|
247
228
|
const elementProp = element[e];
|
|
248
229
|
const extendProp = extend[e];
|
|
@@ -264,8 +245,8 @@ var require_cjs = __commonJS({
|
|
|
264
245
|
var clone = (obj, excludeFrom = []) => {
|
|
265
246
|
const o = {};
|
|
266
247
|
for (const prop in obj) {
|
|
267
|
-
const
|
|
268
|
-
if (!
|
|
248
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, prop);
|
|
249
|
+
if (!hasOwnProperty || excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
269
250
|
continue;
|
|
270
251
|
o[prop] = obj[prop];
|
|
271
252
|
}
|
|
@@ -316,9 +297,10 @@ var require_cjs = __commonJS({
|
|
|
316
297
|
}
|
|
317
298
|
if (isObjectLike2(value)) {
|
|
318
299
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
319
|
-
clone2[key] = deepClone2(value,
|
|
300
|
+
clone2[key] = deepClone2(value, {
|
|
301
|
+
...options,
|
|
320
302
|
visited
|
|
321
|
-
})
|
|
303
|
+
});
|
|
322
304
|
} else {
|
|
323
305
|
clone2[key] = value;
|
|
324
306
|
}
|
|
@@ -758,25 +740,6 @@ var require_cjs = __commonJS({
|
|
|
758
740
|
]
|
|
759
741
|
};
|
|
760
742
|
var isValidHtmlTag = (arg) => HTML_TAGS.body.includes(arg);
|
|
761
|
-
var __defProp32 = Object.defineProperty;
|
|
762
|
-
var __defProps22 = Object.defineProperties;
|
|
763
|
-
var __getOwnPropDescs22 = Object.getOwnPropertyDescriptors;
|
|
764
|
-
var __getOwnPropSymbols22 = Object.getOwnPropertySymbols;
|
|
765
|
-
var __hasOwnProp32 = Object.prototype.hasOwnProperty;
|
|
766
|
-
var __propIsEnum22 = Object.prototype.propertyIsEnumerable;
|
|
767
|
-
var __defNormalProp22 = (obj, key, value) => key in obj ? __defProp32(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
768
|
-
var __spreadValues22 = (a, b) => {
|
|
769
|
-
for (var prop in b || (b = {}))
|
|
770
|
-
if (__hasOwnProp32.call(b, prop))
|
|
771
|
-
__defNormalProp22(a, prop, b[prop]);
|
|
772
|
-
if (__getOwnPropSymbols22)
|
|
773
|
-
for (var prop of __getOwnPropSymbols22(b)) {
|
|
774
|
-
if (__propIsEnum22.call(b, prop))
|
|
775
|
-
__defNormalProp22(a, prop, b[prop]);
|
|
776
|
-
}
|
|
777
|
-
return a;
|
|
778
|
-
};
|
|
779
|
-
var __spreadProps22 = (a, b) => __defProps22(a, __getOwnPropDescs22(b));
|
|
780
743
|
var checkIfKeyIsComponent = (key) => {
|
|
781
744
|
const isFirstKeyString = isString2(key);
|
|
782
745
|
if (!isFirstKeyString) return;
|
|
@@ -789,7 +752,7 @@ var require_cjs = __commonJS({
|
|
|
789
752
|
const originalArray = isArray2(elementExtend) ? elementExtend : [elementExtend];
|
|
790
753
|
const receivedArray = isArray2(newExtend) ? newExtend : [newExtend];
|
|
791
754
|
const extend = joinArrays2(receivedArray, originalArray);
|
|
792
|
-
return
|
|
755
|
+
return { ...element, extend };
|
|
793
756
|
};
|
|
794
757
|
var checkIfSugar = (element, parent2, key) => {
|
|
795
758
|
var _a;
|
|
@@ -833,7 +796,7 @@ var require_cjs = __commonJS({
|
|
|
833
796
|
const newElem = addAdditionalExtend(element.extends, {
|
|
834
797
|
extend: extendFromKey,
|
|
835
798
|
tag,
|
|
836
|
-
props:
|
|
799
|
+
props: { ...element }
|
|
837
800
|
});
|
|
838
801
|
if (newElem.props.data) {
|
|
839
802
|
newElem.data = newElem.props.data;
|
|
@@ -854,17 +817,18 @@ var require_cjs = __commonJS({
|
|
|
854
817
|
if (childExtends) newElem.childExtend = childExtends;
|
|
855
818
|
return newElem;
|
|
856
819
|
} else if (!extend || extend === true) {
|
|
857
|
-
return
|
|
820
|
+
return {
|
|
821
|
+
...element,
|
|
858
822
|
tag,
|
|
859
823
|
extend: extendFromKey
|
|
860
|
-
}
|
|
824
|
+
};
|
|
861
825
|
} else if (extend) {
|
|
862
826
|
return addAdditionalExtend(extendFromKey, element);
|
|
863
827
|
} else if (isFunction2(element)) {
|
|
864
828
|
return {
|
|
865
829
|
extend: extendFromKey,
|
|
866
830
|
tag,
|
|
867
|
-
props:
|
|
831
|
+
props: { ...exec2(element, parent2) }
|
|
868
832
|
};
|
|
869
833
|
}
|
|
870
834
|
};
|
|
@@ -2314,25 +2278,25 @@ ${element}` : ""
|
|
|
2314
2278
|
"removePathCollection",
|
|
2315
2279
|
"getByPath"
|
|
2316
2280
|
];
|
|
2317
|
-
var
|
|
2318
|
-
var
|
|
2319
|
-
var
|
|
2320
|
-
var
|
|
2321
|
-
var
|
|
2322
|
-
var
|
|
2323
|
-
var
|
|
2324
|
-
var
|
|
2281
|
+
var __defProp22 = Object.defineProperty;
|
|
2282
|
+
var __defProps = Object.defineProperties;
|
|
2283
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2284
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2285
|
+
var __hasOwnProp22 = Object.prototype.hasOwnProperty;
|
|
2286
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2287
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2288
|
+
var __spreadValues = (a, b) => {
|
|
2325
2289
|
for (var prop in b || (b = {}))
|
|
2326
|
-
if (
|
|
2327
|
-
|
|
2328
|
-
if (
|
|
2329
|
-
for (var prop of
|
|
2330
|
-
if (
|
|
2331
|
-
|
|
2290
|
+
if (__hasOwnProp22.call(b, prop))
|
|
2291
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2292
|
+
if (__getOwnPropSymbols)
|
|
2293
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
2294
|
+
if (__propIsEnum.call(b, prop))
|
|
2295
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2332
2296
|
}
|
|
2333
2297
|
return a;
|
|
2334
2298
|
};
|
|
2335
|
-
var
|
|
2299
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2336
2300
|
var parse2 = function() {
|
|
2337
2301
|
const state2 = this;
|
|
2338
2302
|
if (isObject2(state2)) {
|
|
@@ -2354,7 +2318,7 @@ ${element}` : ""
|
|
|
2354
2318
|
}
|
|
2355
2319
|
}
|
|
2356
2320
|
if (!options.preventStateUpdate) {
|
|
2357
|
-
await state2.update(state2,
|
|
2321
|
+
await state2.update(state2, __spreadValues({ replace: true }, options));
|
|
2358
2322
|
}
|
|
2359
2323
|
return state2;
|
|
2360
2324
|
};
|
|
@@ -2363,7 +2327,7 @@ ${element}` : ""
|
|
|
2363
2327
|
const element = state2.__element;
|
|
2364
2328
|
const stateKey = element.__ref.__state;
|
|
2365
2329
|
if (isString2(stateKey)) {
|
|
2366
|
-
await element.parent.state.remove(stateKey,
|
|
2330
|
+
await element.parent.state.remove(stateKey, __spreadValues({ isHoisted: true }, options));
|
|
2367
2331
|
return element.state;
|
|
2368
2332
|
}
|
|
2369
2333
|
delete element.state;
|
|
@@ -2391,25 +2355,25 @@ ${element}` : ""
|
|
|
2391
2355
|
}
|
|
2392
2356
|
}
|
|
2393
2357
|
}
|
|
2394
|
-
await element.state.update({},
|
|
2358
|
+
await element.state.update({}, __spreadValues({ isHoisted: true }, options));
|
|
2395
2359
|
return element.state;
|
|
2396
2360
|
};
|
|
2397
2361
|
var parentUpdate = async function(obj, options = {}) {
|
|
2398
2362
|
const state2 = this;
|
|
2399
2363
|
if (!state2 || !state2.parent) return;
|
|
2400
|
-
return await state2.parent.update(obj,
|
|
2364
|
+
return await state2.parent.update(obj, __spreadValues({ isHoisted: true }, options));
|
|
2401
2365
|
};
|
|
2402
2366
|
var rootUpdate = async function(obj, options = {}) {
|
|
2403
2367
|
const state2 = this;
|
|
2404
2368
|
if (!state2) return;
|
|
2405
2369
|
const rootState = state2.__element.__ref.root.state;
|
|
2406
|
-
return await rootState.update(obj,
|
|
2370
|
+
return await rootState.update(obj, __spreadValues({ isHoisted: false }, options));
|
|
2407
2371
|
};
|
|
2408
2372
|
var add = async function(value, options = {}) {
|
|
2409
2373
|
const state2 = this;
|
|
2410
2374
|
if (isArray2(state2)) {
|
|
2411
2375
|
await state2.push(value);
|
|
2412
|
-
return await state2.update(state2.parse(),
|
|
2376
|
+
return await state2.update(state2.parse(), __spreadValues({ overwrite: true }, options));
|
|
2413
2377
|
} else if (isObject2(state2)) {
|
|
2414
2378
|
const key = Object.keys(state2).length;
|
|
2415
2379
|
return await state2.update({ [key]: value }, options);
|
|
@@ -2424,13 +2388,13 @@ ${element}` : ""
|
|
|
2424
2388
|
if (isArray2(state2)) removeFromArray(state2, key);
|
|
2425
2389
|
if (isObject2(state2)) removeFromObject(state2, key);
|
|
2426
2390
|
if (options.applyReset)
|
|
2427
|
-
return await state2.set(state2.parse(),
|
|
2391
|
+
return await state2.set(state2.parse(), __spreadValues({ replace: true }, options));
|
|
2428
2392
|
return await state2.update();
|
|
2429
2393
|
};
|
|
2430
2394
|
var set = async function(val, options = {}) {
|
|
2431
2395
|
const state2 = this;
|
|
2432
2396
|
const value = deepClone2(val);
|
|
2433
|
-
await state2.clean(
|
|
2397
|
+
await state2.clean(__spreadValues({ preventStateUpdate: true }, options));
|
|
2434
2398
|
await state2.replace(value, options);
|
|
2435
2399
|
return state2;
|
|
2436
2400
|
};
|
|
@@ -2447,7 +2411,7 @@ ${element}` : ""
|
|
|
2447
2411
|
const update3 = await changes.reduce(async (promacc, change) => {
|
|
2448
2412
|
const acc = await promacc;
|
|
2449
2413
|
if (change[0] === "update") {
|
|
2450
|
-
const result = await setByPath.call(state2, change[1], change[2],
|
|
2414
|
+
const result = await setByPath.call(state2, change[1], change[2], __spreadProps(__spreadValues({}, options), {
|
|
2451
2415
|
preventStateUpdate: true
|
|
2452
2416
|
}));
|
|
2453
2417
|
return overwriteDeep2(acc, result);
|
|
@@ -2485,13 +2449,13 @@ ${element}` : ""
|
|
|
2485
2449
|
var reset = async function(options = {}) {
|
|
2486
2450
|
const state2 = this;
|
|
2487
2451
|
const value = deepClone2(state2.parse());
|
|
2488
|
-
return await state2.set(value,
|
|
2452
|
+
return await state2.set(value, __spreadValues({ replace: true }, options));
|
|
2489
2453
|
};
|
|
2490
2454
|
var apply = async function(func, options = {}) {
|
|
2491
2455
|
const state2 = this;
|
|
2492
2456
|
if (isFunction2(func)) {
|
|
2493
2457
|
const value = func(state2);
|
|
2494
|
-
return await state2.update(value,
|
|
2458
|
+
return await state2.update(value, __spreadValues({ replace: true }, options));
|
|
2495
2459
|
}
|
|
2496
2460
|
};
|
|
2497
2461
|
var applyReplace = async function(func, options = {}) {
|
|
@@ -2507,12 +2471,12 @@ ${element}` : ""
|
|
|
2507
2471
|
const result = func(state2);
|
|
2508
2472
|
if (result instanceof Promise) await result;
|
|
2509
2473
|
else result;
|
|
2510
|
-
return await state2.update(state2.parse(),
|
|
2474
|
+
return await state2.update(state2.parse(), __spreadValues({ replace: true }, options));
|
|
2511
2475
|
}
|
|
2512
2476
|
};
|
|
2513
2477
|
var quietUpdate = async function(obj, options = {}) {
|
|
2514
2478
|
const state2 = this;
|
|
2515
|
-
return await state2.update(obj,
|
|
2479
|
+
return await state2.update(obj, __spreadValues({ preventUpdate: true }, options));
|
|
2516
2480
|
};
|
|
2517
2481
|
var replace = async function(obj, options = {}) {
|
|
2518
2482
|
const state2 = this;
|
|
@@ -2523,7 +2487,7 @@ ${element}` : ""
|
|
|
2523
2487
|
};
|
|
2524
2488
|
var quietReplace = async function(obj, options = {}) {
|
|
2525
2489
|
const state2 = this;
|
|
2526
|
-
return await state2.replace(obj,
|
|
2490
|
+
return await state2.replace(obj, __spreadValues({ preventUpdate: true }, options));
|
|
2527
2491
|
};
|
|
2528
2492
|
var keys2 = function(obj, options = {}) {
|
|
2529
2493
|
const state2 = this;
|
|
@@ -2614,25 +2578,25 @@ ${element}` : ""
|
|
|
2614
2578
|
});
|
|
2615
2579
|
return obj;
|
|
2616
2580
|
};
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2619
|
-
var
|
|
2620
|
-
var
|
|
2621
|
-
var
|
|
2622
|
-
var
|
|
2623
|
-
var
|
|
2624
|
-
var
|
|
2581
|
+
var __defProp3 = Object.defineProperty;
|
|
2582
|
+
var __defProps2 = Object.defineProperties;
|
|
2583
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
2584
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
2585
|
+
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
2586
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
2587
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2588
|
+
var __spreadValues2 = (a, b) => {
|
|
2625
2589
|
for (var prop in b || (b = {}))
|
|
2626
|
-
if (
|
|
2627
|
-
|
|
2628
|
-
if (
|
|
2629
|
-
for (var prop of
|
|
2630
|
-
if (
|
|
2631
|
-
|
|
2590
|
+
if (__hasOwnProp3.call(b, prop))
|
|
2591
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
2592
|
+
if (__getOwnPropSymbols2)
|
|
2593
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
2594
|
+
if (__propIsEnum2.call(b, prop))
|
|
2595
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
2632
2596
|
}
|
|
2633
2597
|
return a;
|
|
2634
2598
|
};
|
|
2635
|
-
var
|
|
2599
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
2636
2600
|
var STATE_UPDATE_OPTIONS = {
|
|
2637
2601
|
overwrite: true,
|
|
2638
2602
|
preventHoistElementUpdate: false,
|
|
@@ -2701,7 +2665,7 @@ ${element}` : ""
|
|
|
2701
2665
|
const changesValue = createNestedObjectByKeyPath(stateKey, passedValue);
|
|
2702
2666
|
const targetParent = findRootState || findGrandParentState || parent2.state;
|
|
2703
2667
|
if (options.replace) overwriteDeep2(targetParent, changesValue || value);
|
|
2704
|
-
await targetParent.update(changesValue,
|
|
2668
|
+
await targetParent.update(changesValue, __spreadValues2({
|
|
2705
2669
|
isHoisted: true,
|
|
2706
2670
|
preventUpdate: options.preventHoistElementUpdate,
|
|
2707
2671
|
overwrite: !options.replace
|
|
@@ -2724,14 +2688,14 @@ ${element}` : ""
|
|
|
2724
2688
|
if (options.preventUpdate !== true) {
|
|
2725
2689
|
return await element.update(
|
|
2726
2690
|
{},
|
|
2727
|
-
|
|
2691
|
+
__spreadProps2(__spreadValues2({}, options), {
|
|
2728
2692
|
updateByState: true
|
|
2729
2693
|
})
|
|
2730
2694
|
);
|
|
2731
2695
|
} else if (options.preventUpdate === "recursive") {
|
|
2732
2696
|
return await element.update(
|
|
2733
2697
|
{},
|
|
2734
|
-
|
|
2698
|
+
__spreadProps2(__spreadValues2({}, options), {
|
|
2735
2699
|
isHoisted: false,
|
|
2736
2700
|
updateByState: true,
|
|
2737
2701
|
preventUpdate: true
|
|
@@ -2739,25 +2703,25 @@ ${element}` : ""
|
|
|
2739
2703
|
);
|
|
2740
2704
|
}
|
|
2741
2705
|
};
|
|
2742
|
-
var
|
|
2743
|
-
var
|
|
2744
|
-
var
|
|
2745
|
-
var
|
|
2746
|
-
var
|
|
2747
|
-
var
|
|
2748
|
-
var
|
|
2749
|
-
var
|
|
2706
|
+
var __defProp4 = Object.defineProperty;
|
|
2707
|
+
var __defProps3 = Object.defineProperties;
|
|
2708
|
+
var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
|
|
2709
|
+
var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
|
|
2710
|
+
var __hasOwnProp4 = Object.prototype.hasOwnProperty;
|
|
2711
|
+
var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
|
|
2712
|
+
var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2713
|
+
var __spreadValues3 = (a, b) => {
|
|
2750
2714
|
for (var prop in b || (b = {}))
|
|
2751
|
-
if (
|
|
2752
|
-
|
|
2753
|
-
if (
|
|
2754
|
-
for (var prop of
|
|
2755
|
-
if (
|
|
2756
|
-
|
|
2715
|
+
if (__hasOwnProp4.call(b, prop))
|
|
2716
|
+
__defNormalProp3(a, prop, b[prop]);
|
|
2717
|
+
if (__getOwnPropSymbols3)
|
|
2718
|
+
for (var prop of __getOwnPropSymbols3(b)) {
|
|
2719
|
+
if (__propIsEnum3.call(b, prop))
|
|
2720
|
+
__defNormalProp3(a, prop, b[prop]);
|
|
2757
2721
|
}
|
|
2758
2722
|
return a;
|
|
2759
2723
|
};
|
|
2760
|
-
var
|
|
2724
|
+
var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
|
|
2761
2725
|
var createState = async function(element, parent2, options) {
|
|
2762
2726
|
element.state = await applyInitialState(element, parent2, options);
|
|
2763
2727
|
return element.state;
|
|
@@ -2787,13 +2751,13 @@ ${element}` : ""
|
|
|
2787
2751
|
if (!origState) return;
|
|
2788
2752
|
const dependentState = deepClone2(origState, IGNORE_STATE_PARAMS2);
|
|
2789
2753
|
const newDepends = { [element.key + Math.random()]: dependentState };
|
|
2790
|
-
const __depends = isObject2(origState.__depends) ?
|
|
2754
|
+
const __depends = isObject2(origState.__depends) ? __spreadValues3(__spreadValues3({}, origState.__depends), newDepends) : newDepends;
|
|
2791
2755
|
if (Array.isArray(origState)) {
|
|
2792
|
-
addProtoToArray(origState,
|
|
2756
|
+
addProtoToArray(origState, __spreadProps3(__spreadValues3({}, Object.getPrototypeOf(origState)), {
|
|
2793
2757
|
__depends
|
|
2794
2758
|
}));
|
|
2795
2759
|
} else {
|
|
2796
|
-
Object.setPrototypeOf(origState,
|
|
2760
|
+
Object.setPrototypeOf(origState, __spreadProps3(__spreadValues3({}, Object.getPrototypeOf(origState)), {
|
|
2797
2761
|
__depends
|
|
2798
2762
|
}));
|
|
2799
2763
|
}
|
|
@@ -3173,9 +3137,6 @@ ${element}` : ""
|
|
|
3173
3137
|
(options.strict ? merge2 : overwrite)(proto, element.context.methods);
|
|
3174
3138
|
Object.setPrototypeOf(element, proto);
|
|
3175
3139
|
};
|
|
3176
|
-
var NODE_ENV22 = "development";
|
|
3177
|
-
var isProduction22 = (env = NODE_ENV22) => env === "production";
|
|
3178
|
-
var isNotProduction22 = (env = NODE_ENV22) => !isProduction22(env);
|
|
3179
3140
|
var create = async (element, parent2, key, options = OPTIONS.create || {}, attachOptions) => {
|
|
3180
3141
|
const isValid = validateElement(element, options);
|
|
3181
3142
|
if (!isValid) {
|
|
@@ -3237,7 +3198,7 @@ ${element}` : ""
|
|
|
3237
3198
|
};
|
|
3238
3199
|
var createBasedOnType = (element, parent2, key, options) => {
|
|
3239
3200
|
if (element === void 0) {
|
|
3240
|
-
if (
|
|
3201
|
+
if (isNotProduction2()) {
|
|
3241
3202
|
console.warn(
|
|
3242
3203
|
key,
|
|
3243
3204
|
"element is undefined in",
|
|
@@ -3247,7 +3208,7 @@ ${element}` : ""
|
|
|
3247
3208
|
return {};
|
|
3248
3209
|
}
|
|
3249
3210
|
if (isString2(key) && key.slice(0, false)) {
|
|
3250
|
-
if (
|
|
3211
|
+
if (isNotProduction2()) {
|
|
3251
3212
|
console.warn(key, "seems like to be in __ref");
|
|
3252
3213
|
}
|
|
3253
3214
|
}
|
|
@@ -3365,7 +3326,7 @@ ${element}` : ""
|
|
|
3365
3326
|
var renderElement = async (element, parent2, options, attachOptions) => {
|
|
3366
3327
|
var _a, _b, _c, _d;
|
|
3367
3328
|
if (visitedElements.has(element)) {
|
|
3368
|
-
if (
|
|
3329
|
+
if (isNotProduction2())
|
|
3369
3330
|
console.warn("Cyclic rendering detected:", element.__ref.path);
|
|
3370
3331
|
}
|
|
3371
3332
|
visitedElements.set(element, true);
|
|
@@ -3376,7 +3337,7 @@ ${element}` : ""
|
|
|
3376
3337
|
await createNode(element, options);
|
|
3377
3338
|
ref.__uniqId = Math.random();
|
|
3378
3339
|
};
|
|
3379
|
-
if (
|
|
3340
|
+
if (isNotProduction2()) {
|
|
3380
3341
|
await createNestedChild();
|
|
3381
3342
|
} else {
|
|
3382
3343
|
try {
|
|
@@ -3908,8 +3869,6 @@ ${element}` : ""
|
|
|
3908
3869
|
stateKeys: []
|
|
3909
3870
|
};
|
|
3910
3871
|
function temporaryDomqlHack(value) {
|
|
3911
|
-
var _a;
|
|
3912
|
-
if (this && !((_a = this.getUserSettings) == null ? void 0 : _a.call(this, "useDomql3"))) return value;
|
|
3913
3872
|
let obj = { ...value };
|
|
3914
3873
|
const on = obj.on;
|
|
3915
3874
|
if (this.call("isObject", on)) {
|
|
@@ -3938,8 +3897,6 @@ ${element}` : ""
|
|
|
3938
3897
|
return { ...extendObj, ...obj };
|
|
3939
3898
|
}
|
|
3940
3899
|
function temporaryDomqlHackReverse(value) {
|
|
3941
|
-
var _a;
|
|
3942
|
-
if (this && !((_a = this.getUserSettings) == null ? void 0 : _a.call(this, "useDomql3"))) return value;
|
|
3943
3900
|
const obj = { ...value };
|
|
3944
3901
|
if (obj.extends) {
|
|
3945
3902
|
obj.extend = obj.extends;
|
|
@@ -4041,21 +3998,21 @@ __export(system_exports, {
|
|
|
4041
3998
|
});
|
|
4042
3999
|
module.exports = __toCommonJS(system_exports);
|
|
4043
4000
|
|
|
4044
|
-
// ../../../domql/packages/utils/
|
|
4001
|
+
// ../../../domql/packages/utils/env.js
|
|
4045
4002
|
var NODE_ENV = "development";
|
|
4046
4003
|
var isProduction = (env = NODE_ENV) => env === "production";
|
|
4047
4004
|
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
4048
4005
|
|
|
4049
|
-
// ../../../domql/packages/utils/
|
|
4006
|
+
// ../../../domql/packages/utils/globals.js
|
|
4050
4007
|
var window2 = globalThis;
|
|
4051
4008
|
var document2 = window2.document;
|
|
4052
4009
|
|
|
4053
|
-
// ../../../domql/packages/utils/
|
|
4010
|
+
// ../../../domql/packages/utils/node.js
|
|
4054
4011
|
var isDOMNode = (obj) => {
|
|
4055
4012
|
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
4056
4013
|
};
|
|
4057
4014
|
|
|
4058
|
-
// ../../../domql/packages/utils/
|
|
4015
|
+
// ../../../domql/packages/utils/types.js
|
|
4059
4016
|
var isObject = (arg) => {
|
|
4060
4017
|
if (arg === null) return false;
|
|
4061
4018
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -4073,7 +4030,7 @@ var isUndefined = (arg) => {
|
|
|
4073
4030
|
return arg === void 0;
|
|
4074
4031
|
};
|
|
4075
4032
|
|
|
4076
|
-
// ../../../domql/packages/utils/
|
|
4033
|
+
// ../../../domql/packages/utils/array.js
|
|
4077
4034
|
var mergeArray = (arr, exclude = []) => {
|
|
4078
4035
|
return arr.reduce(
|
|
4079
4036
|
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
@@ -4081,30 +4038,11 @@ var mergeArray = (arr, exclude = []) => {
|
|
|
4081
4038
|
);
|
|
4082
4039
|
};
|
|
4083
4040
|
|
|
4084
|
-
// ../../../domql/packages/utils/
|
|
4085
|
-
var __defProp2 = Object.defineProperty;
|
|
4086
|
-
var __defProps = Object.defineProperties;
|
|
4087
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4088
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4089
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
4090
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4091
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4092
|
-
var __spreadValues = (a, b) => {
|
|
4093
|
-
for (var prop in b || (b = {}))
|
|
4094
|
-
if (__hasOwnProp2.call(b, prop))
|
|
4095
|
-
__defNormalProp(a, prop, b[prop]);
|
|
4096
|
-
if (__getOwnPropSymbols)
|
|
4097
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
4098
|
-
if (__propIsEnum.call(b, prop))
|
|
4099
|
-
__defNormalProp(a, prop, b[prop]);
|
|
4100
|
-
}
|
|
4101
|
-
return a;
|
|
4102
|
-
};
|
|
4103
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
4041
|
+
// ../../../domql/packages/utils/object.js
|
|
4104
4042
|
var merge = (element, obj, excludeFrom = []) => {
|
|
4105
4043
|
for (const e in obj) {
|
|
4106
|
-
const
|
|
4107
|
-
if (!
|
|
4044
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, e);
|
|
4045
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
|
|
4108
4046
|
continue;
|
|
4109
4047
|
const elementProp = element[e];
|
|
4110
4048
|
const objProp = obj[e];
|
|
@@ -4116,8 +4054,8 @@ var merge = (element, obj, excludeFrom = []) => {
|
|
|
4116
4054
|
};
|
|
4117
4055
|
var deepMerge = (element, extend, excludeFrom = [], level = Infinity) => {
|
|
4118
4056
|
for (const e in extend) {
|
|
4119
|
-
const
|
|
4120
|
-
if (!
|
|
4057
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty.call(extend, e);
|
|
4058
|
+
if (!hasOwnProperty || excludeFrom.includes(e) || e.startsWith("__"))
|
|
4121
4059
|
continue;
|
|
4122
4060
|
const elementProp = element[e];
|
|
4123
4061
|
const extendProp = extend[e];
|
|
@@ -4152,8 +4090,8 @@ var deepClone = (obj, options = {}) => {
|
|
|
4152
4090
|
if (visited.has(obj)) {
|
|
4153
4091
|
return visited.get(obj);
|
|
4154
4092
|
}
|
|
4155
|
-
const
|
|
4156
|
-
visited.set(obj,
|
|
4093
|
+
const clone = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
4094
|
+
visited.set(obj, clone);
|
|
4157
4095
|
for (const key in obj) {
|
|
4158
4096
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
4159
4097
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
@@ -4162,15 +4100,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
4162
4100
|
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
4163
4101
|
continue;
|
|
4164
4102
|
if (isDOMNode(value)) {
|
|
4165
|
-
|
|
4103
|
+
clone[key] = value;
|
|
4166
4104
|
continue;
|
|
4167
4105
|
}
|
|
4168
4106
|
if (handleExtend && key === "extend" && isArray(value)) {
|
|
4169
|
-
|
|
4107
|
+
clone[key] = mergeArray(value, exclude);
|
|
4170
4108
|
continue;
|
|
4171
4109
|
}
|
|
4172
4110
|
if (isFunction(value) && options.window) {
|
|
4173
|
-
|
|
4111
|
+
clone[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
4174
4112
|
continue;
|
|
4175
4113
|
}
|
|
4176
4114
|
if ((value == null ? void 0 : value.__ref) && (value == null ? void 0 : value.node)) {
|
|
@@ -4181,14 +4119,15 @@ var deepClone = (obj, options = {}) => {
|
|
|
4181
4119
|
}
|
|
4182
4120
|
if (isObjectLike(value)) {
|
|
4183
4121
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
4184
|
-
|
|
4122
|
+
clone[key] = deepClone(value, {
|
|
4123
|
+
...options,
|
|
4185
4124
|
visited
|
|
4186
|
-
})
|
|
4125
|
+
});
|
|
4187
4126
|
} else {
|
|
4188
|
-
|
|
4127
|
+
clone[key] = value;
|
|
4189
4128
|
}
|
|
4190
4129
|
}
|
|
4191
|
-
return
|
|
4130
|
+
return clone;
|
|
4192
4131
|
};
|
|
4193
4132
|
var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
4194
4133
|
const excl = opts.exclude || [];
|
|
@@ -4214,7 +4153,7 @@ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakM
|
|
|
4214
4153
|
return obj;
|
|
4215
4154
|
};
|
|
4216
4155
|
|
|
4217
|
-
// ../../../domql/packages/utils/
|
|
4156
|
+
// ../../../domql/packages/utils/cookie.js
|
|
4218
4157
|
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
4219
4158
|
|
|
4220
4159
|
// src/defaultConfig/index.js
|