@player-ui/common-types-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 CommonTypesPlugin = 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 CommonTypesPlugin = 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 CommonTypesPlugin = 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 CommonTypesPlugin = 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 CommonTypesPlugin = 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 CommonTypesPlugin = 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
|
};
|
|
@@ -1555,7 +1523,7 @@ var CommonTypesPlugin = function() {
|
|
|
1555
1523
|
});
|
|
1556
1524
|
};
|
|
1557
1525
|
var __copyProps = function(to, from, except, desc) {
|
|
1558
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1526
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1559
1527
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1560
1528
|
try {
|
|
1561
1529
|
var _loop = function() {
|
|
@@ -1610,15 +1578,16 @@ var CommonTypesPlugin = function() {
|
|
|
1610
1578
|
exports.toError = exports.NestedError = void 0;
|
|
1611
1579
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1612
1580
|
_inherits(_NestedError, Error1);
|
|
1613
|
-
var _super = _create_super(_NestedError);
|
|
1614
1581
|
function _NestedError(message) {
|
|
1615
1582
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1616
1583
|
innerErrors[_key - 1] = arguments[_key];
|
|
1617
1584
|
}
|
|
1618
1585
|
_class_call_check(this, _NestedError);
|
|
1619
1586
|
var _this;
|
|
1620
|
-
_this =
|
|
1621
|
-
|
|
1587
|
+
_this = _call_super(this, _NestedError, [
|
|
1588
|
+
message
|
|
1589
|
+
]);
|
|
1590
|
+
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1622
1591
|
if (innerErrors.length === 1) {
|
|
1623
1592
|
var innerError = toError(innerErrors[0]);
|
|
1624
1593
|
_this.innerErrors = [
|
|
@@ -1754,7 +1723,7 @@ var CommonTypesPlugin = function() {
|
|
|
1754
1723
|
return out;
|
|
1755
1724
|
}
|
|
1756
1725
|
function isObject(o) {
|
|
1757
|
-
return o != null && typeof o === "object";
|
|
1726
|
+
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1758
1727
|
}
|
|
1759
1728
|
function addLast2(array, val) {
|
|
1760
1729
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2097,7 +2066,7 @@ var CommonTypesPlugin = function() {
|
|
|
2097
2066
|
else return 0;
|
|
2098
2067
|
}
|
|
2099
2068
|
}();
|
|
2100
|
-
if (typeof module === "object") module.exports = SortedArray2;
|
|
2069
|
+
if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
|
|
2101
2070
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2102
2071
|
return SortedArray2;
|
|
2103
2072
|
});
|
|
@@ -2400,10 +2369,9 @@ var CommonTypesPlugin = function() {
|
|
|
2400
2369
|
}();
|
|
2401
2370
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2402
2371
|
_inherits(SyncHook, Hook);
|
|
2403
|
-
var _super = _create_super(SyncHook);
|
|
2404
2372
|
function SyncHook() {
|
|
2405
2373
|
_class_call_check(this, SyncHook);
|
|
2406
|
-
return
|
|
2374
|
+
return _call_super(this, SyncHook, arguments);
|
|
2407
2375
|
}
|
|
2408
2376
|
_create_class(SyncHook, [
|
|
2409
2377
|
{
|
|
@@ -2436,10 +2404,9 @@ var CommonTypesPlugin = function() {
|
|
|
2436
2404
|
}(Hook);
|
|
2437
2405
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2438
2406
|
_inherits(SyncBailHook, Hook);
|
|
2439
|
-
var _super = _create_super(SyncBailHook);
|
|
2440
2407
|
function SyncBailHook() {
|
|
2441
2408
|
_class_call_check(this, SyncBailHook);
|
|
2442
|
-
return
|
|
2409
|
+
return _call_super(this, SyncBailHook, arguments);
|
|
2443
2410
|
}
|
|
2444
2411
|
_create_class(SyncBailHook, [
|
|
2445
2412
|
{
|
|
@@ -2471,10 +2438,9 @@ var CommonTypesPlugin = function() {
|
|
|
2471
2438
|
}(Hook);
|
|
2472
2439
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2473
2440
|
_inherits(SyncWaterfallHook, Hook);
|
|
2474
|
-
var _super = _create_super(SyncWaterfallHook);
|
|
2475
2441
|
function SyncWaterfallHook() {
|
|
2476
2442
|
_class_call_check(this, SyncWaterfallHook);
|
|
2477
|
-
return
|
|
2443
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
2478
2444
|
}
|
|
2479
2445
|
_create_class(SyncWaterfallHook, [
|
|
2480
2446
|
{
|
|
@@ -2536,7 +2502,7 @@ var CommonTypesPlugin = function() {
|
|
|
2536
2502
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2537
2503
|
len = _step.value;
|
|
2538
2504
|
tmp = len;
|
|
2539
|
-
if (tmp && typeof tmp === "object") {
|
|
2505
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2540
2506
|
tmp = find(bar, tmp);
|
|
2541
2507
|
if (!tmp) return false;
|
|
2542
2508
|
}
|
|
@@ -2567,7 +2533,7 @@ var CommonTypesPlugin = function() {
|
|
|
2567
2533
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2568
2534
|
len = _step1.value;
|
|
2569
2535
|
tmp = len[0];
|
|
2570
|
-
if (tmp && typeof tmp === "object") {
|
|
2536
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2571
2537
|
tmp = find(bar, tmp);
|
|
2572
2538
|
if (!tmp) return false;
|
|
2573
2539
|
}
|
|
@@ -2606,7 +2572,7 @@ var CommonTypesPlugin = function() {
|
|
|
2606
2572
|
}
|
|
2607
2573
|
return len === -1;
|
|
2608
2574
|
}
|
|
2609
|
-
if (!ctor || typeof foo === "object") {
|
|
2575
|
+
if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
|
|
2610
2576
|
len = 0;
|
|
2611
2577
|
for(ctor in foo){
|
|
2612
2578
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -2639,7 +2605,7 @@ var CommonTypesPlugin = function() {
|
|
|
2639
2605
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2640
2606
|
key
|
|
2641
2607
|
]);
|
|
2642
|
-
if (typeof val === "object") {
|
|
2608
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
2643
2609
|
traverseObj(val, nestedPath, pairs);
|
|
2644
2610
|
} else {
|
|
2645
2611
|
pairs.set(nestedPath, val);
|
|
@@ -2680,7 +2646,7 @@ var CommonTypesPlugin = function() {
|
|
|
2680
2646
|
{
|
|
2681
2647
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
2682
2648
|
value: function set(match, value) {
|
|
2683
|
-
var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2649
|
+
var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2684
2650
|
this.store.insert({
|
|
2685
2651
|
key: match,
|
|
2686
2652
|
value: value,
|
|
@@ -2843,6 +2809,7 @@ var CommonTypesPlugin = function() {
|
|
|
2843
2809
|
}
|
|
2844
2810
|
};
|
|
2845
2811
|
var identifier = function() {
|
|
2812
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2846
2813
|
if (!isIdentifierChar(ch)) {
|
|
2847
2814
|
return;
|
|
2848
2815
|
}
|
|
@@ -2853,6 +2820,14 @@ var CommonTypesPlugin = function() {
|
|
|
2853
2820
|
}
|
|
2854
2821
|
value += ch;
|
|
2855
2822
|
}
|
|
2823
|
+
if (allowBoolValue) {
|
|
2824
|
+
if (value === "true") {
|
|
2825
|
+
return toValue(true);
|
|
2826
|
+
}
|
|
2827
|
+
if (value === "false") {
|
|
2828
|
+
return toValue(false);
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2856
2831
|
if (value) {
|
|
2857
2832
|
var maybeNumber = Number(value);
|
|
2858
2833
|
value = isNaN(maybeNumber) ? value : maybeNumber;
|
|
@@ -2901,8 +2876,9 @@ var CommonTypesPlugin = function() {
|
|
|
2901
2876
|
}
|
|
2902
2877
|
};
|
|
2903
2878
|
var simpleSegment = function() {
|
|
2879
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2904
2880
|
var _nestedPath, _ref;
|
|
2905
|
-
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression2()) !== null && _ref !== void 0 ? _ref : identifier();
|
|
2881
|
+
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression2()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
|
|
2906
2882
|
};
|
|
2907
2883
|
var segment = function() {
|
|
2908
2884
|
var segments = [];
|
|
@@ -2917,6 +2893,7 @@ var CommonTypesPlugin = function() {
|
|
|
2917
2893
|
return toConcatenatedNode(segments);
|
|
2918
2894
|
};
|
|
2919
2895
|
var optionallyQuotedSegment = function() {
|
|
2896
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2920
2897
|
whitespace();
|
|
2921
2898
|
if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
|
|
2922
2899
|
var singleQuote = ch === SINGLE_QUOTE;
|
|
@@ -2925,7 +2902,7 @@ var CommonTypesPlugin = function() {
|
|
|
2925
2902
|
next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
|
|
2926
2903
|
return id;
|
|
2927
2904
|
}
|
|
2928
|
-
return simpleSegment();
|
|
2905
|
+
return simpleSegment(allowBoolValue);
|
|
2929
2906
|
};
|
|
2930
2907
|
var equals = function() {
|
|
2931
2908
|
if (ch !== EQUALS) {
|
|
@@ -2945,7 +2922,7 @@ var CommonTypesPlugin = function() {
|
|
|
2945
2922
|
whitespace();
|
|
2946
2923
|
if (equals()) {
|
|
2947
2924
|
whitespace();
|
|
2948
|
-
var second = optionallyQuotedSegment();
|
|
2925
|
+
var second = optionallyQuotedSegment(true);
|
|
2949
2926
|
value = toQuery(value, second);
|
|
2950
2927
|
whitespace();
|
|
2951
2928
|
}
|
|
@@ -3133,7 +3110,7 @@ var CommonTypesPlugin = function() {
|
|
|
3133
3110
|
appendPathSegments(getValueForNode(resolvedNode));
|
|
3134
3111
|
break;
|
|
3135
3112
|
case "Value":
|
|
3136
|
-
appendPathSegments(resolvedNode.value);
|
|
3113
|
+
appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
|
|
3137
3114
|
break;
|
|
3138
3115
|
case "Query":
|
|
3139
3116
|
{
|
|
@@ -3209,7 +3186,7 @@ var CommonTypesPlugin = function() {
|
|
|
3209
3186
|
var _this_parseCache_path;
|
|
3210
3187
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3211
3188
|
this.parseCache[path] = ast;
|
|
3212
|
-
if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3189
|
+
if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3213
3190
|
var _ast_error;
|
|
3214
3191
|
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."));
|
|
3215
3192
|
}
|
|
@@ -3409,14 +3386,13 @@ var CommonTypesPlugin = function() {
|
|
|
3409
3386
|
}();
|
|
3410
3387
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3411
3388
|
_inherits(DependencyModel, DependencyTracker);
|
|
3412
|
-
var _super = _create_super(DependencyModel);
|
|
3413
3389
|
function DependencyModel(rootModel) {
|
|
3414
3390
|
_class_call_check(this, DependencyModel);
|
|
3415
3391
|
var _this;
|
|
3416
|
-
_this =
|
|
3392
|
+
_this = _call_super(this, DependencyModel);
|
|
3417
3393
|
_this.rootModel = rootModel;
|
|
3418
|
-
_this.set = _this.set.bind(
|
|
3419
|
-
_this.get = _this.get.bind(
|
|
3394
|
+
_this.set = _this.set.bind(_this);
|
|
3395
|
+
_this.get = _this.get.bind(_this);
|
|
3420
3396
|
return _this;
|
|
3421
3397
|
}
|
|
3422
3398
|
_create_class(DependencyModel, [
|
|
@@ -3960,23 +3936,20 @@ var CommonTypesPlugin = function() {
|
|
|
3960
3936
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3961
3937
|
*/ key: "evaluateAsync",
|
|
3962
3938
|
value: function evaluateAsync(expr, options) {
|
|
3939
|
+
var _this = this;
|
|
3963
3940
|
if (Array.isArray(expr)) {
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
var _ref = _async_to_generator(function(exp) {
|
|
3941
|
+
return collateAwaitable(expr.map(function(exp) {
|
|
3942
|
+
return _async_to_generator(function() {
|
|
3967
3943
|
return _ts_generator(this, function(_state) {
|
|
3968
3944
|
return [
|
|
3969
3945
|
2,
|
|
3970
|
-
|
|
3946
|
+
this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3971
3947
|
async: true
|
|
3972
3948
|
}))
|
|
3973
3949
|
];
|
|
3974
3950
|
});
|
|
3975
|
-
});
|
|
3976
|
-
|
|
3977
|
-
return _ref.apply(this, arguments);
|
|
3978
|
-
};
|
|
3979
|
-
}())).awaitableThen(function(values) {
|
|
3951
|
+
}).call(_this);
|
|
3952
|
+
})).awaitableThen(function(values) {
|
|
3980
3953
|
return values.pop();
|
|
3981
3954
|
});
|
|
3982
3955
|
} else {
|
|
@@ -4700,23 +4673,8 @@ var CommonTypesPlugin = function() {
|
|
|
4700
4673
|
function Parser() {
|
|
4701
4674
|
_class_call_check(this, Parser);
|
|
4702
4675
|
this.hooks = {
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
*
|
|
4706
|
-
* @param value - The object we're are about to parse
|
|
4707
|
-
* @returns - A new value to parse.
|
|
4708
|
-
* If undefined, the original value is used.
|
|
4709
|
-
* If null, we stop parsing this node.
|
|
4710
|
-
*/ onParseObject: new SyncWaterfallHook(),
|
|
4711
|
-
/**
|
|
4712
|
-
* A callback to interact with an AST _after_ we parse it into the AST
|
|
4713
|
-
*
|
|
4714
|
-
* @param value - The object we parsed
|
|
4715
|
-
* @param node - The AST node we generated
|
|
4716
|
-
* @returns - A new AST node to use
|
|
4717
|
-
* If undefined, the original value is used.
|
|
4718
|
-
* If null, we ignore this node all together
|
|
4719
|
-
*/ onCreateASTNode: new SyncWaterfallHook(),
|
|
4676
|
+
onParseObject: new SyncWaterfallHook(),
|
|
4677
|
+
onCreateASTNode: new SyncWaterfallHook(),
|
|
4720
4678
|
parseNode: new SyncBailHook()
|
|
4721
4679
|
};
|
|
4722
4680
|
}
|
|
@@ -4754,7 +4712,7 @@ var CommonTypesPlugin = function() {
|
|
|
4754
4712
|
}
|
|
4755
4713
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4756
4714
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4757
|
-
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4715
|
+
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4758
4716
|
return {
|
|
4759
4717
|
value: objToParse,
|
|
4760
4718
|
children: []
|
|
@@ -4791,7 +4749,7 @@ var CommonTypesPlugin = function() {
|
|
|
4791
4749
|
if (newChildren) {
|
|
4792
4750
|
var _children2;
|
|
4793
4751
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4794
|
-
} else if (localValue && typeof localValue === "object") {
|
|
4752
|
+
} else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
|
|
4795
4753
|
var _children21;
|
|
4796
4754
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4797
4755
|
localKey
|
|
@@ -4858,20 +4816,14 @@ var CommonTypesPlugin = function() {
|
|
|
4858
4816
|
function Resolver(root, options) {
|
|
4859
4817
|
_class_call_check(this, Resolver);
|
|
4860
4818
|
this.hooks = {
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
*/ resolve: new SyncWaterfallHook(),
|
|
4870
|
-
/**
|
|
4871
|
-
* A hook to transform the resolved value of an AST node.
|
|
4872
|
-
* This runs _after_ all children nodes are resolved
|
|
4873
|
-
*/ afterResolve: new SyncWaterfallHook(),
|
|
4874
|
-
/** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
|
|
4819
|
+
skipResolve: new SyncWaterfallHook(),
|
|
4820
|
+
beforeUpdate: new SyncHook(),
|
|
4821
|
+
afterUpdate: new SyncHook(),
|
|
4822
|
+
resolveOptions: new SyncWaterfallHook(),
|
|
4823
|
+
beforeResolve: new SyncWaterfallHook(),
|
|
4824
|
+
resolve: new SyncWaterfallHook(),
|
|
4825
|
+
afterResolve: new SyncWaterfallHook(),
|
|
4826
|
+
afterNodeUpdate: new SyncHook()
|
|
4875
4827
|
};
|
|
4876
4828
|
this.root = root;
|
|
4877
4829
|
this.options = options;
|
|
@@ -4879,6 +4831,7 @@ var CommonTypesPlugin = function() {
|
|
|
4879
4831
|
this.ASTMap = /* @__PURE__ */ new Map();
|
|
4880
4832
|
this.logger = options.logger;
|
|
4881
4833
|
this.idCache = /* @__PURE__ */ new Set();
|
|
4834
|
+
this.AsyncIdMap = /* @__PURE__ */ new Map();
|
|
4882
4835
|
}
|
|
4883
4836
|
_create_class(Resolver, [
|
|
4884
4837
|
{
|
|
@@ -4889,13 +4842,27 @@ var CommonTypesPlugin = function() {
|
|
|
4889
4842
|
},
|
|
4890
4843
|
{
|
|
4891
4844
|
key: "update",
|
|
4892
|
-
value: function update(changes) {
|
|
4845
|
+
value: function update(changes, asyncChanges) {
|
|
4846
|
+
var _this = this;
|
|
4893
4847
|
this.hooks.beforeUpdate.call(changes);
|
|
4894
4848
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
4895
4849
|
this.idCache.clear();
|
|
4896
4850
|
var prevASTMap = new Map(this.ASTMap);
|
|
4897
4851
|
this.ASTMap.clear();
|
|
4898
|
-
var
|
|
4852
|
+
var prevAsyncIdMap = new Map(this.AsyncIdMap);
|
|
4853
|
+
var nextAsyncIdMap = /* @__PURE__ */ new Map();
|
|
4854
|
+
asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
|
|
4855
|
+
var current = prevAsyncIdMap.get(id);
|
|
4856
|
+
while(current && prevASTMap.has(current)){
|
|
4857
|
+
var next = prevASTMap.get(current);
|
|
4858
|
+
if (next && _this.resolveCache.has(next)) {
|
|
4859
|
+
_this.resolveCache.delete(next);
|
|
4860
|
+
}
|
|
4861
|
+
current = current.parent;
|
|
4862
|
+
}
|
|
4863
|
+
});
|
|
4864
|
+
var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
|
|
4865
|
+
this.AsyncIdMap = nextAsyncIdMap;
|
|
4899
4866
|
this.resolveCache = resolveCache;
|
|
4900
4867
|
this.hooks.afterUpdate.call(updated.value);
|
|
4901
4868
|
return updated.value;
|
|
@@ -4940,7 +4907,7 @@ var CommonTypesPlugin = function() {
|
|
|
4940
4907
|
Object.keys(clonedNode).forEach(function(key) {
|
|
4941
4908
|
if (key === "parent") return;
|
|
4942
4909
|
var value = clonedNode[key];
|
|
4943
|
-
if (typeof value === "object" && value !== null) {
|
|
4910
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
4944
4911
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
4945
4912
|
}
|
|
4946
4913
|
});
|
|
@@ -4949,9 +4916,8 @@ var CommonTypesPlugin = function() {
|
|
|
4949
4916
|
},
|
|
4950
4917
|
{
|
|
4951
4918
|
key: "computeTree",
|
|
4952
|
-
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4919
|
+
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
|
|
4953
4920
|
var _this = this;
|
|
4954
|
-
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4955
4921
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4956
4922
|
dependencyModel.trackSubset("core");
|
|
4957
4923
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4970,15 +4936,6 @@ var CommonTypesPlugin = function() {
|
|
|
4970
4936
|
var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
|
|
4971
4937
|
var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
4972
4938
|
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
4973
|
-
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4974
|
-
parent: partiallyResolvedParent
|
|
4975
|
-
});
|
|
4976
|
-
var _this_hooks_beforeResolve_call;
|
|
4977
|
-
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4978
|
-
type: "empty"
|
|
4979
|
-
};
|
|
4980
|
-
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");
|
|
4981
|
-
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";
|
|
4982
4939
|
if (previousResult && shouldUseLastValue) {
|
|
4983
4940
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4984
4941
|
updated: false
|
|
@@ -4990,6 +4947,30 @@ var CommonTypesPlugin = function() {
|
|
|
4990
4947
|
updated: false
|
|
4991
4948
|
});
|
|
4992
4949
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
4950
|
+
if (resolvedUpdate.node.type === "async") {
|
|
4951
|
+
nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
|
|
4952
|
+
}
|
|
4953
|
+
var _resolvedUpdate_node_asyncNodesResolved;
|
|
4954
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4955
|
+
try {
|
|
4956
|
+
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){
|
|
4957
|
+
var key = _step.value;
|
|
4958
|
+
nextAsyncIdMap.set(key, resolvedUpdate.node);
|
|
4959
|
+
}
|
|
4960
|
+
} catch (err) {
|
|
4961
|
+
_didIteratorError = true;
|
|
4962
|
+
_iteratorError = err;
|
|
4963
|
+
} finally{
|
|
4964
|
+
try {
|
|
4965
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4966
|
+
_iterator.return();
|
|
4967
|
+
}
|
|
4968
|
+
} finally{
|
|
4969
|
+
if (_didIteratorError) {
|
|
4970
|
+
throw _iteratorError;
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4993
4974
|
var handleChildNode = function(childNode) {
|
|
4994
4975
|
var _prevASTMap_get;
|
|
4995
4976
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
@@ -5012,10 +4993,37 @@ var CommonTypesPlugin = function() {
|
|
|
5012
4993
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
5013
4994
|
return update2;
|
|
5014
4995
|
}
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
}
|
|
5018
|
-
|
|
4996
|
+
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4997
|
+
parent: partiallyResolvedParent
|
|
4998
|
+
});
|
|
4999
|
+
var _this_hooks_beforeResolve_call;
|
|
5000
|
+
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
5001
|
+
type: "empty"
|
|
5002
|
+
};
|
|
5003
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
5004
|
+
if (resolvedAST.type === "async") {
|
|
5005
|
+
nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
|
|
5006
|
+
}
|
|
5007
|
+
var _resolvedAST_asyncNodesResolved;
|
|
5008
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5009
|
+
try {
|
|
5010
|
+
for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5011
|
+
var id = _step.value;
|
|
5012
|
+
nextAsyncIdMap.set(id, resolvedAST);
|
|
5013
|
+
}
|
|
5014
|
+
} catch (err) {
|
|
5015
|
+
_didIteratorError = true;
|
|
5016
|
+
_iteratorError = err;
|
|
5017
|
+
} finally{
|
|
5018
|
+
try {
|
|
5019
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5020
|
+
_iterator.return();
|
|
5021
|
+
}
|
|
5022
|
+
} finally{
|
|
5023
|
+
if (_didIteratorError) {
|
|
5024
|
+
throw _iteratorError;
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
5019
5027
|
}
|
|
5020
5028
|
resolveOptions.node = resolvedAST;
|
|
5021
5029
|
this.ASTMap.set(resolvedAST, node);
|
|
@@ -5029,7 +5037,7 @@ var CommonTypesPlugin = function() {
|
|
|
5029
5037
|
if ("children" in resolvedAST) {
|
|
5030
5038
|
var _resolvedAST_children;
|
|
5031
5039
|
var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
|
|
5032
|
-
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
5040
|
+
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
5033
5041
|
var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
|
|
5034
5042
|
childTreeDeps.forEach(function(binding) {
|
|
5035
5043
|
return childDependencies.add(binding);
|
|
@@ -5050,40 +5058,18 @@ var CommonTypesPlugin = function() {
|
|
|
5050
5058
|
resolvedAST.children = newChildren;
|
|
5051
5059
|
} else if (resolvedAST.type === "multi-node") {
|
|
5052
5060
|
var childValue = [];
|
|
5053
|
-
var rawParentToPassIn =
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
}).filter(function(index) {
|
|
5057
|
-
return index !== -1;
|
|
5058
|
-
});
|
|
5059
|
-
var newValues = resolvedAST.values.map(function(mValue) {
|
|
5060
|
-
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
5061
|
+
var rawParentToPassIn = node;
|
|
5062
|
+
resolvedAST.values = resolvedAST.values.map(function(mValue) {
|
|
5063
|
+
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
5061
5064
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
}
|
|
5065
|
-
|
|
5066
|
-
|
|
5065
|
+
mTree.dependencies.forEach(function(bindingDep) {
|
|
5066
|
+
return childDependencies.add(bindingDep);
|
|
5067
|
+
});
|
|
5068
|
+
updated = updated || mTree.updated;
|
|
5069
|
+
childValue.push(mTree.value);
|
|
5067
5070
|
}
|
|
5068
|
-
mTree.dependencies.forEach(function(bindingDep) {
|
|
5069
|
-
return childDependencies.add(bindingDep);
|
|
5070
|
-
});
|
|
5071
|
-
updated = updated || mTree.updated;
|
|
5072
5071
|
return mTree.node;
|
|
5073
5072
|
});
|
|
5074
|
-
if (hasAsync.length > 0) {
|
|
5075
|
-
var copy = newValues;
|
|
5076
|
-
hasAsync.forEach(function(index) {
|
|
5077
|
-
var _copy;
|
|
5078
|
-
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
5079
|
-
index,
|
|
5080
|
-
1
|
|
5081
|
-
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
5082
|
-
});
|
|
5083
|
-
resolvedAST.values = copy;
|
|
5084
|
-
} else {
|
|
5085
|
-
resolvedAST.values = newValues;
|
|
5086
|
-
}
|
|
5087
5073
|
resolved = childValue;
|
|
5088
5074
|
}
|
|
5089
5075
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -5104,7 +5090,7 @@ var CommonTypesPlugin = function() {
|
|
|
5104
5090
|
value: resolved,
|
|
5105
5091
|
dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
|
|
5106
5092
|
};
|
|
5107
|
-
this.hooks.afterNodeUpdate.call(node,
|
|
5093
|
+
this.hooks.afterNodeUpdate.call(node, rawParent, update);
|
|
5108
5094
|
cacheUpdate.set(node, update);
|
|
5109
5095
|
return update;
|
|
5110
5096
|
}
|
|
@@ -5112,15 +5098,6 @@ var CommonTypesPlugin = function() {
|
|
|
5112
5098
|
]);
|
|
5113
5099
|
return Resolver;
|
|
5114
5100
|
}();
|
|
5115
|
-
function unpackAndPush(item, initial) {
|
|
5116
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
5117
|
-
item.asset.values.forEach(function(i) {
|
|
5118
|
-
unpackAndPush(i, initial);
|
|
5119
|
-
});
|
|
5120
|
-
} else {
|
|
5121
|
-
initial.push(item);
|
|
5122
|
-
}
|
|
5123
|
-
}
|
|
5124
5101
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
5125
5102
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
5126
5103
|
_class_call_check(this, CrossfieldProvider);
|
|
@@ -5188,9 +5165,11 @@ var CommonTypesPlugin = function() {
|
|
|
5188
5165
|
_create_class(ViewInstance, [
|
|
5189
5166
|
{
|
|
5190
5167
|
key: "updateAsync",
|
|
5191
|
-
value: function updateAsync() {
|
|
5168
|
+
value: function updateAsync(asyncNode) {
|
|
5192
5169
|
var _this_resolver;
|
|
5193
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update()
|
|
5170
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
|
|
5171
|
+
asyncNode
|
|
5172
|
+
]));
|
|
5194
5173
|
this.lastUpdate = update;
|
|
5195
5174
|
this.hooks.onUpdate.call(update);
|
|
5196
5175
|
}
|
|
@@ -5280,7 +5259,7 @@ var CommonTypesPlugin = function() {
|
|
|
5280
5259
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5281
5260
|
var _step_value = _step.value, expression2 = _step_value.expression, value = _step_value.value;
|
|
5282
5261
|
var flags = "g";
|
|
5283
|
-
if (typeof expression2 === "object") {
|
|
5262
|
+
if ((typeof expression2 === "undefined" ? "undefined" : _type_of(expression2)) === "object") {
|
|
5284
5263
|
flags = "".concat(expression2.flags).concat(expression2.global ? "" : "g");
|
|
5285
5264
|
}
|
|
5286
5265
|
templateStr = templateStr.replace(new RegExp(expression2, flags), value);
|
|
@@ -5429,7 +5408,7 @@ var CommonTypesPlugin = function() {
|
|
|
5429
5408
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5430
5409
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5431
5410
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5432
|
-
if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
|
|
5411
|
+
if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
|
|
5433
5412
|
return node;
|
|
5434
5413
|
}
|
|
5435
5414
|
if (typeof node === "string") {
|
|
@@ -5442,7 +5421,7 @@ var CommonTypesPlugin = function() {
|
|
|
5442
5421
|
}
|
|
5443
5422
|
var val = node[key];
|
|
5444
5423
|
var newVal = val;
|
|
5445
|
-
if (typeof val === "object") {
|
|
5424
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
5446
5425
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5447
5426
|
} else if (typeof val === "string") {
|
|
5448
5427
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -5731,7 +5710,7 @@ var CommonTypesPlugin = function() {
|
|
|
5731
5710
|
key: "applyParser",
|
|
5732
5711
|
value: function applyParser(parser) {
|
|
5733
5712
|
parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
|
|
5734
|
-
if (childOptions
|
|
5713
|
+
if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
|
|
5735
5714
|
var values = obj.map(function(childVal) {
|
|
5736
5715
|
return parser.parseObject(childVal, "value", options);
|
|
5737
5716
|
}).filter(function(child) {
|
|
@@ -5742,7 +5721,7 @@ var CommonTypesPlugin = function() {
|
|
|
5742
5721
|
}
|
|
5743
5722
|
var multiNode = parser.createASTNode({
|
|
5744
5723
|
type: "multi-node",
|
|
5745
|
-
override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5724
|
+
override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5746
5725
|
values: values
|
|
5747
5726
|
}, obj);
|
|
5748
5727
|
if (!multiNode) {
|
|
@@ -5753,7 +5732,7 @@ var CommonTypesPlugin = function() {
|
|
|
5753
5732
|
v.parent = multiNode;
|
|
5754
5733
|
});
|
|
5755
5734
|
}
|
|
5756
|
-
return [
|
|
5735
|
+
return childOptions === void 0 ? multiNode : [
|
|
5757
5736
|
{
|
|
5758
5737
|
path: _to_consumable_array(childOptions.path).concat([
|
|
5759
5738
|
childOptions.key
|
|
@@ -5783,7 +5762,7 @@ var CommonTypesPlugin = function() {
|
|
|
5783
5762
|
key: "applyParser",
|
|
5784
5763
|
value: function applyParser(parser) {
|
|
5785
5764
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
5786
|
-
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
|
|
5765
|
+
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
5787
5766
|
var assetAST = parser.parseObject(obj, "asset", options);
|
|
5788
5767
|
if (!assetAST) {
|
|
5789
5768
|
return [];
|
|
@@ -5983,6 +5962,7 @@ var CommonTypesPlugin = function() {
|
|
|
5983
5962
|
}();
|
|
5984
5963
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
5985
5964
|
function FlowInstance(id, flow, options) {
|
|
5965
|
+
var _this = this;
|
|
5986
5966
|
_class_call_check(this, FlowInstance);
|
|
5987
5967
|
this.isTransitioning = false;
|
|
5988
5968
|
this.hooks = {
|
|
@@ -5999,60 +5979,55 @@ var CommonTypesPlugin = function() {
|
|
|
5999
5979
|
this.flow = flow;
|
|
6000
5980
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
6001
5981
|
this.history = [];
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
5982
|
+
this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
|
|
5983
|
+
return _async_to_generator(function() {
|
|
6005
5984
|
var newState;
|
|
6006
5985
|
return _ts_generator(this, function(_state) {
|
|
6007
5986
|
newState = nextState.value;
|
|
6008
|
-
if (
|
|
6009
|
-
|
|
5987
|
+
if (this.flowPromise && newState.state_type === "END") {
|
|
5988
|
+
this.flowPromise.resolve(newState);
|
|
6010
5989
|
}
|
|
6011
5990
|
return [
|
|
6012
5991
|
2
|
|
6013
5992
|
];
|
|
6014
5993
|
});
|
|
6015
|
-
});
|
|
6016
|
-
|
|
6017
|
-
return _ref.apply(this, arguments);
|
|
6018
|
-
};
|
|
6019
|
-
}());
|
|
5994
|
+
}).call(_this);
|
|
5995
|
+
});
|
|
6020
5996
|
}
|
|
6021
5997
|
_create_class(FlowInstance, [
|
|
6022
5998
|
{
|
|
6023
5999
|
key: "start",
|
|
6024
6000
|
value: /** Start the state machine */ function start() {
|
|
6025
|
-
var _this = this;
|
|
6026
6001
|
return _async_to_generator(function() {
|
|
6027
6002
|
var _this_log, initialState;
|
|
6028
6003
|
return _ts_generator(this, function(_state) {
|
|
6029
|
-
if (
|
|
6004
|
+
if (this.flowPromise) {
|
|
6030
6005
|
;
|
|
6031
|
-
(_this_log =
|
|
6006
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
6032
6007
|
return [
|
|
6033
6008
|
2,
|
|
6034
|
-
|
|
6009
|
+
this.flowPromise.promise
|
|
6035
6010
|
];
|
|
6036
6011
|
}
|
|
6037
|
-
|
|
6038
|
-
if (
|
|
6039
|
-
|
|
6012
|
+
this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
|
|
6013
|
+
if (this.flow.onStart) {
|
|
6014
|
+
this.hooks.onStart.call(this.flow.onStart);
|
|
6040
6015
|
}
|
|
6041
|
-
initialState =
|
|
6016
|
+
initialState = this.flow.startState;
|
|
6042
6017
|
if (!initialState) {
|
|
6043
6018
|
return [
|
|
6044
6019
|
2,
|
|
6045
6020
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
6046
6021
|
];
|
|
6047
6022
|
}
|
|
6048
|
-
|
|
6049
|
-
|
|
6023
|
+
this.flowPromise = (0, import_p_defer2.default)();
|
|
6024
|
+
this.pushHistory(initialState);
|
|
6050
6025
|
return [
|
|
6051
6026
|
2,
|
|
6052
|
-
|
|
6027
|
+
this.flowPromise.promise
|
|
6053
6028
|
];
|
|
6054
6029
|
});
|
|
6055
|
-
})();
|
|
6030
|
+
}).call(this);
|
|
6056
6031
|
}
|
|
6057
6032
|
},
|
|
6058
6033
|
{
|
|
@@ -6104,7 +6079,7 @@ var CommonTypesPlugin = function() {
|
|
|
6104
6079
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6105
6080
|
}
|
|
6106
6081
|
var nextState = this.flow[stateName];
|
|
6107
|
-
if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
|
|
6082
|
+
if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
|
|
6108
6083
|
var _this_log;
|
|
6109
6084
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6110
6085
|
return;
|
|
@@ -6164,30 +6139,30 @@ var CommonTypesPlugin = function() {
|
|
|
6164
6139
|
{
|
|
6165
6140
|
key: "run",
|
|
6166
6141
|
value: function run(startState) {
|
|
6167
|
-
var _this = this;
|
|
6168
6142
|
return _async_to_generator(function() {
|
|
6169
|
-
var _this_log, startFlow, flow, end, firstItem;
|
|
6143
|
+
var _this, _this_log, startFlow, flow, end, firstItem;
|
|
6170
6144
|
return _ts_generator(this, function(_state) {
|
|
6171
6145
|
switch(_state.label){
|
|
6172
6146
|
case 0:
|
|
6173
|
-
|
|
6147
|
+
_this = this;
|
|
6148
|
+
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6174
6149
|
return [
|
|
6175
6150
|
2,
|
|
6176
6151
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6177
6152
|
];
|
|
6178
6153
|
}
|
|
6179
|
-
startFlow =
|
|
6180
|
-
if (startFlow === null || typeof startFlow !== "object") {
|
|
6154
|
+
startFlow = this.navigation[startState];
|
|
6155
|
+
if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
|
|
6181
6156
|
return [
|
|
6182
6157
|
2,
|
|
6183
6158
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6184
6159
|
];
|
|
6185
6160
|
}
|
|
6186
|
-
(_this_log =
|
|
6161
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6187
6162
|
flow = new FlowInstance(startState, startFlow, {
|
|
6188
|
-
logger:
|
|
6163
|
+
logger: this.log
|
|
6189
6164
|
});
|
|
6190
|
-
|
|
6165
|
+
this.addNewFlow(flow);
|
|
6191
6166
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6192
6167
|
var _flowInstance_currentState;
|
|
6193
6168
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6207,10 +6182,10 @@ var CommonTypesPlugin = function() {
|
|
|
6207
6182
|
];
|
|
6208
6183
|
case 1:
|
|
6209
6184
|
end = _state.sent();
|
|
6210
|
-
|
|
6211
|
-
if (
|
|
6185
|
+
this.navStack.pop();
|
|
6186
|
+
if (this.navStack.length > 0) {
|
|
6212
6187
|
firstItem = 0;
|
|
6213
|
-
|
|
6188
|
+
this.current = this.navStack[firstItem];
|
|
6214
6189
|
}
|
|
6215
6190
|
return [
|
|
6216
6191
|
2,
|
|
@@ -6218,16 +6193,15 @@ var CommonTypesPlugin = function() {
|
|
|
6218
6193
|
];
|
|
6219
6194
|
}
|
|
6220
6195
|
});
|
|
6221
|
-
})();
|
|
6196
|
+
}).call(this);
|
|
6222
6197
|
}
|
|
6223
6198
|
},
|
|
6224
6199
|
{
|
|
6225
6200
|
key: "start",
|
|
6226
6201
|
value: function start() {
|
|
6227
|
-
var _this = this;
|
|
6228
6202
|
return _async_to_generator(function() {
|
|
6229
6203
|
return _ts_generator(this, function(_state) {
|
|
6230
|
-
if (!
|
|
6204
|
+
if (!this.navigation.BEGIN) {
|
|
6231
6205
|
return [
|
|
6232
6206
|
2,
|
|
6233
6207
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6235,10 +6209,10 @@ var CommonTypesPlugin = function() {
|
|
|
6235
6209
|
}
|
|
6236
6210
|
return [
|
|
6237
6211
|
2,
|
|
6238
|
-
|
|
6212
|
+
this.run(this.navigation.BEGIN)
|
|
6239
6213
|
];
|
|
6240
6214
|
});
|
|
6241
|
-
})();
|
|
6215
|
+
}).call(this);
|
|
6242
6216
|
}
|
|
6243
6217
|
}
|
|
6244
6218
|
]);
|
|
@@ -7345,7 +7319,7 @@ var CommonTypesPlugin = function() {
|
|
|
7345
7319
|
var parentBinding = resolved.parent();
|
|
7346
7320
|
var property = resolved.key();
|
|
7347
7321
|
var parentValue = this.get(parentBinding);
|
|
7348
|
-
var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7322
|
+
var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7349
7323
|
this.getModel().delete(resolved, options);
|
|
7350
7324
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7351
7325
|
this.trash.add(resolved);
|
|
@@ -7446,7 +7420,7 @@ var CommonTypesPlugin = function() {
|
|
|
7446
7420
|
var expressionEvaluator;
|
|
7447
7421
|
var handleEval = function(exp) {
|
|
7448
7422
|
if (exp) {
|
|
7449
|
-
if (typeof exp === "object" && "exp" in exp) {
|
|
7423
|
+
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7450
7424
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7451
7425
|
} else {
|
|
7452
7426
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -7707,7 +7681,7 @@ var CommonTypesPlugin = function() {
|
|
|
7707
7681
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
7708
7682
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
7709
7683
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
7710
|
-
if (
|
|
7684
|
+
if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
|
|
7711
7685
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
7712
7686
|
} else {
|
|
7713
7687
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -7866,12 +7840,12 @@ var CommonTypesPlugin = function() {
|
|
|
7866
7840
|
{
|
|
7867
7841
|
key: "start",
|
|
7868
7842
|
value: function start(payload) {
|
|
7869
|
-
var _this = this;
|
|
7870
7843
|
return _async_to_generator(function() {
|
|
7871
|
-
var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7844
|
+
var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7872
7845
|
return _ts_generator(this, function(_state) {
|
|
7873
7846
|
switch(_state.label){
|
|
7874
7847
|
case 0:
|
|
7848
|
+
_this = this;
|
|
7875
7849
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
7876
7850
|
maybeUpdateState = function(newState) {
|
|
7877
7851
|
if (_this.state.ref !== ref) {
|
|
@@ -7881,7 +7855,7 @@ var CommonTypesPlugin = function() {
|
|
|
7881
7855
|
_this.setState(newState);
|
|
7882
7856
|
return newState;
|
|
7883
7857
|
};
|
|
7884
|
-
|
|
7858
|
+
this.setState({
|
|
7885
7859
|
status: "not-started",
|
|
7886
7860
|
ref: ref
|
|
7887
7861
|
});
|
|
@@ -7893,8 +7867,8 @@ var CommonTypesPlugin = function() {
|
|
|
7893
7867
|
,
|
|
7894
7868
|
4
|
|
7895
7869
|
]);
|
|
7896
|
-
_this_setupFlow =
|
|
7897
|
-
|
|
7870
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7871
|
+
this.setState(_object_spread({
|
|
7898
7872
|
ref: ref
|
|
7899
7873
|
}, state));
|
|
7900
7874
|
start();
|
|
@@ -7939,7 +7913,7 @@ var CommonTypesPlugin = function() {
|
|
|
7939
7913
|
];
|
|
7940
7914
|
}
|
|
7941
7915
|
});
|
|
7942
|
-
})();
|
|
7916
|
+
}).call(this);
|
|
7943
7917
|
}
|
|
7944
7918
|
}
|
|
7945
7919
|
]);
|
|
@@ -8041,7 +8015,7 @@ var CommonTypesPlugin = function() {
|
|
|
8041
8015
|
}
|
|
8042
8016
|
});
|
|
8043
8017
|
var length = skipNullish(function(context, value, options) {
|
|
8044
|
-
if (typeof options !== "object") {
|
|
8018
|
+
if ((typeof options === "undefined" ? "undefined" : _type_of(options)) !== "object") {
|
|
8045
8019
|
context.logger.warn("Missing comparison in length validation");
|
|
8046
8020
|
return;
|
|
8047
8021
|
}
|
|
@@ -8050,7 +8024,7 @@ var CommonTypesPlugin = function() {
|
|
|
8050
8024
|
if (typeof value === "string") {
|
|
8051
8025
|
valLength = value.length;
|
|
8052
8026
|
itemName = "characters";
|
|
8053
|
-
} else if (typeof value === "object" && value !== null) {
|
|
8027
|
+
} else if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
8054
8028
|
valLength = Object.keys(value).length;
|
|
8055
8029
|
}
|
|
8056
8030
|
if (valLength === void 0) {
|