@player-ui/reference-assets-plugin 0.11.1 → 0.11.2--canary.649.23032

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.
@@ -1497,6 +1497,22 @@ var ReferenceAssetsPlugin = function() {
1497
1497
  }
1498
1498
  });
1499
1499
  };
1500
+ var unpackNode = function unpackNode(item) {
1501
+ var _item_children_, _item_children, _item_children_1, _item_children1;
1502
+ var unpacked = [];
1503
+ 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) {
1504
+ var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
1505
+ 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") {
1506
+ var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
1507
+ ((_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) {
1508
+ unpacked.push(value);
1509
+ });
1510
+ }
1511
+ } else {
1512
+ unpacked.push(item);
1513
+ }
1514
+ return unpacked;
1515
+ };
1500
1516
  var hasSomethingToResolve = function hasSomethingToResolve(str) {
1501
1517
  return bindingResolveLookup(str) || expressionResolveLookup(str);
1502
1518
  };
@@ -3791,6 +3807,9 @@ var ReferenceAssetsPlugin = function() {
3791
3807
  },
3792
3808
  setDataVal: function() {
3793
3809
  return setDataVal;
3810
+ },
3811
+ waitFor: function() {
3812
+ return waitFor;
3794
3813
  }
3795
3814
  });
3796
3815
  var setDataVal = function(_context, binding, value) {
@@ -3818,6 +3837,27 @@ var ReferenceAssetsPlugin = function() {
3818
3837
  return null;
3819
3838
  };
3820
3839
  conditional.resolveParams = false;
3840
+ var waitFor = function() {
3841
+ var _ref = _async_to_generator(function(ctx, promise) {
3842
+ return _ts_generator(this, function(_state) {
3843
+ switch(_state.label){
3844
+ case 0:
3845
+ return [
3846
+ 4,
3847
+ promise
3848
+ ];
3849
+ case 1:
3850
+ return [
3851
+ 2,
3852
+ _state.sent()
3853
+ ];
3854
+ }
3855
+ });
3856
+ });
3857
+ return function waitFor(ctx, promise) {
3858
+ return _ref.apply(this, arguments);
3859
+ };
3860
+ }();
3821
3861
  var andandOperator = function(ctx, a, b) {
3822
3862
  return ctx.evaluate(a) && ctx.evaluate(b);
3823
3863
  };
@@ -3923,7 +3963,12 @@ var ReferenceAssetsPlugin = function() {
3923
3963
  this.operators = {
3924
3964
  binary: new Map(Object.entries(DEFAULT_BINARY_OPERATORS)),
3925
3965
  unary: new Map(Object.entries(DEFAULT_UNARY_OPERATORS)),
3926
- expressions: new Map(Object.entries(evaluator_functions_exports))
3966
+ expressions: new Map(_to_consumable_array(Object.entries(evaluator_functions_exports)).concat([
3967
+ [
3968
+ "await",
3969
+ waitFor
3970
+ ]
3971
+ ]))
3927
3972
  };
3928
3973
  this.defaultHookOptions = _object_spread_props(_object_spread({}, defaultOptions), {
3929
3974
  evaluate: function(expr) {
@@ -3933,7 +3978,12 @@ var ReferenceAssetsPlugin = function() {
3933
3978
  return _this._execAST(node, _this.defaultHookOptions);
3934
3979
  }
3935
3980
  });
3936
- this.hooks.resolve.tap("ExpressionEvaluator", this._resolveNode.bind(this));
3981
+ this.hooks.resolve.tap("ExpressionEvaluator", function(result, node, options) {
3982
+ if (options.async) {
3983
+ return _this._resolveNodeAsync(result, node, options);
3984
+ }
3985
+ return _this._resolveNode(result, node, options);
3986
+ });
3937
3987
  this.evaluate = this.evaluate.bind(this);
3938
3988
  }
3939
3989
  _create_class(ExpressionEvaluator, [
@@ -3971,6 +4021,14 @@ var ReferenceAssetsPlugin = function() {
3971
4021
  return this._execString(String(expression), resolvedOpts);
3972
4022
  }
3973
4023
  },
4024
+ {
4025
+ key: "evaluateAsync",
4026
+ value: function evaluateAsync(expr, options) {
4027
+ return this.evaluate(expr, _object_spread_props(_object_spread({}, options), {
4028
+ async: true
4029
+ }));
4030
+ }
4031
+ },
3974
4032
  {
3975
4033
  key: "addExpressionFunction",
3976
4034
  value: function addExpressionFunction(name, handler) {
@@ -4016,8 +4074,10 @@ var ReferenceAssetsPlugin = function() {
4016
4074
  var matches = exp.match(/^@\[(.*)\]@$/);
4017
4075
  var matchedExp = exp;
4018
4076
  if (matches) {
4019
- var ref;
4020
- ref = _sliced_to_array(Array.from(matches), 2), matchedExp = ref[1], ref;
4077
+ var _Array_from = _sliced_to_array(Array.from(matches), 2), matched = _Array_from[1];
4078
+ if (matched) {
4079
+ matchedExp = matched;
4080
+ }
4021
4081
  }
4022
4082
  var storedAST;
4023
4083
  try {
@@ -4178,6 +4238,452 @@ var ReferenceAssetsPlugin = function() {
4178
4238
  return resolveNode(node.left);
4179
4239
  }
4180
4240
  }
4241
+ },
4242
+ {
4243
+ key: "_resolveNodeAsync",
4244
+ value: function _resolveNodeAsync(_currentValue, node, options) {
4245
+ var _this = this;
4246
+ return _async_to_generator(function() {
4247
+ var resolveNode, model, expressionContext, operator, _tmp, _tmp1, operator1, _tmp2, _tmp3, attributes, resolvedAttributes, expressionName, operator2, args, obj, prop, value, value1, result, operation, newValue, _tmp4, _tmp5;
4248
+ return _ts_generator(this, function(_state) {
4249
+ switch(_state.label){
4250
+ case 0:
4251
+ resolveNode = options.resolveNode, model = options.model;
4252
+ expressionContext = _object_spread_props(_object_spread({}, options), {
4253
+ evaluate: function(expr) {
4254
+ return _this.evaluate(expr, options);
4255
+ }
4256
+ });
4257
+ if (!(node.type === "BinaryExpression" || node.type === "LogicalExpression")) return [
4258
+ 3,
4259
+ 7
4260
+ ];
4261
+ operator = _this.operators.binary.get(node.operator);
4262
+ if (!operator) return [
4263
+ 3,
4264
+ 6
4265
+ ];
4266
+ if (!("resolveParams" in operator)) return [
4267
+ 3,
4268
+ 3
4269
+ ];
4270
+ if (operator.resolveParams === false) {
4271
+ return [
4272
+ 2,
4273
+ operator(expressionContext, node.left, node.right)
4274
+ ];
4275
+ }
4276
+ _tmp = [
4277
+ expressionContext
4278
+ ];
4279
+ return [
4280
+ 4,
4281
+ resolveNode(node.left)
4282
+ ];
4283
+ case 1:
4284
+ _tmp = _tmp.concat([
4285
+ _state.sent()
4286
+ ]);
4287
+ return [
4288
+ 4,
4289
+ resolveNode(node.right)
4290
+ ];
4291
+ case 2:
4292
+ return [
4293
+ 2,
4294
+ operator.apply(void 0, _tmp.concat([
4295
+ _state.sent()
4296
+ ]))
4297
+ ];
4298
+ case 3:
4299
+ return [
4300
+ 4,
4301
+ resolveNode(node.left)
4302
+ ];
4303
+ case 4:
4304
+ _tmp1 = [
4305
+ _state.sent()
4306
+ ];
4307
+ return [
4308
+ 4,
4309
+ resolveNode(node.right)
4310
+ ];
4311
+ case 5:
4312
+ return [
4313
+ 2,
4314
+ operator.apply(void 0, _tmp1.concat([
4315
+ _state.sent()
4316
+ ]))
4317
+ ];
4318
+ case 6:
4319
+ return [
4320
+ 2
4321
+ ];
4322
+ case 7:
4323
+ if (!(node.type === "UnaryExpression")) return [
4324
+ 3,
4325
+ 14
4326
+ ];
4327
+ operator1 = _this.operators.unary.get(node.operator);
4328
+ if (!operator1) return [
4329
+ 3,
4330
+ 13
4331
+ ];
4332
+ if (!("resolveParams" in operator1)) return [
4333
+ 3,
4334
+ 11
4335
+ ];
4336
+ _tmp2 = [
4337
+ expressionContext
4338
+ ];
4339
+ if (!(operator1.resolveParams === false)) return [
4340
+ 3,
4341
+ 8
4342
+ ];
4343
+ _tmp3 = node.argument;
4344
+ return [
4345
+ 3,
4346
+ 10
4347
+ ];
4348
+ case 8:
4349
+ return [
4350
+ 4,
4351
+ resolveNode(node.argument)
4352
+ ];
4353
+ case 9:
4354
+ _tmp3 = _state.sent();
4355
+ _state.label = 10;
4356
+ case 10:
4357
+ return [
4358
+ 2,
4359
+ operator1.apply(void 0, _tmp2.concat([
4360
+ _tmp3
4361
+ ]))
4362
+ ];
4363
+ case 11:
4364
+ return [
4365
+ 4,
4366
+ resolveNode(node.argument)
4367
+ ];
4368
+ case 12:
4369
+ return [
4370
+ 2,
4371
+ operator1.apply(void 0, [
4372
+ _state.sent()
4373
+ ])
4374
+ ];
4375
+ case 13:
4376
+ return [
4377
+ 2
4378
+ ];
4379
+ case 14:
4380
+ if (!(node.type === "Object")) return [
4381
+ 3,
4382
+ 16
4383
+ ];
4384
+ attributes = node.attributes;
4385
+ resolvedAttributes = {};
4386
+ return [
4387
+ 4,
4388
+ Promise.all(attributes.map(function() {
4389
+ var _ref = _async_to_generator(function(attr) {
4390
+ var key, value;
4391
+ return _ts_generator(this, function(_state) {
4392
+ switch(_state.label){
4393
+ case 0:
4394
+ return [
4395
+ 4,
4396
+ resolveNode(attr.key)
4397
+ ];
4398
+ case 1:
4399
+ key = _state.sent();
4400
+ return [
4401
+ 4,
4402
+ resolveNode(attr.value)
4403
+ ];
4404
+ case 2:
4405
+ value = _state.sent();
4406
+ resolvedAttributes[key] = value;
4407
+ return [
4408
+ 2
4409
+ ];
4410
+ }
4411
+ });
4412
+ });
4413
+ return function(attr) {
4414
+ return _ref.apply(this, arguments);
4415
+ };
4416
+ }()))
4417
+ ];
4418
+ case 15:
4419
+ _state.sent();
4420
+ return [
4421
+ 2,
4422
+ resolvedAttributes
4423
+ ];
4424
+ case 16:
4425
+ if (!(node.type === "CallExpression")) return [
4426
+ 3,
4427
+ 18
4428
+ ];
4429
+ expressionName = node.callTarget.name;
4430
+ operator2 = _this.operators.expressions.get(expressionName);
4431
+ if (!operator2) {
4432
+ throw new Error("Unknown expression function: ".concat(expressionName));
4433
+ }
4434
+ if ("resolveParams" in operator2 && operator2.resolveParams === false) {
4435
+ return [
4436
+ 2,
4437
+ operator2.apply(void 0, [
4438
+ expressionContext
4439
+ ].concat(_to_consumable_array(node.args)))
4440
+ ];
4441
+ }
4442
+ return [
4443
+ 4,
4444
+ Promise.all(node.args.map(function() {
4445
+ var _ref = _async_to_generator(function(n) {
4446
+ return _ts_generator(this, function(_state) {
4447
+ switch(_state.label){
4448
+ case 0:
4449
+ return [
4450
+ 4,
4451
+ resolveNode(n)
4452
+ ];
4453
+ case 1:
4454
+ return [
4455
+ 2,
4456
+ _state.sent()
4457
+ ];
4458
+ }
4459
+ });
4460
+ });
4461
+ return function(n) {
4462
+ return _ref.apply(this, arguments);
4463
+ };
4464
+ }()))
4465
+ ];
4466
+ case 17:
4467
+ args = _state.sent();
4468
+ return [
4469
+ 2,
4470
+ operator2.apply(void 0, [
4471
+ expressionContext
4472
+ ].concat(_to_consumable_array(args)))
4473
+ ];
4474
+ case 18:
4475
+ if (node.type === "ModelRef") {
4476
+ return [
4477
+ 2,
4478
+ model.get(node.ref, {
4479
+ context: {
4480
+ model: options.model
4481
+ }
4482
+ })
4483
+ ];
4484
+ }
4485
+ if (!(node.type === "MemberExpression")) return [
4486
+ 3,
4487
+ 21
4488
+ ];
4489
+ return [
4490
+ 4,
4491
+ resolveNode(node.object)
4492
+ ];
4493
+ case 19:
4494
+ obj = _state.sent();
4495
+ return [
4496
+ 4,
4497
+ resolveNode(node.property)
4498
+ ];
4499
+ case 20:
4500
+ prop = _state.sent();
4501
+ return [
4502
+ 2,
4503
+ obj[prop]
4504
+ ];
4505
+ case 21:
4506
+ if (!(node.type === "Assignment")) return [
4507
+ 3,
4508
+ 26
4509
+ ];
4510
+ if (!(node.left.type === "ModelRef")) return [
4511
+ 3,
4512
+ 23
4513
+ ];
4514
+ return [
4515
+ 4,
4516
+ resolveNode(node.right)
4517
+ ];
4518
+ case 22:
4519
+ value = _state.sent();
4520
+ model.set([
4521
+ [
4522
+ node.left.ref,
4523
+ value
4524
+ ]
4525
+ ]);
4526
+ return [
4527
+ 2,
4528
+ value
4529
+ ];
4530
+ case 23:
4531
+ if (!(node.left.type === "Identifier")) return [
4532
+ 3,
4533
+ 25
4534
+ ];
4535
+ return [
4536
+ 4,
4537
+ resolveNode(node.right)
4538
+ ];
4539
+ case 24:
4540
+ value1 = _state.sent();
4541
+ _this.vars[node.left.name] = value1;
4542
+ return [
4543
+ 2,
4544
+ value1
4545
+ ];
4546
+ case 25:
4547
+ return [
4548
+ 2
4549
+ ];
4550
+ case 26:
4551
+ if (!(node.type === "ConditionalExpression")) return [
4552
+ 3,
4553
+ 28
4554
+ ];
4555
+ return [
4556
+ 4,
4557
+ resolveNode(node.test)
4558
+ ];
4559
+ case 27:
4560
+ result = _state.sent() ? node.consequent : node.alternate;
4561
+ return [
4562
+ 2,
4563
+ resolveNode(result)
4564
+ ];
4565
+ case 28:
4566
+ if (node.type === "ArrayExpression") {
4567
+ return [
4568
+ 2,
4569
+ Promise.all(node.elements.map(function() {
4570
+ var _ref = _async_to_generator(function(ele) {
4571
+ return _ts_generator(this, function(_state) {
4572
+ switch(_state.label){
4573
+ case 0:
4574
+ return [
4575
+ 4,
4576
+ resolveNode(ele)
4577
+ ];
4578
+ case 1:
4579
+ return [
4580
+ 2,
4581
+ _state.sent()
4582
+ ];
4583
+ }
4584
+ });
4585
+ });
4586
+ return function(ele) {
4587
+ return _ref.apply(this, arguments);
4588
+ };
4589
+ }()))
4590
+ ];
4591
+ }
4592
+ if (!(node.type === "Modification")) return [
4593
+ 3,
4594
+ 38
4595
+ ];
4596
+ operation = _this.operators.binary.get(node.operator);
4597
+ if (!operation) return [
4598
+ 3,
4599
+ 37
4600
+ ];
4601
+ if (!("resolveParams" in operation)) return [
4602
+ 3,
4603
+ 33
4604
+ ];
4605
+ if (!(operation.resolveParams === false)) return [
4606
+ 3,
4607
+ 29
4608
+ ];
4609
+ newValue = operation(expressionContext, node.left, node.right);
4610
+ return [
4611
+ 3,
4612
+ 32
4613
+ ];
4614
+ case 29:
4615
+ _tmp4 = [
4616
+ expressionContext
4617
+ ];
4618
+ return [
4619
+ 4,
4620
+ resolveNode(node.left)
4621
+ ];
4622
+ case 30:
4623
+ _tmp4 = _tmp4.concat([
4624
+ _state.sent()
4625
+ ]);
4626
+ return [
4627
+ 4,
4628
+ resolveNode(node.right)
4629
+ ];
4630
+ case 31:
4631
+ newValue = operation.apply(void 0, _tmp4.concat([
4632
+ _state.sent()
4633
+ ]));
4634
+ _state.label = 32;
4635
+ case 32:
4636
+ return [
4637
+ 3,
4638
+ 36
4639
+ ];
4640
+ case 33:
4641
+ return [
4642
+ 4,
4643
+ resolveNode(node.left)
4644
+ ];
4645
+ case 34:
4646
+ _tmp5 = [
4647
+ _state.sent()
4648
+ ];
4649
+ return [
4650
+ 4,
4651
+ resolveNode(node.right)
4652
+ ];
4653
+ case 35:
4654
+ newValue = operation.apply(void 0, _tmp5.concat([
4655
+ _state.sent()
4656
+ ]));
4657
+ _state.label = 36;
4658
+ case 36:
4659
+ if (node.left.type === "ModelRef") {
4660
+ model.set([
4661
+ [
4662
+ node.left.ref,
4663
+ newValue
4664
+ ]
4665
+ ]);
4666
+ } else if (node.left.type === "Identifier") {
4667
+ _this.vars[node.left.name] = newValue;
4668
+ }
4669
+ return [
4670
+ 2,
4671
+ newValue
4672
+ ];
4673
+ case 37:
4674
+ return [
4675
+ 2,
4676
+ resolveNode(node.left)
4677
+ ];
4678
+ case 38:
4679
+ return [
4680
+ 2,
4681
+ _this._resolveNode(_currentValue, node, options)
4682
+ ];
4683
+ }
4684
+ });
4685
+ })();
4686
+ }
4181
4687
  }
4182
4688
  ]);
4183
4689
  return ExpressionEvaluator;
@@ -4690,15 +5196,6 @@ var ReferenceAssetsPlugin = function() {
4690
5196
  ]);
4691
5197
  return Parser;
4692
5198
  }();
4693
- function unpackAndPush(item, initial) {
4694
- if (item.asset.values && Array.isArray(item.asset.values)) {
4695
- item.asset.values.forEach(function(i) {
4696
- unpackAndPush(i, initial);
4697
- });
4698
- } else {
4699
- initial.push(item);
4700
- }
4701
- }
4702
5199
  var withContext = function(model) {
4703
5200
  return {
4704
5201
  get: function(binding, options) {
@@ -4821,7 +5318,7 @@ var ReferenceAssetsPlugin = function() {
4821
5318
  key: "computeTree",
4822
5319
  value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
4823
5320
  var _this = this;
4824
- var _partiallyResolvedParent_parent;
5321
+ var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
4825
5322
  var dependencyModel = new DependencyModel(options.data.model);
4826
5323
  dependencyModel.trackSubset("core");
4827
5324
  var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
@@ -4847,7 +5344,8 @@ var ReferenceAssetsPlugin = function() {
4847
5344
  var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
4848
5345
  type: "empty"
4849
5346
  };
4850
- var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent.type) === "multi-node" && partiallyResolvedParent.type === "value";
5347
+ 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");
5348
+ 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";
4851
5349
  if (previousResult && shouldUseLastValue) {
4852
5350
  var update2 = _object_spread_props(_object_spread({}, previousResult), {
4853
5351
  updated: false
@@ -4881,7 +5379,11 @@ var ReferenceAssetsPlugin = function() {
4881
5379
  repopulateASTMapFromCache(previousResult, node, rawParent);
4882
5380
  return update2;
4883
5381
  }
4884
- resolvedAST.parent = partiallyResolvedParent;
5382
+ if (isNestedMultiNodeWithAsync) {
5383
+ resolvedAST.parent = partiallyResolvedParent.parent;
5384
+ } else {
5385
+ resolvedAST.parent = partiallyResolvedParent;
5386
+ }
4885
5387
  resolveOptions.node = resolvedAST;
4886
5388
  this.ASTMap.set(resolvedAST, node);
4887
5389
  var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
@@ -4916,6 +5418,11 @@ var ReferenceAssetsPlugin = function() {
4916
5418
  } else if (resolvedAST.type === "multi-node") {
4917
5419
  var childValue = [];
4918
5420
  var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
5421
+ var hasAsync = resolvedAST.values.map(function(value, index) {
5422
+ return value.type === "async" ? index : -1;
5423
+ }).filter(function(index) {
5424
+ return index !== -1;
5425
+ });
4919
5426
  var newValues = resolvedAST.values.map(function(mValue) {
4920
5427
  var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
4921
5428
  if (mTree.value !== void 0 && mTree.value !== null) {
@@ -4931,7 +5438,19 @@ var ReferenceAssetsPlugin = function() {
4931
5438
  updated = updated || mTree.updated;
4932
5439
  return mTree.node;
4933
5440
  });
4934
- resolvedAST.values = newValues;
5441
+ if (hasAsync.length > 0) {
5442
+ var copy = newValues;
5443
+ hasAsync.forEach(function(index) {
5444
+ var _copy;
5445
+ if (copy[index]) (_copy = copy).splice.apply(_copy, [
5446
+ index,
5447
+ 1
5448
+ ].concat(_to_consumable_array(unpackNode(copy[index]))));
5449
+ });
5450
+ resolvedAST.values = copy;
5451
+ } else {
5452
+ resolvedAST.values = newValues;
5453
+ }
4935
5454
  resolved = childValue;
4936
5455
  }
4937
5456
  childDependencies.forEach(function(bindingDep) {
@@ -4960,6 +5479,15 @@ var ReferenceAssetsPlugin = function() {
4960
5479
  ]);
4961
5480
  return Resolver;
4962
5481
  }();
5482
+ function unpackAndPush(item, initial) {
5483
+ if (item.asset.values && Array.isArray(item.asset.values)) {
5484
+ item.asset.values.forEach(function(i) {
5485
+ unpackAndPush(i, initial);
5486
+ });
5487
+ } else {
5488
+ initial.push(item);
5489
+ }
5490
+ }
4963
5491
  var CrossfieldProvider = /*#__PURE__*/ function() {
4964
5492
  function CrossfieldProvider(initialView, parser, logger) {
4965
5493
  _class_call_check(this, CrossfieldProvider);
@@ -7707,15 +8235,56 @@ var ReferenceAssetsPlugin = function() {
7707
8235
  validationController.reset();
7708
8236
  }
7709
8237
  });
7710
- flow.hooks.afterTransition.tap("player", function(flowInstance) {
7711
- var _flowInstance_currentState;
7712
- var value = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value;
7713
- if (value && value.state_type === "ACTION") {
7714
- var exp = value.exp;
7715
- flowController === null || flowController === void 0 ? void 0 : flowController.transition(String(expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp)));
7716
- }
7717
- expressionEvaluator.reset();
7718
- });
8238
+ flow.hooks.afterTransition.tap("player", function() {
8239
+ var _ref = _async_to_generator(function(flowInstance) {
8240
+ var _flowInstance_currentState, value, exp, result, e;
8241
+ return _ts_generator(this, function(_state) {
8242
+ switch(_state.label){
8243
+ case 0:
8244
+ value = (_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value;
8245
+ if (!(value && value.state_type === "ACTION")) return [
8246
+ 3,
8247
+ 4
8248
+ ];
8249
+ exp = value.exp;
8250
+ _state.label = 1;
8251
+ case 1:
8252
+ _state.trys.push([
8253
+ 1,
8254
+ 3,
8255
+ ,
8256
+ 4
8257
+ ]);
8258
+ return [
8259
+ 4,
8260
+ expressionEvaluator.evaluateAsync(exp)
8261
+ ];
8262
+ case 2:
8263
+ result = _state.sent();
8264
+ flowController === null || flowController === void 0 ? void 0 : flowController.transition(String(result));
8265
+ return [
8266
+ 3,
8267
+ 4
8268
+ ];
8269
+ case 3:
8270
+ e = _state.sent();
8271
+ flowResultDeferred.reject(e);
8272
+ return [
8273
+ 3,
8274
+ 4
8275
+ ];
8276
+ case 4:
8277
+ expressionEvaluator.reset();
8278
+ return [
8279
+ 2
8280
+ ];
8281
+ }
8282
+ });
8283
+ });
8284
+ return function(flowInstance) {
8285
+ return _ref.apply(this, arguments);
8286
+ };
8287
+ }());
7719
8288
  });
7720
8289
  this.hooks.dataController.call(dataController);
7721
8290
  validationController.setOptions({