@oxyhq/services 22.8.6 → 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 (152) 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/components/fileManagement/UploadPreview.js +3 -3
  8. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  9. package/lib/commonjs/ui/context/OxyContext.js +32 -1
  10. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  11. package/lib/commonjs/ui/navigation/bottomSheetManager.js +38 -56
  12. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  13. package/lib/commonjs/ui/navigation/routes.js +7 -57
  14. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  15. package/lib/commonjs/ui/navigation/surfaceNavStack.js +98 -0
  16. package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -0
  17. package/lib/commonjs/ui/navigation/surfaceRegistry.js +108 -0
  18. package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -0
  19. package/lib/commonjs/ui/navigation/surfaces.js +219 -0
  20. package/lib/commonjs/ui/navigation/surfaces.js.map +1 -0
  21. package/lib/commonjs/ui/screens/FileManagementScreen.js +8 -1
  22. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +60 -3
  24. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  25. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +14 -17
  26. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  27. package/lib/commonjs/ui/screens/fileManagement/shared.js +13 -1
  28. package/lib/commonjs/ui/screens/fileManagement/shared.js.map +1 -1
  29. package/lib/commonjs/ui/types/surfaceScreen.js +6 -0
  30. package/lib/commonjs/ui/types/surfaceScreen.js.map +1 -0
  31. package/lib/module/ui/components/OxyAccountDialog.js +31 -40
  32. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -1
  33. package/lib/module/ui/components/OxyProvider.js +10 -30
  34. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  35. package/lib/module/ui/components/SurfaceScreen.js +141 -0
  36. package/lib/module/ui/components/SurfaceScreen.js.map +1 -0
  37. package/lib/module/ui/components/fileManagement/UploadPreview.js +3 -3
  38. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  39. package/lib/module/ui/context/OxyContext.js +32 -1
  40. package/lib/module/ui/context/OxyContext.js.map +1 -1
  41. package/lib/module/ui/navigation/bottomSheetManager.js +37 -53
  42. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  43. package/lib/module/ui/navigation/routes.js +6 -56
  44. package/lib/module/ui/navigation/routes.js.map +1 -1
  45. package/lib/module/ui/navigation/surfaceNavStack.js +95 -0
  46. package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -0
  47. package/lib/module/ui/navigation/surfaceRegistry.js +102 -0
  48. package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -0
  49. package/lib/module/ui/navigation/surfaces.js +207 -0
  50. package/lib/module/ui/navigation/surfaces.js.map +1 -0
  51. package/lib/module/ui/screens/FileManagementScreen.js +8 -1
  52. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  53. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +60 -3
  54. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  55. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +14 -18
  56. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  57. package/lib/module/ui/screens/fileManagement/shared.js +12 -0
  58. package/lib/module/ui/screens/fileManagement/shared.js.map +1 -1
  59. package/lib/module/ui/types/surfaceScreen.js +4 -0
  60. package/lib/module/ui/types/surfaceScreen.js.map +1 -0
  61. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +29 -27
  62. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
  64. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +24 -0
  66. package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +3 -10
  68. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +24 -16
  71. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +2 -60
  73. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +51 -0
  75. package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +117 -0
  77. package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +79 -0
  79. package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts +7 -0
  82. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +1 -1
  84. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/ui/screens/fileManagement/shared.d.ts +4 -0
  86. package/lib/typescript/commonjs/ui/screens/fileManagement/shared.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts +38 -0
  88. package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts.map +1 -0
  89. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +29 -27
  90. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -1
  91. package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
  92. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  93. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +24 -0
  94. package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -0
  95. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +3 -10
  96. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  97. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  98. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +24 -16
  99. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  100. package/lib/typescript/module/ui/navigation/routes.d.ts +2 -60
  101. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  102. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +51 -0
  103. package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -0
  104. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +117 -0
  105. package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -0
  106. package/lib/typescript/module/ui/navigation/surfaces.d.ts +79 -0
  107. package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -0
  108. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts +7 -0
  110. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  111. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts +1 -1
  112. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  113. package/lib/typescript/module/ui/screens/fileManagement/shared.d.ts +4 -0
  114. package/lib/typescript/module/ui/screens/fileManagement/shared.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/types/surfaceScreen.d.ts +38 -0
  116. package/lib/typescript/module/ui/types/surfaceScreen.d.ts.map +1 -0
  117. package/package.json +2 -2
  118. package/src/ui/components/OxyAccountDialog.tsx +32 -38
  119. package/src/ui/components/OxyProvider.tsx +12 -34
  120. package/src/ui/components/SurfaceScreen.tsx +166 -0
  121. package/src/ui/components/fileManagement/UploadPreview.tsx +8 -16
  122. package/src/ui/context/OxyContext.tsx +27 -1
  123. package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +39 -0
  124. package/src/ui/navigation/bottomSheetManager.ts +46 -73
  125. package/src/ui/navigation/routes.ts +7 -106
  126. package/src/ui/navigation/surfaceNavStack.ts +110 -0
  127. package/src/ui/navigation/surfaceRegistry.ts +174 -0
  128. package/src/ui/navigation/surfaces.ts +244 -0
  129. package/src/ui/screens/FileManagementScreen.tsx +8 -1
  130. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +69 -7
  131. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +16 -18
  132. package/src/ui/screens/fileManagement/shared.ts +23 -0
  133. package/src/ui/types/surfaceScreen.ts +38 -0
  134. package/lib/commonjs/ui/components/BottomSheet.js +0 -49
  135. package/lib/commonjs/ui/components/BottomSheet.js.map +0 -1
  136. package/lib/commonjs/ui/components/BottomSheetRouter.js +0 -298
  137. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +0 -1
  138. package/lib/module/ui/components/BottomSheet.js +0 -45
  139. package/lib/module/ui/components/BottomSheet.js.map +0 -1
  140. package/lib/module/ui/components/BottomSheetRouter.js +0 -292
  141. package/lib/module/ui/components/BottomSheetRouter.js.map +0 -1
  142. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +0 -29
  143. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +0 -1
  144. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +0 -9
  145. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +0 -1
  146. package/lib/typescript/module/ui/components/BottomSheet.d.ts +0 -29
  147. package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +0 -1
  148. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +0 -9
  149. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +0 -1
  150. package/src/ui/components/BottomSheet.tsx +0 -48
  151. package/src/ui/components/BottomSheetRouter.tsx +0 -310
  152. package/src/ui/navigation/__tests__/getSheetConfig.test.ts +0 -36
