@oxyhq/services 13.1.6 → 13.2.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.
@@ -12,18 +12,23 @@ import { isDev, logger as loggerUtil } from '@oxyhq/core';
12
12
  import { useOxy } from "../context/OxyContext.js";
13
13
  import { useI18n } from "../hooks/useI18n.js";
14
14
  import { useDeviceAccounts } from "../hooks/useDeviceAccounts.js";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
16
16
  const isWeb = Platform.OS === 'web';
17
17
 
18
18
  /** Fixed popover width on web. `ProfileButton` mirrors this when anchoring. */
19
19
  const MENU_WIDTH = 300;
20
20
 
21
21
  /**
22
- * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel's
23
- * BOTTOM-LEFT corner so the menu opens UPWARD from the sidebar footer. Native
24
- * ignores the anchor and docks the panel to the bottom as a sheet.
22
+ * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel to
23
+ * one corner so the menu opens either UPWARD (footer trigger) or DOWNWARD (a
24
+ * trigger at the top of a sidebar). Exactly ONE vertical edge is pinned:
25
+ * - `bottom` set → the panel's BOTTOM edge is anchored, so it opens UPWARD.
26
+ * - `top` set → the panel's TOP edge is anchored, so it opens DOWNWARD.
27
+ * Native ignores the anchor and docks the panel to the bottom as a sheet.
25
28
  */
26
29
 
30
+ /** Everything `ProfileMenuContent` needs, minus the `open` flag (always open). */
31
+
27
32
  /**
28
33
  * Clean device-account switcher, modeled on the inbox `AccountMenu` but written
29
34
  * fresh with NativeWind classNames + Bloom primitives. Lists every account
@@ -31,13 +36,13 @@ const MENU_WIDTH = 300;
31
36
  * switches, and each inactive row carries a sign-out icon. Below the list:
32
37
  * Add account, Manage account, optional View profile, and Sign out of all.
33
38
  *
34
- * Renders as an upward-opening popover anchored to the trigger on web, and a
35
- * bottom-sheet style modal on native.
39
+ * Heavy hooks (device accounts / refresh-all, Bloom dialog/toast controls, the
40
+ * escape-key listener) live here so they run ONLY while the menu is open — the
41
+ * outer {@link ProfileMenu} mounts this only when `open`. This component may
42
+ * therefore assume it is always open.
36
43
  */
