@tamagui/image 1.144.2 → 1.144.4

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.
Files changed (74) hide show
  1. package/dist/cjs/createImage.cjs +122 -0
  2. package/dist/cjs/createImage.js +127 -0
  3. package/dist/cjs/createImage.js.map +6 -0
  4. package/dist/cjs/createImage.native.js +128 -0
  5. package/dist/cjs/createImage.native.js.map +1 -0
  6. package/dist/cjs/types.cjs +16 -0
  7. package/dist/cjs/types.js +14 -0
  8. package/dist/cjs/types.js.map +6 -0
  9. package/dist/cjs/types.native.js +19 -0
  10. package/dist/cjs/types.native.js.map +1 -0
  11. package/dist/cjs/v1/Image.cjs +86 -0
  12. package/dist/cjs/v1/Image.js +72 -0
  13. package/dist/cjs/v1/Image.js.map +6 -0
  14. package/dist/cjs/v1/Image.native.js +105 -0
  15. package/dist/cjs/v1/Image.native.js.map +1 -0
  16. package/dist/cjs/v1/index.cjs +18 -0
  17. package/dist/cjs/v1/index.js +15 -0
  18. package/dist/cjs/v1/index.js.map +6 -0
  19. package/dist/cjs/v1/index.native.js +21 -0
  20. package/dist/cjs/v1/index.native.js.map +1 -0
  21. package/dist/esm/createImage.js +112 -0
  22. package/dist/esm/createImage.js.map +6 -0
  23. package/dist/esm/createImage.mjs +99 -0
  24. package/dist/esm/createImage.mjs.map +1 -0
  25. package/dist/esm/createImage.native.js +102 -0
  26. package/dist/esm/createImage.native.js.map +1 -0
  27. package/dist/esm/types.js +1 -0
  28. package/dist/esm/types.js.map +6 -0
  29. package/dist/esm/types.mjs +2 -0
  30. package/dist/esm/types.mjs.map +1 -0
  31. package/dist/esm/types.native.js +2 -0
  32. package/dist/esm/types.native.js.map +1 -0
  33. package/dist/esm/v1/Image.js +52 -0
  34. package/dist/esm/v1/Image.js.map +6 -0
  35. package/dist/esm/v1/Image.mjs +52 -0
  36. package/dist/esm/v1/Image.mjs.map +1 -0
  37. package/dist/esm/v1/Image.native.js +68 -0
  38. package/dist/esm/v1/Image.native.js.map +1 -0
  39. package/dist/esm/v1/index.js +2 -0
  40. package/dist/esm/v1/index.js.map +6 -0
  41. package/dist/esm/v1/index.mjs +2 -0
  42. package/dist/esm/v1/index.mjs.map +1 -0
  43. package/dist/esm/v1/index.native.js +2 -0
  44. package/dist/esm/v1/index.native.js.map +1 -0
  45. package/dist/jsx/createImage.js +112 -0
  46. package/dist/jsx/createImage.js.map +6 -0
  47. package/dist/jsx/createImage.mjs +99 -0
  48. package/dist/jsx/createImage.mjs.map +1 -0
  49. package/dist/jsx/createImage.native.js +128 -0
  50. package/dist/jsx/createImage.native.js.map +1 -0
  51. package/dist/jsx/types.js +1 -0
  52. package/dist/jsx/types.js.map +6 -0
  53. package/dist/jsx/types.mjs +2 -0
  54. package/dist/jsx/types.mjs.map +1 -0
  55. package/dist/jsx/types.native.js +19 -0
  56. package/dist/jsx/types.native.js.map +1 -0
  57. package/dist/jsx/v1/Image.js +52 -0
  58. package/dist/jsx/v1/Image.js.map +6 -0
  59. package/dist/jsx/v1/Image.mjs +52 -0
  60. package/dist/jsx/v1/Image.mjs.map +1 -0
  61. package/dist/jsx/v1/Image.native.js +105 -0
  62. package/dist/jsx/v1/Image.native.js.map +1 -0
  63. package/dist/jsx/v1/index.js +2 -0
  64. package/dist/jsx/v1/index.js.map +6 -0
  65. package/dist/jsx/v1/index.mjs +2 -0
  66. package/dist/jsx/v1/index.mjs.map +1 -0
  67. package/dist/jsx/v1/index.native.js +21 -0
  68. package/dist/jsx/v1/index.native.js.map +1 -0
  69. package/package.json +4 -4
  70. package/types/Image.native.d.ts.map +1 -0
  71. package/types/createImage.d.ts.map +1 -0
  72. package/types/types.d.ts.map +1 -0
  73. package/types/v1/Image.d.ts.map +1 -0
  74. package/types/v1/index.d.ts.map +1 -0
