@tamagui/image 1.9.9 → 1.9.10
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 +6 -0
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +6 -0
- package/dist/esm/Image.js.map +2 -2
- package/dist/esm/Image.mjs +6 -0
- package/dist/esm/Image.mjs.map +2 -2
- package/dist/jsx/Image.js +6 -0
- package/dist/jsx/Image.js.map +2 -2
- package/dist/jsx/Image.mjs +6 -0
- package/dist/jsx/Image.mjs.map +2 -2
- package/package.json +3 -3
- package/src/Image.tsx +21 -3
- package/types/Image.d.ts +11 -1
- package/types/Image.d.ts.map +1 -1
package/dist/cjs/Image.js
CHANGED
|
@@ -42,6 +42,12 @@ const Image = StyledImage.extractable(
|
|
|
42
42
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, { ref, source, ...rest });
|
|
43
43
|
})
|
|
44
44
|
);
|
|
45
|
+
Image.getSize = import_react_native.Image.getSize;
|
|
46
|
+
Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
|
|
47
|
+
Image.prefetch = import_react_native.Image.prefetch;
|
|
48
|
+
Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
|
|
49
|
+
Image.abortPrefetch = import_react_native.Image.abortPrefetch;
|
|
50
|
+
Image.queryCache = import_react_native.Image.queryCache;
|
|
45
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
52
|
0 && (module.exports = {
|
|
47
53
|
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, { 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\
|
|
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\ntype RNImageType = typeof RNImage\n\ntype ImageType = React.FC<ImageProps> & {\n getSize: RNImageType['getSize']\n getSizeWithHeaders: RNImageType['getSizeWithHeaders']\n prefetch: RNImageType['prefetch']\n prefetchWithMetadata: RNImageType['prefetchWithMetadata']\n abortPrefetch: RNImageType['abortPrefetch']\n queryCache: RNImageType['queryCache']\n}\n\nexport const Image = StyledImage.extractable(\n forwardRef((inProps: ImageProps, 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) as any as ImageType\n\nImage.getSize = RNImage.getSize\nImage.getSizeWithHeaders = RNImage.getSizeWithHeaders\nImage.prefetch = RNImage.prefetch\nImage.prefetchWithMetadata = RNImage.prefetchWithMetadata\nImage.abortPrefetch = RNImage.abortPrefetch\nImage.queryCache = RNImage.queryCache\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2DW;AA3DX,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;AA4BM,MAAM,QAAQ,YAAY;AAAA,MAC/B,yBAAW,CAAC,SAAqB,QAAQ;AACvC,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;AAEA,MAAM,UAAU,oBAAAA,MAAQ;AACxB,MAAM,qBAAqB,oBAAAA,MAAQ;AACnC,MAAM,WAAW,oBAAAA,MAAQ;AACzB,MAAM,uBAAuB,oBAAAA,MAAQ;AACrC,MAAM,gBAAgB,oBAAAA,MAAQ;AAC9B,MAAM,aAAa,oBAAAA,MAAQ;",
|
|
6
6
|
"names": ["RNImage"]
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -24,6 +24,12 @@ const Image = StyledImage.extractable(
|
|
|
24
24
|
return /* @__PURE__ */ jsx(StyledImage, { ref, source, ...rest });
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
|
+
Image.getSize = RNImage.getSize;
|
|
28
|
+
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
29
|
+
Image.prefetch = RNImage.prefetch;
|
|
30
|
+
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
|
|
31
|
+
Image.abortPrefetch = RNImage.abortPrefetch;
|
|
32
|
+
Image.queryCache = RNImage.queryCache;
|
|
27
33
|
export {
|
|
28
34
|
Image
|
|
29
35
|
};
|
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, { 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\
|
|
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\ntype RNImageType = typeof RNImage\n\ntype ImageType = React.FC<ImageProps> & {\n getSize: RNImageType['getSize']\n getSizeWithHeaders: RNImageType['getSizeWithHeaders']\n prefetch: RNImageType['prefetch']\n prefetchWithMetadata: RNImageType['prefetchWithMetadata']\n abortPrefetch: RNImageType['abortPrefetch']\n queryCache: RNImageType['queryCache']\n}\n\nexport const Image = StyledImage.extractable(\n forwardRef((inProps: ImageProps, 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) as any as ImageType\n\nImage.getSize = RNImage.getSize\nImage.getSizeWithHeaders = RNImage.getSizeWithHeaders\nImage.prefetch = RNImage.prefetch\nImage.prefetchWithMetadata = RNImage.prefetchWithMetadata\nImage.abortPrefetch = RNImage.abortPrefetch\nImage.queryCache = RNImage.queryCache\n"],
|
|
5
|
+
"mappings": "AA2DW;AA3DX;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;AA4BM,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,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;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Image.mjs
CHANGED
|
@@ -24,6 +24,12 @@ const Image = StyledImage.extractable(
|
|
|
24
24
|
return /* @__PURE__ */ jsx(StyledImage, { ref, source, ...rest });
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
|
+
Image.getSize = RNImage.getSize;
|
|
28
|
+
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
29
|
+
Image.prefetch = RNImage.prefetch;
|
|
30
|
+
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
|
|
31
|
+
Image.abortPrefetch = RNImage.abortPrefetch;
|
|
32
|
+
Image.queryCache = RNImage.queryCache;
|
|
27
33
|
export {
|
|
28
34
|
Image
|
|
29
35
|
};
|
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, { 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\
|
|
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\ntype RNImageType = typeof RNImage\n\ntype ImageType = React.FC<ImageProps> & {\n getSize: RNImageType['getSize']\n getSizeWithHeaders: RNImageType['getSizeWithHeaders']\n prefetch: RNImageType['prefetch']\n prefetchWithMetadata: RNImageType['prefetchWithMetadata']\n abortPrefetch: RNImageType['abortPrefetch']\n queryCache: RNImageType['queryCache']\n}\n\nexport const Image = StyledImage.extractable(\n forwardRef((inProps: ImageProps, 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) as any as ImageType\n\nImage.getSize = RNImage.getSize\nImage.getSizeWithHeaders = RNImage.getSizeWithHeaders\nImage.prefetch = RNImage.prefetch\nImage.prefetchWithMetadata = RNImage.prefetchWithMetadata\nImage.abortPrefetch = RNImage.abortPrefetch\nImage.queryCache = RNImage.queryCache\n"],
|
|
5
|
+
"mappings": "AA2DW;AA3DX;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;AA4BM,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,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;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.js
CHANGED
|
@@ -23,6 +23,12 @@ const Image = StyledImage.extractable(
|
|
|
23
23
|
return <StyledImage ref={ref} source={source} {...rest} />;
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
+
Image.getSize = RNImage.getSize;
|
|
27
|
+
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
28
|
+
Image.prefetch = RNImage.prefetch;
|
|
29
|
+
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
|
|
30
|
+
Image.abortPrefetch = RNImage.abortPrefetch;
|
|
31
|
+
Image.queryCache = RNImage.queryCache;
|
|
26
32
|
export {
|
|
27
33
|
Image
|
|
28
34
|
};
|
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, { 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\
|
|
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;
|
|
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\ntype RNImageType = typeof RNImage\n\ntype ImageType = React.FC<ImageProps> & {\n getSize: RNImageType['getSize']\n getSizeWithHeaders: RNImageType['getSizeWithHeaders']\n prefetch: RNImageType['prefetch']\n prefetchWithMetadata: RNImageType['prefetchWithMetadata']\n abortPrefetch: RNImageType['abortPrefetch']\n queryCache: RNImageType['queryCache']\n}\n\nexport const Image = StyledImage.extractable(\n forwardRef((inProps: ImageProps, 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) as any as ImageType\n\nImage.getSize = RNImage.getSize\nImage.getSizeWithHeaders = RNImage.getSizeWithHeaders\nImage.prefetch = RNImage.prefetch\nImage.prefetchWithMetadata = RNImage.prefetchWithMetadata\nImage.abortPrefetch = RNImage.abortPrefetch\nImage.queryCache = RNImage.queryCache\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;AA4BM,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,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;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.mjs
CHANGED
|
@@ -23,6 +23,12 @@ const Image = StyledImage.extractable(
|
|
|
23
23
|
return <StyledImage ref={ref} source={source} {...rest} />;
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
+
Image.getSize = RNImage.getSize;
|
|
27
|
+
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
28
|
+
Image.prefetch = RNImage.prefetch;
|
|
29
|
+
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
|
|
30
|
+
Image.abortPrefetch = RNImage.abortPrefetch;
|
|
31
|
+
Image.queryCache = RNImage.queryCache;
|
|
26
32
|
export {
|
|
27
33
|
Image
|
|
28
34
|
};
|
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, { 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\
|
|
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;
|
|
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\ntype RNImageType = typeof RNImage\n\ntype ImageType = React.FC<ImageProps> & {\n getSize: RNImageType['getSize']\n getSizeWithHeaders: RNImageType['getSizeWithHeaders']\n prefetch: RNImageType['prefetch']\n prefetchWithMetadata: RNImageType['prefetchWithMetadata']\n abortPrefetch: RNImageType['abortPrefetch']\n queryCache: RNImageType['queryCache']\n}\n\nexport const Image = StyledImage.extractable(\n forwardRef((inProps: ImageProps, 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) as any as ImageType\n\nImage.getSize = RNImage.getSize\nImage.getSizeWithHeaders = RNImage.getSizeWithHeaders\nImage.prefetch = RNImage.prefetch\nImage.prefetchWithMetadata = RNImage.prefetchWithMetadata\nImage.abortPrefetch = RNImage.abortPrefetch\nImage.queryCache = RNImage.queryCache\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;AA4BM,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,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;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
|
|
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.10",
|
|
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.10"
|
|
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.10",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-native": "^0.71.4"
|
|
36
36
|
},
|
package/src/Image.tsx
CHANGED
|
@@ -36,8 +36,19 @@ type BaseProps = Omit<
|
|
|
36
36
|
|
|
37
37
|
export type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
type RNImageType = typeof RNImage
|
|
40
|
+
|
|
41
|
+
type ImageType = React.FC<ImageProps> & {
|
|
42
|
+
getSize: RNImageType['getSize']
|
|
43
|
+
getSizeWithHeaders: RNImageType['getSizeWithHeaders']
|
|
44
|
+
prefetch: RNImageType['prefetch']
|
|
45
|
+
prefetchWithMetadata: RNImageType['prefetchWithMetadata']
|
|
46
|
+
abortPrefetch: RNImageType['abortPrefetch']
|
|
47
|
+
queryCache: RNImageType['queryCache']
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Image = StyledImage.extractable(
|
|
51
|
+
forwardRef((inProps: ImageProps, ref) => {
|
|
41
52
|
const props = useMediaPropsActive(inProps)
|
|
42
53
|
const { src, ...rest } = props
|
|
43
54
|
const source =
|
|
@@ -48,4 +59,11 @@ export const Image: React.FC<ImageProps> = StyledImage.extractable(
|
|
|
48
59
|
// must set defaultSource to allow SSR, default it to the same as src
|
|
49
60
|
return <StyledImage ref={ref} source={source} {...(rest as any)} />
|
|
50
61
|
})
|
|
51
|
-
)
|
|
62
|
+
) as any as ImageType
|
|
63
|
+
|
|
64
|
+
Image.getSize = RNImage.getSize
|
|
65
|
+
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders
|
|
66
|
+
Image.prefetch = RNImage.prefetch
|
|
67
|
+
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata
|
|
68
|
+
Image.abortPrefetch = RNImage.abortPrefetch
|
|
69
|
+
Image.queryCache = RNImage.queryCache
|
package/types/Image.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GetProps, RadiusTokens, StackProps } from '@tamagui/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Image as RNImage } from 'react-native';
|
|
3
4
|
declare const StyledImage: import("@tamagui/core").TamaguiComponent<(import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps>) | (import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps> & Omit<{}, string | number> & {
|
|
4
5
|
[x: string]: undefined;
|
|
5
6
|
} & import("@tamagui/core").MediaProps<Partial<import("react-native").ImageProps & Omit<StackProps, keyof import("react-native").ImageProps> & Omit<{}, string | number> & {
|
|
@@ -18,6 +19,15 @@ type BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style'
|
|
|
18
19
|
src: string | StyledImageProps['source'];
|
|
19
20
|
};
|
|
20
21
|
export type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>;
|
|
21
|
-
|
|
22
|
+
type RNImageType = typeof RNImage;
|
|
23
|
+
type ImageType = React.FC<ImageProps> & {
|
|
24
|
+
getSize: RNImageType['getSize'];
|
|
25
|
+
getSizeWithHeaders: RNImageType['getSizeWithHeaders'];
|
|
26
|
+
prefetch: RNImageType['prefetch'];
|
|
27
|
+
prefetchWithMetadata: RNImageType['prefetchWithMetadata'];
|
|
28
|
+
abortPrefetch: RNImageType['abortPrefetch'];
|
|
29
|
+
queryCache: RNImageType['queryCache'];
|
|
30
|
+
};
|
|
31
|
+
export declare const Image: ImageType;
|
|
22
32
|
export {};
|
|
23
33
|
//# sourceMappingURL=Image.d.ts.map
|
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,KAAqB,MAAM,OAAO,CAAA;
|
|
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;AACzC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AAM/C,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,KAAK,WAAW,GAAG,OAAO,OAAO,CAAA;AAEjC,KAAK,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC/B,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAA;IACrD,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACjC,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAAA;IACzD,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC3C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,KAAK,WAYG,CAAA"}
|