@flemo/core 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/dist/core/TaskManger.d.ts +62 -0
- package/dist/core/__tests__/TaskManger.test.d.ts +1 -0
- package/dist/history/__tests__/store.test.d.ts +1 -0
- package/dist/history/store.d.ts +17 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.mjs +965 -0
- package/dist/navigate/__tests__/selfPopGuard.test.d.ts +1 -0
- package/dist/navigate/selfPopGuard.d.ts +12 -0
- package/dist/navigate/store.d.ts +9 -0
- package/dist/transition/__tests__/compileTransitionStyles.test.d.ts +7 -0
- package/dist/transition/compileTransitionStyles.d.ts +13 -0
- package/dist/transition/createRawTransition.d.ts +18 -0
- package/dist/transition/createTransition.d.ts +14 -0
- package/dist/transition/cssTypes.d.ts +22 -0
- package/dist/transition/cupertino.d.ts +2 -0
- package/dist/transition/decorator/createDecorator.d.ts +12 -0
- package/dist/transition/decorator/createRawDecorator.d.ts +19 -0
- package/dist/transition/decorator/decorator.d.ts +2 -0
- package/dist/transition/decorator/overlay.d.ts +2 -0
- package/dist/transition/decorator/typing.d.ts +24 -0
- package/dist/transition/layout.d.ts +2 -0
- package/dist/transition/material.d.ts +2 -0
- package/dist/transition/none.d.ts +2 -0
- package/dist/transition/store.d.ts +7 -0
- package/dist/transition/transition.d.ts +2 -0
- package/dist/transition/typing.d.ts +61 -0
- package/dist/utils/__tests__/findScrollable.test.d.ts +1 -0
- package/dist/utils/__tests__/getMatchedPathPattern.test.d.ts +1 -0
- package/dist/utils/__tests__/getParams.test.d.ts +1 -0
- package/dist/utils/__tests__/isServer.test.d.ts +1 -0
- package/dist/utils/findScrollable.d.ts +21 -0
- package/dist/utils/getMatchedPathPattern.d.ts +2 -0
- package/dist/utils/getParams.d.ts +4 -0
- package/dist/utils/isServer.d.ts +1 -0
- package/package.json +62 -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.
|
|
@@ -0,0 +1,62 @@
|
|
|
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" | "SIGNAL_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: (abortController: AbortController) => 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
|
+
abortController?: AbortController;
|
|
28
|
+
manualResolver?: {
|
|
29
|
+
resolve: (value: TaskResult<T>) => void;
|
|
30
|
+
reject: (error: Error) => void;
|
|
31
|
+
result: T;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
declare class TaskManager {
|
|
35
|
+
private tasks;
|
|
36
|
+
private readonly instanceId;
|
|
37
|
+
private isLocked;
|
|
38
|
+
private currentTaskId;
|
|
39
|
+
private taskQueue;
|
|
40
|
+
private signalListeners;
|
|
41
|
+
private pendingTaskQueue;
|
|
42
|
+
private isProcessingPending;
|
|
43
|
+
private acquireLock;
|
|
44
|
+
private releaseLock;
|
|
45
|
+
generateTaskId(): string;
|
|
46
|
+
emitSignal(signalName: string): void;
|
|
47
|
+
private processPendingTasks;
|
|
48
|
+
private waitForPendingTasks;
|
|
49
|
+
private onTaskStatusChange;
|
|
50
|
+
addTask<T>(execute: Task<T>["execute"], options?: {
|
|
51
|
+
id?: string;
|
|
52
|
+
delay?: number;
|
|
53
|
+
validate?: () => Promise<boolean>;
|
|
54
|
+
rollback?: () => Promise<void>;
|
|
55
|
+
dependencies?: string[];
|
|
56
|
+
control?: Control;
|
|
57
|
+
}): Promise<TaskResult<T>>;
|
|
58
|
+
resolveTask(taskId: string): Promise<boolean>;
|
|
59
|
+
resolveAllPending(): Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
declare const instance: TaskManager;
|
|
62
|
+
export default instance;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TransitionName } from '../transition/typing';
|
|
2
|
+
export interface History {
|
|
3
|
+
id: string;
|
|
4
|
+
pathname: string;
|
|
5
|
+
params: object;
|
|
6
|
+
transitionName: TransitionName;
|
|
7
|
+
layoutId: string | number | null;
|
|
8
|
+
}
|
|
9
|
+
interface HistoryStore {
|
|
10
|
+
index: number;
|
|
11
|
+
histories: History[];
|
|
12
|
+
addHistory: (history: History) => void;
|
|
13
|
+
replaceHistory: (index: number) => void;
|
|
14
|
+
popHistory: (index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const useHistoryStore: import('zustand').UseBoundStore<import('zustand').StoreApi<HistoryStore>>;
|
|
17
|
+
export default useHistoryStore;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { default as TaskManger } from './core/TaskManger';
|
|
2
|
+
export { default as useHistoryStore, type History } from './history/store';
|
|
3
|
+
export { default as useNavigateStore, type NavigateStatus } from './navigate/store';
|
|
4
|
+
export { markSelfInducedPop, consumeSelfInducedPop } from './navigate/selfPopGuard';
|
|
5
|
+
export { default as createTransition } from './transition/createTransition';
|
|
6
|
+
export { default as createRawTransition } from './transition/createRawTransition';
|
|
7
|
+
export { transitionMap } from './transition/transition';
|
|
8
|
+
export { default as useTransitionStore } from './transition/store';
|
|
9
|
+
export { default as createDecorator } from './transition/decorator/createDecorator';
|
|
10
|
+
export { default as createRawDecorator } from './transition/decorator/createRawDecorator';
|
|
11
|
+
export { decoratorMap } from './transition/decorator/decorator';
|
|
12
|
+
export { default as cupertino } from './transition/cupertino';
|
|
13
|
+
export { default as material } from './transition/material';
|
|
14
|
+
export { default as layout } from './transition/layout';
|
|
15
|
+
export { default as none } from './transition/none';
|
|
16
|
+
export { default as overlay } from './transition/decorator/overlay';
|
|
17
|
+
export { compileTransitionStyles, animationName, variantHasAnimation, targetToDecls, collectAnimatedProperties, easingToCss, type CssDecl } from './transition/compileTransitionStyles';
|
|
18
|
+
export type { RegisterTransition, TransitionName, TransitionVariant, TransitionVariantValue, TransitionOptions, BaseTransition, Transition, SwipeInfo, SwipeAnimate } from './transition/typing';
|
|
19
|
+
export type { RegisterDecorator, DecoratorName, DecoratorOptions, Decorator } from './transition/decorator/typing';
|
|
20
|
+
export { default as isServer } from './utils/isServer';
|
|
21
|
+
export { default as getParams } from './utils/getParams';
|
|
22
|
+
export { default as getMatchedPathPattern } from './utils/getMatchedPathPattern';
|
|
23
|
+
export { default as findScrollable, overflowsAxis, canProgrammaticallyScroll } from './utils/findScrollable';
|