page-transition 0.1.0-beta.16 → 0.1.0-beta.18

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