@oxyhq/services 22.8.7 → 22.9.0

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.
Files changed (116) hide show
  1. package/lib/commonjs/ui/components/OxyAccountDialog.js +30 -39
  2. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -1
  3. package/lib/commonjs/ui/components/OxyProvider.js +9 -29
  4. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  5. package/lib/commonjs/ui/components/SurfaceScreen.js +146 -0
  6. package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -0
  7. package/lib/commonjs/ui/context/OxyContext.js +32 -1
  8. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  9. package/lib/commonjs/ui/navigation/bottomSheetManager.js +38 -56
  10. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  11. package/lib/commonjs/ui/navigation/routes.js +7 -57
  12. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  13. package/lib/commonjs/ui/navigation/surfaceNavStack.js +98 -0
  14. package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -0
  15. package/lib/commonjs/ui/navigation/surfaceRegistry.js +108 -0
  16. package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -0
  17. package/lib/commonjs/ui/navigation/surfaces.js +219 -0
  18. package/lib/commonjs/ui/navigation/surfaces.js.map +1 -0
  19. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +9 -7
  20. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  21. package/lib/commonjs/ui/types/surfaceScreen.js +6 -0
  22. package/lib/commonjs/ui/types/surfaceScreen.js.map +1 -0
  23. package/lib/module/ui/components/OxyAccountDialog.js +31 -40
  24. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -1
  25. package/lib/module/ui/components/OxyProvider.js +10 -30
  26. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  27. package/lib/module/ui/components/SurfaceScreen.js +141 -0
  28. package/lib/module/ui/components/SurfaceScreen.js.map +1 -0
  29. package/lib/module/ui/context/OxyContext.js +32 -1
  30. package/lib/module/ui/context/OxyContext.js.map +1 -1
  31. package/lib/module/ui/navigation/bottomSheetManager.js +37 -53
  32. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  33. package/lib/module/ui/navigation/routes.js +6 -56
  34. package/lib/module/ui/navigation/routes.js.map +1 -1
  35. package/lib/module/ui/navigation/surfaceNavStack.js +95 -0
  36. package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -0
  37. package/lib/module/ui/navigation/surfaceRegistry.js +102 -0
  38. package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -0
  39. package/lib/module/ui/navigation/surfaces.js +207 -0
  40. package/lib/module/ui/navigation/surfaces.js.map +1 -0
  41. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +8 -7
  42. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  43. package/lib/module/ui/types/surfaceScreen.js +4 -0
  44. package/lib/module/ui/types/surfaceScreen.js.map +1 -0
  45. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +29 -27
  46. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
  48. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +24 -0
  50. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +24 -16
  53. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +2 -60
  55. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +51 -0
  57. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +117 -0
  59. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +79 -0
  61. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts +38 -0
  64. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts.map +1 -0
  65. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +29 -27
  66. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -1
  67. package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
  68. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  69. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +24 -0
  70. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -0
  71. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  72. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +24 -16
  73. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  74. package/lib/typescript/module/ui/navigation/routes.d.ts +2 -60
  75. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  76. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +51 -0
  77. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  78. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +117 -0
  79. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  80. package/lib/typescript/module/ui/navigation/surfaces.d.ts +79 -0
  81. package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -0
  82. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  83. package/lib/typescript/module/ui/types/surfaceScreen.d.ts +38 -0
  84. package/lib/typescript/module/ui/types/surfaceScreen.d.ts.map +1 -0
  85. package/package.json +2 -2
  86. package/src/ui/components/OxyAccountDialog.tsx +32 -38
  87. package/src/ui/components/OxyProvider.tsx +12 -34
  88. package/src/ui/components/SurfaceScreen.tsx +166 -0
  89. package/src/ui/context/OxyContext.tsx +27 -1
  90. package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +39 -0
  91. package/src/ui/navigation/bottomSheetManager.ts +46 -73
  92. package/src/ui/navigation/routes.ts +7 -106
  93. package/src/ui/navigation/surfaceNavStack.ts +110 -0
  94. package/src/ui/navigation/surfaceRegistry.ts +174 -0
  95. package/src/ui/navigation/surfaces.ts +244 -0
  96. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +9 -7
  97. package/src/ui/types/surfaceScreen.ts +38 -0
  98. package/lib/commonjs/ui/components/BottomSheet.js +0 -49
  99. package/lib/commonjs/ui/components/BottomSheet.js.map +0 -1
  100. package/lib/commonjs/ui/components/BottomSheetRouter.js +0 -298
  101. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +0 -1
  102. package/lib/module/ui/components/BottomSheet.js +0 -45
  103. package/lib/module/ui/components/BottomSheet.js.map +0 -1
  104. package/lib/module/ui/components/BottomSheetRouter.js +0 -292
  105. package/lib/module/ui/components/BottomSheetRouter.js.map +0 -1
  106. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +0 -29
  107. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +0 -1
  108. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +0 -9
  109. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +0 -1
  110. package/lib/typescript/module/ui/components/BottomSheet.d.ts +0 -29
  111. package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +0 -1
  112. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +0 -9
  113. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +0 -1
  114. package/src/ui/components/BottomSheet.tsx +0 -48
  115. package/src/ui/components/BottomSheetRouter.tsx +0 -310
  116. package/src/ui/navigation/__tests__/getSheetConfig.test.ts +0 -36
