page-transition 0.1.0-beta.13 → 0.1.0-beta.15

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.
@@ -43,10 +43,15 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
43
43
  const pop = useTransitionEndObj({
44
44
  transitionEndData,
45
45
  fn: () => {
46
+ console.log('pop transitionEnd called');
47
+ console.log(checkTransitionFinish(transitionEndData.current, () => { }));
46
48
  state.current = 'navigating';
47
49
  window.scrollTo(0, window.history.state.scrollY ?? 0);
50
+ console.log('pop transitionEnd called after scrollTo');
48
51
  resolveFn.current?.();
52
+ console.log('pop transitionEnd called after resolveFn');
49
53
  setPromise(null);
54
+ useUse.current = false;
50
55
  }
51
56
  });
52
57
  useEffect(() => {
@@ -55,8 +60,10 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
55
60
  resolveFn.current = resolve;
56
61
  resolveUseFn.current = reject;
57
62
  new Promise((resolveNavigating) => {
58
- if (state.current === "navigating" || state.current === "exiting") {
63
+ if (state.current === "navigating") {
64
+ console.log('state.current === "navigating"');
59
65
  if (currentPathname.current !== window.location.pathname) {
66
+ console.log('currentPathname.current !== window.location.pathname');
60
67
  if (checkTransitionFinish(transitionEndData.current, () => {
61
68
  resolveFn.current?.();
62
69
  setPromise(null);
@@ -64,6 +71,7 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
64
71
  return;
65
72
  }
66
73
  else if (currentPathname.current === window.location.pathname) {
74
+ console.log('currentPathname.current === window.location.pathname');
67
75
  if (checkTransitionFinish(transitionEndData.current, afterExitFn.current)) {
68
76
  return;
69
77
  }
@@ -73,10 +81,13 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
73
81
  }
74
82
  }
75
83
  else {
84
+ console.log('not navigating');
76
85
  resolveNavigating();
77
86
  }
78
87
  }).then(() => {
88
+ console.log('after resolveNavigating', 'state:', state.current);
79
89
  if (currentPathname.current === window.location.pathname) {
90
+ console.log('currentPathname.current === window.location.pathname');
80
91
  transitionEnd({
81
92
  transitionEndObj: afterExit,
82
93
  transitionEndHandler,
@@ -91,6 +102,8 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
91
102
  reverse,
92
103
  delay
93
104
  });
105
+ console.log('transitionEnd called Pop');
106
+ console.log(checkTransitionFinish(transitionEndData.current, () => { }));
94
107
  container.current?.classList.remove('enter');
95
108
  container.current?.classList.add('exit');
96
109
  state.current = 'exiting';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-transition",
3
- "version": "0.1.0-beta.13",
3
+ "version": "0.1.0-beta.15",
4
4
  "description": "A page transition library for the Next.js App Router.",
5
5
  "license": "MIT",
6
6
  "files": [