@oxyhq/services 5.21.5 → 5.21.6
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/lib/commonjs/ui/components/BottomSheetRouter.js +100 -286
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +0 -3
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +14 -19
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +43 -145
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +102 -284
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +0 -3
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +14 -19
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +37 -135
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +0 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +2 -7
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +11 -60
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +2 -7
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +11 -60
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/BottomSheetRouter.tsx +97 -319
- package/src/ui/components/GroupedItem.tsx +0 -4
- package/src/ui/components/OxyProvider.tsx +13 -18
- package/src/ui/navigation/bottomSheetManager.ts +43 -150
- package/src/ui/screens/AccountSettingsScreen.tsx +0 -2
- package/lib/commonjs/ui/hooks/use-haptic-press.js +0 -21
- package/lib/commonjs/ui/hooks/use-haptic-press.js.map +0 -1
- package/lib/module/ui/hooks/use-haptic-press.js +0 -17
- package/lib/module/ui/hooks/use-haptic-press.js.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/use-haptic-press.d.ts +0 -8
- package/lib/typescript/commonjs/ui/hooks/use-haptic-press.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/use-haptic-press.d.ts +0 -8
- package/lib/typescript/module/ui/hooks/use-haptic-press.d.ts.map +0 -1
- package/src/ui/hooks/use-haptic-press.ts +0 -15
|
@@ -1,344 +1,162 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
import React, { useRef, useEffect, useCallback, useMemo } from 'react';
|
|
4
4
|
import { BackHandler, View, StyleSheet } from 'react-native';
|
|
5
|
-
import Animated, { useSharedValue, useAnimatedStyle } from 'react-native-reanimated';
|
|
6
5
|
import { useStore } from 'zustand';
|
|
7
6
|
import { getScreenComponent, isValidRoute } from "../navigation/routes.js";
|
|
8
7
|
import { useColorScheme } from "../hooks/use-color-scheme.js";
|
|
9
8
|
import { Colors } from "../constants/theme.js";
|
|
10
9
|
import BottomSheet from "./BottomSheet.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
// Re-export types for backward compatibility
|
|
10
|
+
import { bottomSheetStore, getState, showBottomSheet, closeBottomSheet, goBack, updateState } from "../navigation/bottomSheetManager.js";
|
|
14
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
export { subscribeToBottomSheetState };
|
|
16
|
-
|
|
17
|
-
// Re-export BottomSheetRef for backward compatibility
|
|
18
|
-
|
|
19
12
|
/**
|
|
20
|
-
* BottomSheetRouter -
|
|
21
|
-
*
|
|
22
|
-
* Uses custom BottomSheet component built with react-native-reanimated v4.
|
|
23
|
-
* State is managed by bottomSheetManager (single source of truth).
|
|
24
|
-
*
|
|
25
|
-
* Features:
|
|
26
|
-
* - Screen navigation with history stack
|
|
27
|
-
* - Step-based navigation for multi-step screens
|
|
28
|
-
* - Android back button handling
|
|
29
|
-
* - Minimal props passing (screens use useOxy() for context)
|
|
13
|
+
* BottomSheetRouter - Navigation container for bottom sheet screens
|
|
30
14
|
*/
|
|
31
|
-
|
|
32
|
-
const AnimatedScreenContainer = ({
|
|
33
|
-
children,
|
|
34
|
-
fadeAnim,
|
|
35
|
-
scaleAnim,
|
|
36
|
-
screenKey
|
|
37
|
-
}) => {
|
|
38
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
39
|
-
opacity: fadeAnim.value,
|
|
40
|
-
transform: [{
|
|
41
|
-
scale: scaleAnim.value
|
|
42
|
-
}]
|
|
43
|
-
}));
|
|
44
|
-
return /*#__PURE__*/_jsx(Animated.View, {
|
|
45
|
-
style: [{
|
|
46
|
-
flexShrink: 1
|
|
47
|
-
}, animatedStyle],
|
|
48
|
-
children: children
|
|
49
|
-
}, screenKey);
|
|
50
|
-
};
|
|
51
|
-
const BottomSheetRouterComponent = ({
|
|
15
|
+
const BottomSheetRouter = ({
|
|
52
16
|
onScreenChange,
|
|
53
17
|
onDismiss
|
|
54
18
|
}) => {
|
|
55
|
-
const
|
|
19
|
+
const sheetRef = useRef(null);
|
|
56
20
|
const colorScheme = useColorScheme();
|
|
57
21
|
const colors = Colors[colorScheme ?? 'light'];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
22
|
+
const prevScreenRef = useRef(null);
|
|
23
|
+
const {
|
|
24
|
+
currentScreen,
|
|
25
|
+
screenProps,
|
|
26
|
+
currentStep,
|
|
27
|
+
isOpen
|
|
28
|
+
} = useStore(bottomSheetStore);
|
|
29
|
+
const ScreenComponent = useMemo(() => currentScreen ? getScreenComponent(currentScreen) : null, [currentScreen]);
|
|
30
|
+
|
|
31
|
+
// Notify screen changes
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (prevScreenRef.current !== currentScreen) {
|
|
34
|
+
onScreenChange?.(currentScreen);
|
|
35
|
+
prevScreenRef.current = currentScreen;
|
|
71
36
|
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// Single source of truth - subscribe to manager state using Zustand
|
|
75
|
-
const state = useStore(bottomSheetStore);
|
|
37
|
+
}, [currentScreen, onScreenChange]);
|
|
76
38
|
|
|
77
|
-
//
|
|
78
|
-
const animateScreenTransition = useCallback((newScreen, newState) => {
|
|
79
|
-
// ... implementation uses newState which comes from the store ...
|
|
80
|
-
// We can just rely on the re-render from useStore, no need to manually set local state
|
|
81
|
-
// However, the animation logic relied on queueing state updates.
|
|
82
|
-
// Let's adapt it.
|
|
83
|
-
onScreenChange?.(newScreen);
|
|
84
|
-
|
|
85
|
-
// Note: The original logic tried to defer the state update (setState) until animation completed.
|
|
86
|
-
// With Zustand, the global state is already updated.
|
|
87
|
-
// The animation logic needs to react to the state change.
|
|
88
|
-
|
|
89
|
-
// Since useStore forces a re-render with the NEW state, we are already "in" the new state.
|
|
90
|
-
// To animate "out" the old screen, we would need to have captured the previous screen
|
|
91
|
-
// before the re-render, OR we accept that the transition might be slightly different.
|
|
92
|
-
|
|
93
|
-
// Actually, the original logic had `setState` to control when the UI updates.
|
|
94
|
-
// With global store, the UI updates immediately.
|
|
95
|
-
// For now, let's trust the re-render. If animation is jerky, we can revisit.
|
|
96
|
-
// But wait, the original logic:
|
|
97
|
-
// 1. Check if transitioning. If so, wait.
|
|
98
|
-
// 2. If valid change, start exit animation -> then update local state -> then enter animation.
|
|
99
|
-
|
|
100
|
-
// With Zustand, we can't "delay" the state update because it's global.
|
|
101
|
-
// So `state` (from useStore) is ALREADY the new state.
|
|
102
|
-
// We need to detect that `state.currentScreen` changed from our `previousScreenRef`.
|
|
103
|
-
}, [onScreenChange]);
|
|
104
|
-
|
|
105
|
-
// Handle screen transitions based on state changes
|
|
39
|
+
// Control visibility
|
|
106
40
|
useEffect(() => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (isScreenChange) {
|
|
111
|
-
// Logic to handle transition...
|
|
112
|
-
// Since we are already re-rendered with new state, we might see a flash of new content.
|
|
113
|
-
// Ideally we shouldn't have updated the global store until animation started...
|
|
114
|
-
// BUT `bottomSheetManager` updates the store immediately.
|
|
115
|
-
|
|
116
|
-
// For this fix, let's keep it simple: Just update the refs.
|
|
117
|
-
// The complex animation logic in the original file was trying to bridge imperative calls with React state.
|
|
118
|
-
|
|
119
|
-
previousScreenRef.current = newScreen;
|
|
120
|
-
} else if (previousScreen === null && newScreen !== null) {
|
|
121
|
-
// Opening first time
|
|
122
|
-
fadeAnim.value = 1;
|
|
123
|
-
scaleAnim.value = 1;
|
|
124
|
-
previousScreenRef.current = newScreen;
|
|
125
|
-
onScreenChange?.(newScreen);
|
|
41
|
+
if (!sheetRef.current) return;
|
|
42
|
+
if (isOpen) {
|
|
43
|
+
sheetRef.current.present();
|
|
126
44
|
} else {
|
|
127
|
-
|
|
45
|
+
sheetRef.current.dismiss();
|
|
128
46
|
}
|
|
129
|
-
|
|
130
|
-
}, [state.currentScreen, onScreenChange, fadeAnim, scaleAnim]);
|
|
47
|
+
}, [isOpen]);
|
|
131
48
|
|
|
132
|
-
//
|
|
49
|
+
// Android back button
|
|
133
50
|
useEffect(() => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
// Handle explicit dismiss - only update state, don't call dismiss again
|
|
140
|
-
const handleDismiss = useCallback(() => {
|
|
141
|
-
// Only update state, don't call dismiss() as it's already being dismissed
|
|
142
|
-
updateBottomSheetState({
|
|
143
|
-
currentScreen: null,
|
|
144
|
-
screenProps: {},
|
|
145
|
-
currentStep: undefined,
|
|
146
|
-
navigationHistory: [],
|
|
147
|
-
isOpen: false
|
|
51
|
+
if (!isOpen) return;
|
|
52
|
+
const handler = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
53
|
+
handleGoBack();
|
|
54
|
+
return true;
|
|
148
55
|
});
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
|
|
152
|
-
// Get current screen component (lazy-loaded)
|
|
153
|
-
const ScreenComponent = state.currentScreen ? getScreenComponent(state.currentScreen) : null;
|
|
154
|
-
|
|
155
|
-
// Navigation handler - validates route and updates manager state
|
|
156
|
-
// For step-based screens, step changes are treated as navigation events (added to history)
|
|
56
|
+
return () => handler.remove();
|
|
57
|
+
}, [isOpen]);
|
|
157
58
|
const navigate = useCallback((screen, props) => {
|
|
158
59
|
if (!isValidRoute(screen)) {
|
|
159
|
-
if (__DEV__) {
|
|
160
|
-
console.warn(`[BottomSheetRouter] Invalid route: ${screen}`);
|
|
161
|
-
}
|
|
60
|
+
if (__DEV__) console.warn(`[BottomSheetRouter] Invalid route: ${screen}`);
|
|
162
61
|
return;
|
|
163
62
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
// For step-based screens: if same screen but different step, treat as navigation (add to history)
|
|
169
|
-
// This allows step navigation to be handled by router with animations
|
|
170
|
-
const isStepChange = isSameScreen && newStep !== undefined && newStep !== currentStep;
|
|
171
|
-
managerShowBottomSheet(screen, props, {
|
|
172
|
-
addToHistory: !isSameScreen || isStepChange // Add to history if different screen OR step change
|
|
63
|
+
showBottomSheet({
|
|
64
|
+
screen,
|
|
65
|
+
props
|
|
173
66
|
});
|
|
174
|
-
}, [state.currentScreen, state.currentStep, state.screenProps]);
|
|
175
|
-
|
|
176
|
-
// Step change handler for step-based screens
|
|
177
|
-
// This is called by StepBasedScreen to notify router of step changes
|
|
178
|
-
// The router now handles step navigation through navigate/goBack, so this is mainly for compatibility
|
|
179
|
-
const handleStepChange = useCallback((step, _totalSteps) => {
|
|
180
|
-
// Step changes are now handled through navigate/goBack, but we still update currentStep
|
|
181
|
-
// for screens that might query it directly
|
|
182
|
-
if (state.currentScreen) {
|
|
183
|
-
updateBottomSheetState({
|
|
184
|
-
currentStep: step,
|
|
185
|
-
screenProps: {
|
|
186
|
-
...state.screenProps,
|
|
187
|
-
initialStep: step
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}, [state.currentScreen, state.screenProps]);
|
|
192
|
-
|
|
193
|
-
// Check if the bottom sheet can be dismissed (no navigation history or steps to go back to)
|
|
194
|
-
const canDismiss = useCallback(() => {
|
|
195
|
-
// Use global state to avoid stale closures during transitions
|
|
196
|
-
const currentState = getBottomSheetState();
|
|
197
|
-
|
|
198
|
-
// Check if there's navigation history
|
|
199
|
-
if (currentState.navigationHistory.length > 0) {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Check if there are steps to go back to
|
|
204
|
-
const initialStep = typeof currentState.screenProps?.initialStep === 'number' ? currentState.screenProps.initialStep : undefined;
|
|
205
|
-
const currentStep = currentState.currentStep ?? initialStep ?? 0;
|
|
206
|
-
const isStepBased = initialStep !== undefined || currentState.currentStep !== undefined;
|
|
207
|
-
if (isStepBased && typeof currentStep === 'number' && currentStep > 0) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// No history and on step 0 (or not step-based) - can dismiss
|
|
212
|
-
return true;
|
|
213
67
|
}, []);
|
|
68
|
+
const handleGoBack = useCallback(() => {
|
|
69
|
+
const state = getState();
|
|
214
70
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
const goBack = useCallback(() => {
|
|
220
|
-
// Use global state to avoid stale closures during transitions
|
|
221
|
-
const currentState = getBottomSheetState();
|
|
222
|
-
|
|
223
|
-
// Priority 1: Screen history
|
|
224
|
-
if (currentState.navigationHistory.length > 0) {
|
|
225
|
-
const wentBack = managerGoBack();
|
|
226
|
-
if (wentBack) {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
71
|
+
// Try history first
|
|
72
|
+
if (state.history.length > 0) {
|
|
73
|
+
goBack();
|
|
74
|
+
return true;
|
|
229
75
|
}
|
|
230
76
|
|
|
231
|
-
//
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
const previousStep = currentStep - 1;
|
|
237
|
-
updateBottomSheetState({
|
|
77
|
+
// Try step back
|
|
78
|
+
const step = state.currentStep ?? 0;
|
|
79
|
+
if (step > 0) {
|
|
80
|
+
updateState({
|
|
81
|
+
currentStep: step - 1,
|
|
238
82
|
screenProps: {
|
|
239
|
-
...
|
|
240
|
-
initialStep:
|
|
241
|
-
}
|
|
242
|
-
currentStep: previousStep
|
|
83
|
+
...state.screenProps,
|
|
84
|
+
initialStep: step - 1
|
|
85
|
+
}
|
|
243
86
|
});
|
|
244
87
|
return true;
|
|
245
88
|
}
|
|
246
89
|
|
|
247
|
-
//
|
|
248
|
-
|
|
90
|
+
// Close
|
|
91
|
+
closeBottomSheet();
|
|
249
92
|
return true;
|
|
250
93
|
}, []);
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
94
|
+
const canDismiss = useCallback(() => {
|
|
95
|
+
const state = getState();
|
|
96
|
+
if (state.history.length > 0) return false;
|
|
97
|
+
const step = state.currentStep ?? 0;
|
|
98
|
+
return step <= 0;
|
|
99
|
+
}, []);
|
|
100
|
+
const handleDismissAttempt = useCallback(() => {
|
|
101
|
+
if (!canDismiss()) {
|
|
102
|
+
handleGoBack();
|
|
103
|
+
return false;
|
|
256
104
|
}
|
|
257
|
-
|
|
258
|
-
|
|
105
|
+
return true;
|
|
106
|
+
}, [canDismiss, handleGoBack]);
|
|
107
|
+
const handleDismiss = useCallback(() => {
|
|
108
|
+
closeBottomSheet();
|
|
109
|
+
onDismiss?.();
|
|
110
|
+
}, [onDismiss]);
|
|
111
|
+
const handleStepChange = useCallback(step => {
|
|
112
|
+
const state = getState();
|
|
113
|
+
updateState({
|
|
114
|
+
currentStep: step,
|
|
115
|
+
screenProps: {
|
|
116
|
+
...state.screenProps,
|
|
117
|
+
initialStep: step
|
|
118
|
+
}
|
|
259
119
|
});
|
|
260
|
-
|
|
261
|
-
backHandler.remove();
|
|
262
|
-
};
|
|
263
|
-
}, [state.isOpen, goBack]);
|
|
264
|
-
|
|
265
|
-
// Present modal when state changes to open
|
|
266
|
-
// This must be before any early returns to follow rules of hooks
|
|
267
|
-
useEffect(() => {
|
|
268
|
-
if (state.isOpen && bottomSheetRef.current) {
|
|
269
|
-
bottomSheetRef.current.present();
|
|
270
|
-
}
|
|
271
|
-
}, [state.isOpen]);
|
|
272
|
-
|
|
273
|
-
// Minimal screen props - only navigation-specific
|
|
274
|
-
// Screens should use useOxy() hook for OxyContext values (user, sessions, etc.)
|
|
275
|
-
// Calculate initialStep first, ensuring it's always a number or undefined
|
|
276
|
-
const calculatedInitialStep = typeof state.currentStep === 'number' ? state.currentStep : typeof state.screenProps?.initialStep === 'number' ? state.screenProps.initialStep : undefined;
|
|
277
|
-
|
|
278
|
-
// Extract screenProps without initialStep to avoid conflicts
|
|
279
|
-
const {
|
|
280
|
-
initialStep: _,
|
|
281
|
-
...otherScreenProps
|
|
282
|
-
} = state.screenProps;
|
|
120
|
+
}, []);
|
|
283
121
|
const scrollTo = useCallback((y, animated) => {
|
|
284
|
-
|
|
122
|
+
sheetRef.current?.scrollTo(y, animated);
|
|
285
123
|
}, []);
|
|
286
|
-
const screenProps = {
|
|
287
|
-
navigate,
|
|
288
|
-
goBack,
|
|
289
|
-
onClose: () => managerCloseBottomSheet(),
|
|
290
|
-
onAuthenticated: () => managerCloseBottomSheet(),
|
|
291
|
-
theme: colorScheme ?? 'light',
|
|
292
|
-
currentScreen: state.currentScreen ?? undefined,
|
|
293
|
-
initialStep: calculatedInitialStep,
|
|
294
|
-
onStepChange: handleStepChange,
|
|
295
|
-
scrollTo,
|
|
296
|
-
// Pass scrollTo method
|
|
297
|
-
...otherScreenProps
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
// renderBackground must be called before any conditional returns (React hooks rule)
|
|
301
124
|
const renderBackground = useCallback(props => /*#__PURE__*/_jsx(View, {
|
|
302
125
|
style: [styles.background, {
|
|
303
126
|
backgroundColor: colors.background
|
|
304
127
|
}, props.style]
|
|
305
128
|
}), [colors.background]);
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
129
|
+
const screenPropsValue = useMemo(() => {
|
|
130
|
+
const {
|
|
131
|
+
initialStep: _,
|
|
132
|
+
...rest
|
|
133
|
+
} = screenProps;
|
|
134
|
+
return {
|
|
135
|
+
navigate,
|
|
136
|
+
goBack: handleGoBack,
|
|
137
|
+
onClose: closeBottomSheet,
|
|
138
|
+
onAuthenticated: closeBottomSheet,
|
|
139
|
+
theme: colorScheme ?? 'light',
|
|
140
|
+
currentScreen: currentScreen ?? undefined,
|
|
141
|
+
initialStep: currentStep ?? screenProps?.initialStep,
|
|
142
|
+
onStepChange: handleStepChange,
|
|
143
|
+
scrollTo,
|
|
144
|
+
...rest
|
|
145
|
+
};
|
|
146
|
+
}, [navigate, handleGoBack, colorScheme, currentScreen, currentStep, screenProps, handleStepChange, scrollTo]);
|
|
322
147
|
return /*#__PURE__*/_jsx(BottomSheet, {
|
|
323
|
-
ref:
|
|
148
|
+
ref: sheetRef,
|
|
324
149
|
enablePanDownToClose: true,
|
|
325
|
-
backgroundComponent: renderBackground,
|
|
326
150
|
enableHandlePanningGesture: true,
|
|
151
|
+
backgroundComponent: renderBackground,
|
|
327
152
|
style: styles.container,
|
|
328
153
|
onDismiss: handleDismiss,
|
|
329
154
|
onDismissAttempt: handleDismissAttempt,
|
|
330
|
-
children: /*#__PURE__*/_jsx(
|
|
331
|
-
|
|
332
|
-
scaleAnim: scaleAnim,
|
|
333
|
-
screenKey: state.currentScreen,
|
|
334
|
-
children: /*#__PURE__*/_jsx(ScreenComponent, {
|
|
335
|
-
...screenProps
|
|
336
|
-
})
|
|
155
|
+
children: ScreenComponent && currentScreen && /*#__PURE__*/_jsx(ScreenComponent, {
|
|
156
|
+
...screenPropsValue
|
|
337
157
|
})
|
|
338
158
|
});
|
|
339
159
|
};
|
|
340
|
-
const BottomSheetRouter = /*#__PURE__*/React.memo(BottomSheetRouterComponent);
|
|
341
|
-
BottomSheetRouter.displayName = 'BottomSheetRouter';
|
|
342
160
|
const styles = StyleSheet.create({
|
|
343
161
|
container: {
|
|
344
162
|
maxWidth: 800,
|
|
@@ -352,5 +170,5 @@ const styles = StyleSheet.create({
|
|
|
352
170
|
overflow: 'hidden'
|
|
353
171
|
}
|
|
354
172
|
});
|
|
355
|
-
export default BottomSheetRouter;
|
|
173
|
+
export default /*#__PURE__*/React.memo(BottomSheetRouter);
|
|
356
174
|
//# sourceMappingURL=BottomSheetRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useEffect","useCallback","BackHandler","View","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","useRef","useEffect","useCallback","useMemo","BackHandler","View","StyleSheet","useStore","getScreenComponent","isValidRoute","useColorScheme","Colors","BottomSheet","bottomSheetStore","getState","showBottomSheet","closeBottomSheet","goBack","updateState","jsx","_jsx","BottomSheetRouter","onScreenChange","onDismiss","sheetRef","colorScheme","colors","prevScreenRef","currentScreen","screenProps","currentStep","isOpen","ScreenComponent","current","present","dismiss","handler","addEventListener","handleGoBack","remove","navigate","screen","props","__DEV__","console","warn","state","history","length","step","initialStep","canDismiss","handleDismissAttempt","handleDismiss","handleStepChange","scrollTo","y","animated","renderBackground","style","styles","background","backgroundColor","screenPropsValue","_","rest","onClose","onAuthenticated","theme","undefined","onStepChange","ref","enablePanDownToClose","enableHandlePanningGesture","backgroundComponent","container","onDismissAttempt","children","create","maxWidth","width","alignSelf","marginHorizontal","borderTopLeftRadius","borderTopRightRadius","overflow","memo"],"sourceRoot":"../../../../src","sources":["ui/components/BottomSheetRouter.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACtE,SAASC,WAAW,EAAEC,IAAI,EAAEC,UAAU,QAAwC,cAAc;AAC5F,SAASC,QAAQ,QAAQ,SAAS;AAElC,SAASC,kBAAkB,EAAEC,YAAY,QAAQ,yBAAsB;AAEvE,SAASC,cAAc,QAAQ,8BAA2B;AAC1D,SAASC,MAAM,QAAQ,uBAAoB;AAC3C,OAAOC,WAAW,MAA+B,kBAAe;AAChE,SACIC,gBAAgB,EAChBC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,EAChBC,MAAM,EACNC,WAAW,QACR,qCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAO1C;AACA;AACA;AACA,MAAMC,iBAAmD,GAAGA,CAAC;EAAEC,cAAc;EAAEC;AAAU,CAAC,KAAK;EAC3F,MAAMC,QAAQ,GAAGxB,MAAM,CAAiB,I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EnD,gBAAgB;MACjCoD,KAAK,EAAE3C,WAAW,IAAI,OAAO;MAC7BG,aAAa,EAAEA,aAAa,IAAIyC,SAAS;MACzCnB,WAAW,EAAEpB,WAAW,IAAKD,WAAW,EAAEqB,WAAkC;MAC5EoB,YAAY,EAAEhB,gBAAgB;MAC9BC,QAAQ;MACR,GAAGU;IACP,CAAC;EACL,CAAC,EAAE,CAACzB,QAAQ,EAAEF,YAAY,EAAEb,WAAW,EAAEG,aAAa,EAAEE,WAAW,EAAED,WAAW,EAAEyB,gBAAgB,EAAEC,QAAQ,CAAC,CAAC;EAE9G,oBACInC,IAAA,CAACR,WAAW;IACR2D,GAAG,EAAE/C,QAAS;IACdgD,oBAAoB;IACpBC,0BAA0B;IAC1BC,mBAAmB,EAAEhB,gBAAiB;IACtCC,KAAK,EAAEC,MAAM,CAACe,SAAU;IACxBpD,SAAS,EAAE8B,aAAc;IACzBuB,gBAAgB,EAAExB,oBAAqB;IAAAyB,QAAA,EAEtC7C,eAAe,IAAIJ,aAAa,iBAAIR,IAAA,CAACY,eAAe;MAAA,GAAK+B;IAAgB,CAAG;EAAC,CACrE,CAAC;AAEtB,CAAC;AAED,MAAMH,MAAM,GAAGtD,UAAU,CAACwE,MAAM,CAAC;EAC7BH,SAAS,EAAE;IACPI,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE,QAAQ;IACnBC,gBAAgB,EAAE;EACtB,CAAC;EACDrB,UAAU,EAAE;IACRsB,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,QAAQ,EAAE;EACd;AACJ,CAAC,CAAC;AAEF,4BAAetF,KAAK,CAACuF,IAAI,CAACjE,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,6 @@ import { Ionicons } from '@expo/vector-icons';
|
|
|
6
6
|
// @ts-ignore - MaterialCommunityIcons is available at runtime
|
|
7
7
|
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
8
8
|
import { useColorScheme } from "../hooks/use-color-scheme.js";
|
|
9
|
-
import { useHapticPress } from "../hooks/use-haptic-press.js";
|
|
10
9
|
import { darkenColor } from "../utils/colorUtils.js";
|
|
11
10
|
import { normalizeColorScheme } from "../utils/themeUtils.js";
|
|
12
11
|
import { Colors } from "../constants/theme.js";
|
|
@@ -69,11 +68,9 @@ const GroupedItemComponent = ({
|
|
|
69
68
|
color: colors.icon
|
|
70
69
|
})]
|
|
71
70
|
});
|
|
72
|
-
const handlePressIn = useHapticPress();
|
|
73
71
|
if (onPress && !disabled) {
|
|
74
72
|
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
75
73
|
style: itemStyles,
|
|
76
|
-
onPressIn: disabled ? undefined : handlePressIn,
|
|
77
74
|
onPress: onPress,
|
|
78
75
|
activeOpacity: 0.7,
|
|
79
76
|
accessibilityRole: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useMemo","View","Text","TouchableOpacity","StyleSheet","Ionicons","MaterialCommunityIcons","useColorScheme","
|
|
1
|
+
{"version":3,"names":["React","memo","useMemo","View","Text","TouchableOpacity","StyleSheet","Ionicons","MaterialCommunityIcons","useColorScheme","darkenColor","normalizeColorScheme","Colors","jsx","_jsx","jsxs","_jsxs","GroupedItemComponent","icon","iconColor","title","subtitle","onPress","isFirst","isLast","showChevron","disabled","customContent","customIcon","accessibilityLabel","accessibilityHint","hookColorScheme","colorScheme","colors","finalIconColor","iconSecurity","itemStyles","styles","groupedItem","firstGroupedItem","lastGroupedItem","backgroundColor","card","content","style","groupedItemContent","children","actionIcon","iconContainer","name","size","color","actionTextContainer","actionButtonText","text","actionButtonSubtext","secondaryText","activeOpacity","accessibilityRole","accessibilityState","displayName","GroupedItem","create","flexDirection","alignItems","justifyContent","overflow","width","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","paddingVertical","paddingHorizontal","gap","height","borderRadius","flex","fontSize","fontWeight","marginTop"],"sourceR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AAE,EAAE;IAChBZ,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;IAChB;EACJ,CAAC;EACDb,mBAAmB,EAAE;IACjByB,IAAI,EAAE;EACV,CAAC;EACDxB,gBAAgB,EAAE;IACdyB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EAChB,CAAC;EACDxB,mBAAmB,EAAE;IACjBuB,QAAQ,EAAE,EAAE;IACZE,SAAS,EAAE;EACf;AACJ,CAAC,CAAC;AAEF,eAAenB,WAAW","ignoreList":[]}
|
|
@@ -18,21 +18,28 @@ setupFonts();
|
|
|
18
18
|
// Detect if running on web
|
|
19
19
|
const isWeb = Platform.OS === 'web';
|
|
20
20
|
|
|
21
|
-
// Conditionally import
|
|
21
|
+
// Conditionally import components
|
|
22
22
|
let KeyboardProvider = ({
|
|
23
23
|
children
|
|
24
24
|
}) => children;
|
|
25
|
-
let BottomSheetRouter =
|
|
25
|
+
let BottomSheetRouter = null;
|
|
26
|
+
|
|
27
|
+
// KeyboardProvider only on native
|
|
26
28
|
if (!isWeb) {
|
|
27
29
|
try {
|
|
28
|
-
// Only import on native platforms
|
|
29
30
|
KeyboardProvider = require('react-native-keyboard-controller').KeyboardProvider;
|
|
30
|
-
BottomSheetRouter = require('./BottomSheetRouter').default;
|
|
31
31
|
} catch {
|
|
32
|
-
//
|
|
32
|
+
// KeyboardProvider not available
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// BottomSheetRouter works on all platforms
|
|
37
|
+
try {
|
|
38
|
+
BottomSheetRouter = require('./BottomSheetRouter').default;
|
|
39
|
+
} catch {
|
|
40
|
+
// BottomSheetRouter not available
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
/**
|
|
37
44
|
* OxyProvider - Universal provider for Expo apps (native + web)
|
|
38
45
|
*
|
|
@@ -187,23 +194,11 @@ const OxyProvider = ({
|
|
|
187
194
|
authRedirectUri: authRedirectUri,
|
|
188
195
|
storageKeyPrefix: storageKeyPrefix,
|
|
189
196
|
onAuthStateChange: onAuthStateChange,
|
|
190
|
-
children: [children,
|
|
197
|
+
children: [children, BottomSheetRouter && /*#__PURE__*/_jsx(BottomSheetRouter, {}), /*#__PURE__*/_jsx(Toaster, {})]
|
|
191
198
|
})
|
|
192
199
|
});
|
|
193
200
|
|
|
194
|
-
//
|
|
195
|
-
if (isWeb) {
|
|
196
|
-
return /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
197
|
-
children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
198
|
-
style: {
|
|
199
|
-
flex: 1
|
|
200
|
-
},
|
|
201
|
-
children: coreContent
|
|
202
|
-
})
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// On native, full wrappers including KeyboardProvider
|
|
201
|
+
// All platforms use same wrapper (KeyboardProvider is passthrough on web)
|
|
207
202
|
return /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
208
203
|
children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
209
204
|
style: {
|