@player-ui/check-path-plugin 0.8.0-next.3 → 0.8.0-next.5

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";
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;
@@ -4305,7 +4313,6 @@ var CheckPathPlugin = function() {
4305
4313
  * If undefined, the original value is used.
4306
4314
  * If null, we ignore this node all together
4307
4315
  */ onCreateASTNode: new SyncWaterfallHook(),
4308
- determineNodeType: new SyncBailHook(),
4309
4316
  parseNode: new SyncBailHook()
4310
4317
  };
4311
4318
  }
@@ -4320,21 +4327,6 @@ var CheckPathPlugin = function() {
4320
4327
  return viewNode;
4321
4328
  }
4322
4329
  },
4323
- {
4324
- key: "parseAsync",
4325
- value: function parseAsync(obj, type, options) {
4326
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4327
- var parsedNodeId = getNodeID(parsedAsync);
4328
- if (parsedAsync !== null && parsedNodeId) {
4329
- return this.createASTNode({
4330
- id: parsedNodeId,
4331
- type: "async",
4332
- value: parsedAsync
4333
- }, obj);
4334
- }
4335
- return null;
4336
- }
4337
- },
4338
4330
  {
4339
4331
  key: "createASTNode",
4340
4332
  value: function createASTNode(node, value) {
@@ -4345,25 +4337,6 @@ var CheckPathPlugin = function() {
4345
4337
  return tapped;
4346
4338
  }
4347
4339
  },
4348
- {
4349
- /**
4350
- * Checks if there are templated values in the object
4351
- *
4352
- * @param obj - The Parsed Object to check to see if we have a template array type for
4353
- * @param localKey - The key being checked
4354
- */ key: "hasTemplateValues",
4355
- value: function hasTemplateValues(obj, localKey) {
4356
- 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) {
4357
- return tmpl.output === localKey;
4358
- });
4359
- }
4360
- },
4361
- {
4362
- key: "hasSwitchKey",
4363
- value: function hasSwitchKey(localKey) {
4364
- return localKey === "staticSwitch";
4365
- }
4366
- },
4367
4340
  {
4368
4341
  key: "parseObject",
4369
4342
  value: function parseObject(obj) {
@@ -4371,12 +4344,9 @@ var CheckPathPlugin = function() {
4371
4344
  templateDepth: 0
4372
4345
  };
4373
4346
  var _this = this;
4374
- var nodeType = this.hooks.determineNodeType.call(obj);
4375
- if (nodeType !== void 0) {
4376
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4377
- if (parsedNode) {
4378
- return parsedNode;
4379
- }
4347
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4348
+ if (parsedNode || parsedNode === null) {
4349
+ return parsedNode;
4380
4350
  }
4381
4351
  var parseLocalObject = function(currentValue, objToParse) {
4382
4352
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4406,166 +4376,42 @@ var CheckPathPlugin = function() {
4406
4376
  value: currentValue
4407
4377
  };
4408
4378
  var newValue = objEntries.reduce(function(accumulation, current) {
4409
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4410
- "children"
4411
- ]);
4379
+ var value2 = accumulation.value;
4380
+ var children2 = accumulation.children;
4412
4381
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4413
- if (localKey === "asset" && typeof localValue === "object") {
4414
- var assetAST = _this.parseObject(localValue, "asset", options);
4415
- if (assetAST) {
4416
- return _object_spread_props(_object_spread({}, rest), {
4417
- children: _to_consumable_array(children2).concat([
4418
- {
4419
- path: _to_consumable_array(path).concat([
4420
- "asset"
4421
- ]),
4422
- value: assetAST
4423
- }
4424
- ])
4425
- });
4426
- }
4427
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4428
- var templateChildren = localValue.map(function(template) {
4429
- var _options_templateDepth, _template_dynamic;
4430
- var templateAST = _this.hooks.onCreateASTNode.call({
4431
- type: "template",
4432
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4433
- data: template.data,
4434
- template: template.value,
4435
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4436
- }, template);
4437
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4438
- templateAST.values.forEach(function(v) {
4439
- v.parent = templateAST;
4440
- });
4441
- }
4442
- if (templateAST) {
4443
- return {
4444
- path: _to_consumable_array(path).concat([
4445
- template.output
4446
- ]),
4447
- value: templateAST
4448
- };
4449
- }
4450
- return;
4451
- }).filter(function(element) {
4452
- return !!element;
4453
- });
4454
- return _object_spread_props(_object_spread({}, rest), {
4455
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4456
- });
4457
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4458
- var _localSwitch_children;
4459
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4460
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4461
- var firstChild = localSwitch.children[0];
4462
- return _object_spread_props(_object_spread({}, rest), {
4463
- children: _to_consumable_array(children2).concat([
4464
- {
4465
- path: _to_consumable_array(path).concat([
4466
- localKey
4467
- ], _to_consumable_array(firstChild.path)),
4468
- value: firstChild.value
4469
- }
4470
- ])
4471
- });
4472
- }
4473
- if (localSwitch) {
4474
- return _object_spread_props(_object_spread({}, rest), {
4475
- children: _to_consumable_array(children2).concat([
4476
- {
4477
- path: _to_consumable_array(path).concat([
4478
- localKey
4479
- ]),
4480
- value: localSwitch
4481
- }
4482
- ])
4483
- });
4484
- }
4485
- } else if (localValue && hasAsync(localValue)) {
4486
- var localAsync = _this.parseAsync(localValue, "value", options);
4487
- if (localAsync) {
4488
- children2.push({
4489
- path: _to_consumable_array(path).concat([
4490
- localKey
4491
- ]),
4492
- value: localAsync
4493
- });
4494
- }
4495
- } else if (localValue && Array.isArray(localValue)) {
4496
- var childValues = localValue.map(function(childVal) {
4497
- return _this.parseObject(childVal, "value", options);
4498
- }).filter(function(child) {
4499
- return !!child;
4500
- });
4501
- if (childValues.length > 0) {
4502
- var multiNode = _this.hooks.onCreateASTNode.call({
4503
- type: "multi-node",
4504
- override: !_this.hasTemplateValues(localObj, localKey),
4505
- values: childValues
4506
- }, localValue);
4507
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4508
- multiNode.values.forEach(function(v) {
4509
- v.parent = multiNode;
4510
- });
4511
- }
4512
- if (multiNode) {
4513
- return _object_spread_props(_object_spread({}, rest), {
4514
- children: _to_consumable_array(children2).concat([
4515
- {
4516
- path: _to_consumable_array(path).concat([
4517
- localKey
4518
- ]),
4519
- value: multiNode
4520
- }
4521
- ])
4522
- });
4523
- }
4524
- }
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));
4525
4390
  } else if (localValue && typeof localValue === "object") {
4526
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4527
- if (determineNodeType === "applicability") {
4528
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4529
- if (parsedNode) {
4530
- return _object_spread_props(_object_spread({}, rest), {
4531
- children: _to_consumable_array(children2).concat([
4532
- {
4533
- path: _to_consumable_array(path).concat([
4534
- localKey
4535
- ]),
4536
- value: parsedNode
4537
- }
4538
- ])
4539
- });
4540
- }
4541
- } else {
4542
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4543
- localKey
4544
- ]));
4545
- return {
4546
- value: result.value,
4547
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4548
- };
4549
- }
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));
4550
4397
  } else {
4551
- 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([
4552
4399
  localKey
4553
4400
  ]), localValue);
