@player-ui/check-path-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 CheckPathPlugin = 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;
@@ -1667,7 +1675,7 @@ var CheckPathPlugin = function() {
1667
1675
  exports.merge = merge;
1668
1676
  exports.mergeDeep = mergeDeep;
1669
1677
  exports.mergeIn = mergeIn;
1670
- exports.omit = omit4;
1678
+ exports.omit = omit3;
1671
1679
  exports.addDefaults = addDefaults;
1672
1680
  exports.default = void 0;
1673
1681
  var INVALID_ARGS = "INVALID_ARGS";
@@ -1841,7 +1849,7 @@ var CheckPathPlugin = function() {
1841
1849
  }
1842
1850
  return setIn8(a, path, nextVal);
1843
1851
  }
1844
- function omit4(obj, attrs) {
1852
+ function omit3(obj, attrs) {
1845
1853
  var omitList = Array.isArray(attrs) ? attrs : [
1846
1854
  attrs
1847
1855
  ];
@@ -1927,7 +1935,7 @@ var CheckPathPlugin = function() {
1927
1935
  merge: merge,
1928
1936
  mergeDeep: mergeDeep,
1929
1937
  mergeIn: mergeIn,
1930
- omit: omit4,
1938
+ omit: omit3,
1931
1939
  addDefaults: addDefaults
1932
1940
  };
1933
1941
  var _default = timm;
@@ -2580,6 +2588,12 @@ var CheckPathPlugin = function() {
2580
2588
  value: function clear() {
2581
2589
  this.store = createSortedArray();
2582
2590
  }
2591
+ },
2592
+ {
2593
+ /** Check if the registry is empty*/ key: "isRegistryEmpty",
2594
+ value: function isRegistryEmpty() {
2595
+ return this.store.array.length === 0;
2596
+ }
2583
2597
  }
2584
2598
  ]);
2585
2599
  return Registry;
@@ -4299,7 +4313,6 @@ var CheckPathPlugin = function() {
4299
4313
  * If undefined, the original value is used.
4300
4314
  * If null, we ignore this node all together
4301
4315
  */ onCreateASTNode: new SyncWaterfallHook(),
4302
- determineNodeType: new SyncBailHook(),
4303
4316
  parseNode: new SyncBailHook()
4304
4317
  };
4305
4318
  }
@@ -4314,21 +4327,6 @@ var CheckPathPlugin = function() {
4314
4327
  return viewNode;
4315
4328
  }
4316
4329
  },
