@player-ui/async-node-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.
@@ -4803,6 +4803,7 @@ var AsyncNodePlugin = function() {
4803
4803
  onTemplatePluginCreated: new SyncHook(),
4804
4804
  templatePlugin: new SyncHook()
4805
4805
  };
4806
+ this.transitioning = true;
4806
4807
  this.initialView = initialView;
4807
4808
  this.resolverOptions = resolverOptions;
4808
4809
  this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
@@ -4810,18 +4811,28 @@ var AsyncNodePlugin = function() {
4810
4811
  });
4811
4812
  }
4812
4813
  _create_class(ViewInstance, [
4814
+ {
4815
+ key: "setTransition",
4816
+ value: function setTransition(isTransitioning) {
4817
+ this.transitioning = isTransitioning;
4818
+ }
4819
+ },
4813
4820
  {
4814
4821
  key: "updateAsync",
4815
4822
  value: function updateAsync() {
4823
+ var fromTransitioning = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4816
4824
  var _this_resolver;
4817
4825
  var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
4818
4826
  this.lastUpdate = update;
4819
- this.hooks.onUpdate.call(update);
4827
+ if (!this.transitioning || this.transitioning && fromTransitioning) {
4828
+ this.hooks.onUpdate.call(update);
4829
+ }
4820
4830
  }
4821
4831
  },
4822
4832
  {
4823
4833
  key: "update",
4824
4834
  value: function update(changes) {
4835
+ var fromTransitioning = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
4825
4836
  var _this_resolver;
4826
4837
  if (this.rootNode === void 0) {
4827
4838
  this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
@@ -4844,7 +4855,10 @@ var AsyncNodePlugin = function() {
4844
4855
  return this.lastUpdate;
4845
4856
  }
4846
4857
  this.lastUpdate = update;
4847
- this.hooks.onUpdate.call(update);
4858
+ if (!this.transitioning || this.transitioning && fromTransitioning) {
4859
+ this.hooks.onUpdate.call(update);
4860
+ }
4861
+ this.transitioning = false;
4848
4862
  return update;
4849
4863
  }
4850
4864
  },
@@ -6648,6 +6662,14 @@ var AsyncNodePlugin = function() {
6648
6662
  });
6649
6663
  }
6650
6664
  _create_class(ViewController, [
6665
+ {
6666
+ key: "setViewsTransition",
6667
+ value: function setViewsTransition(transition) {
6668
+ var _this_previousView, _this_currentView;
6669
+ (_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
6670
+ (_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
6671
+ }
6672
+ },
6651
6673
  {
6652
6674
  key: "queueUpdate",
6653
6675
  value: function queueUpdate(bindings) {
@@ -6699,10 +6721,12 @@ var AsyncNodePlugin = function() {
6699
6721
  if (!source) {
6700
6722
  throw new Error("No view with id ".concat(viewId));
6701
6723
  }
6724
+ this.previousView = this.currentView;
6702
6725
  var view = new ViewInstance(source, this.viewOptions);
6703
6726
  this.currentView = view;
6727
+ this.setViewsTransition(true);
6704
6728
  this.hooks.view.call(view);
6705
- view.update();
6729
+ view.update(void 0, true);
6706
6730
  }
6707
6731
  }
6708
6732
  ]);