@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TransitionName } from '@flemo/core';
|
|
2
|
+
import { RegisterRoute } from '../Route';
|
|
3
|
+
export default function useNavigate(): {
|
|
4
|
+
push: <T extends keyof RegisterRoute>(path: T, params?: RegisterRoute[T], options?: {
|
|
5
|
+
layoutId?: string | number;
|
|
6
|
+
transitionName?: TransitionName;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
replace: <T extends keyof RegisterRoute>(path: T, params?: RegisterRoute[T], options?: {
|
|
9
|
+
layoutId?: string | number;
|
|
10
|
+
transitionName?: TransitionName;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
pop: () => Promise<void>;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useParamsDispatch(): import('react').Dispatch<import('./ParamsDispatchContext').ParamsDispatchContextType>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export interface ScreenProps extends PropsWithChildren<Omit<ComponentPropsWithoutRef<"div">, "onPointerDown" | "onPointerMove" | "onPointerUp" | "onPointerCancel">> {
|
|
3
|
+
statusBarHeight?: string;
|
|
4
|
+
statusBarColor?: string;
|
|
5
|
+
systemNavigationBarHeight?: string;
|
|
6
|
+
systemNavigationBarColor?: string;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
sharedAppBar?: ReactNode;
|
|
9
|
+
sharedNavigationBar?: ReactNode;
|
|
10
|
+
appBar?: ReactNode;
|
|
11
|
+
navigationBar?: ReactNode;
|
|
12
|
+
hideStatusBar?: boolean;
|
|
13
|
+
hideSystemNavigationBar?: boolean;
|
|
14
|
+
contentScrollable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function Screen({ children, ...props }: ScreenProps): import("react").JSX.Element;
|
|
17
|
+
export default Screen;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { History, TransitionName } from '@flemo/core';
|
|
2
|
+
import { Path } from 'path-to-regexp';
|
|
3
|
+
export interface ScreenContextProps extends History {
|
|
4
|
+
id: string;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
isRoot: boolean;
|
|
7
|
+
isPrev: boolean;
|
|
8
|
+
zIndex: number;
|
|
9
|
+
prevTransitionName: TransitionName;
|
|
10
|
+
routePath: Path;
|
|
11
|
+
}
|
|
12
|
+
declare const ScreenContext: import('react').Context<ScreenContextProps>;
|
|
13
|
+
export default ScreenContext;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ScreenProps } from './Screen';
|
|
2
|
+
declare function ScreenMotion({ children, statusBarHeight, statusBarColor, systemNavigationBarHeight, systemNavigationBarColor, sharedAppBar, sharedNavigationBar, appBar, navigationBar, hideStatusBar, hideSystemNavigationBar, backgroundColor, contentScrollable, ...props }: ScreenProps): import("react").JSX.Element;
|
|
3
|
+
export default ScreenMotion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SharedBarPresence {
|
|
2
|
+
appBar: boolean;
|
|
3
|
+
navigationBar: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface ScreenStore {
|
|
6
|
+
dragStatus: "IDLE" | "PENDING";
|
|
7
|
+
replaceTransitionStatus: "IDLE" | "PENDING";
|
|
8
|
+
sharedBars: Record<string, SharedBarPresence>;
|
|
9
|
+
setDragStatus: (dragStatus: "IDLE" | "PENDING") => void;
|
|
10
|
+
setReplaceTransitionStatus: (replaceTransitionStatus: "IDLE" | "PENDING") => void;
|
|
11
|
+
registerSharedBars: (id: string, presence: SharedBarPresence) => void;
|
|
12
|
+
unregisterSharedBars: (id: string) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const useScreenStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ScreenStore>>;
|
|
15
|
+
export default useScreenStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useScreen(): import('./ScreenContext').ScreenContextProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flemo/react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React bindings for flemo — Router, Route, Screen, and the screen-transition runtime.",
|
|
5
|
+
"main": "./dist/index.mjs",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"keywords": [
|
|
14
|
+
"flemo",
|
|
15
|
+
"react",
|
|
16
|
+
"react-router",
|
|
17
|
+
"transition",
|
|
18
|
+
"page-transition",
|
|
19
|
+
"react-page-transition"
|
|
20
|
+
],
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "kimjh96",
|
|
23
|
+
"email": "kimjhs@kakao.com"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/kimjh96/flemo.git",
|
|
28
|
+
"directory": "packages/react"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/kimjh96/flemo/issues",
|
|
32
|
+
"email": "kimjhs@kakao.com"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://flemo-web.vercel.app",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"path-to-regexp": "^8.2.0",
|
|
38
|
+
"zustand": "^5.0.11",
|
|
39
|
+
"@flemo/core": "1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
43
|
+
"@testing-library/react": "^16.1.0",
|
|
44
|
+
"@types/node": "^24.3.0",
|
|
45
|
+
"@types/react": "^19.2.0",
|
|
46
|
+
"@types/react-dom": "^19.2.0",
|
|
47
|
+
"@vitejs/plugin-react-swc": "^4.0.1",
|
|
48
|
+
"eslint": "^9.33.0",
|
|
49
|
+
"jsdom": "^25.0.1",
|
|
50
|
+
"react": "^19.2.0",
|
|
51
|
+
"react-dom": "^19.2.0",
|
|
52
|
+
"typescript": "^5.9.2",
|
|
53
|
+
"vite": "^7.1.5",
|
|
54
|
+
"vite-plugin-dts": "^4.5.4",
|
|
55
|
+
"vitest": "^2.1.8",
|
|
56
|
+
"@flemo/tsconfig": "0.0.0",
|
|
57
|
+
"@flemo/eslint-config": "0.0.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^19.2.0",
|
|
61
|
+
"react-dom": "^19.2.0"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "vite build",
|
|
68
|
+
"watch": "vite build --watch",
|
|
69
|
+
"dev": "vite build --watch",
|
|
70
|
+
"lint": "eslint \"**/*.{js,mjs,ts,jsx,tsx,mts}\"",
|
|
71
|
+
"typecheck": "tsc --noEmit",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"test:watch": "vitest",
|
|
74
|
+
"clean": "rm -rf dist .turbo"
|
|
75
|
+
}
|
|
76
|
+
}
|