@umituz/react-native-onboarding 3.0.3 → 3.0.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-onboarding",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Advanced onboarding flow for React Native apps with personalization questions, theme-aware colors, animations, and customizable slides. SOLID, DRY, KISS principles applied.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -18,17 +18,36 @@ interface OnboardingStore extends OnboardingStoreState {
|
|
|
18
18
|
setError: (error: string | null) => void;
|
|
19
19
|
setState: (state: Partial<OnboardingStoreState>) => void;
|
|
20
20
|
getState: () => OnboardingStoreState;
|
|
21
|
+
// Async actions for initialization (match OnboardingStoreActions signatures)
|
|
22
|
+
initialize: (storageKey?: string) => Promise<void>;
|
|
23
|
+
complete: (storageKey?: string) => Promise<void>;
|
|
24
|
+
skip: (storageKey?: string) => Promise<void>;
|
|
25
|
+
reset: (storageKey?: string) => Promise<void>;
|
|
26
|
+
saveAnswer: (questionId: string, answer: any) => Promise<void>;
|
|
27
|
+
setUserData: (data: any) => Promise<void>;
|
|
21
28
|
}
|
|
22
29
|
|
|
23
|
-
export const useOnboardingStore = create<OnboardingStore>((set, get) =>
|
|
24
|
-
|
|
30
|
+
export const useOnboardingStore = create<OnboardingStore>((set, get) => {
|
|
31
|
+
const actions = createOnboardingStoreActions(set as any, get);
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
33
|
+
return {
|
|
34
|
+
...initialOnboardingState,
|
|
35
|
+
|
|
36
|
+
setCurrentStep: (step) => set({ currentStep: step }),
|
|
37
|
+
setLoading: (loading) => set({ loading }),
|
|
38
|
+
setError: (error) => set({ error }),
|
|
39
|
+
setState: set,
|
|
40
|
+
getState: get,
|
|
41
|
+
|
|
42
|
+
// Async actions from actions module
|
|
43
|
+
initialize: actions.initialize,
|
|
44
|
+
complete: actions.complete,
|
|
45
|
+
skip: actions.skip,
|
|
46
|
+
reset: actions.reset,
|
|
47
|
+
saveAnswer: actions.saveAnswer,
|
|
48
|
+
setUserData: actions.setUserData,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
32
51
|
|
|
33
52
|
/**
|
|
34
53
|
* Hook for accessing onboarding state
|
|
@@ -47,7 +66,7 @@ export const useOnboarding = () => {
|
|
|
47
66
|
loading: store.loading,
|
|
48
67
|
error: store.error,
|
|
49
68
|
userData: store.userData,
|
|
50
|
-
|
|
69
|
+
|
|
51
70
|
// Actions
|
|
52
71
|
initialize: actions.initialize,
|
|
53
72
|
complete: actions.complete,
|
|
@@ -58,7 +77,7 @@ export const useOnboarding = () => {
|
|
|
58
77
|
setError: store.setError,
|
|
59
78
|
saveAnswer: actions.saveAnswer,
|
|
60
79
|
setUserData: actions.setUserData,
|
|
61
|
-
|
|
80
|
+
|
|
62
81
|
// Selectors
|
|
63
82
|
getAnswer: selectors.getAnswer,
|
|
64
83
|
getUserData: selectors.getUserData,
|