@player-ui/stage-revert-data-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 StageRevertDataPlugin = 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 StageRevertDataPlugin = 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 StageRevertDataPlugin = function() {
1819
1827
  }
1820
1828
  return setIn8(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 StageRevertDataPlugin = 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;
@@ -4270,7 +4278,6 @@ var StageRevertDataPlugin = function() {
4270
4278
  * If undefined, the original value is used.
4271
4279
  * If null, we ignore this node all together
4272
4280
  */ onCreateASTNode: new SyncWaterfallHook(),
4273
- determineNodeType: new SyncBailHook(),
4274
4281
  parseNode: new SyncBailHook()
4275
4282
  };
4276
4283
  }
@@ -4285,21 +4292,6 @@ var StageRevertDataPlugin = function() {
4285
4292
  return viewNode;
4286
4293
  }
4287
4294
  },
4288
- {
4289
- key: "parseAsync",
4290
- value: function parseAsync(obj, type, options) {
4291
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4292
- var parsedNodeId = getNodeID(parsedAsync);
4293
- if (parsedAsync !== null && parsedNodeId) {
4294
- return this.createASTNode({
4295
- id: parsedNodeId,
4296
- type: "async",
4297
- value: parsedAsync
4298
- }, obj);
4299
- }
4300
- return null;
4301
- }
4302
- },
4303
4295
  {
4304
4296
  key: "createASTNode",
4305
4297
  value: function createASTNode(node, value) {
@@ -4310,25 +4302,6 @@ var StageRevertDataPlugin = function() {
4310
4302
  return tapped;
4311
4303
  }
4312
4304
  },
4313
- {
4314
- /**
4315
- * Checks if there are templated values in the object
4316
- *
4317
- * @param obj - The Parsed Object to check to see if we have a template array type for
4318
- * @param localKey - The key being checked
4319
- */ key: "hasTemplateValues",
4320
- value: function hasTemplateValues(obj, localKey) {
4321
- 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) {
4322
- return tmpl.output === localKey;
4323
- });
4324
- }
4325
- },
4326
- {
4327
- key: "hasSwitchKey",
4328
- value: function hasSwitchKey(localKey) {
4329
- return localKey === "staticSwitch";
4330
- }
4331
- },
4332
4305
  {
4333
4306
  key: "parseObject",
4334
4307
  value: function parseObject(obj) {
@@ -4336,12 +4309,9 @@ var StageRevertDataPlugin = function() {
4336
4309
  templateDepth: 0
4337
4310
  };
4338
4311
  var _this = this;
4339
- var nodeType = this.hooks.determineNodeType.call(obj);
4340
- if (nodeType !== void 0) {
4341
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4342
- if (parsedNode) {
4343
- return parsedNode;
4344
- }
4312
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4313
+ if (parsedNode || parsedNode === null) {
4314
+ return parsedNode;
4345
4315
  }
4346
4316
  var parseLocalObject = function(currentValue, objToParse) {
4347
4317
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4371,166 +4341,42 @@ var StageRevertDataPlugin = function() {
4371
4341
  value: currentValue
4372
4342
  };
4373
4343
  var newValue = objEntries.reduce(function(accumulation, current) {
4374
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4375
- "children"
4376
- ]);
4344
+ var value2 = accumulation.value;
4345
+ var children2 = accumulation.children;
4377
4346
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4378
- if (localKey === "asset" && typeof localValue === "object") {
4379
- var assetAST = _this.parseObject(localValue, "asset", options);
4380
- if (assetAST) {
4381
- return _object_spread_props(_object_spread({}, rest), {
4382
- children: _to_consumable_array(children2).concat([
4383
- {
4384
- path: _to_consumable_array(path).concat([
4385
- "asset"
4386
- ]),
4387
- value: assetAST
4388
- }
4389
- ])
4390
- });
4391
- }
4392
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4393
- var templateChildren = localValue.map(function(template) {
4394
- var _options_templateDepth, _template_dynamic;
4395
- var templateAST = _this.hooks.onCreateASTNode.call({
4396
- type: "template",
4397
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4398
- data: template.data,
4399
- template: template.value,
4400
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4401
- }, template);
4402
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4403
- templateAST.values.forEach(function(v) {
4404
- v.parent = templateAST;
4405
- });
4406
- }
4407
- if (templateAST) {
4408
- return {
4409
- path: _to_consumable_array(path).concat([
4410
- template.output
4411
- ]),
4412
- value: templateAST
4413
- };
4414
- }
4415
- return;
4416
- }).filter(function(element) {
4417
- return !!element;
4418
- });
4419
- return _object_spread_props(_object_spread({}, rest), {
4420
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4421
- });
4422
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4423
- var _localSwitch_children;
4424
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4425
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4426
- var firstChild = localSwitch.children[0];
4427
- return _object_spread_props(_object_spread({}, rest), {
4428
- children: _to_consumable_array(children2).concat([
4429
- {
4430
- path: _to_consumable_array(path).concat([
4431
- localKey
4432
- ], _to_consumable_array(firstChild.path)),
4433
- value: firstChild.value
4434
- }
4435
- ])
4436
- });
4437
- }
4438
- if (localSwitch) {
4439
- return _object_spread_props(_object_spread({}, rest), {
4440
- children: _to_consumable_array(children2).concat([
4441
- {
4442
- path: _to_consumable_array(path).concat([
4443
- localKey
4444
- ]),
4445
- value: localSwitch
4446
- }
4447
- ])
4448
- });
4449
- }
4450
- } else if (localValue && hasAsync(localValue)) {
4451
- var localAsync = _this.parseAsync(localValue, "value", options);
4452
- if (localAsync) {
4453
- children2.push({
4454
- path: _to_consumable_array(path).concat([
4455
- localKey
4456
- ]),
4457
- value: localAsync
4458
- });
4459
- }
4460
- } else if (localValue && Array.isArray(localValue)) {
4461
- var childValues = localValue.map(function(childVal) {
4462
- return _this.parseObject(childVal, "value", options);
4463
- }).filter(function(child) {
4464
- return !!child;
4465
- });
4466
- if (childValues.length > 0) {
4467
- var multiNode = _this.hooks.onCreateASTNode.call({
4468
- type: "multi-node",
4469
- override: !_this.hasTemplateValues(localObj, localKey),
4470
- values: childValues
4471
- }, localValue);
4472
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4473
- multiNode.values.forEach(function(v) {
4474
- v.parent = multiNode;
4475
- });
4476
- }
4477
- if (multiNode) {
4478
- return _object_spread_props(_object_spread({}, rest), {
4479
- children: _to_consumable_array(children2).concat([
4480
- {
4481
- path: _to_consumable_array(path).concat([
4482
- localKey
4483
- ]),
4484
- value: multiNode
4485
- }
4486
- ])
4487
- });
4488
- }
4489
- }
4347
+ var newChildren = _this.hooks.parseNode.call(localValue, "value", options, {
4348
+ path: path,
4349
+ key: localKey,
4350
+ parentObj: localObj
4351
+ });
4352
+ if (newChildren) {
4353
+ var _children2;
4354
+ (_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
4490
4355
  } else if (localValue && typeof localValue === "object") {
4491
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4492
- if (determineNodeType === "applicability") {
4493
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4494
- if (parsedNode) {
4495
- return _object_spread_props(_object_spread({}, rest), {
4496
- children: _to_consumable_array(children2).concat([
4497
- {
4498
- path: _to_consumable_array(path).concat([
4499
- localKey
4500
- ]),
4501
- value: parsedNode
4502
- }
4503
- ])
4504
- });
4505
- }
4506
- } else {
4507
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4508
- localKey
4509
- ]));
4510
- return {
4511
- value: result.value,
4512
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4513
- };
4514
- }
4356
+ var _children21;
4357
+ var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4358
+ localKey
4359
+ ]));
4360
+ value2 = result.value;
4361
+ (_children21 = children2).push.apply(_children21, _to_consumable_array(result.children));
4515
4362
  } else {
4516
- var value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4363
+ value2 = (0, import_timm5.setIn)(accumulation.value, _to_consumable_array(path).concat([
4517
4364
  localKey
4518
4365
  ]), localValue);
4519
- return {
4520
- children: children2,
4521
- value: value2
4522
- };
4523
4366
  }
