@tamagui/image 1.116.1 → 1.116.2
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.
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
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);
|
|
23
|
+
var Image_exports = {};
|
|
24
|
+
__export(Image_exports, {
|
|
25
|
+
Image: () => Image
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(Image_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_react_native = require("react-native-web"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const StyledImage = (0, import_core.styled)(import_react_native.Image, {
|
|
30
|
+
name: "Image"
|
|
31
|
+
});
|
|
32
|
+
let hasWarned = !1;
|
|
33
|
+
const Image = StyledImage.styleable((inProps, ref) => {
|
|
34
|
+
const [props, style] = (0, import_core.usePropsAndStyle)(inProps), { src, source, objectFit, ...rest } = props;
|
|
35
|
+
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(
|
|
36
|
+
'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.'
|
|
37
|
+
)));
|
|
38
|
+
let finalSource = typeof src == "string" ? {
|
|
39
|
+
uri: src,
|
|
40
|
+
...import_constants.isWeb && {
|
|
41
|
+
width: props.width || style?.width,
|
|
42
|
+
height: props.height || style?.height
|
|
43
|
+
}
|
|
44
|
+
} : source ?? src;
|
|
45
|
+
return finalSource && typeof finalSource == "object" && (process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && import_react.default.useEffect(() => {
|
|
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,
|
|
62
|
+
...rest
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
Image.getSize = import_react_native.Image.getSize;
|
|
67
|
+
Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
|
|
68
|
+
Image.prefetch = import_react_native.Image.prefetch;
|
|
69
|
+
Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
|
|
70
|
+
Image.abortPrefetch = import_react_native.Image.abortPrefetch;
|
|
71
|
+
Image.queryCache = import_react_native.Image.queryCache;
|
|
72
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
+
return to;
|
|
10
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
+
var src_exports = {};
|
|
13
|
+
module.exports = __toCommonJS(src_exports);
|
|
14
|
+
__reExport(src_exports, require("./Image"), module.exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/image",
|
|
3
|
-
"version": "1.116.
|
|
3
|
+
"version": "1.116.2",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/constants": "1.116.
|
|
38
|
-
"@tamagui/core": "1.116.
|
|
37
|
+
"@tamagui/constants": "1.116.2",
|
|
38
|
+
"@tamagui/core": "1.116.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "*"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@tamagui/build": "1.116.
|
|
44
|
+
"@tamagui/build": "1.116.2",
|
|
45
45
|
"react": "^18.2.0 || ^19.0.0",
|
|
46
46
|
"react-native": "0.74.1"
|
|
47
47
|
},
|
|
File without changes
|
|
File without changes
|