@player-ui/stage-revert-data-plugin 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.
|
@@ -1405,6 +1405,22 @@ var StageRevertDataPlugin = 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
|
};
|
|
@@ -4395,15 +4411,6 @@ var StageRevertDataPlugin = function() {
|
|
|
4395
4411
|
]);
|
|
4396
4412
|
return Parser;
|
|
4397
4413
|
}();
|
|
4398
|
-
function unpackAndPush(item, initial) {
|
|
4399
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
4400
|
-
item.asset.values.forEach(function(i) {
|
|
4401
|
-
unpackAndPush(i, initial);
|
|
4402
|
-
});
|
|
4403
|
-
} else {
|
|
4404
|
-
initial.push(item);
|
|
4405
|
-
}
|
|
4406
|
-
}
|
|
4407
4414
|
var withContext = function(model) {
|
|
4408
4415
|
return {
|
|
4409
4416
|
get: function(binding, options) {
|
|
@@ -4526,7 +4533,7 @@ var StageRevertDataPlugin = function() {
|
|
|
4526
4533
|
key: "computeTree",
|
|
4527
4534
|
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4528
4535
|
var _this = this;
|
|
4529
|
-
var _partiallyResolvedParent_parent;
|
|
4536
|
+
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4530
4537
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4531
4538
|
dependencyModel.trackSubset("core");
|
|
4532
4539
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4552,7 +4559,8 @@ var StageRevertDataPlugin = function() {
|
|
|
4552
4559
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4553
4560
|
type: "empty"
|
|
4554
4561
|
};
|
|
4555
|
-
var
|
|
4562
|
+
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");
|
|
4563
|
+
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";
|
|
4556
4564
|
if (previousResult && shouldUseLastValue) {
|
|
4557
4565
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4558
4566
|
updated: false
|
|
@@ -4586,7 +4594,11 @@ var StageRevertDataPlugin = function() {
|
|
|
4586
4594
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4587
4595
|
return update2;
|
|
4588
4596
|
}
|
|
4589
|
-
|
|
4597
|
+
if (isNestedMultiNodeWithAsync) {
|
|
4598
|
+
resolvedAST.parent = partiallyResolvedParent.parent;
|
|
4599
|
+
} else {
|
|
4600
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4601
|
+
}
|
|
4590
4602
|
resolveOptions.node = resolvedAST;
|
|
4591
4603
|
this.ASTMap.set(resolvedAST, node);
|
|
4592
4604
|
var resolved = this.hooks.resolve.call(void 0, resolvedAST, resolveOptions);
|
|
@@ -4621,6 +4633,11 @@ var StageRevertDataPlugin = function() {
|
|
|
4621
4633
|
} else if (resolvedAST.type === "multi-node") {
|
|
4622
4634
|
var childValue = [];
|
|
4623
4635
|
var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
|
|
4636
|
+
var hasAsync = resolvedAST.values.map(function(value, index) {
|
|
4637
|
+
return value.type === "async" ? index : -1;
|
|
4638
|
+
}).filter(function(index) {
|
|
4639
|
+
return index !== -1;
|
|
4640
|
+
});
|
|
4624
4641
|
var newValues = resolvedAST.values.map(function(mValue) {
|
|
4625
4642
|
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4626
4643
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
@@ -4636,7 +4653,19 @@ var StageRevertDataPlugin = function() {
|
|
|
4636
4653
|
updated = updated || mTree.updated;
|
|
4637
4654
|
return mTree.node;
|
|
4638
4655
|
});
|
|
4639
|
-
|
|
4656
|
+
if (hasAsync.length > 0) {
|
|
4657
|
+
var copy = newValues;
|
|
4658
|
+
hasAsync.forEach(function(index) {
|
|
4659
|
+
var _copy;
|
|
4660
|
+
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
4661
|
+
index,
|
|
4662
|
+
1
|
|
4663
|
+
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
4664
|
+
});
|
|
4665
|
+
resolvedAST.values = copy;
|
|
4666
|
+
} else {
|
|
4667
|
+
resolvedAST.values = newValues;
|
|
4668
|
+
}
|
|
4640
4669
|
resolved = childValue;
|
|
4641
4670
|
}
|
|
4642
4671
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -4665,6 +4694,15 @@ var StageRevertDataPlugin = function() {
|
|
|
4665
4694
|
]);
|
|
4666
4695
|
return Resolver;
|
|
4667
4696
|
}();
|
|
4697
|
+
function unpackAndPush(item, initial) {
|
|
4698
|
+
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
4699
|
+
item.asset.values.forEach(function(i) {
|
|
4700
|
+
unpackAndPush(i, initial);
|
|
4701
|
+
});
|
|
4702
|
+
} else {
|
|
4703
|
+
initial.push(item);
|
|
4704
|
+
}
|
|
4705
|
+
}
|
|
4668
4706
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
4669
4707
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
4670
4708
|
_class_call_check(this, CrossfieldProvider);
|