@tamagui/image 1.0.1-beta.149 → 1.0.1-beta.152
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 +18 -10
- package/dist/cjs/Image.js.map +2 -2
- package/dist/esm/Image.js +14 -9
- package/dist/esm/Image.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/jsx/Image.js +12 -8
- package/dist/jsx/Image.js.map +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/Image.js
CHANGED
|
@@ -17,25 +17,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var Image_exports = {};
|
|
23
26
|
__export(Image_exports, {
|
|
24
27
|
Image: () => Image
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(Image_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
31
|
var import_core = require("@tamagui/core");
|
|
28
32
|
var import_react = __toESM(require("react"));
|
|
29
33
|
var import_react_native = require("react-native");
|
|
30
34
|
import_react.default["createElement"];
|
|
31
|
-
const StyledImage = (0, import_core.styled)(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
}
|
|
35
|
+
const StyledImage = (0, import_core.styled)(
|
|
36
|
+
import_react_native.Image,
|
|
37
|
+
{
|
|
38
|
+
name: "Image",
|
|
39
|
+
position: "relative",
|
|
40
|
+
source: { uri: "" },
|
|
41
|
+
zIndex: 1
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
|
|
45
|
+
}
|
|
46
|
+
);
|
|
39
47
|
const Image = StyledImage.extractable((inProps) => {
|
|
40
48
|
const props = (0, import_core.getExpandedShorthands)(inProps);
|
|
41
49
|
const { src, width, height, ...rest } = props;
|
|
@@ -44,7 +52,7 @@ const Image = StyledImage.extractable((inProps) => {
|
|
|
44
52
|
if (!defaultSource) {
|
|
45
53
|
return null;
|
|
46
54
|
}
|
|
47
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, {
|
|
48
56
|
...!import_core.isWeb && { style: { width, height } },
|
|
49
57
|
defaultSource,
|
|
50
58
|
source,
|
package/dist/cjs/Image.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
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": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CI;AA1CJ,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;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,4CAAC;AAAA,IACE,GAAI,CAAC,qBAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE;AAAA,IAC1C;AAAA,IACA;AAAA,IACC,GAAI;AAAA,GACP;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React", "RNImage"]
|
|
7
7
|
}
|
package/dist/esm/Image.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { getExpandedShorthands, isWeb, styled } from "@tamagui/core";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Image as RNImage } from "react-native";
|
|
4
5
|
React["createElement"];
|
|
5
|
-
const StyledImage = styled(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
}
|
|
6
|
+
const StyledImage = styled(
|
|
7
|
+
RNImage,
|
|
8
|
+
{
|
|
9
|
+
name: "Image",
|
|
10
|
+
position: "relative",
|
|
11
|
+
source: { uri: "" },
|
|
12
|
+
zIndex: 1
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
|
|
16
|
+
}
|
|
17
|
+
);
|
|
13
18
|
const Image = StyledImage.extractable((inProps) => {
|
|
14
19
|
const props = getExpandedShorthands(inProps);
|
|
15
20
|
const { src, width, height, ...rest } = props;
|
|
@@ -18,7 +23,7 @@ const Image = StyledImage.extractable((inProps) => {
|
|
|
18
23
|
if (!defaultSource) {
|
|
19
24
|
return null;
|
|
20
25
|
}
|
|
21
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ jsx(StyledImage, {
|
|
22
27
|
...!isWeb && { style: { width, height } },
|
|
23
28
|
defaultSource,
|
|
24
29
|
source,
|
package/dist/esm/Image.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
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": "
|
|
5
|
+
"mappings": "AA0CI;AA1CJ,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;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,oBAAC;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/esm/index.js.map
CHANGED
package/dist/jsx/Image.js
CHANGED
|
@@ -2,14 +2,18 @@ import { getExpandedShorthands, isWeb, styled } from "@tamagui/core";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Image as RNImage } from "react-native";
|
|
4
4
|
React["createElement"];
|
|
5
|
-
const StyledImage = styled(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
const StyledImage = styled(
|
|
6
|
+
RNImage,
|
|
7
|
+
{
|
|
8
|
+
name: "Image",
|
|
9
|
+
position: "relative",
|
|
10
|
+
source: { uri: "" },
|
|
11
|
+
zIndex: 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
inlineProps: /* @__PURE__ */ new Set(["src", "width", "height"])
|
|
15
|
+
}
|
|
16
|
+
);
|
|
13
17
|
const Image = StyledImage.extractable((inProps) => {
|
|
14
18
|
const props = getExpandedShorthands(inProps);
|
|
15
19
|
const { src, width, height, ...rest } = props;
|
package/dist/jsx/Image.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
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;
|
|
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;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/dist/jsx/index.js.map
CHANGED
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.152",
|
|
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.152"
|
|
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.152",
|
|
34
34
|
"react": "*",
|
|
35
35
|
"react-native": "*"
|
|
36
36
|
},
|