@player-ui/beacon-plugin 0.8.0-next.4 → 0.8.0-next.6

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.
@@ -1354,8 +1354,16 @@ var BeaconPlugin = function() {
1354
1354
  }
1355
1355
  return targetMap;
1356
1356
  };
1357
- var hasAsync = function hasAsync(obj) {
1358
- return Object.prototype.hasOwnProperty.call(obj, "async");
1357
+ var hasTemplateValues = function hasTemplateValues(obj, localKey) {
1358
+ return Object.hasOwnProperty.call(obj, "template") && Array.isArray(obj === null || obj === void 0 ? void 0 : obj.template) && obj.template.length && obj.template.find(function(tmpl) {
1359
+ return tmpl.output === localKey;
1360
+ });
1361
+ };
1362
+ var hasSwitchKey = function hasSwitchKey(localKey) {
1363
+ return localKey === "staticSwitch" || localKey === "dynamicSwitch";
1364
+ };
1365
+ var hasTemplateKey = function hasTemplateKey(localKey) {
1366
+ return localKey === "template";
1359
1367
  };
1360
1368
  var getNodeID = function getNodeID(node) {
1361
1369
  var _node_value;
@@ -1645,7 +1653,7 @@ var BeaconPlugin = function() {
1645
1653
  exports.merge = merge;
1646
1654
  exports.mergeDeep = mergeDeep;
1647
1655
  exports.mergeIn = mergeIn;
1648
- exports.omit = omit4;
1656
+ exports.omit = omit3;
1649
1657
  exports.addDefaults = addDefaults;
1650
1658
  exports.default = void 0;
1651
1659
  var INVALID_ARGS = "INVALID_ARGS";
@@ -1819,7 +1827,7 @@ var BeaconPlugin = function() {
1819
1827
  }
1820
1828
  return setIn9(a, path, nextVal);
1821
1829
  }
1822
- function omit4(obj, attrs) {
1830
+ function omit3(obj, attrs) {
1823
1831
  var omitList = Array.isArray(attrs) ? attrs : [
1824
1832
  attrs
1825
1833
  ];
@@ -1905,7 +1913,7 @@ var BeaconPlugin = function() {
1905
1913
  merge: merge,
1906
1914
  mergeDeep: mergeDeep,
1907
1915
  mergeIn: mergeIn,
1908
- omit: omit4,
1916
+ omit: omit3,
1909
1917
  addDefaults: addDefaults
1910
1918
  };
1911
1919
  var _default = timm;
@@ -4354,7 +4362,6 @@ var BeaconPlugin = function() {
4354
4362
  * If undefined, the original value is used.
4355
4363
  * If null, we ignore this node all together
4356
4364
  */ onCreateASTNode: new SyncWaterfallHook(),
4357
- determineNodeType: new SyncBailHook(),
4358
4365
  parseNode: new SyncBailHook()
4359
4366
  };
4360
4367
  }
@@ -4369,21 +4376,6 @@ var BeaconPlugin = function() {
4369
4376
  return viewNode;
4370
4377
  }
4371
4378
  },
4372
- {
4373
- key: "parseAsync",
4374
- value: function parseAsync(obj, type, options) {
4375
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4376
- var parsedNodeId = getNodeID(parsedAsync);
4377
- if (parsedAsync !== null && parsedNodeId) {
4378
- return this.createASTNode({
4379
- id: parsedNodeId,
4380
- type: "async",
4381
- value: parsedAsync
4382
- }, obj);
4383
- }
4384
- return null;
4385
- }
4386
- },
4387
4379
  {
4388
4380
  key: "createASTNode",
4389
4381
  value: function createASTNode(node, value) {
@@ -4394,25 +4386,6 @@ var BeaconPlugin = function() {
4394
4386
  return tapped;
4395
4387
  }
4396
4388
  },
4397
- {
4398
- /**
4399
- * Checks if there are templated values in the object
4400
- *
4401
- * @param obj - The Parsed Object to check to see if we have a template array type for
4402
- * @param localKey - The key being checked
4403
- */ key: "hasTemplateValues",
4404
- value: function hasTemplateValues(obj, localKey) {
4405
- return Object.hasOwnProperty.call(obj, "template") && Array.isArray(obj === null || obj === void 0 ? void 0 : obj.template) && obj.template.length && obj.template.find(function(tmpl) {
4406
- return tmpl.output === localKey;
4407
- });
4408
- }
4409
- },
4410
- {
4411
- key: "hasSwitchKey",
4412
- value: function hasSwitchKey(localKey) {
4413
- return localKey === "staticSwitch";
4414
- }
4415
- },
4416
4389
  {
4417
4390
  key: "parseObject",
4418
4391
  value: function parseObject(obj) {
@@ -4420,12 +4393,9 @@ var BeaconPlugin = function() {
4420
4393
  templateDepth: 0
4421
4394
  };
4422
4395
  var _this = this;
4423
- var nodeType = this.hooks.determineNodeType.call(obj);
4424
- if (nodeType !== void 0) {
4425
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4426
- if (parsedNode) {
4427
- return parsedNode;
4428
- }
4396
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4397
+ if (parsedNode || parsedNode === null) {
4398
+ return parsedNode;
4429
4399
  }
4430
4400
  var parseLocalObject = function(currentValue, objToParse) {
4431
4401
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4455,166 +4425,42 @@ var BeaconPlugin = function() {
4455
4425
  value: currentValue
4456
4426
  };
4457
4427
  var newValue = objEntries.reduce(function(accumulation, current) {
4458
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4459
- "children"
4460
- ]);
4428
+ var value2 = accumulation.value;
4429
+ var children2 = accumulation.children;
4461
4430
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4462
- if (localKey === "asset" && typeof localValue === "object") {
4463
- var assetAST = _this.parseObject(localValue, "asset", options);
4464
- if (assetAST) {
4465
- return _object_spread_props(_object_spread({}, rest), {
4466
- children: _to_consumable_array(children2).concat([
4467
- {
4468
- path: _to_consumable_array(path).concat([
4469
- "asset"
4470
- ]),
4471
- value: assetAST
4472
- }
4473
- ])
4474
- });
4475
- }
4476
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4477
- var templateChildren = localValue.map(function(template) {
4478
- var _options_templateDepth, _template_dynamic;
4479
- var templateAST = _this.hooks.onCreateASTNode.call({
4480
- type: "template",
4481
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4482
- data: template.data,
4483
- template: template.value,
4484
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4485
- }, template);
4486
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4487
- templateAST.values.forEach(function(v) {
4488
- v.parent = templateAST;
4489
- });
4490
- }
4491
- if (templateAST) {
4492
- return {
4493
- path: _to_consumable_array(path).concat([
4494
- template.output
4495
- ]),
4496
- value: templateAST
4497
- };
4498
- }
4499
- return;
4500
- }).filter(function(element) {
4501
- return !!element;
4502
- });
4503
- return _object_spread_props(_object_spread({}, rest), {
4504
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4505
- });
4506
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4507
- var _localSwitch_children;
4508
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4509
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4510
- var firstChild = localSwitch.children[0];
4511
- return _object_spread_props(_object_spread({}, rest), {
4512
- children: _to_consumable_array(children2).concat([
4513
- {
4514
- path: _to_consumable_array(path).concat([
4515
- localKey
4516
- ], _to_consumable_array(firstChild.path)),
4517
- value: firstChild.value
4518
- }
4519
- ])
4520
- });
4521
- }
4522
- if (localSwitch) {
4523
- return _object_spread_props(_object_spread({}, rest), {
4524
- children: _to_consumable_array(children2).concat([
4525
- {
4526
- path: _to_consumable_array(path).concat([
4527
- localKey
4528
- ]),
4529
- value: localSwitch
4530
- }
4531
- ])
4532
- });
4533
- }
4534
- } else if (localValue && hasAsync(localValue)) {
4535
- var localAsync = _this.parseAsync(localValue, "value", options);
4536
- if (localAsync) {
4537
- children2.push({
4538
- path: _to_consumable_array(path).concat([
4539
- localKey
4540
- ]),
4541
- value: localAsync
4542
- });
4543
- }
4544
- } else if (localValue && Array.isArray(localValue)) {
4545
- var childValues = localValue.map(function(childVal) {
4546
- return _this.parseObject(childVal, "value", options);
4547
- }).filter(function(child) {
4548
- return !!child;
4549
- });
4550
- if (childValues.length > 0) {
4551
- var multiNode = _this.hooks.onCreateASTNode.call({
4552
- type: "multi-node",
4553
- override: !_this.hasTemplateValues(localObj, localKey),
4554
- values: childValues
4555
- }, localValue);
4556
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4557
- multiNode.values.forEach(function(v) {
4558
- v.parent = multiNode;
4559
- });
4560
- }
4561
- if (multiNode) {
4562
- return _object_spread_props(_object_spread({}, rest), {
4563
- children: _to_consumable_array(children2).concat([
4564
- {
4565
- path: _to_consumable_array(path).concat([
4566
- localKey
4567
- ]),
4568
- value: multiNode
4569
- }
4570
- ])
4571
- });
4572
- }
4573
- }
4431
+ var newChildren = _this.hooks.parseNode.call(localValue, "value", options, {
4432
+ path: path,
4433
+ key: localKey,
4434
+ parentObj: localObj
4435
+ });
4436
+ if (newChildren) {
4437
+ var _children2;
4438
+ (_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
4574
4439
  } else if (localValue && typeof localValue === "object") {
4575
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4576
- if (determineNodeType === "applicability") {
4577
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4578
- if (parsedNode) {
4579
- return _object_spread_props(_object_spread({}, rest), {
4580
- children: _to_consumable_array(children2).concat([
4581
- {
4582
- path: _to_consumable_array(path).concat([
4583
- localKey
4584
- ]),
4585
- value: parsedNode
4586
- }
4587
- ])
4588
- });
4589
- }
4590
- } else {
4591
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4592
- localKey
4593
- ]));
4594
- return {
4595
- value: result.value,
4596
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4597
- };
4598
- }
4440
+ var _children21;
4441
+ var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4442
+ localKey
4443
+ ]));
4444
+ value2 = result.value;
4445
+ (_children21 = children2).push.apply(_children21, _to_consumable_array(result.children));
4599
4446
  } else {
4600
- var value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4447
+ value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4601
4448
  localKey
4602
4449
  ]), localValue);
