@tamagui/image 1.125.6 → 1.125.7

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.
@@ -4,29 +4,36 @@ import { isWeb } from "@tamagui/constants";
4
4
  import { styled, usePropsAndStyle } from "@tamagui/core";
5
5
  import { Image as RNImage } from "react-native";
6
6
  var StyledImage = styled(RNImage, {
7
- name: "Image"
8
- }), hasWarned = !1, Image = StyledImage.styleable(function(inProps, ref) {
9
- var [props, style] = usePropsAndStyle(inProps), { src, source, objectFit, ...rest } = props;
10
- 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.')));
11
- var finalSource = typeof src == "string" ? {
12
- uri: src,
13
- ...isWeb && {
14
- width: props.width || style?.width,
15
- height: props.height || style?.height
16
- }
17
- } : source ?? src;
18
- if (finalSource && typeof finalSource == "object") {
19
- if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source))) {
20
- var _style, _style1, _width;
21
- (_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
22
- var _height;
23
- (_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
24
- }
25
- process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && React.useEffect(function() {
26
- async function run() {
27
- if (typeof src == "string")
28
- try {
29
- await fetch(src).then(function(res) {
7
+ name: "Image"
8
+ }),
9
+ hasWarned = !1,
10
+ Image = StyledImage.styleable(function (inProps, ref) {
11
+ var [props, style] = usePropsAndStyle(inProps),
12
+ {
13
+ src,
14
+ source,
15
+ objectFit,
16
+ ...rest
17
+ } = props;
18
+ 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.')));
19
+ var finalSource = typeof src == "string" ? {
20
+ uri: src,
21
+ ...(isWeb && {
22
+ width: props.width || style?.width,
23
+ height: props.height || style?.height
24
+ })
25
+ } : source ?? src;
26
+ if (finalSource && typeof finalSource == "object") {
27
+ if (!Array.isArray(finalSource) && typeof finalSource.uri == "number" && (finalSource = finalSource.uri, source && typeof source == "object" && !Array.isArray(source))) {
28
+ var _style, _style1, _width;
29
+ (_width = (_style = style).width) !== null && _width !== void 0 || (_style.width = source.width);
30
+ var _height;
31
+ (_height = (_style1 = style).height) !== null && _height !== void 0 || (_style1.height = source.height);
32
+ }
33
+ process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR && React.useEffect(function () {
34
+ async function run() {
35
+ if (typeof src == "string") try {
36
+ await fetch(src).then(function (res) {
30
37
  return res.text();
31
38
  });
32
39
  } catch {
@@ -34,27 +41,23 @@ var StyledImage = styled(RNImage, {
34
41
  props
35
42
  });
36
43
  }
37
- }
38
- run();
39
- }, [
40
- src
41
- ]), finalSource.default && (finalSource = finalSource.default);
42
- }
43
- return /* @__PURE__ */ _jsx(RNImage, {
44
- resizeMode: objectFit,
45
- ref,
46
- source: finalSource,
47
- style,
48
- ...rest
44
+ }
45
+ run();
46
+ }, [src]), finalSource.default && (finalSource = finalSource.default);
47
+ }
48
+ return /* @__PURE__ */_jsx(RNImage, {
49
+ resizeMode: objectFit,
50
+ ref,
51
+ source: finalSource,
52
+ style,
53
+ ...rest
54
+ });
49
55
  });
50
- });
51
56
  Image.getSize = RNImage.getSize;
52
57
  Image.getSizeWithHeaders = RNImage.getSizeWithHeaders;
53
58
  Image.prefetch = RNImage.prefetch;
54
59
  Image.prefetchWithMetadata = RNImage.prefetchWithMetadata;
55
60
  Image.abortPrefetch = RNImage.abortPrefetch;
56
61
  Image.queryCache = RNImage.queryCache;
57
- export {
58
- Image
59
- };
60
- //# sourceMappingURL=Image.js.map
62
+ export { Image };
63
+ //# sourceMappingURL=Image.native.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Users/n8/tamagui/code/ui/image/src/Image.tsx"],
4
- "mappings": ";AAAA,OAAOA,WAAW;AAClB,SAASC,aAAa;AAQtB,SAASC,QAAQC,wBAAwB;AAEzC,SAASC,SAASC,eAAe;AAEjC,IAAMC,cAAcJ,OAAOG,SAAS;EAClCE,MAAM;AACR,CAAA,GAmCIC,YAAY,IAMHJ,QAAQE,YAAYG,UAAsB,SAACC,SAASC,KAAAA;AAC/D,MAAM,CAACC,OAAOC,KAAAA,IAASV,iBAAiBO,OAAAA,GAClC,EAAEI,KAAKC,QAAQC,WAAW,GAAGC,KAAAA,IAASL;AAE5C,EAAIM,QAAQC,IAAIC,aAAa,iBACvB,OAAON,OAAQ,aAEd,OAAOF,MAAMS,SAAU,YAAYT,MAAMS,MAAM,CAAA,MAAO,OACtD,OAAOT,MAAMU,UAAW,YAAYV,MAAMU,OAAO,CAAA,MAAO,SAEpDd,cACHA,YAAY,IACZe,QAAQC,KACN,4IAA4I;AAOtJ,MAAIC,cACF,OAAOX,OAAQ,WACX;IACEY,KAAKZ;IACL,GAAIb,SAAS;MACXoB,OAAOT,MAAMS,SAASR,OAAOQ;MAC7BC,QAAQV,MAAMU,UAAUT,OAAOS;IACjC;EACF,IACCP,UAAUD;AAEjB,MAAIW,eAAe,OAAOA,eAAgB,UAAU;AAGhD,QAAI,CAACE,MAAMC,QAAQH,WAAAA,KACb,OAAOA,YAAYC,OAAQ,aAC7BD,cAAcA,YAAYC,KACtBX,UAAU,OAAOA,UAAW,YAAY,CAACY,MAAMC,QAAQb,MAAAA,IAAS;UAElEF,QAEAA;AAFAA,OAAAA,UAAAA,SAAAA,OAAMQ,WAAAA,QAAAA,WAAAA,WAANR,OAAMQ,QAAUN,OAAOM;;AAEvBR,OAAAA,WAAAA,UAAAA,OAAMS,YAAAA,QAAAA,YAAAA,WAANT,QAAMS,SAAWP,OAAOO;IAC1B;AAKN,IAAIJ,QAAQC,IAAIC,aAAa,iBAAiBF,QAAQC,IAAIU,6BAExD7B,MAAM8B,UAAU,WAAA;AACd,qBAAeC,MAAAA;AACb,YAAI,OAAOjB,OAAQ;AACjB,cAAI;AACF,kBAAMkB,MAAMlB,GAAAA,EAAKmB,KAAK,SAACC,KAAAA;qBAAQA,IAAIC,KAAI;;UACzC,QAAc;AACZZ,oBAAQa,MAAM,wBAAwBtB,GAAAA,IAAO;cAAEF;YAAM,CAAA;UACvD;MAEJ;AAEAmB,UAAAA;IACF,GAAG;MAACjB;KAAI,GAINW,YAAY,YACdA,cAAcA,YAAY;EAE9B;AAGA,SACE,qBAACpB,SAAAA;IACCgC,YAAYrB;IACZL;IACAI,QAAQU;IACRZ;IACC,GAAII;;AAGX,CAAA;AAEAb,MAAMkC,UAAUjC,QAAQiC;AACxBlC,MAAMmC,qBAAqBlC,QAAQkC;AACnCnC,MAAMoC,WAAWnC,QAAQmC;AACzBpC,MAAMqC,uBAAuBpC,QAAQoC;AACrCrC,MAAMsC,gBAAgBrC,QAAQqC;AAC9BtC,MAAMuC,aAAatC,QAAQsC;",
5
- "names": ["React", "isWeb", "styled", "usePropsAndStyle", "Image", "RNImage", "StyledImage", "name", "hasWarned", "styleable", "inProps", "ref", "props", "style", "src", "source", "objectFit", "rest", "process", "env", "NODE_ENV", "width", "height", "console", "warn", "finalSource", "uri", "Array", "isArray", "TAMAGUI_IMAGE_CHECK_ERROR", "useEffect", "run", "fetch", "then", "res", "text", "error", "resizeMode", "getSize", "getSizeWithHeaders", "prefetch", "prefetchWithMetadata", "abortPrefetch", "queryCache"]
6
- }
1
+ {"version":3,"names":["jsx","_jsx","React","isWeb","styled","usePropsAndStyle","Image","RNImage","StyledImage","name","hasWarned","styleable","inProps","ref","props","style","src","source","objectFit","rest","process","env","NODE_ENV","width","height","console","warn","finalSource","uri","Array","isArray","_style","_style1","_width","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WAAAA,MAAA,iBAAAY,KAAA,CAAAC,OAAA,CAAAb,MAAA;QACjC,IAAAc,MAAA,EAAAC,OAAA,EAAAC,MAAA;QAED,CAAAA,MAAA,GAAU,CAAAF,MAAA,GAAAhB,KAAA,EAAAQ,KAAA,cAAAU,MAAA,gBAAAF,MAAA,CAAAR,KAAA,GAAAN,MAAA,CAAAM,KAAA;QAEjB,IAAIW,OAAA;QAmBE,CAAAA,OAAA,IAAAF,OAAqB,GAAAjB,KAAA,EAAAS,MAAA,cAAAU,OAAA,gBAAAF,OAAA,CAAAR,MAAA,GAAAP,MAAA,CAAAO,MAAA;MACnB;MACEJ,OAAA,CAAIC,GAAA,CAAAC,QAAA,sBAAAF,OAAA,CAAAC,GAAA,CAAAc,yBAAA,IAAAjC,KAAA,CAAAkC,SAAA;QACF,eAAMC,GAAMA,CAAA,EAAK;UACnB,WAAcrB,GAAA,cACZ;YACF,MAAAsB,KAAA,CAAAtB,GAAA,EAAAuB,IAAA,WAAAC,GAAA;cAEJ,OAAAA,GAAA,CAAAC,IAAA;YAEI;UACE,QAIN;YAOHhB,OAAA,CAAAiB,KAAA,yBAAA1B,GAAA;cAAAF;YACC;UACA;QACA;QACAuB,GAAA;MAAA,GACC,CAAIrB,GAAA,CACP,GAAAW,WAAA,CAAAgB,OAAA,KAAAhB,WAAA,GAAAA,WAAA,CAAAgB,OAAA;IAEH;IAED,OAAM,eAAkB1C,IAAA,CAAAM,OAAA;MACxBqC,UAAM,EAAA1B,SAAA;MACNL,GAAM;MACNI,MAAM,EAAAU,WAAA;MACNZ,KAAM;MACN,GAAMI","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export * from "./Image";
2
- //# sourceMappingURL=index.js.map
1
+ export * from "./Image.native.js";
2
+ //# sourceMappingURL=index.native.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Users/n8/tamagui/code/ui/image/src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/image",
3
- "version": "1.125.6",
3
+ "version": "1.125.7",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -36,14 +36,14 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@tamagui/constants": "1.125.6",
40
- "@tamagui/core": "1.125.6"
39
+ "@tamagui/constants": "1.125.7",
40
+ "@tamagui/core": "1.125.7"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": "*"
44
44
  },
45
45
  "devDependencies": {
46
- "@tamagui/build": "1.125.6",
46
+ "@tamagui/build": "1.125.7",
47
47
  "react": "*",
48
48
  "react-native": "^0.76.5"
49
49
  },