@player-ui/check-path-plugin 0.13.0 → 0.14.0-next.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.
|
@@ -45,6 +45,10 @@ function _async_to_generator(fn) {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
+
function _call_super(_this, derived, args) {
|
|
49
|
+
derived = _get_prototype_of(derived);
|
|
50
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
51
|
+
}
|
|
48
52
|
function _class_call_check(instance, Constructor) {
|
|
49
53
|
if (!(instance instanceof Constructor)) {
|
|
50
54
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -283,31 +287,15 @@ function _wrap_native_super(Class) {
|
|
|
283
287
|
return _wrap_native_super(Class);
|
|
284
288
|
}
|
|
285
289
|
function _is_native_reflect_construct() {
|
|
286
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
287
|
-
if (Reflect.construct.sham) return false;
|
|
288
|
-
if (typeof Proxy === "function") return true;
|
|
289
290
|
try {
|
|
290
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function _create_super(Derived) {
|
|
297
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
298
|
-
return function _createSuperInternal() {
|
|
299
|
-
var Super = _get_prototype_of(Derived), result;
|
|
300
|
-
if (hasNativeReflectConstruct) {
|
|
301
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
302
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
303
|
-
} else {
|
|
304
|
-
result = Super.apply(this, arguments);
|
|
305
|
-
}
|
|
306
|
-
return _possible_constructor_return(this, result);
|
|
307
|
-
};
|
|
291
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
292
|
+
} catch (_) {}
|
|
293
|
+
return (_is_native_reflect_construct = function() {
|
|
294
|
+
return !!result;
|
|
295
|
+
})();
|
|
308
296
|
}
|
|
309
297
|
function _ts_generator(thisArg, body) {
|
|
310
|
-
var f, y, t,
|
|
298
|
+
var f, y, t, _ = {
|
|
311
299
|
label: 0,
|
|
312
300
|
sent: function() {
|
|
313
301
|
if (t[0] & 1) throw t[1];
|
|
@@ -315,12 +303,8 @@ function _ts_generator(thisArg, body) {
|
|
|
315
303
|
},
|
|
316
304
|
trys: [],
|
|
317
305
|
ops: []
|
|
318
|
-
};
|
|
319
|
-
return g = {
|
|
320
|
-
next: verb(0),
|
|
321
|
-
"throw": verb(1),
|
|
322
|
-
"return": verb(2)
|
|
323
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
306
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
307
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
324
308
|
return this;
|
|
325
309
|
}), g;
|
|
326
310
|
function verb(n) {
|
|
@@ -333,7 +317,7 @@ function _ts_generator(thisArg, body) {
|
|
|
333
317
|
}
|
|
334
318
|
function step(op) {
|
|
335
319
|
if (f) throw new TypeError("Generator is already executing.");
|
|
336
|
-
while(_)try {
|
|
320
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
337
321
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
338
322
|
if (y = 0, t) op = [
|
|
339
323
|
op[0] & 2,
|
|
@@ -505,7 +489,7 @@ var CheckPathPlugin = function() {
|
|
|
505
489
|
};
|
|
506
490
|
var findInArray = function findInArray(array, key, value) {
|
|
507
491
|
return array.findIndex(function(obj) {
|
|
508
|
-
if (obj && typeof obj === "object") {
|
|
492
|
+
if (obj && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
509
493
|
return obj[key] == value;
|
|
510
494
|
}
|
|
511
495
|
return false;
|
|
@@ -599,7 +583,7 @@ var CheckPathPlugin = function() {
|
|
|
599
583
|
};
|
|
600
584
|
};
|
|
601
585
|
var isExpressionNode = function isExpressionNode(x) {
|
|
602
|
-
return typeof x === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
|
|
586
|
+
return (typeof x === "undefined" ? "undefined" : _type_of(x)) === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
|
|
603
587
|
};
|
|
604
588
|
var throwError = function throwError(message, index) {
|
|
605
589
|
var err = new Error("".concat(message, " at character ").concat(index));
|
|
@@ -1187,7 +1171,7 @@ var CheckPathPlugin = function() {
|
|
|
1187
1171
|
var isPromiseLike = function isPromiseLike(value) {
|
|
1188
1172
|
var // Check for standard Promise constructor name
|
|
1189
1173
|
_value_constructor;
|
|
1190
|
-
return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
|
|
1174
|
+
return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && typeof value.then === "function" && // Additional safeguards against false positives
|
|
1191
1175
|
(_instanceof(value, Promise) || ((_value_constructor = value.constructor) === null || _value_constructor === void 0 ? void 0 : _value_constructor.name) === "Promise" || // Verify it has other Promise-like methods to reduce false positives
|
|
1192
1176
|
typeof value.catch === "function" && typeof value.finally === "function");
|
|
1193
1177
|
};
|
|
@@ -1202,7 +1186,7 @@ var CheckPathPlugin = function() {
|
|
|
1202
1186
|
if (isExpressionNode(expr)) {
|
|
1203
1187
|
return false;
|
|
1204
1188
|
}
|
|
1205
|
-
return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
|
|
1189
|
+
return (typeof expr === "undefined" ? "undefined" : _type_of(expr)) === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
|
|
1206
1190
|
};
|
|
1207
1191
|
var makePromiseAwareBinaryOp = function makePromiseAwareBinaryOp(operation) {
|
|
1208
1192
|
return function(a, b, async) {
|
|
@@ -1419,7 +1403,7 @@ var CheckPathPlugin = function() {
|
|
|
1419
1403
|
if (!node) {
|
|
1420
1404
|
return;
|
|
1421
1405
|
}
|
|
1422
|
-
if ("value" in node &&
|
|
1406
|
+
if ("value" in node && _type_of(node.value) === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
|
|
1423
1407
|
return node.value.id;
|
|
1424
1408
|
}
|
|
1425
1409
|
};
|
|
@@ -1454,22 +1438,6 @@ var CheckPathPlugin = function() {
|
|
|
1454
1438
|
}
|
|
1455
1439
|
});
|
|
1456
1440
|
};
|
|
1457
|
-
var unpackNode = function unpackNode(item) {
|
|
1458
|
-
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1459
|
-
var unpacked = [];
|
|
1460
|
-
if ("children" in item && ((_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.value.type) === "asset" && ((_item_children1 = item.children) === null || _item_children1 === void 0 ? void 0 : (_item_children_1 = _item_children1[0]) === null || _item_children_1 === void 0 ? void 0 : _item_children_1.value).children) {
|
|
1461
|
-
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1462
|
-
if (((_item_children__value_children = ((_item_children2 = item.children) === null || _item_children2 === void 0 ? void 0 : (_item_children_2 = _item_children2[0]) === null || _item_children_2 === void 0 ? void 0 : _item_children_2.value).children) === null || _item_children__value_children === void 0 ? void 0 : (_item_children__value_children_ = _item_children__value_children[0]) === null || _item_children__value_children_ === void 0 ? void 0 : _item_children__value_children_.value.type) === "multi-node") {
|
|
1463
|
-
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1464
|
-
((_item_children__value_children1 = ((_item_children3 = item.children) === null || _item_children3 === void 0 ? void 0 : (_item_children_3 = _item_children3[0]) === null || _item_children_3 === void 0 ? void 0 : _item_children_3.value).children) === null || _item_children__value_children1 === void 0 ? void 0 : (_item_children__value_children_1 = _item_children__value_children1[0]) === null || _item_children__value_children_1 === void 0 ? void 0 : _item_children__value_children_1.value).values.forEach(function(value) {
|
|
1465
|
-
unpacked.push(value);
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
} else {
|
|
1469
|
-
unpacked.push(item);
|
|
1470
|
-
}
|
|
1471
|
-
return unpacked;
|
|
1472
|
-
};
|
|
1473
1441
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1474
1442
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1475
1443
|
};
|
|
@@ -1569,7 +1537,7 @@ var CheckPathPlugin = function() {
|
|
|
1569
1537
|
});
|
|
1570
1538
|
};
|
|
1571
1539
|
var __copyProps = function(to, from, except, desc) {
|
|
1572
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1540
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1573
1541
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1574
1542
|
try {
|
|
1575
1543
|
var _loop = function() {
|
|
@@ -1624,15 +1592,16 @@ var CheckPathPlugin = function() {
|
|
|
1624
1592
|
exports.toError = exports.NestedError = void 0;
|
|
1625
1593
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1626
1594
|
_inherits(_NestedError, Error1);
|
|
1627
|
-
var _super = _create_super(_NestedError);
|
|
1628
1595
|
function _NestedError(message) {
|
|
1629
1596
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1630
1597
|
innerErrors[_key - 1] = arguments[_key];
|
|
1631
1598
|
}
|
|
1632
1599
|
_class_call_check(this, _NestedError);
|
|
1633
1600
|
var _this;
|
|
1634
|
-
_this =
|
|
1635
|
-
|
|
1601
|
+
_this = _call_super(this, _NestedError, [
|
|
1602
|
+
message
|
|
1603
|
+
]);
|
|
1604
|
+
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1636
1605
|
if (innerErrors.length === 1) {
|
|
1637
1606
|
var innerError = toError(innerErrors[0]);
|
|
1638
1607
|
_this.innerErrors = [
|
|
@@ -1768,7 +1737,7 @@ var CheckPathPlugin = function() {
|
|
|
1768
1737
|
return out;
|
|
1769
1738
|
}
|
|
1770
1739
|
function isObject(o) {
|
|
1771
|
-
return o != null && typeof o === "object";
|
|
1740
|
+
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1772
1741
|
}
|
|
1773
1742
|
function addLast2(array, val) {
|
|
1774
1743
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2111,7 +2080,7 @@ var CheckPathPlugin = function() {
|
|
|
2111
2080
|
else return 0;
|
|
2112
2081
|
}
|
|
2113
2082
|
}();
|
|
2114
|
-
if (typeof module === "object") module.exports = SortedArray2;
|
|
2083
|
+
if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
|
|
2115
2084
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2116
2085
|
return SortedArray2;
|
|
2117
2086
|
});
|
|
@@ -2308,10 +2277,9 @@ var CheckPathPlugin = function() {
|
|
|
2308
2277
|
}();
|
|
2309
2278
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2310
2279
|
_inherits(SyncHook, Hook);
|
|
2311
|
-
var _super = _create_super(SyncHook);
|
|
2312
2280
|
function SyncHook() {
|
|
2313
2281
|
_class_call_check(this, SyncHook);
|
|
2314
|
-
return
|
|
2282
|
+
return _call_super(this, SyncHook, arguments);
|
|
2315
2283
|
}
|
|
2316
2284
|
_create_class(SyncHook, [
|
|
2317
2285
|
{
|
|
@@ -2344,10 +2312,9 @@ var CheckPathPlugin = function() {
|
|
|
2344
2312
|
}(Hook);
|
|
2345
2313
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2346
2314
|
_inherits(SyncBailHook, Hook);
|
|
2347
|
-
var _super = _create_super(SyncBailHook);
|
|
2348
2315
|
function SyncBailHook() {
|
|
2349
2316
|
_class_call_check(this, SyncBailHook);
|
|
2350
|
-
return
|
|
2317
|
+
return _call_super(this, SyncBailHook, arguments);
|
|
2351
2318
|
}
|
|
2352
2319
|
_create_class(SyncBailHook, [
|
|
2353
2320
|
{
|
|
@@ -2379,10 +2346,9 @@ var CheckPathPlugin = function() {
|
|
|
2379
2346
|
}(Hook);
|
|
2380
2347
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2381
2348
|
_inherits(SyncWaterfallHook, Hook);
|
|
2382
|
-
var _super = _create_super(SyncWaterfallHook);
|
|
2383
2349
|
function SyncWaterfallHook() {
|
|
2384
2350
|
_class_call_check(this, SyncWaterfallHook);
|
|
2385
|
-
return
|
|
2351
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
2386
2352
|
}
|
|
2387
2353
|
_create_class(SyncWaterfallHook, [
|
|
2388
2354
|
{
|
|
@@ -2444,7 +2410,7 @@ var CheckPathPlugin = function() {
|
|
|
2444
2410
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2445
2411
|
len = _step.value;
|
|
2446
2412
|
tmp = len;
|
|
2447
|
-
if (tmp && typeof tmp === "object") {
|
|
2413
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2448
2414
|
tmp = find(bar, tmp);
|
|
2449
2415
|
if (!tmp) return false;
|
|
2450
2416
|
}
|
|
@@ -2475,7 +2441,7 @@ var CheckPathPlugin = function() {
|
|
|
2475
2441
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2476
2442
|
len = _step1.value;
|
|
2477
2443
|
tmp = len[0];
|
|
2478
|
-
if (tmp && typeof tmp === "object") {
|
|
2444
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2479
2445
|
tmp = find(bar, tmp);
|
|
2480
2446
|
if (!tmp) return false;
|
|
2481
2447
|
}
|
|
@@ -2514,7 +2480,7 @@ var CheckPathPlugin = function() {
|
|
|
2514
2480
|
}
|
|
2515
2481
|
return len === -1;
|
|
2516
2482
|
}
|
|
2517
|
-
if (!ctor || typeof foo === "object") {
|
|
2483
|
+
if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
|
|
2518
2484
|
len = 0;
|
|
2519
2485
|
for(ctor in foo){
|
|
2520
2486
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -2547,7 +2513,7 @@ var CheckPathPlugin = function() {
|
|
|
2547
2513
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2548
2514
|
key
|
|
2549
2515
|
]);
|
|
2550
|
-
if (typeof val === "object") {
|
|
2516
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
2551
2517
|
traverseObj(val, nestedPath, pairs);
|
|
2552
2518
|
} else {
|
|
2553
2519
|
pairs.set(nestedPath, val);
|
|
@@ -2588,7 +2554,7 @@ var CheckPathPlugin = function() {
|
|
|
2588
2554
|
{
|
|
2589
2555
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
2590
2556
|
value: function set(match, value) {
|
|
2591
|
-
var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2557
|
+
var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2592
2558
|
this.store.insert({
|
|
2593
2559
|
key: match,
|
|
2594
2560
|
value: value,
|
|
@@ -2751,6 +2717,7 @@ var CheckPathPlugin = function() {
|
|
|
2751
2717
|
}
|
|
2752
2718
|
};
|
|
2753
2719
|
var identifier = function() {
|
|
2720
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2754
2721
|
if (!isIdentifierChar(ch)) {
|
|
2755
2722
|
return;
|
|
2756
2723
|
}
|
|
@@ -2761,6 +2728,14 @@ var CheckPathPlugin = function() {
|
|
|
2761
2728
|
}
|
|
2762
2729
|
value += ch;
|
|
2763
2730
|
}
|
|
2731
|
+
if (allowBoolValue) {
|
|
2732
|
+
if (value === "true") {
|
|
2733
|
+
return toValue(true);
|
|
2734
|
+
}
|
|
2735
|
+
if (value === "false") {
|
|
2736
|
+
return toValue(false);
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2764
2739
|
if (value) {
|
|
2765
2740
|
var maybeNumber = Number(value);
|
|
2766
2741
|
value = isNaN(maybeNumber) ? value : maybeNumber;
|
|
@@ -2809,8 +2784,9 @@ var CheckPathPlugin = function() {
|
|
|
2809
2784
|
}
|
|
2810
2785
|
};
|
|
2811
2786
|
var simpleSegment = function() {
|
|
2787
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2812
2788
|
var _nestedPath, _ref;
|
|
2813
|
-
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier();
|
|
2789
|
+
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
|
|
2814
2790
|
};
|
|
2815
2791
|
var segment = function() {
|
|
2816
2792
|
var segments = [];
|
|
@@ -2825,6 +2801,7 @@ var CheckPathPlugin = function() {
|
|
|
2825
2801
|
return toConcatenatedNode(segments);
|
|
2826
2802
|
};
|
|
2827
2803
|
var optionallyQuotedSegment = function() {
|
|
2804
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2828
2805
|
whitespace();
|
|
2829
2806
|
if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
|
|
2830
2807
|
var singleQuote = ch === SINGLE_QUOTE;
|
|
@@ -2833,7 +2810,7 @@ var CheckPathPlugin = function() {
|
|
|
2833
2810
|
next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
|
|
2834
2811
|
return id;
|
|
2835
2812
|
}
|
|
2836
|
-
return simpleSegment();
|
|
2813
|
+
return simpleSegment(allowBoolValue);
|
|
2837
2814
|
};
|
|
2838
2815
|
var equals = function() {
|
|
2839
2816
|
if (ch !== EQUALS) {
|
|
@@ -2853,7 +2830,7 @@ var CheckPathPlugin = function() {
|
|
|
2853
2830
|
whitespace();
|
|
2854
2831
|
if (equals()) {
|
|
2855
2832
|
whitespace();
|
|
2856
|
-
var second = optionallyQuotedSegment();
|
|
2833
|
+
var second = optionallyQuotedSegment(true);
|
|
2857
2834
|
value = toQuery(value, second);
|
|
2858
2835
|
whitespace();
|
|
2859
2836
|
}
|
|
@@ -3041,7 +3018,7 @@ var CheckPathPlugin = function() {
|
|
|
3041
3018
|
appendPathSegments(getValueForNode(resolvedNode));
|
|
3042
3019
|
break;
|
|
3043
3020
|
case "Value":
|
|
3044
|
-
appendPathSegments(resolvedNode.value);
|
|
3021
|
+
appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
|
|
3045
3022
|
break;
|
|
3046
3023
|
case "Query":
|
|
3047
3024
|
{
|
|
@@ -3117,7 +3094,7 @@ var CheckPathPlugin = function() {
|
|
|
3117
3094
|
var _this_parseCache_path;
|
|
3118
3095
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3119
3096
|
this.parseCache[path] = ast;
|
|
3120
|
-
if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3097
|
+
if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3121
3098
|
var _ast_error;
|
|
3122
3099
|
throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((_ast_error = ast === null || ast === void 0 ? void 0 : ast.error) !== null && _ast_error !== void 0 ? _ast_error : "Unknown Error."));
|
|
3123
3100
|
}
|
|
@@ -3317,14 +3294,13 @@ var CheckPathPlugin = function() {
|
|
|
3317
3294
|
}();
|
|
3318
3295
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3319
3296
|
_inherits(DependencyModel, DependencyTracker);
|
|
3320
|
-
var _super = _create_super(DependencyModel);
|
|
3321
3297
|
function DependencyModel(rootModel) {
|
|
3322
3298
|
_class_call_check(this, DependencyModel);
|
|
3323
3299
|
var _this;
|
|
3324
|
-
_this =
|
|
3300
|
+
_this = _call_super(this, DependencyModel);
|
|
3325
3301
|
_this.rootModel = rootModel;
|
|
3326
|
-
_this.set = _this.set.bind(
|
|
3327
|
-
_this.get = _this.get.bind(
|
|
3302
|
+
_this.set = _this.set.bind(_this);
|
|
3303
|
+
_this.get = _this.get.bind(_this);
|
|
3328
3304
|
return _this;
|
|
3329
3305
|
}
|
|
3330
3306
|
_create_class(DependencyModel, [
|
|
@@ -3868,23 +3844,20 @@ var CheckPathPlugin = function() {
|
|
|
3868
3844
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3869
3845
|
*/ key: "evaluateAsync",
|
|
3870
3846
|
value: function evaluateAsync(expr, options) {
|
|
3847
|
+
var _this = this;
|
|
3871
3848
|
if (Array.isArray(expr)) {
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
var _ref = _async_to_generator(function(exp) {
|
|
3849
|
+
return collateAwaitable(expr.map(function(exp) {
|
|
3850
|
+
return _async_to_generator(function() {
|
|
3875
3851
|
return _ts_generator(this, function(_state) {
|
|
3876
3852
|
return [
|
|
3877
3853
|
2,
|
|
3878
|
-
|
|
3854
|
+
this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3879
3855
|
async: true
|
|
3880
3856
|
}))
|
|
3881
3857
|
];
|
|
3882
3858
|
});
|
|
3883
|
-
});
|
|
3884
|
-
|
|
3885
|
-
return _ref.apply(this, arguments);
|
|
3886
|
-
};
|
|
3887
|
-
}())).awaitableThen(function(values) {
|
|
3859
|
+
}).call(_this);
|
|
3860
|
+
})).awaitableThen(function(values) {
|
|
3888
3861
|
return values.pop();
|
|
3889
3862
|
});
|
|
3890
3863
|
} else {
|
|
@@ -4621,23 +4594,8 @@ var CheckPathPlugin = function() {
|
|
|
4621
4594
|
function Parser() {
|
|
4622
4595
|
_class_call_check(this, Parser);
|
|
4623
4596
|
this.hooks = {
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
*
|
|
4627
|
-
* @param value - The object we're are about to parse
|
|
4628
|
-
* @returns - A new value to parse.
|
|
4629
|
-
* If undefined, the original value is used.
|
|
4630
|
-
* If null, we stop parsing this node.
|
|
4631
|
-
*/ onParseObject: new SyncWaterfallHook(),
|
|
4632
|
-
/**
|
|
4633
|
-
* A callback to interact with an AST _after_ we parse it into the AST
|
|
4634
|
-
*
|
|
4635
|
-
* @param value - The object we parsed
|
|
4636
|
-
* @param node - The AST node we generated
|
|
4637
|
-
* @returns - A new AST node to use
|
|
4638
|
-
* If undefined, the original value is used.
|
|
4639
|
-
* If null, we ignore this node all together
|
|
4640
|
-
*/ onCreateASTNode: new SyncWaterfallHook(),
|
|
4597
|
+
onParseObject: new SyncWaterfallHook(),
|
|
4598
|
+
onCreateASTNode: new SyncWaterfallHook(),
|
|
4641
4599
|
parseNode: new SyncBailHook()
|
|
4642
4600
|
};
|
|
4643
4601
|
}
|
|
@@ -4675,7 +4633,7 @@ var CheckPathPlugin = function() {
|
|
|
4675
4633
|
}
|
|
4676
4634
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4677
4635
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4678
|
-
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4636
|
+
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4679
4637
|
return {
|
|
4680
4638
|
value: objToParse,
|
|
4681
4639
|
children: []
|
|
@@ -4712,7 +4670,7 @@ var CheckPathPlugin = function() {
|
|
|
4712
4670
|
if (newChildren) {
|
|
4713
4671
|
var _children2;
|
|
4714
4672
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4715
|
-
} else if (localValue && typeof localValue === "object") {
|
|
4673
|
+
} else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
|
|
4716
4674
|
var _children21;
|
|
4717
4675
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4718
4676
|
localKey
|
|
@@ -4779,20 +4737,14 @@ var CheckPathPlugin = function() {
|
|
|
4779
4737
|
function Resolver(root, options) {
|
|
4780
4738
|
_class_call_check(this, Resolver);
|
|
4781
4739
|
this.hooks = {
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
*/ resolve: new SyncWaterfallHook(),
|
|
4791
|
-
/**
|
|
4792
|
-
* A hook to transform the resolved value of an AST node.
|
|
4793
|
-
* This runs _after_ all children nodes are resolved
|
|
4794
|
-
*/ afterResolve: new SyncWaterfallHook(),
|
|
4795
|
-
/** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
|
|
4740
|
+
skipResolve: new SyncWaterfallHook(),
|
|
4741
|
+
beforeUpdate: new SyncHook(),
|
|
4742
|
+
afterUpdate: new SyncHook(),
|
|
4743
|
+
resolveOptions: new SyncWaterfallHook(),
|
|
4744
|
+
beforeResolve: new SyncWaterfallHook(),
|
|
4745
|
+
resolve: new SyncWaterfallHook(),
|
|
4746
|
+
afterResolve: new SyncWaterfallHook(),
|
|
4747
|
+
afterNodeUpdate: new SyncHook()
|
|
4796
4748
|
};
|
|
4797
4749
|
this.root = root;
|
|
4798
4750
|
this.options = options;
|
|
@@ -4800,6 +4752,7 @@ var CheckPathPlugin = function() {
|
|
|
4800
4752
|
this.ASTMap = /* @__PURE__ */ new Map();
|
|
4801
4753
|
this.logger = options.logger;
|
|
4802
4754
|
this.idCache = /* @__PURE__ */ new Set();
|
|
4755
|
+
this.AsyncIdMap = /* @__PURE__ */ new Map();
|
|
4803
4756
|
}
|
|
4804
4757
|
_create_class(Resolver, [
|
|
4805
4758
|
{
|
|
@@ -4810,13 +4763,27 @@ var CheckPathPlugin = function() {
|
|
|
4810
4763
|
},
|
|
4811
4764
|
{
|
|
4812
4765
|
key: "update",
|
|
4813
|
-
value: function update(changes) {
|
|
4766
|
+
value: function update(changes, asyncChanges) {
|
|
4767
|
+
var _this = this;
|
|
4814
4768
|
this.hooks.beforeUpdate.call(changes);
|
|
4815
4769
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
4816
4770
|
this.idCache.clear();
|
|
4817
4771
|
var prevASTMap = new Map(this.ASTMap);
|
|
4818
4772
|
this.ASTMap.clear();
|
|
4819
|
-
var
|
|
4773
|
+
var prevAsyncIdMap = new Map(this.AsyncIdMap);
|
|
4774
|
+
var nextAsyncIdMap = /* @__PURE__ */ new Map();
|
|
4775
|
+
asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
|
|
4776
|
+
var current = prevAsyncIdMap.get(id);
|
|
4777
|
+
while(current && prevASTMap.has(current)){
|
|
4778
|
+
var next = prevASTMap.get(current);
|
|
4779
|
+
if (next && _this.resolveCache.has(next)) {
|
|
4780
|
+
_this.resolveCache.delete(next);
|
|
4781
|
+
}
|
|
4782
|
+
current = current.parent;
|
|
4783
|
+
}
|
|
4784
|
+
});
|
|
4785
|
+
var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
|
|
4786
|
+
this.AsyncIdMap = nextAsyncIdMap;
|
|
4820
4787
|
this.resolveCache = resolveCache;
|
|
4821
4788
|
this.hooks.afterUpdate.call(updated.value);
|
|
4822
4789
|
return updated.value;
|
|
@@ -4861,7 +4828,7 @@ var CheckPathPlugin = function() {
|
|
|
4861
4828
|
Object.keys(clonedNode).forEach(function(key) {
|
|
4862
4829
|
if (key === "parent") return;
|
|
4863
4830
|
var value = clonedNode[key];
|
|
4864
|
-
if (typeof value === "object" && value !== null) {
|
|
4831
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
4865
4832
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
4866
4833
|
}
|
|
4867
4834
|
});
|
|
@@ -4870,9 +4837,8 @@ var CheckPathPlugin = function() {
|
|
|
4870
4837
|
},
|
|
4871
4838
|
{
|
|
4872
4839
|
key: "computeTree",
|
|
4873
|
-
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4840
|
+
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
|
|
4874
4841
|
var _this = this;
|
|
4875
|
-
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4876
4842
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4877
4843
|
dependencyModel.trackSubset("core");
|
|
4878
4844
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4891,15 +4857,6 @@ var CheckPathPlugin = function() {
|
|
|
4891
4857
|
var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
|
|
4892
4858
|
var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
4893
4859
|
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
4894
|
-
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4895
|
-
parent: partiallyResolvedParent
|
|
4896
|
-
});
|
|
4897
|
-
var _this_hooks_beforeResolve_call;
|
|
4898
|
-
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4899
|
-
type: "empty"
|
|
4900
|
-
};
|
|
4901
|
-
var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : (_partiallyResolvedParent_parent_parent = _partiallyResolvedParent_parent.parent) === null || _partiallyResolvedParent_parent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent_parent.type) === "multi-node" && partiallyResolvedParent.parent.type === "value" && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" && resolvedAST.parent.value.id.includes("async");
|
|
4902
|
-
var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" && partiallyResolvedParent.type === "value";
|
|
4903
4860
|
if (previousResult && shouldUseLastValue) {
|
|
4904
4861
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4905
4862
|
updated: false
|
|
@@ -4911,6 +4868,30 @@ var CheckPathPlugin = function() {
|
|
|
4911
4868
|
updated: false
|
|
4912
4869
|
});
|
|
4913
4870
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
4871
|
+
if (resolvedUpdate.node.type === "async") {
|
|
4872
|
+
nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
|
|
4873
|
+
}
|
|
4874
|
+
var _resolvedUpdate_node_asyncNodesResolved;
|
|
4875
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4876
|
+
try {
|
|
4877
|
+
for(var _iterator = ((_resolvedUpdate_node_asyncNodesResolved = resolvedUpdate.node.asyncNodesResolved) !== null && _resolvedUpdate_node_asyncNodesResolved !== void 0 ? _resolvedUpdate_node_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4878
|
+
var key = _step.value;
|
|
4879
|
+
nextAsyncIdMap.set(key, resolvedUpdate.node);
|
|
4880
|
+
}
|
|
4881
|
+
} catch (err) {
|
|
4882
|
+
_didIteratorError = true;
|
|
4883
|
+
_iteratorError = err;
|
|
4884
|
+
} finally{
|
|
4885
|
+
try {
|
|
4886
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4887
|
+
_iterator.return();
|
|
4888
|
+
}
|
|
4889
|
+
} finally{
|
|
4890
|
+
if (_didIteratorError) {
|
|
4891
|
+
throw _iteratorError;
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
}
|
|
4914
4895
|
var handleChildNode = function(childNode) {
|
|
4915
4896
|
var _prevASTMap_get;
|
|
4916
4897
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
@@ -4933,10 +4914,37 @@ var CheckPathPlugin = function() {
|
|
|
4933
4914
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4934
4915
|
return update2;
|
|
4935
4916
|
}
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
}
|
|
4939
|
-
|
|
4917
|
+
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4918
|
+
parent: partiallyResolvedParent
|
|
4919
|
+
});
|
|
4920
|
+
var _this_hooks_beforeResolve_call;
|
|
4921
|
+
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4922
|
+
type: "empty"
|
|
4923
|
+
};
|
|
4924
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4925
|
+
if (resolvedAST.type === "async") {
|
|
4926
|
+
nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
|
|
4927
|
+
}
|
|
4928
|
+
var _resolvedAST_asyncNodesResolved;
|
|
4929
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4930
|
+
try {
|
|
4931
|
+
for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4932
|
+
var id = _step.value;
|
|
4933
|
+
nextAsyncIdMap.set(id, resolvedAST);
|
|
4934
|
+
}
|
|
4935
|
+
} catch (err) {
|
|
4936
|
+
_didIteratorError = true;
|
|
4937
|
+
_iteratorError = err;
|
|
4938
|
+
} finally{
|
|
4939
|
+
try {
|
|
4940
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4941
|
+
_iterator.return();
|
|
4942
|
+
}
|
|
4943
|
+
} finally{
|
|
4944
|
+
if (_didIteratorError) {
|
|
4945
|
+
throw _iteratorError;
|
|
4946
|
+
}
|
|
4947
|
+
}
|
|
4940
4948
|
}
|
|
4941
4949
|
resolveOptions.node = resolvedAST;
|
|
4942
4950
|
this.ASTMap.set(resolvedAST, node);
|
|
@@ -4950,7 +4958,7 @@ var CheckPathPlugin = function() {
|
|
|
4950
4958
|
if ("children" in resolvedAST) {
|
|
4951
4959
|
var _resolvedAST_children;
|
|
4952
4960
|
var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
|
|
4953
|
-
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4961
|
+
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
4954
4962
|
var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
|
|
4955
4963
|
childTreeDeps.forEach(function(binding) {
|
|
4956
4964
|
return childDependencies.add(binding);
|
|
@@ -4971,40 +4979,18 @@ var CheckPathPlugin = function() {
|
|
|
4971
4979
|
resolvedAST.children = newChildren;
|
|
4972
4980
|
} else if (resolvedAST.type === "multi-node") {
|
|
4973
4981
|
var childValue = [];
|
|
4974
|
-
var rawParentToPassIn =
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
}).filter(function(index) {
|
|
4978
|
-
return index !== -1;
|
|
4979
|
-
});
|
|
4980
|
-
var newValues = resolvedAST.values.map(function(mValue) {
|
|
4981
|
-
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4982
|
+
var rawParentToPassIn = node;
|
|
4983
|
+
resolvedAST.values = resolvedAST.values.map(function(mValue) {
|
|
4984
|
+
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
4982
4985
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
}
|
|
4986
|
-
|
|
4987
|
-
|
|
4986
|
+
mTree.dependencies.forEach(function(bindingDep) {
|
|
4987
|
+
return childDependencies.add(bindingDep);
|
|
4988
|
+
});
|
|
4989
|
+
updated = updated || mTree.updated;
|
|
4990
|
+
childValue.push(mTree.value);
|
|
4988
4991
|
}
|
|
4989
|
-
mTree.dependencies.forEach(function(bindingDep) {
|
|
4990
|
-
return childDependencies.add(bindingDep);
|
|
4991
|
-
});
|
|
4992
|
-
updated = updated || mTree.updated;
|
|
4993
4992
|
return mTree.node;
|
|
4994
4993
|
});
|
|
4995
|
-
if (hasAsync.length > 0) {
|
|
4996
|
-
var copy = newValues;
|
|
4997
|
-
hasAsync.forEach(function(index) {
|
|
4998
|
-
var _copy;
|
|
4999
|
-
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
5000
|
-
index,
|
|
5001
|
-
1
|
|
5002
|
-
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
5003
|
-
});
|
|
5004
|
-
resolvedAST.values = copy;
|
|
5005
|
-
} else {
|
|
5006
|
-
resolvedAST.values = newValues;
|
|
5007
|
-
}
|
|
5008
4994
|
resolved = childValue;
|
|
5009
4995
|
}
|
|
5010
4996
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -5025,7 +5011,7 @@ var CheckPathPlugin = function() {
|
|
|
5025
5011
|
value: resolved,
|
|
5026
5012
|
dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
|
|
5027
5013
|
};
|
|
5028
|
-
this.hooks.afterNodeUpdate.call(node,
|
|
5014
|
+
this.hooks.afterNodeUpdate.call(node, rawParent, update);
|
|
5029
5015
|
cacheUpdate.set(node, update);
|
|
5030
5016
|
return update;
|
|
5031
5017
|
}
|
|
@@ -5033,15 +5019,6 @@ var CheckPathPlugin = function() {
|
|
|
5033
5019
|
]);
|
|
5034
5020
|
return Resolver;
|
|
5035
5021
|
}();
|
|
5036
|
-
function unpackAndPush(item, initial) {
|
|
5037
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
5038
|
-
item.asset.values.forEach(function(i) {
|
|
5039
|
-
unpackAndPush(i, initial);
|
|
5040
|
-
});
|
|
5041
|
-
} else {
|
|
5042
|
-
initial.push(item);
|
|
5043
|
-
}
|
|
5044
|
-
}
|
|
5045
5022
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
5046
5023
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
5047
5024
|
_class_call_check(this, CrossfieldProvider);
|
|
@@ -5109,9 +5086,11 @@ var CheckPathPlugin = function() {
|
|
|
5109
5086
|
_create_class(ViewInstance, [
|
|
5110
5087
|
{
|
|
5111
5088
|
key: "updateAsync",
|
|
5112
|
-
value: function updateAsync() {
|
|
5089
|
+
value: function updateAsync(asyncNode) {
|
|
5113
5090
|
var _this_resolver;
|
|
5114
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update()
|
|
5091
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
|
|
5092
|
+
asyncNode
|
|
5093
|
+
]));
|
|
5115
5094
|
this.lastUpdate = update;
|
|
5116
5095
|
this.hooks.onUpdate.call(update);
|
|
5117
5096
|
}
|
|
@@ -5201,7 +5180,7 @@ var CheckPathPlugin = function() {
|
|
|
5201
5180
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5202
5181
|
var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
|
|
5203
5182
|
var flags = "g";
|
|
5204
|
-
if (typeof expression === "object") {
|
|
5183
|
+
if ((typeof expression === "undefined" ? "undefined" : _type_of(expression)) === "object") {
|
|
5205
5184
|
flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
|
|
5206
5185
|
}
|
|
5207
5186
|
templateStr = templateStr.replace(new RegExp(expression, flags), value);
|
|
@@ -5350,7 +5329,7 @@ var CheckPathPlugin = function() {
|
|
|
5350
5329
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5351
5330
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5352
5331
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5353
|
-
if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
|
|
5332
|
+
if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
|
|
5354
5333
|
return node;
|
|
5355
5334
|
}
|
|
5356
5335
|
if (typeof node === "string") {
|
|
@@ -5363,7 +5342,7 @@ var CheckPathPlugin = function() {
|
|
|
5363
5342
|
}
|
|
5364
5343
|
var val = node[key];
|
|
5365
5344
|
var newVal = val;
|
|
5366
|
-
if (typeof val === "object") {
|
|
5345
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
5367
5346
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5368
5347
|
} else if (typeof val === "string") {
|
|
5369
5348
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -5652,7 +5631,7 @@ var CheckPathPlugin = function() {
|
|
|
5652
5631
|
key: "applyParser",
|
|
5653
5632
|
value: function applyParser(parser) {
|
|
5654
5633
|
parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
|
|
5655
|
-
if (childOptions
|
|
5634
|
+
if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
|
|
5656
5635
|
var values = obj.map(function(childVal) {
|
|
5657
5636
|
return parser.parseObject(childVal, "value", options);
|
|
5658
5637
|
}).filter(function(child) {
|
|
@@ -5663,7 +5642,7 @@ var CheckPathPlugin = function() {
|
|
|
5663
5642
|
}
|
|
5664
5643
|
var multiNode = parser.createASTNode({
|
|
5665
5644
|
type: "multi-node",
|
|
5666
|
-
override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5645
|
+
override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5667
5646
|
values: values
|
|
5668
5647
|
}, obj);
|
|
5669
5648
|
if (!multiNode) {
|
|
@@ -5674,7 +5653,7 @@ var CheckPathPlugin = function() {
|
|
|
5674
5653
|
v.parent = multiNode;
|
|
5675
5654
|
});
|
|
5676
5655
|
}
|
|
5677
|
-
return [
|
|
5656
|
+
return childOptions === void 0 ? multiNode : [
|
|
5678
5657
|
{
|
|
5679
5658
|
path: _to_consumable_array(childOptions.path).concat([
|
|
5680
5659
|
childOptions.key
|
|
@@ -5704,7 +5683,7 @@ var CheckPathPlugin = function() {
|
|
|
5704
5683
|
key: "applyParser",
|
|
5705
5684
|
value: function applyParser(parser) {
|
|
5706
5685
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
5707
|
-
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
|
|
5686
|
+
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
5708
5687
|
var assetAST = parser.parseObject(obj, "asset", options);
|
|
5709
5688
|
if (!assetAST) {
|
|
5710
5689
|
return [];
|
|
@@ -5904,6 +5883,7 @@ var CheckPathPlugin = function() {
|
|
|
5904
5883
|
}();
|
|
5905
5884
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
5906
5885
|
function FlowInstance(id, flow, options) {
|
|
5886
|
+
var _this = this;
|
|
5907
5887
|
_class_call_check(this, FlowInstance);
|
|
5908
5888
|
this.isTransitioning = false;
|
|
5909
5889
|
this.hooks = {
|
|
@@ -5920,60 +5900,55 @@ var CheckPathPlugin = function() {
|
|
|
5920
5900
|
this.flow = flow;
|
|
5921
5901
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
5922
5902
|
this.history = [];
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
5903
|
+
this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
|
|
5904
|
+
return _async_to_generator(function() {
|
|
5926
5905
|
var newState;
|
|
5927
5906
|
return _ts_generator(this, function(_state) {
|
|
5928
5907
|
newState = nextState.value;
|
|
5929
|
-
if (
|
|
5930
|
-
|
|
5908
|
+
if (this.flowPromise && newState.state_type === "END") {
|
|
5909
|
+
this.flowPromise.resolve(newState);
|
|
5931
5910
|
}
|
|
5932
5911
|
return [
|
|
5933
5912
|
2
|
|
5934
5913
|
];
|
|
5935
5914
|
});
|
|
5936
|
-
});
|
|
5937
|
-
|
|
5938
|
-
return _ref.apply(this, arguments);
|
|
5939
|
-
};
|
|
5940
|
-
}());
|
|
5915
|
+
}).call(_this);
|
|
5916
|
+
});
|
|
5941
5917
|
}
|
|
5942
5918
|
_create_class(FlowInstance, [
|
|
5943
5919
|
{
|
|
5944
5920
|
key: "start",
|
|
5945
5921
|
value: /** Start the state machine */ function start() {
|
|
5946
|
-
var _this = this;
|
|
5947
5922
|
return _async_to_generator(function() {
|
|
5948
5923
|
var _this_log, initialState;
|
|
5949
5924
|
return _ts_generator(this, function(_state) {
|
|
5950
|
-
if (
|
|
5925
|
+
if (this.flowPromise) {
|
|
5951
5926
|
;
|
|
5952
|
-
(_this_log =
|
|
5927
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
5953
5928
|
return [
|
|
5954
5929
|
2,
|
|
5955
|
-
|
|
5930
|
+
this.flowPromise.promise
|
|
5956
5931
|
];
|
|
5957
5932
|
}
|
|
5958
|
-
|
|
5959
|
-
if (
|
|
5960
|
-
|
|
5933
|
+
this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
|
|
5934
|
+
if (this.flow.onStart) {
|
|
5935
|
+
this.hooks.onStart.call(this.flow.onStart);
|
|
5961
5936
|
}
|
|
5962
|
-
initialState =
|
|
5937
|
+
initialState = this.flow.startState;
|
|
5963
5938
|
if (!initialState) {
|
|
5964
5939
|
return [
|
|
5965
5940
|
2,
|
|
5966
5941
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
5967
5942
|
];
|
|
5968
5943
|
}
|
|
5969
|
-
|
|
5970
|
-
|
|
5944
|
+
this.flowPromise = (0, import_p_defer2.default)();
|
|
5945
|
+
this.pushHistory(initialState);
|
|
5971
5946
|
return [
|
|
5972
5947
|
2,
|
|
5973
|
-
|
|
5948
|
+
this.flowPromise.promise
|
|
5974
5949
|
];
|
|
5975
5950
|
});
|
|
5976
|
-
})();
|
|
5951
|
+
}).call(this);
|
|
5977
5952
|
}
|
|
5978
5953
|
},
|
|
5979
5954
|
{
|
|
@@ -6025,7 +6000,7 @@ var CheckPathPlugin = function() {
|
|
|
6025
6000
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6026
6001
|
}
|
|
6027
6002
|
var nextState = this.flow[stateName];
|
|
6028
|
-
if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
|
|
6003
|
+
if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
|
|
6029
6004
|
var _this_log;
|
|
6030
6005
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6031
6006
|
return;
|
|
@@ -6085,30 +6060,30 @@ var CheckPathPlugin = function() {
|
|
|
6085
6060
|
{
|
|
6086
6061
|
key: "run",
|
|
6087
6062
|
value: function run(startState) {
|
|
6088
|
-
var _this = this;
|
|
6089
6063
|
return _async_to_generator(function() {
|
|
6090
|
-
var _this_log, startFlow, flow, end, firstItem;
|
|
6064
|
+
var _this, _this_log, startFlow, flow, end, firstItem;
|
|
6091
6065
|
return _ts_generator(this, function(_state) {
|
|
6092
6066
|
switch(_state.label){
|
|
6093
6067
|
case 0:
|
|
6094
|
-
|
|
6068
|
+
_this = this;
|
|
6069
|
+
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6095
6070
|
return [
|
|
6096
6071
|
2,
|
|
6097
6072
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6098
6073
|
];
|
|
6099
6074
|
}
|
|
6100
|
-
startFlow =
|
|
6101
|
-
if (startFlow === null || typeof startFlow !== "object") {
|
|
6075
|
+
startFlow = this.navigation[startState];
|
|
6076
|
+
if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
|
|
6102
6077
|
return [
|
|
6103
6078
|
2,
|
|
6104
6079
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6105
6080
|
];
|
|
6106
6081
|
}
|
|
6107
|
-
(_this_log =
|
|
6082
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6108
6083
|
flow = new FlowInstance(startState, startFlow, {
|
|
6109
|
-
logger:
|
|
6084
|
+
logger: this.log
|
|
6110
6085
|
});
|
|
6111
|
-
|
|
6086
|
+
this.addNewFlow(flow);
|
|
6112
6087
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6113
6088
|
var _flowInstance_currentState;
|
|
6114
6089
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6128,10 +6103,10 @@ var CheckPathPlugin = function() {
|
|
|
6128
6103
|
];
|
|
6129
6104
|
case 1:
|
|
6130
6105
|
end = _state.sent();
|
|
6131
|
-
|
|
6132
|
-
if (
|
|
6106
|
+
this.navStack.pop();
|
|
6107
|
+
if (this.navStack.length > 0) {
|
|
6133
6108
|
firstItem = 0;
|
|
6134
|
-
|
|
6109
|
+
this.current = this.navStack[firstItem];
|
|
6135
6110
|
}
|
|
6136
6111
|
return [
|
|
6137
6112
|
2,
|
|
@@ -6139,16 +6114,15 @@ var CheckPathPlugin = function() {
|
|
|
6139
6114
|
];
|
|
6140
6115
|
}
|
|
6141
6116
|
});
|
|
6142
|
-
})();
|
|
6117
|
+
}).call(this);
|
|
6143
6118
|
}
|
|
6144
6119
|
},
|
|
6145
6120
|
{
|
|
6146
6121
|
key: "start",
|
|
6147
6122
|
value: function start() {
|
|
6148
|
-
var _this = this;
|
|
6149
6123
|
return _async_to_generator(function() {
|
|
6150
6124
|
return _ts_generator(this, function(_state) {
|
|
6151
|
-
if (!
|
|
6125
|
+
if (!this.navigation.BEGIN) {
|
|
6152
6126
|
return [
|
|
6153
6127
|
2,
|
|
6154
6128
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6156,10 +6130,10 @@ var CheckPathPlugin = function() {
|
|
|
6156
6130
|
}
|
|
6157
6131
|
return [
|
|
6158
6132
|
2,
|
|
6159
|
-
|
|
6133
|
+
this.run(this.navigation.BEGIN)
|
|
6160
6134
|
];
|
|
6161
6135
|
});
|
|
6162
|
-
})();
|
|
6136
|
+
}).call(this);
|
|
6163
6137
|
}
|
|
6164
6138
|
}
|
|
6165
6139
|
]);
|
|
@@ -7266,7 +7240,7 @@ var CheckPathPlugin = function() {
|
|
|
7266
7240
|
var parentBinding = resolved.parent();
|
|
7267
7241
|
var property = resolved.key();
|
|
7268
7242
|
var parentValue = this.get(parentBinding);
|
|
7269
|
-
var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7243
|
+
var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7270
7244
|
this.getModel().delete(resolved, options);
|
|
7271
7245
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7272
7246
|
this.trash.add(resolved);
|
|
@@ -7367,7 +7341,7 @@ var CheckPathPlugin = function() {
|
|
|
7367
7341
|
var expressionEvaluator;
|
|
7368
7342
|
var handleEval = function(exp) {
|
|
7369
7343
|
if (exp) {
|
|
7370
|
-
if (typeof exp === "object" && "exp" in exp) {
|
|
7344
|
+
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7371
7345
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7372
7346
|
} else {
|
|
7373
7347
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -7628,7 +7602,7 @@ var CheckPathPlugin = function() {
|
|
|
7628
7602
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
7629
7603
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
7630
7604
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
7631
|
-
if (
|
|
7605
|
+
if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
|
|
7632
7606
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
7633
7607
|
} else {
|
|
7634
7608
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -7787,12 +7761,12 @@ var CheckPathPlugin = function() {
|
|
|
7787
7761
|
{
|
|
7788
7762
|
key: "start",
|
|
7789
7763
|
value: function start(payload) {
|
|
7790
|
-
var _this = this;
|
|
7791
7764
|
return _async_to_generator(function() {
|
|
7792
|
-
var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7765
|
+
var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7793
7766
|
return _ts_generator(this, function(_state) {
|
|
7794
7767
|
switch(_state.label){
|
|
7795
7768
|
case 0:
|
|
7769
|
+
_this = this;
|
|
7796
7770
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
7797
7771
|
maybeUpdateState = function(newState) {
|
|
7798
7772
|
if (_this.state.ref !== ref) {
|
|
@@ -7802,7 +7776,7 @@ var CheckPathPlugin = function() {
|
|
|
7802
7776
|
_this.setState(newState);
|
|
7803
7777
|
return newState;
|
|
7804
7778
|
};
|
|
7805
|
-
|
|
7779
|
+
this.setState({
|
|
7806
7780
|
status: "not-started",
|
|
7807
7781
|
ref: ref
|
|
7808
7782
|
});
|
|
@@ -7814,8 +7788,8 @@ var CheckPathPlugin = function() {
|
|
|
7814
7788
|
,
|
|
7815
7789
|
4
|
|
7816
7790
|
]);
|
|
7817
|
-
_this_setupFlow =
|
|
7818
|
-
|
|
7791
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7792
|
+
this.setState(_object_spread({
|
|
7819
7793
|
ref: ref
|
|
7820
7794
|
}, state));
|
|
7821
7795
|
start();
|
|
@@ -7860,7 +7834,7 @@ var CheckPathPlugin = function() {
|
|
|
7860
7834
|
];
|
|
7861
7835
|
}
|
|
7862
7836
|
});
|
|
7863
|
-
})();
|
|
7837
|
+
}).call(this);
|
|
7864
7838
|
}
|
|
7865
7839
|
}
|
|
7866
7840
|
]);
|