@oxyhq/bloom 0.62.0 → 0.64.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/bottom-sheet/BottomSheetBase.js +13 -13
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +9 -17
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +4 -11
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +0 -2
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/placement.js +1 -4
- package/lib/commonjs/dialog/placement.js.map +1 -1
- package/lib/commonjs/overlay/index.js +20 -5
- package/lib/commonjs/overlay/index.js.map +1 -1
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +0 -1
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +14 -14
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/dialog/Dialog.js +11 -19
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +5 -12
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +1 -3
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/placement.js +0 -3
- package/lib/module/dialog/placement.js.map +1 -1
- package/lib/module/overlay/index.js +20 -5
- package/lib/module/overlay/index.js.map +1 -1
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +0 -1
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/placement.d.ts +0 -2
- package/lib/typescript/commonjs/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/index.d.ts +9 -2
- package/lib/typescript/commonjs/overlay/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/placement.d.ts +0 -2
- package/lib/typescript/module/dialog/placement.d.ts.map +1 -1
- package/lib/typescript/module/overlay/index.d.ts +9 -2
- package/lib/typescript/module/overlay/index.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/animated-style-deps.test.ts +1 -1
- package/src/__tests__/overlay-pointer-events.test.tsx +32 -5
- package/src/bottom-sheet/BottomSheetBase.tsx +13 -13
- package/src/dialog/Dialog.tsx +9 -18
- package/src/dialog/Dialog.web.tsx +2 -9
- package/src/dialog/DialogBottomSheet.tsx +0 -2
- package/src/dialog/placement.ts +0 -2
- package/src/overlay/index.tsx +20 -6
- package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +0 -1
|
@@ -47,7 +47,6 @@ import {
|
|
|
47
47
|
DIALOG_SHEET_BACKDROP_TESTID,
|
|
48
48
|
EASE_OUT,
|
|
49
49
|
PANEL_RADIUS,
|
|
50
|
-
SHEET_BACKDROP_OPACITY,
|
|
51
50
|
SIDE_SHEET_MIN_GUTTER,
|
|
52
51
|
useResolvedPlacement,
|
|
53
52
|
} from './placement';
|
|
@@ -60,11 +59,6 @@ import type {
|
|
|
60
59
|
|
|
61
60
|
const FADE_OUT_DURATION = CENTER_FADE_OUT_DURATION;
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
* The centered card's scrim reads darker than a sheet's because the card floats
|
|
65
|
-
* in the middle of it; the shared blur underneath is identical.
|
|
66
|
-
*/
|
|
67
|
-
const DIALOG_BACKDROP_DIM_OPACITY = 0.6;
|
|
68
62
|
|
|
69
63
|
/**
|
|
70
64
|
* The four CSS `animation` shorthands driving the centered card and its backdrop.
|
|
@@ -331,7 +325,6 @@ function CenterOrSideDialog({
|
|
|
331
325
|
onPress={() => close()}
|
|
332
326
|
disabled={!dismissOnBackdrop}
|
|
333
327
|
accessibilityLabel={label ? `Dismiss ${label}` : 'Dismiss dialog'}
|
|
334
|
-
dimOpacity={DIALOG_BACKDROP_DIM_OPACITY}
|
|
335
328
|
// The fade rides on the LAYERS, never on the press target: an
|
|
336
329
|
// opacity animation on the blur's ancestor composites the group in
|
|
337
330
|
// isolation and leaves `backdrop-filter` nothing to sample.
|
|
@@ -705,7 +698,7 @@ function SheetSurface({
|
|
|
705
698
|
disabled={!dismissOnBackdrop}
|
|
706
699
|
// Same reason as the centred dialog: the transition and the opacity it
|
|
707
700
|
// animates belong to the layers, not to the press target above them.
|
|
708
|
-
dimOpacity
|
|
701
|
+
// No `dimOpacity` override — one darkness for every Bloom surface.
|
|
709
702
|
layerStyle={backdropTransition}
|
|
710
703
|
style={[sheetStyles.backdrop, { opacity: visible ? 1 : 0 }]}
|
|
711
704
|
/>
|
|
@@ -858,12 +851,12 @@ const sheetStyles: Record<'root' | 'backdrop' | 'panel', ViewStyle> = {
|
|
|
858
851
|
bottom: 0,
|
|
859
852
|
},
|
|
860
853
|
backdrop: {
|
|
854
|
+
// Geometry only: the colour and the dim level belong to `Backdrop`.
|
|
861
855
|
position: 'absolute',
|
|
862
856
|
top: 0,
|
|
863
857
|
left: 0,
|
|
864
858
|
right: 0,
|
|
865
859
|
bottom: 0,
|
|
866
|
-
backgroundColor: '#000',
|
|
867
860
|
},
|
|
868
861
|
panel: {
|
|
869
862
|
position: 'absolute',
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
DEFAULT_DIALOG_CONTENT_PADDING,
|
|
31
31
|
DEFAULT_MAX_HEIGHT_RATIO,
|
|
32
32
|
PANEL_RADIUS,
|
|
33
|
-
SHEET_BACKDROP_OPACITY,
|
|
34
33
|
} from './placement';
|
|
35
34
|
import type { DialogControlProps, DialogProps } from './types';
|
|
36
35
|
|
|
@@ -286,7 +285,6 @@ export function DialogBottomSheet({
|
|
|
286
285
|
}
|
|
287
286
|
// Stronger dim than a lone sheet so an underlying sheet's handle/content
|
|
288
287
|
// doesn't bleed through when a Dialog is stacked over one.
|
|
289
|
-
backdropOpacity={SHEET_BACKDROP_OPACITY + 0.3}
|
|
290
288
|
// Measures the sheet card — the size a morph starts from.
|
|
291
289
|
onLayout={morphState.onPanelLayout}
|
|
292
290
|
style={sheetStyle}
|
package/src/dialog/placement.ts
CHANGED
|
@@ -83,8 +83,6 @@ export const CENTER_FADE_OUT_DURATION = 150;
|
|
|
83
83
|
/** CSS approximation of reanimated's `Easing.out(Easing.cubic)`. */
|
|
84
84
|
export const EASE_OUT = 'cubic-bezier(0.33, 1, 0.68, 1)';
|
|
85
85
|
|
|
86
|
-
/** Backdrop dim opacity once fully shown (matches `bg-black/40`). */
|
|
87
|
-
export const SHEET_BACKDROP_OPACITY = 0.4;
|
|
88
86
|
|
|
89
87
|
/** Stable testID for the dimmed backdrop of a side/bottom placement dialog. */
|
|
90
88
|
export const DIALOG_SHEET_BACKDROP_TESTID = 'bloom-dialog-sheet-backdrop';
|
package/src/overlay/index.tsx
CHANGED
|
@@ -60,8 +60,15 @@ const AnimatedBlurView = Animated.createAnimatedComponent(BlurView);
|
|
|
60
60
|
* not in how the app behind them recedes.
|
|
61
61
|
*/
|
|
62
62
|
export const BACKDROP_BLUR_INTENSITY = 80;
|
|
63
|
-
/**
|
|
64
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Extra dim laid OVER the blur. The blur already paints its own tint wash
|
|
65
|
+
* (`rgba(25,25,25,~0.62)` at the intensity above), so this is what takes the
|
|
66
|
+
* total to roughly 0.72 — dark enough to read a panel against, still clearly
|
|
67
|
+
* see-through. Every surface uses this one value: with each of them picking its
|
|
68
|
+
* own, menus landed at ~0.83 and read as solid black next to the image viewer's
|
|
69
|
+
* ~0.72.
|
|
70
|
+
*/
|
|
71
|
+
export const BACKDROP_DIM_OPACITY = 0.28;
|
|
65
72
|
|
|
66
73
|
export interface OverlayRootProps {
|
|
67
74
|
children?: ReactNode;
|
|
@@ -144,11 +151,18 @@ export const Backdrop = memo(function Backdrop({
|
|
|
144
151
|
}: BackdropProps) {
|
|
145
152
|
const inert = disabled || !onPress;
|
|
146
153
|
|
|
147
|
-
//
|
|
148
|
-
//
|
|
154
|
+
// The press target must stay a pure hit box. Two things a caller's `style`
|
|
155
|
+
// can carry would break the visuals if honoured there:
|
|
156
|
+
// - `opacity`, because `backdrop-filter` samples nothing under an ancestor
|
|
157
|
+
// that composites in isolation, so the fade would erase the blur;
|
|
158
|
+
// - `backgroundColor`, which would paint an opaque sheet UNDER the blur —
|
|
159
|
+
// a second backdrop, and the reason menus and sheets rendered solid black
|
|
160
|
+
// while the image viewer (which passed no background) looked right.
|
|
161
|
+
// Both are hoisted onto the layers, where they mean what the caller intended.
|
|
149
162
|
const flat: ViewStyle = StyleSheet.flatten(style) ?? {};
|
|
150
|
-
const { opacity: styleOpacity, ...rootStyle } = flat;
|
|
163
|
+
const { opacity: styleOpacity, backgroundColor: styleBackground, ...rootStyle } = flat;
|
|
151
164
|
const staticOpacity = typeof styleOpacity === 'number' ? styleOpacity : 1;
|
|
165
|
+
const resolvedDimColor = typeof styleBackground === 'string' ? styleBackground : dimColor;
|
|
152
166
|
|
|
153
167
|
// The fade lives on each LAYER, never on their shared ancestor.
|
|
154
168
|
const blurFade = useAnimatedStyle(
|
|
@@ -187,7 +201,7 @@ export const Backdrop = memo(function Backdrop({
|
|
|
187
201
|
) : null}
|
|
188
202
|
<Animated.View
|
|
189
203
|
pointerEvents="none"
|
|
190
|
-
style={[StyleSheet.absoluteFill, { backgroundColor:
|
|
204
|
+
style={[StyleSheet.absoluteFill, { backgroundColor: resolvedDimColor }, layerStyle, dimFade]}
|
|
191
205
|
/>
|
|
192
206
|
{children}
|
|
193
207
|
</Pressable>
|