4524
- return accumulation;
4367
+ return {
4368
+ value: value2,
4369
+ children: children2
4370
+ };
4525
4371
  }, defaultValue);
4526
4372
  return newValue;
4527
4373
  };
4528
4374
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4529
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4375
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4530
4376
  type: type,
4531
4377
  value: value
4532
4378
  };
4533
- if (baseAst !== void 0 && children.length > 0) {
4379
+ if (baseAst && children.length) {
4534
4380
  var parent = baseAst;
4535
4381
  parent.children = children;
4536
4382
  children.forEach(function(child) {
@@ -5018,24 +4864,30 @@ var StageRevertDataPlugin = function() {
5018
4864
  }
5019
4865
  return node;
5020
4866
  });
5021
- parser.hooks.determineNodeType.tap("template", function(obj) {
5022
- if (obj === "template") {
5023
- return "template";
5024
- }
5025
- });
5026
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5027
- if (determinedNodeType === "template") {
5028
- var _options_templateDepth, _obj_dynamic;
5029
- var templateNode = parser.createASTNode({
5030
- type: "template",
5031
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5032
- data: obj.data,
5033
- template: obj.value,
5034
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5035
- }, obj);
5036
- if (templateNode) {
5037
- return templateNode;
5038
- }
4867
+ parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
4868
+ if (childOptions && hasTemplateKey(childOptions.key)) {
4869
+ return obj.map(function(template) {
4870
+ var _options_templateDepth, _template_dynamic;
4871
+ var templateAST = parser.createASTNode({
4872
+ type: "template",
4873
+ depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4874
+ data: template.data,
4875
+ template: template.value,
4876
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4877
+ }, template);
4878
+ if (!templateAST) return;
4879
+ if (templateAST.type === "multi-node") {
4880
+ templateAST.values.forEach(function(v) {
4881
+ v.parent = templateAST;
4882
+ });
4883
+ }
4884
+ return {
4885
+ path: _to_consumable_array(childOptions.path).concat([
4886
+ template.output
4887
+ ]),
4888
+ value: templateAST
4889
+ };
4890
+ }).filter(Boolean);
5039
4891
  }
5040
4892
  });
5041
4893
  }