4554
- return {
4555
- children: children2,
4556
- value: value2
4557
- };
4558
4401
  }
4559
- return accumulation;
4402
+ return {
4403
+ value: value2,
4404
+ children: children2
4405
+ };
4560
4406
  }, defaultValue);
4561
4407
  return newValue;
4562
4408
  };
4563
4409
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4564
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4410
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4565
4411
  type: type,
4566
4412
  value: value
4567
4413
  };
4568
- if (baseAst !== void 0 && children.length > 0) {
4414
+ if (baseAst && children.length) {
4569
4415
  var parent = baseAst;
4570
4416
  parent.children = children;
4571
4417
  children.forEach(function(child) {
@@ -5053,24 +4899,30 @@ var CheckPathPlugin = function() {
5053
4899
  }
5054
4900
  return node;
5055
4901
  });
5056
- parser.hooks.determineNodeType.tap("template", function(obj) {
5057
- if (obj === "template") {
5058
- return "template";
5059
- }
5060
- });
5061
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5062
- if (determinedNodeType === "template") {
5063
- var _options_templateDepth, _obj_dynamic;
5064
- var templateNode = parser.createASTNode({
5065
- type: "template",
5066
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5067
- data: obj.data,
5068
- template: obj.value,
5069
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5070
- }, obj);
5071
- if (templateNode) {
5072
- return templateNode;
5073
- }
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);
5074
4926
  }
5075
4927
  });
