@oxyhq/bloom 0.58.1 → 0.60.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/context-menu/index.web.js +2 -1
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/overlay/index.js +2 -2
- package/lib/commonjs/popover/index.web.js +2 -1
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/select/index.web.js +2 -1
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +13 -3
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/module/context-menu/index.web.js +2 -1
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/overlay/index.js +2 -2
- package/lib/module/popover/index.web.js +3 -2
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/select/index.web.js +2 -1
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +13 -3
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/index.d.ts +2 -2
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-image-gallery/types.d.ts +6 -2
- package/lib/typescript/commonjs/zoomable-image-gallery/types.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/overlay/index.d.ts +2 -2
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-image-gallery/types.d.ts +6 -2
- package/lib/typescript/module/zoomable-image-gallery/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/pointer-events-style-form.test.ts +24 -0
- package/src/context-menu/index.web.tsx +2 -1
- package/src/overlay/index.tsx +2 -2
- package/src/popover/index.web.tsx +2 -1
- package/src/select/index.web.tsx +2 -1
- package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +17 -3
- package/src/zoomable-image-gallery/types.ts +6 -2
package/src/select/index.web.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Pressable, StyleSheet, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { Text } from '../typography';
|
|
6
|
+
import { Backdrop } from '../overlay';
|
|
6
7
|
import { Portal } from '../portal/index.web';
|
|
7
8
|
import { createOverlayZIndex } from '../styles/z-index';
|
|
8
9
|
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
@@ -188,7 +189,7 @@ export function SelectContent<T>({
|
|
|
188
189
|
|
|
189
190
|
return (
|
|
190
191
|
<Portal>
|
|
191
|
-
<
|
|
192
|
+
<Backdrop
|
|
192
193
|
style={styles.backdrop}
|
|
193
194
|
onPress={ctx.close}
|
|
194
195
|
accessibilityLabel="Close selection"
|
|
@@ -95,6 +95,15 @@ interface FittedSize {
|
|
|
95
95
|
height: number;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Resolve `cornerRadius` against the size an image is actually rendered at, so
|
|
100
|
+
* `'circle'` stays a circle at every fitted size (and through the open/close
|
|
101
|
+
* animation, which scales this same box).
|
|
102
|
+
*/
|
|
103
|
+
function resolveCornerRadius(cornerRadius: number | 'circle', fit: FittedSize): number {
|
|
104
|
+
return cornerRadius === 'circle' ? Math.min(fit.width, fit.height) / 2 : cornerRadius;
|
|
105
|
+
}
|
|
106
|
+
|
|
98
107
|
/**
|
|
99
108
|
* Fullscreen, swipeable image viewer that replicates the profile avatar's
|
|
100
109
|
* measured-origin zoom transition (`ZoomableAvatar`) for rectangular post media:
|
|
@@ -116,6 +125,11 @@ const ZoomableImageGalleryInner = React.forwardRef<ZoomableImageGalleryHandle, Z
|
|
|
116
125
|
const theme = useTheme();
|
|
117
126
|
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = useWindowDimensions();
|
|
118
127
|
|
|
128
|
+
const radiusFor = useCallback(
|
|
129
|
+
(fit: FittedSize) => resolveCornerRadius(cornerRadius, fit),
|
|
130
|
+
[cornerRadius],
|
|
131
|
+
);
|
|
132
|
+
|
|
119
133
|
const [isOpen, setIsOpen] = useState(false);
|
|
120
134
|
// Once true, the swipeable pager is mounted and the single open-image hidden.
|
|
121
135
|
const [pagerReady, setPagerReady] = useState(false);
|
|
@@ -787,7 +801,7 @@ const ZoomableImageGalleryInner = React.forwardRef<ZoomableImageGalleryHandle, Z
|
|
|
787
801
|
source={{ uri: images[activeIndex]?.uri }}
|
|
788
802
|
contentFit="contain"
|
|
789
803
|
style={[
|
|
790
|
-
{ width: activeFit.width, height: activeFit.height, borderRadius:
|
|
804
|
+
{ width: activeFit.width, height: activeFit.height, borderRadius: radiusFor(activeFit) },
|
|
791
805
|
openImageStyle,
|
|
792
806
|
]}
|
|
793
807
|
transition={0}
|
|
@@ -839,7 +853,7 @@ const ZoomableImageGalleryInner = React.forwardRef<ZoomableImageGalleryHandle, Z
|
|
|
839
853
|
source={{ uri: img.uri }}
|
|
840
854
|
contentFit="contain"
|
|
841
855
|
style={[
|
|
842
|
-
{ width: fit.width, height: fit.height, borderRadius:
|
|
856
|
+
{ width: fit.width, height: fit.height, borderRadius: radiusFor(fit) },
|
|
843
857
|
zoomImageStyle,
|
|
844
858
|
]}
|
|
845
859
|
transition={0}
|
|
@@ -859,7 +873,7 @@ const ZoomableImageGalleryInner = React.forwardRef<ZoomableImageGalleryHandle, Z
|
|
|
859
873
|
<Image
|
|
860
874
|
source={{ uri: img.uri }}
|
|
861
875
|
contentFit="contain"
|
|
862
|
-
style={{ width: fit.width, height: fit.height, borderRadius:
|
|
876
|
+
style={{ width: fit.width, height: fit.height, borderRadius: radiusFor(fit) }}
|
|
863
877
|
transition={0}
|
|
864
878
|
{...(Platform.OS === 'web' ? { draggable: false } : {})}
|
|
865
879
|
/>
|
|
@@ -44,8 +44,12 @@ export interface ZoomableImageGalleryHandle {
|
|
|
44
44
|
export interface ZoomableImageGalleryProps {
|
|
45
45
|
/** Measures any thumbnail by its images-only subset index, used on dismiss. */
|
|
46
46
|
measureThumb?: MeasureThumb;
|
|
47
|
-
/**
|
|
48
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Corner radius applied to the zoomed images. `'circle'` rounds each image to
|
|
49
|
+
* a full circle at whatever size it is fitted to — what an avatar needs, and
|
|
50
|
+
* the reason avatars don't need their own viewer.
|
|
51
|
+
*/
|
|
52
|
+
cornerRadius?: number | 'circle';
|
|
49
53
|
/**
|
|
50
54
|
* Bottom page indicator for multi-image galleries. `'dots'` (default) renders the
|
|
51
55
|
* compact dot row; `'thumbnails'` renders a horizontal strip of tappable image
|