@tamagui/image 2.7.7 → 3.0.0-beta.643.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.
Files changed (92) hide show
  1. package/dist/cjs/Image.cjs +25 -45
  2. package/dist/cjs/Image.native.cjs +29 -0
  3. package/dist/cjs/Image.native.js +16 -20
  4. package/dist/cjs/Image.native.js.map +1 -1
  5. package/dist/cjs/createImage.cjs +112 -145
  6. package/dist/cjs/createImage.native.cjs +133 -0
  7. package/dist/cjs/createImage.native.js +116 -145
  8. package/dist/cjs/createImage.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +10 -11
  10. package/dist/cjs/index.native.cjs +22 -0
  11. package/dist/cjs/index.native.js +10 -10
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +10 -11
  14. package/dist/cjs/types.native.cjs +19 -0
  15. package/dist/cjs/types.native.js +10 -10
  16. package/dist/cjs/types.native.js.map +1 -1
  17. package/dist/esm/Image.mjs +13 -28
  18. package/dist/esm/Image.mjs.map +1 -1
  19. package/dist/esm/Image.native.js +4 -4
  20. package/dist/esm/Image.native.js.map +1 -1
  21. package/dist/esm/createImage.mjs +100 -128
  22. package/dist/esm/createImage.mjs.map +1 -1
  23. package/dist/esm/createImage.native.js +105 -130
  24. package/dist/esm/createImage.native.js.map +1 -1
  25. package/dist/esm/index.js +3 -3
  26. package/dist/esm/index.mjs +3 -3
  27. package/dist/esm/index.native.js +3 -3
  28. package/dist/esm/types.mjs +0 -2
  29. package/dist/esm/types.native.js +0 -2
  30. package/dist/jsx/Image.mjs +13 -28
  31. package/dist/jsx/Image.mjs.map +1 -1
  32. package/dist/jsx/Image.native.cjs +29 -0
  33. package/dist/jsx/Image.native.js +16 -20
  34. package/dist/jsx/Image.native.js.map +1 -1
  35. package/dist/jsx/createImage.mjs +100 -128
  36. package/dist/jsx/createImage.mjs.map +1 -1
  37. package/dist/jsx/createImage.native.cjs +133 -0
  38. package/dist/jsx/createImage.native.js +116 -145
  39. package/dist/jsx/createImage.native.js.map +1 -1
  40. package/dist/jsx/index.js +3 -3
  41. package/dist/jsx/index.mjs +3 -3
  42. package/dist/jsx/index.native.cjs +22 -0
  43. package/dist/jsx/index.native.js +10 -10
  44. package/dist/jsx/index.native.js.map +1 -1
  45. package/dist/jsx/types.mjs +0 -2
  46. package/dist/jsx/types.native.cjs +19 -0
  47. package/dist/jsx/types.native.js +10 -10
  48. package/dist/jsx/types.native.js.map +1 -1
  49. package/package.json +8 -7
  50. package/src/Image.tsx +5 -4
  51. package/src/createImage.tsx +99 -89
  52. package/types/Image.d.ts.map +1 -1
  53. package/types/Image.native.d.ts +4 -4
  54. package/types/Image.native.d.ts.map +1 -1
  55. package/types/createImage.d.ts +4 -4
  56. package/types/createImage.d.ts.map +1 -1
  57. package/dist/cjs/v1/Image.cjs +0 -101
  58. package/dist/cjs/v1/Image.native.js +0 -123
  59. package/dist/cjs/v1/Image.native.js.map +0 -1
  60. package/dist/cjs/v1/index.cjs +0 -20
  61. package/dist/cjs/v1/index.native.js +0 -23
  62. package/dist/cjs/v1/index.native.js.map +0 -1
  63. package/dist/esm/index.js.map +0 -1
  64. package/dist/esm/index.mjs.map +0 -1
  65. package/dist/esm/index.native.js.map +0 -1
  66. package/dist/esm/types.mjs.map +0 -1
  67. package/dist/esm/types.native.js.map +0 -1
  68. package/dist/esm/v1/Image.mjs +0 -65
  69. package/dist/esm/v1/Image.mjs.map +0 -1
  70. package/dist/esm/v1/Image.native.js +0 -84
  71. package/dist/esm/v1/Image.native.js.map +0 -1
  72. package/dist/esm/v1/index.mjs +0 -2
  73. package/dist/esm/v1/index.mjs.map +0 -1
  74. package/dist/esm/v1/index.native.js +0 -2
  75. package/dist/esm/v1/index.native.js.map +0 -1
  76. package/dist/jsx/index.js.map +0 -1
  77. package/dist/jsx/index.mjs.map +0 -1
  78. package/dist/jsx/types.mjs.map +0 -1
  79. package/dist/jsx/v1/Image.mjs +0 -65
  80. package/dist/jsx/v1/Image.mjs.map +0 -1
  81. package/dist/jsx/v1/Image.native.js +0 -123
  82. package/dist/jsx/v1/Image.native.js.map +0 -1
  83. package/dist/jsx/v1/index.mjs +0 -2
  84. package/dist/jsx/v1/index.mjs.map +0 -1
  85. package/dist/jsx/v1/index.native.js +0 -23
  86. package/dist/jsx/v1/index.native.js.map +0 -1
  87. package/src/v1/Image.tsx +0 -144
  88. package/src/v1/index.ts +0 -1
  89. package/types/v1/Image.d.ts +0 -36
  90. package/types/v1/Image.d.ts.map +0 -1
  91. package/types/v1/index.d.ts +0 -2
  92. package/types/v1/index.d.ts.map +0 -1