5076
4928
  }
@@ -5214,6 +5066,12 @@ var CheckPathPlugin = function() {
5214
5066
  _class_call_check(this, ApplicabilityPlugin);
5215
5067
  }
5216
5068
  _create_class(ApplicabilityPlugin, [
5069
+ {
5070
+ key: "isApplicability",
5071
+ value: function isApplicability(obj) {
5072
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5073
+ }
5074
+ },
5217
5075
  {
5218
5076
  key: "applyResolver",
5219
5077
  value: function applyResolver(resolver) {
@@ -5233,25 +5091,32 @@ var CheckPathPlugin = function() {
5233
5091
  {
5234
5092
  key: "applyParser",
5235
5093
  value: function applyParser(parser) {
5236
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5237
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5238
- return "applicability";
5239
- }
5240
- });
5241
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5242
- if (determinedNodeType === "applicability") {
5094
+ var _this = this;
5095
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5096
+ if (_this.isApplicability(obj)) {
5243
5097
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5244
- if (parsedApplicability !== null) {
5245
- var applicabilityNode = parser.createASTNode({
5246
- type: "applicability",
5247
- expression: obj.applicability,
5248
- value: parsedApplicability
5249
- }, obj);
5250
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5251
- applicabilityNode.value.parent = applicabilityNode;
5252
- }
5253
- return applicabilityNode;
5098
+ if (!parsedApplicability) {
5099
+ return childOptions ? [] : null;
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;
5254
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;
5255
5120
  }
5256
5121
  });
5257
5122
  }
@@ -5301,6 +5166,12 @@ var CheckPathPlugin = function() {
5301
5166
  return EMPTY_NODE;
5302
5167
  }
5303
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
+ },
5304
5175
  {
5305
5176
  key: "applyParser",
5306
5177
  value: function applyParser(parser) {
@@ -5311,42 +5182,56 @@ var CheckPathPlugin = function() {
5311
5182
  }
5312
5183
  return node;
5313
5184
  });
5314
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5315
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5316
- return "switch";
5317
- }
5318
- });
5319
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5320
- if (determinedNodeType === "switch") {
5321
- var dynamic = "dynamicSwitch" in obj;
5322
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5323
- var cases = [];
5324
- 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) {
5325
5191
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5326
5192
  "case"
5327
5193
  ]);
5328
5194
  var value = parser.parseObject(switchBody, "value", options);
5329
5195
  if (value) {
5330
- cases.push({
5196
+ return {
5331
5197
  case: switchCaseExpr,
5332
5198
  value: value
5333
- });
5199
+ };
5334
5200
  }
5335
- });
5336
- var switchAST = parser.hooks.onCreateASTNode.call({
5201
+ return;
5202
+ }).filter(Boolean);
5203
+ var switchAST = parser.createASTNode({
5337
5204
  type: "switch",
5338
5205
  dynamic: dynamic,
5339
5206
  cases: cases
5340
- }, obj);
5341
- 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") {
5342
5212
  switchAST.cases.forEach(function(sCase) {
5343
5213
  sCase.value.parent = switchAST;
5344
5214
  });
5345
5215
  }
5346
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5347
- 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
+ ];
5348
5233
  }
5349
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5234
+ return switchAST;
5350
5235
  }
5351
5236
  });
5352
5237
  }
@@ -5373,6 +5258,93 @@ var CheckPathPlugin = function() {
5373
5258
  ]);
5374
5259
  return SwitchPlugin;
5375
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
+ }();
5376
5348
  var FlowInstance = /*#__PURE__*/ function() {
5377
5349
  function FlowInstance(id, flow, options) {
5378
5350
  _class_call_check(this, FlowInstance);
@@ -7075,12 +7047,14 @@ var CheckPathPlugin = function() {
7075
7047
  player.hooks.viewController.tap(this.name, function(viewController) {
7076
7048
  viewController.hooks.view.tap(_this.name, function(view) {
7077
7049
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7050
+ new AssetPlugin().apply(view);
7078
7051
  new SwitchPlugin(pluginOptions).apply(view);
7079
7052
  new ApplicabilityPlugin().apply(view);
7080
7053
  new StringResolverPlugin().apply(view);
7081
7054
  var templatePlugin = new TemplatePlugin(pluginOptions);
7082
7055
  templatePlugin.apply(view);
7083
7056
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7057
+ new MultiNodePlugin().apply(view);
7084
7058
  });
7085
7059
  });
7086
7060
  }