@@ -0,0 +1,117 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AccountDialogView } from '@oxyhq/core';
3
+ import type { RouteName } from './routes.js';
4
+ /**
5
+ * The SDK's typed surface registry — the contract layer the SDK stacks on top of
6
+ * Bloom's content-agnostic surface stack (`@oxyhq/bloom/surfaces`). One entry per
7
+ * route describing its `props` (what the presenter must pass) and its `result`
8
+ * (what awaiting `present()` resolves with). Hand-maintained, contract-first:
9
+ * adding a route here is the single edit that types it end to end.
10
+ *
11
+ * For P1 most routes keep permissive `Record<string, unknown>` props + a `void`
12
+ * result — the historical grab-bag `showBottomSheet`/`navigate` props are
13
+ * unchanged. Later phases tighten individual routes without changing this shape.
14
+ */
15
+ /** One registry entry: the props a route is presented with + its dismissal result. */
16
+ type SurfaceRoute<Props = Record<string, unknown>, Result = void> = {
17
+ props: Props;
18
+ result: Result;
19
+ };
20
+ export interface SurfaceRegistry {
21
+ ManageAccount: SurfaceRoute;
22
+ AccountVerification: SurfaceRoute;
23
+ PaymentGateway: SurfaceRoute;
24
+ Profile: SurfaceRoute;
25
+ LanguageSelector: SurfaceRoute;
26
+ PrivacySettings: SurfaceRoute;
27
+ SearchSettings: SurfaceRoute;
28
+ FileManagement: SurfaceRoute;
29
+ HelpSupport: SurfaceRoute;
30
+ FAQ: SurfaceRoute;
31
+ Feedback: SurfaceRoute;
32
+ LegalDocuments: SurfaceRoute;
33
+ AppInfo: SurfaceRoute;
34
+ PremiumSubscription: SurfaceRoute;
35
+ WelcomeNewUser: SurfaceRoute;
36
+ UserLinks: SurfaceRoute;
37
+ HistoryView: SurfaceRoute;
38
+ SavesCollections: SurfaceRoute;
39
+ EditProfile: SurfaceRoute;
40
+ EditProfileField: SurfaceRoute;
41
+ LearnMoreUsernames: SurfaceRoute;
42
+ TrustCenter: SurfaceRoute;
43
+ TrustLeaderboard: SurfaceRoute;
44
+ TrustRewards: SurfaceRoute;
45
+ TrustRules: SurfaceRoute;
46
+ AboutTrust: SurfaceRoute;
47
+ TrustFAQ: SurfaceRoute;
48
+ FollowersList: SurfaceRoute;
49
+ FollowingList: SurfaceRoute;
50
+ CreateAccount: SurfaceRoute;
51
+ AccountMembers: SurfaceRoute;
52
+ AccountSettings: SurfaceRoute;
53
+ AvatarCrop: SurfaceRoute;
54
+ Notifications: SurfaceRoute;
55
+ ConnectedApps: SurfaceRoute;
56
+ Preferences: SurfaceRoute;
57
+ /** Unified account switcher + sign-in surface (folded `OxyAccountDialog` body). */
58
+ AccountDialog: SurfaceRoute<{
59
+ initialView?: AccountDialogView;
60
+ }>;
61
+ }
62
+ /** Typed props a route is presented with. */
63
+ export type SurfaceProps<K extends RouteName> = SurfaceRegistry[K]['props'];
64
+ /** What awaiting a route's `present()` resolves with when it is dismissed. */
65
+ export type SurfaceResult<K extends RouteName> = SurfaceRegistry[K]['result'];
66
+ /**
67
+ * How a surface renders — the SDK's presentation taxonomy. Each value maps to a
68
+ * concrete Bloom `Dialog` placement/chrome in `surfaces.ts`:
69
+ *
70
+ * - `'sheet'` → responsive `{ base: 'bottom', md: 'center' }` (the default:
71
+ * a bottom sheet on narrow viewports, a centered card on wide).
72
+ * - `'center'` → a plain centered modal at every width.
73
+ * - `'drawer'` → responsive `{ base: 'bottom', md: 'left' }` side drawer.
74
+ * - `'fullScreen'` → approximated with the shared `Dialog`: a full-height sheet /
75
+ * large centered card, flush (`contentPadding: 0`) content, a
76
+ * black canvas and programmatic-only dismiss (the flagship
77
+ * image picker). A real Bloom `'fullScreen'` placement is a
78
+ * follow-up if the approximation reads wrong on device.
79
+ */
80
+ export type SurfacePresentation = 'sheet' | 'center' | 'drawer' | 'fullScreen';
81
+ /**
82
+ * Per-route surface configuration. Merges the historical `SheetRouteConfig`
83
+ * knobs with the new {@link SurfacePresentation}.
84
+ *
85
+ * NOTE: `scrollable` / `manualActivation` / `dynamicBackdrop` / `handleComponent`
86
+ * describe the in-tree bottom-sheet's pan + scroll behaviour. On Bloom's `Dialog`
87
+ * surface those concerns are now owned by the shared `DialogBottomSheet` (it opts
88
+ * pure custom children OUT of its internal ScrollView and manages the pan itself),
89
+ * so for P1 these fields are informational — reserved for a future Bloom
90
+ * bottom-placement passthrough. `presentation` (+ `scrollable` for the picker's
91
+ * flush layout) is what actually drives the surface today.
92
+ */
93
+ export interface SurfaceRouteConfig {
94
+ /** Which surface hosts the route. */
95
+ presentation: SurfacePresentation;
96
+ /**
97
+ * When `false`, the route owns its own scroll container (a FlatList /
98
+ * SectionList / VirtualizedList) and the host must not wrap it in a ScrollView.
99
+ */
100
+ scrollable: boolean;
101
+ /** Body-pan activation strategy — reserved (owned by Bloom's Dialog surface). */
102
+ manualActivation: boolean;
103
+ /** Drag-proportional backdrop dim — reserved (owned by Bloom's Dialog surface). */
104
+ dynamicBackdrop: boolean;
105
+ /** Optional custom drag-handle slot — reserved (owned by Bloom's Dialog surface). */
106
+ handleComponent?: () => ReactNode;
107
+ }
108
+ /**
109
+ * Resolve the surface configuration for a route + props. Defaults to the
110
+ * responsive sheet; the image-only FileManagement picker upgrades to a full-bleed
111
+ * `'fullScreen'` surface that owns its own scrolling.
112
+ */
113
+ export declare const getSurfaceConfig: (route: RouteName, props: Record<string, unknown>) => SurfaceRouteConfig;
114
+ /** Convenience: just the presentation taxonomy for a route + props. */
115
+ export declare const getSurfacePresentation: (route: RouteName, props: Record<string, unknown>) => SurfacePresentation;
116
+ export {};
117
+ //# sourceMappingURL=surfaceRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceRegistry.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/surfaceRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AAE1C;;;;;;;;;;GAUG;AAEH,sFAAsF;AACtF,KAAK,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,IAAI;IAClE,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,YAAY,CAAC;IAC5B,mBAAmB,EAAE,YAAY,CAAC;IAClC,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,eAAe,EAAE,YAAY,CAAC;IAC9B,cAAc,EAAE,YAAY,CAAC;IAC7B,cAAc,EAAE,YAAY,CAAC;IAC7B,WAAW,EAAE,YAAY,CAAC;IAC1B,GAAG,EAAE,YAAY,CAAC;IAClB,QAAQ,EAAE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Q,GAAG,YAAY,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,YAAY,EAAE,mBAAmB,CAAC;IAClC;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mFAAmF;IACnF,eAAe,EAAE,OAAO,CAAC;IACzB,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;CACnC;AA+BD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,SAAS,EAChB,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,kBAKF,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,GACjC,OAAO,SAAS,EAChB,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,mBAAkE,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { type PresentOptions } from '@oxyhq/bloom/surfaces';
2
+ import type { RouteName } from './routes.js';
3
+ import { type SurfacePresentation, type SurfaceProps, type SurfaceResult } from './surfaceRegistry.js';
4
+ import { type SurfaceNavStack } from './surfaceNavStack.js';
5
+ /**
6
+ * A live handle to a presented SDK surface. Exposes DEPTH controls (`dismiss`,
7
+ * `result`) and NAV-WITHIN controls (`navigate`/`replace`/`goBack`/`setStep`) that
8
+ * drive this surface's own nav stack. Held by the `showBottomSheet` adapter (base
9
+ * surface) and by `OxyContext` (the AccountDialog surface).
10
+ */
11
+ export interface SurfaceInstance<K extends RouteName = RouteName> {
12
+ readonly route: RouteName;
13
+ readonly presentation: SurfacePresentation;
14
+ navigate: (route: RouteName, props?: Record<string, unknown>) => void;
15
+ replace: (route: RouteName, props?: Record<string, unknown>) => void;
16
+ goBack: () => boolean;
17
+ canGoBack: () => boolean;
18
+ setStep: (step: number) => void;
19
+ dismiss: (result?: SurfaceResult<K>) => void;
20
+ readonly result: Promise<SurfaceResult<K> | undefined>;
21
+ }
22
+ /**
23
+ * The type-erased handle the `showBottomSheet` adapter needs from a tracked
24
+ * surface: what it hosts, and how to drive/dismiss it. Kept result-type-free so
25
+ * the (generic) `SurfaceInstance<K>` never has to be widened into a shared array.
26
+ */
27
+ interface TrackedSurface {
28
+ readonly route: RouteName;
29
+ readonly presentation: SurfacePresentation;
30
+ navigate: (route: RouteName, props?: Record<string, unknown>) => void;
31
+ goBack: () => boolean;
32
+ dismiss: () => void;
33
+ }
34
+ /**
35
+ * Present a NEW route surface on top of the stack (the DEPTH axis). Resolves with
36
+ * the value the surface is dismissed with. Registered in the route-surface stack.
37
+ */
38
+ export declare function present<K extends RouteName>(route: K, props?: SurfaceProps<K>, opts?: PresentOptions): SurfaceInstance<K>;
39
+ /**
40
+ * Present a surface that is NOT part of the `showBottomSheet` base-navigation
41
+ * lineage (the AccountDialog modal). Otherwise identical to {@link present}.
42
+ */
43
+ export declare function presentDetached<K extends RouteName>(route: K, props?: SurfaceProps<K>, opts?: PresentOptions): SurfaceInstance<K>;
44
+ /**
45
+ * Untyped present for the adapter, the nav helpers, and the `SurfaceScreen`
46
+ * binding (where the route is a runtime value and its props are already erased).
47
+ */
48
+ export declare function presentRoute(route: RouteName, props?: Record<string, unknown>): SurfaceInstance;
49
+ /** The top-most active route surface, or `undefined` when none are open. */
50
+ export declare function topRouteSurface(): TrackedSurface | undefined;
51
+ /**
52
+ * Dismiss every active route surface (the whole `showBottomSheet` session). The
53
+ * AccountDialog is untracked, so it is untouched. Iterates a snapshot because
54
+ * `dismiss` mutates `activeRouteSurfaces` asynchronously as surfaces settle.
55
+ */
56
+ export declare function closeAllRouteSurfaces(): void;
57
+ /**
58
+ * Drill in from a screen: navigate WITHIN the current surface when the target's
59
+ * presentation matches, else present the target as a NEW surface on top (so a
60
+ * sheet screen opening the full-bleed picker gets the right chrome).
61
+ */
62
+ export declare function navigateWithinOrPresent(currentPresentation: SurfacePresentation, navStack: SurfaceNavStack, route: RouteName, props?: Record<string, unknown>): void;
63
+ /** Replace variant of {@link navigateWithinOrPresent}. */
64
+ export declare function replaceWithinOrPresent(currentPresentation: SurfacePresentation, navStack: SurfaceNavStack, route: RouteName, props?: Record<string, unknown>): void;
65
+ /**
66
+ * The SDK's imperative surface API (a module singleton). `present` is the typed
67
+ * route presenter; `dismissAll` unwinds the whole session. Not yet exported from
68
+ * the package root — the public `surfaces`/`useSurfaces` API lands in a later
69
+ * phase; for P1 the internal adapters (`showBottomSheet`, `openAccountDialog`)
70
+ * are the only public entry points.
71
+ */
72
+ export declare const surfaces: {
73
+ readonly present: <K extends RouteName>(route: K, props?: SurfaceProps<K>, opts?: PresentOptions) => Promise<SurfaceResult<K> | undefined>;
74
+ readonly dismissAll: typeof closeAllRouteSurfaces;
75
+ };
76
+ /** Hook form of {@link surfaces} (stable singleton). */
77
+ export declare function useSurfaces(): typeof surfaces;
78
+ export {};
79
+ //# sourceMappingURL=surfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/surfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AAC1C,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EAEnB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,sBAAmB,CAAC;AA8ChF;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC9D,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAA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,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe,CAE/F;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,IAAI,cAAc,GAAG,SAAS,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,mBAAmB,EAAE,mBAAmB,EACxC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,SAAS,EAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,IAAI,CAON;AAED,0DAA0D;AAC1D,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,mBAAmB,EACxC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,SAAS,EAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,IAAI,CAON;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ;uBACT,CAAC,SAAS,SAAS,SAAS,CAAC,UAAU,YAAY,CAAC,CAAC,CAAC,SAAS,cAAc;;CAG/E,CAAC;AAEX,wDAAwD;AACxD,wBAAgB,WAAW,IAAI,OAAO,QAAQ,CAE7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileManagementScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/FileManagementScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAejF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAAyB,CAAC;AA4CzE,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2/C7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"FileManagementScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/FileManagementScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAejF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAAyB,CAAC;AA4CzE,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAkgD7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -20,6 +20,13 @@ export interface PhotoPickerViewProps {
20
20
  } | null;
