@tamagui/image 1.0.1-beta.165 → 1.0.1-beta.166
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 +2 -3
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +2 -3
- package/dist/esm/Image.js.map +2 -2
- package/dist/jsx/Image.js +3 -3
- package/dist/jsx/Image.js.map +2 -2
- package/package.json +3 -3
- package/src/Image.tsx +6 -5
package/dist/cjs/Image.js
CHANGED
|
@@ -46,10 +46,9 @@ const StyledImage = (0, import_core.styled)(
|
|
|
46
46
|
);
|
|
47
47
|
const Image = StyledImage.extractable((inProps) => {
|
|
48
48
|
const props = (0, import_core.getExpandedShorthands)(inProps);
|
|
49
|
-
const { src,
|
|
50
|
-
const source = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width, height } } : src;
|
|
49
|
+
const { src, ...rest } = props;
|
|
50
|
+
const source = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width: props.width, height: props.height } } : src;
|
|
51
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, {
|
|
52
|
-
...!import_core.isWeb && { style: { width, height } },
|
|
53
52
|
source,
|
|
54
53
|
...rest
|
|
55
54
|
});
|
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 { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(inProps)\n const { src,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(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 source={source} {...(rest as any)} />\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCS;AAtCT,kBAA2E;AAC3E,mBAAkB;AAClB,0BAAiC;AAEjC,aAAAA,QAAM;AAEN,MAAM,kBAAc;AAAA,EAClB,oBAAAC;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ,EAAE,KAAK,GAAG;AAAA,IAClB,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AAAA,EACjD;AACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,YAAQ,mCAAsB,OAAO;AAC3C,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,QAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,qBAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,SAAO,4CAAC;AAAA,IAAY;AAAA,IAAiB,GAAI;AAAA,GAAc;AACzD,CAAC;",
|
|
6
6
|
"names": ["React", "RNImage"]
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -17,10 +17,9 @@ const StyledImage = styled(
|
|
|
17
17
|
);
|
|
18
18
|
const Image = StyledImage.extractable((inProps) => {
|
|
19
19
|
const props = getExpandedShorthands(inProps);
|
|
20
|
-
const { src,
|
|
21
|
-
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
20
|
+
const { src, ...rest } = props;
|
|
21
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
22
22
|
return /* @__PURE__ */ jsx(StyledImage, {
|
|
23
|
-
...!isWeb && { style: { width, height } },
|
|
24
23
|
source,
|
|
25
24
|
...rest
|
|
26
25
|
});
|
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 { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(inProps)\n const { src,
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(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 source={source} {...(rest as any)} />\n})\n"],
|
|
5
|
+
"mappings": "AAsCS;AAtCT,SAA+B,uBAAuB,OAAO,cAAc;AAC3E,OAAO,WAAW;AAClB,SAAS,SAAS,eAAe;AAEjC,MAAM;AAEN,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ,EAAE,KAAK,GAAG;AAAA,IAClB,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AAAA,EACjD;AACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,QAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,SAAO,oBAAC;AAAA,IAAY;AAAA,IAAiB,GAAI;AAAA,GAAc;AACzD,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.js
CHANGED
|
@@ -16,9 +16,9 @@ const StyledImage = styled(
|
|
|
16
16
|
);
|
|
17
17
|
const Image = StyledImage.extractable((inProps) => {
|
|
18
18
|
const props = getExpandedShorthands(inProps);
|
|
19
|
-
const { src,
|
|
20
|
-
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
21
|
-
return <StyledImage
|
|
19
|
+
const { src, ...rest } = props;
|
|
20
|
+
const source = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : src;
|
|
21
|
+
return <StyledImage source={source} {...rest} />;
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
24
24
|
Image
|
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 { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(inProps)\n const { src,
|
|
5
|
-
"mappings": "AAAA,SAA+B,uBAAuB,OAAO,cAAc;AAC3E,OAAO,WAAW;AAClB,SAAS,SAAS,eAAe;AAEjC,MAAM;AAEN,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ,EAAE,KAAK,GAAG;AAAA,IAClB,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AAAA,EACjD;AACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\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 const props = getExpandedShorthands(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 source={source} {...(rest as any)} />\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAA+B,uBAAuB,OAAO,cAAc;AAC3E,OAAO,WAAW;AAClB,SAAS,SAAS,eAAe;AAEjC,MAAM;AAEN,MAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ,EAAE,KAAK,GAAG;AAAA,IAClB,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,IACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AAAA,EACjD;AACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,QAAQ,KAAK,IAAI;AACzB,QAAM,SACJ,OAAO,QAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE;AAGN,SAAO,CAAC,YAAY,QAAQ,YAAa,MAAc;AACzD,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/image",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.166",
|
|
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.0.1-beta.
|
|
26
|
+
"@tamagui/core": "^1.0.1-beta.166"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-native": "*"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
33
|
+
"@tamagui/build": "^1.0.1-beta.166",
|
|
34
34
|
"react": "*",
|
|
35
35
|
"react-native": "*"
|
|
36
36
|
},
|
package/src/Image.tsx
CHANGED
|
@@ -29,11 +29,12 @@ export type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>
|
|
|
29
29
|
|
|
30
30
|
export const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {
|
|
31
31
|
const props = getExpandedShorthands(inProps)
|
|
32
|
-
const { src,
|
|
33
|
-
const source =
|
|
32
|
+
const { src, ...rest } = props
|
|
33
|
+
const source =
|
|
34
|
+
typeof src === 'string'
|
|
35
|
+
? { uri: src, ...(isWeb && { width: props.width, height: props.height }) }
|
|
36
|
+
: src
|
|
34
37
|
|
|
35
38
|
// must set defaultSource to allow SSR, default it to the same as src
|
|
36
|
-
return (
|
|
37
|
-
<StyledImage {...(!isWeb && { style: { width, height } })} source={source} {...(rest as any)} />
|
|
38
|
-
)
|
|
39
|
+
return <StyledImage source={source} {...(rest as any)} />
|
|
39
40
|
})
|