@tamagui/image 1.61.3 → 1.62.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.js CHANGED
@@ -1,30 +1,23 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var Image_exports = {};
20
16
  __export(Image_exports, {
21
17
  Image: () => Image
22
18
  });
23
19
  module.exports = __toCommonJS(Image_exports);
24
- var import_jsx_runtime = require("react/jsx-runtime");
25
- var import_core = require("@tamagui/core");
26
- var import_react = require("react");
27
- var import_react_native = require("react-native");
20
+ var import_core = require("@tamagui/core"), import_react = require("react"), import_react_native = require("react-native"), import_jsx_runtime = require("react/jsx-runtime");
28
21
  (0, import_core.setupReactNative)({
29
22
  Image: import_react_native.Image
30
23
  });
@@ -33,24 +26,14 @@ const StyledImage = (0, import_core.styled)(import_react_native.Image, {
33
26
  position: "relative",
34
27
  source: { uri: "" }
35
28
  });
36
- let hasWarned = false;
29
+ let hasWarned = !1;
37
30
  const Image = StyledImage.extractable(
38
31
  (0, import_react.forwardRef)((inProps, ref) => {
39
- const props = (0, import_core.useProps)(inProps);
40
- const { src, source, ...rest } = props;
41
- if (process.env.NODE_ENV === "development") {
42
- if (typeof src === "string") {
43
- if (typeof props.width === "string" && props.width[0] !== "$" || typeof props.height === "string" && props.height[0] !== "$") {
44
- if (!hasWarned) {
45
- hasWarned = true;
46
- console.warn(
47
- `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.`
48
- );
49
- }
50
- }
51
- }
52
- }
53
- const finalSource = typeof src === "string" ? { uri: src, ...import_core.isWeb && { width: props.width, height: props.height } } : source ?? src;
32
+ const props = (0, import_core.useProps)(inProps), { src, source, ...rest } = props;
33
+ 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(
34
+ '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.'
35
+ )));
36
+ const finalSource = typeof src == "string" ? { uri: src, ...import_core.isWeb && { width: props.width, height: props.height } } : source ?? src;
54
37
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, { ref, source: finalSource, ...rest });
55
38
  })
56
39
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Image.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgFW;AAhFX,kBAUO;AACP,mBAAkC;AAClC,0BAAiC;AAAA,IAEjC,8BAAiB;AAAA,EACf,OAAO,oBAAAA;AACT,CAAC;AAED,MAAM,kBAAc,oBAAO,oBAAAA,OAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA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6BD,IAAI,YAAY;AAET,MAAM,QAAQ,YAAY;AAAA,MAC/B,yBAAW,CAAC,SAAqB,QAAQ;AACvC,UAAM,YAAQ,sBAAS,OAAO,GACxB,EAAE,KAAK,QAAQ,GAAG,KAAK,IAAI;AAEjC,IAAI,QAAQ,IAAI,aAAa,iBACvB,OAAO,OAAQ,aAEd,OAAO,MAAM,SAAU,YAAY,MAAM,MAAM,CAAC,MAAM,OACtD,OAAO,MAAM,UAAW,YAAY,MAAM,OAAO,CAAC,MAAM,SAEpD,cACH,YAAY,IACZ,QAAQ;AAAA,MACN;AAAA,IACF;AAMR,UAAM,cACJ,OAAO,OAAQ,WACX,EAAE,KAAK,KAAK,GAAI,qBAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE,UAAU;AAGhB,WAAO,4CAAC,eAAY,KAAU,QAAQ,aAAc,GAAI,MAAc;AAAA,EACxE,CAAC;AACH;AAEA,MAAM,UAAU,oBAAAA,MAAQ;AACxB,MAAM,qBAAqB,oBAAAA,MAAQ;AACnC,MAAM,WAAW,oBAAAA,MAAQ;AACzB,MAAM,uBAAuB,oBAAAA,MAAQ;AACrC,MAAM,gBAAgB,oBAAAA,MAAQ;AAC9B,MAAM,aAAa,oBAAAA,MAAQ;",
5
5
  "names": ["RNImage"]
6
6
  }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var Image_exports = {};
17
+ __export(Image_exports, {
18
+ Image: () => Image
19
+ });
20
+ module.exports = __toCommonJS(Image_exports);
21
+ var import_core = require("@tamagui/core"), import_react = require("react"), import_react_native = require("react-native"), import_jsx_runtime = require("react/jsx-runtime");
22
+ (0, import_core.setupReactNative)({
23
+ Image: import_react_native.Image
24
+ });
25
+ const StyledImage = (0, import_core.styled)(import_react_native.Image, {
26
+ name: "Image",
27
+ position: "relative",
28
+ source: { uri: "" }
29
+ });
30
+ let hasWarned = !1;
31
+ const Image = StyledImage.extractable(
32
+ (0, import_react.forwardRef)((inProps, ref) => {
33
+ const props = (0, import_core.useProps)(inProps), { src, source, ...rest } = props;
34
+ 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(
35
+ '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.'
36
+ )));
37
+ const finalSource = typeof src == "string" ? { uri: src, ...import_core.isWeb && { width: props.width, height: props.height } } : source ?? src;
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, { ref, source: finalSource, ...rest });
39
+ })
40
+ );
41
+ Image.getSize = import_react_native.Image.getSize;
42
+ Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
43
+ Image.prefetch = import_react_native.Image.prefetch;
44
+ Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
45
+ Image.abortPrefetch = import_react_native.Image.abortPrefetch;
46
+ Image.queryCache = import_react_native.Image.queryCache;
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ Image
50
+ });
51
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Image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ertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
6
+ if (from && typeof from == "object" || typeof from == "function")
8
7
  for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
