@player-ui/async-node-plugin 0.10.5--canary.614.21174 → 0.10.5--canary.597.21388

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.
@@ -2038,9 +2038,6 @@ var AsyncNodePlugin = function() {
2038
2038
  },
2039
2039
  AsyncNodePluginPlugin: function() {
2040
2040
  return AsyncNodePluginPlugin;
2041
- },
2042
- asyncTransform: function() {
2043
- return asyncTransform;
2044
2041
  }
2045
2042
  });
2046
2043
  var InterceptionManager = /*#__PURE__*/ function() {
@@ -4327,18 +4324,18 @@ var AsyncNodePlugin = function() {
4327
4324
  ]);
4328
4325
  return ValidatorRegistry;
4329
4326
  }();
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;
4327
+ var NodeType = /* @__PURE__ */ function(NodeType2) {
4328
+ NodeType2["Asset"] = "asset";
4329
+ NodeType2["View"] = "view";
4330
+ NodeType2["Applicability"] = "applicability";
4331
+ NodeType2["Template"] = "template";
4332
+ NodeType2["Value"] = "value";
4333
+ NodeType2["MultiNode"] = "multi-node";
4334
+ NodeType2["Switch"] = "switch";
4335
+ NodeType2["Async"] = "async";
4336
+ NodeType2["Unknown"] = "unknown";
4337
+ NodeType2["Empty"] = "empty";
4338
+ return NodeType2;
4342
4339
  }(NodeType || {});
4343
4340
  var EMPTY_NODE = {
4344
4341
  type: "empty"
@@ -4476,15 +4473,6 @@ var AsyncNodePlugin = function() {
4476
4473
  ]);
4477
4474
  return Parser;
4478
4475
  }();
4479
- function unpackAndPush(item, initial) {
4480
- if (Array.isArray(item)) {
4481
- item.forEach(function(i) {
4482
- unpackAndPush(i, initial);
4483
- });
4484
- } else {
4485
- initial.push(item);
4486
- }
4487
- }
4488
4476
  var withContext = function(model) {
4489
4477
  return {
4490
4478
  get: function(binding, options) {
@@ -4705,13 +4693,7 @@ var AsyncNodePlugin = function() {
4705
4693
  var newValues = resolvedAST.values.map(function(mValue) {
4706
4694
  var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
4707
4695
  if (mTree.value !== void 0 && mTree.value !== null) {
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
- });
4712
- } else {
4713
- childValue.push(mTree.value);
4714
- }
4696
+ childValue.push(mTree.value);
4715
4697
  }
4716
4698
  mTree.dependencies.forEach(function(bindingDep) {
4717
4699
  return childDependencies.add(bindingDep);
@@ -4866,113 +4848,6 @@ var AsyncNodePlugin = function() {
4866
4848
  ]);
4867
4849
  return ViewInstance;
4868
4850
  }();
4869
- var Builder = /*#__PURE__*/ function() {
4870
- function _Builder() {
4871
- _class_call_check(this, _Builder);
4872
- }
4873
- _create_class(_Builder, null, [
4874
- {
4875
- key: "asset",
4876
- value: /**
4877
- * Creates an asset node
4878
- *
4879
- * @param value - the value to put in the asset node
4880
- */ function asset(value) {
4881
- return {
4882
- type: "asset",
4883
- value: value
4884
- };
4885
- }
4886
- },
4887
- {
4888
- key: "assetWrapper",
4889
- value: function assetWrapper(value) {
4890
- var valueNode = _Builder.value();
4891
- _Builder.addChild(valueNode, "asset", value);
4892
- return valueNode;
4893
- }
4894
- },
4895
- {
4896
- key: "value",
4897
- value: /**
4898
- * Creates a value node
4899
- *
4900
- * @param v - The object to put in the value node
4901
- */ function value(v) {
4902
- return {
4903
- type: "value",
4904
- value: v
4905
- };
4906
- }
4907
- },
4908
- {
4909
- key: "multiNode",
4910
- value: /**
4911
- * Creates a multiNode and associates the multiNode as the parent
4912
- * of all the value nodes
4913
- *
4914
- * @param values - the value, applicability or async nodes to put in the multinode
4915
- */ function multiNode() {
4916
- for(var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++){
4917
- values[_key] = arguments[_key];
4918
- }
4919
- var m = {
4920
- type: "multi-node",
4921
- override: true,
4922
- values: values
4923
- };
4924
- values.forEach(function(v) {
4925
- v.parent = m;
4926
- });
4927
- return m;
4928
- }
4929
- },
4930
- {
4931
- key: "asyncNode",
4932
- value: /**
4933
- * Creates an async node
4934
- *
4935
- * @param id - the id of async node. It should be identical for each async node
4936
- */ function asyncNode(id) {
4937
- var flatten2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
4938
- return {
4939
- id: id,
4940
- type: "async",
4941
- flatten: flatten2,
4942
- value: {
4943
- type: "value",
4944
- value: {
4945
- id: id
4946
- }
4947
- }
4948
- };
4949
- }
4950
- },
4951
- {
4952
- key: "addChild",
4953
- value: /**
4954
- * Adds a child node to a node
4955
- *
4956
- * @param node - The node to add a child to
4957
- * @param path - The path at which to add the child
4958
- * @param child - The child node
4959
- */ function addChild(node, path, child) {
4960
- child.parent = node;
4961
- var newChild = {
4962
- path: Array.isArray(path) ? path : [
4963
- path
4964
- ],
4965
- value: child
4966
- };
4967
- node.children = node.children || [];
4968
- node.children.push(newChild);
4969
- return node;
4970
- }
4971
- }
4972
- ]);
4973
- return _Builder;
4974
- }();
4975
- var templateSymbol = Symbol("template");
4976
4851
  var TemplatePlugin = /*#__PURE__*/ function() {
4977
4852
  function TemplatePlugin(options) {
4978
4853
  _class_call_check(this, TemplatePlugin);
@@ -5038,11 +4913,11 @@ var AsyncNodePlugin = function() {
5038
4913
  values.push(parsed);
5039
4914
  }
5040
4915
  });
5041
- var result = _define_property({
4916
+ var result = {
5042
4917
  type: "multi-node",
5043
4918
  override: false,
5044
4919
  values: values
5045
- }, templateSymbol, node.placement);
4920
+ };
5046
4921
  return result;
5047
4922
  }
5048
4923
  },
@@ -5056,38 +4931,6 @@ var AsyncNodePlugin = function() {
5056
4931
  }
5057
4932
  return node;
5058
4933
  });
