flemo 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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/dist/Route.d.ts +10 -0
  4. package/dist/Router.d.ts +11 -0
  5. package/dist/core/TaskManger.d.ts +56 -0
  6. package/dist/history/HistoryListener.d.ts +2 -0
  7. package/dist/history/store.d.ts +16 -0
  8. package/dist/index.d.ts +13 -0
  9. package/dist/index.mjs +1041 -0
  10. package/dist/navigate/store.d.ts +7 -0
  11. package/dist/navigate/useNavigate.d.ts +11 -0
  12. package/dist/navigate/useStep.d.ts +6 -0
  13. package/dist/renderer/Renderer.d.ts +3 -0
  14. package/dist/screen/ParamsProvider/ParamsContext.d.ts +2 -0
  15. package/dist/screen/ParamsProvider/ParamsDispatchContext.d.ts +7 -0
  16. package/dist/screen/ParamsProvider/ParamsProvider.d.ts +6 -0
  17. package/dist/screen/ParamsProvider/ParamsReducer.d.ts +3 -0
  18. package/dist/screen/ParamsProvider/useParams.d.ts +2 -0
  19. package/dist/screen/ParamsProvider/useParamsDispatch.d.ts +1 -0
  20. package/dist/screen/Screen.d.ts +3 -0
  21. package/dist/screen/ScreenContext.d.ts +12 -0
  22. package/dist/screen/ScreenFreeze.d.ts +8 -0
  23. package/dist/screen/ScreenMotion.d.ts +3 -0
  24. package/dist/screen/ScreenMotionDecorator.d.ts +3 -0
  25. package/dist/screen/store.d.ts +6 -0
  26. package/dist/screen/useScreen.d.ts +1 -0
  27. package/dist/transition/createRawTransition.d.ts +18 -0
  28. package/dist/transition/createTransition.d.ts +14 -0
  29. package/dist/transition/cupertino.d.ts +2 -0
  30. package/dist/transition/decorator/createDecorator.d.ts +12 -0
  31. package/dist/transition/decorator/createRawDecorator.d.ts +19 -0
  32. package/dist/transition/decorator/decorator.d.ts +2 -0
  33. package/dist/transition/decorator/overlay.d.ts +2 -0
  34. package/dist/transition/decorator/typing.d.ts +13 -0
  35. package/dist/transition/material.d.ts +2 -0
  36. package/dist/transition/none.d.ts +2 -0
  37. package/dist/transition/store.d.ts +7 -0
  38. package/dist/transition/transition.d.ts +3 -0
  39. package/dist/transition/typing.d.ts +38 -0
  40. package/dist/utils/getParams.d.ts +4 -0
  41. package/dist/utils/isServer.d.ts +1 -0
  42. package/dist/vendor-C8cPYUOQ.js +299 -0
  43. package/package.json +79 -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,44 @@
