@player-ui/player 0.15.2 → 0.15.3--canary.836.34893
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Player.native.js +126 -98
- package/dist/Player.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/Player.native.js
CHANGED
|
@@ -45,10 +45,6 @@ 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
|
-
}
|
|
52
48
|
function _class_call_check(instance, Constructor) {
|
|
53
49
|
if (!(instance instanceof Constructor)) {
|
|
54
50
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -287,15 +283,31 @@ function _wrap_native_super(Class) {
|
|
|
287
283
|
return _wrap_native_super(Class);
|
|
288
284
|
}
|
|
289
285
|
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;
|
|
290
289
|
try {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return
|
|
295
|
-
}
|
|
290
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
291
|
+
return true;
|
|
292
|
+
} catch (e) {
|
|
293
|
+
return false;
|
|
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
|
+
};
|
|
296
308
|
}
|
|
297
309
|
function _ts_generator(thisArg, body) {
|
|
298
|
-
var f, y, t, _ = {
|
|
310
|
+
var f, y, t, g, _ = {
|
|
299
311
|
label: 0,
|
|
300
312
|
sent: function() {
|
|
301
313
|
if (t[0] & 1) throw t[1];
|
|
@@ -303,8 +315,12 @@ function _ts_generator(thisArg, body) {
|
|
|
303
315
|
},
|
|
304
316
|
trys: [],
|
|
305
317
|
ops: []
|
|
306
|
-
}
|
|
307
|
-
return g
|
|
318
|
+
};
|
|
319
|
+
return g = {
|
|
320
|
+
next: verb(0),
|
|
321
|
+
"throw": verb(1),
|
|
322
|
+
"return": verb(2)
|
|
323
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
308
324
|
return this;
|
|
309
325
|
}), g;
|
|
310
326
|
function verb(n) {
|
|
@@ -317,7 +333,7 @@ function _ts_generator(thisArg, body) {
|
|
|
317
333
|
}
|
|
318
334
|
function step(op) {
|
|
319
335
|
if (f) throw new TypeError("Generator is already executing.");
|
|
320
|
-
while(
|
|
336
|
+
while(_)try {
|
|
321
337
|
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;
|
|
322
338
|
if (y = 0, t) op = [
|
|
323
339
|
op[0] & 2,
|
|
@@ -425,7 +441,7 @@ var Player = function() {
|
|
|
425
441
|
};
|
|
426
442
|
var findInArray = function findInArray(array, key, value) {
|
|
427
443
|
return array.findIndex(function(obj) {
|
|
428
|
-
if (obj &&
|
|
444
|
+
if (obj && typeof obj === "object") {
|
|
429
445
|
return obj[key] == value;
|
|
430
446
|
}
|
|
431
447
|
return false;
|
|
@@ -524,7 +540,7 @@ var Player = function() {
|
|
|
524
540
|
return t2 === r ? l : t2;
|
|
525
541
|
};
|
|
526
542
|
var isExpressionNode = function isExpressionNode(x) {
|
|
527
|
-
return
|
|
543
|
+
return typeof x === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
|
|
528
544
|
};
|
|
529
545
|
var throwError = function throwError(message, index) {
|
|
530
546
|
var err = new Error("".concat(message, " at character ").concat(index));
|
|
@@ -1113,7 +1129,7 @@ var Player = function() {
|
|
|
1113
1129
|
function isPromiseLike(value) {
|
|
1114
1130
|
var // Check for standard Promise constructor name
|
|
1115
1131
|
_value_constructor;
|
|
1116
|
-
return value != null &&
|
|
1132
|
+
return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
|
|
1117
1133
|
(_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
|
|
1118
1134
|
typeof value.catch === "function" && typeof value.finally === "function");
|
|
1119
1135
|
};
|
|
@@ -1140,7 +1156,7 @@ var Player = function() {
|
|
|
1140
1156
|
if (isExpressionNode(expr)) {
|
|
1141
1157
|
return false;
|
|
1142
1158
|
}
|
|
1143
|
-
return
|
|
1159
|
+
return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
|
|
1144
1160
|
};
|
|
1145
1161
|
var isErrorWithLocation = function isErrorWithLocation(error) {
|
|
1146
1162
|
return error.index !== void 0 && error.description !== void 0;
|
|
@@ -1384,7 +1400,7 @@ var Player = function() {
|
|
|
1384
1400
|
if (!node) {
|
|
1385
1401
|
return;
|
|
1386
1402
|
}
|
|
1387
|
-
if ("value" in node &&
|
|
1403
|
+
if ("value" in node && typeof node.value === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
|
|
1388
1404
|
return node.value.id;
|
|
1389
1405
|
}
|
|
1390
1406
|
};
|
|
@@ -1535,7 +1551,7 @@ var Player = function() {
|
|
|
1535
1551
|
});
|
|
1536
1552
|
};
|
|
1537
1553
|
var __copyProps = function(to, from, except, desc) {
|
|
1538
|
-
if (from &&
|
|
1554
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1539
1555
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1540
1556
|
try {
|
|
1541
1557
|
var _loop = function() {
|
|
@@ -1590,16 +1606,15 @@ var Player = function() {
|
|
|
1590
1606
|
exports.toError = exports.NestedError = void 0;
|
|
1591
1607
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1592
1608
|
_inherits(_NestedError, Error1);
|
|
1609
|
+
var _super = _create_super(_NestedError);
|
|
1593
1610
|
function _NestedError(message) {
|
|
1594
1611
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1595
1612
|
innerErrors[_key - 1] = arguments[_key];
|
|
1596
1613
|
}
|
|
1597
1614
|
_class_call_check(this, _NestedError);
|
|
1598
1615
|
var _this;
|
|
1599
|
-
_this =
|
|
1600
|
-
|
|
1601
|
-
]);
|
|
1602
|
-
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1616
|
+
_this = _super.call(this, message);
|
|
1617
|
+
var thisErrorReport = _NestedError.getErrorReport(_assert_this_initialized(_this));
|
|
1603
1618
|
if (innerErrors.length === 1) {
|
|
1604
1619
|
var innerError = toError(innerErrors[0]);
|
|
1605
1620
|
_this.innerErrors = [
|
|
@@ -1735,7 +1750,7 @@ var Player = function() {
|
|
|
1735
1750
|
return out;
|
|
1736
1751
|
}
|
|
1737
1752
|
function isObject(o) {
|
|
1738
|
-
return o != null &&
|
|
1753
|
+
return o != null && typeof o === "object";
|
|
1739
1754
|
}
|
|
1740
1755
|
function addLast2(array, val) {
|
|
1741
1756
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2078,7 +2093,7 @@ var Player = function() {
|
|
|
2078
2093
|
else return 0;
|
|
2079
2094
|
}
|
|
2080
2095
|
}();
|
|
2081
|
-
if (
|
|
2096
|
+
if (typeof module === "object") module.exports = SortedArray2;
|
|
2082
2097
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2083
2098
|
return SortedArray2;
|
|
2084
2099
|
});
|
|
@@ -2500,9 +2515,10 @@ var Player = function() {
|
|
|
2500
2515
|
}();
|
|
2501
2516
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2502
2517
|
_inherits(SyncHook, Hook);
|
|
2518
|
+
var _super = _create_super(SyncHook);
|
|
2503
2519
|
function SyncHook() {
|
|
2504
2520
|
_class_call_check(this, SyncHook);
|
|
2505
|
-
return
|
|
2521
|
+
return _super.apply(this, arguments);
|
|
2506
2522
|
}
|
|
2507
2523
|
_create_class(SyncHook, [
|
|
2508
2524
|
{
|
|
@@ -2535,9 +2551,10 @@ var Player = function() {
|
|
|
2535
2551
|
}(Hook);
|
|
2536
2552
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2537
2553
|
_inherits(SyncBailHook, Hook);
|
|
2554
|
+
var _super = _create_super(SyncBailHook);
|
|
2538
2555
|
function SyncBailHook() {
|
|
2539
2556
|
_class_call_check(this, SyncBailHook);
|
|
2540
|
-
return
|
|
2557
|
+
return _super.apply(this, arguments);
|
|
2541
2558
|
}
|
|
2542
2559
|
_create_class(SyncBailHook, [
|
|
2543
2560
|
{
|
|
@@ -2569,9 +2586,10 @@ var Player = function() {
|
|
|
2569
2586
|
}(Hook);
|
|
2570
2587
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2571
2588
|
_inherits(SyncWaterfallHook, Hook);
|
|
2589
|
+
var _super = _create_super(SyncWaterfallHook);
|
|
2572
2590
|
function SyncWaterfallHook() {
|
|
2573
2591
|
_class_call_check(this, SyncWaterfallHook);
|
|
2574
|
-
return
|
|
2592
|
+
return _super.apply(this, arguments);
|
|
2575
2593
|
}
|
|
2576
2594
|
_create_class(SyncWaterfallHook, [
|
|
2577
2595
|
{
|
|
@@ -3067,7 +3085,7 @@ var Player = function() {
|
|
|
3067
3085
|
var _this_parseCache_path;
|
|
3068
3086
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3069
3087
|
this.parseCache[path] = ast;
|
|
3070
|
-
if (
|
|
3088
|
+
if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3071
3089
|
var _ast_error;
|
|
3072
3090
|
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."));
|
|
3073
3091
|
}
|
|
@@ -3268,12 +3286,13 @@ var Player = function() {
|
|
|
3268
3286
|
}();
|
|
3269
3287
|
var DependencyMiddleware = /*#__PURE__*/ function(DependencyTracker) {
|
|
3270
3288
|
_inherits(DependencyMiddleware, DependencyTracker);
|
|
3289
|
+
var _super = _create_super(DependencyMiddleware);
|
|
3271
3290
|
function DependencyMiddleware() {
|
|
3272
3291
|
_class_call_check(this, DependencyMiddleware);
|
|
3273
3292
|
var _this;
|
|
3274
|
-
_this =
|
|
3275
|
-
_this.get = _this.get.bind(_this);
|
|
3276
|
-
_this.set = _this.set.bind(_this);
|
|
3293
|
+
_this = _super.call(this);
|
|
3294
|
+
_this.get = _this.get.bind(_assert_this_initialized(_this));
|
|
3295
|
+
_this.set = _this.set.bind(_assert_this_initialized(_this));
|
|
3277
3296
|
return _this;
|
|
3278
3297
|
}
|
|
3279
3298
|
_create_class(DependencyMiddleware, [
|
|
@@ -3308,13 +3327,14 @@ var Player = function() {
|
|
|
3308
3327
|
}(DependencyTracker);
|
|
3309
3328
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3310
3329
|
_inherits(DependencyModel, DependencyTracker);
|
|
3330
|
+
var _super = _create_super(DependencyModel);
|
|
3311
3331
|
function DependencyModel(rootModel) {
|
|
3312
3332
|
_class_call_check(this, DependencyModel);
|
|
3313
3333
|
var _this;
|
|
3314
|
-
_this =
|
|
3334
|
+
_this = _super.call(this);
|
|
3315
3335
|
_this.rootModel = rootModel;
|
|
3316
|
-
_this.set = _this.set.bind(_this);
|
|
3317
|
-
_this.get = _this.get.bind(_this);
|
|
3336
|
+
_this.set = _this.set.bind(_assert_this_initialized(_this));
|
|
3337
|
+
_this.get = _this.get.bind(_assert_this_initialized(_this));
|
|
3318
3338
|
return _this;
|
|
3319
3339
|
}
|
|
3320
3340
|
_create_class(DependencyModel, [
|
|
@@ -3948,20 +3968,23 @@ var Player = function() {
|
|
|
3948
3968
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3949
3969
|
*/ key: "evaluateAsync",
|
|
3950
3970
|
value: function evaluateAsync(expr, options) {
|
|
3951
|
-
var _this = this;
|
|
3952
3971
|
if (Array.isArray(expr)) {
|
|
3953
|
-
|
|
3954
|
-
|
|
3972
|
+
var _this = this;
|
|
3973
|
+
return collateAwaitable(expr.map(function() {
|
|
3974
|
+
var _ref = _async_to_generator(function(exp) {
|
|
3955
3975
|
return _ts_generator(this, function(_state) {
|
|
3956
3976
|
return [
|
|
3957
3977
|
2,
|
|
3958
|
-
|
|
3978
|
+
_this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3959
3979
|
async: true
|
|
3960
3980
|
}))
|
|
3961
3981
|
];
|
|
3962
3982
|
});
|
|
3963
|
-
})
|
|
3964
|
-
|
|
3983
|
+
});
|
|
3984
|
+
return function(exp) {
|
|
3985
|
+
return _ref.apply(this, arguments);
|
|
3986
|
+
};
|
|
3987
|
+
}())).awaitableThen(function(values) {
|
|
3965
3988
|
return values.pop();
|
|
3966
3989
|
});
|
|
3967
3990
|
} else {
|
|
@@ -4786,7 +4809,7 @@ var Player = function() {
|
|
|
4786
4809
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4787
4810
|
len = _step.value;
|
|
4788
4811
|
tmp = len;
|
|
4789
|
-
if (tmp &&
|
|
4812
|
+
if (tmp && typeof tmp === "object") {
|
|
4790
4813
|
tmp = find(bar, tmp);
|
|
4791
4814
|
if (!tmp) return false;
|
|
4792
4815
|
}
|
|
@@ -4817,7 +4840,7 @@ var Player = function() {
|
|
|
4817
4840
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
4818
4841
|
len = _step1.value;
|
|
4819
4842
|
tmp = len[0];
|
|
4820
|
-
if (tmp &&
|
|
4843
|
+
if (tmp && typeof tmp === "object") {
|
|
4821
4844
|
tmp = find(bar, tmp);
|
|
4822
4845
|
if (!tmp) return false;
|
|
4823
4846
|
}
|
|
@@ -4856,7 +4879,7 @@ var Player = function() {
|
|
|
4856
4879
|
}
|
|
4857
4880
|
return len === -1;
|
|
4858
4881
|
}
|
|
4859
|
-
if (!ctor ||
|
|
4882
|
+
if (!ctor || typeof foo === "object") {
|
|
4860
4883
|
len = 0;
|
|
4861
4884
|
for(ctor in foo){
|
|
4862
4885
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -4930,7 +4953,7 @@ var Player = function() {
|
|
|
4930
4953
|
}
|
|
4931
4954
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4932
4955
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4933
|
-
if (
|
|
4956
|
+
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4934
4957
|
return {
|
|
4935
4958
|
value: objToParse,
|
|
4936
4959
|
children: []
|
|
@@ -4967,7 +4990,7 @@ var Player = function() {
|
|
|
4967
4990
|
if (newChildren) {
|
|
4968
4991
|
var _children2;
|
|
4969
4992
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4970
|
-
} else if (localValue &&
|
|
4993
|
+
} else if (localValue && typeof localValue === "object") {
|
|
4971
4994
|
var _children21;
|
|
4972
4995
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4973
4996
|
localKey
|
|
@@ -5142,7 +5165,7 @@ var Player = function() {
|
|
|
5142
5165
|
Object.keys(clonedNode).forEach(function(key) {
|
|
5143
5166
|
if (key === "parent") return;
|
|
5144
5167
|
var value = clonedNode[key];
|
|
5145
|
-
if (
|
|
5168
|
+
if (typeof value === "object" && value !== null) {
|
|
5146
5169
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
5147
5170
|
}
|
|
5148
5171
|
});
|
|
@@ -5576,7 +5599,7 @@ var Player = function() {
|
|
|
5576
5599
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5577
5600
|
var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
|
|
5578
5601
|
var flags = "g";
|
|
5579
|
-
if (
|
|
5602
|
+
if (typeof expression === "object") {
|
|
5580
5603
|
flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
|
|
5581
5604
|
}
|
|
5582
5605
|
templateStr = templateStr.replace(new RegExp(expression, flags), value);
|
|
@@ -5727,7 +5750,7 @@ var Player = function() {
|
|
|
5727
5750
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5728
5751
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5729
5752
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5730
|
-
if (node === null || node === void 0 ||
|
|
5753
|
+
if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
|
|
5731
5754
|
return node;
|
|
5732
5755
|
}
|
|
5733
5756
|
if (typeof node === "string") {
|
|
@@ -5740,7 +5763,7 @@ var Player = function() {
|
|
|
5740
5763
|
}
|
|
5741
5764
|
var val = node[key];
|
|
5742
5765
|
var newVal = val;
|
|
5743
|
-
if (
|
|
5766
|
+
if (typeof val === "object") {
|
|
5744
5767
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5745
5768
|
} else if (typeof val === "string") {
|
|
5746
5769
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -6086,7 +6109,7 @@ var Player = function() {
|
|
|
6086
6109
|
key: "applyParser",
|
|
6087
6110
|
value: function applyParser(parser) {
|
|
6088
6111
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
6089
|
-
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" &&
|
|
6112
|
+
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
|
|
6090
6113
|
var assetAST = parser.parseObject(obj, "asset" /* Asset */ , options);
|
|
6091
6114
|
if (!assetAST) {
|
|
6092
6115
|
return [];
|
|
@@ -6294,7 +6317,6 @@ var Player = function() {
|
|
|
6294
6317
|
var import_p_defer = __toESM(require_p_defer());
|
|
6295
6318
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
6296
6319
|
function FlowInstance(id, flow, options) {
|
|
6297
|
-
var _this = this;
|
|
6298
6320
|
_class_call_check(this, FlowInstance);
|
|
6299
6321
|
this.isTransitioning = false;
|
|
6300
6322
|
this.hooks = {
|
|
@@ -6311,55 +6333,60 @@ var Player = function() {
|
|
|
6311
6333
|
this.flow = flow;
|
|
6312
6334
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
6313
6335
|
this.history = [];
|
|
6314
|
-
|
|
6315
|
-
|
|
6336
|
+
var _this = this;
|
|
6337
|
+
this.hooks.transition.tap("startPromise", function() {
|
|
6338
|
+
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
6316
6339
|
var newState;
|
|
6317
6340
|
return _ts_generator(this, function(_state) {
|
|
6318
6341
|
newState = nextState.value;
|
|
6319
|
-
if (
|
|
6320
|
-
|
|
6342
|
+
if (_this.flowPromise && newState.state_type === "END") {
|
|
6343
|
+
_this.flowPromise.resolve(newState);
|
|
6321
6344
|
}
|
|
6322
6345
|
return [
|
|
6323
6346
|
2
|
|
6324
6347
|
];
|
|
6325
6348
|
});
|
|
6326
|
-
})
|
|
6327
|
-
|
|
6349
|
+
});
|
|
6350
|
+
return function(_oldState, nextState) {
|
|
6351
|
+
return _ref.apply(this, arguments);
|
|
6352
|
+
};
|
|
6353
|
+
}());
|
|
6328
6354
|
}
|
|
6329
6355
|
_create_class(FlowInstance, [
|
|
6330
6356
|
{
|
|
6331
6357
|
key: "start",
|
|
6332
6358
|
value: /** Start the state machine */ function start() {
|
|
6359
|
+
var _this = this;
|
|
6333
6360
|
return _async_to_generator(function() {
|
|
6334
6361
|
var _this_log, initialState;
|
|
6335
6362
|
return _ts_generator(this, function(_state) {
|
|
6336
|
-
if (
|
|
6363
|
+
if (_this.flowPromise) {
|
|
6337
6364
|
;
|
|
6338
|
-
(_this_log =
|
|
6365
|
+
(_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
6339
6366
|
return [
|
|
6340
6367
|
2,
|
|
6341
|
-
|
|
6368
|
+
_this.flowPromise.promise
|
|
6342
6369
|
];
|
|
6343
6370
|
}
|
|
6344
|
-
|
|
6345
|
-
if (
|
|
6346
|
-
|
|
6371
|
+
_this.flow = _this.hooks.beforeStart.call(_this.flow) || _this.flow;
|
|
6372
|
+
if (_this.flow.onStart) {
|
|
6373
|
+
_this.hooks.onStart.call(_this.flow.onStart);
|
|
6347
6374
|
}
|
|
6348
|
-
initialState =
|
|
6375
|
+
initialState = _this.flow.startState;
|
|
6349
6376
|
if (!initialState) {
|
|
6350
6377
|
return [
|
|
6351
6378
|
2,
|
|
6352
6379
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
6353
6380
|
];
|
|
6354
6381
|
}
|
|
6355
|
-
|
|
6356
|
-
|
|
6382
|
+
_this.flowPromise = (0, import_p_defer.default)();
|
|
6383
|
+
_this.pushHistory(initialState);
|
|
6357
6384
|
return [
|
|
6358
6385
|
2,
|
|
6359
|
-
|
|
6386
|
+
_this.flowPromise.promise
|
|
6360
6387
|
];
|
|
6361
6388
|
});
|
|
6362
|
-
})
|
|
6389
|
+
})();
|
|
6363
6390
|
}
|
|
6364
6391
|
},
|
|
6365
6392
|
{
|
|
@@ -6411,7 +6438,7 @@ var Player = function() {
|
|
|
6411
6438
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6412
6439
|
}
|
|
6413
6440
|
var nextState = this.flow[stateName];
|
|
6414
|
-
if (!this.flow[stateName] ||
|
|
6441
|
+
if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
|
|
6415
6442
|
var _this_log;
|
|
6416
6443
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6417
6444
|
return;
|
|
@@ -6472,30 +6499,30 @@ var Player = function() {
|
|
|
6472
6499
|
{
|
|
6473
6500
|
key: "run",
|
|
6474
6501
|
value: function run(startState) {
|
|
6502
|
+
var _this = this;
|
|
6475
6503
|
return _async_to_generator(function() {
|
|
6476
|
-
var
|
|
6504
|
+
var _this_log, startFlow, flow, end, firstItem;
|
|
6477
6505
|
return _ts_generator(this, function(_state) {
|
|
6478
6506
|
switch(_state.label){
|
|
6479
6507
|
case 0:
|
|
6480
|
-
_this
|
|
6481
|
-
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6508
|
+
if (!Object.prototype.hasOwnProperty.call(_this.navigation, startState)) {
|
|
6482
6509
|
return [
|
|
6483
6510
|
2,
|
|
6484
6511
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6485
6512
|
];
|
|
6486
6513
|
}
|
|
6487
|
-
startFlow =
|
|
6488
|
-
if (startFlow === null ||
|
|
6514
|
+
startFlow = _this.navigation[startState];
|
|
6515
|
+
if (startFlow === null || typeof startFlow !== "object") {
|
|
6489
6516
|
return [
|
|
6490
6517
|
2,
|
|
6491
6518
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6492
6519
|
];
|
|
6493
6520
|
}
|
|
6494
|
-
(_this_log =
|
|
6521
|
+
(_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6495
6522
|
flow = new FlowInstance(startState, startFlow, {
|
|
6496
|
-
logger:
|
|
6523
|
+
logger: _this.log
|
|
6497
6524
|
});
|
|
6498
|
-
|
|
6525
|
+
_this.addNewFlow(flow);
|
|
6499
6526
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6500
6527
|
var _flowInstance_currentState;
|
|
6501
6528
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6515,10 +6542,10 @@ var Player = function() {
|
|
|
6515
6542
|
];
|
|
6516
6543
|
case 1:
|
|
6517
6544
|
end = _state.sent();
|
|
6518
|
-
|
|
6519
|
-
if (
|
|
6545
|
+
_this.navStack.pop();
|
|
6546
|
+
if (_this.navStack.length > 0) {
|
|
6520
6547
|
firstItem = 0;
|
|
6521
|
-
|
|
6548
|
+
_this.current = _this.navStack[firstItem];
|
|
6522
6549
|
}
|
|
6523
6550
|
return [
|
|
6524
6551
|
2,
|
|
@@ -6526,15 +6553,16 @@ var Player = function() {
|
|
|
6526
6553
|
];
|
|
6527
6554
|
}
|
|
6528
6555
|
});
|
|
6529
|
-
})
|
|
6556
|
+
})();
|
|
6530
6557
|
}
|
|
6531
6558
|
},
|
|
6532
6559
|
{
|
|
6533
6560
|
key: "start",
|
|
6534
6561
|
value: function start() {
|
|
6562
|
+
var _this = this;
|
|
6535
6563
|
return _async_to_generator(function() {
|
|
6536
6564
|
return _ts_generator(this, function(_state) {
|
|
6537
|
-
if (!
|
|
6565
|
+
if (!_this.navigation.BEGIN) {
|
|
6538
6566
|
return [
|
|
6539
6567
|
2,
|
|
6540
6568
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6542,10 +6570,10 @@ var Player = function() {
|
|
|
6542
6570
|
}
|
|
6543
6571
|
return [
|
|
6544
6572
|
2,
|
|
6545
|
-
|
|
6573
|
+
_this.run(_this.navigation.BEGIN)
|
|
6546
6574
|
];
|
|
6547
6575
|
});
|
|
6548
|
-
})
|
|
6576
|
+
})();
|
|
6549
6577
|
}
|
|
6550
6578
|
}
|
|
6551
6579
|
]);
|
|
@@ -7336,7 +7364,7 @@ var Player = function() {
|
|
|
7336
7364
|
var nestedPath = _to_consumable_array(path).concat([
|
|
7337
7365
|
key
|
|
7338
7366
|
]);
|
|
7339
|
-
if (
|
|
7367
|
+
if (typeof val === "object") {
|
|
7340
7368
|
traverseObj(val, nestedPath, pairs);
|
|
7341
7369
|
} else {
|
|
7342
7370
|
pairs.set(nestedPath, val);
|
|
@@ -7377,7 +7405,7 @@ var Player = function() {
|
|
|
7377
7405
|
{
|
|
7378
7406
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
7379
7407
|
value: function set(match, value) {
|
|
7380
|
-
var matcher =
|
|
7408
|
+
var matcher = typeof match === "object" ? createObjectMatcher(match) : createBasicMatcher(match);
|
|
7381
7409
|
this.store.insert({
|
|
7382
7410
|
key: match,
|
|
7383
7411
|
value: value,
|
|
@@ -7804,7 +7832,7 @@ var Player = function() {
|
|
|
7804
7832
|
var parentBinding = resolved.parent();
|
|
7805
7833
|
var property = resolved.key();
|
|
7806
7834
|
var parentValue = this.get(parentBinding);
|
|
7807
|
-
var existedBeforeDelete =
|
|
7835
|
+
var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7808
7836
|
this.getModel().delete(resolved, options);
|
|
7809
7837
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7810
7838
|
this.trash.add(resolved);
|
|
@@ -7908,7 +7936,7 @@ var Player = function() {
|
|
|
7908
7936
|
var expressionEvaluator;
|
|
7909
7937
|
var handleEval = function(exp) {
|
|
7910
7938
|
if (exp) {
|
|
7911
|
-
if (
|
|
7939
|
+
if (typeof exp === "object" && "exp" in exp) {
|
|
7912
7940
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7913
7941
|
} else {
|
|
7914
7942
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -8001,8 +8029,8 @@ var Player = function() {
|
|
|
8001
8029
|
status: "not-started"
|
|
8002
8030
|
};
|
|
8003
8031
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/player.ts
|
|
8004
|
-
var PLAYER_VERSION = true ? "0.15.
|
|
8005
|
-
var COMMIT = true ? "
|
|
8032
|
+
var PLAYER_VERSION = true ? "0.15.3--canary.836.34893" : "unknown";
|
|
8033
|
+
var COMMIT = true ? "8cc25d6931ec8e9cd677e45b807897f220d2aa75" : "unknown";
|
|
8006
8034
|
var _Player = /*#__PURE__*/ function() {
|
|
8007
8035
|
function _Player(config) {
|
|
8008
8036
|
var _this = this;
|
|
@@ -8172,7 +8200,7 @@ var Player = function() {
|
|
|
8172
8200
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
8173
8201
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
8174
8202
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
8175
|
-
if (
|
|
8203
|
+
if (typeof state.onEnd === "object" && "exp" in state.onEnd) {
|
|
8176
8204
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
8177
8205
|
} else {
|
|
8178
8206
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -8331,12 +8359,12 @@ var Player = function() {
|
|
|
8331
8359
|
{
|
|
8332
8360
|
key: "start",
|
|
8333
8361
|
value: function start(payload) {
|
|
8362
|
+
var _this = this;
|
|
8334
8363
|
return _async_to_generator(function() {
|
|
8335
|
-
var
|
|
8364
|
+
var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
8336
8365
|
return _ts_generator(this, function(_state) {
|
|
8337
8366
|
switch(_state.label){
|
|
8338
8367
|
case 0:
|
|
8339
|
-
_this = this;
|
|
8340
8368
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
8341
8369
|
maybeUpdateState = function(newState) {
|
|
8342
8370
|
if (_this.state.ref !== ref) {
|
|
@@ -8346,7 +8374,7 @@ var Player = function() {
|
|
|
8346
8374
|
_this.setState(newState);
|
|
8347
8375
|
return newState;
|
|
8348
8376
|
};
|
|
8349
|
-
|
|
8377
|
+
_this.setState({
|
|
8350
8378
|
status: "not-started",
|
|
8351
8379
|
ref: ref
|
|
8352
8380
|
});
|
|
@@ -8358,8 +8386,8 @@ var Player = function() {
|
|
|
8358
8386
|
,
|
|
8359
8387
|
4
|
|
8360
8388
|
]);
|
|
8361
|
-
_this_setupFlow =
|
|
8362
|
-
|
|
8389
|
+
_this_setupFlow = _this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
8390
|
+
_this.setState(_object_spread({
|
|
8363
8391
|
ref: ref
|
|
8364
8392
|
}, state));
|
|
8365
8393
|
start();
|
|
@@ -8404,7 +8432,7 @@ var Player = function() {
|
|
|
8404
8432
|
];
|
|
8405
8433
|
}
|
|
8406
8434
|
});
|
|
8407
|
-
})
|
|
8435
|
+
})();
|
|
8408
8436
|
}
|
|
8409
8437
|
}
|
|
8410
8438
|
]);
|