@player-ui/stage-revert-data-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 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;
@@ -2558,6 +2566,12 @@ var StageRevertDataPlugin = function() {
2558
2566
  value: function clear() {
2559
2567
  this.store = createSortedArray();
2560
2568
  }
2569
+ },
2570
+ {
2571
+ /** Check if the registry is empty*/ key: "isRegistryEmpty",
2572
+ value: function isRegistryEmpty() {
2573
+ return this.store.array.length === 0;
2574
+ }
2561
2575
  }
2562
2576
  ]);
2563
2577
  return Registry;
@@ -4264,7 +4278,6 @@ var StageRevertDataPlugin = function() {
4264
4278
  * If undefined, the original value is used.
4265
4279
  * If null, we ignore this node all together
4266
4280
  */ onCreateASTNode: new SyncWaterfallHook(),
4267
- determineNodeType: new SyncBailHook(),
4268
4281
  parseNode: new SyncBailHook()
4269
4282
  };
4270
4283
  }
@@ -4279,21 +4292,6 @@ var StageRevertDataPlugin = function() {
4279
4292
  return viewNode;
4280
4293
  }
4281
4294
  },
4282
- {
4283
- key: "parseAsync",
4284
- value: function parseAsync(obj, type, options) {
4285
- var parsedAsync = this.parseObject((0, import_timm5.omit)(obj, "async"), type, options);
4286
- var parsedNodeId = getNodeID(parsedAsync);
4287
- if (parsedAsync !== null && parsedNodeId) {
4288
- return this.createASTNode({
4289
- id: parsedNodeId,
4290
- type: "async",
4291
- value: parsedAsync
4292
- }, obj);
4293
- }
4294
- return null;
4295
- }
4296
- },
4297
4295
  {
4298
4296
  key: "createASTNode",
4299
4297
  value: function createASTNode(node, value) {
@@ -4304,25 +4302,6 @@ var StageRevertDataPlugin = function() {
4304
4302
  return tapped;
4305
4303
  }
4306
4304
  },
4307
- {
4308
- /**
4309
- * Checks if there are templated values in the object
4310
- *
4311
- * @param obj - The Parsed Object to check to see if we have a template array type for
4312
- * @param localKey - The key being checked
4313
- */ key: "hasTemplateValues",
4314
- value: function hasTemplateValues(obj, localKey) {
4315
- 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) {
4316
- return tmpl.output === localKey;
4317
- });
4318
- }
4319
- },
4320
- {
4321
- key: "hasSwitchKey",
4322
- value: function hasSwitchKey(localKey) {
4323
- return localKey === "staticSwitch";
4324
- }
4325
- },
4326
4305
  {
4327
4306
  key: "parseObject",
4328
4307
  value: function parseObject(obj) {
@@ -4330,12 +4309,9 @@ var StageRevertDataPlugin = function() {
4330
4309
  templateDepth: 0
4331
4310
  };
4332
4311
  var _this = this;
4333
- var nodeType = this.hooks.determineNodeType.call(obj);
4334
- if (nodeType !== void 0) {
4335
- var parsedNode = this.hooks.parseNode.call(obj, type, options, nodeType);
4336
- if (parsedNode) {
4337
- return parsedNode;
4338
- }
4312
+ var parsedNode = this.hooks.parseNode.call(obj, type, options);
4313
+ if (parsedNode || parsedNode === null) {
4314
+ return parsedNode;
4339
4315
  }
4340
4316
  var parseLocalObject = function(currentValue, objToParse) {
4341
4317
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
@@ -4365,166 +4341,42 @@ var StageRevertDataPlugin = function() {
4365
4341
  value: currentValue
4366
4342
  };
4367
4343
  var newValue = objEntries.reduce(function(accumulation, current) {
4368
- var children2 = accumulation.children, rest = _object_without_properties(accumulation, [
4369
- "children"
4370
- ]);
4344
+ var value2 = accumulation.value;
4345
+ var children2 = accumulation.children;
4371
4346
  var _current = _sliced_to_array(current, 2), localKey = _current[0], localValue = _current[1];
4372
- if (localKey === "asset" && typeof localValue === "object") {
4373
- var assetAST = _this.parseObject(localValue, "asset", options);
4374
- if (assetAST) {
4375
- return _object_spread_props(_object_spread({}, rest), {
4376
- children: _to_consumable_array(children2).concat([
4377
- {
4378
- path: _to_consumable_array(path).concat([
4379
- "asset"
4380
- ]),
4381
- value: assetAST
4382
- }
4383
- ])
4384
- });
4385
- }
4386
- } else if (_this.hooks.determineNodeType.call(localKey) === "template" && Array.isArray(localValue)) {
4387
- var templateChildren = localValue.map(function(template) {
4388
- var _options_templateDepth, _template_dynamic;
4389
- var templateAST = _this.hooks.onCreateASTNode.call({
4390
- type: "template",
4391
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
4392
- data: template.data,
4393
- template: template.value,
4394
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
4395
- }, template);
4396
- if ((templateAST === null || templateAST === void 0 ? void 0 : templateAST.type) === "multi-node") {
4397
- templateAST.values.forEach(function(v) {
4398
- v.parent = templateAST;
4399
- });
4400
- }
4401
- if (templateAST) {
4402
- return {
4403
- path: _to_consumable_array(path).concat([
4404
- template.output
4405
- ]),
4406
- value: templateAST
4407
- };
4408
- }
4409
- return;
4410
- }).filter(function(element) {
4411
- return !!element;
4412
- });
4413
- return _object_spread_props(_object_spread({}, rest), {
4414
- children: _to_consumable_array(children2).concat(_to_consumable_array(templateChildren))
4415
- });
4416
- } else if (localValue && _this.hooks.determineNodeType.call(localValue) === "switch" || _this.hasSwitchKey(localKey)) {
4417
- var _localSwitch_children;
4418
- var localSwitch = _this.hooks.parseNode.call(_this.hasSwitchKey(localKey) ? _define_property({}, localKey, localValue) : localValue, "value", options, "switch");
4419
- if (localSwitch && localSwitch.type === "value" && ((_localSwitch_children = localSwitch.children) === null || _localSwitch_children === void 0 ? void 0 : _localSwitch_children.length) === 1 && localSwitch.value === void 0) {
4420
- var firstChild = localSwitch.children[0];
4421
- return _object_spread_props(_object_spread({}, rest), {
4422
- children: _to_consumable_array(children2).concat([
4423
- {
4424
- path: _to_consumable_array(path).concat([
4425
- localKey
4426
- ], _to_consumable_array(firstChild.path)),
4427
- value: firstChild.value
4428
- }
4429
- ])
4430
- });
4431
- }
4432
- if (localSwitch) {
4433
- return _object_spread_props(_object_spread({}, rest), {
4434
- children: _to_consumable_array(children2).concat([
4435
- {
4436
- path: _to_consumable_array(path).concat([
4437
- localKey
4438
- ]),
4439
- value: localSwitch
4440
- }
4441
- ])
4442
- });
4443
- }
4444
- } else if (localValue && hasAsync(localValue)) {
4445
- var localAsync = _this.parseAsync(localValue, "value", options);
4446
- if (localAsync) {
4447
- children2.push({
4448
- path: _to_consumable_array(path).concat([
4449
- localKey
4450
- ]),
4451
- value: localAsync
4452
- });
4453
- }
4454
- } else if (localValue && Array.isArray(localValue)) {
4455
- var childValues = localValue.map(function(childVal) {
4456
- return _this.parseObject(childVal, "value", options);
4457
- }).filter(function(child) {
4458
- return !!child;
4459
- });
4460
- if (childValues.length > 0) {
4461
- var multiNode = _this.hooks.onCreateASTNode.call({
4462
- type: "multi-node",
4463
- override: !_this.hasTemplateValues(localObj, localKey),
4464
- values: childValues
4465
- }, localValue);
4466
- if ((multiNode === null || multiNode === void 0 ? void 0 : multiNode.type) === "multi-node") {
4467
- multiNode.values.forEach(function(v) {
4468
- v.parent = multiNode;
4469
- });
4470
- }
4471
- if (multiNode) {
4472
- return _object_spread_props(_object_spread({}, rest), {
4473
- children: _to_consumable_array(children2).concat([
4474
- {
4475
- path: _to_consumable_array(path).concat([
4476
- localKey
4477
- ]),
4478
- value: multiNode
4479
- }
4480
- ])
4481
- });
4482
- }
4483
- }
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));
4484
4355
  } else if (localValue && typeof localValue === "object") {
4485
- var determineNodeType = _this.hooks.determineNodeType.call(localValue);
4486
- if (determineNodeType === "applicability") {
4487
- var parsedNode = _this.hooks.parseNode.call(localValue, "value", options, determineNodeType);
4488
- if (parsedNode) {
4489
- return _object_spread_props(_object_spread({}, rest), {
4490
- children: _to_consumable_array(children2).concat([
4491
- {
4492
- path: _to_consumable_array(path).concat([
4493
- localKey
4494
- ]),
4495
- value: parsedNode
4496
- }
4497
- ])
4498
- });
4499
- }
4500
- } else {
4501
- var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4502
- localKey
4503
- ]));
4504
- return {
4505
- value: result.value,
4506
- children: _to_consumable_array(children2).concat(_to_consumable_array(result.children))
4507
- };
4508
- }
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));
4509
4362
  } else {
4510
- 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([
4511
4364
  localKey
4512
4365
  ]), localValue);
