@umituz/react-native-onboarding 3.6.0 → 3.6.1
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.6.
|
|
3
|
+
"version": "3.6.1",
|
|
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",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"expo-video": ">=1.0.0",
|
|
38
38
|
"react": ">=18.2.0",
|
|
39
39
|
"react-native": ">=0.74.0",
|
|
40
|
-
"react-native-safe-area-context": ">=4.0.0"
|
|
41
|
-
"zustand": "^4.5.0 || ^5.0.0"
|
|
40
|
+
"react-native-safe-area-context": ">=4.0.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@expo/vector-icons": "^14.0.0",
|
|
@@ -61,8 +60,7 @@
|
|
|
61
60
|
"react": "19.1.0",
|
|
62
61
|
"react-native": "0.81.5",
|
|
63
62
|
"react-native-safe-area-context": "^5.6.0",
|
|
64
|
-
"typescript": "~5.9.2"
|
|
65
|
-
"zustand": "^5.0.0"
|
|
63
|
+
"typescript": "~5.9.2"
|
|
66
64
|
},
|
|
67
65
|
"publishConfig": {
|
|
68
66
|
"access": "public"
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useMemo } from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { createStore } from "@umituz/react-native-storage";
|
|
10
10
|
import type { OnboardingStoreState } from "./OnboardingStoreState";
|
|
11
11
|
import { initialOnboardingState } from "./OnboardingStoreState";
|
|
12
12
|
import { createOnboardingStoreActions } from "./OnboardingStoreActions";
|
|
13
13
|
import { createOnboardingStoreSelectors } from "./OnboardingStoreSelectors";
|
|
14
14
|
|
|
15
|
-
interface
|
|
15
|
+
interface OnboardingActions {
|
|
16
16
|
// Simple actions
|
|
17
17
|
setCurrentStep: (step: number) => void;
|
|
18
18
|
setLoading: (loading: boolean) => void;
|
|
@@ -24,30 +24,33 @@ interface OnboardingStore extends OnboardingStoreState {
|
|
|
24
24
|
complete: (storageKey?: string) => Promise<void>;
|
|
25
25
|
skip: (storageKey?: string) => Promise<void>;
|
|
26
26
|
reset: (storageKey?: string) => Promise<void>;
|
|
27
|
-
saveAnswer: (questionId: string, answer:
|
|
28
|
-
setUserData: (data:
|
|
27
|
+
saveAnswer: (questionId: string, answer: unknown) => Promise<void>;
|
|
28
|
+
setUserData: (data: unknown) => Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const useOnboardingStore =
|
|
32
|
-
|
|
31
|
+
export const useOnboardingStore = createStore<OnboardingStoreState, OnboardingActions>({
|
|
32
|
+
name: "onboarding-store",
|
|
33
|
+
initialState: initialOnboardingState,
|
|
34
|
+
persist: false,
|
|
35
|
+
actions: (set, get) => {
|
|
36
|
+
const actions = createOnboardingStoreActions(set, get);
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
return {
|
|
39
|
+
setCurrentStep: (step) => set({ currentStep: step }),
|
|
40
|
+
setLoading: (loading) => set({ loading }),
|
|
41
|
+
setError: (error) => set({ error }),
|
|
42
|
+
setState: set,
|
|
43
|
+
getState: get,
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
skip: actions.skip,
|
|
47
|
-
reset: actions.reset,
|
|
48
|
-
saveAnswer: actions.saveAnswer,
|
|
49
|
-
setUserData: actions.setUserData,
|
|
50
|
-
};
|
|
45
|
+
// Async actions from actions module
|
|
46
|
+
initialize: actions.initialize,
|
|
47
|
+
complete: actions.complete,
|
|
48
|
+
skip: actions.skip,
|
|
49
|
+
reset: actions.reset,
|
|
50
|
+
saveAnswer: actions.saveAnswer,
|
|
51
|
+
setUserData: actions.setUserData,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
51
54
|
});
|
|
52
55
|
|
|
53
56
|
/**
|