@player-ui/beacon-plugin 0.8.0-next.1 → 0.8.0-next.10

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;
@@ -2642,6 +2650,12 @@ var BeaconPlugin = function() {
2642
2650
  value: function clear() {
2643
2651
  this.store = createSortedArray();
2644
2652
  }
2653
+ },
2654
+ {
2655
+ /** Check if the registry is empty*/ key: "isRegistryEmpty",
2656
+ value: function isRegistryEmpty() {
2657
+ return this.store.array.length === 0;
2658
+ }
2645
2659
  }
2646
2660
  ]);
2647
2661
  return Registry;
@@ -4348,7 +4362,6 @@ var BeaconPlugin = function() {
4348
4362
  * If undefined, the original value is used.
4349
4363
  * If null, we ignore this node all together
4350
4364
  */ onCreateASTNode: new SyncWaterfallHook(),
4351
- determineNodeType: new SyncBailHook(),
4352
4365
  parseNode: new SyncBailHook()
4353
4366
  };
4354
4367
  }
@@ -4363,21 +4376,6 @@ var BeaconPlugin = function() {
4363
4376
  return viewNode;
4364
4377
  }
4365
4378
  },
4366
- {
4367
- key: "parseAsync",
4368
- value: function parseAsync(obj, type, options) {
4369
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4370
- var parsedNodeId = getNodeID(parsedAsync);
4371
- if (parsedAsync !== null && parsedNodeId) {
4372
- return this.createASTNode({
4373
- id: parsedNodeId,
4374
- type: "async",
4375
- value: parsedAsync
4376
- }, obj);
4377
- }
4378
- return null;
4379
- }
4380
- },
4381
4379
  {
4382
4380
  key: "createASTNode",
4383
4381
  value: function createASTNode(node, value) {
@@ -4388,25 +4386,6 @@ var BeaconPlugin = function() {
4388
4386
  return tapped;
4389
4387
  }
4390
4388
  },
4391
- {
4392
- /**
4393
- * Checks if there are templated values in the object
4394
- *
4395
- * @param obj - The Parsed Object to check to see if we have a template array type for
4396
- * @param localKey - The key being checked
4397
- */ key: "hasTemplateValues",
4398
- value: function hasTemplateValues(obj, localKey) {
4399
- 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) {
4400
- return tmpl.output === localKey;
4401
- });
4402
- }
4403
- },
4404
- {
4405
- key: "hasSwitchKey",
4406
- value: function hasSwitchKey(localKey) {
4407
- return localKey === "staticSwitch";
4408
- }
4409
- },
4410
4389
  {
4411
4390
  key: "parseObject",
4412
4391
  value: function parseObject(obj) {
@@ -4414,12 +4393,9 @@ var BeaconPlugin = function() {
4414
4393
  templateDepth: 0
4415
4394
  };
4416
4395
  var _this = this;
4417
- var nodeType = this.hooks.determineNodeType.call(obj);
4418
- if (nodeType !== void 0) {
4419
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4420
- if (parsedNode) {
4421
- return parsedNode;
4422
- }
4396
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4397
+ if (parsedNode || parsedNode === null) {
4398
+ return parsedNode;
4423
4399
  }
4424
4400
  var parseLocalObject = function(currentValue, objToParse) {
4425
4401
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4449,166 +4425,42 @@ var BeaconPlugin = function() {
4449
4425
  value: currentValue
4450
4426
  };
4451
4427
  var newValue = objEntries.reduce(function(accumulation, current) {
4452
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4453
- "children"
4454
- ]);
4428
+ var value2 = accumulation.value;
4429
+ var children2 = accumulation.children;
4455
4430
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4456
- if (localKey === "asset" && typeof localValue === "object") {
4457
- var assetAST = _this.parseObject(localValue, "asset", options);
4458
- if (assetAST) {
4459
- return _object_spread_props(_object_spread({}, rest), {
4460
- children: _to_consumable_array(children2).concat([
4461
- {
4462
- path: _to_consumable_array(path).concat([
4463
- "asset"
4464
- ]),
4465
- value: assetAST
4466
- }
4467
- ])
4468
- });
4469
- }
4470
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4471
- var templateChildren = localValue.map(function(template) {
4472
- var _options_templateDepth, _template_dynamic;
4473
- var templateAST = _this.hooks.onCreateASTNode.call({
4474
- type: "template",
4475
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4476
- data: template.data,
4477
- template: template.value,
4478
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4479
- }, template);
4480
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4481
- templateAST.values.forEach(function(v) {
4482
- v.parent = templateAST;
4483
- });
4484
- }
4485
- if (templateAST) {
4486
- return {
4487
- path: _to_consumable_array(path).concat([
4488
- template.output
4489
- ]),
4490
- value: templateAST
4491
- };
4492
- }
4493
- return;
4494
- }).filter(function(element) {
4495
- return !!element;
4496
- });
4497
- return _object_spread_props(_object_spread({}, rest), {
4498
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4499
- });
4500
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4501
- var _localSwitch_children;
4502
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4503
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4504
- var firstChild = localSwitch.children[0];
4505
- return _object_spread_props(_object_spread({}, rest), {
4506
- children: _to_consumable_array(children2).concat([
4507
- {
4508
- path: _to_consumable_array(path).concat([
4509
- localKey
4510
- ], _to_consumable_array(firstChild.path)),
4511
- value: firstChild.value
4512
- }
4513
- ])
4514
- });
4515
- }
4516
- if (localSwitch) {
4517
- return _object_spread_props(_object_spread({}, rest), {
4518
- children: _to_consumable_array(children2).concat([
4519
- {
4520
- path: _to_consumable_array(path).concat([
4521
- localKey
4522
- ]),
4523
- value: localSwitch
4524
- }
4525
- ])
4526
- });
4527
- }
4528
- } else if (localValue && hasAsync(localValue)) {
4529
- var localAsync = _this.parseAsync(localValue, "value", options);
4530
- if (localAsync) {
4531
- children2.push({
4532
- path: _to_consumable_array(path).concat([
4533
- localKey
4534
- ]),
4535
- value: localAsync
4536
- });
4537
- }
4538
- } else if (localValue && Array.isArray(localValue)) {
4539
- var childValues = localValue.map(function(childVal) {
4540
- return _this.parseObject(childVal, "value", options);
4541
- }).filter(function(child) {
4542
- return !!child;
4543
- });
4544
- if (childValues.length > 0) {
4545
- var multiNode = _this.hooks.onCreateASTNode.call({
4546
- type: "multi-node",
4547
- override: !_this.hasTemplateValues(localObj, localKey),
4548
- values: childValues
4549
- }, localValue);
4550
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4551
- multiNode.values.forEach(function(v) {
4552
- v.parent = multiNode;
4553
- });
4554
- }
4555
- if (multiNode) {
4556
- return _object_spread_props(_object_spread({}, rest), {
4557
- children: _to_consumable_array(children2).concat([
4558
- {
4559
- path: _to_consumable_array(path).concat([
4560
- localKey
4561
- ]),
4562
- value: multiNode
4563
- }
4564
- ])
4565
- });
4566
- }
4567
- }
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));
4568
4439
  } else if (localValue && typeof localValue === "object") {
4569
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4570
- if (determineNodeType === "applicability") {
4571
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4572
- if (parsedNode) {
4573
- return _object_spread_props(_object_spread({}, rest), {
4574
- children: _to_consumable_array(children2).concat([
4575
- {
4576
- path: _to_consumable_array(path).concat([
4577
- localKey
4578
- ]),
4579
- value: parsedNode
4580
- }
4581
- ])
4582
- });
4583
- }
4584
- } else {
4585
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4586
- localKey
4587
- ]));
4588
- return {
4589
- value: result.value,
4590
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4591
- };
4592
- }
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));
4593
4446
  } else {
4594
- 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([
4595
4448
  localKey
4596
4449
  ]), localValue);
