@nativescript-community/ui-image 4.1.5 → 4.1.8

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 CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.1.8](https://github.com/nativescript-community/ui-image/compare/v4.1.7...v4.1.8) (2022-07-01)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-image
9
+
10
+
11
+
12
+
13
+
14
+ ## [4.1.7](https://github.com/nativescript-community/ui-image/compare/v4.1.6...v4.1.7) (2022-06-13)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **android:** trying to fix build ([b8e0201](https://github.com/nativescript-community/ui-image/commit/b8e020156a9bf3cfb5a8c865789e826bd13d12ae))
20
+
21
+
22
+
23
+
24
+
25
+ ## [4.1.6](https://github.com/nativescript-community/ui-image/compare/v4.1.5...v4.1.6) (2022-02-18)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **android:** build fix ([d985433](https://github.com/nativescript-community/ui-image/commit/d9854332a780393c1677d045c3efdadc936a2d03))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [4.1.5](https://github.com/nativescript-community/ui-image/compare/v4.1.4...v4.1.5) (2022-02-18)
7
37
 
8
38
 
package/image.android.js CHANGED
@@ -337,9 +337,13 @@ export class Img extends ImageBase {
337
337
  [_d = ImageBase.aspectRatioProperty.setNative]() {
338
338
  this.initImage();
339
339
  }
340
- initImage() {
340
+ async initImage() {
341
341
  if (this.nativeViewProtected) {
342
342
  const src = this.src;
343
+ if (src instanceof Promise) {
344
+ this.src = await src;
345
+ return;
346
+ }
343
347
  if (src) {
344
348
  let drawable;
345
349
  if (src instanceof ImageSource) {
package/image.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ImageSource, View } from '@nativescript/core';
1
+ import { ImageAsset, ImageSource, View } from '@nativescript/core';
2
2
 
3
3
 
4
4
  /**
@@ -75,7 +75,7 @@ export class Img extends View {
75
75
  /**
76
76
  * String value used for the image URI.
77
77
  */
78
- src: string | ImageSource;
78
+ src: string | ImageSource | ImageAsset | Promise<string | ImageSource | ImageAsset> ;
79
79
 
80
80
  /**
81
81
  * String value used for the lower res image URI.
package/image.ios.js CHANGED
@@ -297,9 +297,13 @@ export class Img extends ImageBase {
297
297
  }
298
298
  return image;
299
299
  }
300
- initImage() {
300
+ async initImage() {
301
301
  if (this.nativeViewProtected) {
302
302
  const src = this.src;
303
+ if (src instanceof Promise) {
304
+ this.src = await src;
305
+ return;
306
+ }
303
307
  if (src) {
304
308
  const animate = this.fadeDuration > 0;
305
309
  if (src instanceof ImageSource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-image",
3
- "version": "4.1.5",
3
+ "version": "4.1.8",
4
4
  "description": "Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.",
5
5
  "main": "./image",
6
6
  "sideEffects": false,
@@ -36,5 +36,5 @@
36
36
  },
37
37
  "license": "Apache-2.0",
38
38
  "readmeFilename": "README.md",
39
- "gitHead": "9b313b3320e8d081321b71597f7c52019cc9ab5c"
39
+ "gitHead": "41453b620cf3be6a305c67cfbd7e4cd2d1df8377"
40
40
  }
@@ -1,20 +1,4 @@
1
-
2
1
  import groovy.json.JsonSlurper
3
- repositories {
4
- mavenCentral()
5
- def appDir = "$rootDir/../../.."
6
- def widgetsDir = "$appDir/node_modules/@nativescript/core/platforms/android"
7
- def appPackageJsonFile = file("$appDir/package.json")
8
- if (appPackageJsonFile.exists()) {
9
- def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
10
- if (appPackageJson.dependencies['@akylas/nativescript'] != null) {
11
- widgetsDir = "$appDir/node_modules/@akylas/nativescript/platforms/android"
12
- }
13
- }
14
- flatDir {
15
- dirs "$widgetsDir"
16
- }
17
- }
18
2
  dependencies {
19
3
  def frescoVersion = project.hasProperty("frescoVersion") ? project.frescoVersion : "2.3.0"
20
4
 
@@ -30,3 +14,19 @@ dependencies {
30
14
  // }
31
15
  implementation(name:'widgets-release', ext:'aar')
32
16
  }
17
+
18
+ repositories {
19
+ mavenCentral()
20
+ def appDir = "$rootDir/../../.."
21
+ def widgetsDir = "$appDir/node_modules/@nativescript/core/platforms/android"
22
+ def appPackageJsonFile = file("$appDir/package.json")
23
+ if (appPackageJsonFile.exists()) {
24
+ def appPackageJson = new JsonSlurper().parseText(appPackageJsonFile.text)
25
+ if (appPackageJson.dependencies !=null && appPackageJson.dependencies["@akylas/nativescript"] != null) {
26
+ widgetsDir = "$appDir/node_modules/@akylas/nativescript/platforms/android"
27
+ }
28
+ }
29
+ flatDir {
30
+ dirs "$widgetsDir"
31
+ }
32
+ }