@oxyhq/services 13.1.7 → 13.3.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.
- package/lib/commonjs/ui/components/ProfileButton.js +107 -31
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileMenu.js +162 -38
- package/lib/commonjs/ui/components/ProfileMenu.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +108 -32
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/ProfileMenu.js +163 -39
- package/lib/module/ui/components/ProfileMenu.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +23 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +9 -4
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +23 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +9 -4
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/components/ProfileButton.tsx +133 -26
- package/src/ui/components/ProfileMenu.tsx +164 -43
|
@@ -67,6 +67,12 @@ const prefersReducedMotion = () => {
|
|
|
67
67
|
* against the measured trigger, or as a bottom sheet (native).
|
|
68
68
|
* - **Signed out**: a "Sign in" row that calls `useAuth().signIn()`.
|
|
69
69
|
*
|
|
70
|
+
* Styling uses react-native `StyleSheet` + the Bloom theme (via `useTheme`) so
|
|
71
|
+
* the layout renders identically in EVERY consumer — including apps that do not
|
|
72
|
+
* use NativeWind (e.g. the accounts app). Only the web hover animation keeps
|
|
73
|
+
* dynamic inline `style` (the CSS transition/transform values), which is what
|
|
74
|
+
* the `react-native-web-style.d.ts` augmentation exists for.
|
|
75
|
+
*
|
|
70
76
|
* All display strings resolve through `@oxyhq/core`'s
|
|
71
77
|
* `getAccountDisplayName` / `getAccountFallbackHandle` — no hand-rolled name
|
|
72
78
|
* fallbacks. Avatars pass the bare file id as `source` + `variant="thumb"`, so
|
|
@@ -79,6 +85,7 @@ const ProfileButton = ({
|
|
|
79
85
|
onAddAccount,
|
|
80
86
|
onNavigateProfile,
|
|
81
87
|
onBeforeSessionChange,
|
|
88
|
+
placement = 'up',
|
|
82
89
|
className,
|
|
83
90
|
style
|
|
84
91
|
}) => {
|
|
@@ -120,24 +127,40 @@ const ProfileButton = ({
|
|
|
120
127
|
setMenuOpen(true);
|
|
121
128
|
return;
|
|
122
129
|
}
|
|
123
|
-
node.measure((_x, _y, _w,
|
|
130
|
+
node.measure((_x, _y, _w, height, pageX, pageY) => {
|
|
124
131
|
if (typeof pageX !== 'number' || typeof pageY !== 'number') {
|
|
125
132
|
setAnchor(null);
|
|
126
133
|
} else {
|
|
127
134
|
// Clamp the panel's left edge inside the viewport gutter.
|
|
128
135
|
const maxLeft = Math.max(VIEWPORT_GUTTER, window.innerWidth - MENU_WIDTH - VIEWPORT_GUTTER);
|
|
129
136
|
const left = Math.min(Math.max(VIEWPORT_GUTTER, pageX), maxLeft);
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
// Bottom edge of the trigger in page coordinates. `height` is a
|
|
138
|
+
// number for host views; guard defensively for non-web shims.
|
|
139
|
+
const triggerBottom = pageY + (typeof height === 'number' ? height : 0);
|
|
140
|
+
// Resolve `'auto'` by comparing the room below the trigger with
|
|
141
|
+
// the room above it; pick whichever direction has more space.
|
|
142
|
+
const openDown = placement === 'down' || placement === 'auto' && window.innerHeight - triggerBottom > pageY;
|
|
143
|
+
if (openDown) {
|
|
144
|
+
// Anchor the panel's TOP edge just below the trigger bottom so
|
|
145
|
+
// the menu opens downward from a top-of-sidebar trigger.
|
|
146
|
+
const top = Math.max(VIEWPORT_GUTTER, triggerBottom + VIEWPORT_GUTTER);
|
|
147
|
+
setAnchor({
|
|
148
|
+
left,
|
|
149
|
+
top
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
// Anchor the panel's BOTTOM edge just above the trigger top so
|
|
153
|
+
// the menu opens upward from this footer button.
|
|
154
|
+
const bottom = Math.max(VIEWPORT_GUTTER, window.innerHeight - pageY + VIEWPORT_GUTTER);
|
|
155
|
+
setAnchor({
|
|
156
|
+
left,
|
|
157
|
+
bottom
|
|
158
|
+
});
|
|
159
|
+
}
|
|
137
160
|
}
|
|
138
161
|
setMenuOpen(true);
|
|
139
162
|
});
|
|
140
|
-
}, []);
|
|
163
|
+
}, [placement]);
|
|
141
164
|
const handleClose = (0, _react.useCallback)(() => {
|
|
142
165
|
setMenuOpen(false);
|
|
143
166
|
}, []);
|
|
@@ -150,11 +173,11 @@ const ProfileButton = ({
|
|
|
150
173
|
accessibilityElementsHidden: true,
|
|
151
174
|
importantForAccessibility: "no-hide-descendants",
|
|
152
175
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
153
|
-
|
|
154
|
-
style: {
|
|
176
|
+
style: [styles.skeletonCircle, {
|
|
155
177
|
width: resolvedAvatarSize,
|
|
156
|
-
height: resolvedAvatarSize
|
|
157
|
-
|
|
178
|
+
height: resolvedAvatarSize,
|
|
179
|
+
backgroundColor: colors.backgroundSecondary
|
|
180
|
+
}]
|
|
158
181
|
})
|
|
159
182
|
});
|
|
160
183
|
}
|
|
@@ -163,26 +186,28 @@ const ProfileButton = ({
|
|
|
163
186
|
if (!isAuthenticated || !user) {
|
|
164
187
|
const signInLabel = t('common.actions.signIn') || 'Sign in';
|
|
165
188
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
166
|
-
className:
|
|
167
|
-
style: style,
|
|
189
|
+
className: className,
|
|
190
|
+
style: [styles.row, expanded && styles.rowExpanded, style],
|
|
168
191
|
onPress: () => {
|
|
169
192
|
void signIn();
|
|
170
193
|
},
|
|
171
194
|
accessibilityRole: "button",
|
|
172
195
|
accessibilityLabel: signInLabel,
|
|
173
196
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
174
|
-
|
|
175
|
-
style: {
|
|
197
|
+
style: [styles.avatarBadge, {
|
|
176
198
|
width: resolvedAvatarSize,
|
|
177
|
-
height: resolvedAvatarSize
|
|
178
|
-
|
|
199
|
+
height: resolvedAvatarSize,
|
|
200
|
+
backgroundColor: colors.backgroundSecondary
|
|
201
|
+
}],
|
|
179
202
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
|
|
180
203
|
name: "login",
|
|
181
204
|
size: Math.round(resolvedAvatarSize * 0.5),
|
|
182
205
|
color: colors.icon
|
|
183
206
|
})
|
|
184
207
|
}), expanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
185
|
-
|
|
208
|
+
style: [styles.signInLabel, {
|
|
209
|
+
color: colors.text
|
|
210
|
+
}],
|
|
186
211
|
numberOfLines: 1,
|
|
187
212
|
children: signInLabel
|
|
188
213
|
}) : null]
|
|
@@ -231,8 +256,7 @@ const ProfileButton = ({
|
|
|
231
256
|
style: style,
|
|
232
257
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
233
258
|
ref: triggerRef,
|
|
234
|
-
|
|
235
|
-
style: collapsedBgStyle,
|
|
259
|
+
style: [styles.collapsedTrigger, collapsedBgStyle],
|
|
236
260
|
onPress: openMenu,
|
|
237
261
|
accessibilityRole: "button",
|
|
238
262
|
accessibilityLabel: accountLabel,
|
|
@@ -261,7 +285,7 @@ const ProfileButton = ({
|
|
|
261
285
|
// Slide the shrunk avatar left so its visual left edge stays put as it
|
|
262
286
|
// contracts. The avatar loses `size * (1 - scale)` of width; half of that
|
|
263
287
|
// (the left half, since scale is centered) is the offset, plus the row's
|
|
264
|
-
// left padding (
|
|
288
|
+
// left padding (8px) so it hugs the row edge like Bluesky's.
|
|
265
289
|
const activeAvatarTranslateX = -(resolvedAvatarSize * (1 - ACTIVE_AVATAR_SCALE)) / 2 - 8;
|
|
266
290
|
const rowStyle = isWeb ? {
|
|
267
291
|
backgroundColor: active ? colors.backgroundSecondary : 'transparent',
|
|
@@ -300,12 +324,11 @@ const ProfileButton = ({
|
|
|
300
324
|
transitionDelay: active ? '0ms' : `${LEAVE_DELAY_MS}ms`
|
|
301
325
|
} : undefined;
|
|
302
326
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
303
|
-
className:
|
|
304
|
-
style: style,
|
|
327
|
+
className: className,
|
|
328
|
+
style: [styles.fullWidth, style],
|
|
305
329
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
306
330
|
ref: triggerRef,
|
|
307
|
-
|
|
308
|
-
style: rowStyle,
|
|
331
|
+
style: [styles.row, styles.rowExpanded, rowStyle],
|
|
309
332
|
onPress: openMenu,
|
|
310
333
|
accessibilityRole: "button",
|
|
311
334
|
accessibilityLabel: accountLabel,
|
|
@@ -314,14 +337,17 @@ const ProfileButton = ({
|
|
|
314
337
|
style: avatarWrapperStyle,
|
|
315
338
|
children: avatarNode
|
|
316
339
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
317
|
-
|
|
318
|
-
style: identityStyle,
|
|
340
|
+
style: [styles.identity, identityStyle],
|
|
319
341
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
320
|
-
|
|
342
|
+
style: [styles.displayName, {
|
|
343
|
+
color: colors.text
|
|
344
|
+
}],
|
|
321
345
|
numberOfLines: 1,
|
|
322
346
|
children: displayName
|
|
323
347
|
}), handleLine ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
324
|
-
|
|
348
|
+
style: [styles.handle, {
|
|
349
|
+
color: colors.textSecondary
|
|
350
|
+
}],
|
|
325
351
|
numberOfLines: 1,
|
|
326
352
|
children: handleLine
|
|
327
353
|
}) : null]
|
|
@@ -344,5 +370,55 @@ const ProfileButton = ({
|
|
|
344
370
|
})]
|
|
345
371
|
});
|
|
346
372
|
};
|
|
373
|
+
const styles = _reactNative.StyleSheet.create({
|
|
374
|
+
fullWidth: {
|
|
375
|
+
width: '100%'
|
|
376
|
+
},
|
|
377
|
+
// Neutral skeleton / signed-out avatar circle (`rounded-full`).
|
|
378
|
+
skeletonCircle: {
|
|
379
|
+
borderRadius: 9999
|
|
380
|
+
},
|
|
381
|
+
// Shared trigger row (`flex-row items-center gap-3 rounded-full px-2 py-2`).
|
|
382
|
+
row: {
|
|
383
|
+
flexDirection: 'row',
|
|
384
|
+
alignItems: 'center',
|
|
385
|
+
gap: 12,
|
|
386
|
+
borderRadius: 9999,
|
|
387
|
+
paddingHorizontal: 8,
|
|
388
|
+
paddingVertical: 8
|
|
389
|
+
},
|
|
390
|
+
// `w-full` on the expanded row + its signed-out variant.
|
|
391
|
+
rowExpanded: {
|
|
392
|
+
width: '100%'
|
|
393
|
+
},
|
|
394
|
+
// Signed-out login badge (`items-center justify-center rounded-full`).
|
|
395
|
+
avatarBadge: {
|
|
396
|
+
alignItems: 'center',
|
|
397
|
+
justifyContent: 'center',
|
|
398
|
+
borderRadius: 9999
|
|
399
|
+
},
|
|
400
|
+
// Signed-out label (`flex-1 font-semibold`).
|
|
401
|
+
signInLabel: {
|
|
402
|
+
flex: 1,
|
|
403
|
+
fontWeight: '600'
|
|
404
|
+
},
|
|
405
|
+
// Collapsed avatar-only trigger (`rounded-full`).
|
|
406
|
+
collapsedTrigger: {
|
|
407
|
+
borderRadius: 9999
|
|
408
|
+
},
|
|
409
|
+
// Identity block (`min-w-0 flex-1`).
|
|
410
|
+
identity: {
|
|
411
|
+
flex: 1,
|
|
412
|
+
minWidth: 0
|
|
413
|
+
},
|
|
414
|
+
// Display name (`font-bold`).
|
|
415
|
+
displayName: {
|
|
416
|
+
fontWeight: '700'
|
|
417
|
+
},
|
|
418
|
+
// Handle line (`text-xs`).
|
|
419
|
+
handle: {
|
|
420
|
+
fontSize: 12
|
|
421
|
+
}
|
|
422
|
+
});
|
|
347
423
|
var _default = exports.default = ProfileButton;
|
|
348
424
|
//# sourceMappingURL=ProfileButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_vectorIcons","_avatar","_typography","_theme","_core","_useAuth","_useI18n","_ProfileMenu","_interopRequireDefault","_jsxRuntime","e","__esModule","default","isWeb","Platform","OS","MENU_WIDTH","VIEWPORT_GUTTER","BG_TRANSITION_MS","AVATAR_TRANSITION_MS","OPACITY_TRANSITION_MS","LEAVE_DELAY_MS","ACTIVE_AVATAR_SCALE","prefersReducedMotion","window","matchMedia","matches","ProfileButton","expanded","avatarSize","onNavigateManage","onAddAccount","onNavigateProfile","onBeforeSessionChange","className","style","user","isAuthenticated","isAuthResolved","isPrivateApiPending","signIn","useAuth","colors","useTheme","t","locale","useI18n","menuOpen","setMenuOpen","useState","anchor","setAnchor","hovered","setHovered","focused","setFocused","triggerRef","useRef","resolvedAvatarSize","openMenu","useCallback","node","current","measure","_x","_y","_w","_h","pageX","pageY","maxLeft","Math","max","innerWidth","left","min","bottom","innerHeight","handleClose","jsx","View","accessibilityElementsHidden","importantForAccessibility","children","width","height","signInLabel","jsxs","Pressable","onPress","accessibilityRole","accessibilityLabel","MaterialCommunityIcons","name","size","round","color","icon","Text","numberOfLines","displayName","getAccountDisplayName","handle","getAccountFallbackHandle","handleLine","avatarNode","Avatar","source","avatar","undefined","variant","active","accountLabel","webInteractionProps","onHoverIn","onHoverOut","onFocus","onBlur","collapsedBgStyle","backgroundColor","backgroundSecondary","transitionProperty","transitionDuration","transitionDelay","ref","open","onClose","reducedMotion","activeAvatarTranslateX","rowStyle","avatarWrapperStyle","zIndex","transform","scale","translateX","identityStyle","marginLeft","opacity","chevronStyle","textSecondary","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/ProfileButton.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAC,sBAAA,CAAAV,OAAA;AAAoE,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAU,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpE,MAAMG,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;;AAEnC;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,GAAG;;AAEtB;AACA,MAAMC,eAAe,GAAG,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,oBAAoB,GAAG,GAAG;AAChC,MAAMC,qBAAqB,GAAG,GAAG;AACjC,MAAMC,cAAc,GAAG,EAAE;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,CAAC,GAAG,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAAA,KAAe;EACxC,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,EAAE;IAC1E,OAAO,KAAK;EAChB;EACA,OAAOD,MAAM,CAACC,UAAU,CAAC,kCAAkC,CAAC,CAACC,OAAO;AACxE,CAAC;AA0BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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ACiG;QAAc,CAC/B;MAAC,CACA,CAAC;IAAA,CACA,CAAC,eACZ,IAAAlI,WAAA,CAAAsE,GAAA,EAACxE,YAAA,CAAAK,OAAW;MACRiH,IAAI,EAAE9E,QAAS;MACf+E,OAAO,EAAEhD,WAAY;MACrB5B,MAAM,EAAEA,MAAO;MACfpB,gBAAgB,EAAEA,gBAAiB;MACnCC,YAAY,EAAEA,YAAa;MAC3BC,iBAAiB,EAAEA,iBAAkB;MACrCC,qBAAqB,EAAEA;IAAsB,CAChD,CAAC;EAAA,CACA,CAAC;AAEf,CAAC;AAAC,IAAA2G,QAAA,GAAAC,OAAA,CAAAjI,OAAA,GAEae,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_vectorIcons","_avatar","_typography","_theme","_core","_useAuth","_useI18n","_ProfileMenu","_interopRequireDefault","_jsxRuntime","e","__esModule","default","isWeb","Platform","OS","MENU_WIDTH","VIEWPORT_GUTTER","BG_TRANSITION_MS","AVATAR_TRANSITION_MS","OPACITY_TRANSITION_MS","LEAVE_DELAY_MS","ACTIVE_AVATAR_SCALE","prefersReducedMotion","window","matchMedia","matches","ProfileButton","expanded","avatarSize","onNavigateManage","onAddAccount","onNavigateProfile","onBeforeSessionChange","placement","className","style","user","isAuthenticated","isAuthResolved","isPrivateApiPending","signIn","useAuth","colors","useTheme","t","locale","useI18n","menuOpen","setMenuOpen","useState","anchor","setAnchor","hovered","setHovered","focused","setFocused","triggerRef","useRef","resolvedAvatarSize","openMenu","useCallback","node","current","measure","_x","_y","_w","height","pageX","pageY","maxLeft","Math","max","innerWidth","left","min","triggerBottom","openDown","innerHeight","top","bottom","handleClose","jsx","View","accessibilityElementsHidden","importantForAccessibility","children","styles","skeletonCircle","width","backgroundColor","backgroundSecondary","signInLabel","jsxs","Pressable","row","rowExpanded","onPress","accessibilityRole","accessibilityLabel","avatarBadge","MaterialCommunityIcons","name","size","round","color","icon","Text","text","numberOfLines","displayName","getAccountDisplayName","handle","getAccountFallbackHandle","handleLine","avatarNode","Avatar","source","avatar","undefined","variant","active","accountLabel","webInteractionProps","onHoverIn","onHoverOut","onFocus","onBlur","collapsedBgStyle","transitionProperty","transitionDuration","transitionDelay","ref","collapsedTrigger","open","onClose","reducedMotion","activeAvatarTranslateX","rowStyle","avatarWrapperStyle","zIndex","transform","scale","translateX","identityStyle","marginLeft","opacity","chevronStyle","fullWidth","identity","textSecondary","StyleSheet","create","borderRadius","flexDirection","alignItems","gap","paddingHorizontal","paddingVertical","justifyContent","flex","fontWeight","minWidth","fontSize","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/ProfileButton.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAC,sBAAA,CAAAV,OAAA;AAAoE,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAU,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpE,MAAMG,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;;AAEnC;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAG,GAAG;;AAEtB;AACA,MAAMC,eAAe,GAAG,CAAC;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,oBAAoB,GAAG,GAAG;AAChC,MAAMC,qBAAqB,GAAG,GAAG;AACjC,MAAMC,cAAc,GAAG,EAAE;;AAEzB;AACA,MAAMC,mBA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d;AACJ,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1J,OAAA,GAEYe,aAAa","ignoreList":[]}
|
|
@@ -23,16 +23,20 @@ const isWeb = _reactNative.Platform.OS === 'web';
|
|
|
23
23
|
const MENU_WIDTH = 300;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Web-only anchor. `ProfileButton` measures its trigger and anchors the panel
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Web-only anchor. `ProfileButton` measures its trigger and anchors the panel to
|
|
27
|
+
* one corner so the menu opens either UPWARD (footer trigger) or DOWNWARD (a
|
|
28
|
+
* trigger at the top of a sidebar). Exactly ONE vertical edge is pinned:
|
|
29
|
+
* - `bottom` set → the panel's BOTTOM edge is anchored, so it opens UPWARD.
|
|
30
|
+
* - `top` set → the panel's TOP edge is anchored, so it opens DOWNWARD.
|
|
31
|
+
* Native ignores the anchor and docks the panel to the bottom as a sheet.
|
|
29
32
|
*/
|
|
30
33
|
|
|
31
34
|
/** Everything `ProfileMenuContent` needs, minus the `open` flag (always open). */
|
|
32
35
|
|
|
33
36
|
/**
|
|
34
|
-
* Clean device-account switcher, modeled on the inbox `AccountMenu`
|
|
35
|
-
*
|
|
37
|
+
* Clean device-account switcher, modeled on the inbox `AccountMenu` and styled
|
|
38
|
+
* with react-native `StyleSheet` + the Bloom theme (via `useTheme`) so it
|
|
39
|
+
* renders in EVERY consumer regardless of NativeWind. Lists every account
|
|
36
40
|
* signed in on this device (from {@link useDeviceAccounts}); tapping a row
|
|
37
41
|
* switches, and each inactive row carries a sign-out icon. Below the list:
|
|
38
42
|
* Add account, Manage account, optional View profile, and Sign out of all.
|
|
@@ -150,8 +154,8 @@ const ProfileMenuContent = ({
|
|
|
150
154
|
}, [onClose]);
|
|
151
155
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
152
156
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
style: styles.scroll,
|
|
158
|
+
contentContainerStyle: styles.scrollContent,
|
|
155
159
|
showsVerticalScrollIndicator: false,
|
|
156
160
|
children: [accounts.map(account => {
|
|
157
161
|
const isActive = account.isCurrent;
|
|
@@ -165,7 +169,9 @@ const ProfileMenuContent = ({
|
|
|
165
169
|
},
|
|
166
170
|
onPress: () => handleSwitch(account.sessionId),
|
|
167
171
|
disabled: isActive || isBusy || isSwitching,
|
|
168
|
-
|
|
172
|
+
style: [styles.accountRow, isActive && {
|
|
173
|
+
backgroundColor: colors.backgroundSecondary
|
|
174
|
+
}, isSwitching && !isActive && styles.rowDimmed],
|
|
169
175
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_avatar.Avatar, {
|
|
170
176
|
source: account.user.avatar ?? undefined,
|
|
171
177
|
uri: account.avatarUrl,
|
|
@@ -173,13 +179,17 @@ const ProfileMenuContent = ({
|
|
|
173
179
|
name: account.displayName,
|
|
174
180
|
size: isActive ? 40 : 32
|
|
175
181
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
176
|
-
|
|
182
|
+
style: styles.accountInfo,
|
|
177
183
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
178
|
-
|
|
184
|
+
style: [isActive ? styles.accountNameActive : styles.accountName, {
|
|
185
|
+
color: colors.text
|
|
186
|
+
}],
|
|
179
187
|
numberOfLines: 1,
|
|
180
188
|
children: account.displayName
|
|
181
189
|
}), account.email ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
182
|
-
|
|
190
|
+
style: [styles.accountEmail, {
|
|
191
|
+
color: colors.textSecondary
|
|
192
|
+
}],
|
|
183
193
|
numberOfLines: 1,
|
|
184
194
|
children: account.email
|
|
185
195
|
}) : null]
|
|
@@ -206,7 +216,7 @@ const ProfileMenuContent = ({
|
|
|
206
216
|
left: 8,
|
|
207
217
|
right: 8
|
|
208
218
|
},
|
|
209
|
-
|
|
219
|
+
style: styles.rowSignOutButton,
|
|
210
220
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
|
|
211
221
|
name: "logout",
|
|
212
222
|
size: 18,
|
|
@@ -215,12 +225,14 @@ const ProfileMenuContent = ({
|
|
|
215
225
|
})]
|
|
216
226
|
}, `account-${account.sessionId}`);
|
|
217
227
|
}), isSwitching ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
218
|
-
|
|
228
|
+
style: styles.switchingRow,
|
|
219
229
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
220
230
|
color: colors.textSecondary,
|
|
221
231
|
size: "small"
|
|
222
232
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
223
|
-
|
|
233
|
+
style: [styles.switchingText, {
|
|
234
|
+
color: colors.textSecondary
|
|
235
|
+
}],
|
|
224
236
|
children: t('accountMenu.switching') || 'Switching account…'
|
|
225
237
|
})]
|
|
226
238
|
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_divider.Divider, {
|
|
@@ -229,6 +241,7 @@ const ProfileMenuContent = ({
|
|
|
229
241
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionRow, {
|
|
230
242
|
icon: "account-plus-outline",
|
|
231
243
|
iconColor: colors.icon,
|
|
244
|
+
textColor: colors.text,
|
|
232
245
|
label: t('accountMenu.addAnother') || 'Add another account',
|
|
233
246
|
disabled: actionDisabled,
|
|
234
247
|
onPress: () => {
|
|
@@ -238,6 +251,7 @@ const ProfileMenuContent = ({
|
|
|
238
251
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionRow, {
|
|
239
252
|
icon: "cog-outline",
|
|
240
253
|
iconColor: colors.icon,
|
|
254
|
+
textColor: colors.text,
|
|
241
255
|
label: t('accountMenu.manage') || 'Manage your Oxy Account',
|
|
242
256
|
disabled: actionDisabled,
|
|
243
257
|
onPress: () => {
|
|
@@ -247,6 +261,7 @@ const ProfileMenuContent = ({
|
|
|
247
261
|
}), onNavigateProfile ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionRow, {
|
|
248
262
|
icon: "account-outline",
|
|
249
263
|
iconColor: colors.icon,
|
|
264
|
+
textColor: colors.text,
|
|
250
265
|
label: t('accountMenu.viewProfile') || 'View profile',
|
|
251
266
|
disabled: actionDisabled,
|
|
252
267
|
onPress: () => {
|
|
@@ -261,7 +276,7 @@ const ProfileMenuContent = ({
|
|
|
261
276
|
accessibilityLabel: t('accountMenu.signOutAll') || 'Sign out of all accounts',
|
|
262
277
|
onPress: () => signOutAllDialog.open(),
|
|
263
278
|
disabled: actionDisabled,
|
|
264
|
-
|
|
279
|
+
style: [styles.signOutAllRow, actionDisabled && styles.rowDimmed],
|
|
265
280
|
children: [signingOutAll ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
266
281
|
color: colors.error,
|
|
267
282
|
size: "small"
|
|
@@ -270,10 +285,9 @@ const ProfileMenuContent = ({
|
|
|
270
285
|
size: 18,
|
|
271
286
|
color: colors.error
|
|
272
287
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
273
|
-
|
|
274
|
-
style: {
|
|
288
|
+
style: [styles.actionText, {
|
|
275
289
|
color: colors.error
|
|
276
|
-
},
|
|
290
|
+
}],
|
|
277
291
|
children: t('accountMenu.signOutAll') || 'Sign out of all accounts'
|
|
278
292
|
})]
|
|
279
293
|
})]
|
|
@@ -317,15 +331,24 @@ const ProfileMenu = ({
|
|
|
317
331
|
const {
|
|
318
332
|
t
|
|
319
333
|
} = (0, _useI18n.useI18n)();
|
|
334
|
+
const {
|
|
335
|
+
colors
|
|
336
|
+
} = (0, _theme.useTheme)();
|
|
320
337
|
|
|
321
|
-
// Web: anchor the panel
|
|
322
|
-
//
|
|
323
|
-
//
|
|
338
|
+
// Web: anchor the panel to the measured trigger. When the anchor pins `top`
|
|
339
|
+
// the panel opens DOWNWARD from the trigger; otherwise it pins `bottom` and
|
|
340
|
+
// opens UPWARD (the default footer behavior). With no anchor captured, fall
|
|
341
|
+
// back to a bottom-left placement. Native ignores this (the panel docks to
|
|
342
|
+
// the bottom via the overlay's flex-end).
|
|
324
343
|
const panelAnchorStyle = isWeb ? {
|
|
325
344
|
position: 'absolute',
|
|
326
345
|
width: MENU_WIDTH,
|
|
327
346
|
left: anchor?.left ?? 8,
|
|
328
|
-
|
|
347
|
+
...(typeof anchor?.top === 'number' ? {
|
|
348
|
+
top: anchor.top
|
|
349
|
+
} : {
|
|
350
|
+
bottom: anchor?.bottom ?? 8
|
|
351
|
+
})
|
|
329
352
|
} : undefined;
|
|
330
353
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
331
354
|
visible: open,
|
|
@@ -336,17 +359,17 @@ const ProfileMenu = ({
|
|
|
336
359
|
accessibilityRole: "button",
|
|
337
360
|
accessibilityLabel: t('common.actions.close') || 'Close',
|
|
338
361
|
onPress: onClose,
|
|
339
|
-
|
|
340
|
-
style: !isWeb ? styles.nativeScrim : undefined,
|
|
362
|
+
style: isWeb ? styles.webOverlay : styles.nativeOverlay,
|
|
341
363
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable
|
|
342
364
|
// Swallow taps inside the panel so they never reach the overlay's
|
|
343
365
|
// outside-tap-to-close handler.
|
|
344
366
|
, {
|
|
345
367
|
onPress: () => undefined,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
368
|
+
style: [isWeb ? styles.panelWeb : styles.panelNative, {
|
|
369
|
+
backgroundColor: colors.background
|
|
370
|
+
}, isWeb && {
|
|
371
|
+
borderColor: colors.border
|
|
372
|
+
}, panelAnchorStyle, styles.panelBounds, styles.shadow],
|
|
350
373
|
accessibilityRole: "menu",
|
|
351
374
|
accessibilityLabel: t('accountMenu.label') || 'Account menu',
|
|
352
375
|
children: open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ProfileMenuContent, {
|
|
@@ -366,6 +389,7 @@ const ProfileMenu = ({
|
|
|
366
389
|
const ActionRow = ({
|
|
367
390
|
icon,
|
|
368
391
|
iconColor,
|
|
392
|
+
textColor,
|
|
369
393
|
label,
|
|
370
394
|
disabled,
|
|
371
395
|
onPress
|
|
@@ -374,21 +398,47 @@ const ActionRow = ({
|
|
|
374
398
|
accessibilityLabel: label,
|
|
375
399
|
onPress: onPress,
|
|
376
400
|
disabled: disabled,
|
|
377
|
-
|
|
401
|
+
style: [styles.actionRow, disabled && styles.rowDimmed],
|
|
378
402
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.MaterialCommunityIcons, {
|
|
379
403
|
name: icon,
|
|
380
404
|
size: 20,
|
|
381
405
|
color: iconColor
|
|
382
406
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.Text, {
|
|
383
|
-
|
|
407
|
+
style: [styles.actionText, {
|
|
408
|
+
color: textColor
|
|
409
|
+
}],
|
|
384
410
|
children: label
|
|
385
411
|
})]
|
|
386
412
|
});
|
|
387
|
-
|
|
388
|
-
//
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
413
|
+
const styles = _reactNative.StyleSheet.create({
|
|
414
|
+
// Overlay (`flex-1 relative` web / `flex-1 justify-end` + scrim native).
|
|
415
|
+
webOverlay: {
|
|
416
|
+
flex: 1,
|
|
417
|
+
position: 'relative'
|
|
418
|
+
},
|
|
419
|
+
nativeOverlay: {
|
|
420
|
+
flex: 1,
|
|
421
|
+
justifyContent: 'flex-end',
|
|
422
|
+
backgroundColor: 'rgba(0,0,0,0.32)'
|
|
423
|
+
},
|
|
424
|
+
// Panel shell — web popover (`overflow-hidden rounded-2xl border`).
|
|
425
|
+
panelWeb: {
|
|
426
|
+
overflow: 'hidden',
|
|
427
|
+
borderRadius: 16,
|
|
428
|
+
borderWidth: 1
|
|
429
|
+
},
|
|
430
|
+
// Panel shell — native bottom sheet (`overflow-hidden rounded-t-3xl pb-3`).
|
|
431
|
+
panelNative: {
|
|
432
|
+
overflow: 'hidden',
|
|
433
|
+
borderTopLeftRadius: 24,
|
|
434
|
+
borderTopRightRadius: 24,
|
|
435
|
+
paddingBottom: 12
|
|
436
|
+
},
|
|
437
|
+
// Shared `maxHeight: '85%'` cap applied to both panel variants.
|
|
438
|
+
panelBounds: {
|
|
439
|
+
maxHeight: '85%'
|
|
440
|
+
},
|
|
441
|
+
// The panel's drop shadow — dynamic elevation with no class equivalent.
|
|
392
442
|
shadow: {
|
|
393
443
|
shadowColor: '#000',
|
|
394
444
|
shadowOpacity: 0.18,
|
|
@@ -399,9 +449,83 @@ const styles = {
|
|
|
399
449
|
},
|
|
400
450
|
elevation: 12
|
|
401
451
|
},
|
|
402
|
-
|
|
403
|
-
|
|
452
|
+
// Scroll region (`grow-0` + `py-1` content).
|
|
453
|
+
scroll: {
|
|
454
|
+
flexGrow: 0
|
|
455
|
+
},
|
|
456
|
+
scrollContent: {
|
|
457
|
+
paddingVertical: 4
|
|
458
|
+
},
|
|
459
|
+
// Account row (`flex-row items-center gap-3 px-4 py-2.5`).
|
|
460
|
+
accountRow: {
|
|
461
|
+
flexDirection: 'row',
|
|
462
|
+
alignItems: 'center',
|
|
463
|
+
gap: 12,
|
|
464
|
+
paddingHorizontal: 16,
|
|
465
|
+
paddingVertical: 10
|
|
466
|
+
},
|
|
467
|
+
// `opacity-40` dim applied to disabled / non-active-while-switching rows.
|
|
468
|
+
rowDimmed: {
|
|
469
|
+
opacity: 0.4
|
|
470
|
+
},
|
|
471
|
+
// Identity block (`min-w-0 flex-1`).
|
|
472
|
+
accountInfo: {
|
|
473
|
+
flex: 1,
|
|
474
|
+
minWidth: 0
|
|
475
|
+
},
|
|
476
|
+
// Inactive account name (`font-medium`).
|
|
477
|
+
accountName: {
|
|
478
|
+
fontWeight: '500'
|
|
479
|
+
},
|
|
480
|
+
// Active account name (`font-semibold`).
|
|
481
|
+
accountNameActive: {
|
|
482
|
+
fontWeight: '600'
|
|
483
|
+
},
|
|
484
|
+
// Secondary email line (`text-xs`).
|
|
485
|
+
accountEmail: {
|
|
486
|
+
fontSize: 12
|
|
487
|
+
},
|
|
488
|
+
// Per-row sign-out button (`h-7 w-7 items-center justify-center rounded-full opacity-60`).
|
|
489
|
+
rowSignOutButton: {
|
|
490
|
+
width: 28,
|
|
491
|
+
height: 28,
|
|
492
|
+
alignItems: 'center',
|
|
493
|
+
justifyContent: 'center',
|
|
494
|
+
borderRadius: 9999,
|
|
495
|
+
opacity: 0.6
|
|
496
|
+
},
|
|
497
|
+
// Switching indicator (`flex-row items-center justify-center gap-2 py-2`).
|
|
498
|
+
switchingRow: {
|
|
499
|
+
flexDirection: 'row',
|
|
500
|
+
alignItems: 'center',
|
|
501
|
+
justifyContent: 'center',
|
|
502
|
+
gap: 8,
|
|
503
|
+
paddingVertical: 8
|
|
504
|
+
},
|
|
505
|
+
switchingText: {
|
|
506
|
+
fontSize: 12,
|
|
507
|
+
fontWeight: '500'
|
|
508
|
+
},
|
|
509
|
+
// Bottom action rows (`flex-row items-center gap-3 px-4 py-3`).
|
|
510
|
+
actionRow: {
|
|
511
|
+
flexDirection: 'row',
|
|
512
|
+
alignItems: 'center',
|
|
513
|
+
gap: 12,
|
|
514
|
+
paddingHorizontal: 16,
|
|
515
|
+
paddingVertical: 12
|
|
516
|
+
},
|
|
517
|
+
// Sign-out-of-all row shares the action-row geometry.
|
|
518
|
+
signOutAllRow: {
|
|
519
|
+
flexDirection: 'row',
|
|
520
|
+
alignItems: 'center',
|
|
521
|
+
gap: 12,
|
|
522
|
+
paddingHorizontal: 16,
|
|
523
|
+
paddingVertical: 12
|
|
524
|
+
},
|
|
525
|
+
// Action / sign-out label (`font-medium`).
|
|
526
|
+
actionText: {
|
|
527
|
+
fontWeight: '500'
|
|
404
528
|
}
|
|
405
|
-
};
|
|
529
|
+
});
|
|
406
530
|
var _default = exports.default = ProfileMenu;
|
|
407
531
|
//# sourceMappingURL=ProfileMenu.js.map
|