4603
- return {
4604
- children: children2,
4605
- value: value2
4606
- };
4607
4450
  }
4608
- return accumulation;
4451
+ return {
4452
+ value: value2,
4453
+ children: children2
4454
+ };
4609
4455
  }, defaultValue);
4610
4456
  return newValue;
4611
4457
  };
4612
4458
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4613
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4459
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4614
4460
  type: type,
4615
4461
  value: value
4616
4462
  };
4617
- if (baseAst !== void 0 && children.length > 0) {
4463
+ if (baseAst && children.length) {
4618
4464
  var parent = baseAst;
4619
4465
  parent.children = children;
4620
4466
  children.forEach(function(child) {
@@ -5102,24 +4948,30 @@ var BeaconPlugin = function() {
5102
4948
  }
5103
4949
  return node;
5104
4950
  });
5105
- parser.hooks.determineNodeType.tap("template", function(obj) {
5106
- if (obj === "template") {
5107
- return "template";
5108
- }
5109
- });
5110
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5111
- if (determinedNodeType === "template") {
5112
- var _options_templateDepth, _obj_dynamic;
5113
- var templateNode = parser.createASTNode({
5114
- type: "template",
5115
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5116
- data: obj.data,
5117
- template: obj.value,
5118
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5119
- }, obj);
5120
- if (templateNode) {
5121
- return templateNode;
5122
- }
4951
+ parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
4952
+ if (childOptions && hasTemplateKey(childOptions.key)) {
4953
+ return obj.map(function(template) {
4954
+ var _options_templateDepth, _template_dynamic;
4955
+ var templateAST = parser.createASTNode({
4956
+ type: "template",
4957
+ depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4958
+ data: template.data,
4959
+ template: template.value,
4960
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4961
+ }, template);
4962
+ if (!templateAST) return;
4963
+ if (templateAST.type === "multi-node") {
4964
+ templateAST.values.forEach(function(v) {
4965
+ v.parent = templateAST;
4966
+ });
4967
+ }
4968
+ return {
4969
+ path: _to_consumable_array(childOptions.path).concat([
4970
+ template.output
4971
+ ]),
4972
+ value: templateAST
4973
+ };
4974
+ }).filter(Boolean);
5123
4975
  }
5124
4976
  });
5125
4977
  }