@@ -1,164 +1,135 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
12
13
  };
13
14
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
21
22
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
24
  var createImage_exports = {};
26
- __export(createImage_exports, {
27
- createImage: () => createImage
28
- });
25
+ __export(createImage_exports, { createImage: () => createImage });
29
26
  module.exports = __toCommonJS(createImage_exports);
30
27
  var import_jsx_runtime = require("react/jsx-runtime");
31
28
  var import_web = require("@tamagui/web");
32
- var defaultObjectFitMap = function (objectFit) {
33
- switch (objectFit) {
34
- case "fill":
35
- return "stretch";
36
- case "none":
37
- return "center";
38
- case "scale-down":
39
- return "contain";
40
- case "contain":
41
- return "contain";
42
- default:
43
- return "cover";
44
- }
29
+ var defaultObjectFitMap = function(objectFit) {
30
+ switch (objectFit) {
31
+ case "fill": return "stretch";
32
+ case "none": return "center";
33
+ case "scale-down": return "contain";
34
+ case "contain": return "contain";
35
+ default: return "cover";
36
+ }
45
37
  };
46
- var defaultTransformSource = function (props) {
47
- var {
48
- src,
49
- source
50
- } = props;
51
- if (typeof src === "string") {
52
- return {
53
- uri: src
54
- };
55
- }
56
- if (source !== void 0 && source !== null) return source;
57
- if (src !== void 0 && src !== null) return src;
58
- return {
59
- uri: src
60
- };
38
+ var defaultTransformSource = function(props) {
39
+ var { src, source } = props;
40
+ if (typeof src === "string") {
41
+ return { uri: src };
42
+ }
43
+ if (source !== void 0 && source !== null) return source;
44
+ if (src !== void 0 && src !== null) return src;
45
+ return { uri: src };
61
46
  };
62
47
  function createImage(options) {
63
- var {
64
- Component,
65
- mapObjectFitToResizeMode = defaultObjectFitMap,
66
- resizeModePropName = "resizeMode",
67
- objectPositionPropName,
68
- transformSource = defaultTransformSource
69
- } = options;
70
- var inlinePropsSet = /* @__PURE__ */new Set(["source", "placeholder", "transition", "contentFit", "contentPosition", "cachePolicy", "recyclingKey", "allowDownscaling", "autoplay", "blurRadius", "priority", "placeholderContentFit", "responsivePolicy", "onLoadStart", "onProgress", "onLoadEnd"]);
71
- var StyledImage = (0, import_web.styled)(Component, {
72
- name: "Image"
73
- }, {
74
- inlineProps: inlinePropsSet
75
- });
76
- var ImageComponent = StyledImage.styleable(function (incomingProps, ref) {
77
- var props = incomingProps;
78
- var {
79
- src,
80
- source,
81
- width,
82
- height,
83
- borderRadius,
84
- objectFit,
85
- objectPosition,
86
- // web only props - filter out on native
87
- decoding,
88
- elementTiming,
89
- fetchpriority,
90
- isMap,
91
- loading,
92
- sizes,
93
- useMap,
94
- onLoad,
95
- onError,
96
- ...rest
97
- } = props;
98
- var resolvedWidth = typeof width === "string" && width[0] === "$" ? (0, import_web.getTokenValue)(width, "size") : width;
99
- var resolvedHeight = typeof height === "string" && height[0] === "$" ? (0, import_web.getTokenValue)(height, "size") : height;
100
- var finalSource = transformSource({
101
- src,
102
- source,
103
- width: resolvedWidth,
104
- height: resolvedHeight
105
- });
106
- var incomingStyle = Array.isArray(rest.style) ? Object.assign({}, ...rest.style.flat()) : rest.style;
107
- var resolvedBorderRadius = typeof borderRadius === "string" && borderRadius[0] === "$" ? (0, import_web.getTokenValue)(borderRadius, "radius") : borderRadius;
108
- var finalProps = {
109
- ...rest,
110
- source: finalSource,
111
- style: {
112
- ...incomingStyle,
113
- ...(resolvedBorderRadius !== void 0 && {
114
- borderRadius: resolvedBorderRadius
115
- }),
116
- ...(resolvedWidth !== void 0 && {
117
- width: resolvedWidth
118
- }),
119
- ...(resolvedHeight !== void 0 && {
120
- height: resolvedHeight
121
- })
122
- }
123
- };
124
- if (objectFit) {
125
- finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit);
126
- }
127
- if (objectPositionPropName && objectPosition) {
128
- finalProps[objectPositionPropName] = objectPosition;
129
- }
130
- if (onLoad) {
131
- finalProps.onLoad = function (e) {
132
- var _e_nativeEvent;
133
- var source2 = (e === null || e === void 0 ? void 0 : (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.source) || (e === null || e === void 0 ? void 0 : e.source) || {};
134
- onLoad({
135
- target: {
136
- naturalHeight: source2 === null || source2 === void 0 ? void 0 : source2.height,
137
- naturalWidth: source2 === null || source2 === void 0 ? void 0 : source2.width
138
- },
139
- type: "load"
140
- });
141
- };
142
- }
143
- if (onError) {
144
- finalProps.onError = function () {
145
- onError({
146
- type: "error"
147
- });
148
- };
149
- }
150
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(StyledImage, {
151
- ref,
152
- ...finalProps
153
- });
154
- });
155
- var comp = Component;
156
- ImageComponent.getSize = comp.getSize || function () {};
157
- ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || function () {};
158
- ImageComponent.prefetch = comp.prefetch || function () {};
159
- ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || function () {};
160
- ImageComponent.abortPrefetch = comp.abortPrefetch || function () {};
161
- ImageComponent.queryCache = comp.queryCache || function () {};
162
- return ImageComponent;
48
+ var { Component, mapObjectFitToResizeMode = defaultObjectFitMap, resizeModePropName = "resizeMode", objectPositionPropName, transformSource = defaultTransformSource } = options;
49
+ var inlinePropsSet = /* @__PURE__ */ new Set([
50
+ "source",
51
+ "placeholder",
52
+ "transition",
53
+ "contentFit",
54
+ "contentPosition",
55
+ "cachePolicy",
56
+ "recyclingKey",
57
+ "allowDownscaling",
58
+ "autoplay",
59
+ "blurRadius",
60
+ "priority",
61
+ "placeholderContentFit",
62
+ "responsivePolicy",
63
+ "onLoadStart",
64
+ "onProgress",
65
+ "onLoadEnd"
66
+ ]);
67
+ var StyledImage = (0, import_web.styled)(Component, { displayName: "Image" }, { inlineProps: inlinePropsSet });
68
+ var ImageComponent = (0, import_web.createStyledHOC)(StyledImage, function(incomingProps, ref) {
69
+ var props = incomingProps;
70
+ var { src, source, width, height, borderRadius, objectFit, objectPosition, decoding, elementTiming, fetchpriority, isMap, loading, sizes, useMap, onLoad, onError, ...rest } = props;
71
+ var _getTokenValue;
72
+ var resolvedWidth = typeof width === "string" ? (_getTokenValue = (0, import_web.getTokenValue)(width, "size")) !== null && _getTokenValue !== void 0 ? _getTokenValue : width : width;
73
+ var _getTokenValue1;
74
+ var resolvedHeight = typeof height === "string" ? (_getTokenValue1 = (0, import_web.getTokenValue)(height, "size")) !== null && _getTokenValue1 !== void 0 ? _getTokenValue1 : height : height;
75
+ var finalSource = transformSource({
76
+ src,
77
+ source,
78
+ width: resolvedWidth,
79
+ height: resolvedHeight
80
+ });
81
+ var incomingStyle = Array.isArray(rest.style) ? Object.assign({}, ...rest.style.flat()) : rest.style;
82
+ var _getTokenValue2;
83
+ var resolvedBorderRadius = typeof borderRadius === "string" ? (_getTokenValue2 = (0, import_web.getTokenValue)(borderRadius, "radius")) !== null && _getTokenValue2 !== void 0 ? _getTokenValue2 : borderRadius : borderRadius;
84
+ var finalProps = {
85
+ ...rest,
86
+ source: finalSource,
87
+ style: {
88
+ ...incomingStyle,
89
+ ...resolvedBorderRadius !== void 0 && { borderRadius: resolvedBorderRadius },
90
+ ...resolvedWidth !== void 0 && { width: resolvedWidth },
91
+ ...resolvedHeight !== void 0 && { height: resolvedHeight },
92
+ ...objectFit !== void 0 && { objectFit },
93
+ ...objectPosition !== void 0 && { objectPosition }
94
+ }
95
+ };
96
+ if (objectFit) {
97
+ finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit);
98
+ }
99
+ if (objectPositionPropName && objectPosition) {
100
+ finalProps[objectPositionPropName] = objectPosition;
101
+ }
102
+ if (onLoad) {
103
+ finalProps.onLoad = function(e) {
104
+ var _e_nativeEvent;
105
+ var source2 = (e === null || e === void 0 ? void 0 : (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.source) || (e === null || e === void 0 ? void 0 : e.source) || {};
106
+ onLoad({
107
+ target: {
108
+ naturalHeight: source2 === null || source2 === void 0 ? void 0 : source2.height,
109
+ naturalWidth: source2 === null || source2 === void 0 ? void 0 : source2.width
110
+ },
111
+ type: "load"
112
+ });
113
+ };
114
+ }
115
+ if (onError) {
116
+ finalProps.onError = function() {
117
+ onError({ type: "error" });
118
+ };
119
+ }
120
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, {
121
+ ref,
122
+ ...finalProps
123
+ });
124
+ });
125
+ var comp = Component;
126
+ ImageComponent.getSize = comp.getSize || function() {};
127
+ ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || function() {};
128
+ ImageComponent.prefetch = comp.prefetch || function() {};
129
+ ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || function() {};
130
+ ImageComponent.abortPrefetch = comp.abortPrefetch || function() {};
131
+ ImageComponent.queryCache = comp.queryCache || function() {};
132
+ return ImageComponent;
163
133
  }
134
+
164
135
  //# sourceMappingURL=createImage.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","createImage_exports","createImage","module","exports","import_jsx_runtime","require","import_web","defaultObjectFitMap","objectFit","defaultTransformSource","props","src","source","uri","options","Component","mapObjectFitToResizeMode","resizeModePropName","objectPositionPropName","transformSource","inlinePropsSet","Set","StyledImage","styled","inlineProps","ImageComponent","styleable","incomingProps","ref","width","height","borderRadius","objectPosition","decoding","elementTiming","fetchpriority","isMap","loading","sizes","useMap","onLoad","onError","rest","resolvedWidth","getTokenValue","resolvedHeight","finalSource","incomingStyle","Array","isArray","style","assign","flat","resolvedBorderRadius","finalProps","e","_e_nativeEvent","source2","nativeEvent","naturalHeight","naturalWidth","type"],"sources":["../../src/createImage.tsx"],"sourcesContent":[null],"mappings":"AAAA,YAAS;;AA2OE,IAAAA,SAAA,GAAAC,MAAA,CAAAC,cAAA;AAjMX,IAAAC,gBAAM,GAAAF,MAAuB,CAAAG,wBAAuC;AAClE,IAAAC,iBAAmB,GAAAJ,MAAA,CAAAK,mBAAA;AAAA,IACjBC,YAAK,GAAAN,MAAA,CAAAO,SAAA,CAAAC,cAAA;AACH,IAAAC,QAAA,GAAOA,CAAAC,MAAA,EAAAC,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OAAO;UACToB,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"createImage.native.js","names":[],"sources":["jsx/createImage.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createImage_exports = {};\n__export(createImage_exports, {\n createImage: () => createImage\n});\nmodule.exports = __toCommonJS(createImage_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar defaultObjectFitMap = function(objectFit) {\n switch (objectFit) {\n case \"fill\":\n return \"stretch\";\n case \"none\":\n return \"center\";\n case \"scale-down\":\n return \"contain\";\n case \"contain\":\n return \"contain\";\n default:\n return \"cover\";\n }\n};\nvar defaultTransformSource = function(props) {\n var { src, source } = props;\n if (typeof src === \"string\") {\n return {\n uri: src\n };\n }\n if (source !== void 0 && source !== null) return source;\n if (src !== void 0 && src !== null) return src;\n return {\n uri: src\n };\n};\nfunction createImage(options) {\n var { Component, mapObjectFitToResizeMode = defaultObjectFitMap, resizeModePropName = \"resizeMode\", objectPositionPropName, transformSource = defaultTransformSource } = options;\n var inlinePropsSet = /* @__PURE__ */ new Set([\n \"source\",\n \"placeholder\",\n \"transition\",\n \"contentFit\",\n \"contentPosition\",\n \"cachePolicy\",\n \"recyclingKey\",\n \"allowDownscaling\",\n \"autoplay\",\n \"blurRadius\",\n \"priority\",\n \"placeholderContentFit\",\n \"responsivePolicy\",\n \"onLoadStart\",\n \"onProgress\",\n \"onLoadEnd\"\n ]);\n var StyledImage = (0, import_web.styled)(Component, {\n displayName: \"Image\"\n }, {\n inlineProps: inlinePropsSet\n });\n var ImageComponent = (0, import_web.createStyledHOC)(StyledImage, function(incomingProps, ref) {\n var props = incomingProps;\n var {\n src,\n source,\n width,\n height,\n borderRadius,\n objectFit,\n objectPosition,\n // web only props - filter out on native\n decoding,\n elementTiming,\n fetchpriority,\n isMap,\n loading,\n sizes,\n useMap,\n onLoad,\n onError,\n ...rest\n } = props;\n var _getTokenValue;\n var resolvedWidth = typeof width === \"string\" ? (_getTokenValue = (0, import_web.getTokenValue)(width, \"size\")) !== null && _getTokenValue !== void 0 ? _getTokenValue : width : width;\n var _getTokenValue1;\n var resolvedHeight = typeof height === \"string\" ? (_getTokenValue1 = (0, import_web.getTokenValue)(height, \"size\")) !== null && _getTokenValue1 !== void 0 ? _getTokenValue1 : height : height;\n var finalSource = transformSource({\n src,\n source,\n width: resolvedWidth,\n height: resolvedHeight\n });\n var incomingStyle = Array.isArray(rest.style) ? Object.assign({}, ...rest.style.flat()) : rest.style;\n var _getTokenValue2;\n var resolvedBorderRadius = typeof borderRadius === \"string\" ? (_getTokenValue2 = (0, import_web.getTokenValue)(borderRadius, \"radius\")) !== null && _getTokenValue2 !== void 0 ? _getTokenValue2 : borderRadius : borderRadius;\n var finalProps = {\n ...rest,\n source: finalSource,\n style: {\n ...incomingStyle,\n ...resolvedBorderRadius !== void 0 && {\n borderRadius: resolvedBorderRadius\n },\n ...resolvedWidth !== void 0 && {\n width: resolvedWidth\n },\n ...resolvedHeight !== void 0 && {\n height: resolvedHeight\n },\n // RN 0.76+ reads objectFit from style natively on Image; harmless on older.\n // Also forwarded to the resize-mode prop below for back-compat / non-RN components.\n ...objectFit !== void 0 && {\n objectFit\n },\n // RN doesn't currently read objectPosition from style; expo-image uses\n // contentPosition (handled via objectPositionPropName below). Forwarding\n // through style is a no-op there but matches CSS shape and is forward-compatible.\n ...objectPosition !== void 0 && {\n objectPosition\n }\n }\n };\n if (objectFit) {\n finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit);\n }\n if (objectPositionPropName && objectPosition) {\n finalProps[objectPositionPropName] = objectPosition;\n }\n if (onLoad) {\n finalProps.onLoad = function(e) {\n var _e_nativeEvent;\n var source2 = (e === null || e === void 0 ? void 0 : (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.source) || (e === null || e === void 0 ? void 0 : e.source) || {};\n onLoad({\n target: {\n naturalHeight: source2 === null || source2 === void 0 ? void 0 : source2.height,\n naturalWidth: source2 === null || source2 === void 0 ? void 0 : source2.width\n },\n type: \"load\"\n });\n };\n }\n if (onError) {\n finalProps.onError = function() {\n onError({\n type: \"error\"\n });\n };\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledImage, {\n ref,\n ...finalProps\n });\n });\n var comp = Component;\n ImageComponent.getSize = comp.getSize || function() {\n };\n ImageComponent.getSizeWithHeaders = comp.getSizeWithHeaders || function() {\n };\n ImageComponent.prefetch = comp.prefetch || function() {\n };\n ImageComponent.prefetchWithMetadata = comp.prefetchWithMetadata || function() {\n };\n ImageComponent.abortPrefetch = comp.abortPrefetch || function() {\n };\n ImageComponent.queryCache = comp.queryCache || function() {\n };\n return ImageComponent;\n}\n//# sourceMappingURL=createImage.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAA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ACvC;EACA,IAAI,QAAQ;GACV,WAAW,SAAS,SAAS,GAAG;IAC9B,IAAI;IACJ,IAAI,WAAW,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,KAAK,iBAAiB,EAAE,iBAAiB,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,YAAY,MAAM,QAAQ,MAAM,KAAK,IAAI,KAAK,IAAI,EAAE,WAAW,CAAC;IACtN,OAAO;KACL,QAAQ;MACN,eAAe,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;MACzE,cAAc,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;KAC1E;KACA,MAAM;IACR,CAAC;GACH;EACF;EACA,IAAI,SAAS;GACX,WAAW,UAAU,WAAW;IAC9B,QAAQ,EACN,MAAM,QACR,CAAC;GACH;EACF;EACA,OAAuB,iBAAC,GAAG,mBAAmB,KAAK,aAAa;GAC9D;GACA,GAAG;EACL,CAAC;CACH,CAAC;CACD,IAAI,OAAO;CACX,eAAe,UAAU,KAAK,WAAW,WAAW,CACpD;CACA,eAAe,qBAAqB,KAAK,sBAAsB,WAAW,CAC1E;CACA,eAAe,WAAW,KAAK,YAAY,WAAW,CACtD;CACA,eAAe,uBAAuB,KAAK,wBAAwB,WAAW,CAC9E;CACA,eAAe,gBAAgB,KAAK,iBAAiB,WAAW,CAChE;CACA,eAAe,aAAa,KAAK,cAAc,WAAW,CAC1D;CACA,OAAO;AACT"}
package/dist/jsx/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./Image.mjs";
2
- export * from "./createImage.mjs";
3
- //# sourceMappingURL=index.js.map
1
+ export * from "./Image.mjs"
2
+
3
+ export * from "./createImage.mjs"
@@ -1,3 +1,3 @@
1
- export * from "./Image.mjs";
2
- export * from "./createImage.mjs";
3
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./Image.mjs"
2
+
3
+ export * from "./createImage.mjs"
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ module.exports = __toCommonJS(index_exports);
21
+ __reExport(index_exports, require("./Image.native.js"), module.exports);
22
+ __reExport(index_exports, require("./createImage.native.js"), module.exports);
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
  var index_exports = {};
21
20
  module.exports = __toCommonJS(index_exports);
22
21
  __reExport(index_exports, require("./Image.native.js"), module.exports);
23
22
  __reExport(index_exports, require("./createImage.native.js"), module.exports);
23
+
24
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;AACA,IAAAA,SAAA,GAAcC,MAAA,CAAAC,cAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["jsx/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Image\"), module.exports);\n__reExport(index_exports, require(\"./createImage\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,mBAAS,GAAG,OAAO,OAAO;AAC5D,WAAW,eAAe,QAAQ,yBAAe,GAAG,OAAO,OAAO"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var types_exports = {};
19
+ module.exports = __toCommonJS(types_exports);
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
- value: true
18
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
18
  var types_exports = {};
20
19
  module.exports = __toCommonJS(types_exports);
20
+
21
21
  //# sourceMappingURL=types.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":[],"sourcesContent":[],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.native.js","names":[],"sources":["jsx/types.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n//# sourceMappingURL=types.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/image",
3
- "version": "2.7.7",
3
+ "version": "3.0.0-beta.643.1",
4
4
  "source": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -34,17 +34,18 @@
34
34
  "clean:build": "tamagui-build clean:build"
35
35
  },
36
36
  "dependencies": {
37
- "@tamagui/constants": "2.7.7",
38
- "@tamagui/core": "2.7.7",
39
- "@tamagui/web": "2.7.7"
37
+ "@tamagui/constants": "3.0.0-beta.643.1",
38
+ "@tamagui/core": "3.0.0-beta.643.1",
39
+ "@tamagui/web": "3.0.0-beta.643.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@tamagui/build": "2.7.7",
42
+ "@tamagui/build": "3.0.0-beta.643.1",
43
43
  "react": ">=19",
44
- "react-native": "0.83.2"
44
+ "react-native": "0.86.2"
45
45
  },
46
46
  "peerDependencies": {
47
- "react": ">=19"
47
+ "react": ">=19",
48
+ "react-native-web": "*"
48
49
  },
49
50
  "module:jsx": "dist/jsx",
50
51
  "repository": {
package/src/Image.tsx CHANGED
@@ -1,13 +1,14 @@
1
- import { View, styled } from '@tamagui/web'
1
+ import { createStyledHOC, View, styled } from '@tamagui/web'
2
2
  import type { ImageProps, ImageType } from './types'
3
3
 
4
4
  const StyledImage = styled(View, {
5
- name: 'Image',
5
+ displayName: 'Image',
6
6
  render: 'img',
7
7
  })
8
8
 
9
- export const Image = StyledImage.styleable<ImageProps>(
10
- (inProps, ref) => {
9
+ export const Image = createStyledHOC(
10
+ StyledImage,
11
+ (inProps: ImageProps, ref) => {
11
12
  const {
12
13
  // exclude native only props
13
14
  blurRadius,