@player-ui/beacon-plugin 0.8.0-next.9 → 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.
|
@@ -4810,6 +4810,7 @@ var BeaconPlugin = function() {
|
|
|
4810
4810
|
onTemplatePluginCreated: new SyncHook(),
|
|
4811
4811
|
templatePlugin: new SyncHook()
|
|
4812
4812
|
};
|
|
4813
|
+
this.transitioning = true;
|
|
4813
4814
|
this.initialView = initialView;
|
|
4814
4815
|
this.resolverOptions = resolverOptions;
|
|
4815
4816
|
this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
|
|
@@ -4817,18 +4818,28 @@ var BeaconPlugin = function() {
|
|
|
4817
4818
|
});
|
|
4818
4819
|
}
|
|
4819
4820
|
_create_class(ViewInstance, [
|
|
4821
|
+
{
|
|
4822
|
+
key: "setTransition",
|
|
4823
|
+
value: function setTransition(isTransitioning) {
|
|
4824
|
+
this.transitioning = isTransitioning;
|
|
4825
|
+
}
|
|
4826
|
+
},
|
|
4820
4827
|
{
|
|
4821
4828
|
key: "updateAsync",
|
|
4822
4829
|
value: function updateAsync() {
|
|
4830
|
+
var fromTransitioning = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
4823
4831
|
var _this_resolver;
|
|
4824
4832
|
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
|
|
4825
4833
|
this.lastUpdate = update;
|
|
4826
|
-
this.
|
|
4834
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4835
|
+
this.hooks.onUpdate.call(update);
|
|
4836
|
+
}
|
|
4827
4837
|
}
|
|
4828
4838
|
},
|
|
4829
4839
|
{
|
|
4830
4840
|
key: "update",
|
|
4831
4841
|
value: function update(changes) {
|
|
4842
|
+
var fromTransitioning = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
4832
4843
|
var _this_resolver;
|
|
4833
4844
|
if (this.rootNode === void 0) {
|
|
4834
4845
|
this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
|
|
@@ -4851,7 +4862,10 @@ var BeaconPlugin = function() {
|
|
|
4851
4862
|
return this.lastUpdate;
|
|
4852
4863
|
}
|
|
4853
4864
|
this.lastUpdate = update;
|
|
4854
|
-
this.
|
|
4865
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4866
|
+
this.hooks.onUpdate.call(update);
|
|
4867
|
+
}
|
|
4868
|
+
this.transitioning = false;
|
|
4855
4869
|
return update;
|
|
4856
4870
|
}
|
|
4857
4871
|
},
|
|
@@ -6618,11 +6632,15 @@ var BeaconPlugin = function() {
|
|
|
6618
6632
|
options.flowController.hooks.flow.tap("viewController", function(flow) {
|
|
6619
6633
|
flow.hooks.transition.tap("viewController", function(_oldState, newState) {
|
|
6620
6634
|
if (newState.value.state_type === "VIEW") {
|
|
6635
|
+
_this.setViewsTransition(true);
|
|
6621
6636
|
_this.onView(newState.value);
|
|
6622
6637
|
} else {
|
|
6623
6638
|
_this.currentView = void 0;
|
|
6624
6639
|
}
|
|
6625
6640
|
});
|
|
6641
|
+
flow.hooks.afterTransition.tap("view", function(flowInstance) {
|
|
6642
|
+
_this.setViewsTransition(false);
|
|
6643
|
+
});
|
|
6626
6644
|
});
|
|
6627
6645
|
var update = function(updates) {
|
|
6628
6646
|
var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
@@ -6655,6 +6673,14 @@ var BeaconPlugin = function() {
|
|
|
6655
6673
|
});
|
|
6656
6674
|
}
|
|
6657
6675
|
_create_class(ViewController, [
|
|
6676
|
+
{
|
|
6677
|
+
key: "setViewsTransition",
|
|
6678
|
+
value: function setViewsTransition(transition) {
|
|
6679
|
+
var _this_previousView, _this_currentView;
|
|
6680
|
+
(_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
|
|
6681
|
+
(_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
|
|
6682
|
+
}
|
|
6683
|
+
},
|
|
6658
6684
|
{
|
|
6659
6685
|
key: "queueUpdate",
|
|
6660
6686
|
value: function queueUpdate(bindings) {
|
|
@@ -6706,10 +6732,11 @@ var BeaconPlugin = function() {
|
|
|
6706
6732
|
if (!source) {
|
|
6707
6733
|
throw new Error("No view with id ".concat(viewId));
|
|
6708
6734
|
}
|
|
6735
|
+
this.previousView = this.currentView;
|
|
6709
6736
|
var view = new ViewInstance(source, this.viewOptions);
|
|
6710
6737
|
this.currentView = view;
|
|
6711
6738
|
this.hooks.view.call(view);
|
|
6712
|
-
view.update();
|
|
6739
|
+
view.update(void 0, true);
|
|
6713
6740
|
}
|
|
6714
6741
|
}
|
|
6715
6742
|
]);
|