@player-ui/async-node-plugin 0.11.0--canary.614.21793 → 0.11.0-next.1

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.
@@ -2522,7 +2522,6 @@ var AsyncNodePlugin = function() {
2522
2522
  try {
2523
2523
  for(var _iterator = Object.keys(object)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2524
2524
  var key = _step.value;
2525
- "";
2526
2525
  var val = object[key];
2527
2526
  var nestedPath = _to_consumable_array(path).concat([
2528
2527
  key
@@ -4327,18 +4326,18 @@ var AsyncNodePlugin = function() {
4327
4326
  ]);
4328
4327
  return ValidatorRegistry;
4329
4328
  }();
4330
- var NodeType = /* @__PURE__ */ function(NodeType22) {
4331
- NodeType22["Asset"] = "asset";
4332
- NodeType22["View"] = "view";
4333
- NodeType22["Applicability"] = "applicability";
4334
- NodeType22["Template"] = "template";
4335
- NodeType22["Value"] = "value";
4336
- NodeType22["MultiNode"] = "multi-node";
4337
- NodeType22["Switch"] = "switch";
4338
- NodeType22["Async"] = "async";
4339
- NodeType22["Unknown"] = "unknown";
4340
- NodeType22["Empty"] = "empty";
4341
- return NodeType22;
4329
+ var NodeType = /* @__PURE__ */ function(NodeType2) {
4330
+ NodeType2["Asset"] = "asset";
4331
+ NodeType2["View"] = "view";
4332
+ NodeType2["Applicability"] = "applicability";
4333
+ NodeType2["Template"] = "template";
4334
+ NodeType2["Value"] = "value";
4335
+ NodeType2["MultiNode"] = "multi-node";
4336
+ NodeType2["Switch"] = "switch";
4337
+ NodeType2["Async"] = "async";
4338
+ NodeType2["Unknown"] = "unknown";
4339
+ NodeType2["Empty"] = "empty";
4340
+ return NodeType2;
4342
4341
  }(NodeType || {});
4343
4342
  var EMPTY_NODE = {
4344
4343
  type: "empty"
@@ -4966,32 +4965,10 @@ var AsyncNodePlugin = function() {
4966
4965
  node.children.push(newChild);
4967
4966
  return node;
4968
4967
  }
4969
- },
4970
- {
4971
- key: "updateChildrenByPath",
4972
- value: /**
4973
- * Updates children of a node of the same path and preserves order
4974
- *
4975
- * @param node - The node to update children for
4976
- * @param pathToMatch - The path to match against child paths
4977
- * @param mapFn - Function to transform matching children
4978
- */ function updateChildrenByPath(node, pathToMatch, updateFn) {
4979
- if (!node.children) return node;
4980
- var updatedChildren = node.children.map(function(child) {
4981
- return(// Check if paths match exactly
4982
- child.path.join() === pathToMatch.join() ? _object_spread_props(_object_spread({}, child), {
4983
- value: updateFn(child)
4984
- }) : child);
4985
- });
4986
- return _object_spread_props(_object_spread({}, node), {
4987
- children: updatedChildren
4988
- });
4989
- }
4990
4968
  }
4991
4969
  ]);
4992
4970
  return _Builder;
4993
4971
  }();
4994
- var templateSymbol = Symbol("template");
4995
4972
  var TemplatePlugin = /*#__PURE__*/ function() {
4996
4973
  function TemplatePlugin(options) {
4997
4974
  _class_call_check(this, TemplatePlugin);
@@ -5062,9 +5039,6 @@ var AsyncNodePlugin = function() {
5062
5039
  override: false,
5063
5040
  values: values
5064
5041
  };
5065
- if (node.placement !== void 0) {
5066
- result[templateSymbol] = node.placement;
5067
- }
5068
5042
  return result;
5069
5043
  }
5070
5044
  },
@@ -5078,40 +5052,6 @@ var AsyncNodePlugin = function() {
5078
5052
  }
5079
5053
  return node;
5080
5054
  });
5081
- parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
5082
- var getTemplateSymbolValue = function getTemplateSymbolValue(node2) {
5083
- if (node2.type === "multi-node") {
5084
- return node2[templateSymbol];
5085
- } else if (node2.type === "template") {
5086
- return node2.placement;
5087
- }
5088
- return void 0;
5089
- };
5090
- if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
5091
- node.children = node.children.sort(function(a, b) {
5092
- var aPath = a.path.join();
5093
- var bPath = b.path.join();
5094
- var pathsEqual = aPath === bPath;
5095
- if (pathsEqual) {
5096
- var aPlacement = getTemplateSymbolValue(a.value);
5097
- var bPlacement = getTemplateSymbolValue(b.value);
5098
- if (aPlacement !== void 0 && bPlacement === void 0) {
5099
- return aPlacement === "prepend" ? -1 : 1;
5100
- } else if (bPlacement !== void 0 && aPlacement === void 0) {
5101
- return bPlacement === "prepend" ? 1 : -1;
5102
- } else if (aPlacement !== void 0 && bPlacement !== void 0) {
5103
- if (aPlacement === bPlacement) {
5104
- return 0;
5105
- }
5106
- return aPlacement === "prepend" ? -1 : 1;
5107
- }
5108
- return 0;
5109
- }
5110
- return aPath > bPath ? 1 : -1;
5111
- });
5112
- }
5113
- return node;
5114
- });
5115
5055
  parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
5116
5056
  if (childOptions && hasTemplateKey(childOptions.key)) {
5117
5057
  return obj.map(function(template) {
@@ -5121,8 +5061,7 @@ var AsyncNodePlugin = function() {
5121
5061
  depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5122
5062
  data: template.data,
5123
5063
  template: template.value,
5124
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false,
5125
- placement: template.placement
5064
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
5126
5065
  }, template);
5127
5066
  if (!templateAST) return;
5128
5067
  if (templateAST.type === "multi-node") {