@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.
Files changed (40) hide show
  1. package/lib/commonjs/context-menu/index.web.js +2 -1
  2. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  3. package/lib/commonjs/overlay/index.js +2 -2
  4. package/lib/commonjs/popover/index.web.js +2 -1
  5. package/lib/commonjs/popover/index.web.js.map +1 -1
  6. package/lib/commonjs/select/index.web.js +2 -1
  7. package/lib/commonjs/select/index.web.js.map +1 -1
  8. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +13 -3
  9. package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  10. package/lib/module/context-menu/index.web.js +2 -1
  11. package/lib/module/context-menu/index.web.js.map +1 -1
  12. package/lib/module/overlay/index.js +2 -2
  13. package/lib/module/popover/index.web.js +3 -2
  14. package/lib/module/popover/index.web.js.map +1 -1
  15. package/lib/module/select/index.web.js +2 -1
  16. package/lib/module/select/index.web.js.map +1 -1
  17. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +13 -3
  18. package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
  19. package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
  20. package/lib/typescript/commonjs/overlay/index.d.ts +2 -2
  21. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  22. package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
  23. package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  24. package/lib/typescript/commonjs/zoomable-image-gallery/types.d.ts +6 -2
  25. package/lib/typescript/commonjs/zoomable-image-gallery/types.d.ts.map +1 -1
  26. package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
  27. package/lib/typescript/module/overlay/index.d.ts +2 -2
  28. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  29. package/lib/typescript/module/select/index.web.d.ts.map +1 -1
  30. package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
  31. package/lib/typescript/module/zoomable-image-gallery/types.d.ts +6 -2
  32. package/lib/typescript/module/zoomable-image-gallery/types.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/__tests__/pointer-events-style-form.test.ts +24 -0
  35. package/src/context-menu/index.web.tsx +2 -1
  36. package/src/overlay/index.tsx +2 -2
  37. package/src/popover/index.web.tsx +2 -1
  38. package/src/select/index.web.tsx +2 -1
  39. package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +17 -3
  40. package/src/zoomable-image-gallery/types.ts +6 -2
@@ -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
- <Pressable
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: cornerRadius },
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: cornerRadius },
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: cornerRadius }}
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
- /** Corner radius applied to the zoomed images. Defaults to `DEFAULT_CORNER_RADIUS`. */
48
- cornerRadius?: number;
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