@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.
- package/dist/Player.native.js +51 -16
- package/dist/Player.native.js.map +1 -1
- package/dist/cjs/index.cjs +39 -13
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +41 -14
- package/dist/index.mjs +41 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/view/resolver/index.ts +68 -11
- package/src/view/resolver/utils.ts +0 -13
- package/types/view/resolver/index.d.ts +2 -2
- package/types/view/resolver/utils.d.ts +0 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -103,7 +103,6 @@ __export(src_exports, {
|
|
|
103
103
|
severities: () => severities,
|
|
104
104
|
toModel: () => toModel,
|
|
105
105
|
toNodeResolveOptions: () => toNodeResolveOptions,
|
|
106
|
-
unpackAndPush: () => unpackAndPush,
|
|
107
106
|
withParser: () => withParser,
|
|
108
107
|
withoutContext: () => withoutContext
|
|
109
108
|
});
|
|
@@ -2684,15 +2683,6 @@ function toNodeResolveOptions(resolverOptions) {
|
|
|
2684
2683
|
evaluate: (exp) => resolverOptions.evaluator.evaluate(exp, resolverOptions)
|
|
2685
2684
|
};
|
|
2686
2685
|
}
|
|
2687
|
-
function unpackAndPush(item, initial) {
|
|
2688
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
2689
|
-
item.asset.values.forEach((i) => {
|
|
2690
|
-
unpackAndPush(i, initial);
|
|
2691
|
-
});
|
|
2692
|
-
} else {
|
|
2693
|
-
initial.push(item);
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
2686
|
|
|
2697
2687
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
|
|
2698
2688
|
var withContext = (model) => {
|
|
@@ -2848,6 +2838,7 @@ var Resolver = class {
|
|
|
2848
2838
|
) ?? {
|
|
2849
2839
|
type: "empty" /* Empty */
|
|
2850
2840
|
};
|
|
2841
|
+
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");
|
|
2851
2842
|
const isNestedMultiNode = resolvedAST.type === "multi-node" /* MultiNode */ && partiallyResolvedParent?.parent?.type === "multi-node" /* MultiNode */ && partiallyResolvedParent.type === "value" /* Value */;
|
|
2852
2843
|
if (previousResult && shouldUseLastValue) {
|
|
2853
2844
|
const update2 = {
|
|
@@ -2886,7 +2877,11 @@ var Resolver = class {
|
|
|
2886
2877
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
2887
2878
|
return update2;
|
|
2888
2879
|
}
|
|
2889
|
-
|
|
2880
|
+
if (isNestedMultiNodeWithAsync) {
|
|
2881
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
2882
|
+
} else {
|
|
2883
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
2884
|
+
}
|
|
2890
2885
|
resolveOptions.node = resolvedAST;
|
|
2891
2886
|
this.ASTMap.set(resolvedAST, node);
|
|
2892
2887
|
let resolved = this.hooks.resolve.call(
|
|
@@ -2936,6 +2931,7 @@ var Resolver = class {
|
|
|
2936
2931
|
} else if (resolvedAST.type === "multi-node" /* MultiNode */) {
|
|
2937
2932
|
const childValue = [];
|
|
2938
2933
|
const rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent?.parent : node;
|
|
2934
|
+
const hasAsync = resolvedAST.values.map((value, index) => value.type === "async" /* Async */ ? index : -1).filter((index) => index !== -1);
|
|
2939
2935
|
const newValues = resolvedAST.values.map((mValue) => {
|
|
2940
2936
|
const mTree = this.computeTree(
|
|
2941
2937
|
mValue,
|
|
@@ -2959,7 +2955,16 @@ var Resolver = class {
|
|
|
2959
2955
|
updated = updated || mTree.updated;
|
|
2960
2956
|
return mTree.node;
|
|
2961
2957
|
});
|
|
2962
|
-
|
|
2958
|
+
if (hasAsync.length > 0) {
|
|
2959
|
+
const copy = newValues;
|
|
2960
|
+
hasAsync.forEach((index) => {
|
|
2961
|
+
if (copy[index])
|
|
2962
|
+
copy.splice(index, 1, ...unpackNode(copy[index]));
|
|
2963
|
+
});
|
|
2964
|
+
resolvedAST.values = copy;
|
|
2965
|
+
} else {
|
|
2966
|
+
resolvedAST.values = newValues;
|
|
2967
|
+
}
|
|
2963
2968
|
resolved = childValue;
|
|
2964
2969
|
}
|
|
2965
2970
|
childDependencies.forEach(
|
|
@@ -2991,6 +2996,28 @@ var Resolver = class {
|
|
|
2991
2996
|
return update;
|
|
2992
2997
|
}
|
|
2993
2998
|
};
|
|
2999
|
+
function unpackAndPush(item, initial) {
|
|
3000
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
3001
|
+
item.asset.values.forEach((i) => {
|
|
3002
|
+
unpackAndPush(i, initial);
|
|
3003
|
+
});
|
|
3004
|
+
} else {
|
|
3005
|
+
initial.push(item);
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
function unpackNode(item) {
|
|
3009
|
+
const unpacked = [];
|
|
3010
|
+
if ("children" in item && item.children?.[0]?.value.type === "asset" /* Asset */ && (item.children?.[0]?.value).children) {
|
|
3011
|
+
if ((item.children?.[0]?.value).children?.[0]?.value.type === "multi-node" /* MultiNode */) {
|
|
3012
|
+
((item.children?.[0]?.value).children?.[0]?.value).values.forEach((value) => {
|
|
3013
|
+
unpacked.push(value);
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
} else {
|
|
3017
|
+
unpacked.push(item);
|
|
3018
|
+
}
|
|
3019
|
+
return unpacked;
|
|
3020
|
+
}
|
|
2994
3021
|
|
|
2995
3022
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/view.ts
|
|
2996
3023
|
var CrossfieldProvider = class {
|
|
@@ -5591,7 +5618,6 @@ var Player = _Player;
|
|
|
5591
5618
|
severities,
|
|
5592
5619
|
toModel,
|
|
5593
5620
|
toNodeResolveOptions,
|
|
5594
|
-
unpackAndPush,
|
|
5595
5621
|
withParser,
|
|
5596
5622
|
withoutContext,
|
|
5597
5623
|
...require("@player-ui/types")
|