@@ -5263,6 +5115,12 @@ var BeaconPlugin = function() {
5263
5115
  _class_call_check(this, ApplicabilityPlugin);
5264
5116
  }
5265
5117
  _create_class(ApplicabilityPlugin, [
5118
+ {
5119
+ key: "isApplicability",
5120
+ value: function isApplicability(obj) {
5121
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5122
+ }
5123
+ },
5266
5124
  {
5267
5125
  key: "applyResolver",
5268
5126
  value: function applyResolver(resolver) {
@@ -5282,25 +5140,32 @@ var BeaconPlugin = function() {
5282
5140
  {
5283
5141
  key: "applyParser",
5284
5142
  value: function applyParser(parser) {
5285
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5286
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5287
- return "applicability";
5288
- }
5289
- });
5290
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5291
- if (determinedNodeType === "applicability") {
5143
+ var _this = this;
5144
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5145
+ if (_this.isApplicability(obj)) {
5292
5146
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5293
- if (parsedApplicability !== null) {
5294
- var applicabilityNode = parser.createASTNode({
5295
- type: "applicability",
5296
- expression: obj.applicability,
5297
- value: parsedApplicability
5298
- }, obj);
5299
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5300
- applicabilityNode.value.parent = applicabilityNode;
5301
- }
5302
- return applicabilityNode;
5147
+ if (!parsedApplicability) {
5148
+ return childOptions ? [] : null;
5303
5149
  }
5150
+ var applicabilityNode = parser.createASTNode({
5151
+ type: "applicability",
5152
+ expression: obj.applicability,
5153
+ value: parsedApplicability
5154
+ }, obj);
5155
+ if (!applicabilityNode) {
5156
+ return childOptions ? [] : null;
5157
+ }
5158
+ if (applicabilityNode.type === "applicability") {
5159
+ applicabilityNode.value.parent = applicabilityNode;
5160
+ }
5161
+ return childOptions ? [
5162
+ {
5163
+ path: _to_consumable_array(childOptions.path).concat([
5164
+ childOptions.key
5165
+ ]),
5166
+ value: applicabilityNode
5167
+ }
5168
+ ] : applicabilityNode;
5304
5169
  }
5305
5170
  });
5306
5171
  }
@@ -5350,6 +5215,12 @@ var BeaconPlugin = function() {
5350
5215
  return EMPTY_NODE;
5351
5216
  }
5352
5217
  },
5218
+ {
5219
+ key: "isSwitch",
5220
+ value: function isSwitch(obj) {
5221
+ return obj && (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch"));
5222
+ }
5223
+ },
5353
5224
  {
5354
5225
  key: "applyParser",
5355
5226
  value: function applyParser(parser) {
@@ -5360,42 +5231,56 @@ var BeaconPlugin = function() {
5360
5231
  }
5361
5232
  return node;
5362
5233
  });
5363
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5364
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5365
- return "switch";
5366
- }
5367
- });
5368
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5369
- if (determinedNodeType === "switch") {
5370
- var dynamic = "dynamicSwitch" in obj;
5371
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5372
- var cases = [];
5373
- switchContent.forEach(function(switchCase) {
5234
+ parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, childOptions) {
5235
+ if (_this.isSwitch(obj) || childOptions && hasSwitchKey(childOptions.key)) {
5236
+ var objToParse = childOptions && hasSwitchKey(childOptions.key) ? _define_property({}, childOptions.key, obj) : obj;
5237
+ var dynamic = "dynamicSwitch" in objToParse;
5238
+ var switchContent = dynamic ? objToParse.dynamicSwitch : objToParse.staticSwitch;
5239
+ var cases = switchContent.map(function(switchCase) {
5374
5240
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5375
5241
  "case"
5376
5242
  ]);
5377
5243
  var value = parser.parseObject(switchBody, "value", options);
5378
5244
  if (value) {
5379
- cases.push({
5245
+ return {
5380
5246
  case: switchCaseExpr,
5381
5247
  value: value
5382
- });
5248
+ };
5383
5249
  }
5384
- });
5385
- var switchAST = parser.hooks.onCreateASTNode.call({
5250
+ return;
5251
+ }).filter(Boolean);
5252
+ var switchAST = parser.createASTNode({
5386
5253
  type: "switch",
5387
5254
  dynamic: dynamic,
5388
5255
  cases: cases
5389
- }, obj);
5390
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "switch") {
5256
+ }, objToParse);
5257
+ if (!switchAST || switchAST.type === "empty") {
5258
+ return childOptions ? [] : null;
5259
+ }
5260
+ if (switchAST.type === "switch") {
5391
5261
  switchAST.cases.forEach(function(sCase) {
5392
5262
  sCase.value.parent = switchAST;
5393
5263
  });
5394
5264
  }