4597
- return {
4598
- children: children2,
4599
- value: value2
4600
- };
4601
4450
  }
4602
- return accumulation;
4451
+ return {
4452
+ value: value2,
4453
+ children: children2
4454
+ };
4603
4455
  }, defaultValue);
4604
4456
  return newValue;
4605
4457
  };
4606
4458
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4607
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4459
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4608
4460
  type: type,
4609
4461
  value: value
4610
4462
  };
4611
- if (baseAst !== void 0 && children.length > 0) {
4463
+ if (baseAst && children.length) {
4612
4464
  var parent = baseAst;
4613
4465
  parent.children = children;
4614
4466
  children.forEach(function(child) {
@@ -5096,24 +4948,30 @@ var BeaconPlugin = function() {
5096
4948
  }
5097
4949
  return node;
5098
4950
  });
5099
- parser.hooks.determineNodeType.tap("template", function(obj) {
5100
- if (obj === "template") {
5101
- return "template";
5102
- }
5103
- });
5104
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5105
- if (determinedNodeType === "template") {
5106
- var _options_templateDepth, _obj_dynamic;
5107
- var templateNode = parser.createASTNode({
5108
- type: "template",
5109
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5110
- data: obj.data,
5111
- template: obj.value,
5112
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5113
- }, obj);
5114
- if (templateNode) {
5115
- return templateNode;
5116
- }
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);
5117
4975
  }
5118
4976
  });