@@ -5179,6 +5031,12 @@ var StageRevertDataPlugin = function() {
5179
5031
  _class_call_check(this, ApplicabilityPlugin);
5180
5032
  }
5181
5033
  _create_class(ApplicabilityPlugin, [
5034
+ {
5035
+ key: "isApplicability",
5036
+ value: function isApplicability(obj) {
5037
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5038
+ }
5039
+ },
5182
5040
  {
5183
5041
  key: "applyResolver",
5184
5042
  value: function applyResolver(resolver) {
@@ -5198,25 +5056,32 @@ var StageRevertDataPlugin = function() {
5198
5056
  {
5199
5057
  key: "applyParser",
5200
5058
  value: function applyParser(parser) {
5201
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5202
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5203
- return "applicability";
5204
- }
5205
- });
5206
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5207
- if (determinedNodeType === "applicability") {
5059
+ var _this = this;
5060
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5061
+ if (_this.isApplicability(obj)) {
5208
5062
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5209
- if (parsedApplicability !== null) {
5210
- var applicabilityNode = parser.createASTNode({
5211
- type: "applicability",
5212
- expression: obj.applicability,
5213
- value: parsedApplicability
5214
- }, obj);
5215
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5216
- applicabilityNode.value.parent = applicabilityNode;
5217
- }
5218
- return applicabilityNode;
5063
+ if (!parsedApplicability) {
5064
+ return childOptions ? [] : null;
5219
5065
  }
5066
+ var applicabilityNode = parser.createASTNode({
5067
+ type: "applicability",
5068
+ expression: obj.applicability,
5069
+ value: parsedApplicability
5070
+ }, obj);
5071
+ if (!applicabilityNode) {
5072
+ return childOptions ? [] : null;
5073
+ }
5074
+ if (applicabilityNode.type === "applicability") {
5075
+ applicabilityNode.value.parent = applicabilityNode;
5076
+ }
5077
+ return childOptions ? [
5078
+ {
5079
+ path: _to_consumable_array(childOptions.path).concat([
5080
+ childOptions.key
5081
+ ]),
5082
+ value: applicabilityNode
5083
+ }
5084
+ ] : applicabilityNode;
5220
5085
  }
5221
5086
  });
5222
5087
  }
@@ -5266,6 +5131,12 @@ var StageRevertDataPlugin = function() {
5266
5131
  return EMPTY_NODE;
5267
5132
  }
5268
5133
  },
5134
+ {
5135
+ key: "isSwitch",
5136
+ value: function isSwitch(obj) {
5137
+ return obj && (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch"));
5138
+ }
5139
+ },
5269
5140
  {
5270
5141
  key: "applyParser",
5271
5142
  value: function applyParser(parser) {
@@ -5276,42 +5147,56 @@ var StageRevertDataPlugin = function() {
5276
5147
  }
5277
5148
  return node;
5278
5149
  });
5279
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5280
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5281
- return "switch";
5282
- }
5283
- });
5284
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5285
- if (determinedNodeType === "switch") {
5286
- var dynamic = "dynamicSwitch" in obj;
5287
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5288
- var cases = [];
5289
- switchContent.forEach(function(switchCase) {
5150
+ parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, childOptions) {
5151
+ if (_this.isSwitch(obj) || childOptions && hasSwitchKey(childOptions.key)) {
5152
+ var objToParse = childOptions && hasSwitchKey(childOptions.key) ? _define_property({}, childOptions.key, obj) : obj;
5153
+ var dynamic = "dynamicSwitch" in objToParse;
5154
+ var switchContent = dynamic ? objToParse.dynamicSwitch : objToParse.staticSwitch;
5155
+ var cases = switchContent.map(function(switchCase) {
5290
5156
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5291
5157
  "case"
5292
5158
  ]);
5293
5159
  var value = parser.parseObject(switchBody, "value", options);
5294
5160
  if (value) {
5295
- cases.push({
5161
+ return {
5296
5162
  case: switchCaseExpr,
5297
5163
  value: value
5298
- });
5164
+ };
5299
5165
  }
5300
- });
5301
- var switchAST = parser.hooks.onCreateASTNode.call({
5166
+ return;
5167
+ }).filter(Boolean);
5168
+ var switchAST = parser.createASTNode({
5302
5169
  type: "switch",
5303
5170
  dynamic: dynamic,
5304
5171
  cases: cases
5305
- }, obj);
5306
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "switch") {
5172
+ }, objToParse);
5173
+ if (!switchAST || switchAST.type === "empty") {
5174
+ return childOptions ? [] : null;
5175
+ }
5176
+ if (switchAST.type === "switch") {
5307
5177
  switchAST.cases.forEach(function(sCase) {
5308
5178
  sCase.value.parent = switchAST;
5309
5179
  });
5310
5180
  }
