@player-ui/common-types-plugin 0.8.0 → 0.8.1--canary.471.16571
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.
|
@@ -4840,6 +4840,7 @@ var CommonTypesPlugin = function() {
|
|
|
4840
4840
|
onTemplatePluginCreated: new SyncHook(),
|
|
4841
4841
|
templatePlugin: new SyncHook()
|
|
4842
4842
|
};
|
|
4843
|
+
this.transitioning = true;
|
|
4843
4844
|
this.initialView = initialView;
|
|
4844
4845
|
this.resolverOptions = resolverOptions;
|
|
4845
4846
|
this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
|
|
@@ -4847,18 +4848,28 @@ var CommonTypesPlugin = function() {
|
|
|
4847
4848
|
});
|
|
4848
4849
|
}
|
|
4849
4850
|
_create_class(ViewInstance, [
|
|
4851
|
+
{
|
|
4852
|
+
key: "setTransition",
|
|
4853
|
+
value: function setTransition(isTransitioning) {
|
|
4854
|
+
this.transitioning = isTransitioning;
|
|
4855
|
+
}
|
|
4856
|
+
},
|
|
4850
4857
|
{
|
|
4851
4858
|
key: "updateAsync",
|
|
4852
4859
|
value: function updateAsync() {
|
|
4860
|
+
var fromTransitioning = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
4853
4861
|
var _this_resolver;
|
|
4854
4862
|
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
|
|
4855
4863
|
this.lastUpdate = update;
|
|
4856
|
-
this.
|
|
4864
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4865
|
+
this.hooks.onUpdate.call(update);
|
|
4866
|
+
}
|
|
4857
4867
|
}
|
|
4858
4868
|
},
|
|
4859
4869
|
{
|
|
4860
4870
|
key: "update",
|
|
4861
4871
|
value: function update(changes) {
|
|
4872
|
+
var fromTransitioning = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
4862
4873
|
var _this_resolver;
|
|
4863
4874
|
if (this.rootNode === void 0) {
|
|
4864
4875
|
this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
|
|
@@ -4881,7 +4892,10 @@ var CommonTypesPlugin = function() {
|
|
|
4881
4892
|
return this.lastUpdate;
|
|
4882
4893
|
}
|
|
4883
4894
|
this.lastUpdate = update;
|
|
4884
|
-
this.
|
|
4895
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4896
|
+
this.hooks.onUpdate.call(update);
|
|
4897
|
+
}
|
|
4898
|
+
this.transitioning = false;
|
|
4885
4899
|
return update;
|
|
4886
4900
|
}
|
|
4887
4901
|
},
|
|
@@ -6648,11 +6662,15 @@ var CommonTypesPlugin = function() {
|
|
|
6648
6662
|
options.flowController.hooks.flow.tap("viewController", function(flow) {
|
|
6649
6663
|
flow.hooks.transition.tap("viewController", function(_oldState, newState) {
|
|
6650
6664
|
if (newState.value.state_type === "VIEW") {
|
|
6665
|
+
_this.setViewsTransition(true);
|
|
6651
6666
|
_this.onView(newState.value);
|
|
6652
6667
|
} else {
|
|
6653
6668
|
_this.currentView = void 0;
|
|
6654
6669
|
}
|
|
6655
6670
|
});
|
|
6671
|
+
flow.hooks.afterTransition.tap("view", function(flowInstance) {
|
|
6672
|
+
_this.setViewsTransition(false);
|
|
6673
|
+
});
|
|
6656
6674
|
});
|
|
6657
6675
|
var update = function(updates) {
|
|
6658
6676
|
var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
@@ -6685,6 +6703,14 @@ var CommonTypesPlugin = function() {
|
|
|
6685
6703
|
});
|
|
6686
6704
|
}
|
|
6687
6705
|
_create_class(ViewController, [
|
|
6706
|
+
{
|
|
6707
|
+
key: "setViewsTransition",
|
|
6708
|
+
value: function setViewsTransition(transition) {
|
|
6709
|
+
var _this_previousView, _this_currentView;
|
|
6710
|
+
(_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
|
|
6711
|
+
(_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
|
|
6712
|
+
}
|
|
6713
|
+
},
|
|
6688
6714
|
{
|
|
6689
6715
|
key: "queueUpdate",
|
|
6690
6716
|
value: function queueUpdate(bindings) {
|
|
@@ -6736,10 +6762,11 @@ var CommonTypesPlugin = function() {
|
|
|
6736
6762
|
if (!source) {
|
|
6737
6763
|
throw new Error("No view with id ".concat(viewId));
|
|
6738
6764
|
}
|
|
6765
|
+
this.previousView = this.currentView;
|
|
6739
6766
|
var view = new ViewInstance(source, this.viewOptions);
|
|
6740
6767
|
this.currentView = view;
|
|
6741
6768
|
this.hooks.view.call(view);
|
|
6742
|
-
view.update();
|
|
6769
|
+
view.update(void 0, true);
|
|
6743
6770
|
}
|
|
6744
6771
|
}
|
|
6745
6772
|
]);
|