expo-image 2.1.7 → 2.2.0
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.
- package/CHANGELOG.md +12 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/expo/modules/image/ExpoImageModule.kt +13 -0
- package/android/src/main/java/expo/modules/image/ExpoImageViewWrapper.kt +8 -3
- package/build/ExpoImage.d.ts +3 -0
- package/build/ExpoImage.d.ts.map +1 -1
- package/build/Image.d.ts +19 -1
- package/build/Image.d.ts.map +1 -1
- package/build/Image.types.d.ts +1 -1
- package/build/Image.types.d.ts.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/useImage.d.ts +1 -1
- package/build/useImage.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/ImageModule.swift +12 -0
- package/ios/ImageView.swift +10 -2
- package/ios/Loaders/PhotoLibraryAssetLoader.swift +1 -4
- package/jest-rsc.config.js +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/{2.1.7/expo.modules.image-2.1.7-sources.jar → 2.2.0/expo.modules.image-2.2.0-sources.jar} +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/{2.1.7/expo.modules.image-2.1.7.module → 2.2.0/expo.modules.image-2.2.0.module} +22 -22
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/{2.1.7/expo.modules.image-2.1.7.pom → 2.2.0/expo.modules.image-2.2.0.pom} +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.md5 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.sha1 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.sha256 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.sha512 +1 -0
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml +4 -4
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/maven-metadata.xml.sha512 +1 -1
- package/package.json +7 -3
- package/src/ExpoImage.tsx +3 -0
- package/src/Image.tsx +28 -1
- package/src/Image.types.ts +1 -1
- package/src/index.ts +2 -2
- package/src/useImage.ts +1 -1
- package/tsconfig.json +1 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar +0 -0
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha512 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.md5 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha1 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha256 +0 -1
- package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 2.2.0 — 2025-06-04
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Add imperative api to lock/unlock/reload resource. ([#36912](https://github.com/expo/expo/pull/36912) by [@jakex7](https://github.com/jakex7))
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fix React Server Components support. ([#36801](https://github.com/expo/expo/pull/36801) by [@EvanBacon](https://github.com/EvanBacon))
|
|
22
|
+
- [iOS] Fix PhotoLibrary assets being scaled twice. ([#36776](https://github.com/expo/expo/pull/36776) by [@alanjhughes](https://github.com/alanjhughes))
|
|
23
|
+
- [iOS] Don't add transformers when unnecessary. ([#36884](https://github.com/expo/expo/pull/36884) by [@jakex7](https://github.com/jakex7))
|
|
24
|
+
|
|
13
25
|
## 2.1.7 — 2025-05-06
|
|
14
26
|
|
|
15
27
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -8,7 +8,7 @@ android {
|
|
|
8
8
|
namespace "expo.modules.image"
|
|
9
9
|
defaultConfig {
|
|
10
10
|
versionCode 1
|
|
11
|
-
versionName "2.
|
|
11
|
+
versionName "2.2.0"
|
|
12
12
|
consumerProguardFiles("proguard-rules.pro")
|
|
13
13
|
|
|
14
14
|
buildConfigField("boolean", "ALLOW_GLIDE_LOGS", project.properties.get("EXPO_ALLOW_GLIDE_LOGS", "false"))
|
|
@@ -275,6 +275,19 @@ class ExpoImageModule : Module() {
|
|
|
275
275
|
view.setIsAnimating(false)
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
AsyncFunction("lockResourceAsync") { view: ExpoImageViewWrapper ->
|
|
279
|
+
view.lockResource = true
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
AsyncFunction("unlockResourceAsync") { view: ExpoImageViewWrapper ->
|
|
283
|
+
view.lockResource = false
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
AsyncFunction("reloadAsync") { view: ExpoImageViewWrapper ->
|
|
287
|
+
view.shouldRerender = true
|
|
288
|
+
view.rerenderIfNeeded(force = true)
|
|
289
|
+
}
|
|
290
|
+
|
|
278
291
|
OnViewDidUpdateProps { view: ExpoImageViewWrapper ->
|
|
279
292
|
view.rerenderIfNeeded()
|
|
280
293
|
}
|
|
@@ -163,6 +163,8 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(
|
|
|
163
163
|
|
|
164
164
|
internal var autoplay: Boolean = true
|
|
165
165
|
|
|
166
|
+
internal var lockResource: Boolean = false
|
|
167
|
+
|
|
166
168
|
internal var priority: Priority = Priority.NORMAL
|
|
167
169
|
internal var cachePolicy: CachePolicy = CachePolicy.DISK
|
|
168
170
|
|
|
@@ -181,7 +183,7 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(
|
|
|
181
183
|
/**
|
|
182
184
|
* Whether the image should be loaded again
|
|
183
185
|
*/
|
|
184
|
-
|
|
186
|
+
internal var shouldRerender = false
|
|
185
187
|
|
|
186
188
|
/**
|
|
187
189
|
* Currently loaded source
|
|
@@ -477,8 +479,11 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(
|
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
481
|
|
|
480
|
-
internal fun rerenderIfNeeded(shouldRerenderBecauseOfResize: Boolean = false) =
|
|
481
|
-
trace(Trace.tag, "rerenderIfNeeded(shouldRerenderBecauseOfResize=$shouldRerenderBecauseOfResize)") {
|
|
482
|
+
internal fun rerenderIfNeeded(shouldRerenderBecauseOfResize: Boolean = false, force: Boolean = false) =
|
|
483
|
+
trace(Trace.tag, "rerenderIfNeeded(shouldRerenderBecauseOfResize=$shouldRerenderBecauseOfResize,force=$force)") {
|
|
484
|
+
if (lockResource && !force) {
|
|
485
|
+
return@trace
|
|
486
|
+
}
|
|
482
487
|
val bestSource = bestSource
|
|
483
488
|
val bestPlaceholder = bestPlaceholder
|
|
484
489
|
|
package/build/ExpoImage.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { ImageErrorEventData, ImageLoadEventData, ImageNativeProps, ImageProgres
|
|
|
4
4
|
declare class ExpoImage extends React.PureComponent<ImageNativeProps> {
|
|
5
5
|
startAnimating: () => Promise<unknown> | unknown;
|
|
6
6
|
stopAnimating: () => Promise<unknown> | unknown;
|
|
7
|
+
lockResourceAsync: () => Promise<void>;
|
|
8
|
+
unlockResourceAsync: () => Promise<void>;
|
|
9
|
+
reloadAsync: () => Promise<void>;
|
|
7
10
|
onLoadStart: () => void;
|
|
8
11
|
onLoad: (event: NativeSyntheticEvent<ImageLoadEventData>) => void;
|
|
9
12
|
onProgress: (event: NativeSyntheticEvent<ImageProgressEventData>) => void;
|
package/build/ExpoImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoImage.d.ts","sourceRoot":"","sources":["../src/ExpoImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAsC,MAAM,cAAc,CAAC;AAExF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AAkBvB,cAAM,SAAU,SAAQ,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IAE3D,cAAc,EAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAClD,aAAa,EAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoImage.d.ts","sourceRoot":"","sources":["../src/ExpoImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAsC,MAAM,cAAc,CAAC;AAExF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AAkBvB,cAAM,SAAU,SAAQ,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC;IAE3D,cAAc,EAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAClD,aAAa,EAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACjD,iBAAiB,EAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,mBAAmB,EAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,WAAW,EAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,WAAW,aAET;IAEF,MAAM,GAAI,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,UAGvD;IAEF,UAAU,GAAI,OAAO,oBAAoB,CAAC,sBAAsB,CAAC,UAE/D;IAEF,OAAO,GAAI,OAAO,oBAAoB,CAAC,mBAAmB,CAAC,UAGzD;IAEF,SAAS,aAEP;IAEF,MAAM;CAgEP;AAED,eAAe,SAAS,CAAC"}
|
package/build/Image.d.ts
CHANGED
|
@@ -88,6 +88,24 @@ export declare class Image extends React.PureComponent<ImageProps> {
|
|
|
88
88
|
* @platform ios
|
|
89
89
|
*/
|
|
90
90
|
stopAnimating(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Prevents the resource from being reloaded by locking it.
|
|
93
|
+
* @platform android
|
|
94
|
+
* @platform ios
|
|
95
|
+
*/
|
|
96
|
+
lockResourceAsync(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Releases the lock on the resource, allowing it to be reloaded.
|
|
99
|
+
* @platform android
|
|
100
|
+
* @platform ios
|
|
101
|
+
*/
|
|
102
|
+
unlockResourceAsync(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Reloads the resource, ignoring lock.
|
|
105
|
+
* @platform android
|
|
106
|
+
* @platform ios
|
|
107
|
+
*/
|
|
108
|
+
reloadAsync(): Promise<void>;
|
|
91
109
|
/**
|
|
92
110
|
* Loads an image from the given source to memory and resolves to
|
|
93
111
|
* an object that references the native image instance.
|
|
@@ -95,7 +113,7 @@ export declare class Image extends React.PureComponent<ImageProps> {
|
|
|
95
113
|
* @platform ios
|
|
96
114
|
* @platform web
|
|
97
115
|
*/
|
|
98
|
-
static loadAsync(source: ImageSource | string, options?: ImageLoadOptions): Promise<ImageRef>;
|
|
116
|
+
static loadAsync(source: ImageSource | string | number, options?: ImageLoadOptions): Promise<ImageRef>;
|
|
99
117
|
render(): React.JSX.Element;
|
|
100
118
|
}
|
|
101
119
|
//# sourceMappingURL=Image.d.ts.map
|
package/build/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,eAAe,CAAC;AAQvB,qBAAa,KAAM,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IACxD,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACjD,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;gBAEnC,KAAK,EAAE,UAAU;IAO7B,gBAAgB,2BAMd;IAEF;;OAEG;IACH,MAAM,CAAC,KAAK,kBAAqB;IAEjC;;;;;;;;;;OAUG;WACU,QAAQ,CACnB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EACvB,WAAW,CAAC,EAAE,oBAAoB,CAAC,aAAa,CAAC,GAChD,OAAO,CAAC,OAAO,CAAC;IAC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E,WAAW,GAAG,MAAM,GAAG,MAAM,EACrC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,QAAQ,CAAC;IAKpB,MAAM;CA6CP"}
|
package/build/Image.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NativeModule, SharedRef, SharedRefType } from 'expo';
|
|
2
|
-
import { ImageStyle as RNImageStyle,
|
|
2
|
+
import { ImageStyle as RNImageStyle, StyleProp, View, ViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
import ExpoImage from './ExpoImage';
|
|
4
4
|
export type ImageSource = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.types.d.ts","sourceRoot":"","sources":["../src/Image.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Image.types.d.ts","sourceRoot":"","sources":["../src/Image.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACnE,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;;;;;;;OAQG;I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AQ,YAAY;IAEzD,KAAK,EAAE,OAAO,QAAQ,CAAC;IAEvB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAC9E;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACjD,CAAC"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/build/useImage.d.ts
CHANGED
|
@@ -31,5 +31,5 @@ import type { ImageLoadOptions, ImageRef, ImageSource } from './Image.types';
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export declare function useImage(source: ImageSource | string, options?: ImageLoadOptions, dependencies?: DependencyList): ImageRef | null;
|
|
34
|
+
export declare function useImage(source: ImageSource | string | number, options?: ImageLoadOptions, dependencies?: DependencyList): ImageRef | null;
|
|
35
35
|
//# sourceMappingURL=useImage.d.ts.map
|
package/build/useImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImage.d.ts","sourceRoot":"","sources":["../src/useImage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"useImage.d.ts","sourceRoot":"","sources":["../src/useImage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,EACrC,OAAO,GAAE,gBAAqB,EAC9B,YAAY,GAAE,cAAmB,GAChC,QAAQ,GAAG,IAAI,CAgDjB"}
|
package/expo-module.config.json
CHANGED
package/ios/ImageModule.swift
CHANGED
|
@@ -115,6 +115,18 @@ public final class ImageModule: Module {
|
|
|
115
115
|
view.sdImageView.stopAnimating()
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
AsyncFunction("lockResourceAsync") { (view: ImageView) in
|
|
119
|
+
view.lockResource = true
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
AsyncFunction("unlockResourceAsync") { (view: ImageView) in
|
|
123
|
+
view.lockResource = false
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
AsyncFunction("reloadAsync") { (view: ImageView) in
|
|
127
|
+
view.reload(force: true)
|
|
128
|
+
}
|
|
129
|
+
|
|
118
130
|
OnViewDidUpdateProps { view in
|
|
119
131
|
view.reload()
|
|
120
132
|
}
|
package/ios/ImageView.swift
CHANGED
|
@@ -56,6 +56,8 @@ public final class ImageView: ExpoView {
|
|
|
56
56
|
|
|
57
57
|
var allowDownscaling: Bool = true
|
|
58
58
|
|
|
59
|
+
var lockResource: Bool = false
|
|
60
|
+
|
|
59
61
|
var recyclingKey: String? {
|
|
60
62
|
didSet {
|
|
61
63
|
if oldValue != nil && recyclingKey != oldValue {
|
|
@@ -118,7 +120,10 @@ public final class ImageView: ExpoView {
|
|
|
118
120
|
|
|
119
121
|
// MARK: - Implementation
|
|
120
122
|
|
|
121
|
-
func reload() {
|
|
123
|
+
func reload(force: Bool = false) {
|
|
124
|
+
if lockResource && !force {
|
|
125
|
+
return
|
|
126
|
+
}
|
|
122
127
|
if isViewEmpty {
|
|
123
128
|
displayPlaceholderIfNecessary()
|
|
124
129
|
}
|
|
@@ -332,7 +337,10 @@ public final class ImageView: ExpoView {
|
|
|
332
337
|
|
|
333
338
|
// MARK: - Processing
|
|
334
339
|
|
|
335
|
-
private func createTransformPipeline() -> SDImagePipelineTransformer {
|
|
340
|
+
private func createTransformPipeline() -> SDImagePipelineTransformer? {
|
|
341
|
+
if blurRadius <= 0 {
|
|
342
|
+
return nil
|
|
343
|
+
}
|
|
336
344
|
let transformers: [SDImageTransformer] = [
|
|
337
345
|
SDImageBlurTransformer(radius: blurRadius)
|
|
338
346
|
]
|
|
@@ -107,12 +107,9 @@ private func requestAsset(
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
let screenScale = context?[ImageView.screenScaleKey] as? Double ?? UIScreen.main.scale
|
|
111
|
-
let targetSize = CGSize(width: Double(asset.pixelWidth) / screenScale, height: Double(asset.pixelHeight) / screenScale)
|
|
112
|
-
|
|
113
110
|
return PHImageManager.default().requestImage(
|
|
114
111
|
for: asset,
|
|
115
|
-
targetSize:
|
|
112
|
+
targetSize: PHImageManagerMaximumSize,
|
|
116
113
|
contentMode: .aspectFit,
|
|
117
114
|
options: options,
|
|
118
115
|
resultHandler: { image, info in
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('jest-expo/rsc/jest-preset');
|
|
Binary file
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
754e5c8b8c3d801d36965a6cf0ec673a
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0-sources.jar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9d61b3b9a11effe5d06c77755eaa06d86da5d422
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d91f60ce8ec04a24413f687b5596f0165504d5b55d05c380daea5b155e537100
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4fd35480bc1edafe3727afbfb6b1d9cf69643f30523402e7512a8b2944d17915150373225d5aed1c344b80ad9c9b3fe1ff1050b2c83a13c8faa34956ddef588e
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5c50faf7e63489ecc2e5d3ab07a2f707
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
af130ea05cd1ce374351bdb409b187b699baeef7
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "BareExpo",
|
|
5
5
|
"module": "expo.modules.image",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.2.0",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
],
|
|
55
55
|
"files": [
|
|
56
56
|
{
|
|
57
|
-
"name": "expo.modules.image-2.
|
|
58
|
-
"url": "expo.modules.image-2.
|
|
59
|
-
"size":
|
|
60
|
-
"sha512": "
|
|
61
|
-
"sha256": "
|
|
62
|
-
"sha1": "
|
|
63
|
-
"md5": "
|
|
57
|
+
"name": "expo.modules.image-2.2.0.aar",
|
|
58
|
+
"url": "expo.modules.image-2.2.0.aar",
|
|
59
|
+
"size": 279544,
|
|
60
|
+
"sha512": "47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8",
|
|
61
|
+
"sha256": "5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac",
|
|
62
|
+
"sha1": "af130ea05cd1ce374351bdb409b187b699baeef7",
|
|
63
|
+
"md5": "5c50faf7e63489ecc2e5d3ab07a2f707"
|
|
64
64
|
}
|
|
65
65
|
]
|
|
66
66
|
},
|
|
@@ -143,13 +143,13 @@
|
|
|
143
143
|
],
|
|
144
144
|
"files": [
|
|
145
145
|
{
|
|
146
|
-
"name": "expo.modules.image-2.
|
|
147
|
-
"url": "expo.modules.image-2.
|
|
148
|
-
"size":
|
|
149
|
-
"sha512": "
|
|
150
|
-
"sha256": "
|
|
151
|
-
"sha1": "
|
|
152
|
-
"md5": "
|
|
146
|
+
"name": "expo.modules.image-2.2.0.aar",
|
|
147
|
+
"url": "expo.modules.image-2.2.0.aar",
|
|
148
|
+
"size": 279544,
|
|
149
|
+
"sha512": "47c107c9a1134bb50953e5cf037cdc5aef8088d6c1bce906d268f2cf2c6b1a2692dbbd4cf686922d9eded7a78e275fea8038b91267fffd31957fa68b297bdae8",
|
|
150
|
+
"sha256": "5d682f47a7031c3d5403faf294bb898f52299dcc73903682475cc310c39e70ac",
|
|
151
|
+
"sha1": "af130ea05cd1ce374351bdb409b187b699baeef7",
|
|
152
|
+
"md5": "5c50faf7e63489ecc2e5d3ab07a2f707"
|
|
153
153
|
}
|
|
154
154
|
]
|
|
155
155
|
},
|
|
@@ -163,13 +163,13 @@
|
|
|
163
163
|
},
|
|
164
164
|
"files": [
|
|
165
165
|
{
|
|
166
|
-
"name": "expo.modules.image-2.
|
|
167
|
-
"url": "expo.modules.image-2.
|
|
168
|
-
"size":
|
|
169
|
-
"sha512": "
|
|
170
|
-
"sha256": "
|
|
171
|
-
"sha1": "
|
|
172
|
-
"md5": "
|
|
166
|
+
"name": "expo.modules.image-2.2.0-sources.jar",
|
|
167
|
+
"url": "expo.modules.image-2.2.0-sources.jar",
|
|
168
|
+
"size": 64200,
|
|
169
|
+
"sha512": "4fd35480bc1edafe3727afbfb6b1d9cf69643f30523402e7512a8b2944d17915150373225d5aed1c344b80ad9c9b3fe1ff1050b2c83a13c8faa34956ddef588e",
|
|
170
|
+
"sha256": "d91f60ce8ec04a24413f687b5596f0165504d5b55d05c380daea5b155e537100",
|
|
171
|
+
"sha1": "9d61b3b9a11effe5d06c77755eaa06d86da5d422",
|
|
172
|
+
"md5": "754e5c8b8c3d801d36965a6cf0ec673a"
|
|
173
173
|
}
|
|
174
174
|
]
|
|
175
175
|
}
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
81aff0c321c555fc7f5d2ce048c969ca
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f46ae285cb98782959ebdb97bf773bef0cbf2bd2
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9cec64d53e9b2bda5886f11709138f440da856d7f5a0ed2d993c95521d5633fb
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.module.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e76fcc02b43ec7224100fe419a8fa44881ba1cbd414ce1b1f45080790f3f7fcc5fa7f17bf9f5a2c2b12f4bbc7cd81079927a76d489f8b92c32acd198e5d86cd3
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>BareExpo</groupId>
|
|
11
11
|
<artifactId>expo.modules.image</artifactId>
|
|
12
|
-
<version>2.
|
|
12
|
+
<version>2.2.0</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.image</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
00d7a028f7e3922d6f7a628f4b62299d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
82a2b234ec52e12658c1d4c62392e4dd9c45d3f2
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
17558bb40edb33db2168e39d6736e153cca9865c74a58350a8b90fe157b6372e
|
package/local-maven-repo/BareExpo/expo.modules.image/2.2.0/expo.modules.image-2.2.0.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dd80e17008b40882bc32b48bc91eb56aeffe4b3203c1c835f899eac541d99dd1b2943751699239e7642c4ca5bc2fd8af9f2ad11caa59d1cd852a65df23047a4d
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>BareExpo</groupId>
|
|
4
4
|
<artifactId>expo.modules.image</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>2.
|
|
7
|
-
<release>2.
|
|
6
|
+
<latest>2.2.0</latest>
|
|
7
|
+
<release>2.2.0</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>2.
|
|
9
|
+
<version>2.2.0</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250604230414</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a76bc4b52d2cab007afb2b6b0e4c9ce2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
888ec682ea16d0eeb1e0c4e9fbee36ed519efcb5
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9928e46f3aa16faa19bb42daac5fd46f8b7050b12f5f232482f4f257d4285e8b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
980ff1540cb0aead9d8bcb5992e6ed6eabf2820fe215a9e7b92122c214616551aa738a04fb9994864ec5b4c8c60bba7cb398a5ccccf202e15764cbb9984fa842
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-image",
|
|
3
3
|
"title": "Expo Image",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "A cross-platform, performant image component for React Native and Expo with Web support",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"clean": "expo-module clean",
|
|
12
12
|
"lint": "expo-module lint",
|
|
13
13
|
"test": "expo-module test",
|
|
14
|
+
"test:rsc": "jest --config jest-rsc.config.js",
|
|
14
15
|
"prepare": "expo-module prepare",
|
|
15
16
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
16
17
|
"expo-module": "expo-module"
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"license": "MIT",
|
|
29
30
|
"dependencies": {},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"expo-module-scripts": "^4.1.
|
|
32
|
+
"expo-module-scripts": "^4.1.7"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"expo": "*",
|
|
@@ -41,5 +42,8 @@
|
|
|
41
42
|
"optional": true
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
|
-
"
|
|
45
|
+
"jest": {
|
|
46
|
+
"preset": "expo-module-scripts"
|
|
47
|
+
},
|
|
48
|
+
"gitHead": "7638c800b57fe78f57cc7f129022f58e84a523c5"
|
|
45
49
|
}
|
package/src/ExpoImage.tsx
CHANGED
|
@@ -29,6 +29,9 @@ class ExpoImage extends React.PureComponent<ImageNativeProps> {
|
|
|
29
29
|
// NOTE(@kitten): native methods
|
|
30
30
|
startAnimating!: () => Promise<unknown> | unknown;
|
|
31
31
|
stopAnimating!: () => Promise<unknown> | unknown;
|
|
32
|
+
lockResourceAsync!: () => Promise<void>;
|
|
33
|
+
unlockResourceAsync!: () => Promise<void>;
|
|
34
|
+
reloadAsync!: () => Promise<void>;
|
|
32
35
|
|
|
33
36
|
onLoadStart = () => {
|
|
34
37
|
this.props.onLoadStart?.();
|
package/src/Image.tsx
CHANGED
|
@@ -160,6 +160,33 @@ export class Image extends React.PureComponent<ImageProps> {
|
|
|
160
160
|
await this.nativeViewRef.current?.stopAnimating();
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Prevents the resource from being reloaded by locking it.
|
|
165
|
+
* @platform android
|
|
166
|
+
* @platform ios
|
|
167
|
+
*/
|
|
168
|
+
async lockResourceAsync(): Promise<void> {
|
|
169
|
+
await this.nativeViewRef.current?.lockResourceAsync();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Releases the lock on the resource, allowing it to be reloaded.
|
|
174
|
+
* @platform android
|
|
175
|
+
* @platform ios
|
|
176
|
+
*/
|
|
177
|
+
async unlockResourceAsync(): Promise<void> {
|
|
178
|
+
await this.nativeViewRef.current?.unlockResourceAsync();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Reloads the resource, ignoring lock.
|
|
183
|
+
* @platform android
|
|
184
|
+
* @platform ios
|
|
185
|
+
*/
|
|
186
|
+
async reloadAsync(): Promise<void> {
|
|
187
|
+
await this.nativeViewRef.current?.reloadAsync();
|
|
188
|
+
}
|
|
189
|
+
|
|
163
190
|
/**
|
|
164
191
|
* Loads an image from the given source to memory and resolves to
|
|
165
192
|
* an object that references the native image instance.
|
|
@@ -168,7 +195,7 @@ export class Image extends React.PureComponent<ImageProps> {
|
|
|
168
195
|
* @platform web
|
|
169
196
|
*/
|
|
170
197
|
static async loadAsync(
|
|
171
|
-
source: ImageSource | string,
|
|
198
|
+
source: ImageSource | string | number,
|
|
172
199
|
options?: ImageLoadOptions
|
|
173
200
|
): Promise<ImageRef> {
|
|
174
201
|
const resolvedSource = resolveSource(source) as ImageSource;
|
package/src/Image.types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NativeModule, SharedRef, SharedRefType } from 'expo';
|
|
2
|
-
import { ImageStyle as RNImageStyle,
|
|
2
|
+
import { ImageStyle as RNImageStyle, StyleProp, View, ViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import ExpoImage from './ExpoImage';
|
|
5
5
|
|
package/src/index.ts
CHANGED
package/src/useImage.ts
CHANGED
|
@@ -38,7 +38,7 @@ import { resolveSource } from './utils/resolveSources';
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
export function useImage(
|
|
41
|
-
source: ImageSource | string,
|
|
41
|
+
source: ImageSource | string | number,
|
|
42
42
|
options: ImageLoadOptions = {},
|
|
43
43
|
dependencies: DependencyList = []
|
|
44
44
|
): ImageRef | null {
|
package/tsconfig.json
CHANGED
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c8557a0851f6c06985048d72fd1988c1
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7-sources.jar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d3f5e5ae74313aa0f1f00100ca224b8ff0f06cdb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b10d135169587ddca802d9c2d5ce8cc9f0aec39651d011c335fc7fae0724d4cc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5d1fc9c3a00f43d3618f1f48a268405ba6409a77afea3d453662a4b4e2713bc06671498dedf70d47c558dc5bfd0aeff36960522d62c4c568321a270b978b9530
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
91591dd86536326bb3cc2e4011cc0d97
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
75a972e62c1b3c0a6f1065a97261eac02fc7caa4
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e18ad974ea696b59696d44c3f9c6b328603f0642b083018b787168d27c0e8368
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
13c0bf84a9a4bc09dc5f80ff226aa6af2144bfa46c8da2537da763d961ecdc65c88eac63c26505f8333b31b0058f0dc800821cc5a9eac2c5e22164895f63f4ef
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
97c191d60bf42c4555393c6600f49cc7
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
202284e2e506da0a1372ffc5b23545e4e8c65ca3
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f7c7ad69b1a0deb569ad62b65b3fb279cd68aec347d6f0e86e64de4a78a82480
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.module.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d847f507079dab43a85f50d6db9d3210c45c3cb895aaf7a798687a7db0bdc11496514e23b7eb027496dac62b4b1a983c8df51ba864c61fdea0fb721e7f66b557
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d7753f2898fffc3dcde6898f20ef75fa
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0272465d80c6f22adb8e9d825076eed44790963a
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
142d72ec051b5fcaf1c9482e0ec879295753199df1fe78de7a2a22ea97d1a5c0
|
package/local-maven-repo/BareExpo/expo.modules.image/2.1.7/expo.modules.image-2.1.7.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
47f4d16abe8eb546f78b17d9e708da2f55cf2300fb56bda92bc0e1ffd6e6b5eb867de4433f9704c3acd5cb3eca0072199f0b28506207cad681bd2c8e5bfcff4c
|