21
21
  hasMore: boolean;
22
22
  loadingMore: boolean;
23
+ /**
24
+ * Initial-load flag. While `true` AND no photos have arrived yet, the picker
25
+ * renders its OWN loading skeleton (placement-aware grid of shimmer tiles)
26
+ * instead of the empty state — so the loading UI matches the picker's shape
27
+ * and container width, not the browse file-manager chrome.
28
+ */
29
+ loading: boolean;
23
30
  reduceMotion: boolean;
24
31
  getThumbUrl: (file: FileMetadata) => string | undefined;
25
32
  primaryColor: string;
@@ -1 +1 @@
1
- {"version":3,"file":"PhotoPickerSection.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/PhotoPickerSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAgBjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA2FhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,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C;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,MAAM,GAAG,SAAS,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACtE;AA+LD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+YnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -26,7 +26,7 @@ export interface UseFileUploadStateResult {
26
26
  handleFileUpload: () => Promise<void>;
27
27
  handleConfirmUpload: () => Promise<void>;
28
28
  handleCancelUpload: () => void;
29
- removePendingFile: (index: number) => void;
29
+ removePendingFile: (id: string) => void;
30
30
  }
31
31
  /**
32
32
  * Owns the self-contained document-picking + upload-preview state and handlers
@@ -1 +1 @@
1
- {"version":3,"file":"useFileUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/screens/fileManagement/hooks/useFileUploadState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,sKAchC,wBAAwB,KAAG,wBAyb7B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"useFileUploadState.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/screens/fileManagement/hooks/useFileUploadState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iDAA8C,CAAC;AAElF,OAAO,EAEH,KAAK,iBAAiB,EAQzB,MAAM,cAAW,CAAC;AAmBnB,8EAA8E;AAC9E,MAAM,WAAW,wBAAwB;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IACrD,iBAAiB,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;IACrD,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAClE,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtF,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACtE;AAED,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mBAAmB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,sKAchC,wBAAwB,KAAG,wBAgb7B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -25,10 +25,14 @@ export declare const candidateType: (candidate: UploadCandidate) => string;
25
25
  export declare const candidateUri: (candidate: UploadCandidate) => string | undefined;
26
26
  /** A processed file ready for review in the upload preview modal. */
