@tamagui/image 1.0.1-beta.133 → 1.0.1-beta.136
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 +1 -1
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +1 -1
- package/dist/esm/Image.js.map +2 -2
- package/dist/jsx/Image.js +1 -1
- package/dist/jsx/Image.js.map +2 -2
- package/package.json +3 -3
- package/src/Image.tsx +3 -3
- package/types/Image.d.ts +2 -2
package/dist/cjs/Image.js
CHANGED
|
@@ -38,7 +38,7 @@ const StyledImage = (0, import_core.styled)(import_react_native.Image, {
|
|
|
38
38
|
});
|
|
39
39
|
const Image = StyledImage.extractable((inProps) => {
|
|
40
40
|
const props = (0, import_core.getExpandedShorthands)(inProps);
|
|
41
|
-
const { src, width
|
|
41
|
+
const { src, width, height, ...rest } = props;
|
|
42
42
|
const source = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width, height } } : src;
|
|
43
43
|
const defaultSource = Array.isArray(source) ? source[0] : source;
|
|
44
44
|
if (!defaultSource) {
|
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\n height: number\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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2E;AAC3E,mBAAkB;AAClB,0BAAiC;AAEjC,qBAAM;AAEN,MAAM,cAAc,wBAClB,2BACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,uCAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,
|
|
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 const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage\n {...(!isWeb && { style: { width, height } })}\n defaultSource={defaultSource}\n source={source}\n {...(rest as any)}\n />\n )\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2E;AAC3E,mBAAkB;AAClB,0BAAiC;AAEjC,qBAAM;AAEN,MAAM,cAAc,wBAClB,2BACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,uCAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,OAAO,WAAW,SAAS;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,qBAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,mDAAC;AAAA,IACE,GAAI,CAAC,qBAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAC1C;AAAA,IACA;AAAA,IACC,GAAI;AAAA,GACP;AAEJ,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -12,7 +12,7 @@ const StyledImage = styled(RNImage, {
|
|
|
12
12
|
});
|
|
13
13
|
const Image = StyledImage.extractable((inProps) => {
|
|
14
14
|
const props = getExpandedShorthands(inProps);
|
|
15
|
-
const { src, width
|
|
15
|
+
const { src, width, height, ...rest } = props;
|
|
16
16
|
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
17
17
|
const defaultSource = Array.isArray(source) ? source[0] : source;
|
|
18
18
|
if (!defaultSource) {
|
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\n height: number\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
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AAEA,MAAM;AAEN,MAAM,cAAc,OAClB,SACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,
|
|
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 const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage\n {...(!isWeb && { style: { width, height } })}\n defaultSource={defaultSource}\n source={source}\n {...(rest as any)}\n />\n )\n})\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AAEA,MAAM;AAEN,MAAM,cAAc,OAClB,SACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,OAAO,WAAW,SAAS;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,oCAAC;AAAA,IACE,GAAI,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAC1C;AAAA,IACA;AAAA,IACC,GAAI;AAAA,GACP;AAEJ,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/Image.js
CHANGED
|
@@ -12,7 +12,7 @@ const StyledImage = styled(RNImage, {
|
|
|
12
12
|
});
|
|
13
13
|
const Image = StyledImage.extractable((inProps) => {
|
|
14
14
|
const props = getExpandedShorthands(inProps);
|
|
15
|
-
const { src, width
|
|
15
|
+
const { src, width, height, ...rest } = props;
|
|
16
16
|
const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
|
|
17
17
|
const defaultSource = Array.isArray(source) ? source[0] : source;
|
|
18
18
|
if (!defaultSource) {
|
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\n height: number\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
|
|
5
|
-
"mappings": "AAAA;AACA;AACA;AAEA,MAAM;AAEN,MAAM,cAAc,OAClB,SACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,
|
|
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 const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage\n {...(!isWeb && { style: { width, height } })}\n defaultSource={defaultSource}\n source={source}\n {...(rest as any)}\n />\n )\n})\n"],
|
|
5
|
+
"mappings": "AAAA;AACA;AACA;AAEA,MAAM;AAEN,MAAM,cAAc,OAClB,SACA;AAAA,EACE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AAAA,EAClB,QAAQ;AACV,GACA;AAAA,EACE,aAAa,oBAAI,IAAI,CAAC,OAAO,SAAS,QAAQ,CAAC;AACjD,CACF;AAYO,MAAM,QAA8B,YAAY,YAAY,CAAC,YAAY;AAC9E,QAAM,QAAQ,sBAAsB,OAAO;AAC3C,QAAM,EAAE,KAAK,OAAO,WAAW,SAAS;AACxC,QAAM,SAAS,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,OAAO,EAAG,IAAI;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,CAAC,gBACM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE,GAC1C,eAAe,eACf,QAAQ,YACH,MACP;AAEJ,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.136",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"clean:build": "tamagui-build clean:build"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
24
|
+
"@tamagui/core": "^1.0.1-beta.136"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "*",
|
|
28
28
|
"react-native": "*"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
31
|
+
"@tamagui/build": "^1.0.1-beta.136",
|
|
32
32
|
"react": "*",
|
|
33
33
|
"react-native": "*"
|
|
34
34
|
},
|
package/src/Image.tsx
CHANGED
|
@@ -20,8 +20,8 @@ const StyledImage = styled(
|
|
|
20
20
|
type StyledImageProps = GetProps<typeof StyledImage>
|
|
21
21
|
|
|
22
22
|
type BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {
|
|
23
|
-
width: number
|
|
24
|
-
height: number
|
|
23
|
+
width: number | string
|
|
24
|
+
height: number | string
|
|
25
25
|
src: string | StyledImageProps['source']
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ 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, width
|
|
32
|
+
const { src, width, height, ...rest } = props
|
|
33
33
|
const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src
|
|
34
34
|
const defaultSource = Array.isArray(source) ? source[0] : source
|
|
35
35
|
|
package/types/Image.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ declare const StyledImage: import("@tamagui/core").TamaguiComponent<(import("rea
|
|
|
11
11
|
}>;
|
|
12
12
|
declare type StyledImageProps = GetProps<typeof StyledImage>;
|
|
13
13
|
declare type BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
14
|
+
width: number | string;
|
|
15
|
+
height: number | string;
|
|
16
16
|
src: string | StyledImageProps['source'];
|
|
17
17
|
};
|
|
18
18
|
export declare type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>;
|