@tamagui/image 1.9.6 → 1.9.8
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/dist/cjs/Image.js +9 -6
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +9 -6
- package/dist/esm/Image.js.map +2 -2
- package/dist/esm/Image.mjs +9 -6
- package/dist/esm/Image.mjs.map +2 -2
- package/dist/jsx/Image.js +9 -6
- package/dist/jsx/Image.js.map +2 -2
- package/dist/jsx/Image.mjs +9 -6
- package/dist/jsx/Image.mjs.map +2 -2
- package/package.json +3 -3
- package/src/Image.tsx +13 -11
- package/types/Image.d.ts.map +1 -1
package/dist/cjs/Image.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(Image_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(Image_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_core = require("@tamagui/core");
|
|
26
|
+
var import_react = require("react");
|
|
26
27
|
var import_react_native = require("react-native");
|
|
27
28
|
(0, import_core.setupReactNative)({
|
|
28
29
|
Image: import_react_native.Image
|
|
@@ -33,12 +34,14 @@ const StyledImage = (0, import_core.styled)(import_react_native.Image, {
|
|
|
33
34
|
source: { uri: "" },
|
|
34
35
|
zIndex: 1
|
|
35
36
|
});
|
|
36
|
-
const Image = StyledImage.extractable(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
37
|
+
const Image = StyledImage.extractable(
|
|
38
|
+
(0, import_react.forwardRef)((inProps, ref) => {
|
|
39
|
+
const props = (0, import_core.useMediaPropsActive)(inProps);
|
|
40
|
+
const { src, ...rest } = props;
|
|
41
|
+
const source = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width: props.width, height: props.height } } : src;
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, { ref, source, ...rest });
|
|
43
|
+
})
|
|
44
|
+
);
|
|
42
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43
46
|
0 && (module.exports = {
|
|
44
47
|
Image
|
package/dist/cjs/Image.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React, { forwardRef } from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable(\n forwardRef((inProps, ref) => {\n const props = useMediaPropsActive(inProps)\n const { src, ...rest } = props\n const source =\n typeof src === 'string'\n ? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }\n : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return <StyledImage ref={ref} source={source} {...(rest as any)} />\n })\n)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgDW;AAhDX,kBAQO;AACP,mBAAkC;AAClC,0BAAiC;AAAA,IAEjC,8BAAiB;AAAA,EACf,OAAO,oBAAAA;AACT,CAAC;AAED,MAAM,kBAAc,oBAAO,oBAAAA,OAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,CAAC;AAiBM,MAAM,QAA8B,YAAY;AAAA,MACrD,yBAAW,CAAC,SAAS,QAAQ;AAC3B,UAAM,YAAQ,iCAAoB,OAAO;AACzC,UAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AACzB,UAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,qBAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,WAAO,4CAAC,eAAY,KAAU,QAAiB,GAAI,MAAc;AAAA,EACnE,CAAC;AACH;",
|
|
6
6
|
"names": ["RNImage"]
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
styled,
|
|
6
6
|
useMediaPropsActive
|
|
7
7
|
} from "@tamagui/core";
|
|
8
|
+
import { forwardRef } from "react";
|
|
8
9
|
import { Image as RNImage } from "react-native";
|
|
9
10
|
setupReactNative({
|
|
10
11
|
Image: RNImage
|
|
@@ -15,12 +16,14 @@ const StyledImage = styled(RNImage, {
|
|
|
15
16
|
source: { uri: "" },
|
|
16
17
|
zIndex: 1
|
|
17
18
|
});
|
|
18
|
-
const Image = StyledImage.extractable(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
19
|
+
const Image = StyledImage.extractable(
|
|
20
|
+
forwardRef((inProps, ref) => {
|
|
21
|
+
const props = useMediaPropsActive(inProps);
|
|
22
|
+
const { src, ...rest } = props;
|
|
23
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
24
|
+
return /* @__PURE__ */ jsx(StyledImage, { ref, source, ...rest });
|
|
25
|
+
})
|
|
26
|
+
);
|
|
24
27
|
export {
|
|
25
28
|
Image
|
|
26
29
|
};
|
package/dist/esm/Image.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React, { forwardRef } from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable(\n forwardRef((inProps, ref) => {\n const props = useMediaPropsActive(inProps)\n const { src, ...rest } = props\n const source =\n typeof src === 'string'\n ? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }\n : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return <StyledImage ref={ref} source={source} {...(rest as any)} />\n })\n)\n"],
|
|
5
|
+
"mappings": "AAgDW;AAhDX;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,CAAC;AAiBM,MAAM,QAA8B,YAAY;AAAA,EACrD,WAAW,CAAC,SAAS,QAAQ;AAC3B,UAAM,QAAQ,oBAAoB,OAAO;AACzC,UAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AACzB,UAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,WAAO,oBAAC,eAAY,KAAU,QAAiB,GAAI,MAAc;AAAA,EACnE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Image.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
styled,
|
|
6
6
|
useMediaPropsActive
|
|
7
7
|
} from "@tamagui/core";
|
|
8
|
+
import { forwardRef } from "react";
|
|
8
9
|
import { Image as RNImage } from "react-native";
|
|
9
10
|
setupReactNative({
|
|
10
11
|
Image: RNImage
|
|
@@ -15,12 +16,14 @@ const StyledImage = styled(RNImage, {
|
|
|
15
16
|
source: { uri: "" },
|
|
16
17
|
zIndex: 1
|
|
17
18
|
});
|
|
18
|
-
const Image = StyledImage.extractable(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
19
|
+
const Image = StyledImage.extractable(
|
|
20
|
+
forwardRef((inProps, ref) => {
|
|
21
|
+
const props = useMediaPropsActive(inProps);
|
|
22
|
+
const { src, ...rest } = props;
|
|
23
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
24
|
+
return /* @__PURE__ */ jsx(StyledImage, { ref, source, ...rest });
|
|
25
|
+
})
|
|
26
|
+
);
|
|
24
27
|
export {
|
|
25
28
|
Image
|
|
26
29
|
};
|
package/dist/esm/Image.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React, { forwardRef } from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable(\n forwardRef((inProps, ref) => {\n const props = useMediaPropsActive(inProps)\n const { src, ...rest } = props\n const source =\n typeof src === 'string'\n ? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }\n : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return <StyledImage ref={ref} source={source} {...(rest as any)} />\n })\n)\n"],
|
|
5
|
+
"mappings": "AAgDW;AAhDX;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,CAAC;AAiBM,MAAM,QAA8B,YAAY;AAAA,EACrD,WAAW,CAAC,SAAS,QAAQ;AAC3B,UAAM,QAAQ,oBAAoB,OAAO;AACzC,UAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AACzB,UAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,WAAO,oBAAC,eAAY,KAAU,QAAiB,GAAI,MAAc;AAAA,EACnE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
styled,
|
|
5
5
|
useMediaPropsActive
|
|
6
6
|
} from "@tamagui/core";
|
|
7
|
+
import { forwardRef } from "react";
|
|
7
8
|
import { Image as RNImage } from "react-native";
|
|
8
9
|
setupReactNative({
|
|
9
10
|
Image: RNImage
|
|
@@ -14,12 +15,14 @@ const StyledImage = styled(RNImage, {
|
|
|
14
15
|
source: { uri: "" },
|
|
15
16
|
zIndex: 1
|
|
16
17
|
});
|
|
17
|
-
const Image = StyledImage.extractable(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
const Image = StyledImage.extractable(
|
|
19
|
+
forwardRef((inProps, ref) => {
|
|
20
|
+
const props = useMediaPropsActive(inProps);
|
|
21
|
+
const { src, ...rest } = props;
|
|
22
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
23
|
+
return <StyledImage ref={ref} source={source} {...rest} />;
|
|
24
|
+
})
|
|
25
|
+
);
|
|
23
26
|
export {
|
|
24
27
|
Image
|
|
25
28
|
};
|
package/dist/jsx/Image.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n
|
|
5
|
-
"mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React, { forwardRef } from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable(\n forwardRef((inProps, ref) => {\n const props = useMediaPropsActive(inProps)\n const { src, ...rest } = props\n const source =\n typeof src === 'string'\n ? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }\n : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return <StyledImage ref={ref} source={source} {...(rest as any)} />\n })\n)\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,CAAC;AAiBM,MAAM,QAA8B,YAAY;AAAA,EACrD,WAAW,CAAC,SAAS,QAAQ;AAC3B,UAAM,QAAQ,oBAAoB,OAAO;AACzC,UAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AACzB,UAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,WAAO,CAAC,YAAY,KAAK,KAAK,QAAQ,YAAa,MAAc;AAAA,EACnE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
styled,
|
|
5
5
|
useMediaPropsActive
|
|
6
6
|
} from "@tamagui/core";
|
|
7
|
+
import { forwardRef } from "react";
|
|
7
8
|
import { Image as RNImage } from "react-native";
|
|
8
9
|
setupReactNative({
|
|
9
10
|
Image: RNImage
|
|
@@ -14,12 +15,14 @@ const StyledImage = styled(RNImage, {
|
|
|
14
15
|
source: { uri: "" },
|
|
15
16
|
zIndex: 1
|
|
16
17
|
});
|
|
17
|
-
const Image = StyledImage.extractable(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
const Image = StyledImage.extractable(
|
|
19
|
+
forwardRef((inProps, ref) => {
|
|
20
|
+
const props = useMediaPropsActive(inProps);
|
|
21
|
+
const { src, ...rest } = props;
|
|
22
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
23
|
+
return <StyledImage ref={ref} source={source} {...rest} />;
|
|
24
|
+
})
|
|
25
|
+
);
|
|
23
26
|
export {
|
|
24
27
|
Image
|
|
25
28
|
};
|
package/dist/jsx/Image.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n
|
|
5
|
-
"mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n RadiusTokens,\n StackProps,\n isWeb,\n setupReactNative,\n styled,\n useMediaPropsActive,\n} from '@tamagui/core'\nimport React, { forwardRef } from 'react'\nimport { Image as RNImage } from 'react-native'\n\nsetupReactNative({\n Image: RNImage,\n})\n\nconst StyledImage = styled(RNImage, {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n})\n\ntype StyledImageProps = Omit<GetProps<typeof StyledImage>, 'borderRadius'> & {\n borderRadius?: RadiusTokens\n}\n\ntype BaseProps = Omit<\n StyledImageProps,\n 'source' | 'width' | 'height' | 'style' | 'onLayout'\n> & {\n width: number | string\n height: number | string\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable(\n forwardRef((inProps, ref) => {\n const props = useMediaPropsActive(inProps)\n const { src, ...rest } = props\n const source =\n typeof src === 'string'\n ? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }\n : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return <StyledImage ref={ref} source={source} {...(rest as any)} />\n })\n)\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,CAAC;AAiBM,MAAM,QAA8B,YAAY;AAAA,EACrD,WAAW,CAAC,SAAS,QAAQ;AAC3B,UAAM,QAAQ,oBAAoB,OAAO;AACzC,UAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AACzB,UAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,WAAO,CAAC,YAAY,KAAK,KAAK,QAAQ,YAAa,MAAc;AAAA,EACnE,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/image",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.8",
|
|
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.9.
|
|
26
|
+
"@tamagui/core": "1.9.8"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-native": "*"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "1.9.
|
|
33
|
+
"@tamagui/build": "1.9.8",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-native": "^0.71.4"
|
|
36
36
|
},
|
package/src/Image.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
styled,
|
|
8
8
|
useMediaPropsActive,
|
|
9
9
|
} from '@tamagui/core'
|
|
10
|
-
import React from 'react'
|
|
10
|
+
import React, { forwardRef } from 'react'
|
|
11
11
|
import { Image as RNImage } from 'react-native'
|
|
12
12
|
|
|
13
13
|
setupReactNative({
|
|
@@ -36,14 +36,16 @@ type BaseProps = Omit<
|
|
|
36
36
|
|
|
37
37
|
export type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>
|
|
38
38
|
|
|
39
|
-
export const Image: React.FC<ImageProps> = StyledImage.extractable(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export const Image: React.FC<ImageProps> = StyledImage.extractable(
|
|
40
|
+
forwardRef((inProps, ref) => {
|
|
41
|
+
const props = useMediaPropsActive(inProps)
|
|
42
|
+
const { src, ...rest } = props
|
|
43
|
+
const source =
|
|
44
|
+
typeof src === 'string'
|
|
45
|
+
? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }
|
|
46
|
+
: src
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
48
|
+
// must set defaultSource to allow SSR, default it to the same as src
|
|
49
|
+
return <StyledImage ref={ref} source={source} {...(rest as any)} />
|
|
50
|
+
})
|
|
51
|
+
)
|
package/types/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,EAKX,MAAM,eAAe,CAAA;AACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,EAKX,MAAM,eAAe,CAAA;AACtB,OAAO,KAAqB,MAAM,OAAO,CAAA;AAOzC,QAAA,MAAM,WAAW;;;;;;;;EAKf,CAAA;AAEF,KAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,WAAW,CAAC,EAAE,cAAc,CAAC,GAAG;IAC3E,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B,CAAA;AAED,KAAK,SAAS,GAAG,IAAI,CACnB,gBAAgB,EAChB,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CACrD,GAAG;IACF,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,SAAS,CAAC,CAAA;AAEtE,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAYtC,CAAA"}
|