8
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
9
  return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
10
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
12
  var src_exports = {};
17
13
  module.exports = __toCommonJS(src_exports);
18
14
  __reExport(src_exports, require("./Image"), module.exports);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;",
4
+ "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from == "object" || typeof from == "function")
8
+ for (let key of __getOwnPropNames(from))
9
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ return to;
11
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
+ var src_exports = {};
14
+ module.exports = __toCommonJS(src_exports);
15
+ __reExport(src_exports, require("./Image"), module.exports);
16
+ // Annotate the CommonJS export names for ESM import in node:
17
+ 0 && (module.exports = {
18
+ ...require("./Image")
19
+ });
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;",
5
+ "names": []
6
+ }
package/dist/esm/Image.js CHANGED
@@ -1,4 +1,3 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import {
3
2
  isWeb,
4
3
  setupReactNative,
@@ -7,6 +6,7 @@ import {
7
6
  } from "@tamagui/core";
8
7
  import { forwardRef } from "react";
9
8
  import { Image as RNImage } from "react-native";
9
+ import { jsx } from "react/jsx-runtime";
10
10
  setupReactNative({
11
11
  Image: RNImage
12
12
  });
@@ -15,24 +15,14 @@ const StyledImage = styled(RNImage, {
15
15
  position: "relative",
16
16
  source: { uri: "" }
17
17
  });
18
- let hasWarned = false;
18
+ let hasWarned = !1;
19
19
  const Image = StyledImage.extractable(
20
20
  forwardRef((inProps, ref) => {
21
- const props = useProps(inProps);
22
- const { src, source, ...rest } = props;
23
- if (process.env.NODE_ENV === "development") {
24
- if (typeof src === "string") {
25
- if (typeof props.width === "string" && props.width[0] !== "$" || typeof props.height === "string" && props.height[0] !== "$") {
26
- if (!hasWarned) {
27
- hasWarned = true;
28
- console.warn(
29
- `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.`
30
- );
31
- }
32
- }
33
- }
34
- }
35
- const finalSource = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
21
+ const props = useProps(inProps), { src, source, ...rest } = props;
22
+ 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(
23
+ '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.'
24
+ )));
25
+ const finalSource = typeof src == "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
36
26
  return /* @__PURE__ */ jsx(StyledImage, { ref, source: finalSource, ...rest });
37
27
  })
38
28
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Image.tsx"],
4
- "mappings": "AAgFW;AAhFX;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AACpB,CAAC;AA6BD,IAAI,YAAY;AAET,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,UAAM,QAAQ,SAAS,OAAO;AAC9B,UAAM,EAAE,KAAK,QAAQ,GAAG,KAAK,IAAI;AAEjC,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,UAAI,OAAO,QAAQ,UAAU;AAC3B,YACG,OAAO,MAAM,UAAU,YAAY,MAAM,MAAM,CAAC,MAAM,OACtD,OAAO,MAAM,WAAW,YAAY,MAAM,OAAO,CAAC,MAAM,KACzD;AACA,cAAI,CAAC,WAAW;AACd,wBAAY;AACZ,oBAAQ;AAAA,cAC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,KAAU,QAAQ,aAAc,GAAI,MAAc;AAAA,EACxE,CAAC;AACH;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
5
5
  "names": []
6
6
  }
package/dist/jsx/Image.js CHANGED
@@ -14,24 +14,14 @@ const StyledImage = styled(RNImage, {
14
14
  position: "relative",
15
15
  source: { uri: "" }
16
16
  });
17
- let hasWarned = false;
17
+ let hasWarned = !1;
18
18
  const Image = StyledImage.extractable(
19
19
  forwardRef((inProps, ref) => {
20
- const props = useProps(inProps);
21
- const { src, source, ...rest } = props;
22
- if (process.env.NODE_ENV === "development") {
23
- if (typeof src === "string") {
24
- if (typeof props.width === "string" && props.width[0] !== "$" || typeof props.height === "string" && props.height[0] !== "$") {
25
- if (!hasWarned) {
26
- hasWarned = true;
27
- console.warn(
28
- `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.`
29
- );
30
- }
31
- }
32
- }
33
- }
34
- const finalSource = typeof src === "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
20
+ const props = useProps(inProps), { src, source, ...rest } = props;
21
+ 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(
22
+ '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.'
23
+ )));
24
+ const finalSource = typeof src == "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
35
25
  return <StyledImage ref={ref} source={finalSource} {...rest} />;
36
26
  })
