@player-ui/async-node-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.
@@ -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
  },
@@ -6611,11 +6625,15 @@ var AsyncNodePlugin = function() {
6611
6625
  options.flowController.hooks.flow.tap("viewController", function(flow) {
6612
6626
  flow.hooks.transition.tap("viewController", function(_oldState, newState) {
6613
6627
  if (newState.value.state_type === "VIEW") {
6628
+ _this.setViewsTransition(true);
6614
6629
  _this.onView(newState.value);
6615
6630
  } else {
6616
6631
  _this.currentView = void 0;
6617
6632
  }
6618
6633
  });
6634
+ flow.hooks.afterTransition.tap("view", function(flowInstance) {
6635
+ _this.setViewsTransition(false);
6636
+ });
6619
6637
  });
6620
6638
  var update = function(updates) {
6621
6639
  var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -6648,6 +6666,14 @@ var AsyncNodePlugin = function() {
6648
6666
  });
6649
6667
  }
6650
6668
  _create_class(ViewController, [
6669
+ {
6670
+ key: "setViewsTransition",
6671
+ value: function setViewsTransition(transition) {
6672
+ var _this_previousView, _this_currentView;
6673
+ (_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
6674
+ (_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
6675
+ }
6676
+ },
6651
6677
  {
6652
6678
  key: "queueUpdate",
6653
6679
  value: function queueUpdate(bindings) {
@@ -6699,10 +6725,11 @@ var AsyncNodePlugin = function() {
6699
6725
  if (!source) {
6700
6726
  throw new Error("No view with id ".concat(viewId));
6701
6727
  }
6728
+ this.previousView = this.currentView;
6702
6729
  var view = new ViewInstance(source, this.viewOptions);
6703
6730
  this.currentView = view;
6704
6731
  this.hooks.view.call(view);
6705
- view.update();
6732
+ view.update(void 0, true);
6706
6733
  }
6707
6734
  }
6708
6735
  ]);