@player-ui/stage-revert-data-plugin 0.13.0 → 0.14.0-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.
|
@@ -1454,22 +1454,6 @@ var StageRevertDataPlugin = function() {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
});
|
|
1456
1456
|
};
|
|
1457
|
-
var unpackNode = function unpackNode(item) {
|
|
1458
|
-
var _item_children_, _item_children, _item_children_1, _item_children1;
|
|
1459
|
-
var unpacked = [];
|
|
1460
|
-
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) {
|
|
1461
|
-
var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
|
|
1462
|
-
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") {
|
|
1463
|
-
var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
|
|
1464
|
-
((_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) {
|
|
1465
|
-
unpacked.push(value);
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
} else {
|
|
1469
|
-
unpacked.push(item);
|
|
1470
|
-
}
|
|
1471
|
-
return unpacked;
|
|
1472
|
-
};
|
|
1473
1457
|
var hasSomethingToResolve = function hasSomethingToResolve(str) {
|
|
1474
1458
|
return bindingResolveLookup(str) || expressionResolveLookup(str);
|
|
1475
1459
|
};
|
|
@@ -2729,6 +2713,7 @@ var StageRevertDataPlugin = function() {
|
|
|
2729
2713
|
}
|
|
2730
2714
|
};
|
|
2731
2715
|
var identifier = function() {
|
|
2716
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2732
2717
|
if (!isIdentifierChar(ch)) {
|
|
2733
2718
|
return;
|
|
2734
2719
|
}
|
|
@@ -2739,6 +2724,14 @@ var StageRevertDataPlugin = function() {
|
|
|
2739
2724
|
}
|
|
2740
2725
|
value += ch;
|
|
2741
2726
|
}
|
|
2727
|
+
if (allowBoolValue) {
|
|
2728
|
+
if (value === "true") {
|
|
2729
|
+
return toValue(true);
|
|
2730
|
+
}
|
|
2731
|
+
if (value === "false") {
|
|
2732
|
+
return toValue(false);
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2742
2735
|
if (value) {
|
|
2743
2736
|
var maybeNumber = Number(value);
|
|
2744
2737
|
value = isNaN(maybeNumber) ? value : maybeNumber;
|
|
@@ -2787,8 +2780,9 @@ var StageRevertDataPlugin = function() {
|
|
|
2787
2780
|
}
|
|
2788
2781
|
};
|
|
2789
2782
|
var simpleSegment = function() {
|
|
2783
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2790
2784
|
var _nestedPath, _ref;
|
|
2791
|
-
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier();
|
|
2785
|
+
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
|
|
2792
2786
|
};
|
|
2793
2787
|
var segment = function() {
|
|
2794
2788
|
var segments = [];
|
|
@@ -2803,6 +2797,7 @@ var StageRevertDataPlugin = function() {
|
|
|
2803
2797
|
return toConcatenatedNode(segments);
|
|
2804
2798
|
};
|
|
2805
2799
|
var optionallyQuotedSegment = function() {
|
|
2800
|
+
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2806
2801
|
whitespace();
|
|
2807
2802
|
if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
|
|
2808
2803
|
var singleQuote = ch === SINGLE_QUOTE;
|
|
@@ -2811,7 +2806,7 @@ var StageRevertDataPlugin = function() {
|
|
|
2811
2806
|
next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
|
|
2812
2807
|
return id;
|
|
2813
2808
|
}
|
|
2814
|
-
return simpleSegment();
|
|
2809
|
+
return simpleSegment(allowBoolValue);
|
|
2815
2810
|
};
|
|
2816
2811
|
var equals = function() {
|
|
2817
2812
|
if (ch !== EQUALS) {
|
|
@@ -2831,7 +2826,7 @@ var StageRevertDataPlugin = function() {
|
|
|
2831
2826
|
whitespace();
|
|
2832
2827
|
if (equals()) {
|
|
2833
2828
|
whitespace();
|
|
2834
|
-
var second = optionallyQuotedSegment();
|
|
2829
|
+
var second = optionallyQuotedSegment(true);
|
|
2835
2830
|
value = toQuery(value, second);
|
|
2836
2831
|
whitespace();
|
|
2837
2832
|
}
|
|
@@ -3019,7 +3014,7 @@ var StageRevertDataPlugin = function() {
|
|
|
3019
3014
|
appendPathSegments(getValueForNode(resolvedNode));
|
|
3020
3015
|
break;
|
|
3021
3016
|
case "Value":
|
|
3022
|
-
appendPathSegments(resolvedNode.value);
|
|
3017
|
+
appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
|
|
3023
3018
|
break;
|
|
3024
3019
|
case "Query":
|
|
3025
3020
|
{
|
|
@@ -4586,23 +4581,8 @@ var StageRevertDataPlugin = function() {
|
|
|
4586
4581
|
function Parser() {
|
|
4587
4582
|
_class_call_check(this, Parser);
|
|
4588
4583
|
this.hooks = {
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
*
|
|
4592
|
-
* @param value - The object we're are about to parse
|
|
4593
|
-
* @returns - A new value to parse.
|
|
4594
|
-
* If undefined, the original value is used.
|
|
4595
|
-
* If null, we stop parsing this node.
|
|
4596
|
-
*/ onParseObject: new SyncWaterfallHook(),
|
|
4597
|
-
/**
|
|
4598
|
-
* A callback to interact with an AST _after_ we parse it into the AST
|
|
4599
|
-
*
|
|
4600
|
-
* @param value - The object we parsed
|
|
4601
|
-
* @param node - The AST node we generated
|
|
4602
|
-
* @returns - A new AST node to use
|
|
4603
|
-
* If undefined, the original value is used.
|
|
4604
|
-
* If null, we ignore this node all together
|
|
4605
|
-
*/ onCreateASTNode: new SyncWaterfallHook(),
|
|
4584
|
+
onParseObject: new SyncWaterfallHook(),
|
|
4585
|
+
onCreateASTNode: new SyncWaterfallHook(),
|
|
4606
4586
|
parseNode: new SyncBailHook()
|
|
4607
4587
|
};
|
|
4608
4588
|
}
|
|
@@ -4744,20 +4724,14 @@ var StageRevertDataPlugin = function() {
|
|
|
4744
4724
|
function Resolver(root, options) {
|
|
4745
4725
|
_class_call_check(this, Resolver);
|
|
4746
4726
|
this.hooks = {
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
*/ resolve: new SyncWaterfallHook(),
|
|
4756
|
-
/**
|
|
4757
|
-
* A hook to transform the resolved value of an AST node.
|
|
4758
|
-
* This runs _after_ all children nodes are resolved
|
|
4759
|
-
*/ afterResolve: new SyncWaterfallHook(),
|
|
4760
|
-
/** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
|
|
4727
|
+
skipResolve: new SyncWaterfallHook(),
|
|
4728
|
+
beforeUpdate: new SyncHook(),
|
|
4729
|
+
afterUpdate: new SyncHook(),
|
|
4730
|
+
resolveOptions: new SyncWaterfallHook(),
|
|
4731
|
+
beforeResolve: new SyncWaterfallHook(),
|
|
4732
|
+
resolve: new SyncWaterfallHook(),
|
|
4733
|
+
afterResolve: new SyncWaterfallHook(),
|
|
4734
|
+
afterNodeUpdate: new SyncHook()
|
|
4761
4735
|
};
|
|
4762
4736
|
this.root = root;
|
|
4763
4737
|
this.options = options;
|
|
@@ -4765,6 +4739,7 @@ var StageRevertDataPlugin = function() {
|
|
|
4765
4739
|
this.ASTMap = /* @__PURE__ */ new Map();
|
|
4766
4740
|
this.logger = options.logger;
|
|
4767
4741
|
this.idCache = /* @__PURE__ */ new Set();
|
|
4742
|
+
this.AsyncIdMap = /* @__PURE__ */ new Map();
|
|
4768
4743
|
}
|
|
4769
4744
|
_create_class(Resolver, [
|
|
4770
4745
|
{
|
|
@@ -4775,13 +4750,27 @@ var StageRevertDataPlugin = function() {
|
|
|
4775
4750
|
},
|
|
4776
4751
|
{
|
|
4777
4752
|
key: "update",
|
|
4778
|
-
value: function update(changes) {
|
|
4753
|
+
value: function update(changes, asyncChanges) {
|
|
4754
|
+
var _this = this;
|
|
4779
4755
|
this.hooks.beforeUpdate.call(changes);
|
|
4780
4756
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
4781
4757
|
this.idCache.clear();
|
|
4782
4758
|
var prevASTMap = new Map(this.ASTMap);
|
|
4783
4759
|
this.ASTMap.clear();
|
|
4784
|
-
var
|
|
4760
|
+
var prevAsyncIdMap = new Map(this.AsyncIdMap);
|
|
4761
|
+
var nextAsyncIdMap = /* @__PURE__ */ new Map();
|
|
4762
|
+
asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
|
|
4763
|
+
var current = prevAsyncIdMap.get(id);
|
|
4764
|
+
while(current && prevASTMap.has(current)){
|
|
4765
|
+
var next = prevASTMap.get(current);
|
|
4766
|
+
if (next && _this.resolveCache.has(next)) {
|
|
4767
|
+
_this.resolveCache.delete(next);
|
|
4768
|
+
}
|
|
4769
|
+
current = current.parent;
|
|
4770
|
+
}
|
|
4771
|
+
});
|
|
4772
|
+
var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
|
|
4773
|
+
this.AsyncIdMap = nextAsyncIdMap;
|
|
4785
4774
|
this.resolveCache = resolveCache;
|
|
4786
4775
|
this.hooks.afterUpdate.call(updated.value);
|
|
4787
4776
|
return updated.value;
|
|
@@ -4835,9 +4824,8 @@ var StageRevertDataPlugin = function() {
|
|
|
4835
4824
|
},
|
|
4836
4825
|
{
|
|
4837
4826
|
key: "computeTree",
|
|
4838
|
-
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
|
|
4827
|
+
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
|
|
4839
4828
|
var _this = this;
|
|
4840
|
-
var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
|
|
4841
4829
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4842
4830
|
dependencyModel.trackSubset("core");
|
|
4843
4831
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4856,15 +4844,6 @@ var StageRevertDataPlugin = function() {
|
|
|
4856
4844
|
var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
|
|
4857
4845
|
var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
|
|
4858
4846
|
var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
|
|
4859
|
-
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4860
|
-
parent: partiallyResolvedParent
|
|
4861
|
-
});
|
|
4862
|
-
var _this_hooks_beforeResolve_call;
|
|
4863
|
-
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4864
|
-
type: "empty"
|
|
4865
|
-
};
|
|
4866
|
-
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");
|
|
4867
|
-
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";
|
|
4868
4847
|
if (previousResult && shouldUseLastValue) {
|
|
4869
4848
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4870
4849
|
updated: false
|
|
@@ -4876,6 +4855,30 @@ var StageRevertDataPlugin = function() {
|
|
|
4876
4855
|
updated: false
|
|
4877
4856
|
});
|
|
4878
4857
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
4858
|
+
if (resolvedUpdate.node.type === "async") {
|
|
4859
|
+
nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
|
|
4860
|
+
}
|
|
4861
|
+
var _resolvedUpdate_node_asyncNodesResolved;
|
|
4862
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4863
|
+
try {
|
|
4864
|
+
for(var _iterator = ((_resolvedUpdate_node_asyncNodesResolved = resolvedUpdate.node.asyncNodesResolved) !== null && _resolvedUpdate_node_asyncNodesResolved !== void 0 ? _resolvedUpdate_node_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4865
|
+
var key = _step.value;
|
|
4866
|
+
nextAsyncIdMap.set(key, resolvedUpdate.node);
|
|
4867
|
+
}
|
|
4868
|
+
} catch (err) {
|
|
4869
|
+
_didIteratorError = true;
|
|
4870
|
+
_iteratorError = err;
|
|
4871
|
+
} finally{
|
|
4872
|
+
try {
|
|
4873
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4874
|
+
_iterator.return();
|
|
4875
|
+
}
|
|
4876
|
+
} finally{
|
|
4877
|
+
if (_didIteratorError) {
|
|
4878
|
+
throw _iteratorError;
|
|
4879
|
+
}
|
|
4880
|
+
}
|
|
4881
|
+
}
|
|
4879
4882
|
var handleChildNode = function(childNode) {
|
|
4880
4883
|
var _prevASTMap_get;
|
|
4881
4884
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
@@ -4898,10 +4901,37 @@ var StageRevertDataPlugin = function() {
|
|
|
4898
4901
|
repopulateASTMapFromCache(previousResult, node, rawParent);
|
|
4899
4902
|
return update2;
|
|
4900
4903
|
}
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
}
|
|
4904
|
-
|
|
4904
|
+
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4905
|
+
parent: partiallyResolvedParent
|
|
4906
|
+
});
|
|
4907
|
+
var _this_hooks_beforeResolve_call;
|
|
4908
|
+
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4909
|
+
type: "empty"
|
|
4910
|
+
};
|
|
4911
|
+
resolvedAST.parent = partiallyResolvedParent;
|
|
4912
|
+
if (resolvedAST.type === "async") {
|
|
4913
|
+
nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
|
|
4914
|
+
}
|
|
4915
|
+
var _resolvedAST_asyncNodesResolved;
|
|
4916
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4917
|
+
try {
|
|
4918
|
+
for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4919
|
+
var id = _step.value;
|
|
4920
|
+
nextAsyncIdMap.set(id, resolvedAST);
|
|
4921
|
+
}
|
|
4922
|
+
} catch (err) {
|
|
4923
|
+
_didIteratorError = true;
|
|
4924
|
+
_iteratorError = err;
|
|
4925
|
+
} finally{
|
|
4926
|
+
try {
|
|
4927
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4928
|
+
_iterator.return();
|
|
4929
|
+
}
|
|
4930
|
+
} finally{
|
|
4931
|
+
if (_didIteratorError) {
|
|
4932
|
+
throw _iteratorError;
|
|
4933
|
+
}
|
|
4934
|
+
}
|
|
4905
4935
|
}
|
|
4906
4936
|
resolveOptions.node = resolvedAST;
|
|
4907
4937
|
this.ASTMap.set(resolvedAST, node);
|
|
@@ -4915,7 +4945,7 @@ var StageRevertDataPlugin = function() {
|
|
|
4915
4945
|
if ("children" in resolvedAST) {
|
|
4916
4946
|
var _resolvedAST_children;
|
|
4917
4947
|
var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
|
|
4918
|
-
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4948
|
+
var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
4919
4949
|
var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
|
|
4920
4950
|
childTreeDeps.forEach(function(binding) {
|
|
4921
4951
|
return childDependencies.add(binding);
|
|
@@ -4936,40 +4966,18 @@ var StageRevertDataPlugin = function() {
|
|
|
4936
4966
|
resolvedAST.children = newChildren;
|
|
4937
4967
|
} else if (resolvedAST.type === "multi-node") {
|
|
4938
4968
|
var childValue = [];
|
|
4939
|
-
var rawParentToPassIn =
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
}).filter(function(index) {
|
|
4943
|
-
return index !== -1;
|
|
4944
|
-
});
|
|
4945
|
-
var newValues = resolvedAST.values.map(function(mValue) {
|
|
4946
|
-
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
|
|
4969
|
+
var rawParentToPassIn = node;
|
|
4970
|
+
resolvedAST.values = resolvedAST.values.map(function(mValue) {
|
|
4971
|
+
var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
|
|
4947
4972
|
if (mTree.value !== void 0 && mTree.value !== null) {
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
}
|
|
4951
|
-
|
|
4952
|
-
|
|
4973
|
+
mTree.dependencies.forEach(function(bindingDep) {
|
|
4974
|
+
return childDependencies.add(bindingDep);
|
|
4975
|
+
});
|
|
4976
|
+
updated = updated || mTree.updated;
|
|
4977
|
+
childValue.push(mTree.value);
|
|
4953
4978
|
}
|
|
4954
|
-
mTree.dependencies.forEach(function(bindingDep) {
|
|
4955
|
-
return childDependencies.add(bindingDep);
|
|
4956
|
-
});
|
|
4957
|
-
updated = updated || mTree.updated;
|
|
4958
4979
|
return mTree.node;
|
|
4959
4980
|
});
|
|
4960
|
-
if (hasAsync.length > 0) {
|
|
4961
|
-
var copy = newValues;
|
|
4962
|
-
hasAsync.forEach(function(index) {
|
|
4963
|
-
var _copy;
|
|
4964
|
-
if (copy[index]) (_copy = copy).splice.apply(_copy, [
|
|
4965
|
-
index,
|
|
4966
|
-
1
|
|
4967
|
-
].concat(_to_consumable_array(unpackNode(copy[index]))));
|
|
4968
|
-
});
|
|
4969
|
-
resolvedAST.values = copy;
|
|
4970
|
-
} else {
|
|
4971
|
-
resolvedAST.values = newValues;
|
|
4972
|
-
}
|
|
4973
4981
|
resolved = childValue;
|
|
4974
4982
|
}
|
|
4975
4983
|
childDependencies.forEach(function(bindingDep) {
|
|
@@ -4990,7 +4998,7 @@ var StageRevertDataPlugin = function() {
|
|
|
4990
4998
|
value: resolved,
|
|
4991
4999
|
dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
|
|
4992
5000
|
};
|
|
4993
|
-
this.hooks.afterNodeUpdate.call(node,
|
|
5001
|
+
this.hooks.afterNodeUpdate.call(node, rawParent, update);
|
|
4994
5002
|
cacheUpdate.set(node, update);
|
|
4995
5003
|
return update;
|
|
4996
5004
|
}
|
|
@@ -4998,15 +5006,6 @@ var StageRevertDataPlugin = function() {
|
|
|
4998
5006
|
]);
|
|
4999
5007
|
return Resolver;
|
|
5000
5008
|
}();
|
|
5001
|
-
function unpackAndPush(item, initial) {
|
|
5002
|
-
if (item.asset.values && Array.isArray(item.asset.values)) {
|
|
5003
|
-
item.asset.values.forEach(function(i) {
|
|
5004
|
-
unpackAndPush(i, initial);
|
|
5005
|
-
});
|
|
5006
|
-
} else {
|
|
5007
|
-
initial.push(item);
|
|
5008
|
-
}
|
|
5009
|
-
}
|
|
5010
5009
|
var CrossfieldProvider = /*#__PURE__*/ function() {
|
|
5011
5010
|
function CrossfieldProvider(initialView, parser, logger) {
|
|
5012
5011
|
_class_call_check(this, CrossfieldProvider);
|
|
@@ -5074,9 +5073,11 @@ var StageRevertDataPlugin = function() {
|
|
|
5074
5073
|
_create_class(ViewInstance, [
|
|
5075
5074
|
{
|
|
5076
5075
|
key: "updateAsync",
|
|
5077
|
-
value: function updateAsync() {
|
|
5076
|
+
value: function updateAsync(asyncNode) {
|
|
5078
5077
|
var _this_resolver;
|
|
5079
|
-
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update()
|
|
5078
|
+
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
|
|
5079
|
+
asyncNode
|
|
5080
|
+
]));
|
|
5080
5081
|
this.lastUpdate = update;
|
|
5081
5082
|
this.hooks.onUpdate.call(update);
|
|
5082
5083
|
}
|
|
@@ -5617,7 +5618,7 @@ var StageRevertDataPlugin = function() {
|
|
|
5617
5618
|
key: "applyParser",
|
|
5618
5619
|
value: function applyParser(parser) {
|
|
5619
5620
|
parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
|
|
5620
|
-
if (childOptions
|
|
5621
|
+
if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
|
|
5621
5622
|
var values = obj.map(function(childVal) {
|
|
5622
5623
|
return parser.parseObject(childVal, "value", options);
|
|
5623
5624
|
}).filter(function(child) {
|
|
@@ -5628,7 +5629,7 @@ var StageRevertDataPlugin = function() {
|
|
|
5628
5629
|
}
|
|
5629
5630
|
var multiNode = parser.createASTNode({
|
|
5630
5631
|
type: "multi-node",
|
|
5631
|
-
override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5632
|
+
override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
|
|
5632
5633
|
values: values
|
|
5633
5634
|
}, obj);
|
|
5634
5635
|
if (!multiNode) {
|
|
@@ -5639,7 +5640,7 @@ var StageRevertDataPlugin = function() {
|
|
|
5639
5640
|
v.parent = multiNode;
|
|
5640
5641
|
});
|
|
5641
5642
|
}
|
|
5642
|
-
return [
|
|
5643
|
+
return childOptions === void 0 ? multiNode : [
|
|
5643
5644
|
{
|
|
5644
5645
|
path: _to_consumable_array(childOptions.path).concat([
|
|
5645
5646
|
childOptions.key
|