@onekeyfe/react-native-native-list 6.7.0-23 → 6.7.0-25
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 +4 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +1 -1
- package/docs/SPEC.md +55 -0
- package/ios/NativeListMediaTileRenderer.swift +1 -1
- package/ios/tests/NativeListLifecycleTests.swift +10 -1
- package/lib/module/validation.js +3 -1
- package/lib/typescript/src/NativeList.types.d.ts +3 -3
- package/package.json +3 -3
- package/react-native-native-list.podspec +1 -1
- package/src/NativeList.types.ts +3 -3
- package/src/validation.ts +3 -1
package/README.md
CHANGED
|
@@ -463,3 +463,7 @@ helper directly. These are geometry unit tests, not RecyclerView/UICollectionVie
|
|
|
463
463
|
integration tests. Full-app visibility, unmounted/deferred behavior and
|
|
464
464
|
consumer-owned layout/input cancellation require separate runtime validation;
|
|
465
465
|
see [the scrolling spec](docs/SPEC.md).
|
|
466
|
+
|
|
467
|
+
`webSectionIndexContainerRef` uses the actual View instance type through
|
|
468
|
+
`React.ElementRef<typeof View>`. RN 0.86.2/0.88.0 declaration checks preserve its
|
|
469
|
+
existing nullable ref API without a consumer declaration patch.
|
|
@@ -138,7 +138,7 @@ internal class NativeListMediaTileRowView(context: ThemedReactContext, fonts: Na
|
|
|
138
138
|
val state = item.json.optString("imageState")
|
|
139
139
|
errorIcon.visibility = if (state == "error") VISIBLE else GONE
|
|
140
140
|
errorIcon.iconName = "ImageSquareWavesOutline"
|
|
141
|
-
errorIcon.tintColor =
|
|
141
|
+
errorIcon.tintColor = tint("disabledText", "#8C8C8C")
|
|
142
142
|
errorIcon.useSourceScale = sourceScale
|
|
143
143
|
errorIcon.layoutParams = FrameLayout.LayoutParams(dp(24), dp(24), Gravity.CENTER)
|
|
144
144
|
val media = item.json.optJSONObject("media")
|
package/docs/SPEC.md
CHANGED
|
@@ -71,6 +71,16 @@ prevention; there is no automatic fitting or shrinking pass.
|
|
|
71
71
|
|
|
72
72
|
## Public API and defaults
|
|
73
73
|
|
|
74
|
+
### Media failure placeholder — Implemented
|
|
75
|
+
|
|
76
|
+
Native media-tile failures use the current theme's `disabledText` color for the
|
|
77
|
+
existing local `ImageSquareWavesOutline` icon, including explicit `imageState:
|
|
78
|
+
'error'` and exhausted media probes. A theme rebind updates that tint. Image
|
|
79
|
+
content and SVG decoding remain owned by OneKeyImage; no per-cell WebView or
|
|
80
|
+
fallback network source is added.
|
|
81
|
+
Full-wallet dark/light placeholder acceptance remains a runtime check; source
|
|
82
|
+
completion does not establish that visual result.
|
|
83
|
+
|
|
74
84
|
### Recipient identity and inline warning rows
|
|
75
85
|
|
|
76
86
|
Status: implemented in local source for the Select Address and Swap selectors;
|
|
@@ -689,6 +699,16 @@ Unsupported image URIs fail development assertions and are sanitized out in
|
|
|
689
699
|
production. This is validation acceptance only; avatar decoding and loading
|
|
690
700
|
remain owned by the platform image loader or Web avatar worker.
|
|
691
701
|
|
|
702
|
+
Common mobile image URI schemes are accepted case-insensitively in snapshots
|
|
703
|
+
and row patches: `http:`, `https:`, `file:`, `content:`, `android.resource:`,
|
|
704
|
+
`asset:`, `res:`, `ph:`, `assets-library:` and image `data:` URIs. Relative paths
|
|
705
|
+
and bare resource names remain accepted. In particular, production MUST NOT
|
|
706
|
+
strip bundled Android Release resource URIs such as
|
|
707
|
+
`android.resource://<package>/drawable/<name>`. This only permits the URI through
|
|
708
|
+
shared validation; resource lookup, permissions and decoding remain the
|
|
709
|
+
platform loader's responsibility. No new loader is registered by this policy.
|
|
710
|
+
Android Release App rendering acceptance remains pending.
|
|
711
|
+
|
|
692
712
|
A complete snapshot remains atomic after decoration sanitization: invalid
|
|
693
713
|
schema, duplicate/missing identities, required business fields or wallet-group
|
|
694
714
|
parent/children relationships reject the snapshot. No row is silently removed.
|
|
@@ -2202,3 +2222,38 @@ catalog without an App checkout, including raw source digests and viewBox sizes.
|
|
|
2202
2222
|
It emits metadata only. Production consumers must supply the complete host icon
|
|
2203
2223
|
bundle/assets and Web provider; SDK-only fixture tests prove their closed sample
|
|
2204
2224
|
coverage, while the App's independent generator verifies all 1,909 resources.
|
|
2225
|
+
|
|
2226
|
+
## Public host-ref types
|
|
2227
|
+
|
|
2228
|
+
`webSectionIndexContainerRef` continues to derive its host instance from
|
|
2229
|
+
`React.ElementRef<typeof View>` with the existing nullable `RefObject` shape.
|
|
2230
|
+
The main integration preserves this existing declaration boundary without a
|
|
2231
|
+
private type import, extra compatibility layer or consumer declaration patch.
|
|
2232
|
+
Fresh normal package prepare/typecheck passed with RN 0.88/React 19.3; an isolated
|
|
2233
|
+
copy of the current sources passed a normal RN 0.86.2 declaration build.
|
|
2234
|
+
Actual View-ref positive/negative fixtures passed on both versions, with RN 0.88
|
|
2235
|
+
bidirectional compatibility against public `ViewInstance`. This is type-only:
|
|
2236
|
+
emitted JavaScript, native schemas, props and list behavior are unchanged by
|
|
2237
|
+
this ref declaration. Independent main-branch Web renderer changes and consumer
|
|
2238
|
+
runtime acceptance remain separately scoped.
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
## Registry consumer integration (2026-11-05)
|
|
2242
|
+
|
|
2243
|
+
Preview alpha.449 from source `76834daf9` was normally installed together with
|
|
2244
|
+
Pager; all 330 installed NativeList files match its verified registry tarball.
|
|
2245
|
+
The published runtime includes main's Web identity-row layout and iOS empty
|
|
2246
|
+
accessory constraint changes; the earlier types-only overlay is historical.
|
|
2247
|
+
New iOS source/object/built/installed binary hashes bind this Swift renderer.
|
|
2248
|
+
The existing App account-selector rows were opened and closed without importing
|
|
2249
|
+
accounts or editing the independent consumer WIP. This is row integration
|
|
2250
|
+
coverage; ellipsis accessory rows do not prove the empty-accessory branch.
|
|
2251
|
+
SDK iOS CI independently passed the empty-trailing, rebind and spinner layout
|
|
2252
|
+
cases. Actual Web Recipient auto-height rows and the installed public fixture's
|
|
2253
|
+
scale/width/long-word/same-DOM reuse checks were separately exercised. External
|
|
2254
|
+
notification/image/postinstall warnings and other prior limits remain recorded.
|
|
2255
|
+
|
|
2256
|
+
Internal Pod edges use unversioned CocoaPods dependencies, matching the npm
|
|
2257
|
+
internal `*` policy while retaining external constraints. Real specification
|
|
2258
|
+
readback is `>= 0`; normal SDK example and consumer Pod installs passed. This
|
|
2259
|
+
does not retroactively make alpha.445's invalid `*` Pod requirement usable.
|
|
@@ -126,7 +126,7 @@ final class NativeListMediaTileCell: NativeListRendererCell {
|
|
|
126
126
|
let placeholder = theme?.string("strongBackground", default: "#0000000F") ?? "#0000000F"
|
|
127
127
|
errorIcon.isHidden = state != "error"
|
|
128
128
|
errorIcon.bindIcon("ImageSquareWavesOutline")
|
|
129
|
-
errorIcon.tintColor =
|
|
129
|
+
errorIcon.tintColor = nativeListColor(theme, "disabledText", "#8C8C8C")
|
|
130
130
|
let media = item.data.dictionary("media")
|
|
131
131
|
if state != "empty", state != "error", let source = media?.dictionary("source") ?? item.data.dictionary("image") {
|
|
132
132
|
// Legacy source-backed media had a transparent container. Clear only a fill this
|
|
@@ -1601,8 +1601,15 @@ final class NativeListLifecycleTests: XCTestCase {
|
|
|
1601
1601
|
let view = NativeListView(frame: window.bounds)
|
|
1602
1602
|
controller.view.addSubview(view)
|
|
1603
1603
|
window.isHidden = false
|
|
1604
|
-
defer {
|
|
1604
|
+
defer {
|
|
1605
|
+
view.dispose()
|
|
1606
|
+
view.removeFromSuperview()
|
|
1607
|
+
window.isHidden = true
|
|
1608
|
+
window.rootViewController = nil
|
|
1609
|
+
}
|
|
1605
1610
|
let list = try XCTUnwrap(view.subviews.compactMap { $0 as? UICollectionView }.first)
|
|
1611
|
+
// Measure renderer reuse without UIKit's timing-dependent speculative prefetch cells.
|
|
1612
|
+
list.isPrefetchingEnabled = false
|
|
1606
1613
|
func sampleCells(count: Int) throws -> [(visible: Int, attached: Int)] {
|
|
1607
1614
|
view.applySnapshotJson(try structuralRowsSnapshot(count: count))
|
|
1608
1615
|
view.layoutIfNeeded()
|
|
@@ -1611,6 +1618,8 @@ final class NativeListLifecycleTests: XCTestCase {
|
|
|
1611
1618
|
return [CGFloat(0), lastOffset / 2, lastOffset].map { offset in
|
|
1612
1619
|
list.setContentOffset(CGPoint(x: 0, y: offset), animated: false)
|
|
1613
1620
|
list.layoutIfNeeded()
|
|
1621
|
+
drainMainQueue()
|
|
1622
|
+
list.layoutIfNeeded()
|
|
1614
1623
|
return (list.visibleCells.count,
|
|
1615
1624
|
list.subviews.compactMap { $0 as? NativeListRowHost }.count)
|
|
1616
1625
|
}
|
package/lib/module/validation.js
CHANGED
|
@@ -1442,7 +1442,9 @@ function isRecord(value) {
|
|
|
1442
1442
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
1443
1443
|
}
|
|
1444
1444
|
function isAllowedImageUri(value) {
|
|
1445
|
-
|
|
1445
|
+
// Keep native file, content, Photos and bundled-resource URIs alongside web images.
|
|
1446
|
+
// Android Release uses android.resource: instead of Metro's HTTP asset URLs.
|
|
1447
|
+
return typeof value === 'string' && value.trim().length > 0 && (!/^[a-z][a-z\d+.-]*:/i.test(value) || /^(https?|file|content|ph|assets-library|asset|res|android\.resource|blob|onekey-avatar):/i.test(value) || /^data:image\//i.test(value));
|
|
1446
1448
|
}
|
|
1447
1449
|
const IMAGE_FIELDS = ['uri', 'width', 'height', 'headers', 'contentFit', 'cachePolicy', 'autoplay', 'optimizeTos', 'overscan', 'loadingStrategy', 'fallbackUri', 'fallbackUris', 'retryTimes'];
|
|
1448
1450
|
const ICON_FIELDS = ['name', 'tintColor', 'backgroundColor', 'size', 'accessibilityLabel', 'hoverActionKey'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScrollEdgeEffect } from './ScrollEdgeEffect';
|
|
2
|
-
import type { ReactNode, RefObject } from 'react';
|
|
3
|
-
import type {
|
|
2
|
+
import type { ElementRef, ReactNode, RefObject } from 'react';
|
|
3
|
+
import type { View, ViewProps } from 'react-native';
|
|
4
4
|
import type { ActionAnchorInvalidatedEvent, EndReachedEvent, NativeListSnapshot, ReorderEvent, RowActionEvent, RowModel, RowPatch, SelectionDeltaEvent, VisibleRangeChangedEvent } from './models';
|
|
5
5
|
export type ActionAnchorState = Readonly<{
|
|
6
6
|
token: string;
|
|
@@ -114,7 +114,7 @@ export type NativeListProps = Omit<ViewProps, 'children'> & Readonly<{
|
|
|
114
114
|
/** Web only: visible sticky chrome above the parent's list viewport. */
|
|
115
115
|
webStickyInset?: number;
|
|
116
116
|
/** Web only. Hosts the section index inside this container. */
|
|
117
|
-
webSectionIndexContainerRef?: RefObject<
|
|
117
|
+
webSectionIndexContainerRef?: RefObject<ElementRef<typeof View> | null>;
|
|
118
118
|
/** Defaults to `none`. `interactive` behaves as `none` on Android. */
|
|
119
119
|
keyboardDismissMode?: NativeListKeyboardDismissMode;
|
|
120
120
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-list",
|
|
3
|
-
"version": "6.7.0-
|
|
3
|
+
"version": "6.7.0-25",
|
|
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",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"typescript": "^5.9.2"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"@onekeyfe/react-native-image": "
|
|
93
|
-
"@onekeyfe/react-native-native-logger": "
|
|
92
|
+
"@onekeyfe/react-native-image": "*",
|
|
93
|
+
"@onekeyfe/react-native-native-logger": "*",
|
|
94
94
|
"react": "*",
|
|
95
95
|
"react-native": "*",
|
|
96
96
|
"react-native-nitro-modules": "0.37.0"
|
|
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
|
|
|
23
23
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20"
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
s.dependency "OneKeyImage"
|
|
26
|
+
s.dependency "OneKeyImage"
|
|
27
27
|
s.dependency "React-jsi"
|
|
28
28
|
s.dependency "React-callinvoker"
|
|
29
29
|
|
package/src/NativeList.types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScrollEdgeEffect } from './ScrollEdgeEffect';
|
|
2
|
-
import type { ReactNode, RefObject } from 'react';
|
|
3
|
-
import type {
|
|
2
|
+
import type { ElementRef, ReactNode, RefObject } from 'react';
|
|
3
|
+
import type { View, ViewProps } from 'react-native';
|
|
4
4
|
import type {
|
|
5
5
|
ActionAnchorInvalidatedEvent,
|
|
6
6
|
EndReachedEvent,
|
|
@@ -161,7 +161,7 @@ export type NativeListProps = Omit<ViewProps, 'children'> &
|
|
|
161
161
|
/** Web only: visible sticky chrome above the parent's list viewport. */
|
|
162
162
|
webStickyInset?: number;
|
|
163
163
|
/** Web only. Hosts the section index inside this container. */
|
|
164
|
-
webSectionIndexContainerRef?: RefObject<
|
|
164
|
+
webSectionIndexContainerRef?: RefObject<ElementRef<typeof View> | null>;
|
|
165
165
|
/** Defaults to `none`. `interactive` behaves as `none` on Android. */
|
|
166
166
|
keyboardDismissMode?: NativeListKeyboardDismissMode;
|
|
167
167
|
/**
|
package/src/validation.ts
CHANGED
|
@@ -3174,11 +3174,13 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
3174
3174
|
}
|
|
3175
3175
|
|
|
3176
3176
|
function isAllowedImageUri(value: unknown): value is string {
|
|
3177
|
+
// Keep native file, content, Photos and bundled-resource URIs alongside web images.
|
|
3178
|
+
// Android Release uses android.resource: instead of Metro's HTTP asset URLs.
|
|
3177
3179
|
return (
|
|
3178
3180
|
typeof value === 'string' &&
|
|
3179
3181
|
value.trim().length > 0 &&
|
|
3180
3182
|
(!/^[a-z][a-z\d+.-]*:/i.test(value) ||
|
|
3181
|
-
/^(https?|file|content|ph|assets-library|asset|res|blob|onekey-avatar):/i.test(
|
|
3183
|
+
/^(https?|file|content|ph|assets-library|asset|res|android\.resource|blob|onekey-avatar):/i.test(
|
|
3182
3184
|
value
|
|
3183
3185
|
) ||
|
|
3184
3186
|
/^data:image\//i.test(value))
|