flemo 1.1.3 → 1.2.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/README.md +4 -6
- package/dist/core/TaskManger.d.ts +20 -1
- package/dist/history/store.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +563 -433
- package/dist/navigate/useNavigate.d.ts +2 -0
- package/dist/screen/LayoutScreen.d.ts +4 -0
- package/dist/transition/decorator/typing.d.ts +4 -0
- package/dist/transition/layout.d.ts +2 -0
- package/dist/transition/typing.d.ts +5 -2
- package/package.json +2 -2
|
@@ -2,9 +2,11 @@ import { RegisterRoute } from '../Route';
|
|
|
2
2
|
import { TransitionName } from '../transition/typing';
|
|
3
3
|
export default function useNavigate(): {
|
|
4
4
|
push: <T extends keyof RegisterRoute>(path: T, params: RegisterRoute[T], options?: {
|
|
5
|
+
layoutId?: string | number;
|
|
5
6
|
transitionName?: TransitionName;
|
|
6
7
|
}) => Promise<void>;
|
|
7
8
|
replace: <T extends keyof RegisterRoute>(path: T, params: RegisterRoute[T], options?: {
|
|
9
|
+
layoutId?: string | number;
|
|
8
10
|
transitionName?: TransitionName;
|
|
9
11
|
}) => Promise<void>;
|
|
10
12
|
pop: () => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
3
|
+
declare function ScreenLayout({ children, ...props }: PropsWithChildren<Omit<HTMLMotionProps<"div">, "initial" | "drag" | "dragControls" | "dragListener" | "onDragStart" | "onDrag" | "onDragEnd" | "onPointerDown" | "onPointerMove" | "onPointerUp">>): import("react").JSX.Element;
|
|
4
|
+
export default ScreenLayout;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { BaseTransition } from '../typing';
|
|
2
|
+
import { AnimationOptions, Target } from 'motion/react';
|
|
2
3
|
export interface RegisterDecorator {
|
|
3
4
|
}
|
|
4
5
|
export type DecoratorName = RegisterDecorator[keyof RegisterDecorator] | "overlay";
|
|
5
6
|
export type DecoratorOptions = {
|
|
6
7
|
onSwipeStart?: (triggered: boolean, options: {
|
|
8
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
7
9
|
currentDecorator: HTMLDivElement;
|
|
8
10
|
prevDecorator: HTMLDivElement;
|
|
9
11
|
}) => void;
|
|
10
12
|
onSwipe?: (triggered: boolean, progress: number, options: {
|
|
13
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
11
14
|
currentDecorator: HTMLDivElement;
|
|
12
15
|
prevDecorator: HTMLDivElement;
|
|
13
16
|
}) => void;
|
|
14
17
|
onSwipeEnd?: (triggered: boolean, options: {
|
|
18
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
15
19
|
currentDecorator: HTMLDivElement;
|
|
16
20
|
prevDecorator: HTMLDivElement;
|
|
17
21
|
}) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PanInfo, TargetAndTransition, Target, AnimationOptions, DragControls } from 'motion/react';
|
|
2
1
|
import { NavigateStatus } from '../navigate/store';
|
|
3
2
|
import { DecoratorName } from './decorator/typing';
|
|
3
|
+
import { PanInfo, TargetAndTransition, Target, AnimationOptions, DragControls } from 'motion/react';
|
|
4
4
|
export interface RegisterTransition {
|
|
5
5
|
}
|
|
6
|
-
export type TransitionName = RegisterTransition[keyof RegisterTransition] | "none" | "cupertino" | "material";
|
|
6
|
+
export type TransitionName = RegisterTransition[keyof RegisterTransition] | "none" | "cupertino" | "material" | "layout";
|
|
7
7
|
export type TransitionVariant = `${NavigateStatus}-${boolean}`;
|
|
8
8
|
export type TransitionVariantValue = {
|
|
9
9
|
value: Target;
|
|
@@ -13,18 +13,21 @@ export type TransitionOptions = {
|
|
|
13
13
|
decoratorName?: DecoratorName;
|
|
14
14
|
swipeDirection: "x" | "y";
|
|
15
15
|
onSwipeStart: (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo, options: {
|
|
16
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
16
17
|
currentScreen: HTMLDivElement;
|
|
17
18
|
prevScreen: HTMLDivElement;
|
|
18
19
|
dragControls: DragControls;
|
|
19
20
|
onStart?: (triggered: boolean) => void;
|
|
20
21
|
}) => Promise<boolean>;
|
|
21
22
|
onSwipe: (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo, options: {
|
|
23
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
22
24
|
currentScreen: HTMLDivElement;
|
|
23
25
|
prevScreen: HTMLDivElement;
|
|
24
26
|
dragControls: DragControls;
|
|
25
27
|
onProgress?: (triggered: boolean, progress: number) => void;
|
|
26
28
|
}) => number;
|
|
27
29
|
onSwipeEnd: (event: MouseEvent | TouchEvent | PointerEvent, info: PanInfo, options: {
|
|
30
|
+
animate: (target: object, objectTarget: Target, options: AnimationOptions) => void;
|
|
28
31
|
currentScreen: HTMLDivElement;
|
|
29
32
|
prevScreen: HTMLDivElement;
|
|
30
33
|
onStart?: (triggered: boolean) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flemo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A modern React router library with built-in motion animations and smooth transitions",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/kimjh96/flemo/issues",
|
|
32
32
|
"email": "kimjhs@kakao.com"
|
|
33
33
|
},
|
|
34
|
-
"homepage": "https://flemo-
|
|
34
|
+
"homepage": "https://flemo-dev.lovable.app",
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "vite build",
|