@tamagui/image 2.7.7 → 3.0.0-beta.1091.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 (95) hide show
  1. package/dist/cjs/Image.cjs +24 -45
  2. package/dist/cjs/Image.native.cjs +28 -0
  3. package/dist/cjs/Image.native.js +15 -20
  4. package/dist/cjs/Image.native.js.map +1 -1
  5. package/dist/cjs/createImage.cjs +111 -145
  6. package/dist/cjs/createImage.native.cjs +132 -0
  7. package/dist/cjs/createImage.native.js +115 -145
  8. package/dist/cjs/createImage.native.js.map +1 -1
  9. package/dist/cjs/index.cjs +9 -11
  10. package/dist/cjs/index.native.cjs +21 -0
  11. package/dist/cjs/index.native.js +9 -10
  12. package/dist/cjs/index.native.js.map +1 -1
  13. package/dist/cjs/types.cjs +9 -11
  14. package/dist/cjs/types.native.cjs +18 -0
  15. package/dist/cjs/types.native.js +9 -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 +28 -0
  33. package/dist/jsx/Image.native.js +15 -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 +132 -0
  38. package/dist/jsx/createImage.native.js +115 -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 +21 -0
  43. package/dist/jsx/index.native.js +9 -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 +18 -0
  47. package/dist/jsx/types.native.js +9 -10
  48. package/dist/jsx/types.native.js.map +1 -1
  49. package/package.json +11 -8
  50. package/src/Image.tsx +5 -4
  51. package/src/createImage.tsx +100 -90
  52. package/src/types.ts +1 -1
  53. package/types/Image.d.ts.map +1 -1
  54. package/types/Image.native.d.ts +12 -13
  55. package/types/Image.native.d.ts.map +1 -1
  56. package/types/createImage.d.ts +12 -12
  57. package/types/createImage.d.ts.map +1 -1
  58. package/types/types.d.ts +1 -1
  59. package/types/types.d.ts.map +1 -1
  60. package/dist/cjs/v1/Image.cjs +0 -101
  61. package/dist/cjs/v1/Image.native.js +0 -123
  62. package/dist/cjs/v1/Image.native.js.map +0 -1
  63. package/dist/cjs/v1/index.cjs +0 -20
  64. package/dist/cjs/v1/index.native.js +0 -23
  65. package/dist/cjs/v1/index.native.js.map +0 -1
  66. package/dist/esm/index.js.map +0 -1
  67. package/dist/esm/index.mjs.map +0 -1
  68. package/dist/esm/index.native.js.map +0 -1
  69. package/dist/esm/types.mjs.map +0 -1
  70. package/dist/esm/types.native.js.map +0 -1
  71. package/dist/esm/v1/Image.mjs +0 -65
  72. package/dist/esm/v1/Image.mjs.map +0 -1
  73. package/dist/esm/v1/Image.native.js +0 -84
  74. package/dist/esm/v1/Image.native.js.map +0 -1
  75. package/dist/esm/v1/index.mjs +0 -2
  76. package/dist/esm/v1/index.mjs.map +0 -1
  77. package/dist/esm/v1/index.native.js +0 -2
  78. package/dist/esm/v1/index.native.js.map +0 -1
  79. package/dist/jsx/index.js.map +0 -1
  80. package/dist/jsx/index.mjs.map +0 -1
  81. package/dist/jsx/types.mjs.map +0 -1
  82. package/dist/jsx/v1/Image.mjs +0 -65
  83. package/dist/jsx/v1/Image.mjs.map +0 -1
  84. package/dist/jsx/v1/Image.native.js +0 -123
  85. package/dist/jsx/v1/Image.native.js.map +0 -1
  86. package/dist/jsx/v1/index.mjs +0 -2
  87. package/dist/jsx/v1/index.mjs.map +0 -1
  88. package/dist/jsx/v1/index.native.js +0 -23
  89. package/dist/jsx/v1/index.native.js.map +0 -1
  90. package/src/v1/Image.tsx +0 -144
  91. package/src/v1/index.ts +0 -1
  92. package/types/v1/Image.d.ts +0 -36
  93. package/types/v1/Image.d.ts.map +0 -1
  94. package/types/v1/index.d.ts +0 -2
  95. package/types/v1/index.d.ts.map +0 -1
@@ -1,6 +1,6 @@
1
- import { getTokenValue, styled } from '@tamagui/web'
1
+ import { createStyledHOC, getTokenValue, styled } from '@tamagui/web'
2
2
  import type { ComponentType } from 'react'
