@player-ui/common-types-plugin 0.8.0 → 0.8.1--canary.471.16612

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.hooks.onUpdate.call(update);
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.hooks.onUpdate.call(update);
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
  },
@@ -6685,6 +6699,14 @@ var CommonTypesPlugin = function() {
6685
6699
  });
6686
6700
  }
6687
6701
  _create_class(ViewController, [
6702
+ {
6703
+ key: "setViewsTransition",
6704
+ value: function setViewsTransition(transition) {
6705
+ var _this_previousView, _this_currentView;
6706
+ (_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
6707
+ (_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
6708
+ }
6709
+ },
6688
6710
  {
6689
6711
  key: "queueUpdate",
6690
6712
  value: function queueUpdate(bindings) {
@@ -6736,10 +6758,12 @@ var CommonTypesPlugin = function() {
6736
6758
  if (!source) {
6737
6759
  throw new Error("No view with id ".concat(viewId));
6738
6760
  }
6761
+ this.previousView = this.currentView;
6739
6762
  var view = new ViewInstance(source, this.viewOptions);
6740
6763
  this.currentView = view;
6764
+ this.setViewsTransition(true);
6741
6765
  this.hooks.view.call(view);
6742
- view.update();
6766
+ view.update(void 0, true);
6743
6767
  }
6744
6768
  }
6745
6769
  ]);