@onekeyfe/react-native-native-list 6.7.0-alpha.404 → 6.7.0-alpha.405
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/docs/SPEC.md +8 -0
- package/lib/module/validation.js +1 -1
- package/package.json +3 -3
- package/src/validation.ts +3 -1
package/docs/SPEC.md
CHANGED
|
@@ -553,6 +553,14 @@ existing placeholders, and positive title-image dimensions are clamped to a
|
|
|
553
553
|
square of 1...40 logical units. Image headers are string dictionaries, never
|
|
554
554
|
interpreted as geometry. Unsafe object graphs are rejected before normalization.
|
|
555
555
|
|
|
556
|
+
Shared image URI validation accepts the entire `onekey-avatar:` scheme,
|
|
557
|
+
case-insensitively, in snapshots and row patches on iOS, Android and Web. It does
|
|
558
|
+
not restrict the host, version, path, query string or fragment, and preserves the
|
|
559
|
+
URI without decoding. Existing image URI schemes retain their acceptance rules.
|
|
560
|
+
Unsupported image URIs fail development assertions and are sanitized out in
|
|
561
|
+
production. This is validation acceptance only; avatar decoding and loading
|
|
562
|
+
remain owned by the platform image loader or Web avatar worker.
|
|
563
|
+
|
|
556
564
|
A complete snapshot remains atomic after decoration sanitization: invalid
|
|
557
565
|
schema, duplicate/missing identities, required business fields or wallet-group
|
|
558
566
|
parent/children relationships reject the snapshot. No row is silently removed.
|
package/lib/module/validation.js
CHANGED
|
@@ -1392,7 +1392,7 @@ function isRecord(value) {
|
|
|
1392
1392
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
1393
1393
|
}
|
|
1394
1394
|
function isAllowedImageUri(value) {
|
|
1395
|
-
return typeof value === 'string' && value.trim().length > 0 && (!/^[a-z][a-z\d+.-]*:/i.test(value) || /^(https?|file|content|ph|assets-library|asset|res|blob):/i.test(value) || /^data:image\//i.test(value));
|
|
1395
|
+
return typeof value === 'string' && value.trim().length > 0 && (!/^[a-z][a-z\d+.-]*:/i.test(value) || /^(https?|file|content|ph|assets-library|asset|res|blob|onekey-avatar):/i.test(value) || /^data:image\//i.test(value));
|
|
1396
1396
|
}
|
|
1397
1397
|
const IMAGE_FIELDS = ['uri', 'width', 'height', 'headers', 'contentFit', 'cachePolicy', 'autoplay', 'optimizeTos', 'overscan', 'loadingStrategy', 'fallbackUri', 'fallbackUris', 'retryTimes'];
|
|
1398
1398
|
const ICON_FIELDS = ['name', 'tintColor', 'backgroundColor', 'size', 'accessibilityLabel', 'hoverActionKey'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-list",
|
|
3
|
-
"version": "6.7.0-alpha.
|
|
3
|
+
"version": "6.7.0-alpha.405",
|
|
4
4
|
"description": "Template-driven native RecyclerView and UICollectionView for React Native",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"typescript": "^5.9.2"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@onekeyfe/react-native-image": "6.7.0-alpha.
|
|
90
|
-
"@onekeyfe/react-native-native-logger": "6.7.0-alpha.
|
|
89
|
+
"@onekeyfe/react-native-image": "6.7.0-alpha.405",
|
|
90
|
+
"@onekeyfe/react-native-native-logger": "6.7.0-alpha.405",
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-native": "*",
|
|
93
93
|
"react-native-nitro-modules": "0.37.0"
|
package/src/validation.ts
CHANGED
|
@@ -3083,7 +3083,9 @@ function isAllowedImageUri(value: unknown): value is string {
|
|
|
3083
3083
|
typeof value === 'string' &&
|
|
3084
3084
|
value.trim().length > 0 &&
|
|
3085
3085
|
(!/^[a-z][a-z\d+.-]*:/i.test(value) ||
|
|
3086
|
-
/^(https?|file|content|ph|assets-library|asset|res|blob):/i.test(
|
|
3086
|
+
/^(https?|file|content|ph|assets-library|asset|res|blob|onekey-avatar):/i.test(
|
|
3087
|
+
value
|
|
3088
|
+
) ||
|
|
3087
3089
|
/^data:image\//i.test(value))
|
|
3088
3090
|
);
|
|
3089
3091
|
}
|