@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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useState","AppState","Platform","GestureHandlerRootView","SafeAreaProvider","OxyContextProvider","QueryClientProvider","focusManager","onlineManager","setupFonts","Toaster","createQueryClient","createPlatformStorage","jsx","_jsx","jsxs","_jsxs","isWeb","OS","KeyboardProvider","children","BottomSheetRouter","require","default","OxyProvider","oxyServices","onAuthStateChange","storageKeyPrefix","baseURL","authWebUrl","authRedirectUri","queryClient","providedQueryClient","storageRef","queryClientRef","setQueryClient","current","mounted","then","storage","client","catch","error","__DEV__","console","warn","handleVisibilityChange","setFocused","document","visibilityState","addEventListener","removeEventListener","subscription","state","remove","cleanup","setupNetworkMonitoring","setOnline","navigator","onLine","handleOnline","handleOffline","window","NetInfo","fetch","isConnected","unsubscribe","coreContent","style","flex"],"sourceRoot":"../../../../src","sources":["ui/components/OxyProvider.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAiB,OAAO;AAC5D,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AACjD,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,gBAAgB,QAAQ,gCAAgC;AAEjE,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,mBAAmB,EAAEC,YAAY,EAAEC,aAAa,QAAQ,uBAAuB;AACxF,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,iBAAiB,QAAQ,yBAAsB;AACxD,SAASC,qBAAqB,QAA+B,4BAAyB;;AAEtF;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACAP,UAAU,CAAC,CAAC;;AAEZ;AACA,MAAMQ,KAAK,GAAGf,QAAQ,CAACgB,EAAE,KAAK,KAAK;;AAEnC;AACA,IAAIC,gBAAqB,GAAGA,CAAC;EAAEC;AAAc,CAAC,KAAKA,QAAQ;AAC3D,IAAIC,iBAAsB,
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useState","AppState","Platform","GestureHandlerRootView","SafeAreaProvider","OxyContextProvider","QueryClientProvider","focusManager","onlineManager","setupFonts","Toaster","createQueryClient","createPlatformStorage","jsx","_jsx","jsxs","_jsxs","isWeb","OS","KeyboardProvider","children","BottomSheetRouter","require","default","OxyProvider","oxyServices","onAuthStateChange","storageKeyPrefix","baseURL","authWebUrl","authRedirectUri","queryClient","providedQueryClient","storageRef","queryClientRef","setQueryClient","current","mounted","then","storage","client","catch","error","__DEV__","console","warn","handleVisibilityChange","setFocused","document","visibilityState","addEventListener","removeEventListener","subscription","state","remove","cleanup","setupNetworkMonitoring","setOnline","navigator","onLine","handleOnline","handleOffline","window","NetInfo","fetch","isConnected","unsubscribe","coreContent","style","flex"],"sourceRoot":"../../../../src","sources":["ui/components/OxyProvider.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAiB,OAAO;AAC5D,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AACjD,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,gBAAgB,QAAQ,gCAAgC;AAEjE,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,mBAAmB,EAAEC,YAAY,EAAEC,aAAa,QAAQ,uBAAuB;AACxF,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,iBAAiB,QAAQ,yBAAsB;AACxD,SAASC,qBAAqB,QAA+B,4BAAyB;;AAEtF;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACAP,UAAU,CAAC,CAAC;;AAEZ;AACA,MAAMQ,KAAK,GAAGf,QAAQ,CAACgB,EAAE,KAAK,KAAK;;AAEnC;AACA,IAAIC,gBAAqB,GAAGA,CAAC;EAAEC;AAAc,CAAC,KAAKA,QAAQ;AAC3D,IAAIC,iBAAsB,GAAG,IAAI;;AAEjC;AACA,IAAI,CAACJ,KAAK,EAAE;EACR,IAAI;IACAE,gBAAgB,GAAGG,OAAO,CAAC,kCAAkC,CAAC,CAACH,gBAAgB;EACnF,CAAC,CAAC,MAAM;IACJ;EAAA;AAER;;AAEA;AACA,IAAI;EACAE,iBAAiB,GAAGC,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;AAC9D,CAAC,CAAC,MAAM;EACJ;AAAA;;AAGJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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D,iBAAiB,EAAEA,iBAAyB;MAAAN,QAAA,GAE3CA,QAAQ,EAERC,iBAAiB,iBAAIP,IAAA,CAACO,iBAAiB,IAAE,CAAC,eAC3CP,IAAA,CAACJ,OAAO,IAAE,CAAC;IAAA,CACK;EAAC,CACJ,CACxB;;EAED;EACA,oBACII,IAAA,CAACV,gBAAgB;IAAAgB,QAAA,eACbN,IAAA,CAACX,sBAAsB;MAACiE,KAAK,EAAE;QAAEC,IAAI,EAAE;MAAE,CAAE;MAAAjD,QAAA,eACvCN,IAAA,CAACK,gBAAgB;QAAAC,QAAA,EACZ+C;MAAW,CACE;IAAC,CACC;EAAC,CACX,CAAC;AAE3B,CAAC;AAED,eAAe3C,WAAW","ignoreList":[]}
|
|
@@ -4,165 +4,67 @@ import { isValidRoute } from "./routes.js";
|
|
|
4
4
|
import { createStore } from 'zustand/vanilla';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Bottom Sheet Manager
|
|
8
|
-
*
|
|
9
|
-
* Uses Zustand (vanilla) for robust state management without React dependencies.
|
|
10
|
-
* This ensures the manager can be imported safely anywhere.
|
|
7
|
+
* Bottom Sheet State Manager
|
|
11
8
|
*/
|
|
12
9
|
|
|
13
|
-
// Initial state
|
|
14
10
|
const initialState = {
|
|
15
11
|
currentScreen: null,
|
|
16
12
|
screenProps: {},
|
|
17
13
|
currentStep: undefined,
|
|
18
|
-
|
|
14
|
+
history: [],
|
|
19
15
|
isOpen: false
|
|
20
16
|
};
|
|
21
|
-
|
|
22
|
-
// Create vanilla store
|
|
23
17
|
export const bottomSheetStore = createStore(() => initialState);
|
|
18
|
+
export const getState = () => bottomSheetStore.getState();
|
|
19
|
+
export const showBottomSheet = screenOrConfig => {
|
|
20
|
+
const screen = typeof screenOrConfig === 'string' ? screenOrConfig : screenOrConfig.screen;
|
|
21
|
+
const props = typeof screenOrConfig === 'string' ? {} : screenOrConfig.props || {};
|
|
22
|
+
if (!isValidRoute(screen)) {
|
|
23
|
+
if (__DEV__) console.warn(`[BottomSheet] Invalid route: ${screen}`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const state = bottomSheetStore.getState();
|
|
24
27
|
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
let bottomSheetRef = null;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Set the bottom sheet ref so showBottomSheet can control it
|
|
31
|
-
*/
|
|
32
|
-
export const setBottomSheetRef = ref => {
|
|
33
|
-
bottomSheetRef = ref;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Update the bottom sheet state
|
|
38
|
-
* (Kept for backward compatibility, but prefer using store directly if possible)
|
|
39
|
-
*/
|
|
40
|
-
export const updateBottomSheetState = updates => {
|
|
41
|
-
bottomSheetStore.setState(state => ({
|
|
42
|
-
...state,
|
|
43
|
-
...updates
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Subscribe to bottom sheet state changes
|
|
49
|
-
* (Wrapper around store.subscribe for backward compatibility)
|
|
50
|
-
*/
|
|
51
|
-
export const subscribeToBottomSheetState = listener => {
|
|
52
|
-
return bottomSheetStore.subscribe(listener);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get the current bottom sheet state
|
|
57
|
-
* (Wrapper around store.getState for backward compatibility)
|
|
58
|
-
*/
|
|
59
|
-
export const getBottomSheetState = () => {
|
|
60
|
-
return bottomSheetStore.getState();
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Show the bottom sheet with a specific screen (internal - no route validation)
|
|
65
|
-
*/
|
|
66
|
-
export const managerShowBottomSheet = (screen, props, options) => {
|
|
67
|
-
const currentState = bottomSheetStore.getState();
|
|
68
|
-
const addToHistory = options?.addToHistory !== false; // Default to true
|
|
69
|
-
|
|
70
|
-
// If adding to history and there's a current screen, push it to history
|
|
71
|
-
if (addToHistory && currentState.currentScreen) {
|
|
72
|
-
const historyEntry = {
|
|
73
|
-
screen: currentState.currentScreen,
|
|
74
|
-
props: {
|
|
75
|
-
...currentState.screenProps
|
|
76
|
-
},
|
|
77
|
-
step: currentState.currentStep
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
// We need to create a new array for immutability
|
|
81
|
-
const newHistory = [...currentState.navigationHistory, historyEntry];
|
|
28
|
+
// Push current screen to history if navigating to different screen
|
|
29
|
+
if (state.currentScreen && state.currentScreen !== screen) {
|
|
82
30
|
bottomSheetStore.setState({
|
|
83
|
-
|
|
31
|
+
history: [...state.history, {
|
|
32
|
+
screen: state.currentScreen,
|
|
33
|
+
props: state.screenProps,
|
|
34
|
+
step: state.currentStep
|
|
35
|
+
}]
|
|
84
36
|
});
|
|
85
37
|
}
|
|
86
|
-
|
|
87
|
-
// Determine the new step
|
|
88
|
-
const newStep = options?.step ?? (props?.initialStep !== undefined ? props.initialStep : addToHistory ? undefined : currentState.currentStep);
|
|
89
38
|
bottomSheetStore.setState({
|
|
90
39
|
currentScreen: screen,
|
|
91
|
-
screenProps: props
|
|
92
|
-
currentStep:
|
|
40
|
+
screenProps: props,
|
|
41
|
+
currentStep: typeof props.initialStep === 'number' ? props.initialStep : undefined,
|
|
93
42
|
isOpen: true
|
|
94
43
|
});
|
|
95
|
-
|
|
96
|
-
// Present the sheet after state update
|
|
97
|
-
if (bottomSheetRef?.current) {
|
|
98
|
-
bottomSheetRef.current.present();
|
|
99
|
-
}
|
|
100
44
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* Close the bottom sheet (internal)
|
|
104
|
-
*/
|
|
105
|
-
export const managerCloseBottomSheet = () => {
|
|
106
|
-
bottomSheetStore.setState({
|
|
107
|
-
currentScreen: null,
|
|
108
|
-
screenProps: {},
|
|
109
|
-
currentStep: undefined,
|
|
110
|
-
navigationHistory: [],
|
|
111
|
-
isOpen: false
|
|
112
|
-
});
|
|
113
|
-
if (bottomSheetRef?.current) {
|
|
114
|
-
bottomSheetRef.current.dismiss();
|
|
115
|
-
}
|
|
45
|
+
export const closeBottomSheet = () => {
|
|
46
|
+
bottomSheetStore.setState(initialState);
|
|
116
47
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
const currentState = bottomSheetStore.getState();
|
|
124
|
-
|
|
125
|
-
// If there's history, pop and navigate to previous screen
|
|
126
|
-
if (currentState.navigationHistory.length > 0) {
|
|
127
|
-
const previous = currentState.navigationHistory[currentState.navigationHistory.length - 1];
|
|
128
|
-
const newHistory = currentState.navigationHistory.slice(0, -1);
|
|
48
|
+
export const goBack = () => {
|
|
49
|
+
const {
|
|
50
|
+
history
|
|
51
|
+
} = bottomSheetStore.getState();
|
|
52
|
+
if (history.length > 0) {
|
|
53
|
+
const prev = history[history.length - 1];
|
|
129
54
|
bottomSheetStore.setState({
|
|
130
|
-
currentScreen:
|
|
131
|
-
screenProps:
|
|
132
|
-
currentStep:
|
|
133
|
-
|
|
134
|
-
isOpen: true
|
|
55
|
+
currentScreen: prev.screen,
|
|
56
|
+
screenProps: prev.props,
|
|
57
|
+
currentStep: prev.step,
|
|
58
|
+
history: history.slice(0, -1)
|
|
135
59
|
});
|
|
136
60
|
return true;
|
|
137
61
|
}
|
|
138
62
|
return false;
|
|
139
63
|
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
let screen;
|
|
146
|
-
let props = {};
|
|
147
|
-
if (typeof screenOrConfig === 'string') {
|
|
148
|
-
screen = screenOrConfig;
|
|
149
|
-
} else {
|
|
150
|
-
screen = screenOrConfig.screen;
|
|
151
|
-
props = screenOrConfig.props || {};
|
|
152
|
-
}
|
|
153
|
-
if (!isValidRoute(screen)) {
|
|
154
|
-
if (__DEV__) {
|
|
155
|
-
console.warn(`[BottomSheetAPI] Invalid route: ${screen}`);
|
|
156
|
-
}
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
managerShowBottomSheet(screen, props);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Public API for closing bottom sheets
|
|
164
|
-
*/
|
|
165
|
-
export const closeBottomSheet = () => {
|
|
166
|
-
managerCloseBottomSheet();
|
|
64
|
+
export const updateState = updates => {
|
|
65
|
+
bottomSheetStore.setState(state => ({
|
|
66
|
+
...state,
|
|
67
|
+
...updates
|
|
68
|
+
}));
|
|
167
69
|
};
|
|
168
70
|
//# sourceMappingURL=bottomSheetManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isValidRoute","createStore","initialState","currentScreen","screenProps","currentStep","undefined","
|
|
1
|
+
{"version":3,"names":["isValidRoute","createStore","initialState","currentScreen","screenProps","currentStep","undefined","history","isOpen","bottomSheetStore","getState","showBottomSheet","screenOrConfig","screen","props","__DEV__","console","warn","state","setState","step","initialStep","closeBottomSheet","goBack","length","prev","slice","updateState","updates"],"sourceRoot":"../../../../src","sources":["ui/navigation/bottomSheetManager.ts"],"mappings":";;AACA,SAASA,YAAY,QAAQ,aAAU;AACvC,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;;AAUA,MAAMC,YAA8B,GAAG;EACnCC,aAAa,EAAE,IAAI;EACnBC,WAAW,EAAE,CAAC,CAAC;EACfC,WAAW,EAAEC,SAAS;EACtBC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAGR,WAAW,CAAmB,MAAMC,YAAY,CAAC;AAEjF,OAAO,MAAMQ,QAAQ,GAAGA,CAAA,KAAMD,gBAAgB,CAACC,QAAQ,CAAC,CAAC;AAEzD,OAAO,MAAMC,eAAe,GACxBC,cAAkF,IAC3E;EACP,MAAMC,MAAM,GAAG,OAAOD,cAAc,KAAK,QAAQ,GAAGA,cAAc,GAAGA,cAAc,CAACC,MAAM;EAC1F,MAAMC,KAAK,GAAG,OAAOF,cAAc,KAAK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EAAEsB,IAAI,CAACZ,MAAM;MAC1BT,WAAW,EAAEqB,IAAI,CAACX,KAAK;MACvBT,WAAW,EAAEoB,IAAI,CAACL,IAAI;MACtBb,OAAO,EAAEA,OAAO,CAACmB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC;IACF,OAAO,IAAI;EACf;EAEA,OAAO,KAAK;AAChB,CAAC;AAED,OAAO,MAAMC,WAAW,GAAIC,OAAkC,IAAK;EAC/DnB,gBAAgB,CAACU,QAAQ,CAAED,KAAK,KAAM;IAAE,GAAGA,KAAK;IAAE,GAAGU;EAAQ,CAAC,CAAC,CAAC;AACpE,CAAC","ignoreList":[]}
|
|
@@ -16,7 +16,6 @@ import { useThemeStyles } from "../hooks/useThemeStyles.js";
|
|
|
16
16
|
import { useColorScheme } from "../hooks/use-color-scheme.js";
|
|
17
17
|
import { Colors } from "../constants/theme.js";
|
|
18
18
|
import { normalizeColorScheme, normalizeTheme } from "../utils/themeUtils.js";
|
|
19
|
-
import { useHapticPress } from "../hooks/use-haptic-press.js";
|
|
20
19
|
import { EditDisplayNameModal } from "../components/profile/EditDisplayNameModal.js";
|
|
21
20
|
import { EditUsernameModal } from "../components/profile/EditUsernameModal.js";
|
|
22
21
|
import { EditEmailModal } from "../components/profile/EditEmailModal.js";
|
|
@@ -138,7 +137,6 @@ const AccountSettingsScreen = ({
|
|
|
138
137
|
// Get theme colors using centralized hook
|
|
139
138
|
const colorScheme = useColorScheme();
|
|
140
139
|
const themeStyles = useThemeStyles(theme || 'light', colorScheme);
|
|
141
|
-
const handlePressIn = useHapticPress();
|
|
142
140
|
|
|
143
141
|
// Extract colors for convenience - ensure it's always defined
|
|
144
142
|
// useThemeStyles always returns colors, but add safety check for edge cases
|