@@ -0,0 +1,122 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var createImage_exports = {};
22
+ __export(createImage_exports, {
23
+ createImage: () => createImage
24
+ });
25
+ module.exports = __toCommonJS(createImage_exports);
26
+ var import_web = require("@tamagui/web"),
27
+ import_jsx_runtime = require("react/jsx-runtime");
28
+ const defaultObjectFitMap = objectFit => {
29
+ switch (objectFit) {
30
+ case "fill":
31
+ return "stretch";
32
+ case "none":
33
+ return "center";
34
+ case "scale-down":
35
+ return "contain";
36
+ case "contain":
37
+ return "contain";
38
+ default:
39
+ return "cover";
40
+ }
41
+ },
42
+ defaultTransformSource = props => {
43
+ const {
44
+ src,
45
+ source,
46
+ width,
47
+ height
48
+ } = props;
49
+ return source || (src && typeof src != "string" ? src : {
50
+ uri: src,
51
+ width,
52
+ height
53
+ });
54
+ };
55
+ function createImage(options) {
56
+ const {
57
+ Component,
58
+ mapObjectFitToResizeMode = defaultObjectFitMap,
59
+ resizeModePropName = "resizeMode",
60
+ objectPositionPropName,
61
+ transformSource = defaultTransformSource
62
+ } = options,
63
+ ImageComponent = (0, import_web.styled)(Component, {
64
+ name: "Image"
65
+ }, {
66
+ inlineProps: /* @__PURE__ */new Set(["source", "placeholder", "transition", "contentFit", "contentPosition", "cachePolicy", "recyclingKey", "allowDownscaling", "autoplay", "blurRadius", "priority", "placeholderContentFit", "responsivePolicy", "onLoadStart", "onProgress", "onLoadEnd"])
67
+ }).styleable((incomingProps, ref) => {
68
+ const props = incomingProps,
69
+ {
70
+ src,
71
+ width,
72
+ height,
73
+ objectFit,
74
+ objectPosition,
75
+ // web only props - filter out on native
76
+ decoding,
77
+ elementTiming,
78
+ fetchpriority,
79
+ isMap,
80
+ loading,
81
+ sizes,
82
+ useMap,
83
+ onLoad,
84
+ onError,
85
+ ...rest
86
+ } = props,
87
+ resolvedWidth = typeof width == "string" && width[0] === "$" ? (0, import_web.getTokenValue)(width) : width,
88
+ resolvedHeight = typeof height == "string" && height[0] === "$" ? (0, import_web.getTokenValue)(height) : height,
89
+ finalSource = transformSource({
90
+ src,
91
+ width: resolvedWidth,
92
+ height: resolvedHeight
93
+ }),
94
+ finalProps = {
95
+ ...rest,
96
+ source: finalSource,
97
+ style: {
98
+ width: resolvedWidth,
99
+ height: resolvedHeight
100
+ }
101
+ };
102
+ return objectFit && (finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit)), objectPositionPropName && objectPosition && (finalProps[objectPositionPropName] = objectPosition), onLoad && (finalProps.onLoad = e => {
103
+ const source = e?.nativeEvent?.source || e?.source || {};
104
+ onLoad({
105
+ target: {
106
+ naturalHeight: source?.height,
107
+ naturalWidth: source?.width
108
+ },
109
+ type: "load"
110
+ });
111
+ }), onError && (finalProps.onError = () => {
112
+ onError({
113
+ type: "error"
114
+ });
115
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {
116
+ ref,
117
+ ...finalProps
118
+ });
119
+ }),
120
+ comp = Component;
121
+ return ImageComponent.getSize = comp.getSize || (() => {}), ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || (() => {}), ImageComponent.prefetch = comp.prefetch || (() => {}), ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || (() => {}), ImageComponent.abortPrefetch = comp.abortPrefetch || (() => {}), ImageComponent.queryCache = comp.queryCache || (() => {}), ImageComponent;
122
+ }
@@ -0,0 +1,127 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var createImage_exports = {};
16
+ __export(createImage_exports, {
17
+ createImage: () => createImage
18
+ });
19
+ module.exports = __toCommonJS(createImage_exports);
20
+ var import_web = require("@tamagui/web"), import_jsx_runtime = require("react/jsx-runtime");
21
+ const defaultObjectFitMap = (objectFit) => {
22
+ switch (objectFit) {
23
+ case "fill":
24
+ return "stretch";
25
+ case "none":
26
+ return "center";
27
+ case "scale-down":
28
+ return "contain";
29
+ case "contain":
30
+ return "contain";
31
+ default:
32
+ return "cover";
33
+ }
34
+ }, defaultTransformSource = (props) => {
35
+ const { src, source, width, height } = props;
36
+ return source || (src && typeof src != "string" ? src : {
37
+ uri: src,
38
+ width,
39
+ height
40
+ });
41
+ };
42
+ function createImage(options) {
43
+ const {
44
+ Component,
45
+ mapObjectFitToResizeMode = defaultObjectFitMap,
46
+ resizeModePropName = "resizeMode",
47
+ objectPositionPropName,
48
+ transformSource = defaultTransformSource
49
+ } = options, ImageComponent = (0, import_web.styled)(
50
+ Component,
51
+ {
52
+ name: "Image"
53
+ },
54
+ {
55
+ inlineProps: /* @__PURE__ */ new Set([
56
+ "source",
57
+ "placeholder",
58
+ "transition",
59
+ "contentFit",
60
+ "contentPosition",
61
+ "cachePolicy",
62
+ "recyclingKey",
63
+ "allowDownscaling",
64
+ "autoplay",
65
+ "blurRadius",
66
+ "priority",
67
+ "placeholderContentFit",
68
+ "responsivePolicy",
69
+ "onLoadStart",
70
+ "onProgress",
71
+ "onLoadEnd"
72
+ ])
73
+ }
74
+ ).styleable((incomingProps, ref) => {
75
+ const props = incomingProps, {
76
+ src,
77
+ width,
78
+ height,
79
+ objectFit,
80
+ objectPosition,
81
+ // web only props - filter out on native
82
+ decoding,
83
+ elementTiming,
84
+ fetchpriority,
85
+ isMap,
86
+ loading,
87
+ sizes,
88
+ useMap,
89
+ onLoad,
90
+ onError,
91
+ ...rest
92
+ } = props, resolvedWidth = typeof width == "string" && width[0] === "$" ? (0, import_web.getTokenValue)(width) : width, resolvedHeight = typeof height == "string" && height[0] === "$" ? (0, import_web.getTokenValue)(height) : height, finalSource = transformSource({
93
+ src,
94
+ width: resolvedWidth,
95
+ height: resolvedHeight
96
+ }), finalProps = {
97
+ ...rest,
98
+ source: finalSource,
99
+ style: {
100
+ width: resolvedWidth,
101
+ height: resolvedHeight
102
+ }
103
+ };
104
+ return objectFit && (finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit)), objectPositionPropName && objectPosition && (finalProps[objectPositionPropName] = objectPosition), onLoad && (finalProps.onLoad = (e) => {
105
+ const source = e?.nativeEvent?.source || e?.source || {};
106
+ onLoad({
107
+ target: {
108
+ naturalHeight: source?.height,
109
+ naturalWidth: source?.width
110
+ },
111
+ type: "load"
112
+ });
113
+ }), onError && (finalProps.onError = () => {
114
+ onError({
115
+ type: "error"
116
+ });
117
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...finalProps });
118
+ }), comp = Component;
119
+ return ImageComponent.getSize = comp.getSize || (() => {
120
+ }), ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || (() => {
121
+ }), ImageComponent.prefetch = comp.prefetch || (() => {
122
+ }), ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || (() => {
123
+ }), ImageComponent.abortPrefetch = comp.abortPrefetch || (() => {
124
+ }), ImageComponent.queryCache = comp.queryCache || (() => {
125
+ }), ImageComponent;
126
+ }
127
+ //# sourceMappingURL=createImage.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/createImage.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAsC,yBAyN3B;AA/KX,MAAM,sBAAsB,CAAC,cAAuC;AAClE,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF,GAEM,yBAAyB,CAAC,UAK1B;AACJ,QAAM,EAAE,KAAK,QAAQ,OAAO,OAAO,IAAI;AACvC,SAAI,WACA,OAAO,OAAO,OAAQ,WAAiB,MACpC;AAAA,IACL,KAAK;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAyBO,SAAS,YACd,SACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA,2BAA2B;AAAA,IAC3B,qBAAqB;AAAA,IACrB;AAAA,IACA,kBAAkB;AAAA,EACpB,IAAI,SAmCE,qBAbc;AAAA,IAClB;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,IACA;AAAA,MACE,aAzBmB,oBAAI,IAAI;AAAA,QAC7B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IASC;AAAA,EACF,EAKmC,UAAyB,CAAC,eAAe,QAAQ;AAClF,UAAM,QAAQ,eACR;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAA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EhD;AACT;",
5
+ "names": []
6
+ }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
+ value: !0
22
+ }), mod);
23
+ var createImage_exports = {};
24
+ __export(createImage_exports, {
25
+ createImage: () => createImage
26
+ });
27
+ module.exports = __toCommonJS(createImage_exports);
28
+ var import_jsx_runtime = require("react/jsx-runtime"),
29
+ import_web = require("@tamagui/web"),
30
+ defaultObjectFitMap = function (objectFit) {
31
+ switch (objectFit) {
32
+ case "fill":
33
+ return "stretch";
34
+ case "none":
35
+ return "center";
36
+ case "scale-down":
37
+ return "contain";
38
+ case "contain":
39
+ return "contain";
40
+ default:
41
+ return "cover";
42
+ }
43
+ },
44
+ defaultTransformSource = function (props) {
45
+ var {
46
+ src,
47
+ source,
48
+ width,
49
+ height
50
+ } = props;
51
+ return source || (src && typeof src != "string" ? src : {
52
+ uri: src,
53
+ width,
54
+ height
55
+ });
56
+ };
57
+ function createImage(options) {
58
+ var {
59
+ Component,
60
+ mapObjectFitToResizeMode = defaultObjectFitMap,
61
+ resizeModePropName = "resizeMode",
62
+ objectPositionPropName,
63
+ transformSource = defaultTransformSource
64
+ } = options,
65
+ inlinePropsSet = /* @__PURE__ */new Set(["source", "placeholder", "transition", "contentFit", "contentPosition", "cachePolicy", "recyclingKey", "allowDownscaling", "autoplay", "blurRadius", "priority", "placeholderContentFit", "responsivePolicy", "onLoadStart", "onProgress", "onLoadEnd"]),
66
+ StyledImage = (0, import_web.styled)(Component, {
67
+ name: "Image"
68
+ }, {
69
+ inlineProps: inlinePropsSet
70
+ }),
71
+ ImageComponent = StyledImage.styleable(function (incomingProps, ref) {
72
+ var props = incomingProps,
73
+ {
74
+ src,
75
+ width,
76
+ height,
77
+ objectFit,
78
+ objectPosition,
79
+ // web only props - filter out on native
80
+ decoding,
81
+ elementTiming,
82
+ fetchpriority,
83
+ isMap,
84
+ loading,
85
+ sizes,
86
+ useMap,
87
+ onLoad,
88
+ onError,
89
+ ...rest
90
+ } = props,
91
+ resolvedWidth = typeof width == "string" && width[0] === "$" ? (0, import_web.getTokenValue)(width) : width,
92
+ resolvedHeight = typeof height == "string" && height[0] === "$" ? (0, import_web.getTokenValue)(height) : height,
93
+ finalSource = transformSource({
94
+ src,
95
+ width: resolvedWidth,
96
+ height: resolvedHeight
97
+ }),
98
+ finalProps = {
99
+ ...rest,
100
+ source: finalSource,
101
+ style: {
102
+ width: resolvedWidth,
103
+ height: resolvedHeight
104
+ }
105
+ };
106
+ return objectFit && (finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit)), objectPositionPropName && objectPosition && (finalProps[objectPositionPropName] = objectPosition), onLoad && (finalProps.onLoad = function (e) {
107
+ var _e_nativeEvent,
108
+ source = (e == null || (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.source) || e?.source || {};
109
+ onLoad({
110
+ target: {
111
+ naturalHeight: source?.height,
112
+ naturalWidth: source?.width
113
+ },
114
+ type: "load"
115
+ });
116
+ }), onError && (finalProps.onError = function () {
117
+ onError({
118
+ type: "error"
119
+ });
120
+ }), /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {
121
+ ref,
122
+ ...finalProps
123
+ });
124
+ }),
125
+ comp = Component;
126
+ return ImageComponent.getSize = comp.getSize || function () {}, ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || function () {}, ImageComponent.prefetch = comp.prefetch || function () {}, ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || function () {}, ImageComponent.abortPrefetch = comp.abortPrefetch || function () {}, ImageComponent.queryCache = comp.queryCache || function () {}, ImageComponent;
127
+ }
128
+ //# sourceMappingURL=createImage.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","createImage_exports","__export","createImage","module","exports","import_jsx_runtime","require","import_web","defaultObjectFitMap","objectFit","defaultTransformSource","props","src","source","width","height","uri","options","Component","mapObjectFitToResizeMode","resizeModePropName","objectPositionPropName","transformSource","inlinePropsSet","Set","StyledImage","styled","name","inlineProps","ImageComponent","styleable","incomingProps","ref","objectPosition","decoding","elementTiming","fetchpriority","isMap","loading","sizes","useMap","onLoad","onError","rest","resolvedWidth","getTokenValue","resolvedHeight","finalSource","finalProps","style","e","_e_nativeEvent","nativeEvent","target","naturalHeight","naturalWidth","type","jsx","comp","getSize","getSizeWithHeaders","prefetch","prefetchWithMetadata","abortPrefetch","queryCache"],"sources":["../../src/createImage.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAsCT,YAAA,CAAAK,mBAyN3B;AA/KX,IAAAK,kBAAM,GAAAC,OAAuB,oBAAuC;EAAAC,UAAA,GAAAD,OAAA;EAAAE,mBAAA,YAAAA,CAAAC,SAAA;IAClE,QAAQA,SAAA;MACN,KAAK;QACH,OAAO;MACT,KAAK;QACH,OAAO;MACT,KAAK;QACH,OAAO;MACT,K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V,CAAC,EAAAnC,cAGY;AACb","ignoreList":[]}
@@ -0,0 +1,16 @@
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") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
7
+ get: () => from[key],
8
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
9
+ });
10
+ return to;
11
+ };
12
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
13
+ value: !0
14
+ }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,14 @@
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
+ };
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
+ var types_exports = {};
13
+ module.exports = __toCommonJS(types_exports);
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types.ts"],
4
+ "mappings": ";;;;;;;;;;;AAAA;AAAA;",
5
+ "names": []
6
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
9
+ get: () => from[key],
10
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
11
+ });
12
+ return to;
13
+ };
14
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
15
+ value: !0
16
+ }), mod);
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
@@ -0,0 +1,86 @@
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,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
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);
32
+ var Image_exports = {};
33
+ __export(Image_exports, {
34
+ Image: () => Image
35
+ });
36
+ module.exports = __toCommonJS(Image_exports);
37
+ var import_react = __toESM(require("react"), 1),
38
+ import_constants = require("@tamagui/constants"),
39
+ import_web = require("@tamagui/web"),
40
+ import_react_native = require("react-native-web"),
41
+ import_jsx_runtime = require("react/jsx-runtime");
42
+ const StyledImage = (0, import_web.styled)(import_react_native.Image, {
43
+ name: "Image"
44
+ });
45
+ let hasWarned = !1;
46
+ const Image = StyledImage.styleable((inProps, ref) => {
47
+ const [props, style] = (0, import_web.usePropsAndStyle)(inProps),
48
+ {
49
+ src,
50
+ source,
51
+ objectFit,
52
+ ...rest
53
+ } = props;
54
+ 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.')));
55
+ let finalSource = typeof src == "string" ? {
56
+ uri: src,
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
+ }
71
+ }
72
+ run();
73
+ }, [src]), finalSource.default && (finalSource = finalSource.default)), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Image, {
74
+ resizeMode: objectFit,
75
+ ref,
76
+ source: finalSource,
77
+ style,
78
+ ...rest
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;
@@ -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"), 1), import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web"), import_react_native = require("react-native-web"), import_jsx_runtime = require("react/jsx-runtime");
29
+ const StyledImage = (0, import_web.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_web.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,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v1/Image.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB,8BAClB,mBAAsB,+BAQtB,aAAyC,yBAEzC,sBAAiC,yBAqH7B;AAnHJ,MAAM,kBAAc,mBAAO,oBAAAA,OAAS;AAAA,EAClC,MAAM;AACR,CAAC;AAmCD,IAAI,YAAY;AAMT,MAAM,QAAQ,YAAY,UAAsB,CAAC,SAAS,QAAQ;AACvE,QAAM,CAAC,OAAO,KAAK,QAAI,6BAAiB,OAAO,GACzC,EAAE,KAAK,QAAQ,WAAW,GAAG,KAAK,IAAI;AAE5C,EAAI,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,IACN;AAAA,EACF;AAMR,MAAI,cACF,OAAO,OAAQ,WACX;AAAA,IACE,KAAK;AAAA,IACL,GAAI,0BAAS;AAAA,MACX,OAAO,MAAM,SAAS,OAAO;AAAA,MAC7B,QAAQ,MAAM,UAAU,OAAO;AAAA,IACjC;AAAA,EACF,IACC,UAAU;AAEjB,SAAI,eAAe,OAAO,eAAgB,aAgBpC,QAAQ,IAAI,aAAa,iBAAiB,QAAQ,IAAI,6BAExD,aAAAC,QAAM,UAAU,MAAM;AACpB,mBAAe,MAAM;AACnB,UAAI,OAAO,OAAQ;AACjB,YAAI;AACF,gBAAM,MAAM,GAAG,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC;AAAA,QAC3C,QAAc;AACZ,kBAAQ,MAAM,wBAAwB,GAAG,IAAI,EAAE,MA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