5059
- function getTemplateSymbolValue(node) {
5060
- if (node.type === "multi-node") {
5061
- return node[templateSymbol];
5062
- } else if (node.type === "template") {
5063
- return node.placement;
5064
- }
5065
- return void 0;
5066
- }
5067
- parser.hooks.onCreateASTNode.tap("template-sort", function(node) {
5068
- if (node && (node.type === "view" || node.type === "asset") && Array.isArray(node.children)) {
5069
- node.children = node.children.sort(function(a, b) {
5070
- var pathsEqual = a.path.join() === b.path.join();
5071
- if (pathsEqual) {
5072
- var aPlacement = getTemplateSymbolValue(a.value);
5073
- var bPlacement = getTemplateSymbolValue(b.value);
5074
- if (aPlacement !== void 0 && bPlacement === void 0) {
5075
- return aPlacement === "prepend" ? -1 : 1;
5076
- } else if (bPlacement !== void 0 && aPlacement === void 0) {
5077
- return bPlacement === "prepend" ? 1 : -1;
5078
- } else if (aPlacement !== void 0 && bPlacement !== void 0) {
5079
- if (aPlacement === bPlacement) {
5080
- return 0;
5081
- }
5082
- return aPlacement === "prepend" ? -1 : 1;
5083
- }
5084
- return 0;
5085
- }
5086
- return 0;
5087
- });
5088
- }
5089
- return node;
5090
- });
5091
4934
  parser.hooks.parseNode.tap("template", function(obj, _nodeType, options, childOptions) {
5092
4935
  if (childOptions && hasTemplateKey(childOptions.key)) {
5093
4936
  return obj.map(function(template) {
@@ -5097,8 +4940,7 @@ var AsyncNodePlugin = function() {
5097
4940
  depth: (_options_templateDepth = options.templateDepth) !== null && _options_templateDepth !== void 0 ? _options_templateDepth : 0,
5098
4941
  data: template.data,
5099
4942
  template: template.value,
5100
- dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false,
5101
- placement: template.placement
4943
+ dynamic: (_template_dynamic = template.dynamic) !== null && _template_dynamic !== void 0 ? _template_dynamic : false
5102
4944
  }, template);
5103
4945
  if (!templateAST) return;
5104
4946
  if (templateAST.type === "multi-node") {
@@ -5134,7 +4976,6 @@ var AsyncNodePlugin = function() {
5134
4976
  value: function apply(view) {
5135
4977
  view.hooks.parser.tap("template", this.applyParser.bind(this));
5136
4978
  view.hooks.resolver.tap("template", this.applyResolverHooks.bind(this));
5137
- view.hooks.onTemplatePluginCreated.call(this);
5138
4979
  }
5139
4980
  }
5140
4981
  ]);
@@ -7644,28 +7485,6 @@ var AsyncNodePlugin = function() {
7644
7485
  // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
7645
7486
  var import_queue_microtask2 = __toESM(require_queue_microtask());
7646
7487
  var import_timm10 = __toESM(require_timm());
7647
- // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/transform.ts
7648
- var asyncTransform = function(assetId, wrapperAssetType, asset, flatten2) {
7649
- var id = "async-" + assetId;
7650
- var asyncNode = Builder.asyncNode(id, flatten2);
7651
- var multiNode;
7652
- var assetNode;
7653
- if (asset) {
7654
- assetNode = Builder.assetWrapper(asset);
7655
- multiNode = Builder.multiNode(assetNode, asyncNode);
7656
- } else {
7657
- multiNode = Builder.multiNode(asyncNode);
7658
- }
7659
- var wrapperAsset = Builder.asset({
7660
- id: wrapperAssetType + "-" + id,
7661
- type: wrapperAssetType
7662
- });
7663
- Builder.addChild(wrapperAsset, [
7664
- "values"
7665
- ], multiNode);
7666
- return wrapperAsset;
7667
- };
7668
- // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
7669
7488
  var AsyncNodePlugin = /*#__PURE__*/ function() {
7670
7489
  function AsyncNodePlugin(options) {
7671
7490
  var _this = this;