1
+ <div align="center">
2
+ <img width="64" height="64" alt="logo_gradient_all_blue_hd" src="https://github.com/user-attachments/assets/131c0626-2730-440e-a802-9fe02e9cf37d" />
3
+
4
+ <h1>Flemo</h1>
5
+
6
+ **Bring native app-like screen transitions to the web**
7
+
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ [Documentation](https://flemo-web.vercel.app/docs) • [Examples](https://https://flemo-web.vercel.app/docs/examples) • [API Reference](https://flemo-web.vercel.app/docs/api)
11
+
12
+ </div>
13
+
14
+ ## ✨ Features
15
+
16
+ - 🎬 **Motion-Powered** - Built on Motion for smooth, native-like transitions
17
+ - 🔒 **Type Safe** - Full TypeScript support with automatic route and parameter inference
18
+ - 🎨 **Custom Transitions** - Create your own transitions with simple or advanced APIs
19
+
20
+ ## 📚 Documentation
21
+
22
+ Visit our [comprehensive documentation](https://flemo-web.vercel.app/) to learn more:
23
+
24
+ - [**Getting Started**](https://flemo-web.vercel.app/docs/getting-started) - Installation and basic setup
25
+ - [**Core Concepts**](https://flemo-web.vercel.app/docs/concepts) - Understanding transitions, decorators, and screens
26
+ - [**API Reference**](https://flemo-web.vercel.app/docs/api) - Complete API documentation
27
+ - [**Examples**](https://flemo-web.vercel.app/docs/examples) - Real-world examples and patterns
28
+
29
+ ## 🛣️ Roadmap
30
+
31
+ - **Shared Element Transitions** - Hero animations between pages
32
+ - **Native UI Components** - App bars and navigation components
33
+ - **Advanced Gesture Support** - Enhanced touch interactions
34
+ - **Developer Tools** - Debug and visualize transitions
35
+
36
+ ## 📄 License
37
+
38
+ MIT © [kimjh96](https://github.com/kimjh96)
39
+
40
+ ---
41
+
42
+ <div align="center">
43
+ <sub>Built with ❤️ for the React community</sub>
44
+ </div>
@@ -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;
@@ -0,0 +1,11 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { Decorator } from './transition/decorator/typing';
3
+ import { TransitionName, Transition } from './transition/typing';
4
+ interface RouterProps {
5
+ initPath?: string;
6
+ defaultTransitionName?: TransitionName;
7
+ transitions?: Transition[];
8
+ decorators?: Decorator[];
9
+ }
10
+ declare function Router({ children, initPath, defaultTransitionName, transitions, decorators }: PropsWithChildren<RouterProps>): import("react").JSX.Element;
11
+ export default Router;
@@ -0,0 +1,56 @@
1
+ interface TaskResult<T> {
2
+ success: boolean;
3
+ error?: Error;
4
+ result?: T;
5
+ taskId?: string;
6
+ timestamp?: number;
7
+ instanceId?: string;
8
+ }
9
+ type TaskStatus = "PENDING" | "MANUAL_PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | "ROLLEDBACK";
10
+ interface Control {
11
+ manual?: boolean;
12
+ delay?: number;
13
+ condition?: () => Promise<boolean>;
14
+ signal?: string;
15
+ }
16
+ interface Task<T> {
17
+ id: string;
18
+ execute: () => Promise<T>;
19
+ validate?: () => Promise<boolean>;
20
+ rollback?: () => Promise<void>;
21
+ control?: Control;
22
+ timestamp: number;
23
+ retryCount: number;
24
+ status: TaskStatus;
25
+ dependencies: string[];
26
+ instanceId: string;
27
+ manualResolver?: {
28
+ resolve: (value: TaskResult<T>) => void;
29
+ reject: (error: Error) => void;
30
+ result: T;
31
+ };
32
+ }
33
+ declare class TaskManager {
34
+ private tasks;
35
+ private readonly instanceId;
36
+ private isLocked;
37
+ private currentTaskId;
38
+ private taskQueue;
39
+ private signalListeners;
40
+ private acquireLock;
41
+ private releaseLock;
42
+ generateTaskId(): string;
43
+ emitSignal(signalName: string): void;
44
+ addTask<T>(execute: () => Promise<T>, options?: {
45
+ id?: string;
46
+ validate?: () => Promise<boolean>;
47
+ rollback?: () => Promise<void>;
48
+ dependencies?: string[];
49
+ control?: Control;
50
+ }): Promise<TaskResult<T>>;
51
+ resolveTask(taskId: string): Promise<boolean>;
52
+ resolveAllPending(): Promise<void>;
53
+ getManualPendingTasks(): Task<unknown>[];
54
+ }
55
+ declare const instance: TaskManager;
56
+ export default instance;
@@ -0,0 +1,2 @@
1
+ declare function HistoryListener(): null;
2
+ export default HistoryListener;
@@ -0,0 +1,16 @@
1
+ import { TransitionName } from '../transition/typing';
2
+ export interface History {
3
+ id: string;
4
+ pathname: string;
5
+ params: object;
6
+ transitionName: TransitionName;
7
+ }
8
+ interface HistoryStore {
9
+ index: number;
10
+ histories: History[];
11
+ addHistory: (history: History) => void;
12
+ replaceHistory: (index: number) => void;
13
+ popHistory: (index: number) => void;
14
+ }
15
+ declare const useHistoryStore: import('zustand').UseBoundStore<import('zustand').StoreApi<HistoryStore>>;
16
+ export default useHistoryStore;
@@ -0,0 +1,13 @@
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 createTransition } from './transition/createTransition';
8
+ export { default as createRawTransition } from './transition/createRawTransition';
9
+ export { default as createDecorator } from './transition/decorator/createDecorator';
10
+ export { default as createRawDecorator } from './transition/decorator/createRawDecorator';
11
+ export { default as Screen } from './screen/Screen';
12
+ export type { TransitionName, RegisterTransition } from './transition/typing';
13
+ export type { DecoratorName, RegisterDecorator } from './transition/decorator/typing';