@tamagui/image 1.143.0 → 2.0.0-1
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.cjs +38 -62
- package/dist/cjs/Image.js +34 -51
- package/dist/cjs/Image.js.map +2 -2
- package/dist/cjs/Image.native.js +11 -83
- package/dist/cjs/Image.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +1 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/Image.js +32 -44
- package/dist/esm/Image.js.map +1 -1
- package/dist/esm/Image.mjs +34 -47
- package/dist/esm/Image.mjs.map +1 -1
- package/dist/esm/Image.native.js +4 -65
- package/dist/esm/Image.native.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Image.js +32 -44
- package/dist/jsx/Image.js.map +1 -1
- package/dist/jsx/Image.mjs +34 -47
- package/dist/jsx/Image.mjs.map +1 -1
- package/dist/jsx/Image.native.js +11 -83
- package/dist/jsx/Image.native.js.map +1 -1
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +1 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +5 -4
- package/src/Image.native.tsx +6 -0
- package/src/Image.tsx +34 -137
- package/src/createImage.tsx +231 -0
- package/src/index.ts +2 -0
- package/src/types.ts +54 -0
- package/src/v1/Image.tsx +144 -0
- package/src/v1/index.ts +1 -0
- package/types/Image.d.ts +1 -34
- package/types/Image.d.ts.map +1 -1
- package/types/Image.native.d.ts +16 -0
- package/types/createImage.d.ts +77 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +42 -0
- package/types/v1/Image.d.ts +36 -0
- package/types/v1/index.d.ts +2 -0
package/dist/cjs/Image.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
6
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all) __defProp(target, name, {
|
|
9
7
|
get: all[name],
|
|
@@ -17,70 +15,48 @@ var __export = (target, all) => {
|
|
|
17
15
|
});
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
-
value: mod,
|
|
27
|
-
enumerable: !0
|
|
28
|
-
}) : target, mod)),
|
|
29
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
-
value: !0
|
|
31
|
-
}), mod);
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
32
21
|
var Image_exports = {};
|
|
33
22
|
__export(Image_exports, {
|
|
34
23
|
Image: () => Image
|
|
35
24
|
});
|
|
36
25
|
module.exports = __toCommonJS(Image_exports);
|
|
37
|
-
var
|
|
38
|
-
import_constants = require("@tamagui/constants"),
|
|
39
|
-
import_core = require("@tamagui/core"),
|
|
40
|
-
import_react_native = require("react-native-web"),
|
|
26
|
+
var import_web = require("@tamagui/web"),
|
|
41
27
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
const StyledImage = (0,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
28
|
+
const StyledImage = (0, import_web.styled)(import_web.View, {
|
|
29
|
+
name: "Image",
|
|
30
|
+
tag: "img"
|
|
31
|
+
}),
|
|
32
|
+
Image = StyledImage.styleable((inProps, ref) => {
|
|
33
|
+
const {
|
|
34
|
+
// exclude native only props
|
|
35
|
+
blurRadius,
|
|
36
|
+
capInsets,
|
|
37
|
+
defaultSource,
|
|
38
|
+
fadeDuration,
|
|
39
|
+
loadingIndicatorSource,
|
|
40
|
+
onLoadEnd,
|
|
41
|
+
onPartialLoad,
|
|
42
|
+
progressiveRenderingEnabled,
|
|
43
|
+
resizeMethod,
|
|
44
|
+
tintColor,
|
|
45
|
+
...rest
|
|
46
|
+
} = inProps;
|
|
47
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(StyledImage, {
|
|
48
|
+
ref,
|
|
52
49
|
...rest
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
...(import_constants.isWeb && {
|
|
58
|
-
width: props.width || style?.width,
|
|
59
|
-
height: props.height || style?.height
|
|
60
|
-
})
|
|
61
|
-
} : source ?? src;
|
|
62
|
-
return finalSource && typeof finalSource == "object" && (process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && import_react.default.useEffect(() => {
|
|
63
|
-
async function run() {
|
|
64
|
-
if (typeof src == "string") try {
|
|
65
|
-
await fetch(src).then(res => res.text());
|
|
66
|
-
} catch {
|
|
67
|
-
console.error(`Error loading image: ${src}`, {
|
|
68
|
-
props
|
|
69
|
-
});
|
|
70
|
-
}
|
|
50
|
+
});
|
|
51
|
+
}, {
|
|
52
|
+
staticConfig: {
|
|
53
|
+
memo: !0
|
|
71
54
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
Image.getSize = import_react_native.Image.getSize;
|
|
82
|
-
Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
|
|
83
|
-
Image.prefetch = import_react_native.Image.prefetch;
|
|
84
|
-
Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
|
|
85
|
-
Image.abortPrefetch = import_react_native.Image.abortPrefetch;
|
|
86
|
-
Image.queryCache = import_react_native.Image.queryCache;
|
|
55
|
+
}),
|
|
56
|
+
func = () => {};
|
|
57
|
+
Image.getSize = func;
|
|
58
|
+
Image.getSizeWithHeaders = func;
|
|
59
|
+
Image.prefetch = func;
|
|
60
|
+
Image.prefetchWithMetadata = func;
|
|
61
|
+
Image.abortPrefetch = func;
|
|
62
|
+
Image.queryCache = func;
|
package/dist/cjs/Image.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -12,61 +11,45 @@ var __export = (target, all) => {
|
|
|
12
11
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
return to;
|
|
14
13
|
};
|
|
15
|
-
var
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
15
|
var Image_exports = {};
|
|
24
16
|
__export(Image_exports, {
|
|
25
17
|
Image: () => Image
|
|
26
18
|
});
|
|
27
19
|
module.exports = __toCommonJS(Image_exports);
|
|
28
|
-
var
|
|
29
|
-
const StyledImage = (0,
|
|
30
|
-
name: "Image"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
async function run() {
|
|
47
|
-
if (typeof src == "string")
|
|
48
|
-
try {
|
|
49
|
-
await fetch(src).then((res) => res.text());
|
|
50
|
-
} catch {
|
|
51
|
-
console.error(`Error loading image: ${src}`, { props });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
run();
|
|
55
|
-
}, [src]), finalSource.default && (finalSource = finalSource.default)), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
-
import_react_native.Image,
|
|
57
|
-
{
|
|
58
|
-
resizeMode: objectFit,
|
|
59
|
-
ref,
|
|
60
|
-
source: finalSource,
|
|
61
|
-
style,
|
|
20
|
+
var import_web = require("@tamagui/web"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
const StyledImage = (0, import_web.styled)(import_web.View, {
|
|
22
|
+
name: "Image",
|
|
23
|
+
tag: "img"
|
|
24
|
+
}), Image = StyledImage.styleable(
|
|
25
|
+
(inProps, ref) => {
|
|
26
|
+
const {
|
|
27
|
+
// exclude native only props
|
|
28
|
+
blurRadius,
|
|
29
|
+
capInsets,
|
|
30
|
+
defaultSource,
|
|
31
|
+
fadeDuration,
|
|
32
|
+
loadingIndicatorSource,
|
|
33
|
+
onLoadEnd,
|
|
34
|
+
onPartialLoad,
|
|
35
|
+
progressiveRenderingEnabled,
|
|
36
|
+
resizeMethod,
|
|
37
|
+
tintColor,
|
|
62
38
|
...rest
|
|
39
|
+
} = inProps;
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, { ref, ...rest });
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
staticConfig: {
|
|
44
|
+
memo: !0
|
|
63
45
|
}
|
|
64
|
-
|
|
46
|
+
}
|
|
47
|
+
), func = (() => {
|
|
65
48
|
});
|
|
66
|
-
Image.getSize =
|
|
67
|
-
Image.getSizeWithHeaders =
|
|
68
|
-
Image.prefetch =
|
|
69
|
-
Image.prefetchWithMetadata =
|
|
70
|
-
Image.abortPrefetch =
|
|
71
|
-
Image.queryCache =
|
|
49
|
+
Image.getSize = func;
|
|
50
|
+
Image.getSizeWithHeaders = func;
|
|
51
|
+
Image.prefetch = func;
|
|
52
|
+
Image.prefetchWithMetadata = func;
|
|
53
|
+
Image.abortPrefetch = func;
|
|
54
|
+
Image.queryCache = func;
|
|
72
55
|
//# sourceMappingURL=Image.js.map
|
package/dist/cjs/Image.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA6B,yBAwBlB;AArBX,MAAM,kBAAc,mBAAO,iBAAM;AAAA,EAC/B,MAAM;AAAA,EACN,KAAK;AACP,CAAC,GAEY,QAAQ,YAAY;AAAA,EAC/B,CAAC,SAAS,QAAQ;AAChB,UAAM;AAAA;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AACJ,WAAO,4CAAC,eAAY,KAAW,GAAG,MAAM;AAAA,EAC1C;AAAA,EACA;AAAA,IACE,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,EACF;AACF,GAEM,QAAQ,MAAM;AAAC;AAErB,MAAM,UAAU;AAChB,MAAM,qBAAqB;AAC3B,MAAM,WAAW;AACjB,MAAM,uBAAuB;AAC7B,MAAM,gBAAgB;AACtB,MAAM,aAAa;",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
package/dist/cjs/Image.native.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var
|
|
8
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all) __defProp(target, name, {
|
|
11
9
|
get: all[name],
|
|
@@ -19,87 +17,17 @@ var __export = (target, all) => {
|
|
|
19
17
|
});
|
|
20
18
|
return to;
|
|
21
19
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: !0
|
|
30
|
-
}) : target, mod)),
|
|
31
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: !0
|
|
33
|
-
}), mod);
|
|
34
|
-
var Image_exports = {};
|
|
35
|
-
__export(Image_exports, {
|
|
20
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
+
value: !0
|
|
22
|
+
}), mod);
|
|
23
|
+
var Image_native_exports = {};
|
|
24
|
+
__export(Image_native_exports, {
|
|
36
25
|
Image: () => Image
|
|
37
26
|
});
|
|
38
|
-
module.exports = __toCommonJS(
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import_react_native = require("react-native");
|
|
44
|
-
function _type_of(obj) {
|
|
45
|
-
"@swc/helpers - typeof";
|
|
46
|
-
|
|
47
|
-
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
48
|
-
}
|
|
49
|
-
var StyledImage = (0, import_core.styled)(import_react_native.Image, {
|
|
50
|
-
name: "Image"
|
|
51
|
-
}),
|
|
52
|
-
hasWarned = !1,
|
|
53
|
-
Image = StyledImage.styleable(function (inProps, ref) {
|
|
54
|
-
var [props, style] = (0, import_core.usePropsAndStyle)(inProps),
|
|
55
|
-
{
|
|
56
|
-
src,
|
|
57
|
-
source,
|
|
58
|
-
objectFit,
|
|
59
|
-
...rest
|
|
60
|
-
} = props;
|
|
61
|
-
process.env.NODE_ENV === "development" && typeof src == "string" && (typeof props.width == "string" && props.width[0] !== "$" || typeof props.height == "string" && props.height[0] !== "$") && (hasWarned || (hasWarned = !0, console.warn('React Native expects a numerical width/height. If you want to use a percent you must define the "source" prop with width, height, and uri.')));
|
|
62
|
-
var finalSource = typeof src == "string" ? {
|
|
63
|
-
uri: src,
|
|
64
|
-
...(import_constants.isWeb && {
|
|
65
|
-
width: props.width || style?.width,
|
|
66
|
-
height: props.height || style?.height
|
|
67
|
-
})
|
|
68
|
-
} : source ?? src;
|
|
69
|
-
if (finalSource && (typeof finalSource > "u" ? "undefined" : _type_of(finalSource)) === "object") {
|
|
70
|
-
if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && (typeof source > "u" ? "undefined" : _type_of(source)) === "object" && !Array.isArray(source))) {
|
|
71
|
-
var _style, _style1, _width;
|
|
72
|
-
(_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
|
|
73
|
-
var _height;
|
|
74
|
-
(_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
|
|
75
|
-
}
|
|
76
|
-
process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && import_react.default.useEffect(function () {
|
|
77
|
-
async function run() {
|
|
78
|
-
if (typeof src == "string") try {
|
|
79
|
-
await fetch(src).then(function (res) {
|
|
80
|
-
return res.text();
|
|
81
|
-
});
|
|
82
|
-
} catch {
|
|
83
|
-
console.error(`Error loading image: ${src}`, {
|
|
84
|
-
props
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
run();
|
|
89
|
-
}, [src]), finalSource.default && (finalSource = finalSource.default);
|
|
90
|
-
}
|
|
91
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Image, {
|
|
92
|
-
resizeMode: objectFit,
|
|
93
|
-
ref,
|
|
94
|
-
source: finalSource,
|
|
95
|
-
style,
|
|
96
|
-
...rest
|
|
97
|
-
});
|
|
27
|
+
module.exports = __toCommonJS(Image_native_exports);
|
|
28
|
+
var import_react_native = require("react-native"),
|
|
29
|
+
import_createImage = require("./createImage.native.js"),
|
|
30
|
+
Image = (0, import_createImage.createImage)({
|
|
31
|
+
Component: import_react_native.Image
|
|
98
32
|
});
|
|
99
|
-
Image.getSize = import_react_native.Image.getSize;
|
|
100
|
-
Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
|
|
101
|
-
Image.prefetch = import_react_native.Image.prefetch;
|
|
102
|
-
Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
|
|
103
|
-
Image.abortPrefetch = import_react_native.Image.abortPrefetch;
|
|
104
|
-
Image.queryCache = import_react_native.Image.queryCache;
|
|
105
33
|
//# sourceMappingURL=Image.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Image_native_exports","__export","Image","module","exports","__toCommonJS","import_react_native","require","import_createImage","createImage","Component"],"sources":["../../src/Image.native.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,KAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,oBAAA;AAAA,IAAAM,mBAAA,GAAiCC,OAAA;EACjCC,kBAAA,GAA4BD,OAAA;EACjBL,KAAA,OAAQM,kBAAA,CAAAC,WAAA,EAAY;IAC3BC,SAAA,EAAWJ,mBAAA,CAAAJ;EACf,CAAC","ignoreList":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -15,4 +15,5 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
15
15
|
}), mod);
|
|
16
16
|
var index_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(index_exports);
|
|
18
|
-
__reExport(index_exports, require("./Image.cjs"), module.exports);
|
|
18
|
+
__reExport(index_exports, require("./Image.cjs"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./createImage.cjs"), module.exports);
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,4 +12,5 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0
|
|
|
12
12
|
var index_exports = {};
|
|
13
13
|
module.exports = __toCommonJS(index_exports);
|
|
14
14
|
__reExport(index_exports, require("./Image"), module.exports);
|
|
15
|
+
__reExport(index_exports, require("./createImage"), module.exports);
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
package/dist/cjs/index.native.js
CHANGED
|
@@ -18,4 +18,5 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
18
18
|
var index_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(index_exports);
|
|
20
20
|
__reExport(index_exports, require("./Image.native.js"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./createImage.native.js"), module.exports);
|
|
21
22
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,uBAAAH,MADd,CAAAC,OAAA","ignoreList":[]}
|
package/dist/esm/Image.js
CHANGED
|
@@ -1,51 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { styled, usePropsAndStyle } from "@tamagui/core";
|
|
4
|
-
import { Image as RNImage } from "react-native-web";
|
|
1
|
+
import { View, styled } from "@tamagui/web";
|
|
5
2
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
const StyledImage = styled(
|
|
7
|
-
name: "Image"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
async function run() {
|
|
24
|
-
if (typeof src == "string")
|
|
25
|
-
try {
|
|
26
|
-
await fetch(src).then((res) => res.text());
|
|
27
|
-
} catch {
|
|
28
|
-
console.error(`Error loading image: ${src}`, { props });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
run();
|
|
32
|
-
}, [src]), finalSource.default && (finalSource = finalSource.default)), /* @__PURE__ */ jsx(
|
|
33
|
-
RNImage,
|
|
34
|
-
{
|
|
35
|
-
resizeMode: objectFit,
|
|
36
|
-
ref,
|
|
37
|
-
source: finalSource,
|
|
38
|
-
style,
|
|
3
|
+
const StyledImage = styled(View, {
|
|
4
|
+
name: "Image",
|
|
5
|
+
tag: "img"
|
|
6
|
+
}), Image = StyledImage.styleable(
|
|
7
|
+
(inProps, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
// exclude native only props
|
|
10
|
+
blurRadius,
|
|
11
|
+
capInsets,
|
|
12
|
+
defaultSource,
|
|
13
|
+
fadeDuration,
|
|
14
|
+
loadingIndicatorSource,
|
|
15
|
+
onLoadEnd,
|
|
16
|
+
onPartialLoad,
|
|
17
|
+
progressiveRenderingEnabled,
|
|
18
|
+
resizeMethod,
|
|
19
|
+
tintColor,
|
|
39
20
|
...rest
|
|
21
|
+
} = inProps;
|
|
22
|
+
return /* @__PURE__ */ jsx(StyledImage, { ref, ...rest });
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
staticConfig: {
|
|
26
|
+
memo: !0
|
|
40
27
|
}
|
|
41
|
-
|
|
28
|
+
}
|
|
29
|
+
), func = (() => {
|
|
42
30
|
});
|
|
43
|
-
Image.getSize =
|
|
44
|
-
Image.getSizeWithHeaders =
|
|
45
|
-
Image.prefetch =
|
|
46
|
-
Image.prefetchWithMetadata =
|
|
47
|
-
Image.abortPrefetch =
|
|
48
|
-
Image.queryCache =
|
|
31
|
+
Image.getSize = func;
|
|
32
|
+
Image.getSizeWithHeaders = func;
|
|
33
|
+
Image.prefetch = func;
|
|
34
|
+
Image.prefetchWithMetadata = func;
|
|
35
|
+
Image.abortPrefetch = func;
|
|
36
|
+
Image.queryCache = func;
|
|
49
37
|
export {
|
|
50
38
|
Image
|
|
51
39
|
};
|
package/dist/esm/Image.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": "AAAA,SAAS,MAAM,cAAc;AAwBlB;AArBX,MAAM,cAAc,OAAO,MAAM;AAAA,EAC/B,MAAM;AAAA,EACN,KAAK;AACP,CAAC,GAEY,QAAQ,YAAY;AAAA,EAC/B,CAAC,SAAS,QAAQ;AAChB,UAAM;AAAA;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AACJ,WAAO,oBAAC,eAAY,KAAW,GAAG,MAAM;AAAA,EAC1C;AAAA,EACA;AAAA,IACE,cAAc;AAAA,MACZ,MAAM;AAAA,IACR;AAAA,EACF;AACF,GAEM,QAAQ,MAAM;AAAC;AAErB,MAAM,UAAU;AAChB,MAAM,qBAAqB;AAC3B,MAAM,WAAW;AACjB,MAAM,uBAAuB;AAC7B,MAAM,gBAAgB;AACtB,MAAM,aAAa;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/Image.mjs
CHANGED
|
@@ -1,52 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isWeb } from "@tamagui/constants";
|
|
3
|
-
import { styled, usePropsAndStyle } from "@tamagui/core";
|
|
4
|
-
import { Image as RNImage } from "react-native-web";
|
|
1
|
+
import { View, styled } from "@tamagui/web";
|
|
5
2
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
const StyledImage = styled(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
const StyledImage = styled(View, {
|
|
4
|
+
name: "Image",
|
|
5
|
+
tag: "img"
|
|
6
|
+
}),
|
|
7
|
+
Image = StyledImage.styleable((inProps, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
// exclude native only props
|
|
10
|
+
blurRadius,
|
|
11
|
+
capInsets,
|
|
12
|
+
defaultSource,
|
|
13
|
+
fadeDuration,
|
|
14
|
+
loadingIndicatorSource,
|
|
15
|
+
onLoadEnd,
|
|
16
|
+
onPartialLoad,
|
|
17
|
+
progressiveRenderingEnabled,
|
|
18
|
+
resizeMethod,
|
|
19
|
+
tintColor,
|
|
16
20
|
...rest
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} : source ?? src;
|
|
26
|
-
return finalSource && typeof finalSource == "object" && (process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && React.useEffect(() => {
|
|
27
|
-
async function run() {
|
|
28
|
-
if (typeof src == "string") try {
|
|
29
|
-
await fetch(src).then(res => res.text());
|
|
30
|
-
} catch {
|
|
31
|
-
console.error(`Error loading image: ${src}`, {
|
|
32
|
-
props
|
|
33
|
-
});
|
|
34
|
-
}
|
|
21
|
+
} = inProps;
|
|
22
|
+
return /* @__PURE__ */jsx(StyledImage, {
|
|
23
|
+
ref,
|
|
24
|
+
...rest
|
|
25
|
+
});
|
|
26
|
+
}, {
|
|
27
|
+
staticConfig: {
|
|
28
|
+
memo: !0
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
Image.getSize = RNImage.getSize;
|
|
46
|
-
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
47
|
-
Image.prefetch = RNImage.prefetch;
|
|
48
|
-
Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
|
|
49
|
-
Image.abortPrefetch = RNImage.abortPrefetch;
|
|
50
|
-
Image.queryCache = RNImage.queryCache;
|
|
30
|
+
}),
|
|
31
|
+
func = () => {};
|
|
32
|
+
Image.getSize = func;
|
|
33
|
+
Image.getSizeWithHeaders = func;
|
|
34
|
+
Image.prefetch = func;
|
|
35
|
+
Image.prefetchWithMetadata = func;
|
|
36
|
+
Image.abortPrefetch = func;
|
|
37
|
+
Image.queryCache = func;
|
|
51
38
|
export { Image };
|
|
52
39
|
//# sourceMappingURL=Image.mjs.map
|
package/dist/esm/Image.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["View","styled","jsx","StyledImage","name","tag","Image","styleable","inProps","ref","blurRadius","capInsets","defaultSource","fadeDuration","loadingIndicatorSource","onLoadEnd","onPartialLoad","progressiveRenderingEnabled","resizeMethod","tintColor","rest","staticConfig","memo","func","getSize","getSizeWithHeaders","prefetch","prefetchWithMetadata","abortPrefetch","queryCache"],"sources":["../../src/Image.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,IAAA,EAAMC,MAAA,QAAc;AAwBlB,SAAAC,GAAA;AArBX,MAAMC,WAAA,GAAcF,MAAA,CAAOD,IAAA,EAAM;IAC/BI,IAAA,EAAM;IACNC,GAAA,EAAK;EACP,CAAC;EAEYC,KAAA,GAAQH,WAAA,CAAYI,SAAA,CAC/B,CAACC,OAAA,EAASC,GAAA,KAAQ;IAChB,MAAM;MAAA;MAEJC,UAAA;MACAC,SAAA;MACAC,aAAA;MACAC,YAAA;MACAC,sBAAA;MACAC,SAAA;MACAC,aAAA;MACAC,2BAAA;MACAC,YAAA;MACAC,SAAA;MACA,GAAGC;IACL,IAAIZ,OAAA;IACJ,OAAO,eAAAN,GAAA,CAACC,WAAA;MAAYM,GAAA;MAAW,GAAGW;IAAA,CAAM;EAC1C,GACA;IACEC,YAAA,EAAc;MACZC,IAAA,EAAM;IACR;EACF,CACF;EAEMC,IAAA,GAAQA,CAAA,KAAM,CAAC;AAErBjB,KAAA,CAAMkB,OAAA,GAAUD,IAAA;AAChBjB,KAAA,CAAMmB,kBAAA,GAAqBF,IAAA;AAC3BjB,KAAA,CAAMoB,QAAA,GAAWH,IAAA;AACjBjB,KAAA,CAAMqB,oBAAA,GAAuBJ,IAAA;AAC7BjB,KAAA,CAAMsB,aAAA,GAAgBL,IAAA;AACtBjB,KAAA,CAAMuB,UAAA,GAAaN,IAAA","ignoreList":[]}
|