@onekeyfe/react-native-image 3.0.157-alpha.251 → 3.0.157-alpha.254
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/android/build.gradle
CHANGED
|
@@ -56,6 +56,7 @@ android {
|
|
|
56
56
|
}
|
|
57
57
|
buildFeatures { buildConfig true; prefab true }
|
|
58
58
|
buildTypes { release { minifyEnabled false } }
|
|
59
|
+
testOptions { unitTests.returnDefaultValues = true }
|
|
59
60
|
lintOptions { disable "GradleCompatible" }
|
|
60
61
|
compileOptions {
|
|
61
62
|
sourceCompatibility JavaVersion.VERSION_1_8
|
package/ios/OneKeyImage.swift
CHANGED
|
@@ -210,8 +210,8 @@ final class HybridOneKeyImage: HybridOneKeyImageSpec, RecyclableView {
|
|
|
210
210
|
// Fabric can reset `round` before clearing `sourceUri` while removing a view.
|
|
211
211
|
// Apply the shape once per committed prop batch so the outgoing frame keeps
|
|
212
212
|
// its clipping, while mounted and recycled views still receive the new value.
|
|
213
|
-
if let sourceUri, !sourceUri.isEmpty {
|
|
214
|
-
hostView.round = round
|
|
213
|
+
if let sourceUri, !sourceUri.isEmpty, let round {
|
|
214
|
+
hostView.round = round
|
|
215
215
|
}
|
|
216
216
|
scheduleLoad()
|
|
217
217
|
}
|
|
@@ -785,6 +785,25 @@ enum OneKeyImageRequestContext {
|
|
|
785
785
|
return context
|
|
786
786
|
}
|
|
787
787
|
|
|
788
|
+
#if DEBUG
|
|
789
|
+
// The separate pod test module cannot import make's full signature.
|
|
790
|
+
static func testContext(
|
|
791
|
+
headersJson: String?,
|
|
792
|
+
thumbnailPixelSize: CGSize?,
|
|
793
|
+
manager: SDWebImageManager,
|
|
794
|
+
url: URL?
|
|
795
|
+
) -> [SDWebImageContextOption: Any] {
|
|
796
|
+
make(
|
|
797
|
+
headersJson: headersJson,
|
|
798
|
+
cachePolicy: .memoryDisk,
|
|
799
|
+
thumbnailPixelSize: thumbnailPixelSize,
|
|
800
|
+
safetyTracker: nil,
|
|
801
|
+
manager: manager,
|
|
802
|
+
url: url
|
|
803
|
+
)
|
|
804
|
+
}
|
|
805
|
+
#endif
|
|
806
|
+
|
|
788
807
|
static func transportGuards(
|
|
789
808
|
tracker: OneKeyImageSafetyTracker
|
|
790
809
|
) -> [SDWebImageContextOption: Any] {
|
|
@@ -11,9 +11,8 @@ final class OneKeyAvatarImageTests: XCTestCase {
|
|
|
11
11
|
let first = OneKeyImagePipeline.makeIsolatedManager()
|
|
12
12
|
let second = OneKeyImagePipeline.makeIsolatedManager()
|
|
13
13
|
func context(_ manager: SDWebImageManager, headers: String) -> [SDWebImageContextOption: Any] {
|
|
14
|
-
OneKeyImageRequestContext.
|
|
15
|
-
thumbnailPixelSize: CGSize(width: 96, height: 96),
|
|
16
|
-
manager: manager, url: url)
|
|
14
|
+
OneKeyImageRequestContext.testContext(headersJson: headers,
|
|
15
|
+
thumbnailPixelSize: CGSize(width: 96, height: 96), manager: manager, url: url)
|
|
17
16
|
}
|
|
18
17
|
let a = context(first, headers: "{\"X-Test\":\"a\"}")
|
|
19
18
|
let b = context(second, headers: "{\"X-Test\":\"b\"}")
|
|
@@ -26,8 +25,8 @@ final class OneKeyAvatarImageTests: XCTestCase {
|
|
|
26
25
|
let firstFilter = try XCTUnwrap(a[.cacheKeyFilter] as? SDWebImageCacheKeyFilter)
|
|
27
26
|
let secondFilter = try XCTUnwrap(b[.cacheKeyFilter] as? SDWebImageCacheKeyFilter)
|
|
28
27
|
XCTAssertEqual(firstFilter.cacheKey(for: url), secondFilter.cacheKey(for: url))
|
|
29
|
-
let remote = OneKeyImageRequestContext.
|
|
30
|
-
thumbnailPixelSize: nil,
|
|
28
|
+
let remote = OneKeyImageRequestContext.testContext(headersJson: nil,
|
|
29
|
+
thumbnailPixelSize: nil, manager: first,
|
|
31
30
|
url: URL(string: "https://example.com/image.png"))
|
|
32
31
|
XCTAssertNil(remote[.imageLoader])
|
|
33
32
|
XCTAssertNil(remote[.imageCache])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-image",
|
|
3
|
-
"version": "3.0.157-alpha.
|
|
3
|
+
"version": "3.0.157-alpha.254",
|
|
4
4
|
"description": "High-performance native image view for OneKey",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"typescript": "^5.9.2"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@onekeyfe/react-native-skeleton": "3.0.157-alpha.
|
|
84
|
+
"@onekeyfe/react-native-skeleton": "3.0.157-alpha.254",
|
|
85
85
|
"react": "*",
|
|
86
86
|
"react-native": "*",
|
|
87
87
|
"react-native-nitro-modules": "0.37.0"
|