@onekeyfe/react-native-native-list 6.7.0-22 → 6.7.0-23

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
@@ -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
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-native-list",
3
- "version": "6.7.0-22",
3
+ "version": "6.7.0-23",
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-22",
93
- "@onekeyfe/react-native-native-logger": "6.7.0-22",
92
+ "@onekeyfe/react-native-image": "6.7.0-23",
93
+ "@onekeyfe/react-native-native-logger": "6.7.0-23",
94
94
  "react": "*",
95
95
  "react-native": "*",
96
96
  "react-native-nitro-modules": "0.37.0"
@@ -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
  };