page-transition 0.1.0-beta.59 → 0.1.0-beta.60

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.
package/README.md CHANGED
@@ -10,7 +10,7 @@ A page transition library for the Next.js App Router.
10
10
  - Scroll restoration
11
11
 
12
12
  ## Install
13
- ![Version](https://img.shields.io/badge/v_0.1.0--beta.58-000000) ![82.1 KB](https://img.shields.io/badge/82.1_KB-1677FF)
13
+ ![Version](https://img.shields.io/badge/v_0.1.0--beta.60-000000) ![82.2 KB](https://img.shields.io/badge/82.2_KB-1677FF)
14
14
 
15
15
  `npm install page-transition@beta`
16
16
 
@@ -86,8 +86,9 @@ Number of items in the second group. Each item receives the `.second-item` class
86
86
  <TransitionProvider
87
87
  outside={<Header/>}
88
88
  options={{
89
- transitionProperty: "clip-path",
90
- items: [1, 0]
89
+ overlay: true,
90
+ transitionProperty: "clip-path",
91
+ items: [1, 0]
91
92
  }}
92
93
  >
93
94
  {children}
@@ -113,12 +114,12 @@ Triggers the transition.
113
114
 
114
115
  *Must be used within the TransitionProvider*
115
116
 
116
- `css`
117
+ css
117
118
  ```tsx
118
119
  import {TransitionLink} from "page-transition/css"
119
120
 
120
121
  ```
121
- `manual`
122
+ manual
122
123
  ```tsx
123
124
  import {TransitionLink} from "page-transition/manual"
124
125
  ```
@@ -165,9 +166,9 @@ After navigation, the `exit` class is removed and the `enter` class is added. On
165
166
  ```
166
167
 
167
168
 
168
- To access the page wrapper, overlay, overlay wrapper, and their respective items, use `useCssContext`.
169
+ To access the page wrapper, overlay, overlay wrapper, and their respective items, use `useTransitionContext`.
169
170
  ```ts
170
- import { useCssContext } from "page-transition"
171
+ import { useTransitionContext } from "page-transition/css"
171
172
 
172
173
  const {
173
174
  pageWrapper,
@@ -213,7 +214,7 @@ overlay: true
213
214
  </details>
214
215
 
215
216
  <details>
216
- <summary>Single Overlay</summary>
217
+ <summary>Single Overlay and Opacity</summary>
217
218
  <br/>
218
219
  options
219
220
 
@@ -394,10 +395,9 @@ items: [10, 10]
394
395
  </details>
395
396
 
396
397
 
397
-
398
398
  ### Manual Mode
399
399
 
400
- In manual mode, you can control the transition using `useManualContext`.
400
+ In manual mode, you can control the transition using `useTransitionContext`.
401
401
 
402
402
 
403
403
  After triggering the navigation, `state.current` is set to `exiting`. You can then call `resolveFn.current()` to proceed with the navigation.
@@ -408,8 +408,8 @@ Once `state.current` is set to `entering`, the navigation has occurred. After th
408
408
 
409
409
 
410
410
  ```ts
411
- import { useManualContext } from "page-transition"
411
+ import { useTransitionContext } from "page-transition/manual"
412
412
 
413
- const { resolveFn, state } = useManualContext()
413
+ const { resolveFn, state } = useTransitionContext()
414
414
 
415
415
  ```
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
- import { useCssContext } from "../../context/CssContext";
3
+ import { useTransitionContext } from "../../context/CssContext";
4
4
  export function TransitionLink({ href, className, prefetch, onClick, children }) {
5
- const { handleLinkClick } = useCssContext();
5
+ const { handleLinkClick } = useTransitionContext();
6
6
  return (_jsx(Link, { href: href, onClick: (e) => {
7
7
  onClick?.(e);
8
8
  handleLinkClick.current(e, href);
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Link from "next/link";
3
- import { useManualContext } from "../../context/ManualContext";
3
+ import { useTransitionContext } from "../../context/ManualContext";
4
4
  export function TransitionLink({ href, className, prefetch, onClick, children }) {
5
- const { handleLinkClick } = useManualContext();
5
+ const { handleLinkClick } = useTransitionContext();
6
6
  return (_jsx(Link, { href: href, onClick: (e) => {
7
7
  onClick?.(e);
8
8
  handleLinkClick.current(e, href);
@@ -8,5 +8,5 @@ interface ContextProps {
8
8
  secondItems?: RefObject<(HTMLDivElement | null)[]>;
9
9
  }
10
10
  export declare const CssContext: import("react").Context<ContextProps | null>;
11
- export declare function useCssContext(): ContextProps;
11
+ export declare function useTransitionContext(): ContextProps;
12
12
  export {};
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createContext, useContext } from "react";
3
3
  export const CssContext = createContext(null);
4
- export function useCssContext() {
4
+ export function useTransitionContext() {
5
5
  const context = useContext(CssContext);
6
6
  if (!context)
7
7
  throw new Error('useCssContext in Provider!');
@@ -5,5 +5,5 @@ interface ContextProps {
5
5
  state?: RefObject<'idle' | 'exiting' | 'entering'>;
6
6
  }
7
7
  export declare const ManualContext: import("react").Context<ContextProps | null>;
8
- export declare function useManualContext(): ContextProps;
8
+ export declare function useTransitionContext(): ContextProps;
9
9
  export {};
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createContext, useContext } from "react";
3
3
  export const ManualContext = createContext(null);
4
- export function useManualContext() {
4
+ export function useTransitionContext() {
5
5
  const context = useContext(ManualContext);
6
6
  if (!context)
7
7
  throw new Error('useManualContext in Provider!');
package/dist/css.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export { useTransitionContext } from "./context/CssContext";
1
2
  export { TransitionLink } from "./components/css/TransitionLink";
package/dist/css.js CHANGED
@@ -1 +1,3 @@
1
+ "use client";
2
+ export { useTransitionContext } from "./context/CssContext";
1
3
  export { TransitionLink } from "./components/css/TransitionLink";
package/dist/index.d.ts CHANGED
@@ -1,3 +1 @@
1
1
  export { TransitionProvider } from "./context/TransitionProvider";
2
- export { useCssContext } from "./context/CssContext";
3
- export { useManualContext } from "./context/ManualContext";
package/dist/index.js CHANGED
@@ -1,4 +1,2 @@
1
1
  "use client";
2
2
  export { TransitionProvider } from "./context/TransitionProvider";
3
- export { useCssContext } from "./context/CssContext";
4
- export { useManualContext } from "./context/ManualContext";
package/dist/manual.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export { useTransitionContext } from "./context/ManualContext";
1
2
  export { TransitionLink } from "./components/manual/TransitionLink";
package/dist/manual.js CHANGED
@@ -1 +1,3 @@
1
+ "use client";
2
+ export { useTransitionContext } from "./context/ManualContext";
1
3
  export { TransitionLink } from "./components/manual/TransitionLink";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-transition",
3
- "version": "0.1.0-beta.59",
3
+ "version": "0.1.0-beta.60",
4
4
  "description": "A page transition library for the Next.js App Router.",
5
5
  "license": "MIT",
6
6
  "files": [