37
- const ProfileMenuBody = ({
38
- open,
44
+ const ProfileMenuContent = ({
39
45
  onClose,
40
- anchor,
41
46
  onNavigateManage,
42
47
  onAddAccount,
43
48
  onNavigateProfile,
@@ -127,9 +132,10 @@ const ProfileMenuBody = ({
127
132
  }
128
133
  }, [signingOutAll, logoutAll, t, onClose, onBeforeSessionChange]);
129
134
 
130
- // Escape-to-close (web only).
135
+ // Escape-to-close (web only). This component only mounts while open, so the
136
+ // listener is attached exactly for the menu's lifetime.
131
137
  useEffect(() => {
132
- if (!open || !isWeb || typeof document === 'undefined') {
138
+ if (!isWeb || typeof document === 'undefined') {
133
139
  return undefined;
134
140
  }
135
141
  const onKey = event => {
@@ -140,34 +146,9 @@ const ProfileMenuBody = ({
140
146
  };
141
147
  document.addEventListener('keydown', onKey, true);
142
148
  return () => document.removeEventListener('keydown', onKey, true);
143
- }, [open, onClose]);
144
- if (!open) {
145
- return null;
146
- }
147
-
148
- // Web: anchor the panel's bottom-left corner to the measured trigger, falling
149
- // back to a bottom-left placement when no anchor was captured. Native ignores
150
- // this (the panel docks to the bottom via the overlay's flex-end).
151
- const panelAnchorStyle = isWeb ? {
152
- position: 'absolute',
153
- width: MENU_WIDTH,
154
- left: anchor?.left ?? 8,
155
- bottom: anchor?.bottom ?? 8
156
- } : undefined;
157
- const content = /*#__PURE__*/_jsx(Pressable
158
- // Swallow taps inside the panel so they never reach the overlay's
159
- // outside-tap-to-close handler.
160
- , {
161
- onPress: () => undefined,
162
- className: isWeb ? 'overflow-hidden rounded-2xl border border-border bg-background' : 'overflow-hidden rounded-t-3xl bg-background pb-3',
163
- style: [panelAnchorStyle, !isWeb ? {
164
- maxHeight: '85%'
165
- } : {
166
- maxHeight: '85%'
167
- }, styles.shadow],
168
- accessibilityRole: "menu",
169
- accessibilityLabel: t('accountMenu.label') || 'Account menu',
170
- children: /*#__PURE__*/_jsxs(ScrollView, {
149
+ }, [onClose]);
150
+ return /*#__PURE__*/_jsxs(_Fragment, {
151
+ children: [/*#__PURE__*/_jsxs(ScrollView, {
171
152
  className: "grow-0",
172
153
  contentContainerClassName: "py-1",
173
154
  showsVerticalScrollIndicator: false,
@@ -295,20 +276,6 @@ const ProfileMenuBody = ({
295
276
  children: t('accountMenu.signOutAll') || 'Sign out of all accounts'
296
277
  })]
297
278
  })]
298
- })
299
- });
300
- return /*#__PURE__*/_jsxs(Modal, {
301
- visible: open,
302
- transparent: true,
303
- animationType: isWeb ? 'fade' : 'slide',
304
- onRequestClose: onClose,
305
- children: [/*#__PURE__*/_jsx(Pressable, {
306
- accessibilityRole: "button",
307
- accessibilityLabel: t('common.actions.close') || 'Close',
308
- onPress: onClose,
309
- className: isWeb ? 'flex-1 relative' : 'flex-1 justify-end',
310
- style: !isWeb ? styles.nativeScrim : undefined,
311
- children: content
312
279
  }), /*#__PURE__*/_jsx(Dialog, {
313
280
  control: signOutAllDialog,
314
281
  title: t('accountMenu.signOutAll') || 'Sign out of all accounts',
@@ -325,6 +292,81 @@ const ProfileMenuBody = ({
325
292
  });
326
293
  };
327
294
 
295
+ /**
296
+ * Public wrapper. The RN `Modal` shell is ALWAYS mounted (only `visible` toggles)
297
+ * so the react-native-web portal is created up front — mounting a web `Modal`
298
+ * already-`visible` is fragile (the first interaction can be eaten / the button
299
+ * "does nothing"). Only the heavy {@link ProfileMenuContent} mounts when open,
300
+ * keeping the account hooks off the render path when the menu is closed. On
301
+ * native that closed render is `<Modal visible={false}>{null}</Modal>` → no heavy
302
+ * hooks run (preserving the native-drawer crash fix).
303
+ *
304
+ * This outer component calls ONLY light, always-safe hooks (`useTheme`,
305
+ * `useI18n` for the overlay a11y label) and computes the panel/overlay layout.
306
+ */
307
+ const ProfileMenu = ({
308
+ open,
309
+ onClose,
310
+ anchor,
311
+ onNavigateManage,
312
+ onAddAccount,
313
+ onNavigateProfile,
314
+ onBeforeSessionChange
315
+ }) => {
316
+ const {
317
+ t
318
+ } = useI18n();
319
+
320
+ // Web: anchor the panel to the measured trigger. When the anchor pins `top`
321
+ // the panel opens DOWNWARD from the trigger; otherwise it pins `bottom` and
322
+ // opens UPWARD (the default footer behavior). With no anchor captured, fall
323
+ // back to a bottom-left placement. Native ignores this (the panel docks to
324
+ // the bottom via the overlay's flex-end).
325
+ const panelAnchorStyle = isWeb ? {
326
+ position: 'absolute',
327
+ width: MENU_WIDTH,
328
+ left: anchor?.left ?? 8,
329
+ ...(typeof anchor?.top === 'number' ? {
330
+ top: anchor.top
331
+ } : {
332
+ bottom: anchor?.bottom ?? 8
333
+ })
334
+ } : undefined;
335
+ return /*#__PURE__*/_jsx(Modal, {
336
+ visible: open,
337
+ transparent: true,
338
+ animationType: isWeb ? 'fade' : 'slide',
339
+ onRequestClose: onClose,
340
+ children: /*#__PURE__*/_jsx(Pressable, {
341
+ accessibilityRole: "button",
342
+ accessibilityLabel: t('common.actions.close') || 'Close',
343
+ onPress: onClose,
344
+ className: isWeb ? 'flex-1 relative' : 'flex-1 justify-end',
345
+ style: !isWeb ? styles.nativeScrim : undefined,
346
+ children: /*#__PURE__*/_jsx(Pressable
347
+ // Swallow taps inside the panel so they never reach the overlay's
348
+ // outside-tap-to-close handler.
349
+ , {
350
+ onPress: () => undefined,
351
+ className: isWeb ? 'overflow-hidden rounded-2xl border border-border bg-background' : 'overflow-hidden rounded-t-3xl bg-background pb-3',
352
+ style: [panelAnchorStyle, {
353
+ maxHeight: '85%'
354
+ }, styles.shadow],
355
+ accessibilityRole: "menu",
356
+ accessibilityLabel: t('accountMenu.label') || 'Account menu',
357
+ children: open ? /*#__PURE__*/_jsx(ProfileMenuContent, {
358
+ onClose: onClose,
359
+ anchor: anchor,
360
+ onNavigateManage: onNavigateManage,
361
+ onAddAccount: onAddAccount,
362
+ onNavigateProfile: onNavigateProfile,
363
+ onBeforeSessionChange: onBeforeSessionChange
364
+ }) : null
365
+ })
366
+ })
367
+ });
368
+ };
369
+
328
370
  /** Bottom-section action row (Add account / Manage / View profile). */
329
371
  const ActionRow = ({
330
372
  icon,
@@ -366,22 +408,5 @@ const styles = {
366
408
  backgroundColor: 'rgba(0,0,0,0.32)'
367
409
  }
368
410
  };
369
-
370
- /**
371
- * Public wrapper: renders nothing — and runs NO hooks — until `open`. Mounting
372
- * the body only while open keeps the account hooks (`useDeviceAccounts` /
373
- * refresh-all, Bloom dialog/toast controls) off the render path when the menu is
374
- * closed, which is every time the sidebar or native drawer mounts
375
- * `ProfileButton`. A hook that is unsafe on a given platform (e.g. throws during
376
- * a native render) therefore never runs unless the user actually opens the menu.
377
- */
378
- const ProfileMenu = props => {
379
- if (!props.open) {
380
- return null;
381
- }
382
- return /*#__PURE__*/_jsx(ProfileMenuBody, {
383
- ...props
384
- });
385
- };
386
411
  export default ProfileMenu;
387
412
  //# sourceMappingURL=ProfileMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useEffect","useState","View","Pressable","Modal","ScrollView","ActivityIndicator","Platform","MaterialCommunityIcons","Avatar","Text","useTheme","toast","useDialogControl","Dialog","Divider","isDev","logger","loggerUtil","useOxy","useI18n","useDeviceAccounts","jsx","_jsx","jsxs","_jsxs","isWeb","OS","MENU_WIDTH","ProfileMenuBody","open","onClose","anchor","onNavigateManage","onAddAccount","onNavigateProfile","onBeforeSessionChange","activeSessionId","switchSession","logoutAll","removeSession","t","colors","accounts","busySessionId","setBusySessionId","removingSessionId","setRemovingSessionId","signingOutAll","setSigningOutAll","signOutAllDialog","isSwitching","actionDisabled","handleSwitch","sessionId","success","error","warn","component","handleRemove","performSignOutAll","document","undefined","onKey","event","key","stopPropagation","addEventListener","removeEventListener","panelAnchorStyle","position","width","left","bottom","content","onPress","className","style","maxHeight","styles","shadow","accessibilityRole","accessibilityLabel","children","contentContainerClassName","showsVerticalScrollIndicator","map","account","isActive","isCurrent","isBusy","isRemoving","displayName","accessibilityState","selected","disabled","source","user","avatar","uri","avatarUrl","variant","name","size","numberOfLines","email","color","primary","textSecondary","hitSlop","top","right","border","spacing","ActionRow","icon","iconColor","label","visible","transparent","animationType","onRequestClose","nativeScrim","control","title","description","actions","shadowColor","shadowOpacity","shadowRadius","shadowOffset","height","elevation","backgroundColor","ProfileMenu","props"],"sourceRoot":"../../../../src","sources":["ui/components/ProfileMenu.tsx"],"mappings":";;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACIC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,UAAU,EACVC,iBAAiB,EACjBC,QAAQ,QAEL,cAAc;AACrB,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,MAAM,QAAQ,cAAc;AAC9D,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,KAAK,EAAEC,MAAM,IAAIC,UAAU,QAAQ,aAAa;AACzD,SAASC,MAAM,QAAQ,0BAAuB;AAC9C,SAASC,OAAO,QAAQ,qBAAkB;AAC1C,SAASC,iBAAiB,QAAQ,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/D,MAAMC,KAAK,GAAGnB,QAAQ,CAACoB,EAAE,KAAK,KAAK;;AAEnC;AACA,MAAMC,UAAU,GAAG,GAAG;;AAEtB;AACA;AACA;AACA;AACA;;AAuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAA2C,GAAGA,CAAC;EACjDC,IAAI;EACJC,OAAO;EACPC,MAAM;EACNC,gBAAgB;EAChBC,YAAY;EACZC,iBAAiB;EACjBC;AACJ,CAAC,KAAK;EACF,MAAM;IACFC,eAAe;IACfC,aAAa;I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AMJ,GAAGA,CAAC;EAAEC,IAAI;EAAEC,SAAS;EAAEC,KAAK;EAAEtB,QAAQ;EAAEpB;AAAQ,CAAC,kBAC/ClD,KAAA,CAACtB,SAAS;EACN8E,iBAAiB,EAAC,UAAU;EAC5BC,kBAAkB,EAAEmC,KAAM;EAC1B1C,OAAO,EAAEA,OAAQ;EACjBoB,QAAQ,EAAEA,QAAS;EACnBnB,SAAS,EAAE,yCAAyCmB,QAAQ,GAAG,YAAY,GAAG,EAAE,EAAG;EAAAZ,QAAA,gBAEnF5D,IAAA,CAACf,sBAAsB;IAAC8F,IAAI,EAAEa,IAAK;IAACZ,IAAI,EAAE,EAAG;IAACG,KAAK,EAAEU;EAAU,CAAE,CAAC,eAClE7F,IAAA,CAACb,IAAI;IAACkE,SAAS,EAAC,6BAA6B;IAAAO,QAAA,EAAEkC;EAAK,CAAO,CAAC;AAAA,CACrD,CACd;;AAED;AACA;AACA;AACA,MAAMtC,MAAM,GAAG;EACXC,MAAM,EAAE;IACJ+C,WAAW,EAAE,MAAM;IACnBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE;MAAE3D,KAAK,EAAE,CAAC;MAAE4D,MAAM,EAAE;IAAE,CAAC;IACrCC,SAAS,EAAE;EACf,CAAqB;EACrBV,WAAW,EAAE;IACTW,eAAe,EAAE;EACrB;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAuC,GAAIC,KAAK,IAAK;EACvD,IAAI,CAACA,KAAK,CAACzG,IAAI,EAAE;IACb,OAAO,IAAI;EACf;EACA,oBAAOP,IAAA,CAACM,eAAe;IAAA,GAAK0G;EAAK,CAAG,CAAC;AACzC,CAAC;AAED,eAAeD,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useEffect","useState","View","Pressable","Modal","ScrollView","ActivityIndicator","Platform","MaterialCommunityIcons","Avatar","Text","useTheme","toast","useDialogControl","Dialog","Divider","isDev","logger","loggerUtil","useOxy","useI18n","useDeviceAccounts","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isWeb","OS","MENU_WIDTH","ProfileMenuContent","onClose","onNavigateManage","onAddAccount","onNavigateProfile","onBeforeSessionChange","activeSessionId","switchSession","logoutAll","removeSession","t","colors","accounts","busySessionId","setBusySessionId","removingSessionId","setRemovingSessionId","signingOutAll","setSigningOutAll","signOutAllDialog","isSwitching","actionDisabled","handleSwitch","sessionId","success","error","warn","component","handleRemove","performSignOutAll","document","undefined","onKey","event","key","stopPropagation","addEventListener","removeEventListener","children","className","contentContainerClassName","showsVerticalScrollIndicator","map","account","isActive","isCurrent","isBusy","isRemoving","accessibilityRole","accessibilityLabel","displayName","accessibilityState","selected","onPress","disabled","source","user","avatar","uri","avatarUrl","variant","name","size","numberOfLines","email","color","primary","textSecondary","hitSlop","top","bottom","left","right","border","spacing","ActionRow","icon","iconColor","label","open","style","control","title","description","actions","ProfileMenu","anchor","panelAnchorStyle","position","width","visible","transparent","animationType","onRequestClose","styles","nativeScrim","maxHeight","shadow","shadowColor","shadowOpacity","shadowRadius","shadowOffset","height","elevation","backgroundColor"],"sourceRoot":"../../../../src","sources":["ui/components/ProfileMenu.tsx"],"mappings":";;AACA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACIC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,UAAU,EACVC,iBAAiB,EACjBC,QAAQ,QAEL,cAAc;AACrB,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,EAAEC,gBAAgB,EAAEC,MAAM,QAAQ,cAAc;AAC9D,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,KAAK,EAAEC,MAAM,IAAIC,UAAU,QAAQ,aAAa;AACzD,SAASC,MA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AkB,EAAE6B,KAAM;EAC1BzB,OAAO,EAAEA,OAAQ;EACjBC,QAAQ,EAAEA,QAAS;EACnBf,SAAS,EAAE,yCAAyCe,QAAQ,GAAG,YAAY,GAAG,EAAE,EAAG;EAAAhB,QAAA,gBAEnF9C,IAAA,CAACf,sBAAsB;IAACoF,IAAI,EAAEe,IAAK;IAACd,IAAI,EAAE,EAAG;IAACG,KAAK,EAAEY;EAAU,CAAE,CAAC,eAClErF,IAAA,CAACb,IAAI;IAAC4D,SAAS,EAAC,6BAA6B;IAAAD,QAAA,EAAEwC;EAAK,CAAO,CAAC;AAAA,CACrD,CACd;;AAED;AACA;AACA;AACA,MAAMgB,MAAM,GAAG;EACXG,MAAM,EAAE;IACJC,WAAW,EAAE,MAAM;IACnBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE;MAAEZ,KAAK,EAAE,CAAC;MAAEa,MAAM,EAAE;IAAE,CAAC;IACrCC,SAAS,EAAE;EACf,CAAqB;EACrBR,WAAW,EAAE;IACTS,eAAe,EAAE;EACrB;AACJ,CAAC;AAED,eAAenB,WAAW","ignoreList":[]}
@@ -18,6 +18,18 @@ export interface ProfileButtonProps {
18
18
  onNavigateProfile?: () => void;
19
19
  /** Called before the active identity changes so apps can clear scoped state. */
20
20
  onBeforeSessionChange?: () => void | Promise<void>;
21
+ /**
22
+ * Web-only popover direction relative to the trigger:
23
+ * - `'up'` (default): the menu opens UPWARD, for a trigger placed at the
24
+ * BOTTOM of a sidebar (the footer pattern). Pixel-identical to prior
25
+ * behavior.
26
+ * - `'down'`: the menu opens DOWNWARD, for a trigger placed at the TOP of a
27
+ * sidebar (the accounts app pattern).
28
+ * - `'auto'`: opens downward when there is more room below the trigger than
29
+ * above, otherwise upward.
30
+ * Native (bottom-sheet) is unaffected — this only influences the web popover.
31
+ */
32
+ placement?: 'up' | 'down' | 'auto';
21
33
  /** Extra className applied to the outer trigger. */
22
34
  className?: string;
23
35
  /** Extra style applied to the outer trigger. */
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAiDtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoS/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAiDtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqT/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,14 +1,19 @@
1
1
  import type React from 'react';
2
2
  /**
3
- * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel's
4
- * BOTTOM-LEFT corner so the menu opens UPWARD from the sidebar footer. Native
5
- * ignores the anchor and docks the panel to the bottom as a sheet.
3
+ * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel to
4
+ * one corner so the menu opens either UPWARD (footer trigger) or DOWNWARD (a
5
+ * trigger at the top of a sidebar). Exactly ONE vertical edge is pinned:
6
+ * - `bottom` set → the panel's BOTTOM edge is anchored, so it opens UPWARD.
7
+ * - `top` set → the panel's TOP edge is anchored, so it opens DOWNWARD.
8
+ * Native ignores the anchor and docks the panel to the bottom as a sheet.
6
9
  */
7
10
  export interface ProfileMenuAnchor {
8
11
  /** Distance from the viewport left, for the panel's LEFT edge. */
9
12
  left: number;
10
13
  /** Distance from the viewport bottom, for the panel's BOTTOM edge (opens upward). */
11
- bottom: number;
14
+ bottom?: number;
15
+ /** Distance from the viewport top, for the panel's TOP edge (opens downward). */
16
+ top?: number;
12
17
  }
13
18
  export interface ProfileMenuProps {
14
19
  open: boolean;
@@ -25,12 +30,16 @@ export interface ProfileMenuProps {
25
30
  onBeforeSessionChange?: () => void | Promise<void>;
26
31
  }
27
32
  /**
28
- * Public wrapper: renders nothing and runs NO hooks until `open`. Mounting
29
- * the body only while open keeps the account hooks (`useDeviceAccounts` /
30
- * refresh-all, Bloom dialog/toast controls) off the render path when the menu is
31
- * closed, which is every time the sidebar or native drawer mounts
32
- * `ProfileButton`. A hook that is unsafe on a given platform (e.g. throws during
33
- * a native render) therefore never runs unless the user actually opens the menu.
33
+ * Public wrapper. The RN `Modal` shell is ALWAYS mounted (only `visible` toggles)
34
+ * so the react-native-web portal is created up front mounting a web `Modal`
35
+ * already-`visible` is fragile (the first interaction can be eaten / the button
36
+ * "does nothing"). Only the heavy {@link ProfileMenuContent} mounts when open,
37
+ * keeping the account hooks off the render path when the menu is closed. On
38
+ * native that closed render is `<Modal visible={false}>{null}</Modal>` no heavy
39
+ * hooks run (preserving the native-drawer crash fix).
40
+ *
41
+ * This outer component calls ONLY light, always-safe hooks (`useTheme`,
42
+ * `useI18n` for the overlay a11y label) and computes the panel/overlay layout.
34
43
  */
35
44
  declare const ProfileMenu: React.FC<ProfileMenuProps>;
36
45
  export default ProfileMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2B/B;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,2DAA2D;I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,WAAW,CAAC"}
@@ -18,6 +18,18 @@ export interface ProfileButtonProps {
18
18
  onNavigateProfile?: () => void;
19
19
  /** Called before the active identity changes so apps can clear scoped state. */
20
20
  onBeforeSessionChange?: () => void | Promise<void>;
21
+ /**
22
+ * Web-only popover direction relative to the trigger:
23
+ * - `'up'` (default): the menu opens UPWARD, for a trigger placed at the
24
+ * BOTTOM of a sidebar (the footer pattern). Pixel-identical to prior
25
+ * behavior.
26
+ * - `'down'`: the menu opens DOWNWARD, for a trigger placed at the TOP of a
27
+ * sidebar (the accounts app pattern).
28
+ * - `'auto'`: opens downward when there is more room below the trigger than
29
+ * above, otherwise upward.
30
+ * Native (bottom-sheet) is unaffected — this only influences the web popover.
31
+ */
32
+ placement?: 'up' | 'down' | 'auto';
21
33
  /** Extra className applied to the outer trigger. */
22
34
  className?: string;
23
35
  /** Extra style applied to the outer trigger. */
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAiDtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoS/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAIH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAiDtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqT/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,14 +1,19 @@
1
1
  import type React from 'react';
2
2
  /**
3
- * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel's
4
- * BOTTOM-LEFT corner so the menu opens UPWARD from the sidebar footer. Native
5
- * ignores the anchor and docks the panel to the bottom as a sheet.
3
+ * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel to
4
+ * one corner so the menu opens either UPWARD (footer trigger) or DOWNWARD (a
5
+ * trigger at the top of a sidebar). Exactly ONE vertical edge is pinned:
6
+ * - `bottom` set → the panel's BOTTOM edge is anchored, so it opens UPWARD.
7
+ * - `top` set → the panel's TOP edge is anchored, so it opens DOWNWARD.
8
+ * Native ignores the anchor and docks the panel to the bottom as a sheet.
6
9
  */
7
10
  export interface ProfileMenuAnchor {
8
11
  /** Distance from the viewport left, for the panel's LEFT edge. */
9
12
  left: number;
10
13
  /** Distance from the viewport bottom, for the panel's BOTTOM edge (opens upward). */
11
- bottom: number;
14
+ bottom?: number;
15
+ /** Distance from the viewport top, for the panel's TOP edge (opens downward). */
16
+ top?: number;
12
17
  }
13
18
  export interface ProfileMenuProps {
14
19
  open: boolean;
@@ -25,12 +30,16 @@ export interface ProfileMenuProps {
25
30
  onBeforeSessionChange?: () => void | Promise<void>;
26
31
  }
27
32
  /**
28
- * Public wrapper: renders nothing and runs NO hooks until `open`. Mounting
29
- * the body only while open keeps the account hooks (`useDeviceAccounts` /
30
- * refresh-all, Bloom dialog/toast controls) off the render path when the menu is
31
- * closed, which is every time the sidebar or native drawer mounts
32
- * `ProfileButton`. A hook that is unsafe on a given platform (e.g. throws during
33
- * a native render) therefore never runs unless the user actually opens the menu.
33
+ * Public wrapper. The RN `Modal` shell is ALWAYS mounted (only `visible` toggles)
34
+ * so the react-native-web portal is created up front mounting a web `Modal`
35
+ * already-`visible` is fragile (the first interaction can be eaten / the button
36
+ * "does nothing"). Only the heavy {@link ProfileMenuContent} mounts when open,
37
+ * keeping the account hooks off the render path when the menu is closed. On
38
+ * native that closed render is `<Modal visible={false}>{null}</Modal>` no heavy
39
+ * hooks run (preserving the native-drawer crash fix).
40
+ *
41
+ * This outer component calls ONLY light, always-safe hooks (`useTheme`,
42
+ * `useI18n` for the overlay a11y label) and computes the panel/overlay layout.
34
43
  */
35
44
  declare const ProfileMenu: React.FC<ProfileMenuProps>;
36
45
  export default ProfileMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2B/B;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AA2WD;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAK3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ProfileMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2B/B;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAwRD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAoE3C,CAAC;AAsCF,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "13.1.6",
3
+ "version": "13.2.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",
@@ -153,7 +153,7 @@
153
153
  "peerDependencies": {
154
154
  "@expo/vector-icons": "^15.0.3",
155
155
  "@oxyhq/bloom": ">=0.16.0",
156
- "@oxyhq/core": "5.2.0",
156
+ "@oxyhq/core": "^5.2.0",
157
157
  "@react-native-async-storage/async-storage": "^2.0.0",
158
158
  "@react-native-community/netinfo": "^11.4.1",
159
159
  "@tanstack/query-async-storage-persister": "^5.101",
@@ -73,6 +73,18 @@ export interface ProfileButtonProps {
73
73
  onNavigateProfile?: () => void;
74
74
  /** Called before the active identity changes so apps can clear scoped state. */
75
75
  onBeforeSessionChange?: () => void | Promise<void>;
76
+ /**
77
+ * Web-only popover direction relative to the trigger:
78
+ * - `'up'` (default): the menu opens UPWARD, for a trigger placed at the
79
+ * BOTTOM of a sidebar (the footer pattern). Pixel-identical to prior
80
+ * behavior.
81
+ * - `'down'`: the menu opens DOWNWARD, for a trigger placed at the TOP of a
82
+ * sidebar (the accounts app pattern).
83
+ * - `'auto'`: opens downward when there is more room below the trigger than
84
+ * above, otherwise upward.
85
+ * Native (bottom-sheet) is unaffected — this only influences the web popover.
86
+ */
87
+ placement?: 'up' | 'down' | 'auto';
76
88
  /** Extra className applied to the outer trigger. */
77
89
  className?: string;
78
90
  /** Extra style applied to the outer trigger. */
@@ -104,6 +116,7 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
104
116
  onAddAccount,
105
117
  onNavigateProfile,
106
118
  onBeforeSessionChange,
119
+ placement = 'up',
107
120
  className,
108
121
  style,
109
122
  }) => {
@@ -143,7 +156,7 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
143
156
  setMenuOpen(true);
144
157
  return;
145
158
  }
146
- node.measure((_x, _y, _w, _h, pageX, pageY) => {
159
+ node.measure((_x, _y, _w, height, pageX, pageY) => {
147
160
  if (typeof pageX !== 'number' || typeof pageY !== 'number') {
148
161
  setAnchor(null);
149
162
  } else {
@@ -153,17 +166,33 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
153
166
  window.innerWidth - MENU_WIDTH - VIEWPORT_GUTTER,
154
167
  );
155
168
  const left = Math.min(Math.max(VIEWPORT_GUTTER, pageX), maxLeft);
156
- // Anchor the panel's BOTTOM edge just above the trigger top so
157
- // the menu opens upward from this footer button.
158
- const bottom = Math.max(
159
- VIEWPORT_GUTTER,
160
- window.innerHeight - pageY + VIEWPORT_GUTTER,
161
- );
162
- setAnchor({ left, bottom });
169
+ // Bottom edge of the trigger in page coordinates. `height` is a
170
+ // number for host views; guard defensively for non-web shims.
171
+ const triggerBottom = pageY + (typeof height === 'number' ? height : 0);
172
+ // Resolve `'auto'` by comparing the room below the trigger with
173
+ // the room above it; pick whichever direction has more space.
174
+ const openDown =
175
+ placement === 'down' ||
176
+ (placement === 'auto' &&
177
+ window.innerHeight - triggerBottom > pageY);
178
+ if (openDown) {
179
+ // Anchor the panel's TOP edge just below the trigger bottom so
180
+ // the menu opens downward from a top-of-sidebar trigger.
181
+ const top = Math.max(VIEWPORT_GUTTER, triggerBottom + VIEWPORT_GUTTER);
182
+ setAnchor({ left, top });
183
+ } else {
184
+ // Anchor the panel's BOTTOM edge just above the trigger top so
185
+ // the menu opens upward from this footer button.
186
+ const bottom = Math.max(
187
+ VIEWPORT_GUTTER,
188
+ window.innerHeight - pageY + VIEWPORT_GUTTER,
189
+ );
190
+ setAnchor({ left, bottom });
191
+ }
163
192
  }
164
193
  setMenuOpen(true);
165
194
  });
166
- }, []);
195
+ }, [placement]);
167
196
 
168
197
  const handleClose = useCallback(() => {
169
198
  setMenuOpen(false);