4317
- {
4318
- key: "parseAsync",
4319
- value: function parseAsync(obj, type, options) {
4320
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4321
- var parsedNodeId = getNodeID(parsedAsync);
4322
- if (parsedAsync !== null && parsedNodeId) {
4323
- return this.createASTNode({
4324
- id: parsedNodeId,
4325
- type: "async",
4326
- value: parsedAsync
4327
- }, obj);
4328
- }
4329
- return null;
4330
- }
4331
- },
4332
4330
  {
4333
4331
  key: "createASTNode",
4334
4332
  value: function createASTNode(node, value) {
@@ -4339,25 +4337,6 @@ var CheckPathPlugin = function() {
4339
4337
  return tapped;
4340
4338
  }
4341
4339
  },
4342
- {
4343
- /**
4344
- * Checks if there are templated values in the object
4345
- *
4346
- * @param obj - The Parsed Object to check to see if we have a template array type for
4347
- * @param localKey - The key being checked
4348
- */ key: "hasTemplateValues",
4349
- value: function hasTemplateValues(obj, localKey) {
4350
- 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) {
4351
- return tmpl.output === localKey;
4352
- });
4353
- }
4354
- },
4355
- {
4356
- key: "hasSwitchKey",
4357
- value: function hasSwitchKey(localKey) {
4358
- return localKey === "staticSwitch";
4359
- }
4360
- },
4361
4340
  {
4362
4341
  key: "parseObject",
4363
4342
  value: function parseObject(obj) {
@@ -4365,12 +4344,9 @@ var CheckPathPlugin = function() {
4365
4344
  templateDepth: 0
4366
4345
  };
4367
4346
  var _this = this;
4368
- var nodeType = this.hooks.determineNodeType.call(obj);
4369
- if (nodeType !== void 0) {
4370
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4371
- if (parsedNode) {
4372
- return parsedNode;
4373
- }
4347
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4348
+ if (parsedNode || parsedNode === null) {
4349
+ return parsedNode;
4374
4350
  }
4375
4351
  var parseLocalObject = function(currentValue, objToParse) {
4376
4352
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4400,166 +4376,42 @@ var CheckPathPlugin = function() {
4400
4376
  value: currentValue
4401
4377
  };
4402
4378
  var newValue = objEntries.reduce(function(accumulation, current) {
4403
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4404
- "children"
4405
- ]);
4379
+ var value2 = accumulation.value;
4380
+ var children2 = accumulation.children;
4406
4381
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4407
- if (localKey === "asset" && typeof localValue === "object") {
4408
- var assetAST = _this.parseObject(localValue, "asset", options);
4409
- if (assetAST) {
4410
- return _object_spread_props(_object_spread({}, rest), {
4411
- children: _to_consumable_array(children2).concat([
4412
- {
4413
- path: _to_consumable_array(path).concat([
4414
- "asset"
4415
- ]),
4416
- value: assetAST
4417
- }
4418
- ])
4419
- });
4420
- }
4421
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4422
- var templateChildren = localValue.map(function(template) {
4423
- var _options_templateDepth, _template_dynamic;
4424
- var templateAST = _this.hooks.onCreateASTNode.call({
4425
- type: "template",
4426
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4427
- data: template.data,
4428
- template: template.value,
4429
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4430
- }, template);
4431
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4432
- templateAST.values.forEach(function(v) {
4433
- v.parent = templateAST;
4434
- });
4435
- }
4436
- if (templateAST) {
4437
- return {
4438
- path: _to_consumable_array(path).concat([
4439
- template.output
4440
- ]),
4441
- value: templateAST
4442
- };
4443
- }
4444
- return;
4445
- }).filter(function(element) {
4446
- return !!element;
4447
- });
4448
- return _object_spread_props(_object_spread({}, rest), {
4449
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4450
- });
4451
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4452
- var _localSwitch_children;
4453
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4454
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4455
- var firstChild = localSwitch.children[0];
4456
- return _object_spread_props(_object_spread({}, rest), {
4457
- children: _to_consumable_array(children2).concat([
4458
- {
4459
- path: _to_consumable_array(path).concat([
4460
- localKey
4461
- ], _to_consumable_array(firstChild.path)),
4462
- value: firstChild.value
4463
- }
4464
- ])
4465
- });
4466
- }
4467
- if (localSwitch) {
4468
- return _object_spread_props(_object_spread({}, rest), {
4469
- children: _to_consumable_array(children2).concat([
4470
- {
4471
- path: _to_consumable_array(path).concat([
4472
- localKey
4473
- ]),
4474
- value: localSwitch
4475
- }
4476
- ])
4477
- });
4478
- }
4479
- } else if (localValue && hasAsync(localValue)) {
4480
- var localAsync = _this.parseAsync(localValue, "value", options);
4481
- if (localAsync) {
4482
- children2.push({
4483
- path: _to_consumable_array(path).concat([
4484
- localKey
4485
- ]),
4486
- value: localAsync
4487
- });
4488
- }
4489
- } else if (localValue && Array.isArray(localValue)) {
4490
- var childValues = localValue.map(function(childVal) {
4491
- return _this.parseObject(childVal, "value", options);
4492
- }).filter(function(child) {
4493
- return !!child;
4494
- });
4495
- if (childValues.length > 0) {
4496
- var multiNode = _this.hooks.onCreateASTNode.call({
4497
- type: "multi-node",
4498
- override: !_this.hasTemplateValues(localObj, localKey),
4499
- values: childValues
4500
- }, localValue);
4501
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4502
- multiNode.values.forEach(function(v) {
4503
- v.parent = multiNode;
4504
- });
4505
- }
4506
- if (multiNode) {
4507
- return _object_spread_props(_object_spread({}, rest), {
4508
- children: _to_consumable_array(children2).concat([
4509
- {
4510
- path: _to_consumable_array(path).concat([
4511
- localKey
4512
- ]),
4513
- value: multiNode
4514
- }
4515
- ])
4516
- });
4517
- }
4518
- }
4382
+ var newChildren = _this.hooks.parseNode.call(localValue, "value", options, {
4383
+ path: path,
4384
+ key: localKey,
4385
+ parentObj: localObj
4386
+ });
4387
+ if (newChildren) {
4388
+ var _children2;
4389
+ (_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
4519
4390
  } else if (localValue && typeof localValue === "object") {
4520
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4521
- if (determineNodeType === "applicability") {
4522
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4523
- if (parsedNode) {
4524
- return _object_spread_props(_object_spread({}, rest), {
4525
- children: _to_consumable_array(children2).concat([
4526
- {
4527
- path: _to_consumable_array(path).concat([
4528
- localKey
4529
- ]),
4530
- value: parsedNode
4531
- }
4532
- ])
4533
- });
4534
- }
4535
- } else {
4536
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4537
- localKey
4538
- ]));
4539
- return {
4540
- value: result.value,
4541
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4542
- };
4543
- }
4391
+ var _children21;
4392
+ var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4393
+ localKey
4394
+ ]));
4395
+ value2 = result.value;
4396
+ (_children21 = children2).push.apply(_children21, _to_consumable_array(result.children));
4544
4397
  } else {
4545
- var value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4398
+ value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4546
4399
  localKey
4547
4400
  ]), localValue);
