@player-ui/player 0.11.1 → 0.11.2-next.0

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.
@@ -2386,8 +2386,8 @@ var ValidatorRegistry = class {
2386
2386
  import { SyncHook as SyncHook4 } from "tapable-ts";
2387
2387
 
2388
2388
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
2389
- import { SyncWaterfallHook as SyncWaterfallHook5, SyncHook as SyncHook3 } from "tapable-ts";
2390
- import { setIn as setIn5, addLast, clone } from "timm";
2389
+ import { SyncHook as SyncHook3, SyncWaterfallHook as SyncWaterfallHook5 } from "tapable-ts";
2390
+ import { addLast, clone, setIn as setIn5 } from "timm";
2391
2391
  import dlv from "dlv";
2392
2392
  import { dequal } from "dequal";
2393
2393
 
@@ -2581,15 +2581,6 @@ function toNodeResolveOptions(resolverOptions) {
2581
2581
  evaluate: (exp) => resolverOptions.evaluator.evaluate(exp, resolverOptions)
2582
2582
  };
2583
2583
  }
2584
- function unpackAndPush(item, initial) {
2585
- if (item.asset.values && Array.isArray(item.asset.values)) {
2586
- item.asset.values.forEach((i) => {
2587
- unpackAndPush(i, initial);
2588
- });
2589
- } else {
2590
- initial.push(item);
2591
- }
2592
- }
2593
2584
 
