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 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 master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/image.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/image/)
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 managed [managed](https://docs.expo.io/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.io/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.
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
 
@@ -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:3.4.1'
30
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
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('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
37
- buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
43
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
38
44
 
39
45
  compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_1_8
41
- targetCompatibility JavaVersion.VERSION_1_8
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('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
46
- targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
55
+ minSdkVersion safeExtGet("minSdkVersion", 21)
56
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
47
57
  versionCode 1
48
- versionName "0.2.0"
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", DEFAULT_OKHTTP_VERSION)}"
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:${safeExtGet('kotlinVersion', '1.4.21')}"
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().toString()
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()) { bytesWritten, contentLength, done ->
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) }
@@ -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"}
@@ -1,2 +1,3 @@
1
1
  import { ImageProps } from './Image';
2
2
  export default function ExpoImage({ source, ...props }: ImageProps): JSX.Element;
3
+ //# sourceMappingURL=ExpoImage.web.d.ts.map
@@ -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
@@ -42,3 +42,4 @@ export default class Image extends React.Component<ImageProps, ImageState> {
42
42
  render(): JSX.Element;
43
43
  }
44
44
  export {};
45
+ //# sourceMappingURL=Image.d.ts.map
@@ -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,EAC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D;;;OAGG;WACU,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjD,KAAK;;;MAGH;IAEF,MAAM;CAgBP"}
@@ -39,3 +39,4 @@ export interface ImageErrorEventData {
39
39
  android?: AndroidGlideException | null;
40
40
  }
41
41
  export {};
42
+ //# sourceMappingURL=Image.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.types.d.ts","sourceRoot":"","sources":["../src/Image.types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,OAAO,IAAI;IACX,IAAI,IAAI;IACR,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,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
@@ -1,3 +1,4 @@
1
1
  import Image from './Image';
2
2
  export * from './Image.types';
3
3
  export default Image;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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.0",
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": "2e5c6983b86d5ecfca028ba64002897d8adc2cc4"
36
+ "gitHead": "c6678c65b68e45062d49a2deea8e822f69388278"
37
37
  }
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }