expo-image 0.2.0 → 0.2.3
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/README.md +3 -3
- package/android/build.gradle +30 -20
- package/android/src/main/java/expo/modules/image/okhttp/OkHttpClientProgressInterceptor.kt +2 -2
- package/build/ExpoImage.d.ts +1 -0
- package/build/ExpoImage.d.ts.map +1 -0
- package/build/ExpoImage.web.d.ts +1 -0
- package/build/ExpoImage.web.d.ts.map +1 -0
- package/build/Image.d.ts +1 -0
- package/build/Image.d.ts.map +1 -0
- package/build/Image.types.d.ts +1 -0
- package/build/Image.types.d.ts.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/package.json +2 -2
- package/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@ A cross-platform, performant image component for React Native and Expo with Web
|
|
|
4
4
|
|
|
5
5
|
# API documentation
|
|
6
6
|
|
|
7
|
-
- [Documentation for the
|
|
8
|
-
- [Documentation for the latest stable release](https://docs.expo.
|
|
7
|
+
- [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/image.md)
|
|
8
|
+
- [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/image/)
|
|
9
9
|
|
|
10
10
|
# Installation in managed Expo projects
|
|
11
11
|
|
|
12
|
-
For
|
|
12
|
+
For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/image/). If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
|
|
13
13
|
|
|
14
14
|
# Installation in bare React Native projects
|
|
15
15
|
|
package/android/build.gradle
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
def DEFAULT_COMPILE_SDK_VERSION = 28
|
|
2
|
-
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
|
|
3
|
-
def DEFAULT_MIN_SDK_VERSION = 16
|
|
4
|
-
def DEFAULT_TARGET_SDK_VERSION = 28
|
|
5
|
-
|
|
6
|
-
def DEFAULT_OKHTTP_VERSION = '3.14.9'
|
|
7
|
-
|
|
8
1
|
apply plugin: 'com.android.library'
|
|
9
2
|
apply plugin: 'kotlin-android'
|
|
10
|
-
apply plugin: 'maven'
|
|
3
|
+
apply plugin: 'maven-publish'
|
|
11
4
|
apply plugin: 'kotlin-kapt'
|
|
12
5
|
|
|
13
6
|
buildscript {
|
|
7
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
8
|
+
if (expoModulesCorePlugin.exists()) {
|
|
9
|
+
apply from: expoModulesCorePlugin
|
|
10
|
+
applyKotlinExpoModulesCorePlugin()
|
|
11
|
+
}
|
|
12
|
+
|
|
14
13
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
15
14
|
ext.safeExtGet = { prop, fallback ->
|
|
16
15
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
// Ensures backward compatibility
|
|
19
|
+
ext.getKotlinVersion = {
|
|
20
|
+
if (ext.has("kotlinVersion")) {
|
|
21
|
+
ext.kotlinVersion()
|
|
22
|
+
} else {
|
|
23
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
20
28
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
21
29
|
// module dependency in an application project.
|
|
@@ -23,29 +31,31 @@ buildscript {
|
|
|
23
31
|
if (project == rootProject) {
|
|
24
32
|
repositories {
|
|
25
33
|
google()
|
|
26
|
-
jcenter()
|
|
27
34
|
}
|
|
28
35
|
dependencies {
|
|
29
|
-
classpath 'com.android.tools.build:gradle:
|
|
30
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
36
|
+
classpath 'com.android.tools.build:gradle:4.2.2'
|
|
37
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
android {
|
|
36
|
-
compileSdkVersion safeExtGet(
|
|
37
|
-
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
43
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
38
44
|
|
|
39
45
|
compileOptions {
|
|
40
|
-
sourceCompatibility JavaVersion.
|
|
41
|
-
targetCompatibility JavaVersion.
|
|
46
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
47
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
kotlinOptions {
|
|
51
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
defaultConfig {
|
|
45
|
-
minSdkVersion safeExtGet(
|
|
46
|
-
targetSdkVersion safeExtGet(
|
|
55
|
+
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
56
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
47
57
|
versionCode 1
|
|
48
|
-
versionName "0.2.
|
|
58
|
+
versionName "0.2.3"
|
|
49
59
|
}
|
|
50
60
|
lintOptions {
|
|
51
61
|
abortOnError false
|
|
@@ -89,9 +99,9 @@ dependencies {
|
|
|
89
99
|
api 'com.caverock:androidsvg-aar:1.4'
|
|
90
100
|
|
|
91
101
|
api 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
|
|
92
|
-
api "com.squareup.okhttp3:okhttp:${safeExtGet("okHttpVersion",
|
|
102
|
+
api "com.squareup.okhttp3:okhttp:${safeExtGet("okHttpVersion", '4.9.2')}"
|
|
93
103
|
|
|
94
104
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1'
|
|
95
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
105
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
96
106
|
implementation "jp.wasabeef:glide-transformations:4.3.0"
|
|
97
107
|
}
|
|
@@ -20,10 +20,10 @@ object OkHttpClientProgressInterceptor : Interceptor {
|
|
|
20
20
|
@Throws(IOException::class)
|
|
21
21
|
override fun intercept(chain: Interceptor.Chain): Response {
|
|
22
22
|
val weakThis = WeakReference(this)
|
|
23
|
-
val requestUrl = chain.call().request().url
|
|
23
|
+
val requestUrl = chain.call().request().url.toString()
|
|
24
24
|
val originalResponse = chain.proceed(chain.request())
|
|
25
25
|
return originalResponse.newBuilder()
|
|
26
|
-
.body(ProgressResponseBody(originalResponse.body
|
|
26
|
+
.body(ProgressResponseBody(originalResponse.body) { bytesWritten, contentLength, done ->
|
|
27
27
|
val strongThis = weakThis.get() ?: return@ProgressResponseBody
|
|
28
28
|
val urlListeners = strongThis.mProgressListeners[requestUrl]
|
|
29
29
|
urlListeners?.forEach { it.get()?.onProgress(bytesWritten, contentLength, done) }
|
package/build/ExpoImage.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { ImageProps } from './Image';
|
|
|
2
2
|
declare const ExpoImageModule: any;
|
|
3
3
|
export { ExpoImageModule };
|
|
4
4
|
export default function ExpoImage({ source, style, defaultSource, loadingIndicatorSource, ...props }: ImageProps): JSX.Element;
|
|
5
|
+
//# sourceMappingURL=ExpoImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoImage.d.ts","sourceRoot":"","sources":["../src/ExpoImage.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAMrC,QAAA,MAAM,eAAe,KAAgC,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,KAAK,EACL,aAAa,EACb,sBAAsB,EACtB,GAAG,KAAK,EACT,EAAE,UAAU,eAoEZ"}
|
package/build/ExpoImage.web.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoImage.web.d.ts","sourceRoot":"","sources":["../src/ExpoImage.web.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,eAKjE"}
|
package/build/Image.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/Image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,UAAU,IAAI,YAAY,EAC1B,oBAAoB,EACpB,SAAS,EAEV,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIpG,UAAU,UAAW,SAAQ,YAAY;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IAMpD,MAAM,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9B,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACpD,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,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AM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,qBAAsB,SAAQ,gBAAgB;IACtD,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;CACxC"}
|
package/build/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-image",
|
|
3
3
|
"title": "Expo Image",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "A cross-platform, performant image component for React Native and Expo with Web support",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"types": "build/index.d.ts",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"expo": "*"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "c6678c65b68e45062d49a2deea8e822f69388278"
|
|
37
37
|
}
|
package/tsconfig.json
CHANGED