3
- import type { ImageResizeMode } from 'react-native'
3
+ import type { ImageResizeMode } from '@tamagui/react-native-types'
4
4
  import type { ImageProps, ImageType } from './types'
5
5
 
6
6
  type GetProps<T> = T extends ComponentType<infer P> ? P : never
@@ -131,7 +131,7 @@ export function createImage<C extends ComponentType<any>>(
131
131
  const StyledImage = styled(
132
132
  Component as ComponentType<any>,
133
133
  {
134
- name: 'Image',
134
+ displayName: 'Image',
135
135
  },
136
136
  {
137
137
  inlineProps: inlinePropsSet,
@@ -141,100 +141,110 @@ export function createImage<C extends ComponentType<any>>(
141
141
  // Combined props: ImageProps (Tamagui) + Component's native props
142
142
  type CombinedProps = ImageProps & Omit<GetProps<C>, keyof ImageProps>
143
143
 
144
- const ImageComponent = StyledImage.styleable<CombinedProps>((incomingProps, ref) => {
145
- const props = incomingProps as any
146
- const {
147
- src,
148
- source,
149
- width,
150
- height,
151
- borderRadius,
152
- objectFit,
153
- objectPosition,
154
- // web only props - filter out on native
155
- decoding,
156
- elementTiming,
157
- fetchpriority,
158
- isMap,
159
- loading,
160
- sizes,
161
- useMap,
162
- onLoad,
163
- onError,
164
- ...rest
165
- } = props
166
-
167
- const resolvedWidth =
168
- typeof width === 'string' && width[0] === '$'
169
- ? getTokenValue(width as any, 'size')
170
- : width
171
- const resolvedHeight =
172
- typeof height === 'string' && height[0] === '$'
173
- ? getTokenValue(height as any, 'size')
174
- : height
175
-
176
- const finalSource = transformSource({
177
- src,
178
- source,
179
- width: resolvedWidth,
180
- height: resolvedHeight,
181
- })
182
-
183
- const incomingStyle = Array.isArray(rest.style)
184
- ? Object.assign({}, ...rest.style.flat())
185
- : rest.style
186
-
187
- const resolvedBorderRadius =
188
- typeof borderRadius === 'string' && borderRadius[0] === '$'
189
- ? getTokenValue(borderRadius as any, 'radius')
190
- : borderRadius
191
-
192
- const finalProps: any = {
193
- ...rest,
194
- source: finalSource,
195
- style: {
196
- ...incomingStyle,
197
- ...(resolvedBorderRadius !== undefined && { borderRadius: resolvedBorderRadius }),
198
- ...(resolvedWidth !== undefined && { width: resolvedWidth }),
199
- ...(resolvedHeight !== undefined && { height: resolvedHeight }),
200
- },
201
- }
144
+ const ImageComponent = createStyledHOC(
145
+ StyledImage,
146
+ (incomingProps: CombinedProps, ref) => {
147
+ const props = incomingProps as any
148
+ const {
149
+ src,
150
+ source,
151
+ width,
152
+ height,
153
+ borderRadius,
154
+ objectFit,
155
+ objectPosition,
156
+ // web only props - filter out on native
157
+ decoding,
158
+ elementTiming,
159
+ fetchpriority,
160
+ isMap,
161
+ loading,
162
+ sizes,
163
+ useMap,
164
+ onLoad,
165
+ onError,
166
+ ...rest
167
+ } = props
202
168
 
203
- // Set resize mode / content fit
204
- if (objectFit) {
205
- finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit)
206
- }
169
+ const resolvedWidth =
170
+ typeof width === 'string' ? (getTokenValue(width as any, 'size') ?? width) : width
171
+ const resolvedHeight =
172
+ typeof height === 'string'
173
+ ? (getTokenValue(height as any, 'size') ?? height)
174
+ : height
207
175
 
208
- // Add object position if supported
209
- if (objectPositionPropName && objectPosition) {
210
- finalProps[objectPositionPropName] = objectPosition
211
- }
176
+ const finalSource = transformSource({
177
+ src,
178
+ source,
179
+ width: resolvedWidth,
180
+ height: resolvedHeight,
181
+ })
182
+
183
+ const incomingStyle = Array.isArray(rest.style)
184
+ ? Object.assign({}, ...rest.style.flat())
185
+ : rest.style
212
186
 
213
- // Normalize onLoad event
214
- if (onLoad) {
215
- finalProps.onLoad = (e: any) => {
216
- const source = e?.nativeEvent?.source || e?.source || {}
217
- onLoad({
218
- target: {
219
- naturalHeight: source?.height,
220
- naturalWidth: source?.width,
221
- },
222
- type: 'load',
223
- } as any)
187
+ const resolvedBorderRadius =
188
+ typeof borderRadius === 'string'
189
+ ? (getTokenValue(borderRadius as any, 'radius') ?? borderRadius)
190
+ : borderRadius
191
+
192
+ const finalProps: any = {
193
+ ...rest,
194
+ source: finalSource,
195
+ style: {
196
+ ...incomingStyle,
197
+ ...(resolvedBorderRadius !== undefined && {
198
+ borderRadius: resolvedBorderRadius,
199
+ }),
200
+ ...(resolvedWidth !== undefined && { width: resolvedWidth }),
201
+ ...(resolvedHeight !== undefined && { height: resolvedHeight }),
202
+ // RN 0.76+ reads objectFit from style natively on Image; harmless on older.
203
+ // Also forwarded to the resize-mode prop below for back-compat / non-RN components.
204
+ ...(objectFit !== undefined && { objectFit }),
205
+ // RN doesn't currently read objectPosition from style; expo-image uses
206
+ // contentPosition (handled via objectPositionPropName below). Forwarding
207
+ // through style is a no-op there but matches CSS shape and is forward-compatible.
208
+ ...(objectPosition !== undefined && { objectPosition }),
209
+ },
224
210
  }
225
- }
226
211
 
227
- // Normalize onError event
228
- if (onError) {
229
- finalProps.onError = () => {
230
- onError({
231
- type: 'error',
232
- } as any)
212
+ // Set resize mode / content fit
213
+ if (objectFit) {
214
+ finalProps[resizeModePropName] = mapObjectFitToResizeMode(objectFit)
233
215
  }
234
- }
235
216
 
236
- return <StyledImage ref={ref} {...finalProps} />
237
- }) as unknown as ImageType & React.FC<CombinedProps>
217
+ // Add object position if supported (e.g. expo-image's contentPosition)
218
+ if (objectPositionPropName && objectPosition) {
219
+ finalProps[objectPositionPropName] = objectPosition
220
+ }
221
+
222
+ // Normalize onLoad event
223
+ if (onLoad) {
224
+ finalProps.onLoad = (e: any) => {
225
+ const source = e?.nativeEvent?.source || e?.source || {}
226
+ onLoad({
227
+ target: {
228
+ naturalHeight: source?.height,
229
+ naturalWidth: source?.width,
230
+ },
231
+ type: 'load',
232
+ } as any)
233
+ }
234
+ }
235
+
236
+ // Normalize onError event
237
+ if (onError) {
238
+ finalProps.onError = () => {
239
+ onError({
240
+ type: 'error',
241
+ } as any)
242
+ }
243
+ }
244
+
245
+ return <StyledImage ref={ref} {...finalProps} />
246
+ }
247
+ ) as unknown as ImageType & React.FC<CombinedProps>
238
248
 
239
249
  // Add static methods if the component has them
240
250
  const comp = Component as any
package/src/types.ts CHANGED
@@ -4,7 +4,7 @@ import type {
4
4
  ImageSourcePropType,
5
5
  Image as RNImage,
6
6
  ImageProps as RNImageProps,
7
- } from 'react-native'
7
+ } from '@tamagui/react-native-types'
8
8
 
9
9
  type RNImageType = typeof RNImage
10
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,SAAS,CAAA;AAOpD,eAAO,MAAM,KAAK,EAuBF,SAAS,CAAA"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,SAAS,CAAA;AAOpD,eAAO,MAAM,KAAK,EAwBF,SAAS,CAAA"}
@@ -1,16 +1,15 @@
1
- import { Image as RNImage } from 'react-native';
2
1
  export declare const Image: import("react").FC<Partial<import("./types").ImageProps>> & {
3
- getSize: typeof RNImage.getSize;
4
- getSizeWithHeaders: typeof RNImage.getSizeWithHeaders;
5
- prefetch: typeof RNImage.prefetch;
6
- prefetchWithMetadata: typeof RNImage.prefetchWithMetadata;
7
- abortPrefetch: typeof RNImage.abortPrefetch | undefined;
8
- queryCache: typeof RNImage.queryCache | undefined;
9
- } & import("react").FC<import("@tamagui/web").StackNonStyleProps & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> & import("@tamagui/web").WithMediaProps<import("@tamagui/web").WithThemeShorthandsAndPseudos<import("@tamagui/web").StackStyleBase, {}>> & Omit<import("react-native").ImageProps, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "source" | "resizeMode"> & {
2
+ getSize: typeof import("@tamagui/react-native-types/src").Image.getSize;
3
+ getSizeWithHeaders: typeof import("@tamagui/react-native-types/src").Image.getSizeWithHeaders;
4
+ prefetch: typeof import("@tamagui/react-native-types/src").Image.prefetch;
5
+ prefetchWithMetadata: typeof import("@tamagui/react-native-types/src").Image.prefetchWithMetadata;
6
+ abortPrefetch: typeof import("@tamagui/react-native-types/src").Image.abortPrefetch | undefined;
7
+ queryCache: typeof import("@tamagui/react-native-types/src").Image.queryCache | undefined;
8
+ } & import("react").FC<import("@tamagui/web").StackNonStyleProps & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & Omit<import("@tamagui/react-native-types/src").ImageProps, "resizeMode" | "source" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase> & {
10
9
  src?: string | number;
11
- source?: import("react-native").ImageSourcePropType;
12
- resizeMode?: import("react-native").ImageResizeMode;
13
- objectFit?: React.CSSProperties["objectFit"];
14
- objectPosition?: React.CSSProperties["objectPosition"];
15
- } & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "src"> & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "style" | "height" | "width" | "src"> & Omit<import("react-native").ImageProps, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | "onLayout" | "rel" | "dir" | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "source" | "resizeMode" | "onError" | "onLoad" | "onLoadEnd" | "onLoadStart" | "progressiveRenderingEnabled" | "src" | "srcSet" | "loadingIndicatorSource" | "defaultSource" | "alt" | "crossOrigin" | "tintColor" | "referrerPolicy" | "blurRadius" | "capInsets" | "onProgress" | "onPartialLoad" | "resizeMethod" | "fadeDuration" | "objectPosition" | "decoding" | "fetchPriority" | "loading" | "sizes" | "useMap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "lang" | "nonce" | "slot" | "spellCheck" | "title" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "onCopyCapture" | "onCutCapture" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInputCapture" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture">>;
10
+ source?: import("@tamagui/react-native-types/src").ImageSourcePropType;
11
+ resizeMode?: import("@tamagui/react-native-types/src").ImageResizeMode;
12
+ objectFit?: React.CSSProperties['objectFit'];
13
+ objectPosition?: React.CSSProperties['objectPosition'];
14
+ } & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "src" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase> & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "height" | "src" | "style" | "width"> & Omit<import("react-native").ImageProps, "about" | "accessKey" | "alt" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoSave" | "blurRadius" | "capInsets" | "content" | "contentEditable" | "contextMenu" | "crossOrigin" | "datatype" | "decoding" | "defaultChecked" | "defaultSource" | "defaultValue" | "dir" | "draggable" | "enterKeyHint" | "exportparts" | "fadeDuration" | "fetchPriority" | "hidden" | "inert" | "inlist" | "inputMode" | "is" | "itemID" | "itemProp" | "itemRef" | "itemScope" | "itemType" | "lang" | "loading" | "loadingIndicatorSource" | "nonce" | "objectPosition" | "onAbort" | "onAbortCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAuxClick" | "onAuxClickCapture" | "onBeforeInputCapture" | "onBeforeToggle" | "onBlurCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onChangeCapture" | "onClickCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onContextMenuCapture" | "onCopyCapture" | "onCutCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onError" | "onErrorCapture" | "onFocusCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onInputCapture" | "onInvalid" | "onInvalidCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onLayout" | "onLoad" | "onLoadCapture" | "onLoadEnd" | "onLoadStart" | "onLoadStartCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onPartialLoad" | "onPasteCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onPointerOut" | "onPointerOutCapture" | "onPointerOver" | "onPointerOverCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onReset" | "onResetCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onSelect" | "onSelectCapture" | "onStalled" | "onStalledCapture" | "onSubmit" | "onSubmitCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onToggle" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onWheelCapture" | "part" | "popover" | "popoverTarget" | "popoverTargetAction" | "prefix" | "progressiveRenderingEnabled" | "property" | "radioGroup" | "referrerPolicy" | "rel" | "resizeMethod" | "resizeMode" | "resource" | "results" | "rev" | "security" | "sizes" | "slot" | "source" | "spellCheck" | "src" | "srcSet" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "tintColor" | "title" | "translate" | "typeof" | "unselectable" | "useMap" | "vocab" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase>>;
16
15
  //# sourceMappingURL=Image.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.native.d.ts","sourceRoot":"","sources":["../src/Image.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,cAAc,CAAA;AAG/C,eAAO,MAAM,KAAK;;;;;;;;;;;;;4vKAEhB,CAAA"}
1
+ {"version":3,"file":"Image.native.d.ts","sourceRoot":"","sources":["../src/Image.native.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;gqJAEhB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from 'react';
2
- import type { ImageResizeMode } from 'react-native';
2
+ import type { ImageResizeMode } from '@tamagui/react-native-types';
3
3
  import type { ImageProps } from './types';
4
4
  type GetProps<T> = T extends ComponentType<infer P> ? P : never;
5
5
  export type CreateImageOptions<C extends ComponentType<any>> = {
@@ -60,18 +60,18 @@ export type CreateImageOptions<C extends ComponentType<any>> = {
60
60
  * />
61
61
  */
62
62
  export declare function createImage<C extends ComponentType<any>>(options: CreateImageOptions<C>): import("react").FC<Partial<ImageProps>> & {
63
- getSize: typeof import("react-native").Image.getSize;
64
- getSizeWithHeaders: typeof import("react-native").Image.getSizeWithHeaders;
65
- prefetch: typeof import("react-native").Image.prefetch;
66
- prefetchWithMetadata: typeof import("react-native").Image.prefetchWithMetadata;
67
- abortPrefetch: typeof import("react-native").Image.abortPrefetch | undefined;
68
- queryCache: typeof import("react-native").Image.queryCache | undefined;
69
- } & import("react").FC<import("@tamagui/web").StackNonStyleProps & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> & import("@tamagui/web").WithMediaProps<import("@tamagui/web").WithThemeShorthandsAndPseudos<import("@tamagui/web").StackStyleBase, {}>> & Omit<import("react-native").ImageProps, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "source" | "resizeMode"> & {
63
+ getSize: typeof import("@tamagui/react-native-types").Image.getSize;
64
+ getSizeWithHeaders: typeof import("@tamagui/react-native-types").Image.getSizeWithHeaders;
65
+ prefetch: typeof import("@tamagui/react-native-types").Image.prefetch;
66
+ prefetchWithMetadata: typeof import("@tamagui/react-native-types").Image.prefetchWithMetadata;
67
+ abortPrefetch: typeof import("@tamagui/react-native-types").Image.abortPrefetch | undefined;
68
+ queryCache: typeof import("@tamagui/react-native-types").Image.queryCache | undefined;
69
+ } & import("react").FC<import("@tamagui/web").StackNonStyleProps & import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithFlatVariantValues<{}> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>> & Omit<import("@tamagui/react-native-types").ImageProps, "resizeMode" | "source" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase> & {
70
70
  src?: string | number;
71
- source?: import("react-native").ImageSourcePropType;
71
+ source?: import("@tamagui/react-native-types").ImageSourcePropType;
72
72
  resizeMode?: ImageResizeMode;
73
- objectFit?: React.CSSProperties["objectFit"];
74
- objectPosition?: React.CSSProperties["objectPosition"];
75
- } & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "src"> & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "style" | "height" | "width" | "src"> & Omit<GetProps<C>, `$${string}` | `$${number}` | import("@tamagui/web").GroupMediaKeys | "onLayout" | "rel" | "dir" | keyof import("@tamagui/web").StackStyleBase | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").WithPseudoProps<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase> & import("@tamagui/web").WithShorthands<import("@tamagui/web").WithThemeValues<import("@tamagui/web").StackStyleBase>>> | "source" | "resizeMode" | "onError" | "onLoad" | "onLoadEnd" | "onLoadStart" | "progressiveRenderingEnabled" | "src" | "srcSet" | "loadingIndicatorSource" | "defaultSource" | "alt" | "crossOrigin" | "tintColor" | "referrerPolicy" | "blurRadius" | "capInsets" | "onProgress" | "onPartialLoad" | "resizeMethod" | "fadeDuration" | "objectPosition" | "decoding" | "fetchPriority" | "loading" | "sizes" | "useMap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "enterKeyHint" | "hidden" | "lang" | "nonce" | "slot" | "spellCheck" | "title" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "onCopyCapture" | "onCutCapture" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInputCapture" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture">>;
73
+ objectFit?: React.CSSProperties['objectFit'];
74
+ objectPosition?: React.CSSProperties['objectPosition'];
75
+ } & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "src" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase> & Omit<import("react").ImgHTMLAttributes<HTMLImageElement>, "height" | "src" | "style" | "width"> & Omit<GetProps<C>, "about" | "accessKey" | "alt" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-level" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-setsize" | "aria-sort" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "autoSave" | "blurRadius" | "capInsets" | "content" | "contentEditable" | "contextMenu" | "crossOrigin" | "datatype" | "decoding" | "defaultChecked" | "defaultSource" | "defaultValue" | "dir" | "draggable" | "enterKeyHint" | "exportparts" | "fadeDuration" | "fetchPriority" | "hidden" | "inert" | "inlist" | "inputMode" | "is" | "itemID" | "itemProp" | "itemRef" | "itemScope" | "itemType" | "lang" | "loading" | "loadingIndicatorSource" | "nonce" | "objectPosition" | "onAbort" | "onAbortCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAuxClick" | "onAuxClickCapture" | "onBeforeInputCapture" | "onBeforeToggle" | "onBlurCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onChangeCapture" | "onClickCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onContextMenuCapture" | "onCopyCapture" | "onCutCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onError" | "onErrorCapture" | "onFocusCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onInputCapture" | "onInvalid" | "onInvalidCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUpCapture" | "onLayout" | "onLoad" | "onLoadCapture" | "onLoadEnd" | "onLoadStart" | "onLoadStartCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onPartialLoad" | "onPasteCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onPointerOut" | "onPointerOutCapture" | "onPointerOver" | "onPointerOverCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onReset" | "onResetCapture" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onSelect" | "onSelectCapture" | "onStalled" | "onStalledCapture" | "onSubmit" | "onSubmitCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onToggle" | "onTouchCancelCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onWheelCapture" | "part" | "popover" | "popoverTarget" | "popoverTargetAction" | "prefix" | "progressiveRenderingEnabled" | "property" | "radioGroup" | "referrerPolicy" | "rel" | "resizeMethod" | "resizeMode" | "resource" | "results" | "rev" | "security" | "sizes" | "slot" | "source" | "spellCheck" | "src" | "srcSet" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "tintColor" | "title" | "translate" | "typeof" | "unselectable" | "useMap" | "vocab" | keyof import("@tamagui/web").StackNonStyleProps | keyof import("@tamagui/web").StackStyleBase>>;
76
76
  export {};
77
77
  //# sourceMappingURL=createImage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createImage.d.ts","sourceRoot":"","sources":["../src/createImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,SAAS,CAAA;AAEpD,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE/D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAAI;IAC7D;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;IACxD;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QACxB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QACrB,MAAM,CAAC,EAAE,GAAG,CAAA;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,MAAM,CAAC,EAAE,GAAG,CAAA;KACb,KAAK,GAAG,CAAA;CACV,CAAA;AAoCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EACtD,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;;;;;;;;;;;;;uuKAoJ/B"}
1
+ {"version":3,"file":"createImage.d.ts","sourceRoot":"","sources":["../src/createImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,SAAS,CAAA;AAEpD,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE/D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAAI;IAC7D;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;IACxD;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QACxB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QACrB,MAAM,CAAC,EAAE,GAAG,CAAA;QACZ,KAAK,CAAC,EAAE,GAAG,CAAA;QACX,MAAM,CAAC,EAAE,GAAG,CAAA;KACb,KAAK,GAAG,CAAA;CACV,CAAA;AAoCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,EACtD,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC;;;;;;;;;;;;;mnJA8J/B"}
package/types/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ViewProps } from '@tamagui/web';
2
- import type { ImageResizeMode, ImageSourcePropType, Image as RNImage, ImageProps as RNImageProps } from 'react-native';
2
+ import type { ImageResizeMode, ImageSourcePropType, Image as RNImage, ImageProps as RNImageProps } from '@tamagui/react-native-types';
3
3
  type RNImageType = typeof RNImage;
4
4
  type KeyofViewProps = keyof ViewProps;
5
5
  export type ImageProps = ViewProps & Omit<RNImageProps, KeyofViewProps | 'source' | 'resizeMode' | 'style'> & {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,KAAK,IAAI,OAAO,EAChB,UAAU,IAAI,YAAY,EAC3B,MAAM,cAAc,CAAA;AAErB,KAAK,WAAW,GAAG,OAAO,OAAO,CAAA;AAEjC,KAAK,cAAc,GAAG,MAAM,SAAS,CAAA;AAErC,MAAM,MAAM,UAAU,GAAG,SAAS,GAChC,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG;IACvE;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;IAC5C;;;;OAIG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;CACvD,GAAG,IAAI,CACN,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EACzC,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,KAAK,CAC5C,GACD,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,CAAA;AAEvF,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG;IACtD,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC/B,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAA;IACrD,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACjC,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAAA;IACzD,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC3C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CACtC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,KAAK,IAAI,OAAO,EAChB,UAAU,IAAI,YAAY,EAC3B,MAAM,6BAA6B,CAAA;AAEpC,KAAK,WAAW,GAAG,OAAO,OAAO,CAAA;AAEjC,KAAK,cAAc,GAAG,MAAM,SAAS,CAAA;AAErC,MAAM,MAAM,UAAU,GAAG,SAAS,GAChC,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG;IACvE;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;IAC5C;;;;OAIG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAA;CACvD,GAAG,IAAI,CACN,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EACzC,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,KAAK,CAC5C,GACD,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,CAAA;AAEvF,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG;IACtD,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAC/B,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAA;IACrD,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IACjC,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAAA;IACzD,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,CAAA;IAC3C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CACtC,CAAA"}
@@ -1,101 +0,0 @@
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
- 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: true
11
- });
12
- };
13
- 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;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
34
- var Image_exports = {};
35
- __export(Image_exports, {
36
- Image: () => Image
37
- });
38
- module.exports = __toCommonJS(Image_exports);
39
- var import_react = __toESM(require("react"), 1);
40
- var import_constants = require("@tamagui/constants");
41
- var import_web = require("@tamagui/web");
42
- var import_react_native = require("react-native-web");
43
- var import_jsx_runtime = require("react/jsx-runtime");
44
- const StyledImage = (0, import_web.styled)(import_react_native.Image, {
45
- name: "Image"
46
- });
47
- let hasWarned = false;
48
- const Image = StyledImage.styleable((inProps, ref) => {
49
- const [props, style] = (0, import_web.usePropsAndStyle)(inProps);
50
- const {
51
- src,
52
- source,
53
- objectFit,
54
- ...rest
55
- } = props;
56
- if (process.env.NODE_ENV === "development") {
57
- if (typeof src === "string") {
58
- if (typeof props.width === "string" && props.width[0] !== "$" || typeof props.height === "string" && props.height[0] !== "$") {
59
- if (!hasWarned) {
60
- hasWarned = true;
61
- 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.`);
62
- }
63
- }
64
- }
65
- }
66
- let finalSource = typeof src === "string" ? {
67
- uri: src,
68
- ...(import_constants.isWeb && {
69
- width: props.width || style?.width,
70
- height: props.height || style?.height
71
- })
72
- } : source ?? src;
73
- if (finalSource && typeof finalSource === "object") {
74
- if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_IMAGE_CHECK_ERROR) import_react.default.useEffect(() => {
75
- async function run() {
76
- if (typeof src === "string") try {
77
- await fetch(src).then(res => res.text());
78
- } catch (err) {
79
- console.error(`Error loading image: ${src}`, {
80
- props
81
- });
82
- }
83
- }
84
- run();
85
- }, [src]);
86
- if (finalSource["default"]) finalSource = finalSource["default"];
87
- }
88
- return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native.Image, {
89
- resizeMode: objectFit,
90
- ref,
91
- source: finalSource,
92
- style,
93
- ...rest
94
- });
95
- });
96
- Image.getSize = import_react_native.Image.getSize;
97
- Image.getSizeWithHeaders = import_react_native.Image.getSizeWithHeaders;
98
- Image.prefetch = import_react_native.Image.prefetch;
99
- Image.prefetchWithMetadata = import_react_native.Image.prefetchWithMetadata;
100
- Image.abortPrefetch = import_react_native.Image.abortPrefetch;
101
- Image.queryCache = import_react_native.Image.queryCache;