@tamagui/image 1.0.1-beta.158 → 1.0.1-beta.161
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 +0 -5
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +0 -5
- package/dist/esm/Image.js.map +2 -2
- package/dist/jsx/Image.js +1 -5
- package/dist/jsx/Image.js.map +2 -2
- package/package.json +3 -3
- package/src/Image.tsx +1 -12
package/dist/cjs/Image.js
CHANGED
|
@@ -48,13 +48,8 @@ const Image = StyledImage.extractable((inProps) => {
|
|
|
48
48
|
const props = (0, import_core.getExpandedShorthands)(inProps);
|
|
49
49
|
const { src, width, height, ...rest } = props;
|
|
50
50
|
const source = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width, height } } : src;
|
|
51
|
-
const defaultSource = Array.isArray(source) ? source[0] : source;
|
|
52
|
-
if (!defaultSource) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, {
|
|
56
52
|
...!import_core.isWeb && { style: { width, height } },
|
|
57
|
-
defaultSource,
|
|
58
53
|
source,
|
|
59
54
|
...rest
|
|
60
55
|
});
|
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n
|
|
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage {...(!isWeb && { style: { width, height } })} source={source} {...(rest as any)} />\n )\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCI;AApCJ,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,KAAK,OAAO,WAAW,KAAK,IAAI;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,qBAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AAGzF,SACE,4CAAC;AAAA,IAAa,GAAI,CAAC,qBAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAAI;AAAA,IAAiB,GAAI;AAAA,GAAc;AAElG,CAAC;",
|
|
6
6
|
"names": ["React", "RNImage"]
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -19,13 +19,8 @@ const Image = StyledImage.extractable((inProps) => {
|
|
|
19
19
|
const props = getExpandedShorthands(inProps);
|
|
20
20
|
const { src, width, height, ...rest } = props;
|
|
21
21
|
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
22
|
-
const defaultSource = Array.isArray(source) ? source[0] : source;
|
|
23
|
-
if (!defaultSource) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
22
|
return /* @__PURE__ */ jsx(StyledImage, {
|
|
27
23
|
...!isWeb && { style: { width, height } },
|
|
28
|
-
defaultSource,
|
|
29
24
|
source,
|
|
30
25
|
...rest
|
|
31
26
|
});
|
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n
|
|
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage {...(!isWeb && { style: { width, height } })} source={source} {...(rest as any)} />\n )\n})\n"],
|
|
5
|
+
"mappings": "AAoCI;AApCJ,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,KAAK,OAAO,WAAW,KAAK,IAAI;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AAGzF,SACE,oBAAC;AAAA,IAAa,GAAI,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAAI;AAAA,IAAiB,GAAI;AAAA,GAAc;AAElG,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.js
CHANGED
|
@@ -18,11 +18,7 @@ const Image = StyledImage.extractable((inProps) => {
|
|
|
18
18
|
const props = getExpandedShorthands(inProps);
|
|
19
19
|
const { src, width, height, ...rest } = props;
|
|
20
20
|
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
21
|
-
|
|
22
|
-
if (!defaultSource) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return <StyledImage {...!isWeb && { style: { width, height } }} defaultSource={defaultSource} source={source} {...rest} />;
|
|
21
|
+
return <StyledImage {...!isWeb && { style: { width, height } }} source={source} {...rest} />;
|
|
26
22
|
});
|
|
27
23
|
export {
|
|
28
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\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,KAAK,OAAO,WAAW,KAAK,IAAI;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,OAAO,EAAG,IAAI;
|
|
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, width, height, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage {...(!isWeb && { style: { width, height } })} source={source} {...(rest as any)} />\n )\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,KAAK,OAAO,WAAW,KAAK,IAAI;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AAGzF,SACE,CAAC,gBAAiB,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE,GAAI,QAAQ,YAAa,MAAc;AAElG,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.161",
|
|
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.161"
|
|
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.161",
|
|
34
34
|
"react": "*",
|
|
35
35
|
"react-native": "*"
|
|
36
36
|
},
|
package/src/Image.tsx
CHANGED
|
@@ -31,20 +31,9 @@ export const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) =>
|
|
|
31
31
|
const props = getExpandedShorthands(inProps)
|
|
32
32
|
const { src, width, height, ...rest } = props
|
|
33
33
|
const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src
|
|
34
|
-
const defaultSource = Array.isArray(source) ? source[0] : source
|
|
35
|
-
|
|
36
|
-
if (!defaultSource) {
|
|
37
|
-
// placeholder with customizability
|
|
38
|
-
return null
|
|
39
|
-
}
|
|
40
34
|
|
|
41
35
|
// must set defaultSource to allow SSR, default it to the same as src
|
|
42
36
|
return (
|
|
43
|
-
<StyledImage
|
|
44
|
-
{...(!isWeb && { style: { width, height } })}
|
|
45
|
-
defaultSource={defaultSource}
|
|
46
|
-
source={source}
|
|
47
|
-
{...(rest as any)}
|
|
48
|
-
/>
|
|
37
|
+
<StyledImage {...(!isWeb && { style: { width, height } })} source={source} {...(rest as any)} />
|
|
49
38
|
)
|
|
50
39
|
})
|