@onekeyfe/react-native-native-list 6.7.0-alpha.435 → 6.7.0-alpha.445

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 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
@@ -2190,3 +2202,17 @@ catalog without an App checkout, including raw source digests and viewBox sizes.
2190
2202
  It emits metadata only. Production consumers must supply the complete host icon
2191
2203
  bundle/assets and Web provider; SDK-only fixture tests prove their closed sample
2192
2204
  coverage, while the App's independent generator verifies all 1,909 resources.
2205
+
2206
+ ## Public host-ref types
2207
+
2208
+ `webSectionIndexContainerRef` continues to derive its host instance from
2209
+ `React.ElementRef<typeof View>` with the existing nullable `RefObject` shape.
2210
+ The main integration preserves this existing declaration boundary without a
2211
+ private type import, extra compatibility layer or consumer declaration patch.
2212
+ Fresh normal package prepare/typecheck passed with RN 0.88/React 19.3; an isolated
2213
+ copy of the current sources passed a normal RN 0.86.2 declaration build.
2214
+ Actual View-ref positive/negative fixtures passed on both versions, with RN 0.88
2215
+ bidirectional compatibility against public `ViewInstance`. This is type-only:
2216
+ emitted JavaScript, native schemas, props and list behavior are unchanged by
2217
+ this ref declaration. Independent main-branch Web renderer changes and consumer
2218
+ runtime acceptance remain separately scoped.
@@ -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 => applyTextLayout(text, lines === 0 ? {} : {
222
- lines
223
- }, lines === 0 ? 0 : undefined));
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.getBoundingClientRect().height;
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 { ViewInstance, ViewProps } from 'react-native';
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<ViewInstance | null>;
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-alpha.435",
3
+ "version": "6.7.0-alpha.445",
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": "6.7.0-alpha.435",
93
- "@onekeyfe/react-native-native-logger": "6.7.0-alpha.435",
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"
@@ -1,6 +1,6 @@
1
1
  import type { ScrollEdgeEffect } from './ScrollEdgeEffect';
2
- import type { ReactNode, RefObject } from 'react';
3
- import type { ViewInstance, ViewProps } from 'react-native';
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<ViewInstance | null>;
164
+ webSectionIndexContainerRef?: RefObject<ElementRef<typeof View> | null>;
165
165
  /** Defaults to `none`. `interactive` behaves as `none` on Android. */
166
166
  keyboardDismissMode?: NativeListKeyboardDismissMode;
167
167
  /**
@@ -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.getBoundingClientRect().height;
750
+ const height = body.offsetHeight;
745
751
  return height > 0 ? height : undefined;
746
752
  },
747
753
  };