@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/Player.native.js
CHANGED
|
@@ -1386,6 +1386,22 @@ var Player = function() {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
});
|
|
1388
1388
|
};
|
|
1389
|
+
var unpackNode = function unpackNode(item) {
|
|
1390
|
+
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1391
|
+
var unpacked = [];
|
|
1392
|
+
if ("children" in item && ((_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.value.type) === "asset" /* Asset */ && ((_item_children1 = item.children) === null || _item_children1 === void 0 ? void 0 : (_item_children_1 = _item_children1[0]) === null || _item_children_1 === void 0 ? void 0 : _item_children_1.value).children) {
|
|
1393
|
+
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1394
|
+
if (((_item_children__value_children = ((_item_children2 = item.children) === null || _item_children2 === void 0 ? void 0 : (_item_children_2 = _item_children2[0]) === null || _item_children_2 === void 0 ? void 0 : _item_children_2.value).children) === null || _item_children__value_children === void 0 ? void 0 : (_item_children__value_children_ = _item_children__value_children[0]) === null || _item_children__value_children_ === void 0 ? void 0 : _item_children__value_children_.value.type) === "multi-node" /* MultiNode */ ) {
|
|
1395
|
+
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1396
|
+
((_item_children__value_children1 = ((_item_children3 = item.children) === null || _item_children3 === void 0 ? void 0 : (_item_children_3 = _item_children3[0]) === null || _item_children_3 === void 0 ? void 0 : _item_children_3.value).children) === null || _item_children__value_children1 === void 0 ? void 0 : (_item_children__value_children_1 = _item_children__value_children1[0]) === null || _item_children__value_children_1 === void 0 ? void 0 : _item_children__value_children_1.value).values.forEach(function(value) {
|
|
1397
|
+
unpacked.push(value);
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
} else {
|
|
1401
|
+
unpacked.push(item);
|
|
1402
|
+
}
|
|
1403
|
+
return unpacked;
|
|
1404
|
+
};
|
|
1389
1405
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1390
1406
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1391
1407
|
};
|
|
@@ -2268,9 +2284,6 @@ var Player = function() {
|
|
|
2268
2284
|
toNodeResolveOptions: function() {
|
|
2269
2285
|
return toNodeResolveOptions;
|
|
2270
2286
|
},
|
|
2271
|
-
unpackAndPush: function() {
|
|
2272
|
-
return unpackAndPush;
|
|
2273
|
-
},
|
|
2274
2287
|
withParser: function() {
|
|
2275
2288
|
return withParser;
|
|
2276
2289
|
},
|
|
@@ -4724,15 +4737,6 @@ var Player = function() {
|
|
|
4724
4737
|
]);
|
|
4725
4738
|
return Parser;
|
|
4726
4739
|
}();
|
|
4727
|
-
function unpackAndPush(item, initial) {
|
|
4728
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
4729
|
-
item.asset.values.forEach(function(i) {
|
|
4730
|
-
unpackAndPush(i, initial);
|
|
4731
|
-
});
|
|
4732
|
-
} else {
|
|
4733
|
-
initial.push(item);
|
|
4734
|
-
}
|
|
4735
|
-
}
|
|
4736
4740
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/resolver/index.ts
|
|
4737
4741
|
var withContext = function(model) {
|
|
4738
4742
|
return {
|
|
@@ -4856,7 +4860,7 @@ var Player = function() {
|
|
|
4856
4860
|
key: "computeTree",
|
|
4857
4861
|
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4858
4862
|
var _this = this;
|
|
4859
|
-
var _partiallyResolvedParent_parent;
|
|
4863
|
+
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4860
4864
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4861
4865
|
dependencyModel.trackSubset("core");
|
|
4862
4866
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4882,7 +4886,8 @@ var Player = function() {
|
|
|
4882
4886
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4883
4887
|
type: "empty" /* Empty */
|
|
4884
4888
|
};
|
|
4885
|
-
var
|
|
4889
|
+
var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" /* MultiNode */ && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : (_partiallyResolvedParent_parent_parent = _partiallyResolvedParent_parent.parent) === null || _partiallyResolvedParent_parent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent_parent.type) === "multi-node" /* MultiNode */ && partiallyResolvedParent.parent.type === "value" /* Value */ && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" /* Asset */ && resolvedAST.parent.value.id.includes("async");
|
|
4890
|
+
var isNestedMultiNode = resolvedAST.type === "multi-node" /* MultiNode */ && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" /* MultiNode */ && partiallyResolvedParent.type === "value" /* Value */ ;
|
|
4886
4891
|
if (previousResult && shouldUseLastValue) {
|
|
4887
4892
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4888
4893
|
updated: false
|
|
@@ -4916,7 +4921,11 @@ var Player = function() {
|
|
|
4916
4921
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4917
4922
|
return update2;
|
|
4918
4923
|
}
|
|
4919
|
-
|
|
4924
|
+
if (isNestedMultiNodeWithAsync) {
|
|
4925
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
4926
|
+
} else {
|
|
4927
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4928
|
+
}
|
|
4920
4929
|
resolveOptions.node = resolvedAST;
|
|
4921
4930
|
this.ASTMap.set(resolvedAST, node);
|
|
4922
4931
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -4951,6 +4960,11 @@ var Player = function() {
|
|
|
4951
4960
|
} else if (resolvedAST.type === "multi-node" /* MultiNode */ ) {
|
|
4952
4961
|
var childValue = [];
|
|
4953
4962
|
var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
|
|
4963
|
+
var hasAsync = resolvedAST.values.map(function(value, index) {
|
|
4964
|
+
return value.type === "async" /* Async */ ? index : -1;
|
|
4965
|
+
}).filter(function(index) {
|
|
4966
|
+
return index !== -1;
|
|
4967
|
+
});
|
|
4954
4968
|
var newValues = resolvedAST.values.map(function(mValue) {
|
|
4955
4969
|
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4956
4970
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
@@ -4966,7 +4980,19 @@ var Player = function() {
|
|
|
4966
4980
|
updated = updated || mTree.updated;
|
|
4967
4981
|
return mTree.node;
|
|
4968
4982
|
});
|
|
4969
|
-
|
|
4983
|
+
if (hasAsync.length > 0) {
|
|
4984
|
+
var copy = newValues;
|
|
4985
|
+
hasAsync.forEach(function(index) {
|
|
4986
|
+
var _copy;
|
|
4987
|
+
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
4988
|
+
index,
|
|
4989
|
+
1
|
|
4990
|
+
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
4991
|
+
});
|
|
4992
|
+
resolvedAST.values = copy;
|
|
4993
|
+
} else {
|
|
4994
|
+
resolvedAST.values = newValues;
|
|
4995
|
+
}
|
|
4970
4996
|
resolved = childValue;
|
|
4971
4997
|
}
|
|
4972
4998
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -4995,6 +5021,15 @@ var Player = function() {
|
|
|
4995
5021
|
]);
|
|
4996
5022
|
return Resolver;
|
|
4997
5023
|
}();
|
|
5024
|
+
function unpackAndPush(item, initial) {
|
|
5025
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
5026
|
+
item.asset.values.forEach(function(i) {
|
|
5027
|
+
unpackAndPush(i, initial);
|
|
5028
|
+
});
|
|
5029
|
+
} else {
|
|
5030
|
+
initial.push(item);
|
|
5031
|
+
}
|
|
5032
|
+
}
|
|
4998
5033
|
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/core/player/src/view/view.ts
|
|
4999
5034
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
5000
5035
|
function CrossfieldProvider(initialView, parser, logger) {
|