4513
- return {
4514
- children: children2,
4515
- value: value2
4516
- };
4517
4366
  }
4518
- return accumulation;
4367
+ return {
4368
+ value: value2,
4369
+ children: children2
4370
+ };
4519
4371
  }, defaultValue);
4520
4372
  return newValue;
4521
4373
  };
4522
4374
  var _parseLocalObject = parseLocalObject(void 0, obj), value = _parseLocalObject.value, children = _parseLocalObject.children;
4523
- var baseAst = value === void 0 && children.length === 0 ? void 0 : {
4375
+ var baseAst = value === void 0 && !children.length ? void 0 : {
4524
4376
  type: type,
4525
4377
  value: value
4526
4378
  };
4527
- if (baseAst !== void 0 && children.length > 0) {
4379
+ if (baseAst && children.length) {
4528
4380
  var parent = baseAst;
4529
4381
  parent.children = children;
4530
4382
  children.forEach(function(child) {
@@ -5012,24 +4864,30 @@ var StageRevertDataPlugin = function() {
5012
4864
  }
5013
4865
  return node;
5014
4866
  });
5015
- parser.hooks.determineNodeType.tap("template", function(obj) {
5016
- if (obj === "template") {
5017
- return "template";
5018
- }
5019
- });
5020
- parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, determinedNodeType) {
5021
- if (determinedNodeType === "template") {
5022
- var _options_templateDepth, _obj_dynamic;
5023
- var templateNode = parser.createASTNode({
5024
- type: "template",
5025
- depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5026
- data: obj.data,
5027
- template: obj.value,
5028
- dynamic: (_obj_dynamic = obj.dynamic) !== null && _obj_dynamic !== void 0 ? _obj_dynamic : false
5029
- }, obj);
5030
- if (templateNode) {
5031
- return templateNode;
5032
- }
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);
5033
4891
  }
5034
4892
  });