27
27
  export interface PendingUploadFile {
28
+ /** Stable row identity for React keys and removal — survives reorder/filter. */
29
+ id: string;
28
30
  file: UploadCandidate;
29
31
  preview?: string;
30
32
  size: number;
31
33
  name: string;
32
34
  type: string;
33
35
  }
36
+ /** Mint a {@link PendingUploadFile} row from a validated upload candidate. */
37
+ export declare const createPendingUploadFile: (file: UploadCandidate, preview: string | undefined, size: number, name: string, type: string) => PendingUploadFile;
34
38
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD,eAAO,MAAM,kBAAkB,sDAQ9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAIzD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,gBAAgB,CAAC;AAE3E,0EAA0E;AAC1E,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,EAAE,UAAU,MAAM,KAAG,MACS,CAAC;AAEvF,sFAAsF;AACtF,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,KAAG,MAG1D,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,KAAG,MAG1D,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY,GAAI,WAAW,eAAe,KAAG,MAAM,GAAG,SAGlE,CAAC;AAEF,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/fileManagement/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD,eAAO,MAAM,kBAAkB,sDAQ9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAIzD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,gBAAgB,CAAC;AAE3E,0EAA0E;AAC1E,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,EAAE,UAAU,MAAM,KAAG,MACS,CAAC;AAEvF,sFAAsF;AACtF,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,KAAG,MAG1D,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,aAAa,GAAI,WAAW,eAAe,KAAG,MAG1D,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,YAAY,GAAI,WAAW,eAAe,KAAG,MAAM,GAAG,SAGlE,CAAC;AAEF,qEAAqE;AACrE,MAAM,WAAW,iBAAiB;IAC9B,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAOD,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB,GAChC,MAAM,eAAe,EACrB,SAAS,MAAM,GAAG,SAAS,EAC3B,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,MAAM,MAAM,KACb,iBAOD,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { RouteName } from '../navigation/routes.js';
2
+ import type { SurfaceProps, SurfaceResult } from '../navigation/surfaceRegistry.js';
3
+ /**
4
+ * The typed prop contract a screen receives when it is bound into an SDK surface.
5
+ *
6
+ * This is the successor to the grab-bag `BaseScreenProps`: `props` carries the
7
+ * route's own {@link SurfaceProps typed props}, and the navigation methods are
8
+ * split along the two axes the surface system models — NAV-WITHIN
9
+ * (`navigate`/`replace`/`goBack`/`step`) inside this surface, and DEPTH
10
+ * (`present`/`dismiss`) across the stack.
11
+ *
12
+ * In P1 the ~35 screens still consume the legacy `BaseScreenProps` shape (the
13
+ * `SurfaceScreen` binding passes a superset that satisfies both), so this type is
14
+ * the target contract for the per-screen migration in a later phase — it is not
15
+ * yet the render-time prop shape for existing screens.
16
+ */
17
+ export interface SurfaceScreenProps<K extends RouteName> {
18
+ /** The route's typed props (from the {@link SurfaceProps registry}). */
19
+ props: SurfaceProps<K>;
20
+ /** Drill in to another route — WITHIN this surface, or a new surface if the
21
+ * target's presentation differs. */
22
+ navigate: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => void;
23
+ /** Replace the current route in place (no history entry). */
24
+ replace: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => void;
25
+ /** Pop one level; if at the root, dismiss the surface. */
26
+ goBack: () => void;
27
+ /** Whether a back is possible (a deeper route OR a prior wizard step). */
28
+ canGoBack: () => boolean;
29
+ /** Dismiss THIS surface, resolving its `present()` promise with `result`. */
30
+ dismiss: (result?: SurfaceResult<K>) => void;
31
+ /** Present a NEW surface on top of the stack (DEPTH); resolves with its result. */
32
+ present: <T extends RouteName>(route: T, props?: SurfaceProps<T>) => Promise<SurfaceResult<T> | undefined>;
33
+ /** The current wizard step of this frame. */
34
+ step: number;
35
+ /** Set the current wizard step. */
36
+ setStep: (step: number) => void;
37
+ }
38
+ //# sourceMappingURL=surfaceScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/surfaceScreen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kCAA+B,CAAC;AAEjF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS;IACrD,wEAAwE;IACxE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACvB;wCACoC;IACpC,QAAQ,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC3E,6DAA6D;IAC7D,OAAO,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC1E,0DAA0D;IAC1D,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,6EAA6E;IAC7E,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC7C,mFAAmF;IACnF,OAAO,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC3G,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "22.8.6",
3
+ "version": "22.9.0",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -176,7 +176,7 @@
176
176
  },
