@player-ui/metrics-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.
|
@@ -4822,6 +4822,7 @@ var MetricsPlugin = function() {
|
|
|
4822
4822
|
onTemplatePluginCreated: new SyncHook(),
|
|
4823
4823
|
templatePlugin: new SyncHook()
|
|
4824
4824
|
};
|
|
4825
|
+
this.transitioning = true;
|
|
4825
4826
|
this.initialView = initialView;
|
|
4826
4827
|
this.resolverOptions = resolverOptions;
|
|
4827
4828
|
this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
|
|
@@ -4829,18 +4830,28 @@ var MetricsPlugin = function() {
|
|
|
4829
4830
|
});
|
|
4830
4831
|
}
|
|
4831
4832
|
_create_class(ViewInstance, [
|
|
4833
|
+
{
|
|
4834
|
+
key: "setTransition",
|
|
4835
|
+
value: function setTransition(isTransitioning) {
|
|
4836
|
+
this.transitioning = isTransitioning;
|
|
4837
|
+
}
|
|
4838
|
+
},
|
|
4832
4839
|
{
|
|
4833
4840
|
key: "updateAsync",
|
|
4834
4841
|
value: function updateAsync() {
|
|
4842
|
+
var fromTransitioning = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
4835
4843
|
var _this_resolver;
|
|
4836
4844
|
var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
|
|
4837
4845
|
this.lastUpdate = update;
|
|
4838
|
-
this.
|
|
4846
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4847
|
+
this.hooks.onUpdate.call(update);
|
|
4848
|
+
}
|
|
4839
4849
|
}
|
|
4840
4850
|
},
|
|
4841
4851
|
{
|
|
4842
4852
|
key: "update",
|
|
4843
4853
|
value: function update(changes) {
|
|
4854
|
+
var fromTransitioning = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
4844
4855
|
var _this_resolver;
|
|
4845
4856
|
if (this.rootNode === void 0) {
|
|
4846
4857
|
this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
|
|
@@ -4863,7 +4874,10 @@ var MetricsPlugin = function() {
|
|
|
4863
4874
|
return this.lastUpdate;
|
|
4864
4875
|
}
|
|
4865
4876
|
this.lastUpdate = update;
|
|
4866
|
-
this.
|
|
4877
|
+
if (!this.transitioning || this.transitioning && fromTransitioning) {
|
|
4878
|
+
this.hooks.onUpdate.call(update);
|
|
4879
|
+
}
|
|
4880
|
+
this.transitioning = false;
|
|
4867
4881
|
return update;
|
|
4868
4882
|
}
|
|
4869
4883
|
},
|
|
@@ -6630,11 +6644,15 @@ var MetricsPlugin = function() {
|
|
|
6630
6644
|
options.flowController.hooks.flow.tap("viewController", function(flow) {
|
|
6631
6645
|
flow.hooks.transition.tap("viewController", function(_oldState, newState) {
|
|
6632
6646
|
if (newState.value.state_type === "VIEW") {
|
|
6647
|
+
_this.setViewsTransition(true);
|
|
6633
6648
|
_this.onView(newState.value);
|
|
6634
6649
|
} else {
|
|
6635
6650
|
_this.currentView = void 0;
|
|
6636
6651
|
}
|
|
6637
6652
|
});
|
|
6653
|
+
flow.hooks.afterTransition.tap("view", function(flowInstance) {
|
|
6654
|
+
_this.setViewsTransition(false);
|
|
6655
|
+
});
|
|
6638
6656
|
});
|
|
6639
6657
|
var update = function(updates) {
|
|
6640
6658
|
var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
@@ -6667,6 +6685,14 @@ var MetricsPlugin = function() {
|
|
|
6667
6685
|
});
|
|
6668
6686
|
}
|
|
6669
6687
|
_create_class(ViewController, [
|
|
6688
|
+
{
|
|
6689
|
+
key: "setViewsTransition",
|
|
6690
|
+
value: function setViewsTransition(transition) {
|
|
6691
|
+
var _this_previousView, _this_currentView;
|
|
6692
|
+
(_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
|
|
6693
|
+
(_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
|
|
6694
|
+
}
|
|
6695
|
+
},
|
|
6670
6696
|
{
|
|
6671
6697
|
key: "queueUpdate",
|
|
6672
6698
|
value: function queueUpdate(bindings) {
|
|
@@ -6718,10 +6744,11 @@ var MetricsPlugin = function() {
|
|
|
6718
6744
|
if (!source) {
|
|
6719
6745
|
throw new Error("No view with id ".concat(viewId));
|
|
6720
6746
|
}
|
|
6747
|
+
this.previousView = this.currentView;
|
|
6721
6748
|
var view = new ViewInstance(source, this.viewOptions);
|
|
6722
6749
|
this.currentView = view;
|
|
6723
6750
|
this.hooks.view.call(view);
|
|
6724
|
-
view.update();
|
|
6751
|
+
view.update(void 0, true);
|
|
6725
6752
|
}
|
|
6726
6753
|
}
|
|
6727
6754
|
]);
|