diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 0000000..ae0ceab --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "RadonAi": { + "url": "http://127.0.0.1:60544/mcp", + "type": "http", + "headers": { + "nonce": "20f25da4-4227-4b6e-8cf1-9f26afcf7289" + } + } + } +} \ No newline at end of file diff --git a/example/assets/logo.png b/example/assets/logo.png new file mode 100644 index 0000000..72dc513 Binary files /dev/null and b/example/assets/logo.png differ diff --git a/example/assets/onboarding/step_benchmark.png b/example/assets/onboarding/step_benchmark.png new file mode 100644 index 0000000..497c0cd Binary files /dev/null and b/example/assets/onboarding/step_benchmark.png differ diff --git a/example/assets/onboarding/step_benchmark@2x.png b/example/assets/onboarding/step_benchmark@2x.png new file mode 100644 index 0000000..14870ff Binary files /dev/null and b/example/assets/onboarding/step_benchmark@2x.png differ diff --git a/example/assets/onboarding/step_benchmark@3x.png b/example/assets/onboarding/step_benchmark@3x.png new file mode 100644 index 0000000..98e1ef8 Binary files /dev/null and b/example/assets/onboarding/step_benchmark@3x.png differ diff --git a/example/assets/onboarding/step_chat.png b/example/assets/onboarding/step_chat.png new file mode 100644 index 0000000..78b16fb Binary files /dev/null and b/example/assets/onboarding/step_chat.png differ diff --git a/example/assets/onboarding/step_chat@2x.png b/example/assets/onboarding/step_chat@2x.png new file mode 100644 index 0000000..b4a4896 Binary files /dev/null and b/example/assets/onboarding/step_chat@2x.png differ diff --git a/example/assets/onboarding/step_chat@3x.png b/example/assets/onboarding/step_chat@3x.png new file mode 100644 index 0000000..4d21544 Binary files /dev/null and b/example/assets/onboarding/step_chat@3x.png differ diff --git a/example/assets/onboarding/step_models.png b/example/assets/onboarding/step_models.png new file mode 100644 index 0000000..27b5f38 Binary files /dev/null and b/example/assets/onboarding/step_models.png differ diff --git a/example/assets/onboarding/step_models@2x.png b/example/assets/onboarding/step_models@2x.png new file mode 100644 index 0000000..7cfbb62 Binary files /dev/null and b/example/assets/onboarding/step_models@2x.png differ diff --git a/example/assets/onboarding/step_models@3x.png b/example/assets/onboarding/step_models@3x.png new file mode 100644 index 0000000..eae77c3 Binary files /dev/null and b/example/assets/onboarding/step_models@3x.png differ diff --git a/example/assets/onboarding/step_sources.png b/example/assets/onboarding/step_sources.png new file mode 100644 index 0000000..8d1e6d4 Binary files /dev/null and b/example/assets/onboarding/step_sources.png differ diff --git a/example/assets/onboarding/step_sources@2x.png b/example/assets/onboarding/step_sources@2x.png new file mode 100644 index 0000000..48d3e70 Binary files /dev/null and b/example/assets/onboarding/step_sources@2x.png differ diff --git a/example/assets/onboarding/step_sources@3x.png b/example/assets/onboarding/step_sources@3x.png new file mode 100644 index 0000000..f3cf29f Binary files /dev/null and b/example/assets/onboarding/step_sources@3x.png differ diff --git a/example/assets/onboarding/step_voice.png b/example/assets/onboarding/step_voice.png new file mode 100644 index 0000000..950477f Binary files /dev/null and b/example/assets/onboarding/step_voice.png differ diff --git a/example/assets/onboarding/step_voice@2x.png b/example/assets/onboarding/step_voice@2x.png new file mode 100644 index 0000000..d71e92f Binary files /dev/null and b/example/assets/onboarding/step_voice@2x.png differ diff --git a/example/assets/onboarding/step_voice@3x.png b/example/assets/onboarding/step_voice@3x.png new file mode 100644 index 0000000..cd6d8b3 Binary files /dev/null and b/example/assets/onboarding/step_voice@3x.png differ diff --git a/example/metro.config.js b/example/metro.config.js index 097c7e0..d7495f5 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -17,4 +17,18 @@ const config = withMetroConfig(getDefaultConfig(__dirname), { config.resolver.unstable_enablePackageExports = true; +// Add watchFolders to include the parent directory for asset resolution +config.watchFolders = [root]; + +// Configure asset extensions +config.resolver.assetExts = [ + ...config.resolver.assetExts, + 'png', + 'jpg', + 'jpeg', + 'gif', + 'webp', + 'svg', +]; + module.exports = config; diff --git a/example/package.json b/example/package.json index 1aebb9e..da842c1 100644 --- a/example/package.json +++ b/example/package.json @@ -10,12 +10,21 @@ }, "dependencies": { "@expo/metro-runtime": "~6.1.2", + "@react-native-async-storage/async-storage": "^2.2.0", + "@react-navigation/native": "^7.1.17", + "@react-navigation/native-stack": "^7.3.26", "expo": "~54.0.7", + "expo-image": "^3.0.8", + "expo-linear-gradient": "~14.0.1", "expo-status-bar": "~3.0.8", "react": "19.1.0", "react-dom": "19.1.0", "react-native": "0.81.4", - "react-native-web": "~0.21.0" + "react-native-reanimated": "^4.1.2", + "react-native-safe-area-context": "^5.6.1", + "react-native-screens": "^4.16.0", + "react-native-web": "~0.21.0", + "react-native-worklets": "0.5.0" }, "private": true, "devDependencies": { diff --git a/example/src/App.tsx b/example/src/App.tsx index d4cdd10..075a001 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,20 +1,61 @@ -import { Text, View, StyleSheet } from 'react-native'; -import { multiply } from 'react-native-onboarding'; +import { NavigationContainer } from '@react-navigation/native'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { enableScreens } from 'react-native-screens'; +import Home from './screens/Home'; +import OnboardingDefault from './screens/OnboardingDefault'; +import OnboardingCustomIntro from './screens/OnboardingCustomIntro'; +import OnboardingCustomSteps from './screens/OnboardingCustomSteps'; +import OnboardingCustomTheme from './screens/OnboardingCustomTheme'; +import OnboardingGradient from './screens/OnboardingGradient'; -const result = multiply(3, 7); +enableScreens(true); + +export type RootStackParamList = { + Home: undefined; + OnboardingDefault: undefined; + OnboardingCustomIntro: undefined; + OnboardingCustomSteps: undefined; + OnboardingCustomTheme: undefined; + OnboardingGradient: undefined; +}; + +const Stack = createNativeStackNavigator(); export default function App() { return ( - - Result: {result} - + + + + + + + + + + ); } - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - }, -}); diff --git a/example/src/screens/Home.tsx b/example/src/screens/Home.tsx new file mode 100644 index 0000000..fc06630 --- /dev/null +++ b/example/src/screens/Home.tsx @@ -0,0 +1,103 @@ +import { useCallback, useState } from 'react'; +import { View, Text, Button, StyleSheet } from 'react-native'; +import AsyncStorage from '@react-native-async-storage/async-storage'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import type { RootStackParamList } from '../App'; +import { useFocusEffect } from '@react-navigation/native'; + +type Props = NativeStackScreenProps; + +const STORAGE_KEY = 'onboarding_finished'; + +export default function Home({ navigation }: Props) { + const [finished, setFinished] = useState(null); + + const load = useCallback(async () => { + try { + const value = await AsyncStorage.getItem(STORAGE_KEY); + setFinished(value === 'true'); + } catch { + setFinished(false); + } + }, []); + + useFocusEffect( + useCallback(() => { + load(); + }, [load]) + ); + + return ( + + React Native Onboarding - Example + + Finished: {finished === null ? 'loading...' : finished ? 'Yes' : 'No'} + + + +