37
27
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Image.tsx"],
4
- "mappings": "AAAA;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,E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,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AACpB,CAAC;AA6BD,IAAI,YAAY;AAET,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,UAAM,QAAQ,SAAS,OAAO,GACxB,EAAE,KAAK,QAAQ,GAAG,KAAK,IAAI;AAEjC,IAAI,QAAQ,IAAI,aAAa,iBACvB,OAAO,OAAQ,aAEd,OAAO,MAAM,SAAU,YAAY,MAAM,MAAM,CAAC,MAAM,OACtD,OAAO,MAAM,UAAW,YAAY,MAAM,OAAO,CAAC,MAAM,SAEpD,cACH,YAAY,IACZ,QAAQ;AAAA,MACN;AAAA,IACF;AAMR,UAAM,cACJ,OAAO,OAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE,UAAU;AAGhB,WAAO,CAAC,YAAY,KAAK,KAAK,QAAQ,iBAAkB,MAAc;AAAA,EACxE,CAAC;AACH;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,37 @@
1
+ import {
2
+ isWeb,
3
+ setupReactNative,
4
+ styled,
5
+ useProps
6
+ } from "@tamagui/core";
7
+ import { forwardRef } from "react";
8
+ import { Image as RNImage } from "react-native";
9
+ setupReactNative({
10
+ Image: RNImage
11
+ });
12
+ const StyledImage = styled(RNImage, {
13
+ name: "Image",
14
+ position: "relative",
15
+ source: { uri: "" }
16
+ });
17
+ let hasWarned = !1;
18
+ const Image = StyledImage.extractable(
19
+ forwardRef((inProps, ref) => {
20
+ const props = useProps(inProps), { src, source, ...rest } = props;
21
+ 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(
22
+ '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.'
23
+ )));
24
+ const finalSource = typeof src == "string" ? { uri: src, ...isWeb && { width: props.width, height: props.height } } : source ?? src;
25
+ return <StyledImage ref={ref} source={finalSource} {...rest} />;
26
+ })
27
+ );
28
+ Image.getSize = RNImage.getSize;
29
+ Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
30
+ Image.prefetch = RNImage.prefetch;
31
+ Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
32
+ Image.abortPrefetch = RNImage.abortPrefetch;
33
+ Image.queryCache = RNImage.queryCache;
34
+ export {
35
+ Image
36
+ };
37
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Image.tsx"],
4
+ "mappings": "AAAA;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,kBAAkB;AAClC,SAAS,SAAS,eAAe;AAEjC,iBAAiB;AAAA,EACf,OAAO;AACT,CAAC;AAED,MAAM,cAAc,OAAO,SAAS;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ,EAAE,KAAK,GAAG;AACpB,CAAC;AA6BD,IAAI,YAAY;AAET,MAAM,QAAQ,YAAY;AAAA,EAC/B,WAAW,CAAC,SAAqB,QAAQ;AACvC,UAAM,QAAQ,SAAS,OAAO,GACxB,EAAE,KAAK,QAAQ,GAAG,KAAK,IAAI;AAEjC,IAAI,QAAQ,IAAI,aAAa,iBACvB,OAAO,OAAQ,aAEd,OAAO,MAAM,SAAU,YAAY,MAAM,MAAM,CAAC,MAAM,OACtD,OAAO,MAAM,UAAW,YAAY,MAAM,OAAO,CAAC,MAAM,SAEpD,cACH,YAAY,IACZ,QAAQ;AAAA,MACN;AAAA,IACF;AAMR,UAAM,cACJ,OAAO,OAAQ,WACX,EAAE,KAAK,KAAK,GAAI,SAAS,EAAE,OAAO,MAAM,OAAO,QAAQ,MAAM,OAAO,EAAG,IACvE,UAAU;AAGhB,WAAO,CAAC,YAAY,KAAK,KAAK,QAAQ,iBAAkB,MAAc;AAAA,EACxE,CAAC;AACH;AAEA,MAAM,UAAU,QAAQ;AACxB,MAAM,qBAAqB,QAAQ;AACnC,MAAM,WAAW,QAAQ;AACzB,MAAM,uBAAuB,QAAQ;AACrC,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Image";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": "AAAA,cAAc;",
5
+ "names": []
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/image",
3
- "version": "1.61.3",
3
+ "version": "1.62.1",
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.61.3"
26
+ "@tamagui/core": "1.62.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "*",
30
30
  "react-native": "*"
31
31
  },
32
32
  "devDependencies": {
33
- "@tamagui/build": "1.61.3",
33
+ "@tamagui/build": "1.62.1",
34
34
  "react": "^18.2.0",
35
35
  "react-native": "^0.72.1"
36
36
  },