@tamagui/image 1.74.3 → 1.74.5

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.
@@ -0,0 +1,34 @@
1
+ import {
2
+ isWeb,
3
+ styled,
4
+ usePropsAndStyle
5
+ } from "@tamagui/core";
6
+ import { forwardRef } from "react";
7
+ import { Image as RNImage } from "react-native";
8
+ import { jsx } from "react/jsx-runtime";
9
+ const StyledImage = styled(RNImage, {
10
+ name: "Image",
11
+ position: "relative",
12
+ source: { uri: "" }
13
+ });
14
+ let hasWarned = !1;
15
+ const Image = StyledImage.extractable(
16
+ forwardRef((inProps, ref) => {
17
+ const [props, style] = usePropsAndStyle(inProps), { src, source, ...rest } = props;
18
+ process.env.NODE_ENV === "development" && typeof src == "string" && (typeof props.width == "string" && props.width[0] !== "$" || typeof props.height == "string" && props.height[0] !== "$") && (hasWarned || (hasWarned = !0, console.warn(
19
+ 'React Native expects a numerical width/height. If you want to use a percent you must define the "source" prop with width, height, and uri.'
20
+ )));
21
+ let finalSource = typeof src == "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
22
+ return finalSource && typeof finalSource == "object" && (Array.isArray(finalSource) || typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source) && (style.width ??= source.width, style.height ??= source.height)), finalSource.default && (finalSource = finalSource.default)), /* @__PURE__ */ jsx(StyledImage, { ref, source: finalSource, style, ...rest });
23
+ })
24
+ );
25
+ Image.getSize = RNImage.getSize;
26
+ Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
27
+ Image.prefetch = RNImage.prefetch;
28
+ Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
29
+ Image.abortPrefetch = RNImage.abortPrefetch;
30
+ Image.queryCache = RNImage.queryCache;
31
+ export {
32
+ Image
33
+ };
34
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/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Q;",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Image";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": "AAAA,cAAc;",
5
+ "names": []
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/image",
3
- "version": "1.74.3",
3
+ "version": "1.74.5",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -23,14 +23,14 @@
23
23
  "clean:build": "tamagui-build clean:build"
24
24
  },
25
25
  "dependencies": {
26
- "@tamagui/core": "1.74.3"
26
+ "@tamagui/core": "1.74.5"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "*",
30
30
  "react-native": "*"
31
31
  },
32
32
  "devDependencies": {
33
- "@tamagui/build": "1.74.3",
33
+ "@tamagui/build": "1.74.5",
34
34
  "react": "^18.2.0",
35
35
  "react-native": "^0.72.1"
36
36
  },