5035
4893
  }
@@ -5173,6 +5031,12 @@ var StageRevertDataPlugin = function() {
5173
5031
  _class_call_check(this, ApplicabilityPlugin);
5174
5032
  }
5175
5033
  _create_class(ApplicabilityPlugin, [
5034
+ {
5035
+ key: "isApplicability",
5036
+ value: function isApplicability(obj) {
5037
+ return obj && Object.prototype.hasOwnProperty.call(obj, "applicability");
5038
+ }
5039
+ },
5176
5040
  {
5177
5041
  key: "applyResolver",
5178
5042
  value: function applyResolver(resolver) {
@@ -5192,25 +5056,32 @@ var StageRevertDataPlugin = function() {
5192
5056
  {
5193
5057
  key: "applyParser",
5194
5058
  value: function applyParser(parser) {
5195
- parser.hooks.determineNodeType.tap("applicability", function(obj) {
5196
- if (Object.prototype.hasOwnProperty.call(obj, "applicability")) {
5197
- return "applicability";
5198
- }
5199
- });
5200
- parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, determinedNodeType) {
5201
- if (determinedNodeType === "applicability") {
5059
+ var _this = this;
5060
+ parser.hooks.parseNode.tap("applicability", function(obj, nodeType, options, childOptions) {
5061
+ if (_this.isApplicability(obj)) {
5202
5062
  var parsedApplicability = parser.parseObject((0, import_timm7.omit)(obj, "applicability"), nodeType, options);
5203
- if (parsedApplicability !== null) {
5204
- var applicabilityNode = parser.createASTNode({
5205
- type: "applicability",
5206
- expression: obj.applicability,
5207
- value: parsedApplicability
5208
- }, obj);
5209
- if ((applicabilityNode === null || applicabilityNode === void 0 ? void 0 : applicabilityNode.type) === "applicability") {
5210
- applicabilityNode.value.parent = applicabilityNode;
5211
- }
5212
- return applicabilityNode;
5063
+ if (!parsedApplicability) {
5064
+ return childOptions ? [] : null;
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;
5213
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;
5214
5085
  }
5215
5086
  });
5216
5087
  }
@@ -5260,6 +5131,12 @@ var StageRevertDataPlugin = function() {
5260
5131
  return EMPTY_NODE;
5261
5132
  }
5262
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
+ },
5263
5140
  {
5264
5141
  key: "applyParser",
5265
5142
  value: function applyParser(parser) {
@@ -5270,42 +5147,56 @@ var StageRevertDataPlugin = function() {
5270
5147
  }
5271
5148
  return node;
5272
5149
  });
5273
- parser.hooks.determineNodeType.tap("switch", function(obj) {
5274
- if (Object.prototype.hasOwnProperty.call(obj, "dynamicSwitch") || Object.prototype.hasOwnProperty.call(obj, "staticSwitch")) {
5275
- return "switch";
5276
- }
5277
- });
5278
- parser.hooks.parseNode.tap("switch", function(obj, _nodeType, options, determinedNodeType) {
5279
- if (determinedNodeType === "switch") {
5280
- var dynamic = "dynamicSwitch" in obj;
5281
- var switchContent = "dynamicSwitch" in obj ? obj.dynamicSwitch : obj.staticSwitch;
5282
- var cases = [];
5283
- 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) {
5284
5156
  var switchCaseExpr = switchCase.case, switchBody = _object_without_properties(switchCase, [
5285
5157
  "case"
5286
5158
  ]);
5287
5159
  var value = parser.parseObject(switchBody, "value", options);
5288
5160
  if (value) {
5289
- cases.push({
5161
+ return {
5290
5162
  case: switchCaseExpr,
5291
5163
  value: value
5292
- });
5164
+ };
5293
5165
  }
5294
- });
5295
- var switchAST = parser.hooks.onCreateASTNode.call({
5166
+ return;
5167
+ }).filter(Boolean);
5168
+ var switchAST = parser.createASTNode({
5296
5169
  type: "switch",
5297
5170
  dynamic: dynamic,
5298
5171
  cases: cases
5299
- }, obj);
5300
- 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") {
5301
5177
  switchAST.cases.forEach(function(sCase) {
5302
5178
  sCase.value.parent = switchAST;
5303
5179
  });
5304
5180
  }
5305
- if ((switchAST === null || switchAST === void 0 ? void 0 : switchAST.type) === "empty") {
5306
- 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
+ ];
5307
5198
  }
5308
- return switchAST !== null && switchAST !== void 0 ? switchAST : null;
5199
+ return switchAST;
5309
5200
  }
5310
5201
  });
5311
5202
  }
@@ -5332,6 +5223,93 @@ var StageRevertDataPlugin = function() {
5332
5223
  ]);
5333
5224
  return SwitchPlugin;
5334
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
+ }();
5335
5313
  var FlowInstance = /*#__PURE__*/ function() {
5336
5314
  function FlowInstance(id, flow, options) {
5337
5315
  _class_call_check(this, FlowInstance);
@@ -7034,12 +7012,14 @@ var StageRevertDataPlugin = function() {
7034
7012
  player.hooks.viewController.tap(this.name, function(viewController) {
7035
7013
  viewController.hooks.view.tap(_this.name, function(view) {
7036
7014
  var pluginOptions = toNodeResolveOptions(view.resolverOptions);
7015
+ new AssetPlugin().apply(view);
7037
7016
  new SwitchPlugin(pluginOptions).apply(view);
7038
7017
  new ApplicabilityPlugin().apply(view);
7039
7018
  new StringResolverPlugin().apply(view);
7040
7019
  var templatePlugin = new TemplatePlugin(pluginOptions);
7041
7020
  templatePlugin.apply(view);
7042
7021
  view.hooks.onTemplatePluginCreated.call(templatePlugin);
7022
+ new MultiNodePlugin().apply(view);
7043
7023
  });
7044
7024
  });
7045
7025
  }