@player-ui/beacon-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.
- package/dist/BeaconPlugin.native.js +260 -286
- package/dist/BeaconPlugin.native.js.map +1 -1
- package/package.json +3 -3
|
@@ -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 BeaconPlugin = 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 BeaconPlugin = 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 BeaconPlugin = 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 BeaconPlugin = 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 BeaconPlugin = 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 BeaconPlugin = 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
|
};
|
|
@@ -1547,7 +1515,7 @@ var BeaconPlugin = function() {
|
|
|
1547
1515
|
});
|
|
1548
1516
|
};
|
|
1549
1517
|
var __copyProps = function(to, from, except, desc) {
|
|
1550
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
1518
|
+
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1551
1519
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1552
1520
|
try {
|
|
1553
1521
|
var _loop = function() {
|
|
@@ -1602,15 +1570,16 @@ var BeaconPlugin = function() {
|
|
|
1602
1570
|
exports.toError = exports.NestedError = void 0;
|
|
1603
1571
|
var NestedError4 = /*#__PURE__*/ function(Error1) {
|
|
1604
1572
|
_inherits(_NestedError, Error1);
|
|
1605
|
-
var _super = _create_super(_NestedError);
|
|
1606
1573
|
function _NestedError(message) {
|
|
1607
1574
|
for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
1608
1575
|
innerErrors[_key - 1] = arguments[_key];
|
|
1609
1576
|
}
|
|
1610
1577
|
_class_call_check(this, _NestedError);
|
|
1611
1578
|
var _this;
|
|
1612
|
-
_this =
|
|
1613
|
-
|
|
1579
|
+
_this = _call_super(this, _NestedError, [
|
|
1580
|
+
message
|
|
1581
|
+
]);
|
|
1582
|
+
var thisErrorReport = _NestedError.getErrorReport(_this);
|
|
1614
1583
|
if (innerErrors.length === 1) {
|
|
1615
1584
|
var innerError = toError(innerErrors[0]);
|
|
1616
1585
|
_this.innerErrors = [
|
|
@@ -1746,7 +1715,7 @@ var BeaconPlugin = function() {
|
|
|
1746
1715
|
return out;
|
|
1747
1716
|
}
|
|
1748
1717
|
function isObject(o) {
|
|
1749
|
-
return o != null && typeof o === "object";
|
|
1718
|
+
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1750
1719
|
}
|
|
1751
1720
|
function addLast2(array, val) {
|
|
1752
1721
|
if (Array.isArray(val)) return array.concat(val);
|
|
@@ -2089,7 +2058,7 @@ var BeaconPlugin = function() {
|
|
|
2089
2058
|
else return 0;
|
|
2090
2059
|
}
|
|
2091
2060
|
}();
|
|
2092
|
-
if (typeof module === "object") module.exports = SortedArray2;
|
|
2061
|
+
if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
|
|
2093
2062
|
if (typeof define === "function" && define.amd) define(function() {
|
|
2094
2063
|
return SortedArray2;
|
|
2095
2064
|
});
|
|
@@ -2289,10 +2258,9 @@ var BeaconPlugin = function() {
|
|
|
2289
2258
|
}();
|
|
2290
2259
|
var SyncHook = /*#__PURE__*/ function(Hook) {
|
|
2291
2260
|
_inherits(SyncHook, Hook);
|
|
2292
|
-
var _super = _create_super(SyncHook);
|
|
2293
2261
|
function SyncHook() {
|
|
2294
2262
|
_class_call_check(this, SyncHook);
|
|
2295
|
-
return
|
|
2263
|
+
return _call_super(this, SyncHook, arguments);
|
|
2296
2264
|
}
|
|
2297
2265
|
_create_class(SyncHook, [
|
|
2298
2266
|
{
|
|
@@ -2325,10 +2293,9 @@ var BeaconPlugin = function() {
|
|
|
2325
2293
|
}(Hook);
|
|
2326
2294
|
var SyncBailHook = /*#__PURE__*/ function(Hook) {
|
|
2327
2295
|
_inherits(SyncBailHook, Hook);
|
|
2328
|
-
var _super = _create_super(SyncBailHook);
|
|
2329
2296
|
function SyncBailHook() {
|
|
2330
2297
|
_class_call_check(this, SyncBailHook);
|
|
2331
|
-
return
|
|
2298
|
+
return _call_super(this, SyncBailHook, arguments);
|
|
2332
2299
|
}
|
|
2333
2300
|
_create_class(SyncBailHook, [
|
|
2334
2301
|
{
|
|
@@ -2360,10 +2327,9 @@ var BeaconPlugin = function() {
|
|
|
2360
2327
|
}(Hook);
|
|
2361
2328
|
var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2362
2329
|
_inherits(SyncWaterfallHook, Hook);
|
|
2363
|
-
var _super = _create_super(SyncWaterfallHook);
|
|
2364
2330
|
function SyncWaterfallHook() {
|
|
2365
2331
|
_class_call_check(this, SyncWaterfallHook);
|
|
2366
|
-
return
|
|
2332
|
+
return _call_super(this, SyncWaterfallHook, arguments);
|
|
2367
2333
|
}
|
|
2368
2334
|
_create_class(SyncWaterfallHook, [
|
|
2369
2335
|
{
|
|
@@ -2395,10 +2361,9 @@ var BeaconPlugin = function() {
|
|
|
2395
2361
|
}(Hook);
|
|
2396
2362
|
var AsyncSeriesWaterfallHook = /*#__PURE__*/ function(Hook) {
|
|
2397
2363
|
_inherits(AsyncSeriesWaterfallHook, Hook);
|
|
2398
|
-
var _super = _create_super(AsyncSeriesWaterfallHook);
|
|
2399
2364
|
function AsyncSeriesWaterfallHook() {
|
|
2400
2365
|
_class_call_check(this, AsyncSeriesWaterfallHook);
|
|
2401
|
-
return
|
|
2366
|
+
return _call_super(this, AsyncSeriesWaterfallHook, arguments);
|
|
2402
2367
|
}
|
|
2403
2368
|
_create_class(AsyncSeriesWaterfallHook, [
|
|
2404
2369
|
{
|
|
@@ -2407,7 +2372,6 @@ var BeaconPlugin = function() {
|
|
|
2407
2372
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
2408
2373
|
args[_key] = arguments[_key];
|
|
2409
2374
|
}
|
|
2410
|
-
var _this = this;
|
|
2411
2375
|
return _async_to_generator(function() {
|
|
2412
2376
|
var _this_interceptions, _args, rtn, rest, ctx, tapIndex, tapValue, e;
|
|
2413
2377
|
return _ts_generator(this, function(_state) {
|
|
@@ -2415,7 +2379,7 @@ var BeaconPlugin = function() {
|
|
|
2415
2379
|
case 0:
|
|
2416
2380
|
_args = _to_array(args), rtn = _args[0], rest = _args.slice(1);
|
|
2417
2381
|
ctx = {};
|
|
2418
|
-
(_this_interceptions =
|
|
2382
|
+
(_this_interceptions = this.interceptions).call.apply(_this_interceptions, [
|
|
2419
2383
|
ctx
|
|
2420
2384
|
].concat(_to_consumable_array(args)));
|
|
2421
2385
|
_state.label = 1;
|
|
@@ -2429,13 +2393,13 @@ var BeaconPlugin = function() {
|
|
|
2429
2393
|
tapIndex = 0;
|
|
2430
2394
|
_state.label = 2;
|
|
2431
2395
|
case 2:
|
|
2432
|
-
if (!(tapIndex <
|
|
2396
|
+
if (!(tapIndex < this.taps.length)) return [
|
|
2433
2397
|
3,
|
|
2434
2398
|
5
|
|
2435
2399
|
];
|
|
2436
2400
|
return [
|
|
2437
2401
|
4,
|
|
2438
|
-
callTap(
|
|
2402
|
+
callTap(this.taps[tapIndex], [
|
|
2439
2403
|
rtn
|
|
2440
2404
|
].concat(_to_consumable_array(rest)), ctx)
|
|
2441
2405
|
];
|
|
@@ -2458,17 +2422,17 @@ var BeaconPlugin = function() {
|
|
|
2458
2422
|
];
|
|
2459
2423
|
case 6:
|
|
2460
2424
|
e = _state.sent();
|
|
2461
|
-
|
|
2425
|
+
this.interceptions.error(e);
|
|
2462
2426
|
throw e;
|
|
2463
2427
|
case 7:
|
|
2464
|
-
|
|
2428
|
+
this.interceptions.result(rtn);
|
|
2465
2429
|
return [
|
|
2466
2430
|
2,
|
|
2467
2431
|
rtn
|
|
2468
2432
|
];
|
|
2469
2433
|
}
|
|
2470
2434
|
});
|
|
2471
|
-
})();
|
|
2435
|
+
}).call(this);
|
|
2472
2436
|
}
|
|
2473
2437
|
}
|
|
2474
2438
|
]);
|
|
@@ -2506,7 +2470,7 @@ var BeaconPlugin = function() {
|
|
|
2506
2470
|
for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2507
2471
|
len = _step.value;
|
|
2508
2472
|
tmp = len;
|
|
2509
|
-
if (tmp && typeof tmp === "object") {
|
|
2473
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2510
2474
|
tmp = find(bar, tmp);
|
|
2511
2475
|
if (!tmp) return false;
|
|
2512
2476
|
}
|
|
@@ -2537,7 +2501,7 @@ var BeaconPlugin = function() {
|
|
|
2537
2501
|
for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2538
2502
|
len = _step1.value;
|
|
2539
2503
|
tmp = len[0];
|
|
2540
|
-
if (tmp && typeof tmp === "object") {
|
|
2504
|
+
if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
|
|
2541
2505
|
tmp = find(bar, tmp);
|
|
2542
2506
|
if (!tmp) return false;
|
|
2543
2507
|
}
|
|
@@ -2576,7 +2540,7 @@ var BeaconPlugin = function() {
|
|
|
2576
2540
|
}
|
|
2577
2541
|
return len === -1;
|
|
2578
2542
|
}
|
|
2579
|
-
if (!ctor || typeof foo === "object") {
|
|
2543
|
+
if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
|
|
2580
2544
|
len = 0;
|
|
2581
2545
|
for(ctor in foo){
|
|
2582
2546
|
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
@@ -2609,7 +2573,7 @@ var BeaconPlugin = function() {
|
|
|
2609
2573
|
var nestedPath = _to_consumable_array(path).concat([
|
|
2610
2574
|
key
|
|
2611
2575
|
]);
|
|
2612
|
-
if (typeof val === "object") {
|
|
2576
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
2613
2577
|
traverseObj(val, nestedPath, pairs);
|
|
2614
2578
|
} else {
|
|
2615
2579
|
pairs.set(nestedPath, val);
|
|
@@ -2650,7 +2614,7 @@ var BeaconPlugin = function() {
|
|
|
2650
2614
|
{
|
|
2651
2615
|
/** Add match -> value mapping to the registry */ key: "set",
|
|
2652
2616
|
value: function set(match, value) {
|
|
2653
|
-
var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2617
|
+
var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
|
|
2654
2618
|
this.store.insert({
|
|
2655
2619
|
key: match,
|
|
2656
2620
|
value: value,
|
|
@@ -2813,6 +2777,7 @@ var BeaconPlugin = function() {
|
|
|
2813
2777
|
}
|
|
2814
2778
|
};
|
|
2815
2779
|
var identifier = function() {
|
|
2780
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2816
2781
|
if (!isIdentifierChar(ch)) {
|
|
2817
2782
|
return;
|
|
2818
2783
|
}
|
|
@@ -2823,6 +2788,14 @@ var BeaconPlugin = function() {
|
|
|
2823
2788
|
}
|
|
2824
2789
|
value += ch;
|
|
2825
2790
|
}
|
|
2791
|
+
if (allowBoolValue) {
|
|
2792
|
+
if (value === "true") {
|
|
2793
|
+
return toValue(true);
|
|
2794
|
+
}
|
|
2795
|
+
if (value === "false") {
|
|
2796
|
+
return toValue(false);
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2826
2799
|
if (value) {
|
|
2827
2800
|
var maybeNumber = Number(value);
|
|
2828
2801
|
value = isNaN(maybeNumber) ? value : maybeNumber;
|
|
@@ -2871,8 +2844,9 @@ var BeaconPlugin = function() {
|
|
|
2871
2844
|
}
|
|
2872
2845
|
};
|
|
2873
2846
|
var simpleSegment = function() {
|
|
2847
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2874
2848
|
var _nestedPath, _ref;
|
|
2875
|
-
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier();
|
|
2849
|
+
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
|
|
2876
2850
|
};
|
|
2877
2851
|
var segment = function() {
|
|
2878
2852
|
var segments = [];
|
|
@@ -2887,6 +2861,7 @@ var BeaconPlugin = function() {
|
|
|
2887
2861
|
return toConcatenatedNode(segments);
|
|
2888
2862
|
};
|
|
2889
2863
|
var optionallyQuotedSegment = function() {
|
|
2864
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2890
2865
|
whitespace();
|
|
2891
2866
|
if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
|
|
2892
2867
|
var singleQuote = ch === SINGLE_QUOTE;
|
|
@@ -2895,7 +2870,7 @@ var BeaconPlugin = function() {
|
|
|
2895
2870
|
next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
|
|
2896
2871
|
return id;
|
|
2897
2872
|
}
|
|
2898
|
-
return simpleSegment();
|
|
2873
|
+
return simpleSegment(allowBoolValue);
|
|
2899
2874
|
};
|
|
2900
2875
|
var equals = function() {
|
|
2901
2876
|
if (ch !== EQUALS) {
|
|
@@ -2915,7 +2890,7 @@ var BeaconPlugin = function() {
|
|
|
2915
2890
|
whitespace();
|
|
2916
2891
|
if (equals()) {
|
|
2917
2892
|
whitespace();
|
|
2918
|
-
var second = optionallyQuotedSegment();
|
|
2893
|
+
var second = optionallyQuotedSegment(true);
|
|
2919
2894
|
value = toQuery(value, second);
|
|
2920
2895
|
whitespace();
|
|
2921
2896
|
}
|
|
@@ -3103,7 +3078,7 @@ var BeaconPlugin = function() {
|
|
|
3103
3078
|
appendPathSegments(getValueForNode(resolvedNode));
|
|
3104
3079
|
break;
|
|
3105
3080
|
case "Value":
|
|
3106
|
-
appendPathSegments(resolvedNode.value);
|
|
3081
|
+
appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
|
|
3107
3082
|
break;
|
|
3108
3083
|
case "Query":
|
|
3109
3084
|
{
|
|
@@ -3179,7 +3154,7 @@ var BeaconPlugin = function() {
|
|
|
3179
3154
|
var _this_parseCache_path;
|
|
3180
3155
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3181
3156
|
this.parseCache[path] = ast;
|
|
3182
|
-
if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3157
|
+
if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3183
3158
|
var _ast_error;
|
|
3184
3159
|
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."));
|
|
3185
3160
|
}
|
|
@@ -3379,14 +3354,13 @@ var BeaconPlugin = function() {
|
|
|
3379
3354
|
}();
|
|
3380
3355
|
var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
|
|
3381
3356
|
_inherits(DependencyModel, DependencyTracker);
|
|
3382
|
-
var _super = _create_super(DependencyModel);
|
|
3383
3357
|
function DependencyModel(rootModel) {
|
|
3384
3358
|
_class_call_check(this, DependencyModel);
|
|
3385
3359
|
var _this;
|
|
3386
|
-
_this =
|
|
3360
|
+
_this = _call_super(this, DependencyModel);
|
|
3387
3361
|
_this.rootModel = rootModel;
|
|
3388
|
-
_this.set = _this.set.bind(
|
|
3389
|
-
_this.get = _this.get.bind(
|
|
3362
|
+
_this.set = _this.set.bind(_this);
|
|
3363
|
+
_this.get = _this.get.bind(_this);
|
|
3390
3364
|
return _this;
|
|
3391
3365
|
}
|
|
3392
3366
|
_create_class(DependencyModel, [
|
|
@@ -3930,23 +3904,20 @@ var BeaconPlugin = function() {
|
|
|
3930
3904
|
* @experimental These Player APIs are in active development and may change. Use with caution
|
|
3931
3905
|
*/ key: "evaluateAsync",
|
|
3932
3906
|
value: function evaluateAsync(expr, options) {
|
|
3907
|
+
var _this = this;
|
|
3933
3908
|
if (Array.isArray(expr)) {
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
var _ref = _async_to_generator(function(exp) {
|
|
3909
|
+
return collateAwaitable(expr.map(function(exp) {
|
|
3910
|
+
return _async_to_generator(function() {
|
|
3937
3911
|
return _ts_generator(this, function(_state) {
|
|
3938
3912
|
return [
|
|
3939
3913
|
2,
|
|
3940
|
-
|
|
3914
|
+
this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
|
|
3941
3915
|
async: true
|
|
3942
3916
|
}))
|
|
3943
3917
|
];
|
|
3944
3918
|
});
|
|
3945
|
-
});
|
|
3946
|
-
|
|
3947
|
-
return _ref.apply(this, arguments);
|
|
3948
|
-
};
|
|
3949
|
-
}())).awaitableThen(function(values) {
|
|
3919
|
+
}).call(_this);
|
|
3920
|
+
})).awaitableThen(function(values) {
|
|
3950
3921
|
return values.pop();
|
|
3951
3922
|
});
|
|
3952
3923
|
} else {
|
|
@@ -4670,23 +4641,8 @@ var BeaconPlugin = function() {
|
|
|
4670
4641
|
function Parser() {
|
|
4671
4642
|
_class_call_check(this, Parser);
|
|
4672
4643
|
this.hooks = {
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
*
|
|
4676
|
-
* @param value - The object we're are about to parse
|
|
4677
|
-
* @returns - A new value to parse.
|
|
4678
|
-
* If undefined, the original value is used.
|
|
4679
|
-
* If null, we stop parsing this node.
|
|
4680
|
-
*/ onParseObject: new SyncWaterfallHook(),
|
|
4681
|
-
/**
|
|
4682
|
-
* A callback to interact with an AST _after_ we parse it into the AST
|
|
4683
|
-
*
|
|
4684
|
-
* @param value - The object we parsed
|
|
4685
|
-
* @param node - The AST node we generated
|
|
4686
|
-
* @returns - A new AST node to use
|
|
4687
|
-
* If undefined, the original value is used.
|
|
4688
|
-
* If null, we ignore this node all together
|
|
4689
|
-
*/ onCreateASTNode: new SyncWaterfallHook(),
|
|
4644
|
+
onParseObject: new SyncWaterfallHook(),
|
|
4645
|
+
onCreateASTNode: new SyncWaterfallHook(),
|
|
4690
4646
|
parseNode: new SyncBailHook()
|
|
4691
4647
|
};
|
|
4692
4648
|
}
|
|
@@ -4724,7 +4680,7 @@ var BeaconPlugin = function() {
|
|
|
4724
4680
|
}
|
|
4725
4681
|
var parseLocalObject = function(currentValue, objToParse) {
|
|
4726
4682
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4727
|
-
if (typeof objToParse !== "object" || objToParse === null) {
|
|
4683
|
+
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4728
4684
|
return {
|
|
4729
4685
|
value: objToParse,
|
|
4730
4686
|
children: []
|
|
@@ -4761,7 +4717,7 @@ var BeaconPlugin = function() {
|
|
|
4761
4717
|
if (newChildren) {
|
|
4762
4718
|
var _children2;
|
|
4763
4719
|
(_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
|
|
4764
|
-
} else if (localValue && typeof localValue === "object") {
|
|
4720
|
+
} else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
|
|
4765
4721
|
var _children21;
|
|
4766
4722
|
var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
|
|
4767
4723
|
localKey
|
|
@@ -4828,20 +4784,14 @@ var BeaconPlugin = function() {
|
|
|
4828
4784
|
function Resolver(root, options) {
|
|
4829
4785
|
_class_call_check(this, Resolver);
|
|
4830
4786
|
this.hooks = {
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
*/ resolve: new SyncWaterfallHook(),
|
|
4840
|
-
/**
|
|
4841
|
-
* A hook to transform the resolved value of an AST node.
|
|
4842
|
-
* This runs _after_ all children nodes are resolved
|
|
4843
|
-
*/ afterResolve: new SyncWaterfallHook(),
|
|
4844
|
-
/** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
|
|
4787
|
+
skipResolve: new SyncWaterfallHook(),
|
|
4788
|
+
beforeUpdate: new SyncHook(),
|
|
4789
|
+
afterUpdate: new SyncHook(),
|
|
4790
|
+
resolveOptions: new SyncWaterfallHook(),
|
|
4791
|
+
beforeResolve: new SyncWaterfallHook(),
|
|
4792
|
+
resolve: new SyncWaterfallHook(),
|
|
4793
|
+
afterResolve: new SyncWaterfallHook(),
|
|
4794
|
+
afterNodeUpdate: new SyncHook()
|
|
4845
4795
|
};
|
|
4846
4796
|
this.root = root;
|
|
4847
4797
|
this.options = options;
|
|
@@ -4849,6 +4799,7 @@ var BeaconPlugin = function() {
|
|
|
4849
4799
|
this.ASTMap = /* @__PURE__ */ new Map();
|
|
4850
4800
|
this.logger = options.logger;
|
|
4851
4801
|
this.idCache = /* @__PURE__ */ new Set();
|
|
4802
|
+
this.AsyncIdMap = /* @__PURE__ */ new Map();
|
|
4852
4803
|
}
|
|
4853
4804
|
_create_class(Resolver, [
|
|
4854
4805
|
{
|
|
@@ -4859,13 +4810,27 @@ var BeaconPlugin = function() {
|
|
|
4859
4810
|
},
|
|
4860
4811
|
{
|
|
4861
4812
|
key: "update",
|
|
4862
|
-
value: function update(changes) {
|
|
4813
|
+
value: function update(changes, asyncChanges) {
|
|
4814
|
+
var _this = this;
|
|
4863
4815
|
this.hooks.beforeUpdate.call(changes);
|
|
4864
4816
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
4865
4817
|
this.idCache.clear();
|
|
4866
4818
|
var prevASTMap = new Map(this.ASTMap);
|
|
4867
4819
|
this.ASTMap.clear();
|
|
4868
|
-
var
|
|
4820
|
+
var prevAsyncIdMap = new Map(this.AsyncIdMap);
|
|
4821
|
+
var nextAsyncIdMap = /* @__PURE__ */ new Map();
|
|
4822
|
+
asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
|
|
4823
|
+
var current = prevAsyncIdMap.get(id);
|
|
4824
|
+
while(current && prevASTMap.has(current)){
|
|
4825
|
+
var next = prevASTMap.get(current);
|
|
4826
|
+
if (next && _this.resolveCache.has(next)) {
|
|
4827
|
+
_this.resolveCache.delete(next);
|
|
4828
|
+
}
|
|
4829
|
+
current = current.parent;
|
|
4830
|
+
}
|
|
4831
|
+
});
|
|
4832
|
+
var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
|
|
4833
|
+
this.AsyncIdMap = nextAsyncIdMap;
|
|
4869
4834
|
this.resolveCache = resolveCache;
|
|
4870
4835
|
this.hooks.afterUpdate.call(updated.value);
|
|
4871
4836
|
return updated.value;
|
|
@@ -4910,7 +4875,7 @@ var BeaconPlugin = function() {
|
|
|
4910
4875
|
Object.keys(clonedNode).forEach(function(key) {
|
|
4911
4876
|
if (key === "parent") return;
|
|
4912
4877
|
var value = clonedNode[key];
|
|
4913
|
-
if (typeof value === "object" && value !== null) {
|
|
4878
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
|
|
4914
4879
|
clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
|
|
4915
4880
|
}
|
|
4916
4881
|
});
|
|
@@ -4919,9 +4884,8 @@ var BeaconPlugin = function() {
|
|
|
4919
4884
|
},
|
|
4920
4885
|
{
|
|
4921
4886
|
key: "computeTree",
|
|
4922
|
-
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4887
|
+
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
|
|
4923
4888
|
var _this = this;
|
|
4924
|
-
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4925
4889
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4926
4890
|
dependencyModel.trackSubset("core");
|
|
4927
4891
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4940,15 +4904,6 @@ var BeaconPlugin = function() {
|
|
|
4940
4904
|
var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
|
|
4941
4905
|
var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
4942
4906
|
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
4943
|
-
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4944
|
-
parent: partiallyResolvedParent
|
|
4945
|
-
});
|
|
4946
|
-
var _this_hooks_beforeResolve_call;
|
|
4947
|
-
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4948
|
-
type: "empty"
|
|
4949
|
-
};
|
|
4950
|
-
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");
|
|
4951
|
-
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";
|
|
4952
4907
|
if (previousResult && shouldUseLastValue) {
|
|
4953
4908
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4954
4909
|
updated: false
|
|
@@ -4960,6 +4915,30 @@ var BeaconPlugin = function() {
|
|
|
4960
4915
|
updated: false
|
|
4961
4916
|
});
|
|
4962
4917
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
4918
|
+
if (resolvedUpdate.node.type === "async") {
|
|
4919
|
+
nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
|
|
4920
|
+
}
|
|
4921
|
+
var _resolvedUpdate_node_asyncNodesResolved;
|
|
4922
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4923
|
+
try {
|
|
4924
|
+
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){
|
|
4925
|
+
var key = _step.value;
|
|
4926
|
+
nextAsyncIdMap.set(key, resolvedUpdate.node);
|
|
4927
|
+
}
|
|
4928
|
+
} catch (err) {
|
|
4929
|
+
_didIteratorError = true;
|
|
4930
|
+
_iteratorError = err;
|
|
4931
|
+
} finally{
|
|
4932
|
+
try {
|
|
4933
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4934
|
+
_iterator.return();
|
|
4935
|
+
}
|
|
4936
|
+
} finally{
|
|
4937
|
+
if (_didIteratorError) {
|
|
4938
|
+
throw _iteratorError;
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
}
|
|
4963
4942
|
var handleChildNode = function(childNode) {
|
|
4964
4943
|
var _prevASTMap_get;
|
|
4965
4944
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
@@ -4982,10 +4961,37 @@ var BeaconPlugin = function() {
|
|
|
4982
4961
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4983
4962
|
return update2;
|
|
4984
4963
|
}
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
}
|
|
4988
|
-
|
|
4964
|
+
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4965
|
+
parent: partiallyResolvedParent
|
|
4966
|
+
});
|
|
4967
|
+
var _this_hooks_beforeResolve_call;
|
|
4968
|
+
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4969
|
+
type: "empty"
|
|
4970
|
+
};
|
|
4971
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4972
|
+
if (resolvedAST.type === "async") {
|
|
4973
|
+
nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
|
|
4974
|
+
}
|
|
4975
|
+
var _resolvedAST_asyncNodesResolved;
|
|
4976
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4977
|
+
try {
|
|
4978
|
+
for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4979
|
+
var id = _step.value;
|
|
4980
|
+
nextAsyncIdMap.set(id, resolvedAST);
|
|
4981
|
+
}
|
|
4982
|
+
} catch (err) {
|
|
4983
|
+
_didIteratorError = true;
|
|
4984
|
+
_iteratorError = err;
|
|
4985
|
+
} finally{
|
|
4986
|
+
try {
|
|
4987
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4988
|
+
_iterator.return();
|
|
4989
|
+
}
|
|
4990
|
+
} finally{
|
|
4991
|
+
if (_didIteratorError) {
|
|
4992
|
+
throw _iteratorError;
|
|
4993
|
+
}
|
|
4994
|
+
}
|
|
4989
4995
|
}
|
|
4990
4996
|
resolveOptions.node = resolvedAST;
|
|
4991
4997
|
this.ASTMap.set(resolvedAST, node);
|
|
@@ -4999,7 +5005,7 @@ var BeaconPlugin = function() {
|
|
|
4999
5005
|
if ("children" in resolvedAST) {
|
|
5000
5006
|
var _resolvedAST_children;
|
|
5001
5007
|
var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
|
|
5002
|
-
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
5008
|
+
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
5003
5009
|
var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
|
|
5004
5010
|
childTreeDeps.forEach(function(binding) {
|
|
5005
5011
|
return childDependencies.add(binding);
|
|
@@ -5020,40 +5026,18 @@ var BeaconPlugin = function() {
|
|
|
5020
5026
|
resolvedAST.children = newChildren;
|
|
5021
5027
|
} else if (resolvedAST.type === "multi-node") {
|
|
5022
5028
|
var childValue = [];
|
|
5023
|
-
var rawParentToPassIn =
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
}).filter(function(index) {
|
|
5027
|
-
return index !== -1;
|
|
5028
|
-
});
|
|
5029
|
-
var newValues = resolvedAST.values.map(function(mValue) {
|
|
5030
|
-
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
5029
|
+
var rawParentToPassIn = node;
|
|
5030
|
+
resolvedAST.values = resolvedAST.values.map(function(mValue) {
|
|
5031
|
+
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
5031
5032
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
}
|
|
5035
|
-
|
|
5036
|
-
|
|
5033
|
+
mTree.dependencies.forEach(function(bindingDep) {
|
|
5034
|
+
return childDependencies.add(bindingDep);
|
|
5035
|
+
});
|
|
5036
|
+
updated = updated || mTree.updated;
|
|
5037
|
+
childValue.push(mTree.value);
|
|
5037
5038
|
}
|
|
5038
|
-
mTree.dependencies.forEach(function(bindingDep) {
|
|
5039
|
-
return childDependencies.add(bindingDep);
|
|
5040
|
-
});
|
|
5041
|
-
updated = updated || mTree.updated;
|
|
5042
5039
|
return mTree.node;
|
|
5043
5040
|
});
|
|
5044
|
-
if (hasAsync.length > 0) {
|
|
5045
|
-
var copy = newValues;
|
|
5046
|
-
hasAsync.forEach(function(index) {
|
|
5047
|
-
var _copy;
|
|
5048
|
-
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
5049
|
-
index,
|
|
5050
|
-
1
|
|
5051
|
-
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
5052
|
-
});
|
|
5053
|
-
resolvedAST.values = copy;
|
|
5054
|
-
} else {
|
|
5055
|
-
resolvedAST.values = newValues;
|
|
5056
|
-
}
|
|
5057
5041
|
resolved = childValue;
|
|
5058
5042
|
}
|
|
5059
5043
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -5074,7 +5058,7 @@ var BeaconPlugin = function() {
|
|
|
5074
5058
|
value: resolved,
|
|
5075
5059
|
dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
|
|
5076
5060
|
};
|
|
5077
|
-
this.hooks.afterNodeUpdate.call(node,
|
|
5061
|
+
this.hooks.afterNodeUpdate.call(node, rawParent, update);
|
|
5078
5062
|
cacheUpdate.set(node, update);
|
|
5079
5063
|
return update;
|
|
5080
5064
|
}
|
|
@@ -5082,15 +5066,6 @@ var BeaconPlugin = function() {
|
|
|
5082
5066
|
]);
|
|
5083
5067
|
return Resolver;
|
|
5084
5068
|
}();
|
|
5085
|
-
function unpackAndPush(item, initial) {
|
|
5086
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
5087
|
-
item.asset.values.forEach(function(i) {
|
|
5088
|
-
unpackAndPush(i, initial);
|
|
5089
|
-
});
|
|
5090
|
-
} else {
|
|
5091
|
-
initial.push(item);
|
|
5092
|
-
}
|
|
5093
|
-
}
|
|
5094
5069
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
5095
5070
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
5096
5071
|
_class_call_check(this, CrossfieldProvider);
|
|
@@ -5158,9 +5133,11 @@ var BeaconPlugin = function() {
|
|
|
5158
5133
|
_create_class(ViewInstance, [
|
|
5159
5134
|
{
|
|
5160
5135
|
key: "updateAsync",
|
|
5161
|
-
value: function updateAsync() {
|
|
5136
|
+
value: function updateAsync(asyncNode) {
|
|
5162
5137
|
var _this_resolver;
|
|
5163
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update()
|
|
5138
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
|
|
5139
|
+
asyncNode
|
|
5140
|
+
]));
|
|
5164
5141
|
this.lastUpdate = update;
|
|
5165
5142
|
this.hooks.onUpdate.call(update);
|
|
5166
5143
|
}
|
|
@@ -5250,7 +5227,7 @@ var BeaconPlugin = function() {
|
|
|
5250
5227
|
for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5251
5228
|
var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
|
|
5252
5229
|
var flags = "g";
|
|
5253
|
-
if (typeof expression === "object") {
|
|
5230
|
+
if ((typeof expression === "undefined" ? "undefined" : _type_of(expression)) === "object") {
|
|
5254
5231
|
flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
|
|
5255
5232
|
}
|
|
5256
5233
|
templateStr = templateStr.replace(new RegExp(expression, flags), value);
|
|
@@ -5399,7 +5376,7 @@ var BeaconPlugin = function() {
|
|
|
5399
5376
|
var bindingResolveLookup = createPatternMatcher("{{", "}}");
|
|
5400
5377
|
var expressionResolveLookup = createPatternMatcher("@[", "]@");
|
|
5401
5378
|
function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
|
|
5402
|
-
if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
|
|
5379
|
+
if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
|
|
5403
5380
|
return node;
|
|
5404
5381
|
}
|
|
5405
5382
|
if (typeof node === "string") {
|
|
@@ -5412,7 +5389,7 @@ var BeaconPlugin = function() {
|
|
|
5412
5389
|
}
|
|
5413
5390
|
var val = node[key];
|
|
5414
5391
|
var newVal = val;
|
|
5415
|
-
if (typeof val === "object") {
|
|
5392
|
+
if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
|
|
5416
5393
|
newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
|
|
5417
5394
|
} else if (typeof val === "string") {
|
|
5418
5395
|
newVal = resolveString(val, resolveOptions);
|
|
@@ -5701,7 +5678,7 @@ var BeaconPlugin = function() {
|
|
|
5701
5678
|
key: "applyParser",
|
|
5702
5679
|
value: function applyParser(parser) {
|
|
5703
5680
|
parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
|
|
5704
|
-
if (childOptions
|
|
5681
|
+
if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
|
|
5705
5682
|
var values = obj.map(function(childVal) {
|
|
5706
5683
|
return parser.parseObject(childVal, "value", options);
|
|
5707
5684
|
}).filter(function(child) {
|
|
@@ -5712,7 +5689,7 @@ var BeaconPlugin = function() {
|
|
|
5712
5689
|
}
|
|
5713
5690
|
var multiNode = parser.createASTNode({
|
|
5714
5691
|
type: "multi-node",
|
|
5715
|
-
override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5692
|
+
override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5716
5693
|
values: values
|
|
5717
5694
|
}, obj);
|
|
5718
5695
|
if (!multiNode) {
|
|
@@ -5723,7 +5700,7 @@ var BeaconPlugin = function() {
|
|
|
5723
5700
|
v.parent = multiNode;
|
|
5724
5701
|
});
|
|
5725
5702
|
}
|
|
5726
|
-
return [
|
|
5703
|
+
return childOptions === void 0 ? multiNode : [
|
|
5727
5704
|
{
|
|
5728
5705
|
path: _to_consumable_array(childOptions.path).concat([
|
|
5729
5706
|
childOptions.key
|
|
@@ -5753,7 +5730,7 @@ var BeaconPlugin = function() {
|
|
|
5753
5730
|
key: "applyParser",
|
|
5754
5731
|
value: function applyParser(parser) {
|
|
5755
5732
|
parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
|
|
5756
|
-
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
|
|
5733
|
+
if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
|
|
5757
5734
|
var assetAST = parser.parseObject(obj, "asset", options);
|
|
5758
5735
|
if (!assetAST) {
|
|
5759
5736
|
return [];
|
|
@@ -5953,6 +5930,7 @@ var BeaconPlugin = function() {
|
|
|
5953
5930
|
}();
|
|
5954
5931
|
var FlowInstance = /*#__PURE__*/ function() {
|
|
5955
5932
|
function FlowInstance(id, flow, options) {
|
|
5933
|
+
var _this = this;
|
|
5956
5934
|
_class_call_check(this, FlowInstance);
|
|
5957
5935
|
this.isTransitioning = false;
|
|
5958
5936
|
this.hooks = {
|
|
@@ -5969,60 +5947,55 @@ var BeaconPlugin = function() {
|
|
|
5969
5947
|
this.flow = flow;
|
|
5970
5948
|
this.log = options === null || options === void 0 ? void 0 : options.logger;
|
|
5971
5949
|
this.history = [];
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
var _ref = _async_to_generator(function(_oldState, nextState) {
|
|
5950
|
+
this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
|
|
5951
|
+
return _async_to_generator(function() {
|
|
5975
5952
|
var newState;
|
|
5976
5953
|
return _ts_generator(this, function(_state) {
|
|
5977
5954
|
newState = nextState.value;
|
|
5978
|
-
if (
|
|
5979
|
-
|
|
5955
|
+
if (this.flowPromise && newState.state_type === "END") {
|
|
5956
|
+
this.flowPromise.resolve(newState);
|
|
5980
5957
|
}
|
|
5981
5958
|
return [
|
|
5982
5959
|
2
|
|
5983
5960
|
];
|
|
5984
5961
|
});
|
|
5985
|
-
});
|
|
5986
|
-
|
|
5987
|
-
return _ref.apply(this, arguments);
|
|
5988
|
-
};
|
|
5989
|
-
}());
|
|
5962
|
+
}).call(_this);
|
|
5963
|
+
});
|
|
5990
5964
|
}
|
|
5991
5965
|
_create_class(FlowInstance, [
|
|
5992
5966
|
{
|
|
5993
5967
|
key: "start",
|
|
5994
5968
|
value: /** Start the state machine */ function start() {
|
|
5995
|
-
var _this = this;
|
|
5996
5969
|
return _async_to_generator(function() {
|
|
5997
5970
|
var _this_log, initialState;
|
|
5998
5971
|
return _ts_generator(this, function(_state) {
|
|
5999
|
-
if (
|
|
5972
|
+
if (this.flowPromise) {
|
|
6000
5973
|
;
|
|
6001
|
-
(_this_log =
|
|
5974
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
|
|
6002
5975
|
return [
|
|
6003
5976
|
2,
|
|
6004
|
-
|
|
5977
|
+
this.flowPromise.promise
|
|
6005
5978
|
];
|
|
6006
5979
|
}
|
|
6007
|
-
|
|
6008
|
-
if (
|
|
6009
|
-
|
|
5980
|
+
this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
|
|
5981
|
+
if (this.flow.onStart) {
|
|
5982
|
+
this.hooks.onStart.call(this.flow.onStart);
|
|
6010
5983
|
}
|
|
6011
|
-
initialState =
|
|
5984
|
+
initialState = this.flow.startState;
|
|
6012
5985
|
if (!initialState) {
|
|
6013
5986
|
return [
|
|
6014
5987
|
2,
|
|
6015
5988
|
Promise.reject(new Error("No 'startState' defined for flow"))
|
|
6016
5989
|
];
|
|
6017
5990
|
}
|
|
6018
|
-
|
|
6019
|
-
|
|
5991
|
+
this.flowPromise = (0, import_p_defer2.default)();
|
|
5992
|
+
this.pushHistory(initialState);
|
|
6020
5993
|
return [
|
|
6021
5994
|
2,
|
|
6022
|
-
|
|
5995
|
+
this.flowPromise.promise
|
|
6023
5996
|
];
|
|
6024
5997
|
});
|
|
6025
|
-
})();
|
|
5998
|
+
}).call(this);
|
|
6026
5999
|
}
|
|
6027
6000
|
},
|
|
6028
6001
|
{
|
|
@@ -6074,7 +6047,7 @@ var BeaconPlugin = function() {
|
|
|
6074
6047
|
throw new Error("No flow definition for: ".concat(stateName, " was found."));
|
|
6075
6048
|
}
|
|
6076
6049
|
var nextState = this.flow[stateName];
|
|
6077
|
-
if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
|
|
6050
|
+
if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
|
|
6078
6051
|
var _this_log;
|
|
6079
6052
|
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
|
|
6080
6053
|
return;
|
|
@@ -6134,30 +6107,30 @@ var BeaconPlugin = function() {
|
|
|
6134
6107
|
{
|
|
6135
6108
|
key: "run",
|
|
6136
6109
|
value: function run(startState) {
|
|
6137
|
-
var _this = this;
|
|
6138
6110
|
return _async_to_generator(function() {
|
|
6139
|
-
var _this_log, startFlow, flow, end, firstItem;
|
|
6111
|
+
var _this, _this_log, startFlow, flow, end, firstItem;
|
|
6140
6112
|
return _ts_generator(this, function(_state) {
|
|
6141
6113
|
switch(_state.label){
|
|
6142
6114
|
case 0:
|
|
6143
|
-
|
|
6115
|
+
_this = this;
|
|
6116
|
+
if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
|
|
6144
6117
|
return [
|
|
6145
6118
|
2,
|
|
6146
6119
|
Promise.reject(new Error("No flow defined for: ".concat(startState)))
|
|
6147
6120
|
];
|
|
6148
6121
|
}
|
|
6149
|
-
startFlow =
|
|
6150
|
-
if (startFlow === null || typeof startFlow !== "object") {
|
|
6122
|
+
startFlow = this.navigation[startState];
|
|
6123
|
+
if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
|
|
6151
6124
|
return [
|
|
6152
6125
|
2,
|
|
6153
6126
|
Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
|
|
6154
6127
|
];
|
|
6155
6128
|
}
|
|
6156
|
-
(_this_log =
|
|
6129
|
+
(_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
|
|
6157
6130
|
flow = new FlowInstance(startState, startFlow, {
|
|
6158
|
-
logger:
|
|
6131
|
+
logger: this.log
|
|
6159
6132
|
});
|
|
6160
|
-
|
|
6133
|
+
this.addNewFlow(flow);
|
|
6161
6134
|
flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
|
|
6162
6135
|
var _flowInstance_currentState;
|
|
6163
6136
|
if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
|
|
@@ -6177,10 +6150,10 @@ var BeaconPlugin = function() {
|
|
|
6177
6150
|
];
|
|
6178
6151
|
case 1:
|
|
6179
6152
|
end = _state.sent();
|
|
6180
|
-
|
|
6181
|
-
if (
|
|
6153
|
+
this.navStack.pop();
|
|
6154
|
+
if (this.navStack.length > 0) {
|
|
6182
6155
|
firstItem = 0;
|
|
6183
|
-
|
|
6156
|
+
this.current = this.navStack[firstItem];
|
|
6184
6157
|
}
|
|
6185
6158
|
return [
|
|
6186
6159
|
2,
|
|
@@ -6188,16 +6161,15 @@ var BeaconPlugin = function() {
|
|
|
6188
6161
|
];
|
|
6189
6162
|
}
|
|
6190
6163
|
});
|
|
6191
|
-
})();
|
|
6164
|
+
}).call(this);
|
|
6192
6165
|
}
|
|
6193
6166
|
},
|
|
6194
6167
|
{
|
|
6195
6168
|
key: "start",
|
|
6196
6169
|
value: function start() {
|
|
6197
|
-
var _this = this;
|
|
6198
6170
|
return _async_to_generator(function() {
|
|
6199
6171
|
return _ts_generator(this, function(_state) {
|
|
6200
|
-
if (!
|
|
6172
|
+
if (!this.navigation.BEGIN) {
|
|
6201
6173
|
return [
|
|
6202
6174
|
2,
|
|
6203
6175
|
Promise.reject(new Error("Must supply a BEGIN state"))
|
|
@@ -6205,10 +6177,10 @@ var BeaconPlugin = function() {
|
|
|
6205
6177
|
}
|
|
6206
6178
|
return [
|
|
6207
6179
|
2,
|
|
6208
|
-
|
|
6180
|
+
this.run(this.navigation.BEGIN)
|
|
6209
6181
|
];
|
|
6210
6182
|
});
|
|
6211
|
-
})();
|
|
6183
|
+
}).call(this);
|
|
6212
6184
|
}
|
|
6213
6185
|
}
|
|
6214
6186
|
]);
|
|
@@ -7315,7 +7287,7 @@ var BeaconPlugin = function() {
|
|
|
7315
7287
|
var parentBinding = resolved.parent();
|
|
7316
7288
|
var property = resolved.key();
|
|
7317
7289
|
var parentValue = this.get(parentBinding);
|
|
7318
|
-
var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7290
|
+
var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
|
|
7319
7291
|
this.getModel().delete(resolved, options);
|
|
7320
7292
|
if (existedBeforeDelete && !this.get(resolved)) {
|
|
7321
7293
|
this.trash.add(resolved);
|
|
@@ -7416,7 +7388,7 @@ var BeaconPlugin = function() {
|
|
|
7416
7388
|
var expressionEvaluator;
|
|
7417
7389
|
var handleEval = function(exp) {
|
|
7418
7390
|
if (exp) {
|
|
7419
|
-
if (typeof exp === "object" && "exp" in exp) {
|
|
7391
|
+
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7420
7392
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
7421
7393
|
} else {
|
|
7422
7394
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
|
|
@@ -7677,7 +7649,7 @@ var BeaconPlugin = function() {
|
|
|
7677
7649
|
flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
|
|
7678
7650
|
var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
|
|
7679
7651
|
if (state.onEnd && state.transitions[computedTransitionVal]) {
|
|
7680
|
-
if (
|
|
7652
|
+
if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
|
|
7681
7653
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
|
|
7682
7654
|
} else {
|
|
7683
7655
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
|
|
@@ -7836,12 +7808,12 @@ var BeaconPlugin = function() {
|
|
|
7836
7808
|
{
|
|
7837
7809
|
key: "start",
|
|
7838
7810
|
value: function start(payload) {
|
|
7839
|
-
var _this = this;
|
|
7840
7811
|
return _async_to_generator(function() {
|
|
7841
|
-
var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7812
|
+
var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7842
7813
|
return _ts_generator(this, function(_state) {
|
|
7843
7814
|
switch(_state.label){
|
|
7844
7815
|
case 0:
|
|
7816
|
+
_this = this;
|
|
7845
7817
|
ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
|
|
7846
7818
|
maybeUpdateState = function(newState) {
|
|
7847
7819
|
if (_this.state.ref !== ref) {
|
|
@@ -7851,7 +7823,7 @@ var BeaconPlugin = function() {
|
|
|
7851
7823
|
_this.setState(newState);
|
|
7852
7824
|
return newState;
|
|
7853
7825
|
};
|
|
7854
|
-
|
|
7826
|
+
this.setState({
|
|
7855
7827
|
status: "not-started",
|
|
7856
7828
|
ref: ref
|
|
7857
7829
|
});
|
|
@@ -7863,8 +7835,8 @@ var BeaconPlugin = function() {
|
|
|
7863
7835
|
,
|
|
7864
7836
|
4
|
|
7865
7837
|
]);
|
|
7866
|
-
_this_setupFlow =
|
|
7867
|
-
|
|
7838
|
+
_this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7839
|
+
this.setState(_object_spread({
|
|
7868
7840
|
ref: ref
|
|
7869
7841
|
}, state));
|
|
7870
7842
|
start();
|
|
@@ -7909,7 +7881,7 @@ var BeaconPlugin = function() {
|
|
|
7909
7881
|
];
|
|
7910
7882
|
}
|
|
7911
7883
|
});
|
|
7912
|
-
})();
|
|
7884
|
+
}).call(this);
|
|
7913
7885
|
}
|
|
7914
7886
|
}
|
|
7915
7887
|
]);
|
|
@@ -8024,51 +7996,53 @@ var BeaconPlugin = function() {
|
|
|
8024
7996
|
{
|
|
8025
7997
|
key: "beacon",
|
|
8026
7998
|
value: function beacon(event) {
|
|
7999
|
+
var _this = this;
|
|
8027
8000
|
var action = event.action, element = event.element, asset = event.asset, view = event.view;
|
|
8028
8001
|
var _this_beaconContext = this.beaconContext, currentView = _this_beaconContext.view;
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8002
|
+
setTimeout(function() {
|
|
8003
|
+
return _async_to_generator(function() {
|
|
8004
|
+
var _event_asset_metaData, _event_asset, _this_resolveDataRefs, _this, _this_player, unresolvedData, _this_resolveDataRefs1, data, defaultBeacon, state, hookArgs, beacon, shouldCancel, _this_logger;
|
|
8005
|
+
return _ts_generator(this, function(_state) {
|
|
8006
|
+
switch(_state.label){
|
|
8007
|
+
case 0:
|
|
8008
|
+
unresolvedData = (event === null || event === void 0 ? void 0 : event.data) || ((_event_asset = event.asset) === null || _event_asset === void 0 ? void 0 : (_event_asset_metaData = _event_asset.metaData) === null || _event_asset_metaData === void 0 ? void 0 : _event_asset_metaData.beacon);
|
|
8009
|
+
data = (_this_resolveDataRefs1 = (_this_resolveDataRefs = (_this = this).resolveDataRefs) === null || _this_resolveDataRefs === void 0 ? void 0 : _this_resolveDataRefs.call(_this, unresolvedData)) !== null && _this_resolveDataRefs1 !== void 0 ? _this_resolveDataRefs1 : unresolvedData;
|
|
8010
|
+
defaultBeacon = {
|
|
8011
|
+
action: action,
|
|
8012
|
+
element: element,
|
|
8013
|
+
data: data,
|
|
8014
|
+
assetId: asset === null || asset === void 0 ? void 0 : asset.id,
|
|
8015
|
+
viewId: currentView === null || currentView === void 0 ? void 0 : currentView.id
|
|
8016
|
+
};
|
|
8017
|
+
state = (_this_player = this.player) === null || _this_player === void 0 ? void 0 : _this_player.getState();
|
|
8018
|
+
hookArgs = _object_spread_props(_object_spread({}, event), {
|
|
8019
|
+
data: data,
|
|
8020
|
+
state: state,
|
|
8021
|
+
view: view !== null && view !== void 0 ? view : currentView,
|
|
8022
|
+
logger: this.logger
|
|
8023
|
+
});
|
|
8024
|
+
return [
|
|
8025
|
+
4,
|
|
8026
|
+
this.hooks.buildBeacon.call(defaultBeacon, hookArgs)
|
|
8027
|
+
];
|
|
8028
|
+
case 1:
|
|
8029
|
+
beacon = _state.sent() || defaultBeacon;
|
|
8030
|
+
if (beacon !== defaultBeacon && this.resolveDataRefs) {
|
|
8031
|
+
beacon = this.resolveDataRefs(beacon);
|
|
8032
|
+
}
|
|
8033
|
+
shouldCancel = this.hooks.cancelBeacon.call(hookArgs) || false;
|
|
8034
|
+
if (!shouldCancel) {
|
|
8035
|
+
;
|
|
8036
|
+
(_this_logger = this.logger) === null || _this_logger === void 0 ? void 0 : _this_logger.debug("Sending beacon event", beacon);
|
|
8037
|
+
this.hooks.publishBeacon.call(beacon);
|
|
8038
|
+
}
|
|
8039
|
+
return [
|
|
8040
|
+
2
|
|
8041
|
+
];
|
|
8042
|
+
}
|
|
8043
|
+
});
|
|
8044
|
+
}).call(_this);
|
|
8045
|
+
}, 0);
|
|
8072
8046
|
}
|
|
8073
8047
|
}
|
|
8074
8048
|
]);
|