@@ -17,6 +17,12 @@ import {
17
17
  loadDocumentPicker,
18
18
  } from '../shared';
19
19
 
20
+ function revokePreviewUrl(preview: string | undefined): void {
21
+ if (preview?.startsWith('blob:')) {
22
+ URL.revokeObjectURL(preview);
23
+ }
24
+ }
25
+
20
26
  /**
21
27
  * Optimistic-entry metadata. `uploading` flags the placeholder so no asset URL
22
28
  * is ever built from its client-minted `temp-…` id; `localPreviewUri` lets the
@@ -334,9 +340,7 @@ export const useFileUploadState = ({
334
340
 
335
341
  // Cleanup preview URLs
336
342
  pendingFiles.forEach(pf => {
337
- if (pf.preview) {
338
- URL.revokeObjectURL(pf.preview);
339
- }
343
+ revokePreviewUrl(pf.preview);
340
344
  });
341
345
  setPendingFiles([]);
342
346
 
@@ -374,9 +378,7 @@ export const useFileUploadState = ({
374
378
  const handleCancelUpload = () => {
375
379
  // Cleanup preview URLs
376
380
  pendingFiles.forEach(pf => {
377
- if (pf.preview) {
378
- URL.revokeObjectURL(pf.preview);
379
- }
381
+ revokePreviewUrl(pf.preview);
380
382
  });
381
383
  setPendingFiles([]);
382
384
  setShowUploadPreview(false);
@@ -386,7 +388,7 @@ export const useFileUploadState = ({
386
388
  const file = pendingFiles.find((pf) => pf.id === id);
387
389
  if (!file) return;
388
390
  if (file.preview) {
389
- URL.revokeObjectURL(file.preview);
391
+ revokePreviewUrl(file.preview);
390
392
  }
391
393
  const updated = pendingFiles.filter((pf) => pf.id !== id);
392
394
  setPendingFiles(updated);
@@ -0,0 +1,38 @@
1
+ import type { RouteName } from '../navigation/routes';
2
+ import type { SurfaceProps, SurfaceResult } from '../navigation/surfaceRegistry';
3
+
4
+ /**
5
+ * The typed prop contract a screen receives when it is bound into an SDK surface.
6
+ *
7
+ * This is the successor to the grab-bag `BaseScreenProps`: `props` carries the
8
+ * route's own {@link SurfaceProps typed props}, and the navigation methods are
9
+ * split along the two axes the surface system models — NAV-WITHIN
10
+ * (`navigate`/`replace`/`goBack`/`step`) inside this surface, and DEPTH
11
+ * (`present`/`dismiss`) across the stack.
12
+ *
13
+ * In P1 the ~35 screens still consume the legacy `BaseScreenProps` shape (the
14
+ * `SurfaceScreen` binding passes a superset that satisfies both), so this type is
15
+ * the target contract for the per-screen migration in a later phase — it is not
16
+ * yet the render-time prop shape for existing screens.
17
+ */
18
+ export interface SurfaceScreenProps<K extends RouteName> {
19
+ /** The route's typed props (from the {@link SurfaceProps registry}). */
20
+ props: SurfaceProps<K>;
21
+ /** Drill in to another route — WITHIN this surface, or a new surface if the
22
+ * target's presentation differs. */
23
+ navigate: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => void;
24
+ /** Replace the current route in place (no history entry). */
25
+ replace: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => void;
26
+ /** Pop one level; if at the root, dismiss the surface. */
27
+ goBack: () => void;
28
+ /** Whether a back is possible (a deeper route OR a prior wizard step). */
29
+ canGoBack: () => boolean;
30
+ /** Dismiss THIS surface, resolving its `present()` promise with `result`. */
31
+ dismiss: (result?: SurfaceResult<K>) => void;
32
+ /** Present a NEW surface on top of the stack (DEPTH); resolves with its result. */
33
+ present: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => Promise<SurfaceResult<T> | undefined>;
34
+ /** The current wizard step of this frame. */
35
+ step: number;
36
+ /** Set the current wizard step. */
37
+ setStep: (step: number) => void;
38
+ }
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _bottomSheet = require("@oxyhq/bloom/bottom-sheet");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- /**
11
- * Thin wrapper around `@oxyhq/bloom`'s `BottomSheet` (>=0.4.0).
12
- *
13
- * Bloom is the canonical bottom-sheet primitive for the Oxy ecosystem; this
14
- * wrapper exists only to inject service-specific defaults so the 29+ screens
15
- * mounted by `BottomSheetRouter` keep the exact UX they had under the
16
- * pre-refactor in-tree implementation:
17
- *
18
- * - `manualActivation: true` — the body pan uses RNGH's manualActivation
19
- * with scroll-handoff, the only RNGH 2.x pattern that doesn't steal
20
- * vertical events from inner scrollers on Android. The previous in-tree
21
- * implementation always ran in this mode.
22
- * - `dynamicBackdrop: true` — backdrop dims proportionally with drag
23
- * distance (iOS Photos style). The previous in-tree implementation
24
- * always did this.
25
- *
26
- * Consumers (`BottomSheetRouter`, primarily) can still override either default
27
- * by passing the prop explicitly — for example, per-route via `getSheetConfig`.
28
- *
29
- * Public API (name + ref shape) is identical to the previous in-tree
30
- * implementation, so external consumers and `BottomSheetRouter` need no
31
- * changes beyond the new pass-through props.
32
- */
33
-
34
- const BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
35
- const {
36
- manualActivation = true,
37
- dynamicBackdrop = true,
38
- ...rest
39
- } = props;
40
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheet, {
41
- ref: ref,
42
- manualActivation: manualActivation,
43
- dynamicBackdrop: dynamicBackdrop,
44
- ...rest
45
- });
46
- });
47
- BottomSheet.displayName = 'BottomSheet';
48
- var _default = exports.default = BottomSheet;
49
- //# sourceMappingURL=BottomSheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_bottomSheet","_jsxRuntime","BottomSheet","forwardRef","props","ref","manualActivation","dynamicBackdrop","rest","jsx","displayName","_default","exports","default"],"sourceRoot":"../../../../src","sources":["ui/components/BottomSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAImC,IAAAE,WAAA,GAAAF,OAAA;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMG,WAAW,gBAAG,IAAAC,iBAAU,EAAmC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC7E,MAAM;IAAEC,gBAAgB,GAAG,IAAI;IAAEC,eAAe,GAAG,IAAI;IAAE,GAAGC;EAAK,CAAC,GAAGJ,KAAK;EAC1E,oBACI,IAAAH,WAAA,CAAAQ,GAAA,EAACT,YAAA,CAAAE,WAAgB;IACbG,GAAG,EAAEA,GAAI;IACTC,gBAAgB,EAAEA,gBAAiB;IACnCC,eAAe,EAAEA,eAAgB;IAAA,GAC7BC;EAAI,CACX,CAAC;AAEV,CAAC,CAAC;AAEFN,WAAW,CAACQ,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzBX,WAAW","ignoreList":[]}
@@ -1,298 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _zustand = require("zustand");
10
- var _routes = require("../navigation/routes.js");
11
- var _theme = require("@oxyhq/bloom/theme");
12
- var _dialog = require("@oxyhq/bloom/dialog");
13
- var _BottomSheet = _interopRequireDefault(require("./BottomSheet.js"));
14
- var _bottomSheetManager = require("../navigation/bottomSheetManager.js");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- /** Error boundary to catch screen rendering failures (e.g. lazy require() throws) */
19
-
20
- class ScreenErrorBoundary extends _react.default.Component {
21
- state = {
22
- error: null
23
- };
24
- static getDerivedStateFromError(error) {
25
- return {
26
- error
27
- };
28
- }
29
- componentDidCatch(error, info) {
30
- if (__DEV__) {
31
- console.error(`[BottomSheetRouter] Screen "${this.props.screenName}" crashed:`, error, info.componentStack);
32
- }
33
- }
34
- componentDidUpdate(prevProps) {
35
- if (prevProps.screenName !== this.props.screenName && this.state.error) {
36
- this.setState({
37
- error: null
38
- });
39
- }
40
- }
41
- render() {
42
- if (this.state.error) {
43
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
44
- style: errorStyles.container,
45
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
46
- style: errorStyles.title,
47
- children: "Something went wrong"
48
- }), __DEV__ && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
49
- style: errorStyles.message,
50
- children: this.state.error.message
51
- })]
52
- });
53
- }
54
- return this.props.children;
55
- }
56
- }
57
- const errorStyles = _reactNative.StyleSheet.create({
58
- container: {
59
- flex: 1,
60
- alignItems: 'center',
61
- justifyContent: 'center',
62
- padding: 24
63
- },
64
- title: {
65
- fontSize: 16,
66
- fontWeight: '600',
67
- marginBottom: 8
68
- },
69
- message: {
70
- fontSize: 13,
71
- textAlign: 'center'
72
- }
73
- });
74
-
75
- /**
76
- * Responsive placement for `presentation: 'dialog'` routes: a bottom-sheet on
77
- * narrow viewports, a centered card at `md+` (≥768dp). Module-scoped so the
78
- * object identity is stable across renders (Bloom's placement resolver memoizes
79
- * on it). PhotoPickerSection keys its center-vs-bottom layout off the SAME `md`
80
- * breakpoint — keep the two in sync if this map changes.
81
- */
82
- const DIALOG_PLACEMENT = {
83
- base: 'bottom',
84
- md: 'center'
85
- };
86
- /**
87
- * BottomSheetRouter - Navigation container for bottom sheet screens
88
- */
89
- const BottomSheetRouter = ({
90
- onScreenChange,
91
- onDismiss
92
- }) => {
93
- const sheetRef = (0, _react.useRef)(null);
94
- const theme = (0, _theme.useTheme)();
95
- const prevScreenRef = (0, _react.useRef)(null);
96
- const {
97
- currentScreen,
98
- screenProps,
99
- currentStep,
100
- isOpen
101
- } = (0, _zustand.useStore)(_bottomSheetManager.bottomSheetStore);
102
- const ScreenComponent = (0, _react.useMemo)(() => {
103
- if (!currentScreen) return null;
104
- const component = (0, _routes.getScreenComponent)(currentScreen);
105
- if (__DEV__ && !component) {
106
- console.error(`[BottomSheetRouter] getScreenComponent("${currentScreen}") returned undefined — the screen's lazy require() likely failed.`);
107
- }
108
- return component ?? null;
109
- }, [currentScreen]);
110
-
111
- // Route-level sheet config (which surface hosts the route, whether the sheet
112
- // provides its own ScrollView, etc.). Computed early so the visibility
113
- // effect can gate the in-tree sheet on the resolved presentation.
114
- const sheetConfig = (0, _react.useMemo)(() => (0, _routes.getSheetConfig)(currentScreen, screenProps), [currentScreen, screenProps]);
115
- const isDialogPresentation = sheetConfig.presentation === 'dialog';
116
-
117
- // Notify screen changes
118
- (0, _react.useEffect)(() => {
119
- if (prevScreenRef.current !== currentScreen) {
120
- onScreenChange?.(currentScreen);
121
- prevScreenRef.current = currentScreen;
122
- }
123
- }, [currentScreen, onScreenChange]);
124
-
125
- // Control visibility. The in-tree BottomSheet only ever presents for
126
- // 'sheet'-presentation routes — 'dialog' routes render in the Bloom
127
- // `<Dialog>` below, so the sheet stays dismissed for them (both surfaces
128
- // remain mounted, so the pick→crop dialog→sheet handoff has no unmount jank).
129
- (0, _react.useEffect)(() => {
130
- if (!sheetRef.current) return;
131
- if (isOpen && !isDialogPresentation) {
132
- sheetRef.current.present();
133
- } else {
134
- sheetRef.current.dismiss();
135
- }
136
- }, [isOpen, isDialogPresentation]);
137
-
138
- // Android back button
139
- (0, _react.useEffect)(() => {
140
- if (!isOpen) return;
141
- if (_reactNative.Platform.OS !== 'android') return;
142
- const handler = _reactNative.BackHandler.addEventListener('hardwareBackPress', () => {
143
- handleGoBack();
144
- return true;
145
- });
146
- return () => handler.remove();
147
- }, [isOpen]);
148
- const navigate = (0, _react.useCallback)((screen, props) => {
149
- if (!(0, _routes.isValidRoute)(screen)) {
150
- if (__DEV__) console.warn(`[BottomSheetRouter] Invalid route: ${screen}`);
151
- return;
152
- }
153
- (0, _bottomSheetManager.showBottomSheet)({
154
- screen,
155
- props
156
- });
157
- }, []);
158
- const handleGoBack = (0, _react.useCallback)(() => {
159
- const state = (0, _bottomSheetManager.getState)();
160
-
161
- // Try history first
162
- if (state.history.length > 0) {
163
- (0, _bottomSheetManager.goBack)();
164
- return true;
165
- }
166
-
167
- // Try step back
168
- const step = state.currentStep ?? 0;
169
- if (step > 0) {
170
- (0, _bottomSheetManager.updateState)({
171
- currentStep: step - 1,
172
- screenProps: {
173
- ...state.screenProps,
174
- initialStep: step - 1
175
- }
176
- });
177
- return true;
178
- }
179
-
180
- // Close
181
- (0, _bottomSheetManager.closeBottomSheet)();
182
- return true;
183
- }, []);
184
- const canDismiss = (0, _react.useCallback)(() => {
185
- const state = (0, _bottomSheetManager.getState)();
186
- if (state.history.length > 0) return false;
187
- const step = state.currentStep ?? 0;
188
- return step <= 0;
189
- }, []);
190
- const handleDismissAttempt = (0, _react.useCallback)(() => {
191
- if (!canDismiss()) {
192
- handleGoBack();
193
- return false;
194
- }
195
- return true;
196
- }, [canDismiss, handleGoBack]);
197
- const handleDismiss = (0, _react.useCallback)(() => {
198
- (0, _bottomSheetManager.closeBottomSheet)();
199
- onDismiss?.();
200
- }, [onDismiss]);
201
- const handleStepChange = (0, _react.useCallback)(step => {
202
- const state = (0, _bottomSheetManager.getState)();
203
- (0, _bottomSheetManager.updateState)({
204
- currentStep: step,
205
- screenProps: {
206
- ...state.screenProps,
207
- initialStep: step
208
- }
209
- });
210
- }, []);
211
- const scrollTo = (0, _react.useCallback)((y, animated) => {
212
- sheetRef.current?.scrollTo(y, animated);
213
- }, []);
214
- const renderBackground = (0, _react.useCallback)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
215
- style: [styles.background, {
216
- backgroundColor: theme.colors.background
217
- }, props.style]
218
- }), [theme.colors.background]);
219
- const screenPropsValue = (0, _react.useMemo)(() => {
220
- const {
221
- initialStep: _,
222
- ...rest
223
- } = screenProps;
224
- return {
225
- navigate,
226
- goBack: handleGoBack,
227
- onClose: _bottomSheetManager.closeBottomSheet,
228
- onAuthenticated: _bottomSheetManager.closeBottomSheet,
229
- theme: theme.mode,
230
- currentScreen: currentScreen ?? undefined,
231
- initialStep: currentStep ?? screenProps?.initialStep,
232
- onStepChange: handleStepChange,
233
- scrollTo,
234
- ...rest
235
- };
236
- }, [navigate, handleGoBack, theme.mode, currentScreen, currentStep, screenProps, handleStepChange, scrollTo]);
237
-
238
- // The active screen, wrapped in its error boundary. Routed into EXACTLY ONE
239
- // surface (the in-tree sheet OR the Dialog) based on the resolved
240
- // presentation, so it never double-mounts.
241
- const screenNode = ScreenComponent && currentScreen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ScreenErrorBoundary, {
242
- screenName: currentScreen,
243
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ScreenComponent, {
244
- ...screenPropsValue
245
- })
246
- }) : null;
247
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
248
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomSheet.default, {
249
- ref: sheetRef,
250
- enablePanDownToClose: true,
251
- enableHandlePanningGesture: true,
252
- backgroundComponent: renderBackground,
253
- style: styles.container,
254
- onDismiss: handleDismiss,
255
- onDismissAttempt: handleDismissAttempt,
256
- scrollable: sheetConfig.scrollable,
257
- manualActivation: sheetConfig.manualActivation,
258
- dynamicBackdrop: sheetConfig.dynamicBackdrop,
259
- handleComponent: sheetConfig.handleComponent,
260
- children: !isDialogPresentation && screenNode
261
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_dialog.Dialog, {
262
- open: isOpen && isDialogPresentation,
263
- onClose: handleDismiss,
264
- placement: DIALOG_PLACEMENT,
265
- dismissOnBackdrop: false,
266
- contentPadding: 0,
267
- maxWidth: 640,
268
- maxHeightRatio: 0.9,
269
- style: styles.dialogSurface,
270
- panelStyle: styles.dialogSurface,
271
- label: currentScreen ?? undefined,
272
- children: isDialogPresentation ? screenNode : null
273
- })]
274
- });
275
- };
276
- const styles = _reactNative.StyleSheet.create({
277
- container: {
278
- maxWidth: 800,
279
- width: '100%',
280
- alignSelf: 'center',
281
- marginHorizontal: 'auto'
282
- },
283
- background: {
284
- borderTopLeftRadius: 20,
285
- borderTopRightRadius: 20,
286
- overflow: 'hidden'
287
- },
288
- // Full-bleed black surface for `presentation: 'dialog'` routes. `overflow:
289
- // 'hidden'` clips the picker's edge-to-edge black content to the panel's
290
- // rounded corners (Dialog supplies the radius per placement); the black
291
- // fill covers any sub-pixel gap behind the picker during entrance.
292
- dialogSurface: {
293
- backgroundColor: '#000000',
294
- overflow: 'hidden'
295
- }
296
- });
297
- var _default = exports.default = /*#__PURE__*/_react.default.memo(BottomSheetRouter);
298
- //# sourceMappingURL=BottomSheetRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_zustand","_routes","_theme","_dialog","_BottomSheet","_interopRequireDefault","_bottomSheetManager","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ScreenErrorBoundary","React","Component","state","error","getDerivedStateFromError","componentDidCatch","info","__DEV__","console","props","screenName","componentStack","componentDidUpdate","prevProps","setState","render","jsxs","View","style","errorStyles","container","children","jsx","Text","title","message","StyleSheet","create","flex","alignItems","justifyContent","padding","fontSize","fontWeight","marginBottom","textAlign","DIALOG_PLACEMENT","base","md","BottomSheetRouter","onScreenChange","onDismiss","sheetRef","useRef","theme","useTheme","prevScreenRef","currentScreen","screenProps","currentStep","isOpen","useStore","bottomSheetStore","ScreenComponent","useMemo","component","getScreenComponent","sheetConfig","getSheetConfig","isDialogPresentation","presentation","useEffect","current","present","dismiss","Platform","OS","handler","BackHandler","addEventListener","handleGoBack","remove","navigate","useCallback","screen","isValidRoute","warn","showBottomSheet","getState","history","length","goBack","step","updateState","initialStep","closeBottomSheet","canDismiss","handleDismissAttempt","handleDismiss","handleStepChange","scrollTo","y","animated","renderBackground","styles","background","backgroundColor","colors","screenPropsValue","_","rest","onClose","onAuthenticated","mode","undefined","onStepChange","screenNode","Fragment","ref","enablePanDownToClose","enableHandlePanningGesture","backgroundComponent","onDismissAttempt","scrollable","manualActivation","dynamicBackdrop","handleComponent","Dialog","open","placement","dismissOnBackdrop","contentPadding","maxWidth","maxHeightRatio","dialogSurface","panelStyle","label","width","alignSelf","marginHorizontal","borderTopLeftRadius","borderTopRightRadius","overflow","_default","exports","memo"],"sourceRoot":"../../../../src","sources":["ui/components/BottomSheetRouter.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAO0C,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAO,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAA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MACpBzG,KAAK,EAAE4E,MAAM,CAAC8B,aAAc;MAC5BC,UAAU,EAAE/B,MAAM,CAAC8B,aAAc;MACjCE,KAAK,EAAE/E,aAAa,IAAIyD,SAAU;MAAAnF,QAAA,EAEjCsC,oBAAoB,GAAG+C,UAAU,GAAG;IAAI,CACrC,CAAC;EAAA,CACX,CAAC;AAEX,CAAC;AAED,MAAMZ,MAAM,GAAGpE,uBAAU,CAACC,MAAM,CAAC;EAC7BP,SAAS,EAAE;IACPsG,QAAQ,EAAE,GAAG;IACbK,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE,QAAQ;IACnBC,gBAAgB,EAAE;EACtB,CAAC;EACDlC,UAAU,EAAE;IACRmC,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,QAAQ,EAAE;EACd,CAAC;EACD;EACA;EACA;EACA;EACAR,aAAa,EAAE;IACX5B,eAAe,EAAE,SAAS;IAC1BoC,QAAQ,EAAE;EACd;AACJ,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxJ,OAAA,gBAEYkB,cAAK,CAACuI,IAAI,CAAChG,iBAAiB,CAAC","ignoreList":[]}
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- import { forwardRef } from 'react';
4
- import { BottomSheet as BloomBottomSheet } from '@oxyhq/bloom/bottom-sheet';
5
-
6
- /**
7
- * Thin wrapper around `@oxyhq/bloom`'s `BottomSheet` (>=0.4.0).
8
- *
9
- * Bloom is the canonical bottom-sheet primitive for the Oxy ecosystem; this
10
- * wrapper exists only to inject service-specific defaults so the 29+ screens
11
- * mounted by `BottomSheetRouter` keep the exact UX they had under the
12
- * pre-refactor in-tree implementation:
13
- *
14
- * - `manualActivation: true` — the body pan uses RNGH's manualActivation
15
- * with scroll-handoff, the only RNGH 2.x pattern that doesn't steal
16
- * vertical events from inner scrollers on Android. The previous in-tree
17
- * implementation always ran in this mode.
18
- * - `dynamicBackdrop: true` — backdrop dims proportionally with drag
19
- * distance (iOS Photos style). The previous in-tree implementation
20
- * always did this.
21
- *
22
- * Consumers (`BottomSheetRouter`, primarily) can still override either default
23
- * by passing the prop explicitly — for example, per-route via `getSheetConfig`.
24
- *
25
- * Public API (name + ref shape) is identical to the previous in-tree
26
- * implementation, so external consumers and `BottomSheetRouter` need no
27
- * changes beyond the new pass-through props.
28
- */
29
- import { jsx as _jsx } from "react/jsx-runtime";
30
- const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
31
- const {
32
- manualActivation = true,
33
- dynamicBackdrop = true,
34
- ...rest
35
- } = props;
36
- return /*#__PURE__*/_jsx(BloomBottomSheet, {
37
- ref: ref,
38
- manualActivation: manualActivation,
39
- dynamicBackdrop: dynamicBackdrop,
40
- ...rest
41
- });
42
- });
43
- BottomSheet.displayName = 'BottomSheet';
44
- export default BottomSheet;
45
- //# sourceMappingURL=BottomSheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["forwardRef","BottomSheet","BloomBottomSheet","jsx","_jsx","props","ref","manualActivation","dynamicBackdrop","rest","displayName"],"sourceRoot":"../../../../src","sources":["ui/components/BottomSheet.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SACIC,WAAW,IAAIC,gBAAgB,QAG5B,2BAA2B;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,SAAAC,GAAA,IAAAC,IAAA;AA0BA,MAAMH,WAAW,gBAAGD,UAAU,CAAmC,CAACK,KAAK,EAAEC,GAAG,KAAK;EAC7E,MAAM;IAAEC,gBAAgB,GAAG,IAAI;IAAEC,eAAe,GAAG,IAAI;IAAE,GAAGC;EAAK,CAAC,GAAGJ,KAAK;EAC1E,oBACID,IAAA,CAACF,gBAAgB;IACbI,GAAG,EAAEA,GAAI;IACTC,gBAAgB,EAAEA,gBAAiB;IACnCC,eAAe,EAAEA,eAAgB;IAAA,GAC7BC;EAAI,CACX,CAAC;AAEV,CAAC,CAAC;AAEFR,WAAW,CAACS,WAAW,GAAG,aAAa;AAEvC,eAAeT,WAAW","ignoreList":[]}