@player-ui/check-path-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.
@@ -4761,6 +4761,7 @@ var CheckPathPlugin = function() {
4761
4761
  onTemplatePluginCreated: new SyncHook(),
4762
4762
  templatePlugin: new SyncHook()
4763
4763
  };
4764
+ this.transitioning = true;
4764
4765
  this.initialView = initialView;
4765
4766
  this.resolverOptions = resolverOptions;
4766
4767
  this.hooks.onTemplatePluginCreated.tap("view", function(templatePlugin) {
@@ -4768,18 +4769,28 @@ var CheckPathPlugin = function() {
4768
4769
  });
4769
4770
  }
4770
4771
  _create_class(ViewInstance, [
4772
+ {
4773
+ key: "setTransition",
4774
+ value: function setTransition(isTransitioning) {
4775
+ this.transitioning = isTransitioning;
4776
+ }
4777
+ },
4771
4778
  {
4772
4779
  key: "updateAsync",
4773
4780
  value: function updateAsync() {
4781
+ var fromTransitioning = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4774
4782
  var _this_resolver;
4775
4783
  var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
4776
4784
  this.lastUpdate = update;
4777
- this.hooks.onUpdate.call(update);
4785
+ if (!this.transitioning || this.transitioning && fromTransitioning) {
4786
+ this.hooks.onUpdate.call(update);
4787
+ }
4778
4788
  }
4779
4789
  },
4780
4790
  {
4781
4791
  key: "update",
4782
4792
  value: function update(changes) {
4793
+ var fromTransitioning = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
4783
4794
  var _this_resolver;
4784
4795
  if (this.rootNode === void 0) {
4785
4796
  this.validationProvider = new CrossfieldProvider(this.initialView, this.resolverOptions.parseBinding, this.resolverOptions.logger);
@@ -4802,7 +4813,10 @@ var CheckPathPlugin = function() {
4802
4813
  return this.lastUpdate;
4803
4814
  }
4804
4815
  this.lastUpdate = update;
4805
- this.hooks.onUpdate.call(update);
4816
+ if (!this.transitioning || this.transitioning && fromTransitioning) {
4817
+ this.hooks.onUpdate.call(update);
4818
+ }
4819
+ this.transitioning = false;
4806
4820
  return update;
4807
4821
  }
4808
4822
  },
@@ -6606,6 +6620,14 @@ var CheckPathPlugin = function() {
6606
6620
  });
6607
6621
  }
6608
6622
  _create_class(ViewController, [
6623
+ {
6624
+ key: "setViewsTransition",
6625
+ value: function setViewsTransition(transition) {
6626
+ var _this_previousView, _this_currentView;
6627
+ (_this_previousView = this.previousView) === null || _this_previousView === void 0 ? void 0 : _this_previousView.setTransition(transition);
6628
+ (_this_currentView = this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.setTransition(transition);
6629
+ }
6630
+ },
6609
6631
  {
6610
6632
  key: "queueUpdate",
6611
6633
  value: function queueUpdate(bindings) {
@@ -6657,10 +6679,12 @@ var CheckPathPlugin = function() {
6657
6679
  if (!source) {
6658
6680
  throw new Error("No view with id ".concat(viewId));
6659
6681
  }
6682
+ this.previousView = this.currentView;
6660
6683
  var view = new ViewInstance(source, this.viewOptions);
6661
6684
  this.currentView = view;
6685
+ this.setViewsTransition(true);
6662
6686
  this.hooks.view.call(view);
6663
- view.update();
6687
+ view.update(void 0, true);
6664
6688
  }
6665
6689
  }
6666
6690
  ]);