@onekeyfe/react-native-native-list 6.7.0-22 → 6.7.0-24
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/docs/SPEC.md +58 -1
- package/ios/tests/NativeListLifecycleTests.swift +10 -1
- package/lib/module/validation.js +3 -1
- package/lib/module/web/templates/IdentityRowRenderer.js +8 -4
- 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/src/web/templates/IdentityRowRenderer.ts +10 -4
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.
|
package/docs/SPEC.md
CHANGED
|
@@ -74,7 +74,7 @@ prevention; there is no automatic fitting or shrinking pass.
|
|
|
74
74
|
### Recipient identity and inline warning rows
|
|
75
75
|
|
|
76
76
|
Status: implemented in local source for the Select Address and Swap selectors;
|
|
77
|
-
native device and Web runtime verification remain pending. These fields travel in snapshot/patch JSON
|
|
77
|
+
native device and broader Web runtime verification remain pending. These fields travel in snapshot/patch JSON
|
|
78
78
|
and do not change the Nitro ABI.
|
|
79
79
|
|
|
80
80
|
An `identity` row may opt into `subtitleLines: 0`, meaning the complete subtitle
|
|
@@ -88,6 +88,18 @@ height changes with row width, text, style or configured font and may not retain
|
|
|
88
88
|
a stale prior width's measurement. The existing 4096 UTF-16-code-unit bound per
|
|
89
89
|
text field still applies; zero is not an unlimited data-size allowance.
|
|
90
90
|
|
|
91
|
+
On Web, opt-in auto-height identity rows without an explicit height use the
|
|
92
|
+
intrinsic body height in CSS layout pixels, before ancestor transforms. A hidden
|
|
93
|
+
body with zero layout height supplies no rendered measurement; zero MUST NOT
|
|
94
|
+
replace a valid layout height. Rebinding between automatic and explicit height
|
|
95
|
+
restores the corresponding body sizing. Multiline subtitles, including
|
|
96
|
+
`subtitleLines: 0`, break unspaced words within the text-column width; single-line
|
|
97
|
+
behavior remains unchanged.
|
|
98
|
+
|
|
99
|
+
Auto-height recipient rows are production-consumer verified with isolated wallet
|
|
100
|
+
fixtures, including modal scaling, width changes and row reuse. This scoped
|
|
101
|
+
acceptance does not establish Electron or browser-extension runtime acceptance.
|
|
102
|
+
|
|
91
103
|
An `identity` row may set `longPressActionKey` to a nonempty action key. A valid
|
|
92
104
|
touch long press on an enabled row emits one `onRowAction` with its current row key,
|
|
93
105
|
action key, `row` anchor source and window press point. An accessibility long-click
|
|
@@ -677,6 +689,16 @@ Unsupported image URIs fail development assertions and are sanitized out in
|
|
|
677
689
|
production. This is validation acceptance only; avatar decoding and loading
|
|
678
690
|
remain owned by the platform image loader or Web avatar worker.
|
|
679
691
|
|
|
692
|
+
Common mobile image URI schemes are accepted case-insensitively in snapshots
|
|
693
|
+
and row patches: `http:`, `https:`, `file:`, `content:`, `android.resource:`,
|
|
694
|
+
`asset:`, `res:`, `ph:`, `assets-library:` and image `data:` URIs. Relative paths
|
|
695
|
+
and bare resource names remain accepted. In particular, production MUST NOT
|
|
696
|
+
strip bundled Android Release resource URIs such as
|
|
697
|
+
`android.resource://<package>/drawable/<name>`. This only permits the URI through
|
|
698
|
+
shared validation; resource lookup, permissions and decoding remain the
|
|
699
|
+
platform loader's responsibility. No new loader is registered by this policy.
|
|
700
|
+
Android Release App rendering acceptance remains pending.
|
|
701
|
+
|
|
680
702
|
A complete snapshot remains atomic after decoration sanitization: invalid
|
|
681
703
|
schema, duplicate/missing identities, required business fields or wallet-group
|
|
682
704
|
parent/children relationships reject the snapshot. No row is silently removed.
|
|
@@ -2190,3 +2212,38 @@ catalog without an App checkout, including raw source digests and viewBox sizes.
|
|
|
2190
2212
|
It emits metadata only. Production consumers must supply the complete host icon
|
|
2191
2213
|
bundle/assets and Web provider; SDK-only fixture tests prove their closed sample
|
|
2192
2214
|
coverage, while the App's independent generator verifies all 1,909 resources.
|
|
2215
|
+
|
|
2216
|
+
## Public host-ref types
|
|
2217
|
+
|
|
2218
|
+
`webSectionIndexContainerRef` continues to derive its host instance from
|
|
2219
|
+
`React.ElementRef<typeof View>` with the existing nullable `RefObject` shape.
|
|
2220
|
+
The main integration preserves this existing declaration boundary without a
|
|
2221
|
+
private type import, extra compatibility layer or consumer declaration patch.
|
|
2222
|
+
Fresh normal package prepare/typecheck passed with RN 0.88/React 19.3; an isolated
|
|
2223
|
+
copy of the current sources passed a normal RN 0.86.2 declaration build.
|
|
2224
|
+
Actual View-ref positive/negative fixtures passed on both versions, with RN 0.88
|
|
2225
|
+
bidirectional compatibility against public `ViewInstance`. This is type-only:
|
|
2226
|
+
emitted JavaScript, native schemas, props and list behavior are unchanged by
|
|
2227
|
+
this ref declaration. Independent main-branch Web renderer changes and consumer
|
|
2228
|
+
runtime acceptance remain separately scoped.
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
## Registry consumer integration (2026-11-05)
|
|
2232
|
+
|
|
2233
|
+
Preview alpha.449 from source `76834daf9` was normally installed together with
|
|
2234
|
+
Pager; all 330 installed NativeList files match its verified registry tarball.
|
|
2235
|
+
The published runtime includes main's Web identity-row layout and iOS empty
|
|
2236
|
+
accessory constraint changes; the earlier types-only overlay is historical.
|
|
2237
|
+
New iOS source/object/built/installed binary hashes bind this Swift renderer.
|
|
2238
|
+
The existing App account-selector rows were opened and closed without importing
|
|
2239
|
+
accounts or editing the independent consumer WIP. This is row integration
|
|
2240
|
+
coverage; ellipsis accessory rows do not prove the empty-accessory branch.
|
|
2241
|
+
SDK iOS CI independently passed the empty-trailing, rebind and spinner layout
|
|
2242
|
+
cases. Actual Web Recipient auto-height rows and the installed public fixture's
|
|
2243
|
+
scale/width/long-word/same-DOM reuse checks were separately exercised. External
|
|
2244
|
+
notification/image/postinstall warnings and other prior limits remain recorded.
|
|
2245
|
+
|
|
2246
|
+
Internal Pod edges use unversioned CocoaPods dependencies, matching the npm
|
|
2247
|
+
internal `*` policy while retaining external constraints. Real specification
|
|
2248
|
+
readback is `>= 0`; normal SDK example and consumer Pod installs passed. This
|
|
2249
|
+
does not retroactively make alpha.445's invalid `*` Pod requirement usable.
|
|
@@ -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'];
|
|
@@ -218,9 +218,12 @@ function createIdentityRow(document, primitives, row) {
|
|
|
218
218
|
}
|
|
219
219
|
for (const key of ['title', 'subtitle']) {
|
|
220
220
|
const lines = row.style?.[key]?.lines ?? row[`${key}Lines`];
|
|
221
|
-
if (lines !== undefined) column.querySelectorAll(`[data-nl-slot="${key}"]`).forEach(text =>
|
|
222
|
-
lines
|
|
223
|
-
|
|
221
|
+
if (lines !== undefined) column.querySelectorAll(`[data-nl-slot="${key}"]`).forEach(text => {
|
|
222
|
+
applyTextLayout(text, lines === 0 ? {} : {
|
|
223
|
+
lines
|
|
224
|
+
}, lines === 0 ? 0 : undefined);
|
|
225
|
+
if (key === 'subtitle') text.style.overflowWrap = lines === 1 ? '' : 'anywhere';
|
|
226
|
+
});
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
body.appendChild(column);
|
|
@@ -402,6 +405,7 @@ function bind(body, row, primitives) {
|
|
|
402
405
|
}
|
|
403
406
|
}
|
|
404
407
|
applyIdentityStyle(body, row);
|
|
408
|
+
body.style.height = row.contentHeight === 'auto' && !hasExplicitRowHeight(row) ? 'auto' : '100%';
|
|
405
409
|
}
|
|
406
410
|
function create(document, row, primitives) {
|
|
407
411
|
const body = document.createElement('div');
|
|
@@ -431,7 +435,7 @@ export const identityRowRenderer = {
|
|
|
431
435
|
measure: (row, _width) => row.presentation === 'walletSidebar' ? 68 + (row.badges?.length ? 24 : 0) : row.presentation === 'networkSelector' ? 47 : row.presentation === 'accountSelector' ? 58 : row.tertiary ? 72 : row.subtitle ? 60 : 56,
|
|
432
436
|
measureRendered: (body, row) => {
|
|
433
437
|
if (row.contentHeight !== 'auto' || hasExplicitRowHeight(row)) return undefined;
|
|
434
|
-
const height = body.
|
|
438
|
+
const height = body.offsetHeight;
|
|
435
439
|
return height > 0 ? height : undefined;
|
|
436
440
|
}
|
|
437
441
|
};
|
|
@@ -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-24",
|
|
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))
|
|
@@ -407,13 +407,15 @@ function createIdentityRow(
|
|
|
407
407
|
if (lines !== undefined)
|
|
408
408
|
column
|
|
409
409
|
.querySelectorAll<HTMLElement>(`[data-nl-slot="${key}"]`)
|
|
410
|
-
.forEach((text) =>
|
|
410
|
+
.forEach((text) => {
|
|
411
411
|
applyTextLayout(
|
|
412
412
|
text,
|
|
413
413
|
lines === 0 ? {} : { lines },
|
|
414
414
|
lines === 0 ? 0 : undefined
|
|
415
|
-
)
|
|
416
|
-
|
|
415
|
+
);
|
|
416
|
+
if (key === 'subtitle')
|
|
417
|
+
text.style.overflowWrap = lines === 1 ? '' : 'anywhere';
|
|
418
|
+
});
|
|
417
419
|
}
|
|
418
420
|
}
|
|
419
421
|
body.appendChild(column);
|
|
@@ -695,6 +697,10 @@ function bind(body: HTMLElement, row: IdentityRow, primitives: RowPrimitives) {
|
|
|
695
697
|
}
|
|
696
698
|
|
|
697
699
|
applyIdentityStyle(body, row);
|
|
700
|
+
body.style.height =
|
|
701
|
+
row.contentHeight === 'auto' && !hasExplicitRowHeight(row)
|
|
702
|
+
? 'auto'
|
|
703
|
+
: '100%';
|
|
698
704
|
}
|
|
699
705
|
function create(
|
|
700
706
|
document: Document,
|
|
@@ -741,7 +747,7 @@ export const identityRowRenderer = {
|
|
|
741
747
|
): number | undefined => {
|
|
742
748
|
if (row.contentHeight !== 'auto' || hasExplicitRowHeight(row))
|
|
743
749
|
return undefined;
|
|
744
|
-
const height = body.
|
|
750
|
+
const height = body.offsetHeight;
|
|
745
751
|
return height > 0 ? height : undefined;
|
|
746
752
|
},
|
|
747
753
|
};
|