@tamagui/image 1.89.26 → 1.89.27-1708113113238
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.native.js +124 -16
- package/dist/cjs/Image.native.js.map +3 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/esm/Image.native.js +114 -15
- package/dist/esm/Image.native.js.map +3 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/jsx/Image.native.js +114 -15
- package/dist/jsx/Image.native.js.map +3 -3
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +5 -5
package/dist/cjs/Image.native.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
@@ -12,27 +13,134 @@ var __export = (target, all) => {
|
|
|
12
13
|
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
14
|
return to;
|
|
14
15
|
};
|
|
15
|
-
var
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
24
|
var Image_exports = {};
|
|
17
25
|
__export(Image_exports, {
|
|
18
26
|
Image: () => Image
|
|
19
27
|
});
|
|
20
28
|
module.exports = __toCommonJS(Image_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_react = require("react"), import_react_native = require("react-native")
|
|
22
|
-
|
|
29
|
+
var import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_react = __toESM(require("react")), import_react_native = require("react-native");
|
|
30
|
+
function _array_like_to_array(arr, len) {
|
|
31
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
32
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
33
|
+
arr2[i] = arr[i];
|
|
34
|
+
return arr2;
|
|
35
|
+
}
|
|
36
|
+
function _array_with_holes(arr) {
|
|
37
|
+
if (Array.isArray(arr))
|
|
38
|
+
return arr;
|
|
39
|
+
}
|
|
40
|
+
function _define_property(obj, key, value) {
|
|
41
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
42
|
+
value,
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
configurable: !0,
|
|
45
|
+
writable: !0
|
|
46
|
+
}) : obj[key] = value, obj;
|
|
47
|
+
}
|
|
48
|
+
function _iterable_to_array_limit(arr, i) {
|
|
49
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
50
|
+
if (_i != null) {
|
|
51
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
52
|
+
try {
|
|
53
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
54
|
+
;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_d = !0, _e = err;
|
|
57
|
+
} finally {
|
|
58
|
+
try {
|
|
59
|
+
!_n && _i.return != null && _i.return();
|
|
60
|
+
} finally {
|
|
61
|
+
if (_d)
|
|
62
|
+
throw _e;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return _arr;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function _non_iterable_rest() {
|
|
69
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
70
|
+
}
|
|
71
|
+
function _object_spread(target) {
|
|
72
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
73
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source);
|
|
74
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
75
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
76
|
+
}))), ownKeys.forEach(function(key) {
|
|
77
|
+
_define_property(target, key, source[key]);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return target;
|
|
81
|
+
}
|
|
82
|
+
function _object_without_properties(source, excluded) {
|
|
83
|
+
if (source == null)
|
|
84
|
+
return {};
|
|
85
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
86
|
+
if (Object.getOwnPropertySymbols) {
|
|
87
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
88
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
89
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
90
|
+
}
|
|
91
|
+
return target;
|
|
92
|
+
}
|
|
93
|
+
function _object_without_properties_loose(source, excluded) {
|
|
94
|
+
if (source == null)
|
|
95
|
+
return {};
|
|
96
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
97
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
98
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
99
|
+
return target;
|
|
100
|
+
}
|
|
101
|
+
function _sliced_to_array(arr, i) {
|
|
102
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
103
|
+
}
|
|
104
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
105
|
+
if (o) {
|
|
106
|
+
if (typeof o == "string")
|
|
107
|
+
return _array_like_to_array(o, minLen);
|
|
108
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
109
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
110
|
+
return Array.from(n);
|
|
111
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
112
|
+
return _array_like_to_array(o, minLen);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
var StyledImage = (0, import_core.styled)(import_react_native.Image, {
|
|
23
116
|
name: "Image"
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
117
|
+
}), hasWarned = !1, Image = StyledImage.extractable(/* @__PURE__ */ (0, import_react.forwardRef)(function(inProps, ref) {
|
|
118
|
+
var _usePropsAndStyle = _sliced_to_array((0, import_core.usePropsAndStyle)(inProps), 2), props = _usePropsAndStyle[0], style = _usePropsAndStyle[1], src = props.src, source = props.source, rest = _object_without_properties(props, [
|
|
119
|
+
"src",
|
|
120
|
+
"source"
|
|
121
|
+
]);
|
|
122
|
+
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.')));
|
|
123
|
+
var finalSource = typeof src == "string" ? _object_spread({
|
|
124
|
+
uri: src
|
|
125
|
+
}, import_constants.isWeb && {
|
|
126
|
+
width: props.width,
|
|
127
|
+
height: props.height
|
|
128
|
+
}) : source ?? src;
|
|
129
|
+
if (finalSource && typeof finalSource == "object") {
|
|
130
|
+
if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source))) {
|
|
131
|
+
var _style, _style1, _width;
|
|
132
|
+
(_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
|
|
133
|
+
var _height;
|
|
134
|
+
(_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
|
|
135
|
+
}
|
|
136
|
+
finalSource.default && (finalSource = finalSource.default);
|
|
137
|
+
}
|
|
138
|
+
return /* @__PURE__ */ import_react.default.createElement(StyledImage, _object_spread({
|
|
139
|
+
ref,
|
|
140
|
+
source: finalSource,
|
|
141
|
+
style
|
|
142
|
+
}, rest));
|
|
143
|
+
}));
|
|
36
144
|
Image.getSize = import_react_native.Image.getSize;
|
|
37
145
|
Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
|
|
38
146
|
Image.prefetch = import_react_native.Image.prefetch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["RNImage"]
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/image/src/Image.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAsB,+BAQtB,cAAyC,0BACzC,eAAkC,2BAClC,sBAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,eAAAA;IAAYS;IAAUK,QAAQS;IAAaX;KAAmBG,IAAAA,CAAAA;AACxE,CAAA,CAAA;AAGFV,MAAMwB,UAAU3B,oBAAAA,MAAQ2B;AACxBxB,MAAMyB,qBAAqB5B,oBAAAA,MAAQ4B;AACnCzB,MAAM0B,WAAW7B,oBAAAA,MAAQ6B;AACzB1B,MAAM2B,uBAAuB9B,oBAAAA,MAAQ8B;AACrC3B,MAAM4B,gBAAgB/B,oBAAAA,MAAQ+B;AAC9B5B,MAAM6B,aAAahC,oBAAAA,MAAQgC;",
|
|
5
|
+
"names": ["StyledImage", "styled", "RNImage", "name", "hasWarned", "Image", "extractable", "forwardRef", "inProps", "ref", "usePropsAndStyle", "props", "style", "src", "source", "rest", "process", "env", "NODE_ENV", "width", "height", "console", "warn", "finalSource", "uri", "isWeb", "Array", "isArray", "React", "getSize", "getSizeWithHeaders", "prefetch", "prefetchWithMetadata", "abortPrefetch", "queryCache"]
|
|
6
6
|
}
|
package/dist/esm/Image.native.js
CHANGED
|
@@ -1,22 +1,121 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { styled, usePropsAndStyle } from "@tamagui/core";
|
|
3
|
-
import { forwardRef } from "react";
|
|
3
|
+
import React, { forwardRef } from "react";
|
|
4
4
|
import { Image as RNImage } from "react-native";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function _array_like_to_array(arr, len) {
|
|
6
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
7
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
8
|
+
arr2[i] = arr[i];
|
|
9
|
+
return arr2;
|
|
10
|
+
}
|
|
11
|
+
function _array_with_holes(arr) {
|
|
12
|
+
if (Array.isArray(arr))
|
|
13
|
+
return arr;
|
|
14
|
+
}
|
|
15
|
+
function _define_property(obj, key, value) {
|
|
16
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
17
|
+
value,
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
configurable: !0,
|
|
20
|
+
writable: !0
|
|
21
|
+
}) : obj[key] = value, obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array_limit(arr, i) {
|
|
24
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
|
+
if (_i != null) {
|
|
26
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
27
|
+
try {
|
|
28
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
29
|
+
;
|
|
30
|
+
} catch (err) {
|
|
31
|
+
_d = !0, _e = err;
|
|
32
|
+
} finally {
|
|
33
|
+
try {
|
|
34
|
+
!_n && _i.return != null && _i.return();
|
|
35
|
+
} finally {
|
|
36
|
+
if (_d)
|
|
37
|
+
throw _e;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return _arr;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function _non_iterable_rest() {
|
|
44
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
45
|
+
}
|
|
46
|
+
function _object_spread(target) {
|
|
47
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
48
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source);
|
|
49
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
50
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
51
|
+
}))), ownKeys.forEach(function(key) {
|
|
52
|
+
_define_property(target, key, source[key]);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return target;
|
|
56
|
+
}
|
|
57
|
+
function _object_without_properties(source, excluded) {
|
|
58
|
+
if (source == null)
|
|
59
|
+
return {};
|
|
60
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
61
|
+
if (Object.getOwnPropertySymbols) {
|
|
62
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
63
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
64
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null)
|
|
70
|
+
return {};
|
|
71
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
72
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
73
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
74
|
+
return target;
|
|
75
|
+
}
|
|
76
|
+
function _sliced_to_array(arr, i) {
|
|
77
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
78
|
+
}
|
|
79
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
80
|
+
if (o) {
|
|
81
|
+
if (typeof o == "string")
|
|
82
|
+
return _array_like_to_array(o, minLen);
|
|
83
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
84
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
85
|
+
return Array.from(n);
|
|
86
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
87
|
+
return _array_like_to_array(o, minLen);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var StyledImage = styled(RNImage, {
|
|
7
91
|
name: "Image"
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
92
|
+
}), hasWarned = !1, Image = StyledImage.extractable(/* @__PURE__ */ forwardRef(function(inProps, ref) {
|
|
93
|
+
var _usePropsAndStyle = _sliced_to_array(usePropsAndStyle(inProps), 2), props = _usePropsAndStyle[0], style = _usePropsAndStyle[1], src = props.src, source = props.source, rest = _object_without_properties(props, [
|
|
94
|
+
"src",
|
|
95
|
+
"source"
|
|
96
|
+
]);
|
|
97
|
+
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.')));
|
|
98
|
+
var finalSource = typeof src == "string" ? _object_spread({
|
|
99
|
+
uri: src
|
|
100
|
+
}, isWeb && {
|
|
101
|
+
width: props.width,
|
|
102
|
+
height: props.height
|
|
103
|
+
}) : source ?? src;
|
|
104
|
+
if (finalSource && typeof finalSource == "object") {
|
|
105
|
+
if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source))) {
|
|
106
|
+
var _style, _style1, _width;
|
|
107
|
+
(_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
|
|
108
|
+
var _height;
|
|
109
|
+
(_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
|
|
110
|
+
}
|
|
111
|
+
finalSource.default && (finalSource = finalSource.default);
|
|
112
|
+
}
|
|
113
|
+
return /* @__PURE__ */ React.createElement(StyledImage, _object_spread({
|
|
114
|
+
ref,
|
|
115
|
+
source: finalSource,
|
|
116
|
+
style
|
|
117
|
+
}, rest));
|
|
118
|
+
}));
|
|
20
119
|
Image.getSize = RNImage.getSize;
|
|
21
120
|
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
22
121
|
Image.prefetch = RNImage.prefetch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|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OAAOA,UAAW,YAAY,CAACW,MAAMC,QAAQZ,MAAAA,IAAS;UAElEF,QAEAA;AAFAA,OAAAA,UAAAA,SAAAA,OAAMO,WAAAA,QAAAA,WAAAA,WAANP,OAAMO,QAAUL,OAAOK;;AAEvBP,OAAAA,WAAAA,UAAAA,OAAMQ,YAAAA,QAAAA,YAAAA,WAANR,QAAMQ,SAAWN,OAAOM;IAC1B;AAMN,IAAIG,YAAY,YACdA,cAAcA,YAAY;EAE9B;AAGA,SAAO,sBAAA,cAAClB,aAAAA,eAAAA;IAAYK;IAAUI,QAAQS;IAAaX;KAAmBG,IAAAA,CAAAA;AACxE,CAAA,CAAA;AAGFZ,MAAMwB,UAAUvB,QAAQuB;AACxBxB,MAAMyB,qBAAqBxB,QAAQwB;AACnCzB,MAAM0B,WAAWzB,QAAQyB;AACzB1B,MAAM2B,uBAAuB1B,QAAQ0B;AACrC3B,MAAM4B,gBAAgB3B,QAAQ2B;AAC9B5B,MAAM6B,aAAa5B,QAAQ4B;",
|
|
5
|
+
"names": ["isWeb", "styled", "usePropsAndStyle", "React", "forwardRef", "Image", "RNImage", "StyledImage", "name", "hasWarned", "extractable", "inProps", "ref", "props", "style", "src", "source", "rest", "process", "env", "NODE_ENV", "width", "height", "console", "warn", "finalSource", "uri", "Array", "isArray", "getSize", "getSizeWithHeaders", "prefetch", "prefetchWithMetadata", "abortPrefetch", "queryCache"]
|
|
6
6
|
}
|
package/dist/jsx/Image.native.js
CHANGED
|
@@ -1,22 +1,121 @@
|
|
|
1
1
|
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { styled, usePropsAndStyle } from "@tamagui/core";
|
|
3
|
-
import { forwardRef } from "react";
|
|
3
|
+
import React, { forwardRef } from "react";
|
|
4
4
|
import { Image as RNImage } from "react-native";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function _array_like_to_array(arr, len) {
|
|
6
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
7
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
8
|
+
arr2[i] = arr[i];
|
|
9
|
+
return arr2;
|
|
10
|
+
}
|
|
11
|
+
function _array_with_holes(arr) {
|
|
12
|
+
if (Array.isArray(arr))
|
|
13
|
+
return arr;
|
|
14
|
+
}
|
|
15
|
+
function _define_property(obj, key, value) {
|
|
16
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
17
|
+
value,
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
configurable: !0,
|
|
20
|
+
writable: !0
|
|
21
|
+
}) : obj[key] = value, obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array_limit(arr, i) {
|
|
24
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
|
+
if (_i != null) {
|
|
26
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
27
|
+
try {
|
|
28
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
29
|
+
;
|
|
30
|
+
} catch (err) {
|
|
31
|
+
_d = !0, _e = err;
|
|
32
|
+
} finally {
|
|
33
|
+
try {
|
|
34
|
+
!_n && _i.return != null && _i.return();
|
|
35
|
+
} finally {
|
|
36
|
+
if (_d)
|
|
37
|
+
throw _e;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return _arr;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function _non_iterable_rest() {
|
|
44
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
45
|
+
}
|
|
46
|
+
function _object_spread(target) {
|
|
47
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
48
|
+
var source = arguments[i] != null ? arguments[i] : {}, ownKeys = Object.keys(source);
|
|
49
|
+
typeof Object.getOwnPropertySymbols == "function" && (ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
50
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
51
|
+
}))), ownKeys.forEach(function(key) {
|
|
52
|
+
_define_property(target, key, source[key]);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return target;
|
|
56
|
+
}
|
|
57
|
+
function _object_without_properties(source, excluded) {
|
|
58
|
+
if (source == null)
|
|
59
|
+
return {};
|
|
60
|
+
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
61
|
+
if (Object.getOwnPropertySymbols) {
|
|
62
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
63
|
+
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
64
|
+
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null)
|
|
70
|
+
return {};
|
|
71
|
+
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
72
|
+
for (i = 0; i < sourceKeys.length; i++)
|
|
73
|
+
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
74
|
+
return target;
|
|
75
|
+
}
|
|
76
|
+
function _sliced_to_array(arr, i) {
|
|
77
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
78
|
+
}
|
|
79
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
80
|
+
if (o) {
|
|
81
|
+
if (typeof o == "string")
|
|
82
|
+
return _array_like_to_array(o, minLen);
|
|
83
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
84
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
85
|
+
return Array.from(n);
|
|
86
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
87
|
+
return _array_like_to_array(o, minLen);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var StyledImage = styled(RNImage, {
|
|
7
91
|
name: "Image"
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
92
|
+
}), hasWarned = !1, Image = StyledImage.extractable(/* @__PURE__ */ forwardRef(function(inProps, ref) {
|
|
93
|
+
var _usePropsAndStyle = _sliced_to_array(usePropsAndStyle(inProps), 2), props = _usePropsAndStyle[0], style = _usePropsAndStyle[1], src = props.src, source = props.source, rest = _object_without_properties(props, [
|
|
94
|
+
"src",
|
|
95
|
+
"source"
|
|
96
|
+
]);
|
|
97
|
+
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.')));
|
|
98
|
+
var finalSource = typeof src == "string" ? _object_spread({
|
|
99
|
+
uri: src
|
|
100
|
+
}, isWeb && {
|
|
101
|
+
width: props.width,
|
|
102
|
+
height: props.height
|
|
103
|
+
}) : source ?? src;
|
|
104
|
+
if (finalSource && typeof finalSource == "object") {
|
|
105
|
+
if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source))) {
|
|
106
|
+
var _style, _style1, _width;
|
|
107
|
+
(_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
|
|
108
|
+
var _height;
|
|
109
|
+
(_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
|
|
110
|
+
}
|
|
111
|
+
finalSource.default && (finalSource = finalSource.default);
|
|
112
|
+
}
|
|
113
|
+
return /* @__PURE__ */ React.createElement(StyledImage, _object_spread({
|
|
114
|
+
ref,
|
|
115
|
+
source: finalSource,
|
|
116
|
+
style
|
|
117
|
+
}, rest));
|
|
118
|
+
}));
|
|
20
119
|
Image.getSize = RNImage.getSize;
|
|
21
120
|
Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
|
|
22
121
|
Image.prefetch = RNImage.prefetch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/Image.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/image/src/Image.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAASA,aAAa;AAQtB,SAASC,QAAQC,wBAAwB;AACzC,OAAOC,SAASC,kBAAkB;AAClC,SAASC,SAASC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,IAAMC,cAAcN,OAAOK,SAAS;EAClCE,MAAM;AACR,CAAA,GA6BIC,YAAY,IAEHJ,QAAQE,YAAYG,YAC/BN,2BAAW,SAACO,SAAqBC,KAAAA;AAC/B,MAAuBV,oBAAAA,iBAAAA,iBAAiBS,OAAAA,GAAAA,CAAAA,GAAjCE,QAAgBX,kBAAAA,CAAAA,GAATY,QAASZ,kBAAAA,CAAAA,GACfa,MAAyBF,MAAzBE,KAAKC,SAAoBH,MAApBG,QAAWC,OAAAA,2BAASJ,OAAAA;IAAzBE;IAAKC;;AAEb,EAAIE,QAAQC,IAAIC,aAAa,iBACvB,OAAOL,OAAQ,aAEd,OAAOF,MAAMQ,SAAU,YAAYR,MAAMQ,MAAM,CAAA,MAAO,OACtD,OAAOR,MAAMS,UAAW,YAAYT,MAAMS,OAAO,CAAA,MAAO,SAEpDb,cACHA,YAAY,IACZc,QAAQC,KACL,4IAAA;AAOX,MAAIC,cACF,OAAOV,OAAQ,WACX,eAAA;IAAEW,KAAKX;KAASf,SAAS;IAAEqB,OAAOR,MAAMQ;IAAOC,QAAQT,MAAMS;EAAO,CAAA,IACpEN,UAAUD;AAEhB,MAAIU,eAAe,OAAOA,eAAgB,UAAU;AAGhD,QAAI,CAACE,MAAMC,QAAQH,WAAAA,KACb,OAAOA,YAAYC,OAAQ,aAC7BD,cAAcA,YAAYC,KACtBV,UAAU,OAAOA,UAAW,YAAY,CAACW,MAAMC,QAAQZ,MAAAA,IAAS;UAElEF,QAEAA;AAFAA,OAAAA,UAAAA,SAAAA,OAAMO,WAAAA,QAAAA,WAAAA,WAANP,OAAMO,QAAUL,OAAOK;;AAEvBP,OAAAA,WAAAA,UAAAA,OAAMQ,YAAAA,QAAAA,YAAAA,WAANR,QAAMQ,SAAWN,OAAOM;IAC1B;AAMN,IAAIG,YAAY,YACdA,cAAcA,YAAY;EAE9B;AAGA,SAAO,sBAAA,cAAClB,aAAAA,eAAAA;IAAYK;IAAUI,QAAQS;IAAaX;KAAmBG,IAAAA,CAAAA;AACxE,CAAA,CAAA;AAGFZ,MAAMwB,UAAUvB,QAAQuB;AACxBxB,MAAMyB,qBAAqBxB,QAAQwB;AACnCzB,MAAM0B,WAAWzB,QAAQyB;AACzB1B,MAAM2B,uBAAuB1B,QAAQ0B;AACrC3B,MAAM4B,gBAAgB3B,QAAQ2B;AAC9B5B,MAAM6B,aAAa5B,QAAQ4B;",
|
|
5
|
+
"names": ["isWeb", "styled", "usePropsAndStyle", "React", "forwardRef", "Image", "RNImage", "StyledImage", "name", "hasWarned", "extractable", "inProps", "ref", "props", "style", "src", "source", "rest", "process", "env", "NODE_ENV", "width", "height", "console", "warn", "finalSource", "uri", "Array", "isArray", "getSize", "getSizeWithHeaders", "prefetch", "prefetchWithMetadata", "abortPrefetch", "queryCache"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/image",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.27-1708113113238",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"clean:build": "tamagui-build clean:build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/constants": "1.89.
|
|
27
|
-
"@tamagui/core": "1.89.
|
|
26
|
+
"@tamagui/constants": "1.89.27-1708113113238",
|
|
27
|
+
"@tamagui/core": "1.89.27-1708113113238"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "*",
|
|
31
31
|
"react-native": "*"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "1.89.
|
|
34
|
+
"@tamagui/build": "1.89.27-1708113113238",
|
|
35
35
|
"react": "^18.2.0",
|
|
36
|
-
"react-native": "^0.
|
|
36
|
+
"react-native": "^0.73.4"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|