@artsy/palette-mobile 13.0.6 → 13.0.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v13.0.7 (Tue Sep 12 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - feat(Image): expose gemini resize mode from Image [#148](https://github.com/artsy/palette-mobile/pull/148) ([@araujobarret](https://github.com/araujobarret))
6
+
7
+ #### Authors: 1
8
+
9
+ - Carlos Alberto de Araujo Barreto ([@araujobarret](https://github.com/araujobarret))
10
+
11
+ ---
12
+
1
13
  # v13.0.6 (Mon Sep 11 2023)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FastImageProps } from "react-native-fast-image";
3
+ import { GeminiResizeMode } from "../../utils/createGeminiUrl";
3
4
  type CustomFastImageProps = Omit<FastImageProps, "onLoadStart" | "onLoadEnd" | "source">;
4
5
  export interface ImageProps extends CustomFastImageProps {
5
6
  /** Supplied aspect ratio of image. If none provided, defaults to 1 */
@@ -12,6 +13,8 @@ export interface ImageProps extends CustomFastImageProps {
12
13
  performResize?: boolean;
13
14
  /** Source url to the image */
14
15
  src: string;
16
+ /** Gemini resize_to param */
17
+ geminiResizeMode?: GeminiResizeMode;
15
18
  }
16
19
  export declare const Image: React.FC<ImageProps>;
17
20
  export {};
@@ -15,7 +15,7 @@ const hooks_1 = require("../../utils/hooks");
15
15
  const useScreenDimensions_1 = require("../../utils/hooks/useScreenDimensions");
16
16
  const Flex_1 = require("../Flex");
17
17
  const Skeleton_1 = require("../Skeleton");
18
- const Image = ({ aspectRatio, width, height, performResize = true, src, style, resizeMode, ...flexProps }) => {
18
+ const Image = ({ aspectRatio, width, height, performResize = true, src, style, resizeMode, geminiResizeMode, ...flexProps }) => {
19
19
  const [loading, setLoading] = (0, react_1.useState)(true);
20
20
  const dimensions = useImageDimensions({ aspectRatio, width, height });
21
21
  const color = (0, hooks_1.useColor)();
@@ -25,6 +25,7 @@ const Image = ({ aspectRatio, width, height, performResize = true, src, style, r
25
25
  imageURL: src,
26
26
  width: react_native_1.PixelRatio.getPixelSizeForLayoutSize(dimensions.width),
27
27
  height: react_native_1.PixelRatio.getPixelSizeForLayoutSize(dimensions.height),
28
+ resizeMode: geminiResizeMode,
28
29
  });
29
30
  }
30
31
  return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { position: "relative", ...flexProps, children: [!!loading && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { position: "absolute", zIndex: 1, children: (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.SkeletonBox, { ...dimensions }) }) })), (0, jsx_runtime_1.jsx)(moti_1.MotiView, { animate: { opacity: loading ? 0 : 1 }, transition: { type: "timing", duration: 400, easing: react_native_reanimated_1.Easing.sin }, children: (0, jsx_runtime_1.jsx)(react_native_fast_image_1.default, { style: [dimensions, style, { backgroundColor: color("black30") }], resizeMode: resizeMode, onLoadStart: () => setLoading(true), onLoadEnd: () => setLoading(false), source: {
@@ -1,8 +1,9 @@
1
+ export type GeminiResizeMode = "fit" | "fill";
1
2
  export declare function createGeminiUrl({ imageURL, width, height, geminiHost, imageQuality, resizeMode, }: {
2
3
  imageURL: string;
3
4
  width: number;
4
5
  height: number;
5
6
  geminiHost?: string;
6
7
  imageQuality?: number;
7
- resizeMode?: "fit" | "fill";
8
+ resizeMode?: GeminiResizeMode;
8
9
  }): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artsy/palette-mobile",
3
- "version": "13.0.6",
3
+ "version": "13.0.7",
4
4
  "description": "Artsy's design system for React Native",
5
5
  "scripts": {
6
6
  "android": "react-native run-android",