@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.
@@ -0,0 +1,10 @@
1
+ declare module '../../Route' {
2
+ interface RegisterRoute {
3
+ "/": Record<string, never>;
4
+ "/a": Record<string, never>;
5
+ "/b": Record<string, never>;
6
+ "/c": Record<string, never>;
7
+ "/c-prime": Record<string, never>;
8
+ }
9
+ }
10
+ export {};
@@ -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,6 @@
1
+ import { RegisterRoute } from '../Route';
2
+ export default function useStep<T extends keyof RegisterRoute>(): {
3
+ pushStep: (params: RegisterRoute[T]) => Promise<void>;
4
+ replaceStep: (params: RegisterRoute[T]) => Promise<void>;
5
+ popStep: () => Promise<void>;
6
+ };
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare function Renderer({ children }: PropsWithChildren): import("react").JSX.Element[];
3
+ export default Renderer;
@@ -0,0 +1,2 @@
1
+ declare const ParamsContext: import('react').Context<object>;
2
+ export default ParamsContext;
@@ -0,0 +1,7 @@
1
+ import { Dispatch } from 'react';
2
+ export interface ParamsDispatchContextType {
3
+ type: "SET";
4
+ params: object;
5
+ }
6
+ declare const ParamsDispatchContext: import('react').Context<Dispatch<ParamsDispatchContextType>>;
7
+ export default ParamsDispatchContext;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ declare function ParamsProvider({ children }: PropsWithChildren): import("react").JSX.Element;
3
+ export default ParamsProvider;
@@ -0,0 +1,3 @@
1
+ import { ParamsDispatchContextType } from './ParamsDispatchContext';
2
+ declare function ParamsReducer(state: object, action: ParamsDispatchContextType): object;
3
+ export default ParamsReducer;
@@ -0,0 +1,2 @@
1
+ import { RegisterRoute } from '../../Route';
2
+ export default function useParams<T extends keyof RegisterRoute>(): RegisterRoute[T];
@@ -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 { ComponentPropsWithRef } from 'react';
2
+ declare function ScreenDecorator({ ref, style, ...props }: ComponentPropsWithRef<"div">): import("react").JSX.Element | null;
3
+ export default ScreenDecorator;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface ScreenFreezeProps {
3
+ freeze: boolean;
4
+ children: ReactNode;
5
+ }
6
+ declare function ScreenFreeze({ freeze, children }: ScreenFreezeProps): import("react").JSX.Element;
7
+ export default ScreenFreeze;
@@ -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,4 @@
1
+ export default function useViewportScrollHeight(): {
2
+ viewportScrollHeight: number;
3
+ changedViewportScrollHeight: number;
4
+ };
@@ -0,0 +1,4 @@
1
+ import { SwipeAnimate } from '@flemo/core';
2
+ export declare const clearInlineAnimation: (el: HTMLElement, properties?: string[]) => void;
3
+ declare const animateInline: SwipeAnimate;
4
+ export default animateInline;
@@ -0,0 +1,2 @@
1
+ import { Decorator, Transition } from '@flemo/core';
2
+ export default function useTransitionStyles(transitions: Transition[], decorators: Decorator[]): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Path } from 'path-to-regexp';
2
+ import { RegisterRoute } from '../Route';
3
+ export default function buildRoutePath<T extends keyof RegisterRoute>(path: Path, params: RegisterRoute[T]): {
4
+ pathname: string;
5
+ toPathname: string;
6
+ };
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
+ }