2594
2585
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
2595
2586
  var withContext = (model) => {
@@ -2745,6 +2736,7 @@ var Resolver = class {
2745
2736
  ) ?? {
2746
2737
  type: "empty" /* Empty */
2747
2738
  };
2739
+ const isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" /* MultiNode */ && partiallyResolvedParent?.parent?.parent?.type === "multi-node" /* MultiNode */ && partiallyResolvedParent.parent.type === "value" /* Value */ && resolvedAST.parent?.type === "asset" /* Asset */ && resolvedAST.parent.value.id.includes("async");
2748
2740
  const isNestedMultiNode = resolvedAST.type === "multi-node" /* MultiNode */ && partiallyResolvedParent?.parent?.type === "multi-node" /* MultiNode */ && partiallyResolvedParent.type === "value" /* Value */;
2749
2741
  if (previousResult && shouldUseLastValue) {
2750
2742
  const update2 = {
@@ -2783,7 +2775,11 @@ var Resolver = class {
2783
2775
  repopulateASTMapFromCache(previousResult, node, rawParent);
2784
2776
  return update2;
2785
2777
  }
2786
- resolvedAST.parent = partiallyResolvedParent;
2778
+ if (isNestedMultiNodeWithAsync) {
2779
+ resolvedAST.parent = partiallyResolvedParent.parent;
2780
+ } else {
2781
+ resolvedAST.parent = partiallyResolvedParent;
2782
+ }
2787
2783
  resolveOptions.node = resolvedAST;
2788
2784
  this.ASTMap.set(resolvedAST, node);
2789
2785
  let resolved = this.hooks.resolve.call(
@@ -2833,6 +2829,7 @@ var Resolver = class {
2833
2829
  } else if (resolvedAST.type === "multi-node" /* MultiNode */) {
2834
2830
  const childValue = [];
2835
2831
  const rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent?.parent : node;
2832
+ const hasAsync = resolvedAST.values.map((value, index) => value.type === "async" /* Async */ ? index : -1).filter((index) => index !== -1);
2836
2833
  const newValues = resolvedAST.values.map((mValue) => {
2837
2834
  const mTree = this.computeTree(
2838
2835
  mValue,
@@ -2856,7 +2853,16 @@ var Resolver = class {
2856
2853
  updated = updated || mTree.updated;
2857
2854
  return mTree.node;
2858
2855
  });
2859
- resolvedAST.values = newValues;
2856
+ if (hasAsync.length > 0) {
2857
+ const copy = newValues;
2858
+ hasAsync.forEach((index) => {
2859
+ if (copy[index])
2860
+ copy.splice(index, 1, ...unpackNode(copy[index]));
2861
+ });
2862
+ resolvedAST.values = copy;
2863
+ } else {
2864
+ resolvedAST.values = newValues;
2865
+ }
2860
2866
  resolved = childValue;
2861
2867
  }
2862
2868
  childDependencies.forEach(
@@ -2888,6 +2894,28 @@ var Resolver = class {
2888
2894
  return update;
2889
2895
  }
2890
2896
  };
2897
+ function unpackAndPush(item, initial) {
2898
+ if (item.asset.values && Array.isArray(item.asset.values)) {
2899
+ item.asset.values.forEach((i) => {
2900
+ unpackAndPush(i, initial);
2901
+ });
2902
+ } else {
2903
+ initial.push(item);
2904
+ }
2905
+ }
2906
+ function unpackNode(item) {
2907
+ const unpacked = [];
2908
+ if ("children" in item && item.children?.[0]?.value.type === "asset" /* Asset */ && (item.children?.[0]?.value).children) {
2909
+ if ((item.children?.[0]?.value).children?.[0]?.value.type === "multi-node" /* MultiNode */) {
2910
+ ((item.children?.[0]?.value).children?.[0]?.value).values.forEach((value) => {
2911
+ unpacked.push(value);
2912
+ });
2913
+ }
2914
+ } else {
2915
+ unpacked.push(item);
2916
+ }
2917
+ return unpacked;
2918
+ }
2891
2919
 
2892
2920
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/view.ts
2893
2921
  var CrossfieldProvider = class {
@@ -5487,7 +5515,6 @@ export {
5487
5515
  severities,
5488
5516
  toModel,
5489
5517
  toNodeResolveOptions,
5490
- unpackAndPush,
5491
5518
  withParser,
5492
5519
  withoutContext
5493
5520
  };
package/dist/index.mjs CHANGED
@@ -2386,8 +2386,8 @@ var ValidatorRegistry = class {
2386
2386
  import { SyncHook as SyncHook4 } from "tapable-ts";
2387
2387
 
2388
2388
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
2389
- import { SyncWaterfallHook as SyncWaterfallHook5, SyncHook as SyncHook3 } from "tapable-ts";
2390
- import { setIn as setIn5, addLast, clone } from "timm";
2389
+ import { SyncHook as SyncHook3, SyncWaterfallHook as SyncWaterfallHook5 } from "tapable-ts";
2390
+ import { addLast, clone, setIn as setIn5 } from "timm";
2391
2391
  import dlv from "dlv";
2392
2392
  import { dequal } from "dequal";
2393
2393
 
@@ -2581,15 +2581,6 @@ function toNodeResolveOptions(resolverOptions) {
2581
2581
  evaluate: (exp) => resolverOptions.evaluator.evaluate(exp, resolverOptions)
2582
2582
  };
2583
2583
  }
2584
- function unpackAndPush(item, initial) {
2585
- if (item.asset.values && Array.isArray(item.asset.values)) {
2586
- item.asset.values.forEach((i) => {
2587
- unpackAndPush(i, initial);
2588
- });
2589
- } else {
2590
- initial.push(item);
2591
- }
2592
- }
2593
2584
 
2594
2585
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
2595
2586
  var withContext = (model) => {
@@ -2745,6 +2736,7 @@ var Resolver = class {
2745
2736
  ) ?? {
2746
2737
  type: "empty" /* Empty */
2747
2738
  };
2739
+ const isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" /* MultiNode */ && partiallyResolvedParent?.parent?.parent?.type === "multi-node" /* MultiNode */ && partiallyResolvedParent.parent.type === "value" /* Value */ && resolvedAST.parent?.type === "asset" /* Asset */ && resolvedAST.parent.value.id.includes("async");
2748
2740
  const isNestedMultiNode = resolvedAST.type === "multi-node" /* MultiNode */ && partiallyResolvedParent?.parent?.type === "multi-node" /* MultiNode */ && partiallyResolvedParent.type === "value" /* Value */;
2749
2741
  if (previousResult && shouldUseLastValue) {
2750
2742
  const update2 = {
@@ -2783,7 +2775,11 @@ var Resolver = class {
2783
2775
  repopulateASTMapFromCache(previousResult, node, rawParent);
2784
2776
  return update2;
2785
2777
  }
2786
- resolvedAST.parent = partiallyResolvedParent;
2778
+ if (isNestedMultiNodeWithAsync) {
2779
+ resolvedAST.parent = partiallyResolvedParent.parent;
2780
+ } else {
2781
+ resolvedAST.parent = partiallyResolvedParent;
2782
+ }
2787
2783
  resolveOptions.node = resolvedAST;
2788
2784
  this.ASTMap.set(resolvedAST, node);
2789
2785
  let resolved = this.hooks.resolve.call(
@@ -2833,6 +2829,7 @@ var Resolver = class {
2833
2829
  } else if (resolvedAST.type === "multi-node" /* MultiNode */) {
2834
2830
  const childValue = [];
2835
2831
  const rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent?.parent : node;
2832
+ const hasAsync = resolvedAST.values.map((value, index) => value.type === "async" /* Async */ ? index : -1).filter((index) => index !== -1);
2836
2833
  const newValues = resolvedAST.values.map((mValue) => {
2837
2834
  const mTree = this.computeTree(
2838
2835
  mValue,
@@ -2856,7 +2853,16 @@ var Resolver = class {
2856
2853
  updated = updated || mTree.updated;
2857
2854
  return mTree.node;
2858
2855
  });
2859
- resolvedAST.values = newValues;
2856
+ if (hasAsync.length > 0) {
2857
+ const copy = newValues;
2858
+ hasAsync.forEach((index) => {
2859
+ if (copy[index])
2860
+ copy.splice(index, 1, ...unpackNode(copy[index]));
2861
+ });
2862
+ resolvedAST.values = copy;
2863
+ } else {
2864
+ resolvedAST.values = newValues;
2865
+ }
2860
2866
  resolved = childValue;
2861
2867
  }
2862
2868
  childDependencies.forEach(
@@ -2888,6 +2894,28 @@ var Resolver = class {
2888
2894
  return update;
2889
2895
  }
2890
2896
  };
2897
+ function unpackAndPush(item, initial) {
2898
+ if (item.asset.values && Array.isArray(item.asset.values)) {
2899
+ item.asset.values.forEach((i) => {
2900
+ unpackAndPush(i, initial);
2901
+ });
2902
+ } else {
2903
+ initial.push(item);
2904
+ }
2905
+ }
2906
+ function unpackNode(item) {
2907
+ const unpacked = [];
2908
+ if ("children" in item && item.children?.[0]?.value.type === "asset" /* Asset */ && (item.children?.[0]?.value).children) {
2909
+ if ((item.children?.[0]?.value).children?.[0]?.value.type === "multi-node" /* MultiNode */) {
2910
+ ((item.children?.[0]?.value).children?.[0]?.value).values.forEach((value) => {
2911
+ unpacked.push(value);
2912
+ });
2913
+ }
2914
+ } else {
2915
+ unpacked.push(item);
2916
+ }
2917
+ return unpacked;
2918
+ }
2891
2919
 
2892
2920
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/view.ts
2893
2921
  var CrossfieldProvider = class {
@@ -5487,7 +5515,6 @@ export {
5487
5515
  severities,
5488
5516
  toModel,
5489
5517
  toNodeResolveOptions,
5490
- unpackAndPush,
5491
5518
  withParser,
5492
5519
  withoutContext
5493
5520
  };