4548
- return {
4549
- children: children2,
4550
- value: value2
4551
- };
4552
4401
  }
4553
- return accumulation;
4402
+ return {
4403
+ value: value2,
4404
+ children: children2
4405
+ };
4554
4406
  }, defaultValue);
4555
4407
  return newValue;
4556
4408
  };
4557
4409
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4558
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4410
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4559
4411
  type: type,
4560
4412
  value: value
4561
4413
  };
4562
- if (baseAst !== void 0 && children.length > 0) {
4414
+ if (baseAst && children.length) {
4563
4415
  var parent = baseAst;
4564
4416
  parent.children = children;
4565
4417
  children.forEach(function(child) {
@@ -5047,24 +4899,30 @@ var CheckPathPlugin = function() {
5047
4899
  }
5048
4900
  return node;
5049
4901
  });
5050
- parser.hooks.determineNodeType.tap("template", function(obj) {
5051
- if (obj === "template") {
5052
- return "template";
5053
- }
5054
- });
5055
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5056
- if (determinedNodeType === "template") {
5057
- var _options_templateDepth, _obj_dynamic;
5058
- var templateNode = parser.createASTNode({
5059
- type: "template",
5060
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5061
- data: obj.data,
5062
- template: obj.value,
5063
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5064
- }, obj);
5065
- if (templateNode) {
5066
- return templateNode;
5067
- }
4902
+ parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
4903
+ if (childOptions && hasTemplateKey(childOptions.key)) {
4904
+ return obj.map(function(template) {
4905
+ var _options_templateDepth, _template_dynamic;
4906
+ var templateAST = parser.createASTNode({
4907
+ type: "template",
4908
+ depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4909
+ data: template.data,
4910
+ template: template.value,
4911
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4912
+ }, template);
4913
+ if (!templateAST) return;
4914
+ if (templateAST.type === "multi-node") {
4915
+ templateAST.values.forEach(function(v) {
4916
+ v.parent = templateAST;
4917
+ });
4918
+ }
4919
+ return {
4920
+ path: _to_consumable_array(childOptions.path).concat([
4921
+ template.output
4922
+ ]),
4923
+ value: templateAST
4924
+ };
4925
+ }).filter(Boolean);
5068
4926
  }
5069
4927
  });
5070
4928
  }
@@ -5208,6 +5066,12 @@ var CheckPathPlugin = function() {
5208
5066
  _class_call_check(this, ApplicabilityPlugin);
5209
5067
  }
