|
| 1 | +diff --git a/node_modules/react-native-web/.DS_Store b/node_modules/react-native-web/.DS_Store |
| 2 | +new file mode 100644 |
| 3 | +index 0000000..9de77ec |
| 4 | +Binary files /dev/null and b/node_modules/react-native-web/.DS_Store differ |
| 5 | +diff --git a/node_modules/react-native-web/dist/cjs/exports/Image/index.js b/node_modules/react-native-web/dist/cjs/exports/Image/index.js |
| 6 | +index c76ecde..b0864cc 100644 |
| 7 | +--- a/node_modules/react-native-web/dist/cjs/exports/Image/index.js |
| 8 | ++++ b/node_modules/react-native-web/dist/cjs/exports/Image/index.js |
| 9 | +@@ -290,6 +290,22 @@ Image.displayName = 'Image'; |
| 10 | + |
| 11 | + // $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet |
| 12 | + var ImageWithStatics = Image; |
| 13 | ++ImageWithStatics.resolveAssetSource = function resolveAssetSource(source) { |
| 14 | ++ var uri = resolveAssetUri(source) || ''; |
| 15 | ++ var dimensions = resolveAssetDimensions(source) || {}; |
| 16 | ++ var width, height; |
| 17 | ++ if (typeof dimensions.width === 'number') { |
| 18 | ++ width = dimensions.width; |
| 19 | ++ } |
| 20 | ++ if (typeof dimensions.height === 'number') { |
| 21 | ++ height = dimensions.height; |
| 22 | ++ } |
| 23 | ++ return { |
| 24 | ++ uri, |
| 25 | ++ width, |
| 26 | ++ height |
| 27 | ++ }; |
| 28 | ++}; |
| 29 | + ImageWithStatics.getSize = function (uri, success, failure) { |
| 30 | + _ImageLoader.default.getSize(uri, success, failure); |
| 31 | + }; |
| 32 | +diff --git a/node_modules/react-native-web/dist/exports/Image/index.js b/node_modules/react-native-web/dist/exports/Image/index.js |
| 33 | +index 348831d..0d20f70 100644 |
| 34 | +--- a/node_modules/react-native-web/dist/exports/Image/index.js |
| 35 | ++++ b/node_modules/react-native-web/dist/exports/Image/index.js |
| 36 | +@@ -285,6 +285,22 @@ Image.displayName = 'Image'; |
| 37 | + |
| 38 | + // $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet |
| 39 | + var ImageWithStatics = Image; |
| 40 | ++ImageWithStatics.resolveAssetSource = function resolveAssetSource(source) { |
| 41 | ++ var uri = resolveAssetUri(source) || ''; |
| 42 | ++ var dimensions = resolveAssetDimensions(source) || {}; |
| 43 | ++ var width, height; |
| 44 | ++ if (typeof dimensions.width === 'number') { |
| 45 | ++ width = dimensions.width; |
| 46 | ++ } |
| 47 | ++ if (typeof dimensions.height === 'number') { |
| 48 | ++ height = dimensions.height; |
| 49 | ++ } |
| 50 | ++ return { |
| 51 | ++ uri, |
| 52 | ++ width, |
| 53 | ++ height |
| 54 | ++ }; |
| 55 | ++}; |
| 56 | + ImageWithStatics.getSize = function (uri, success, failure) { |
| 57 | + ImageLoader.getSize(uri, success, failure); |
| 58 | + }; |
| 59 | +diff --git a/node_modules/react-native-web/dist/exports/Image/index.js.flow b/node_modules/react-native-web/dist/exports/Image/index.js.flow |
| 60 | +index 9c53bdd..d01b34f 100644 |
| 61 | +--- a/node_modules/react-native-web/dist/exports/Image/index.js.flow |
| 62 | ++++ b/node_modules/react-native-web/dist/exports/Image/index.js.flow |
| 63 | +@@ -10,7 +10,7 @@ |
| 64 | + |
| 65 | + 'use client'; |
| 66 | + |
| 67 | +-import type { ImageProps } from './types'; |
| 68 | ++import type { ImageProps, Source } from './types'; |
| 69 | + import * as React from 'react'; |
| 70 | + import createElement from '../createElement'; |
| 71 | + import { getAssetByID } from '../../modules/AssetRegistry'; |
| 72 | +@@ -34,6 +34,11 @@ declare function resolveAssetDimensions(source: any): any; |
| 73 | + declare function resolveAssetUri(source: any): ?string; |
| 74 | + interface ImageStatics { |
| 75 | + getSize: (uri: string, success: (width: number, height: number) => void, failure: () => void) => void, |
| 76 | ++ resolveAssetSource: (source: Source) => { |
| 77 | ++ uri: string, |
| 78 | ++ width?: number, |
| 79 | ++ height?: number, |
| 80 | ++ }, |
| 81 | + prefetch: (uri: string) => Promise<void>, |
| 82 | + queryCache: (uris: Array<string>) => Promise<{| |
| 83 | + [uri: string]: 'disk/memory' |
| 84 | +@@ -150,6 +155,26 @@ Image.displayName = 'Image'; |
| 85 | + |
| 86 | + // $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet |
| 87 | + const ImageWithStatics = (Image: React.AbstractComponent<ImageProps, React.ElementRef<typeof View>> & ImageStatics); |
| 88 | ++ImageWithStatics.resolveAssetSource = function resolveAssetSource(source): { |
| 89 | ++ uri: string, |
| 90 | ++ width?: number, |
| 91 | ++ height?: number, |
| 92 | ++} { |
| 93 | ++ const uri = resolveAssetUri(source) || ''; |
| 94 | ++ const dimensions = resolveAssetDimensions(source) || {}; |
| 95 | ++ let width, height; |
| 96 | ++ if (typeof dimensions.width === 'number') { |
| 97 | ++ width = dimensions.width; |
| 98 | ++ } |
| 99 | ++ if (typeof dimensions.height === 'number') { |
| 100 | ++ height = dimensions.height; |
| 101 | ++ } |
| 102 | ++ return { |
| 103 | ++ uri, |
| 104 | ++ width, |
| 105 | ++ height |
| 106 | ++ }; |
| 107 | ++}; |
| 108 | + ImageWithStatics.getSize = function (uri, success, failure) { |
| 109 | + ImageLoader.getSize(uri, success, failure); |
| 110 | + }; |
0 commit comments