@player-ui/check-path-plugin 0.14.0-next.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
|
};
|
|
@@ -1553,7 +1537,7 @@ var CheckPathPlugin = function() {
|
|
|
1553
1537
|
});
|
|
1554
1538
|
};
|
|
1555
1539
|
var __copyProps = function(to, from, except, desc) {
|
|
1556
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1540
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1557
1541
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1558
1542
|
try {
|
|
1559
1543
|
var _loop = function() {
|
|
@@ -1608,15 +1592,16 @@ var CheckPathPlugin = function() {
|
|
|
1608
1592
|
exports.toError = exports.NestedError = void 0;
|
|
1609
1593
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1610
1594
|
_inherits(_NestedError, Error1);
|
|
1611
|
-
var _super = _create_super(_NestedError);
|
|
1612
1595
|
function _NestedError(message) {
|
|
1613
1596
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1614
1597
|
innerErrors[_key - 1] = arguments[_key];
|
|
1615
1598
|
}
|
|
1616
1599
|
_class_call_check(this, _NestedError);
|
|
1617
1600
|
var _this;
|
|
1618
|
-
_this =
|
|
1619
|
-
|
|
1601
|
+
_this = _call_super(this, _NestedError, [
|
|
1602
|
+
message
|
|
1603
|
+
]);
|
|
1604
|
+
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1620
1605
|
if (innerErrors.length === 1) {
|
|
1621
1606
|
var innerError = toError(innerErrors[0]);
|
|
1622
1607
|
_this.innerErrors = [
|
|
@@ -1752,7 +1737,7 @@ var CheckPathPlugin = function() {
|
|
|
1752
1737
|
return out;
|
|
1753
1738
|
}
|
|
1754
1739
|
function isObject(o) {
|
|
1755
|
-
return o != null && typeof o === "object";
|
|
1740
|
+
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1756
1741
|
}
|
|
1757
1742
|
function addLast2(array, val) {
|
|
1758
1743
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2095,7 +2080,7 @@ var CheckPathPlugin = function() {
|
|
|
2095
2080
|
else return 0;
|
|
2096
2081
|
}
|
|
2097
2082
|
}();
|
|
2098
|
-
if (typeof module === "object") module.exports = SortedArray2;
|
|
2083
|
+
if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
|
|
2099
2084
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2100
2085
|
return SortedArray2;
|
|
2101
2086
|
});
|
|
@@ -2292,10 +2277,9 @@ var CheckPathPlugin = function() {
|
|
|
2292
2277
|
}();
|
|
2293
2278
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2294
2279
|
_inherits(SyncHook, Hook);
|
|
2295
|
-
var _super = _create_super(SyncHook);
|
|
2296
2280
|
function SyncHook() {
|
|
2297
2281
|
_class_call_check(this, SyncHook);
|
|
2298
|
-
return
|
|
2282
|
+
return _call_super(this, SyncHook, arguments);
|
|
2299
2283
|
}
|
|
2300
2284
|
_create_class(SyncHook, [
|
|
2301
2285
|
{
|
|
@@ -2328,10 +2312,9 @@ var CheckPathPlugin = function() {
|
|
|
2328
2312
|
}(Hook);
|
|
2329
2313
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2330
2314
|
_inherits(SyncBailHook, Hook);
|
|
2331
|
-
var _super = _create_super(SyncBailHook);
|
|
2332
2315
|
function SyncBailHook() {
|
|
2333
2316
|
_class_call_check(this, SyncBailHook);
|
|
2334
|
-
return
|
|
2317
|
+
return _call_super(this, SyncBailHook, arguments);
|
|
2335
2318
|
}
|
|
2336
2319
|
_create_class(SyncBailHook, [
|
|
2337
2320
|
{
|
|
@@ -2363,10 +2346,9 @@ var CheckPathPlugin = function() {
|
|
|
2363
2346
|
}(Hook);
|
|
2364
2347
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2365
2348
|
_inherits(SyncWaterfallHook, Hook);
|
|
2366
|
-
var _super = _create_super(SyncWaterfallHook);
|
|
2367
2349
|
function SyncWaterfallHook() {
|
|
2368
2350
|
_class_call_check(this, SyncWaterfallHook);
|
|
2369
|
-
return
|
|
2351
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
2370
2352
|
}
|
|
2371
2353
|
_create_class(SyncWaterfallHook, [
|
|
2372
2354
|
{
|
|
@@ -2428,7 +2410,7 @@ var CheckPathPlugin = function() {
|
|
|
2428
2410
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2429
2411
|
len = _step.value;
|
|
2430
2412
|
tmp = len;
|
|
2431
|
-
if (tmp && typeof tmp === "object") {
|
|
2413
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2432
2414
|
tmp = find(bar, tmp);
|
|
2433
2415
|
if (!tmp) return false;
|
|
2434
2416
|
}
|
|
@@ -2459,7 +2441,7 @@ var CheckPathPlugin = function() {
|
|
|
2459
2441
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2460
2442
|
len = _step1.value;
|
|
2461
2443
|
tmp = len[0];
|
|
2462
|
-
if (tmp && typeof tmp === "object") {
|
|
2444
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2463
2445
|
tmp = find(bar, tmp);
|
|
2464
2446
|
if (!tmp) return false;
|
|
2465
2447
|
}
|
|
@@ -2498,7 +2480,7 @@ var CheckPathPlugin = function() {
|
|
|
2498
2480
|
}
|
|
2499
2481
|
return len === -1;
|
|
2500
2482
|
}
|
|
2501
|
-
if (!ctor || typeof foo === "object") {
|
|
2483
|
+
if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
|
|
2502
2484
|
len = 0;
|
|
2503
2485
|
for(ctor in foo){
|
|
2504
2486
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -2531,7 +2513,7 @@ var CheckPathPlugin = function() {
|
|
|
2531
2513
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2532
2514
|
key
|
|
2533
2515
|
]);
|
|
2534
|
-
if (typeof val === "object") {
|
|
2516
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
2535
2517
|
traverseObj(val, nestedPath, pairs);
|
|
2536
2518
|
} else {
|
|
2537
2519
|
pairs.set(nestedPath, val);
|
|
@@ -2572,7 +2554,7 @@ var CheckPathPlugin = function() {
|
|
|
2572
2554
|
{
|
|
2573
2555
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
2574
2556
|
value: function set(match, value) {
|
|
2575
|
-
var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2557
|
+
var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2576
2558
|
this.store.insert({
|
|
2577
2559
|
key: match,
|
|
2578
2560
|
value: value,
|
|
@@ -3112,7 +3094,7 @@ var CheckPathPlugin = function() {
|
|
|
3112
3094
|
var _this_parseCache_path;
|
|
3113
3095
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3114
3096
|
this.parseCache[path] = ast;
|
|
3115
|
-
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)) {
|
|
3116
3098
|
var _ast_error;
|
|
3117
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."));
|
|
3118
3100
|
}
|
|
@@ -3312,14 +3294,13 @@ var CheckPathPlugin = function() {
|
|
|
3312
3294
|
}();
|
|
3313
3295
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3314
3296
|
_inherits(DependencyModel, DependencyTracker);
|
|
3315
|
-
var _super = _create_super(DependencyModel);
|
|
3316
3297
|
function DependencyModel(rootModel) {
|
|
3317
3298
|
_class_call_check(this, DependencyModel);
|
|
3318
3299
|
var _this;
|
|
3319
|
-
_this =
|
|
3300
|
+
_this = _call_super(this, DependencyModel);
|
|
3320
3301
|
_this.rootModel = rootModel;
|
|
3321
|
-
_this.set = _this.set.bind(
|
|
3322
|
-
_this.get = _this.get.bind(
|
|
3302
|
+
_this.set = _this.set.bind(_this);
|
|
3303
|
+
_this.get = _this.get.bind(_this);
|
|
3323
3304
|
return _this;
|
|
3324
3305
|
}
|
|
3325
3306
|
_create_class(DependencyModel, [
|
|
@@ -3863,23 +3844,20 @@ var CheckPathPlugin = function() {
|
|
|
3863
3844
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3864
3845
|
*/ key: "evaluateAsync",
|
|
3865
3846
|
value: function evaluateAsync(expr, options) {
|
|
3847
|
+
var _this = this;
|
|
3866
3848
|
if (Array.isArray(expr)) {
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
var _ref = _async_to_generator(function(exp) {
|
|
3849
|
+
return collateAwaitable(expr.map(function(exp) {
|
|
3850
|
+
return _async_to_generator(function() {
|
|
3870
3851
|
return _ts_generator(this, function(_state) {
|
|
3871
3852
|
return [
|
|
3872
3853
|
2,
|
|
3873
|
-
|
|
3854
|
+
this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3874
3855
|
async: true
|
|
3875
3856
|
}))
|
|
3876
3857
|
];
|
|
3877
3858
|
});
|
|
3878
|
-
});
|
|
3879
|
-
|
|
3880
|
-
return _ref.apply(this, arguments);
|
|
3881
|
-
};
|
|
3882
|
-
}())).awaitableThen(function(values) {
|
|
3859
|
+
}).call(_this);
|
|
3860
|
+
})).awaitableThen(function(values) {
|
|
3883
3861
|
return values.pop();
|
|
3884
3862
|
});
|
|
3885
3863
|
} else {
|
|
@@ -4655,7 +4633,7 @@ var CheckPathPlugin = function() {
|
|
|
4655
4633
|
}
|
|
4656
4634
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4657
4635
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4658
|
-
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4636
|
+
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4659
4637
|
return {
|
|
4660
4638
|
value: objToParse,
|
|
4661
4639
|
children: []
|
|
@@ -4692,7 +4670,7 @@ var CheckPathPlugin = function() {
|
|
|
4692
4670
|
if (newChildren) {
|
|
4693
4671
|
var _children2;
|
|
4694
4672
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4695
|
-
} else if (localValue && typeof localValue === "object") {
|
|
4673
|
+
} else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
|
|
4696
4674
|
var _children21;
|
|
4697
4675
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4698
4676
|
localKey
|
|
@@ -4850,7 +4828,7 @@ var CheckPathPlugin = function() {
|
|
|
4850
4828
|
Object.keys(clonedNode).forEach(function(key) {
|
|
4851
4829
|
if (key === "parent") return;
|
|
4852
4830
|
var value = clonedNode[key];
|
|
4853
|
-
if (typeof value === "object" && value !== null) {
|
|
4831
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
4854
4832
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
4855
4833
|
}
|
|
4856
4834
|
});
|
|
@@ -5202,7 +5180,7 @@ var CheckPathPlugin = function() {
|
|
|
5202
5180
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5203
5181
|
var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
|
|
5204
5182
|
var flags = "g";
|
|
5205
|
-
if (typeof expression === "object") {
|
|
5183
|
+
if ((typeof expression === "undefined" ? "undefined" : _type_of(expression)) === "object") {
|
|
5206
5184
|
flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
|
|
5207
5185
|
}
|
|
5208
5186
|
templateStr = templateStr.replace(new RegExp(expression, flags), value);
|
|
@@ -5351,7 +5329,7 @@ var CheckPathPlugin = function() {
|
|
|
5351
5329
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5352
5330
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5353
5331
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5354
|
-
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") {
|
|
5355
5333
|
return node;
|
|
5356
5334
|
}
|
|
5357
5335
|
if (typeof node === "string") {
|
|
@@ -5364,7 +5342,7 @@ var CheckPathPlugin = function() {
|
|
|
5364
5342
|
}
|
|
5365
5343
|
var val = node[key];
|
|
5366
5344
|
var newVal = val;
|
|
5367
|
-
if (typeof val === "object") {
|
|
5345
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
5368
5346
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5369
5347
|
} else if (typeof val === "string") {
|
|
5370
5348
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -5705,7 +5683,7 @@ var CheckPathPlugin = function() {
|
|
|
5705
5683
|
key: "applyParser",
|
|
5706
5684
|
value: function applyParser(parser) {
|
|
5707
5685
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
5708
|
-
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") {
|
|
5709
5687
|
var assetAST = parser.parseObject(obj, "asset", options);
|
|
5710
5688
|
if (!assetAST) {
|
|
5711
5689
|
return [];
|
|
@@ -5905,6 +5883,7 @@ var CheckPathPlugin = function() {
|
|
|
5905
5883
|
}();
|
|
5906
5884
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
5907
5885
|
function FlowInstance(id, flow, options) {
|
|
5886
|
+
var _this = this;
|
|
5908
5887
|
_class_call_check(this, FlowInstance);
|
|
5909
5888
|
this.isTransitioning = false;
|
|
5910
5889
|
this.hooks = {
|
|
@@ -5921,60 +5900,55 @@ var CheckPathPlugin = function() {
|
|
|
5921
5900
|
this.flow = flow;
|
|
5922
5901
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
5923
5902
|
this.history = [];
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
5903
|
+
this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
|
|
5904
|
+
return _async_to_generator(function() {
|
|
5927
5905
|
var newState;
|
|
5928
5906
|
return _ts_generator(this, function(_state) {
|
|
5929
5907
|
newState = nextState.value;
|
|
5930
|
-
if (
|
|
5931
|
-
|
|
5908
|
+
if (this.flowPromise && newState.state_type === "END") {
|
|
5909
|
+
this.flowPromise.resolve(newState);
|
|
5932
5910
|
}
|
|
5933
5911
|
return [
|
|
5934
5912
|
2
|
|
5935
5913
|
];
|
|
5936
5914
|
});
|
|
5937
|
-
});
|
|
5938
|
-
|
|
5939
|
-
return _ref.apply(this, arguments);
|
|
5940
|
-
};
|
|
5941
|
-
}());
|
|
5915
|
+
}).call(_this);
|
|
5916
|
+
});
|
|
5942
5917
|
}
|
|
5943
5918
|
_create_class(FlowInstance, [
|
|
5944
5919
|
{
|
|
5945
5920
|
key: "start",
|
|
5946
5921
|
value: /** Start the state machine */ function start() {
|
|
5947
|
-
var _this = this;
|
|
5948
5922
|
return _async_to_generator(function() {
|
|
5949
5923
|
var _this_log, initialState;
|
|
5950
5924
|
return _ts_generator(this, function(_state) {
|
|
5951
|
-
if (
|
|
5925
|
+
if (this.flowPromise) {
|
|
5952
5926
|
;
|
|
5953
|
-
(_this_log =
|
|
5927
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
5954
5928
|
return [
|
|
5955
5929
|
2,
|
|
5956
|
-
|
|
5930
|
+
this.flowPromise.promise
|
|
5957
5931
|
];
|
|
5958
5932
|
}
|
|
5959
|
-
|
|
5960
|
-
if (
|
|
5961
|
-
|
|
5933
|
+
this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
|
|
5934
|
+
if (this.flow.onStart) {
|
|
5935
|
+
this.hooks.onStart.call(this.flow.onStart);
|
|
5962
5936
|
}
|
|
5963
|
-
initialState =
|
|
5937
|
+
initialState = this.flow.startState;
|
|
5964
5938
|
if (!initialState) {
|
|
5965
5939
|
return [
|
|
5966
5940
|
2,
|
|
5967
5941
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
5968
5942
|
];
|
|
5969
5943
|
}
|
|
5970
|
-
|
|
5971
|
-
|
|
5944
|
+
this.flowPromise = (0, import_p_defer2.default)();
|
|
5945
|
+
this.pushHistory(initialState);
|
|
5972
5946
|
return [
|
|
5973
5947
|
2,
|
|
5974
|
-
|
|
5948
|
+
this.flowPromise.promise
|
|
5975
5949
|
];
|
|
5976
5950
|
});
|
|
5977
|
-
})();
|
|
5951
|
+
}).call(this);
|
|
5978
5952
|
}
|
|
5979
5953
|
},
|
|
5980
5954
|
{
|
|
@@ -6026,7 +6000,7 @@ var CheckPathPlugin = function() {
|
|
|
6026
6000
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6027
6001
|
}
|
|
6028
6002
|
var nextState = this.flow[stateName];
|
|
6029
|
-
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)) {
|
|
6030
6004
|
var _this_log;
|
|
6031
6005
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6032
6006
|
return;
|
|
@@ -6086,30 +6060,30 @@ var CheckPathPlugin = function() {
|
|
|
6086
6060
|
{
|
|
6087
6061
|
key: "run",
|
|
6088
6062
|
value: function run(startState) {
|
|
6089
|
-
var _this = this;
|
|
6090
6063
|
return _async_to_generator(function() {
|
|
6091
|
-
var _this_log, startFlow, flow, end, firstItem;
|
|
6064
|
+
var _this, _this_log, startFlow, flow, end, firstItem;
|
|
6092
6065
|
return _ts_generator(this, function(_state) {
|
|
6093
6066
|
switch(_state.label){
|
|
6094
6067
|
case 0:
|
|
6095
|
-
|
|
6068
|
+
_this = this;
|
|
6069
|
+
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6096
6070
|
return [
|
|
6097
6071
|
2,
|
|
6098
6072
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6099
6073
|
];
|
|
6100
6074
|
}
|
|
6101
|
-
startFlow =
|
|
6102
|
-
if (startFlow === null || typeof startFlow !== "object") {
|
|
6075
|
+
startFlow = this.navigation[startState];
|
|
6076
|
+
if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
|
|
6103
6077
|
return [
|
|
6104
6078
|
2,
|
|
6105
6079
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6106
6080
|
];
|
|
6107
6081
|
}
|
|
6108
|
-
(_this_log =
|
|
6082
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6109
6083
|
flow = new FlowInstance(startState, startFlow, {
|
|
6110
|
-
logger:
|
|
6084
|
+
logger: this.log
|
|
6111
6085
|
});
|
|
6112
|
-
|
|
6086
|
+
this.addNewFlow(flow);
|
|
6113
6087
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6114
6088
|
var _flowInstance_currentState;
|
|
6115
6089
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6129,10 +6103,10 @@ var CheckPathPlugin = function() {
|
|
|
6129
6103
|
];
|
|
6130
6104
|
case 1:
|
|
6131
6105
|
end = _state.sent();
|
|
6132
|
-
|
|
6133
|
-
if (
|
|
6106
|
+
this.navStack.pop();
|
|
6107
|
+
if (this.navStack.length > 0) {
|
|
6134
6108
|
firstItem = 0;
|
|
6135
|
-
|
|
6109
|
+
this.current = this.navStack[firstItem];
|
|
6136
6110
|
}
|
|
6137
6111
|
return [
|
|
6138
6112
|
2,
|
|
@@ -6140,16 +6114,15 @@ var CheckPathPlugin = function() {
|
|
|
6140
6114
|
];
|
|
6141
6115
|
}
|
|
6142
6116
|
});
|
|
6143
|
-
})();
|
|
6117
|
+
}).call(this);
|
|
6144
6118
|
}
|
|
6145
6119
|
},
|
|
6146
6120
|
{
|
|
6147
6121
|
key: "start",
|
|
6148
6122
|
value: function start() {
|
|
6149
|
-
var _this = this;
|
|
6150
6123
|
return _async_to_generator(function() {
|
|
6151
6124
|
return _ts_generator(this, function(_state) {
|
|
6152
|
-
if (!
|
|
6125
|
+
if (!this.navigation.BEGIN) {
|
|
6153
6126
|
return [
|
|
6154
6127
|
2,
|
|
6155
6128
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6157,10 +6130,10 @@ var CheckPathPlugin = function() {
|
|
|
6157
6130
|
}
|
|
6158
6131
|
return [
|
|
6159
6132
|
2,
|
|
6160
|
-
|
|
6133
|
+
this.run(this.navigation.BEGIN)
|
|
6161
6134
|
];
|
|
6162
6135
|
});
|
|
6163
|
-
})();
|
|
6136
|
+
}).call(this);
|
|
6164
6137
|
}
|
|
6165
6138
|
}
|
|
6166
6139
|
]);
|
|
@@ -7267,7 +7240,7 @@ var CheckPathPlugin = function() {
|
|
|
7267
7240
|
var parentBinding = resolved.parent();
|
|
7268
7241
|
var property = resolved.key();
|
|
7269
7242
|
var parentValue = this.get(parentBinding);
|
|
7270
|
-
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);
|
|
7271
7244
|
this.getModel().delete(resolved, options);
|
|
7272
7245
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7273
7246
|
this.trash.add(resolved);
|
|
@@ -7368,7 +7341,7 @@ var CheckPathPlugin = function() {
|
|
|
7368
7341
|
var expressionEvaluator;
|
|
7369
7342
|
var handleEval = function(exp) {
|
|
7370
7343
|
if (exp) {
|
|
7371
|
-
if (typeof exp === "object" && "exp" in exp) {
|
|
7344
|
+
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7372
7345
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7373
7346
|
} else {
|
|
7374
7347
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -7629,7 +7602,7 @@ var CheckPathPlugin = function() {
|
|
|
7629
7602
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
7630
7603
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
7631
7604
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
7632
|
-
if (
|
|
7605
|
+
if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
|
|
7633
7606
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
7634
7607
|
} else {
|
|
7635
7608
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -7788,12 +7761,12 @@ var CheckPathPlugin = function() {
|
|
|
7788
7761
|
{
|
|
7789
7762
|
key: "start",
|
|
7790
7763
|
value: function start(payload) {
|
|
7791
|
-
var _this = this;
|
|
7792
7764
|
return _async_to_generator(function() {
|
|
7793
|
-
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;
|
|
7794
7766
|
return _ts_generator(this, function(_state) {
|
|
7795
7767
|
switch(_state.label){
|
|
7796
7768
|
case 0:
|
|
7769
|
+
_this = this;
|
|
7797
7770
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
7798
7771
|
maybeUpdateState = function(newState) {
|
|
7799
7772
|
if (_this.state.ref !== ref) {
|
|
@@ -7803,7 +7776,7 @@ var CheckPathPlugin = function() {
|
|
|
7803
7776
|
_this.setState(newState);
|
|
7804
7777
|
return newState;
|
|
7805
7778
|
};
|
|
7806
|
-
|
|
7779
|
+
this.setState({
|
|
7807
7780
|
status: "not-started",
|
|
7808
7781
|
ref: ref
|
|
7809
7782
|
});
|
|
@@ -7815,8 +7788,8 @@ var CheckPathPlugin = function() {
|
|
|
7815
7788
|
,
|
|
7816
7789
|
4
|
|
7817
7790
|
]);
|
|
7818
|
-
_this_setupFlow =
|
|
7819
|
-
|
|
7791
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7792
|
+
this.setState(_object_spread({
|
|
7820
7793
|
ref: ref
|
|
7821
7794
|
}, state));
|
|
7822
7795
|
start();
|
|
@@ -7861,7 +7834,7 @@ var CheckPathPlugin = function() {
|
|
|
7861
7834
|
];
|
|
7862
7835
|
}
|
|
7863
7836
|
});
|
|
7864
|
-
})();
|
|
7837
|
+
}).call(this);
|
|
7865
7838
|
}
|
|
7866
7839
|
}
|
|
7867
7840
|
]);
|