177
177
  "peerDependencies": {
178
178
  "@expo/vector-icons": "^15.0.3",
179
- "@oxyhq/bloom": ">=0.44.1",
179
+ "@oxyhq/bloom": ">=0.46.0",
180
180
  "@oxyhq/core": "^12.9.0",
181
181
  "@react-native-async-storage/async-storage": "^2.0.0",
182
182
  "@react-native-community/netinfo": "^11.4.1",
@@ -1,38 +1,30 @@
1
1
  /**
2
- * OxyAccountDialog — the ONE unified account dialog for `@oxyhq/services`.
2
+ * OxyAccountDialog — the ONE unified account dialog BODY for `@oxyhq/services`.
3
3
  *
4
- * Bloom `<Dialog>` chrome (header, back button, placement, scroll body) around
5
- * the headless chooser logic, which lives in `OxyAuthChooser` — the account
6
- * switcher, sign-in, sign-up, and QR views are ALL there, extracted so the
7
- * same chooser can be mounted bare by a future host with no Dialog chrome
8
- * (e.g. an auth.oxy.so hub page driving the cross-origin passkey popup, b2).
9
- * This file owns ONLY the chrome: the title/subtitle per view, the back
10
- * button, and the Bloom `<Dialog>` surface itself.
4
+ * The header (title/subtitle per view + back button) around the headless chooser
5
+ * logic, which lives in `OxyAuthChooser` — the account switcher, sign-in,
6
+ * sign-up, and QR views are ALL there, extracted so the same chooser can be
7
+ * mounted bare by a future host with no Dialog chrome (e.g. an auth.oxy.so hub
8
+ * page driving the cross-origin passkey popup, b2). This file owns ONLY the
9
+ * header + the scroll body.
11
10
  *
12
- * The surface is Bloom's `<Dialog>` (`@oxyhq/bloom/dialog`) with a responsive
13
- * `placement`a bottom sheet on narrow viewports, a centered card on wide ones.
14
- * It REPLACES the hand-rolled RN `<Modal>` + `<GestureHandlerRootView>` + manual
15
- * backdrop/card wrapper this component used before. That RN `<Modal>` is invisible
16
- * under React StrictMode on web: react-native-web's `ModalPortal` appends its host
17
- * node during render but removes it in an effect cleanup and never re-attaches, so
18
- * the dialog never paints in a dev Vite build. Bloom's `<Dialog>` renders through
19
- * its own Portal and has no such lifecycle hazard.
20
- *
21
- * Open/close is CONTROLLED by `isAccountDialogOpen` (the `open` prop); the Dialog
22
- * stays mounted whenever the controller exists so it can animate its own close.
23
- * Backdrop / swipe-to-dismiss is disabled (`dismissOnBackdrop={false}`) on purpose:
24
- * Bloom's controlled `bottom` placement does not fire `onClose` on a gesture or
25
- * backdrop dismissal, so allowing it would desync `isAccountDialogOpen` from the
26
- * sheet and block reopening. The header close button (and `OxyAuthChooser`'s
27
- * `onComplete`) drive `closeAccountDialog`, which flips `open` and runs the exit
28
- * animation.
11
+ * It is presented as the `AccountDialog` route on the shared Bloom SURFACE STACK
12
+ * (`@oxyhq/bloom/surfaces`)`OxyContext.openAccountDialog` calls
13
+ * `presentDetached('AccountDialog', …, { placement: { base: 'bottom', md:
14
+ * 'center' }, dismissOnBackdrop: false, maxWidth: 420 })`, so the STACK owns the
15
+ * responsive `<Dialog>` chrome and this component renders only its content. That
16
+ * replaces the previous standalone controlled `<Dialog open={isAccountDialogOpen}>`
17
+ * mount: dismissal now flows through the stack (backdrop/swipe disabled), and the
18
+ * header close button (and `OxyAuthChooser`'s `onComplete`) drive
19
+ * `useOxy().closeAccountDialog`, which dismisses the surface and runs its exit
20
+ * animation. The view-enum (`accounts|signin|qr|add|signup`) stays internal here,
21
+ * driven by the shared `AccountDialogController` in `@oxyhq/core`.
29
22
  */
30
23
 
31
24
  import type React from 'react';
32
25
  import { useCallback, useSyncExternalStore } from 'react';
33
26
  import { Pressable, ScrollView, StyleSheet, View } from 'react-native';
34
27
  import { MaterialCommunityIcons } from '@expo/vector-icons';
35
- import { Dialog } from '@oxyhq/bloom/dialog';
36
28
  import { Text } from '@oxyhq/bloom/typography';
37
29
  import { useTheme } from '@oxyhq/bloom/theme';
38
30
  import type { AccountDialogSnapshot } from '@oxyhq/core';
@@ -45,11 +37,20 @@ type Theme = ReturnType<typeof useTheme>;
45
37
  type Translate = ReturnType<typeof useI18n>['t'];
46
38
 
47
39
  /**
48
- * The unified account dialog. Mounted once by `OxyProvider`; opened imperatively
49
- * via `useOxy().openAccountDialog(view?)` or imperative `openAccountDialog('signin')`.
40
+ * The unified account dialog BODY the header + `OxyAuthChooser` chooser.
41
+ *
42
+ * Presented as the `AccountDialog` surface (route) on the shared Bloom surface
43
+ * stack; the surface owns the `<Dialog>` chrome (responsive `{ base: 'bottom',
44
+ * md: 'center' }` placement, `dismissOnBackdrop={false}`, `maxWidth={420}` — set
45
+ * by `OxyContext` when it presents this surface), so this component renders ONLY
46
+ * the content. Open it via `useOxy().openAccountDialog(view?)` or the imperative
47
+ * `openAccountDialog('signin')`; the view-enum (`accounts|signin|qr|add|signup`)
48
+ * stays internal here, driven by the shared `AccountDialogController` in
49
+ * `@oxyhq/core`. Closing routes through `useOxy().closeAccountDialog`, which
50
+ * dismisses the surface and runs its exit animation.
50
51
  */
51
52
  const OxyAccountDialog: React.FC = () => {
52
- const { accountDialogController: controller, isAccountDialogOpen, closeAccountDialog } = useOxy();
53
+ const { accountDialogController: controller, closeAccountDialog } = useOxy();
53
54
  const theme = useTheme();
54
55
  const { t } = useI18n();
55
56
 
@@ -75,14 +76,7 @@ const OxyAccountDialog: React.FC = () => {
75
76
  view === 'qr' || view === 'signup' || (view === 'add' && snapshot.accounts.length > 0);
76
77
 
77
78
  return (
78
- <Dialog
79
- open={isAccountDialogOpen}
80
- onClose={closeAccountDialog}
81
- placement={{ base: 'bottom', md: 'center' }}
82
- dismissOnBackdrop={false}
83
- maxWidth={420}
84
- label={headerCopy(view, snapshot.accounts.length, t).title}
85
- >
79
+ <>
86
80
  <DialogHeader
87
81
  snapshot={snapshot}
88
82
  theme={theme}
@@ -94,7 +88,7 @@ const OxyAccountDialog: React.FC = () => {
94
88
  <ScrollView style={styles.body} contentContainerStyle={styles.bodyContent} showsVerticalScrollIndicator={false}>
95
89
  <OxyAuthChooser onComplete={closeAccountDialog} />
96
90
  </ScrollView>
97
- </Dialog>
91
+ </>
98
92
  );
99
93
  };
100
94
 
@@ -1,4 +1,4 @@
1
- import { lazy, Suspense, useEffect, useRef, useState, type ComponentType, type FC, type ReactNode } from 'react';
1
+ import { useEffect, useRef, useState, type FC, type ReactNode } from 'react';
2
2
  import { AppState, Platform, StyleSheet, View } from 'react-native';
3
3
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
4
4
  import { SafeAreaProvider } from 'react-native-safe-area-context';
@@ -6,6 +6,7 @@ import type { OxyProviderProps } from '../types/navigation';
6
6
  import { OxyContextProvider, type OxyContextProviderProps } from '../context/OxyContext';
7
7
  import { QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
8
8
  import { BloomDialogProvider } from '@oxyhq/bloom';
9
+ import { SurfaceProvider } from '@oxyhq/bloom/surfaces';
9
10
  import { ToastOutlet } from '@oxyhq/bloom/toast';
10
11
  import { logger as loggerUtil } from '@oxyhq/core';
11
12
  import { RequireOxyAuth } from './RequireOxyAuth';
@@ -49,35 +50,14 @@ const isWeb = Platform.OS === 'web';
49
50
  // static analyzer cannot trace this into the web bundle. Native-only.
50
51
  const KEYBOARD_CONTROLLER_MODULE = 'react-native-keyboard-controller';
51
52
 
52
- // Lazy-load optional components (avoids require() for ESM compatibility).
53
- // The .then() extracts + casts the default export so that `lazy()` sees
54
- // `Promise<{ default: ComponentType }>` instead of the full module namespace.
55
- const LazyBottomSheetRouter = lazy((): Promise<{ default: ComponentType }> =>
56
- import('./BottomSheetRouter').then(
57
- (mod) => ({ default: mod.default as unknown as ComponentType }),
58
- (error) => {
59
- if (__DEV__) {
60
- loggerUtil.error('Failed to load BottomSheetRouter', error instanceof Error ? error : new Error(String(error)), { component: 'OxyProvider' });
61
- }
62
- return { default: (() => null) as FC };
63
- },
64
- ),
65
- );
66
-
67
- const LazyOxyAccountDialog = lazy((): Promise<{ default: ComponentType }> =>
68
- import('./OxyAccountDialog').then(
69
- (mod) => ({ default: mod.default as unknown as ComponentType }),
70
- () => ({ default: (() => null) as FC }),
71
- ),
72
- );
73
-
74
53
  /**
75
54
  * OxyProvider - Universal provider for Expo apps (native + web)
76
55
  *
77
56
  * Provides authentication, session management, query client, and UI overlays.
78
57
  * Wraps its own overlay stack in SafeAreaProvider and GestureHandlerRootView so
79
- * BottomSheetRouter and OxyAccountDialog can safely render even when a consuming
80
- * app has not mounted those providers yet.
58
+ * the shared Bloom SURFACE STACK (`<SurfaceProvider>` / `<SurfaceHost>`) which
59
+ * hosts every SDK surface (the ~35 bottom-sheet routes + the AccountDialog) — can
60
+ * safely render even when a consuming app has not mounted those providers yet.
81
61
  *
82
62
  * Usage:
83
63
  * ```tsx
@@ -316,15 +296,13 @@ const OxyProvider: FC<OxyProviderProps> = ({
316
296
  hubSync={hubSync}
317
297
  onAuthStateChange={onAuthStateChange as OxyContextProviderProps['onAuthStateChange']}
318
298
  >
319
- {requireAuth === 'off' ? (
320
- children
321
- ) : (
322
- <RequireOxyAuth prompt={requireAuth}>{children}</RequireOxyAuth>
323
- )}
324
- <Suspense fallback={null}>
325
- <LazyBottomSheetRouter />
326
- <LazyOxyAccountDialog />
327
- </Suspense>
299
+ <SurfaceProvider>
300
+ {requireAuth === 'off' ? (
301
+ children
302
+ ) : (
303
+ <RequireOxyAuth prompt={requireAuth}>{children}</RequireOxyAuth>
304
+ )}
305
+ </SurfaceProvider>
328
306
  <ToastOutlet />
329
307
  </OxyContextProvider>
330
308
  </BloomDialogProvider>