@onekeyfe/react-native-native-list 6.7.0-56 → 6.7.0-58

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 CHANGED
@@ -2335,6 +2335,41 @@ The same native display-link/animator tick changes suffix extent, footer positio
2335
2335
 
2336
2336
  Web/Desktop/extension prefix-preserving tail refinement status: source implemented; Web and Desktop consuming-app preview routes exercised with the local candidate Web overlay. Browser extension was outside that preview scope, and no FPS or paint-duration claim has been verified. The complete accepted snapshot becomes current immediately, while removed suffix rows may remain only in an inert, accessibility-hidden presentation window until the existing 220 ms transition completes. That window follows the same scroll owner and mounts only viewport-near old rows as the owner moves; each row keeps its natural height while the tail is clipped by the interpolated list extent. Inserted suffix rows use their final layout immediately and are revealed by the growing extent. The shared animation frame updates list height, React footer compensation, and programmatic scroll together. Its final scroll range uses the actual parent page extent, including a taller sidecar. For an off-screen fallback, Web uses the footer's complete visible interval where it fits, including the sticky inset, and otherwise aligns the footer start below the sticky region; the retained row is preferred only when the footer is absent. Price patches update the accepted snapshot and visible retained rows without restarting the transition. A newer structure command, unsupported shape, user scroll takeover, reduced motion, resize, or disposal releases presentation nodes and animation ownership without a stale completion writing an older offset. Other structural changes retain the existing behavior. This refinement adds no public field or native behavior; focused Web DOM tests passed, while browser extension and broader runtime performance remain unverified.
2337
2337
 
2338
+ ### Web token table geometry
2339
+
2340
+ Status: implemented with focused SDK regression coverage and consuming-App
2341
+ measurements from a local runtime overlay; formal SDK release integration is
2342
+ separate.
2343
+
2344
+ A Web `DataRow` with exactly the ordered column keys `asset`, `balance`, `price`,
2345
+ and `swapSpacer`, without an ordinal index, favorite control, or checkbox,
2346
+ preserves the legacy four equal columns. Rows with any of those controls retain
2347
+ their existing weighted layout so the controls keep their linear positions.
2348
+ The leading visual and its declared gap share the first column with the asset
2349
+ text; an absent visual reserves no icon inset. Balance and price occupy the
2350
+ second and third columns; the trailing accessories align to the end of the
2351
+ fourth. This closed migration shape uses equal columns instead of the
2352
+ previous weight approximation and removes the row's inherited 12px gap so
2353
+ each track occupies exactly one quarter of the padded content width. Other
2354
+ column shapes retain their existing weighted layout. Rebinding a retained row
2355
+ between these shapes clears the old grid placement, gap override, and asset
2356
+ inset, including when the leading visual is reused.
2357
+ Text, icon size, row height, actions, and iOS/Android layouts retain their
2358
+ existing contracts.
2359
+
2360
+ The Web `listStructureToggle` slot cancels the enclosing footer band's
2361
+ horizontal content inset while disclosure is present, since toggle content owns
2362
+ its page padding. The footer and expanded-content slots keep their existing
2363
+ insets. Changing the accepted content padding updates the compensation;
2364
+ removing disclosure still hides and disables the retained toggle subtree.
2365
+
2366
+ Conformance covers token-to-generic and generic-to-token row reuse, rows with an
2367
+ index/favorite/checkbox, leading visual and disabled action preservation,
2368
+ accepted padding changes, and absent disclosure. The consuming App comparison
2369
+ covers six visible rows and the toggle
2370
+ at 1024, 1280, and 1600 CSS-pixel viewports; it does not establish native runtime
2371
+ acceptance or a performance improvement.
2372
+
2338
2373
  `DataRow.trailing?: readonly TrailingAccessory[]` reuses the existing accessory action contract, including `rowKey`, `actionKey`, disabled state, and accessibility/test labels. At most two accessories are accepted. Desktop Home can render its independent price/balance columns with `DataRow.columns` and a Swap button in `trailing`. Existing rows without `trailing` retain their current layout. On iOS, trailing controls reserve their intrinsic width and the weighted columns fill the remaining row width. Changing between linear and table layout rebinds retained cells even when their row payload is unchanged.