5395
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5396
- return null;
5265
+ if (childOptions) {
5266
+ var _switchAST_children;
5267
+ var path = _to_consumable_array(childOptions.path).concat([
5268
+ childOptions.key
5269
+ ]);
5270
+ var value = switchAST;
5271
+ if (switchAST.type === "value" && ((_switchAST_children = switchAST.children) === null || _switchAST_children === void 0 ? void 0 : _switchAST_children.length) === 1 && switchAST.value === void 0) {
5272
+ var firstChild = switchAST.children[0];
5273
+ path = _to_consumable_array(path).concat(_to_consumable_array(firstChild.path));
5274
+ value = firstChild.value;
5275
+ }
5276
+ return [
5277
+ {
5278
+ path: path,
5279
+ value: value
5280
+ }
5281
+ ];
5397
5282
  }
5398
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5283
+ return switchAST;
5399
5284
  }
5400
5285
  });
5401
5286
  }
@@ -5422,6 +5307,93 @@ var BeaconPlugin = function() {
5422
5307
  ]);
5423
5308
  return SwitchPlugin;
5424
5309
  }();
5310
+ var MultiNodePlugin = /*#__PURE__*/ function() {
5311
+ function MultiNodePlugin() {
5312
+ _class_call_check(this, MultiNodePlugin);
5313
+ }
5314
+ _create_class(MultiNodePlugin, [
5315
+ {
5316
+ key: "applyParser",
5317
+ value: function applyParser(parser) {
5318
+ parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
5319
+ if (childOptions && !hasTemplateKey(childOptions.key) && Array.isArray(obj)) {
5320
+ var values = obj.map(function(childVal) {
5321
+ return parser.parseObject(childVal, "value", options);
5322
+ }).filter(function(child) {
5323
+ return !!child;
5324
+ });
5325
+ if (!values.length) {
5326
+ return [];
5327
+ }
5328
+ var multiNode = parser.createASTNode({
5329
+ type: "multi-node",
5330
+ override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
5331
+ values: values
5332
+ }, obj);
5333
+ if (!multiNode) {
5334
+ return [];
5335
+ }
5336
+ if (multiNode.type === "multi-node") {
5337
+ multiNode.values.forEach(function(v) {
5338
+ v.parent = multiNode;
5339
+ });
5340
+ }
5341
+ return [
5342
+ {
5343
+ path: _to_consumable_array(childOptions.path).concat([
5344
+ childOptions.key
5345
+ ]),
5346
+ value: multiNode
5347
+ }
5348
+ ];
5349
+ }
5350
+ });
5351
+ }
5352
+ },
5353
+ {
5354
+ key: "apply",
5355
+ value: function apply(view) {
5356
+ view.hooks.parser.tap("multi-node", this.applyParser.bind(this));
5357
+ }
5358
+ }
5359
+ ]);
5360
+ return MultiNodePlugin;
5361
+ }();
5362
+ var AssetPlugin = /*#__PURE__*/ function() {
5363
+ function AssetPlugin() {
5364
+ _class_call_check(this, AssetPlugin);
5365
+ }
5366
+ _create_class(AssetPlugin, [
5367
+ {
5368
+ key: "applyParser",
5369
+ value: function applyParser(parser) {
5370
+ parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
5371
+ if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
5372
+ var assetAST = parser.parseObject(obj, "asset", options);
5373
+ if (!assetAST) {
5374
+ return [];
5375
+ }
5376
+ return [
5377
+ {
5378
+ path: _to_consumable_array(childOptions.path).concat([
5379
+ childOptions.key
5380
+ ]),
5381
+ value: assetAST
5382
+ }
5383
+ ];
5384
+ }
5385
+ });
5386
+ }
5387
+ },
5388
+ {
5389
+ key: "apply",
5390
+ value: function apply(view) {
5391
+ view.hooks.parser.tap("asset", this.applyParser.bind(this));
5392
+ }
5393
+ }
5394
+ ]);
5395
+ return AssetPlugin;
5396
+ }();
5425
5397
  var FlowInstance = /*#__PURE__*/ function() {
5426
5398
  function FlowInstance(id, flow, options) {
5427
5399
  _class_call_check(this, FlowInstance);
@@ -7124,12 +7096,14 @@ var BeaconPlugin = function() {
7124
7096
  player.hooks.viewController.tap(this.name, function(viewController) {
7125
7097
  viewController.hooks.view.tap(_this.name, function(view) {
7126
7098
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7099
+ new AssetPlugin().apply(view);
7127
7100
  new SwitchPlugin(pluginOptions).apply(view);
7128
7101
  new ApplicabilityPlugin().apply(view);
7129
7102
  new StringResolverPlugin().apply(view);
7130
7103
  var templatePlugin = new TemplatePlugin(pluginOptions);
7131
7104
  templatePlugin.apply(view);
7132
7105
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7106
+ new MultiNodePlugin().apply(view);
7133
7107
  });
7134
7108
  });
7135
7109
  }