5311
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5312
- return null;
5181
+ if (childOptions) {
5182
+ var _switchAST_children;
5183
+ var path = _to_consumable_array(childOptions.path).concat([
5184
+ childOptions.key
5185
+ ]);
5186
+ var value = switchAST;
5187
+ if (switchAST.type === "value" && ((_switchAST_children = switchAST.children) === null || _switchAST_children === void 0 ? void 0 : _switchAST_children.length) === 1 && switchAST.value === void 0) {
5188
+ var firstChild = switchAST.children[0];
5189
+ path = _to_consumable_array(path).concat(_to_consumable_array(firstChild.path));
5190
+ value = firstChild.value;
5191
+ }
5192
+ return [
5193
+ {
5194
+ path: path,
5195
+ value: value
5196
+ }
5197
+ ];
5313
5198
  }
5314
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5199
+ return switchAST;
5315
5200
  }
5316
5201
  });
5317
5202
  }
@@ -5338,6 +5223,93 @@ var StageRevertDataPlugin = function() {
5338
5223
  ]);
5339
5224
  return SwitchPlugin;
5340
5225
  }();
5226
+ var MultiNodePlugin = /*#__PURE__*/ function() {
5227
+ function MultiNodePlugin() {
5228
+ _class_call_check(this, MultiNodePlugin);
5229
+ }
5230
+ _create_class(MultiNodePlugin, [
5231
+ {
5232
+ key: "applyParser",
5233
+ value: function applyParser(parser) {
5234
+ parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
5235
+ if (childOptions && !hasTemplateKey(childOptions.key) && Array.isArray(obj)) {
5236
+ var values = obj.map(function(childVal) {
5237
+ return parser.parseObject(childVal, "value", options);
5238
+ }).filter(function(child) {
5239
+ return !!child;
5240
+ });
5241
+ if (!values.length) {
5242
+ return [];
5243
+ }
5244
+ var multiNode = parser.createASTNode({
5245
+ type: "multi-node",
5246
+ override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
5247
+ values: values
5248
+ }, obj);
5249
+ if (!multiNode) {
5250
+ return [];
5251
+ }
5252
+ if (multiNode.type === "multi-node") {
5253
+ multiNode.values.forEach(function(v) {
5254
+ v.parent = multiNode;
5255
+ });
5256
+ }
5257
+ return [
5258
+ {
5259
+ path: _to_consumable_array(childOptions.path).concat([
5260
+ childOptions.key
5261
+ ]),
5262
+ value: multiNode
5263
+ }
5264
+ ];
5265
+ }
5266
+ });
5267
+ }
5268
+ },
5269
+ {
5270
+ key: "apply",
5271
+ value: function apply(view) {
5272
+ view.hooks.parser.tap("multi-node", this.applyParser.bind(this));
5273
+ }
5274
+ }
5275
+ ]);
5276
+ return MultiNodePlugin;
5277
+ }();
5278
+ var AssetPlugin = /*#__PURE__*/ function() {
5279
+ function AssetPlugin() {
5280
+ _class_call_check(this, AssetPlugin);
5281
+ }
5282
+ _create_class(AssetPlugin, [
5283
+ {
5284
+ key: "applyParser",
5285
+ value: function applyParser(parser) {
5286
+ parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
5287
+ if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
5288
+ var assetAST = parser.parseObject(obj, "asset", options);
5289
+ if (!assetAST) {
5290
+ return [];
5291
+ }
5292
+ return [
5293
+ {
5294
+ path: _to_consumable_array(childOptions.path).concat([
5295
+ childOptions.key
5296
+ ]),
5297
+ value: assetAST
5298
+ }
5299
+ ];
5300
+ }
5301
+ });
5302
+ }
5303
+ },
5304
+ {
5305
+ key: "apply",
5306
+ value: function apply(view) {
5307
+ view.hooks.parser.tap("asset", this.applyParser.bind(this));
5308
+ }
5309
+ }
5310
+ ]);
5311
+ return AssetPlugin;
5312
+ }();
5341
5313
  var FlowInstance = /*#__PURE__*/ function() {
5342
5314
  function FlowInstance(id, flow, options) {
5343
5315
  _class_call_check(this, FlowInstance);
@@ -7040,12 +7012,14 @@ var StageRevertDataPlugin = function() {
7040
7012
  player.hooks.viewController.tap(this.name, function(viewController) {
7041
7013
  viewController.hooks.view.tap(_this.name, function(view) {
7042
7014
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7015
+ new AssetPlugin().apply(view);
7043
7016
  new SwitchPlugin(pluginOptions).apply(view);
7044
7017
  new ApplicabilityPlugin().apply(view);
7045
7018
  new StringResolverPlugin().apply(view);
7046
7019
  var templatePlugin = new TemplatePlugin(pluginOptions);
7047
7020
  templatePlugin.apply(view);
7048
7021
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7022
+ new MultiNodePlugin().apply(view);
7049
7023
  });
7050
7024
  });
7051
7025
  }