@player-ui/check-path-plugin 0.11.1-next.0 → 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.
|
@@ -1405,6 +1405,22 @@ var CheckPathPlugin = function() {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
});
|
|
1407
1407
|
};
|
|
1408
|
+
var unpackNode = function unpackNode(item) {
|
|
1409
|
+
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1410
|
+
var unpacked = [];
|
|
1411
|
+
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" && ((_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) {
|
|
1412
|
+
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1413
|
+
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") {
|
|
1414
|
+
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1415
|
+
((_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) {
|
|
1416
|
+
unpacked.push(value);
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
} else {
|
|
1420
|
+
unpacked.push(item);
|
|
1421
|
+
}
|
|
1422
|
+
return unpacked;
|
|
1423
|
+
};
|
|
1408
1424
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1409
1425
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1410
1426
|
};
|
|
@@ -4430,15 +4446,6 @@ var CheckPathPlugin = function() {
|
|
|
4430
4446
|
]);
|
|
4431
4447
|
return Parser;
|
|
4432
4448
|
}();
|
|
4433
|
-
function unpackAndPush(item, initial) {
|
|
4434
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
4435
|
-
item.asset.values.forEach(function(i) {
|
|
4436
|
-
unpackAndPush(i, initial);
|
|
4437
|
-
});
|
|
4438
|
-
} else {
|
|
4439
|
-
initial.push(item);
|
|
4440
|
-
}
|
|
4441
|
-
}
|
|
4442
4449
|
var withContext = function(model) {
|
|
4443
4450
|
return {
|
|
4444
4451
|
get: function(binding, options) {
|
|
@@ -4561,7 +4568,7 @@ var CheckPathPlugin = function() {
|
|
|
4561
4568
|
key: "computeTree",
|
|
4562
4569
|
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4563
4570
|
var _this = this;
|
|
4564
|
-
var _partiallyResolvedParent_parent;
|
|
4571
|
+
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4565
4572
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4566
4573
|
dependencyModel.trackSubset("core");
|
|
4567
4574
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4587,7 +4594,8 @@ var CheckPathPlugin = function() {
|
|
|
4587
4594
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4588
4595
|
type: "empty"
|
|
4589
4596
|
};
|
|
4590
|
-
var
|
|
4597
|
+
var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" && (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" && partiallyResolvedParent.parent.type === "value" && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" && resolvedAST.parent.value.id.includes("async");
|
|
4598
|
+
var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" && partiallyResolvedParent.type === "value";
|
|
4591
4599
|
if (previousResult && shouldUseLastValue) {
|
|
4592
4600
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4593
4601
|
updated: false
|
|
@@ -4621,7 +4629,11 @@ var CheckPathPlugin = function() {
|
|
|
4621
4629
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4622
4630
|
return update2;
|
|
4623
4631
|
}
|
|
4624
|
-
|
|
4632
|
+
if (isNestedMultiNodeWithAsync) {
|
|
4633
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
4634
|
+
} else {
|
|
4635
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4636
|
+
}
|
|
4625
4637
|
resolveOptions.node = resolvedAST;
|
|
4626
4638
|
this.ASTMap.set(resolvedAST, node);
|
|
4627
4639
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -4656,6 +4668,11 @@ var CheckPathPlugin = function() {
|
|
|
4656
4668
|
} else if (resolvedAST.type === "multi-node") {
|
|
4657
4669
|
var childValue = [];
|
|
4658
4670
|
var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
|
|
4671
|
+
var hasAsync = resolvedAST.values.map(function(value, index) {
|
|
4672
|
+
return value.type === "async" ? index : -1;
|
|
4673
|
+
}).filter(function(index) {
|
|
4674
|
+
return index !== -1;
|
|
4675
|
+
});
|
|
4659
4676
|
var newValues = resolvedAST.values.map(function(mValue) {
|
|
4660
4677
|
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4661
4678
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
@@ -4671,7 +4688,19 @@ var CheckPathPlugin = function() {
|
|
|
4671
4688
|
updated = updated || mTree.updated;
|
|
4672
4689
|
return mTree.node;
|
|
4673
4690
|
});
|
|
4674
|
-
|
|
4691
|
+
if (hasAsync.length > 0) {
|
|
4692
|
+
var copy = newValues;
|
|
4693
|
+
hasAsync.forEach(function(index) {
|
|
4694
|
+
var _copy;
|
|
4695
|
+
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
4696
|
+
index,
|
|
4697
|
+
1
|
|
4698
|
+
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
4699
|
+
});
|
|
4700
|
+
resolvedAST.values = copy;
|
|
4701
|
+
} else {
|
|
4702
|
+
resolvedAST.values = newValues;
|
|
4703
|
+
}
|
|
4675
4704
|
resolved = childValue;
|
|
4676
4705
|
}
|
|
4677
4706
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -4700,6 +4729,15 @@ var CheckPathPlugin = function() {
|
|
|
4700
4729
|
]);
|
|
4701
4730
|
return Resolver;
|
|
4702
4731
|
}();
|
|
4732
|
+
function unpackAndPush(item, initial) {
|
|
4733
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
4734
|
+
item.asset.values.forEach(function(i) {
|
|
4735
|
+
unpackAndPush(i, initial);
|
|
4736
|
+
});
|
|
4737
|
+
} else {
|
|
4738
|
+
initial.push(item);
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4703
4741
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
4704
4742
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
4705
4743
|
_class_call_check(this, CrossfieldProvider);
|