2339
2374
 
2340
2375
  `DataColumn.textSegments` and `secondaryTextSegments` reuse `ValueTextSegment` (`text`, optional `style: 'subscript'`) for formatted prices, balances, and values in each independent table column. Plain `text` and `secondaryText` remain the spoken/fallback strings. Missing segments preserve existing rendering.
@@ -44,6 +44,7 @@ final class NativeListMediaVisibilityTests: XCTestCase {
44
44
  @MainActor
45
45
  final class NativeListMediaFrameCaptureTests: XCTestCase {
46
46
  func testVisibleVideoReleasesPlayerAfterCapturingFirstFrame() throws {
47
+ XCTAssertEqual(UIApplication.shared.applicationState, .active, "Video capture requires a foreground app host")
47
48
  let url = try writeVideo()
48
49
  defer { try? FileManager.default.removeItem(at: url) }
49
50
  let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 320, height: 480))
@@ -385,7 +385,9 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
385
385
  testID: "native-list-structure-toggle-slot",
386
386
  "aria-hidden": !slotState.disclosurePresent,
387
387
  pointerEvents: slotState.disclosurePresent ? 'auto' : 'none',
388
- style: slotState.disclosurePresent ? undefined : collapsedExpandedContentStyle,
388
+ style: slotState.disclosurePresent ? {
389
+ marginHorizontal: -padding
390
+ } : collapsedExpandedContentStyle,
389
391
  children: listStructureToggle
390
392
  }) : null, slotState.expandedTrailingInset > 0 && (listExpandedContent !== undefined || listStructureToggle !== undefined) ? /*#__PURE__*/_jsx(View, {
391
393
  testID: "native-list-trailing-inset-slot",
@@ -12,6 +12,13 @@ function bind(body, row, primitives) {
12
12
  body.removeAttribute('data-nl-container-background');
13
13
  body.removeAttribute('data-nl-container-border');
14
14
  const style = row.style;
15
+ const isTokenTable = row.index === undefined && !row.favorite && !row.checkbox && row.columns.length === 4 && row.columns[0]?.key === 'asset' && row.columns[1]?.key === 'balance' && row.columns[2]?.key === 'price' && row.columns[3]?.key === 'swapSpacer';
16
+ if (isTokenTable) {
17
+ // Match the legacy four equal columns, including the icon in the first.
18
+ body.style.display = 'grid';
19
+ body.style.gridTemplateColumns = 'repeat(4, minmax(0, 1fr))';
20
+ body.style.gap = '0';
21
+ }
15
22
  if (style?.horizontalPadding !== undefined) body.style.paddingInline = `${style.horizontalPadding}px`;
16
23
  if (style?.verticalPadding !== undefined) body.style.paddingBlock = `${style.verticalPadding}px`;
17
24
  v.controls.replaceChildren();
@@ -39,6 +46,9 @@ function bind(body, row, primitives) {
39
46
  v.visualKey = visualKey;
40
47
  }
41
48
  v.visualStyle?.apply(style?.image, style?.image?.width ?? 40, style?.image?.height ?? 40, (style?.leadingGap ?? 12) - 12);
49
+ if (v.visual) v.visual.style.gridArea = isTokenTable ? '1 / 1' : '';
50
+ v.trailing.style.gridArea = isTokenTable ? '1 / 4' : '';
51
+ v.trailing.style.justifySelf = isTokenTable ? 'end' : '';
42
52
  v.columns.forEach((cell, index) => {
43
53
  const column = row.columns[index];
44
54
  cell.body.hidden = !column;
@@ -51,6 +61,12 @@ function bind(body, row, primitives) {
51
61
  cell.body.hidden = false;
52
62
  cell.body.style.flex = String(column.weight ?? 1);
53
63
  cell.body.style.display = 'flex';
64
+ if (isTokenTable) {
65
+ cell.body.style.gridArea = `1 / ${index + 1}`;
66
+ if (index === 0 && v.visual) {
67
+ cell.body.style.marginInlineStart = `${(style?.image?.width ?? 40) + (style?.leadingGap ?? 12)}px`;
68
+ }
69
+ }
54
70
  cell.body.dataset.align = column.alignment ?? 'start';
55
71
  if (style?.lineGap !== undefined) cell.body.style.rowGap = `${style.lineGap}px`;
56
72
  cell.primaryLine.style.cssText = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-native-list",
3
- "version": "6.7.0-56",
3
+ "version": "6.7.0-58",
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",
@@ -617,7 +617,7 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
617
617
  pointerEvents={slotState.disclosurePresent ? 'auto' : 'none'}
618
618
  style={
619
619
  slotState.disclosurePresent
620
- ? undefined
620
+ ? { marginHorizontal: -padding }
621
621
  : collapsedExpandedContentStyle
622
622
  }
623
623
  >
@@ -43,6 +43,22 @@ function bind(body: HTMLElement, row: DataRow, primitives: RowPrimitives) {
43
43
  body.removeAttribute('data-nl-container-background');
44
44
  body.removeAttribute('data-nl-container-border');
45
45
  const style = row.style;
46
+ const isTokenTable =
47
+ row.index === undefined &&
48
+ !row.favorite &&
49
+ !row.checkbox &&
50
+ row.columns.length === 4 &&
51
+ row.columns[0]?.key === 'asset' &&
52
+ row.columns[1]?.key === 'balance' &&
53
+ row.columns[2]?.key === 'price' &&
54
+ row.columns[3]?.key === 'swapSpacer';
55
+ if (isTokenTable) {
56
+ // Match the legacy four equal columns, including the icon in the first.
57
+ body.style.display = 'grid';
58
+ body.style.gridTemplateColumns = 'repeat(4, minmax(0, 1fr))';
59
+ body.style.gap = '0';
60
+ }
61
+
46
62
  if (style?.horizontalPadding !== undefined)
47
63
  body.style.paddingInline = `${style.horizontalPadding}px`;
48
64
  if (style?.verticalPadding !== undefined)
@@ -80,6 +96,9 @@ function bind(body: HTMLElement, row: DataRow, primitives: RowPrimitives) {
80
96
  style?.image?.height ?? 40,
81
97
  (style?.leadingGap ?? 12) - 12
82
98
  );
99
+ if (v.visual) v.visual.style.gridArea = isTokenTable ? '1 / 1' : '';
100
+ v.trailing.style.gridArea = isTokenTable ? '1 / 4' : '';
101
+ v.trailing.style.justifySelf = isTokenTable ? 'end' : '';
83
102
  v.columns.forEach((cell, index) => {
84
103
  const column = row.columns[index];
85
104
  cell.body.hidden = !column;
@@ -92,6 +111,15 @@ function bind(body: HTMLElement, row: DataRow, primitives: RowPrimitives) {
92
111
  cell.body.hidden = false;
93
112
  cell.body.style.flex = String(column.weight ?? 1);
94
113
  cell.body.style.display = 'flex';
114
+ if (isTokenTable) {
115
+ cell.body.style.gridArea = `1 / ${index + 1}`;
116
+ if (index === 0 && v.visual) {
117
+ cell.body.style.marginInlineStart = `${
118
+ (style?.image?.width ?? 40) + (style?.leadingGap ?? 12)
119
+ }px`;
120
+ }
121
+ }
122
+
95
123
  cell.body.dataset.align = column.alignment ?? 'start';
96
124
  if (style?.lineGap !== undefined)
97
125
  cell.body.style.rowGap = `${style.lineGap}px`;