5119
4977
  }
@@ -5257,6 +5115,12 @@ var BeaconPlugin = function() {
5257
5115
  _class_call_check(this, ApplicabilityPlugin);
5258
5116
  }
5259
5117
  _create_class(ApplicabilityPlugin, [
5118
+ {
5119
+ key: "isApplicability",
5120
+ value: function isApplicability(obj) {
5121
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5122
+ }
5123
+ },
5260
5124
  {
5261
5125
  key: "applyResolver",
5262
5126
  value: function applyResolver(resolver) {
@@ -5276,25 +5140,32 @@ var BeaconPlugin = function() {
5276
5140
  {
5277
5141
  key: "applyParser",
5278
5142
  value: function applyParser(parser) {
5279
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5280
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5281
- return "applicability";
5282
- }
5283
- });
5284
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5285
- if (determinedNodeType === "applicability") {
5143
+ var _this = this;
5144
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5145
+ if (_this.isApplicability(obj)) {
5286
5146
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5287
- if (parsedApplicability !== null) {
5288
- var applicabilityNode = parser.createASTNode({
5289
- type: "applicability",
5290
- expression: obj.applicability,
5291
- value: parsedApplicability
5292
- }, obj);
5293
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5294
- applicabilityNode.value.parent = applicabilityNode;
5295
- }
5296
- return applicabilityNode;
5147
+ if (!parsedApplicability) {
5148
+ return childOptions ? [] : null;
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;
5297
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;
5298
5169
  }
5299
5170
  });
5300
5171
  }
@@ -5344,6 +5215,12 @@ var BeaconPlugin = function() {
5344
5215
  return EMPTY_NODE;
5345
5216
  }
5346
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
+ },
5347
5224
  {
5348
5225
  key: "applyParser",
5349
5226
  value: function applyParser(parser) {
@@ -5354,42 +5231,56 @@ var BeaconPlugin = function() {
5354
5231
  }
5355
5232
  return node;
5356
5233
  });
5357
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5358
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5359
- return "switch";
5360
- }
5361
- });
5362
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5363
- if (determinedNodeType === "switch") {
5364
- var dynamic = "dynamicSwitch" in obj;
5365
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5366
- var cases = [];
5367
- 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) {
5368
5240
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5369
5241
  "case"
5370
5242
  ]);
5371
5243
  var value = parser.parseObject(switchBody, "value", options);
5372
5244
  if (value) {
5373
- cases.push({
5245
+ return {
5374
5246
  case: switchCaseExpr,
5375
5247
  value: value
5376
- });
5248
+ };
5377
5249
  }
5378
- });
5379
- var switchAST = parser.hooks.onCreateASTNode.call({
5250
+ return;
5251
+ }).filter(Boolean);
5252
+ var switchAST = parser.createASTNode({
5380
5253
  type: "switch",
5381
5254
  dynamic: dynamic,
5382
5255
  cases: cases
5383
- }, obj);
5384
- 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") {
5385
5261
  switchAST.cases.forEach(function(sCase) {
5386
5262
  sCase.value.parent = switchAST;
5387
5263
  });
5388
5264
  }
5389
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5390
- 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
+ ];
5391
5282
  }
5392
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5283
+ return switchAST;
5393
5284
  }
5394
5285
  });
5395
5286
  }
@@ -5416,6 +5307,93 @@ var BeaconPlugin = function() {
5416
5307
  ]);
5417
5308
  return SwitchPlugin;
5418
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
+ }();
5419
5397
  var FlowInstance = /*#__PURE__*/ function() {
5420
5398
  function FlowInstance(id, flow, options) {
5421
5399
  _class_call_check(this, FlowInstance);
@@ -7118,12 +7096,14 @@ var BeaconPlugin = function() {
7118
7096
  player.hooks.viewController.tap(this.name, function(viewController) {
7119
7097
  viewController.hooks.view.tap(_this.name, function(view) {
7120
7098
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7099
+ new AssetPlugin().apply(view);
7121
7100
  new SwitchPlugin(pluginOptions).apply(view);
7122
7101
  new ApplicabilityPlugin().apply(view);
7123
7102
  new StringResolverPlugin().apply(view);
7124
7103
  var templatePlugin = new TemplatePlugin(pluginOptions);
7125
7104
  templatePlugin.apply(view);
7126
7105
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7106
+ new MultiNodePlugin().apply(view);
7127
7107
  });
7128
7108
  });
7129
7109
  }