@player-ui/async-node-plugin 0.11.0--canary.614.21244 → 0.11.0--canary.609.21369

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.
@@ -4477,8 +4477,8 @@ var AsyncNodePlugin = function() {
4477
4477
  return Parser;
4478
4478
  }();
4479
4479
  function unpackAndPush(item, initial) {
4480
- if (Array.isArray(item)) {
4481
- item.forEach(function(i) {
4480
+ if (item.asset.values && Array.isArray(item.asset.values)) {
4481
+ item.asset.values.forEach(function(i) {
4482
4482
  unpackAndPush(i, initial);
4483
4483
  });
4484
4484
  } else {
@@ -4706,9 +4706,7 @@ var AsyncNodePlugin = function() {
4706
4706
  var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
4707
4707
  if (mTree.value !== void 0 && mTree.value !== null) {
4708
4708
  if (mValue.type === "async" && mValue.flatten && mTree.value.asset && Array.isArray(mTree.value.asset.values)) {
4709
- mTree.value.asset.values.forEach(function(v) {
4710
- unpackAndPush(v, childValue);
4711
- });
4709
+ unpackAndPush(mTree.value, childValue);
4712
4710
  } else {
4713
4711
  childValue.push(mTree.value);
4714
4712
  }
@@ -4972,7 +4970,6 @@ var AsyncNodePlugin = function() {
4972
4970
  ]);
4973
4971
  return _Builder;
4974
4972
  }();
4975
- var templateSymbol = Symbol("template");
4976
4973
  var TemplatePlugin = /*#__PURE__*/ function() {
4977
4974
  function TemplatePlugin(options) {
4978
4975
  _class_call_check(this, TemplatePlugin);
@@ -5043,9 +5040,6 @@ var AsyncNodePlugin = function() {
5043
5040
  override: false,
5044
5041
  values: values
5045
5042
  };
5046
- if (node.placement !== void 0) {
5047
- result[templateSymbol] = node.placement;
5048
- }
5049
5043
  return result;
5050
5044
  }
5051
5045
  },
@@ -5059,38 +5053,6 @@ var AsyncNodePlugin = function() {
5059
5053
  }
5060
5054
  return node;
5061
5055
  });
5062
- function getTemplateSymbolValue(node) {
5063
- if (node.type === "multi-node") {
5064
- return node[templateSymbol];
5065
- } else if (node.type === "template") {
5066
- return node.placement;
5067
- }
5068
- return void 0;
5069
- }
5070
- parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
5071
- if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
5072
- node.children = node.children.sort(function(a, b) {
5073
- var pathsEqual = a.path.join() === b.path.join();
5074
- if (pathsEqual) {
5075
- var aPlacement = getTemplateSymbolValue(a.value);
5076
- var bPlacement = getTemplateSymbolValue(b.value);
5077
- if (aPlacement !== void 0 && bPlacement === void 0) {
5078
- return aPlacement === "prepend" ? -1 : 1;
5079
- } else if (bPlacement !== void 0 && aPlacement === void 0) {
5080
- return bPlacement === "prepend" ? 1 : -1;
5081
- } else if (aPlacement !== void 0 && bPlacement !== void 0) {
5082
- if (aPlacement === bPlacement) {
5083
- return 0;
5084
- }
5085
- return aPlacement === "prepend" ? -1 : 1;
5086
- }
5087
- return 0;
5088
- }
5089
- return 0;
5090
- });
5091
- }
5092
- return node;
5093
- });
5094
5056
  parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
5095
5057
  if (childOptions && hasTemplateKey(childOptions.key)) {
5096
5058
  return obj.map(function(template) {
@@ -5100,8 +5062,7 @@ var AsyncNodePlugin = function() {
5100
5062
  depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5101
5063
  data: template.data,
5102
5064
  template: template.value,
5103
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false,
5104
- placement: template.placement
5065
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
5105
5066
  }, template);
5106
5067
  if (!templateAST) return;
5107
5068
  if (templateAST.type === "multi-node") {
@@ -5137,7 +5098,6 @@ var AsyncNodePlugin = function() {
5137
5098
  value: function apply(view) {
5138
5099
  view.hooks.parser.tap("template", this.applyParser.bind(this));
5139
5100
  view.hooks.resolver.tap("template", this.applyResolverHooks.bind(this));
5140
- view.hooks.onTemplatePluginCreated.call(this);
5141
5101
  }
5142
5102
  }
5143
5103
  ]);