5210
5068
  _create_class(ApplicabilityPlugin, [
5069
+ {
5070
+ key: "isApplicability",
5071
+ value: function isApplicability(obj) {
5072
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5073
+ }
5074
+ },
5211
5075
  {
5212
5076
  key: "applyResolver",
5213
5077
  value: function applyResolver(resolver) {
@@ -5227,25 +5091,32 @@ var CheckPathPlugin = function() {
5227
5091
  {
5228
5092
  key: "applyParser",
5229
5093
  value: function applyParser(parser) {
5230
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5231
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5232
- return "applicability";
5233
- }
5234
- });
5235
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5236
- if (determinedNodeType === "applicability") {
5094
+ var _this = this;
5095
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5096
+ if (_this.isApplicability(obj)) {
5237
5097
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5238
- if (parsedApplicability !== null) {
5239
- var applicabilityNode = parser.createASTNode({
5240
- type: "applicability",
5241
- expression: obj.applicability,
5242
- value: parsedApplicability
5243
- }, obj);
5244
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5245
- applicabilityNode.value.parent = applicabilityNode;
5246
- }
5247
- return applicabilityNode;
5098
+ if (!parsedApplicability) {
5099
+ return childOptions ? [] : null;
5248
5100
  }
5101
+ var applicabilityNode = parser.createASTNode({
5102
+ type: "applicability",
5103
+ expression: obj.applicability,
5104
+ value: parsedApplicability
5105
+ }, obj);
5106
+ if (!applicabilityNode) {
5107
+ return childOptions ? [] : null;
5108
+ }
5109
+ if (applicabilityNode.type === "applicability") {
5110
+ applicabilityNode.value.parent = applicabilityNode;
5111
+ }
5112
+ return childOptions ? [
5113
+ {
5114
+ path: _to_consumable_array(childOptions.path).concat([
5115
+ childOptions.key
5116
+ ]),
5117
+ value: applicabilityNode
5118
+ }
5119
+ ] : applicabilityNode;
5249
5120
  }
5250
5121
  });
5251
5122
  }
@@ -5295,6 +5166,12 @@ var CheckPathPlugin = function() {
5295
5166
  return EMPTY_NODE;
5296
5167
  }
5297
5168
  },
5169
+ {
5170
+ key: "isSwitch",
5171
+ value: function isSwitch(obj) {
5172
+ return obj && (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch"));
5173
+ }
5174
+ },
5298
5175
  {
5299
5176
  key: "applyParser",
5300
5177
  value: function applyParser(parser) {
@@ -5305,42 +5182,56 @@ var CheckPathPlugin = function() {
5305
5182
  }
5306
5183
  return node;
5307
5184
  });
5308
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5309
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5310
- return "switch";
5311
- }
5312
- });
5313
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5314
- if (determinedNodeType === "switch") {
5315
- var dynamic = "dynamicSwitch" in obj;
5316
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5317
- var cases = [];
5318
- switchContent.forEach(function(switchCase) {
5185
+ parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, childOptions) {
5186
+ if (_this.isSwitch(obj) || childOptions && hasSwitchKey(childOptions.key)) {
5187
+ var objToParse = childOptions && hasSwitchKey(childOptions.key) ? _define_property({}, childOptions.key, obj) : obj;
5188
+ var dynamic = "dynamicSwitch" in objToParse;
5189
+ var switchContent = dynamic ? objToParse.dynamicSwitch : objToParse.staticSwitch;
5190
+ var cases = switchContent.map(function(switchCase) {
5319
5191
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5320
5192
  "case"
5321
5193
  ]);
5322
5194
  var value = parser.parseObject(switchBody, "value", options);
5323
5195
  if (value) {
5324
- cases.push({
5196
+ return {
5325
5197
  case: switchCaseExpr,
5326
5198
  value: value
5327
- });
5199
+ };
5328
5200
  }
5329
- });
5330
- var switchAST = parser.hooks.onCreateASTNode.call({
5201
+ return;
5202
+ }).filter(Boolean);
5203
+ var switchAST = parser.createASTNode({
5331
5204
  type: "switch",
5332
5205
  dynamic: dynamic,
5333
5206
  cases: cases
5334
- }, obj);
5335
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "switch") {
5207
+ }, objToParse);
5208
+ if (!switchAST || switchAST.type === "empty") {
5209
+ return childOptions ? [] : null;
5210
+ }
5211
+ if (switchAST.type === "switch") {
5336
5212
  switchAST.cases.forEach(function(sCase) {
5337
5213
  sCase.value.parent = switchAST;
5338
5214
  });
5339
5215
  }
5340
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5341
- return null;
5216
+ if (childOptions) {
5217
+ var _switchAST_children;
5218
+ var path = _to_consumable_array(childOptions.path).concat([
5219
+ childOptions.key
5220
+ ]);
5221
+ var value = switchAST;
5222
+ if (switchAST.type === "value" && ((_switchAST_children = switchAST.children) === null || _switchAST_children === void 0 ? void 0 : _switchAST_children.length) === 1 && switchAST.value === void 0) {
5223
+ var firstChild = switchAST.children[0];
5224
+ path = _to_consumable_array(path).concat(_to_consumable_array(firstChild.path));
5225
+ value = firstChild.value;
5226
+ }
5227
+ return [
5228
+ {
5229
+ path: path,
5230
+ value: value
5231
+ }
5232
+ ];
5342
5233
  }
