@flemo/react 1.0.0
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/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/Route.d.ts +10 -0
- package/dist/Router.d.ts +10 -0
- package/dist/history/HistoryListener.d.ts +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.mjs +1188 -0
- package/dist/navigate/__tests__/useNavigate.test.d.ts +10 -0
- package/dist/navigate/__tests__/useStep.test.d.ts +1 -0
- package/dist/navigate/useNavigate.d.ts +13 -0
- package/dist/navigate/useStep.d.ts +6 -0
- package/dist/renderer/Renderer.d.ts +3 -0
- package/dist/screen/ParamsProvider/ParamsContext.d.ts +2 -0
- package/dist/screen/ParamsProvider/ParamsDispatchContext.d.ts +7 -0
- package/dist/screen/ParamsProvider/ParamsProvider.d.ts +3 -0
- package/dist/screen/ParamsProvider/ParamsReducer.d.ts +3 -0
- package/dist/screen/ParamsProvider/useParams.d.ts +2 -0
- package/dist/screen/ParamsProvider/useParamsDispatch.d.ts +1 -0
- package/dist/screen/Screen.d.ts +17 -0
- package/dist/screen/ScreenContext.d.ts +13 -0
- package/dist/screen/ScreenDecorator.d.ts +3 -0
- package/dist/screen/ScreenFreeze.d.ts +7 -0
- package/dist/screen/ScreenMotion.d.ts +3 -0
- package/dist/screen/__tests__/store.test.d.ts +1 -0
- package/dist/screen/store.d.ts +15 -0
- package/dist/screen/useScreen.d.ts +1 -0
- package/dist/screen/useViewportScrollHeight.d.ts +4 -0
- package/dist/transition/animateInline.d.ts +4 -0
- package/dist/transition/styles.d.ts +2 -0
- package/dist/utils/__tests__/buildRoutePath.test.d.ts +1 -0
- package/dist/utils/buildRoutePath.d.ts +6 -0
- package/package.json +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 김종혁
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img width="96" height="96" alt="flemo" src="https://github.com/user-attachments/assets/1d0059ef-8fcc-456c-be42-7e3f08dee453" />
|
|
3
|
+
|
|
4
|
+
<h1>flemo</h1>
|
|
5
|
+
|
|
6
|
+
**Native-like screen transitions for React**
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@flemo/react)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
flemo is a React router whose unit of routing is a **screen**, not a page. Push, pop, and the
|
|
16
|
+
animations and gestures between screens are handled by flemo, so you don't need to wire a
|
|
17
|
+
router and a motion library together yourself.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @flemo/react
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`@flemo/react` pulls in `@flemo/core` (the framework-agnostic primitives) as a regular
|
|
26
|
+
dependency. Apps that only need transition compilers or the navigation queue can install
|
|
27
|
+
`@flemo/core` directly. For shared-element morphs (`<LayoutScreen>` + `<LayoutConfig>`),
|
|
28
|
+
add `@flemo/react-layout` (which carries `motion` as its peer dependency):
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add @flemo/react-layout motion
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Documentation
|
|
35
|
+
|
|
36
|
+
See [flemo-web.vercel.app](https://flemo-web.vercel.app) for the full guide — getting started,
|
|
37
|
+
transitions, shared-element morphs, gestures, and the complete API reference. A live playground is
|
|
38
|
+
at [flemo-web.vercel.app/playground](https://flemo-web.vercel.app/playground).
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT © [kimjh96](https://github.com/kimjh96)
|
package/dist/Route.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Path } from 'path-to-regexp';
|
|
3
|
+
export interface RegisterRoute {
|
|
4
|
+
}
|
|
5
|
+
export interface RouteProps {
|
|
6
|
+
path: Path | Path[];
|
|
7
|
+
element: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function Route({ element }: RouteProps): ReactNode;
|
|
10
|
+
export default Route;
|
package/dist/Router.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Decorator, Transition, TransitionName } from '@flemo/core';
|
|
3
|
+
interface RouterProps {
|
|
4
|
+
initPath?: string;
|
|
5
|
+
defaultTransitionName?: TransitionName;
|
|
6
|
+
transitions?: Transition[];
|
|
7
|
+
decorators?: Decorator[];
|
|
8
|
+
}
|
|
9
|
+
declare function Router({ children, initPath, defaultTransitionName, transitions, decorators }: PropsWithChildren<RouterProps>): import("react").JSX.Element;
|
|
10
|
+
export default Router;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as Router } from './Router';
|
|
2
|
+
export { default as Route, type RegisterRoute } from './Route';
|
|
3
|
+
export { default as useNavigate } from './navigate/useNavigate';
|
|
4
|
+
export { default as useStep } from './navigate/useStep';
|
|
5
|
+
export { default as useScreen } from './screen/useScreen';
|
|
6
|
+
export { default as useParams } from './screen/ParamsProvider/useParams';
|
|
7
|
+
export { default as Screen, type ScreenProps } from './screen/Screen';
|
|
8
|
+
export { default as ScreenMotion } from './screen/ScreenMotion';
|
|
9
|
+
export { default as ScreenFreeze } from './screen/ScreenFreeze';
|
|
10
|
+
export { default as ScreenDecorator } from './screen/ScreenDecorator';
|
|
11
|
+
export { default as ScreenContext, type ScreenContextProps } from './screen/ScreenContext';
|
|
12
|
+
export { default as useScreenStore, type SharedBarPresence } from './screen/store';
|
|
13
|
+
export { default as useViewportScrollHeight } from './screen/useViewportScrollHeight';
|
|
14
|
+
export { createTransition, createRawTransition, createDecorator, createRawDecorator } from '@flemo/core';
|
|
15
|
+
export type { TransitionName, RegisterTransition, DecoratorName, RegisterDecorator } from '@flemo/core';
|