5343
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5234
+ return switchAST;
5344
5235
  }
5345
5236
  });
5346
5237
  }
@@ -5367,6 +5258,93 @@ var CheckPathPlugin = function() {
5367
5258
  ]);
5368
5259
  return SwitchPlugin;
5369
5260
  }();
5261
+ var MultiNodePlugin = /*#__PURE__*/ function() {
5262
+ function MultiNodePlugin() {
5263
+ _class_call_check(this, MultiNodePlugin);
5264
+ }
5265
+ _create_class(MultiNodePlugin, [
5266
+ {
5267
+ key: "applyParser",
5268
+ value: function applyParser(parser) {
5269
+ parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
5270
+ if (childOptions && !hasTemplateKey(childOptions.key) && Array.isArray(obj)) {
5271
+ var values = obj.map(function(childVal) {
5272
+ return parser.parseObject(childVal, "value", options);
5273
+ }).filter(function(child) {
5274
+ return !!child;
5275
+ });
5276
+ if (!values.length) {
5277
+ return [];
5278
+ }
5279
+ var multiNode = parser.createASTNode({
5280
+ type: "multi-node",
5281
+ override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
5282
+ values: values
5283
+ }, obj);
5284
+ if (!multiNode) {
5285
+ return [];
5286
+ }
5287
+ if (multiNode.type === "multi-node") {
5288
+ multiNode.values.forEach(function(v) {
5289
+ v.parent = multiNode;
5290
+ });
5291
+ }
5292
+ return [
5293
+ {
5294
+ path: _to_consumable_array(childOptions.path).concat([
5295
+ childOptions.key
5296
+ ]),
5297
+ value: multiNode
5298
+ }
5299
+ ];
5300
+ }
5301
+ });
5302
+ }
5303
+ },
5304
+ {
5305
+ key: "apply",
5306
+ value: function apply(view) {
5307
+ view.hooks.parser.tap("multi-node", this.applyParser.bind(this));
5308
+ }
5309
+ }
5310
+ ]);
5311
+ return MultiNodePlugin;
5312
+ }();
5313
+ var AssetPlugin = /*#__PURE__*/ function() {
5314
+ function AssetPlugin() {
5315
+ _class_call_check(this, AssetPlugin);
5316
+ }
5317
+ _create_class(AssetPlugin, [
5318
+ {
5319
+ key: "applyParser",
5320
+ value: function applyParser(parser) {
5321
+ parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
5322
+ if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
5323
+ var assetAST = parser.parseObject(obj, "asset", options);
5324
+ if (!assetAST) {
5325
+ return [];
5326
+ }
5327
+ return [
5328
+ {
5329
+ path: _to_consumable_array(childOptions.path).concat([
5330
+ childOptions.key
5331
+ ]),
5332
+ value: assetAST
5333
+ }
5334
+ ];
5335
+ }
5336
+ });
5337
+ }
5338
+ },
5339
+ {
5340
+ key: "apply",
5341
+ value: function apply(view) {
5342
+ view.hooks.parser.tap("asset", this.applyParser.bind(this));
5343
+ }
5344
+ }
5345
+ ]);
5346
+ return AssetPlugin;
5347
+ }();
5370
5348
  var FlowInstance = /*#__PURE__*/ function() {
5371
5349
  function FlowInstance(id, flow, options) {
5372
5350
  _class_call_check(this, FlowInstance);
@@ -7069,12 +7047,14 @@ var CheckPathPlugin = function() {
7069
7047
  player.hooks.viewController.tap(this.name, function(viewController) {
7070
7048
  viewController.hooks.view.tap(_this.name, function(view) {
7071
7049
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7050
+ new AssetPlugin().apply(view);
7072
7051
  new SwitchPlugin(pluginOptions).apply(view);
7073
7052
  new ApplicabilityPlugin().apply(view);
7074
7053
  new StringResolverPlugin().apply(view);
7075
7054
  var templatePlugin = new TemplatePlugin(pluginOptions);
7076
7055
  templatePlugin.apply(view);
7077
7056
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7057
+ new MultiNodePlugin().apply(view);
7078
7058
  });
7079
7059
  });
7080
7060
  }