@onekeyfe/react-native-native-list 6.7.0-5 → 6.7.0-51

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.
Files changed (214) hide show
  1. package/README.md +312 -375
  2. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
  3. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +250 -9
  4. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
  5. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
  6. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
  7. package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
  8. package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
  9. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
  10. package/android/src/main/java/com/onekey/nativelist/NativeListGeneratedIcons.kt +47 -0
  11. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
  12. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +152 -33
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPlaceholderView.kt +244 -0
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
  16. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +32 -11
  17. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
  18. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
  19. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -287
  20. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
  21. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +7 -0
  22. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
  24. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
  25. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1978 -136
  26. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
  27. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
  28. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
  29. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
  30. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
  31. package/docs/ROW_TEMPLATES.md +74 -13
  32. package/docs/SPEC.md +1232 -16
  33. package/docs/STYLE_SPEC.md +14 -0
  34. package/ios/HybridNativeList.swift +21 -2
  35. package/ios/NativeListAccessoryStack.swift +237 -51
  36. package/ios/NativeListActivityDetailsView.swift +30 -11
  37. package/ios/NativeListActivityRenderer.swift +8 -2
  38. package/ios/NativeListButtonGroupRenderer.swift +89 -0
  39. package/ios/NativeListDataRowRenderer.swift +167 -30
  40. package/ios/NativeListDesignAssets.swift +13 -75
  41. package/ios/NativeListGeneratedIcons.swift +55 -0
  42. package/ios/NativeListIconBinding.swift +171 -0
  43. package/ios/NativeListIdentityRenderer.swift +256 -39
  44. package/ios/NativeListLeadingVisual.swift +127 -28
  45. package/ios/NativeListMarketRenderer.swift +120 -31
  46. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  47. package/ios/NativeListMediaPreviewSlot.swift +122 -61
  48. package/ios/NativeListMediaTileRenderer.swift +15 -11
  49. package/ios/NativeListMessageRenderer.swift +34 -1
  50. package/ios/NativeListMetricCardRenderer.swift +4 -2
  51. package/ios/NativeListModels.swift +42 -2
  52. package/ios/NativeListRendererRegistry.swift +1 -0
  53. package/ios/NativeListResolvedText.swift +2 -1
  54. package/ios/NativeListRowHost.swift +14 -0
  55. package/ios/NativeListSectionHeaderRenderer.swift +100 -4
  56. package/ios/RNCNativeListView.swift +1093 -59
  57. package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
  58. package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
  59. package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
  60. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
  61. package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
  62. package/ios/tests/NativeListLifecycleTests.swift +2915 -4
  63. package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
  64. package/ios/tests/NativeListMediaVisibilityTests.swift +26 -1
  65. package/ios/tests/NativeListSharedIconTests.swift +236 -0
  66. package/lib/module/NativeList.js +236 -38
  67. package/lib/module/NativeList.web.js +167 -46
  68. package/lib/module/index.js +1 -1
  69. package/lib/module/models.js +3 -0
  70. package/lib/module/selection.js +1 -1
  71. package/lib/module/validation.js +1246 -48
  72. package/lib/module/web/NativeListGeneratedIcons.js +31 -0
  73. package/lib/module/web/NativeListWebEngine.js +513 -275
  74. package/lib/module/web/templates/ActivityRowRenderer.js +12 -31
  75. package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
  76. package/lib/module/web/templates/DataRowRenderer.js +40 -5
  77. package/lib/module/web/templates/IdentityRowRenderer.js +158 -6
  78. package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
  79. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -25
  80. package/lib/module/web/templates/MessageRowRenderer.js +18 -2
  81. package/lib/module/web/templates/RowContainerStyle.js +1 -0
  82. package/lib/module/web/templates/RowRendererRegistry.js +3 -0
  83. package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
  84. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  85. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  86. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  87. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  88. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  89. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  90. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  91. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  92. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  93. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  94. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  95. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  96. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  97. package/lib/typescript/src/NativeList.d.ts +3 -3
  98. package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
  99. package/lib/typescript/src/NativeList.types.d.ts +20 -2
  100. package/lib/typescript/src/index.d.ts +2 -2
  101. package/lib/typescript/src/models.d.ts +126 -17
  102. package/lib/typescript/src/validation.d.ts +20 -0
  103. package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
  104. package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
  105. package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
  106. package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
  107. package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +9 -3
  108. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  109. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  110. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  112. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  113. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  114. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  115. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  116. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  117. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  118. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  119. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  120. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  121. package/package.json +16 -10
  122. package/react-native-native-list.podspec +2 -6
  123. package/scripts/generate-icons.mjs +150 -0
  124. package/scripts/generate-icons.test.mjs +288 -0
  125. package/scripts/native-list-icons.json +260 -0
  126. package/src/NativeList.nitro.ts +2 -0
  127. package/src/NativeList.tsx +439 -91
  128. package/src/NativeList.types.ts +24 -2
  129. package/src/NativeList.web.tsx +295 -89
  130. package/src/index.ts +2 -0
  131. package/src/models.ts +263 -144
  132. package/src/selection.ts +1 -0
  133. package/src/validation.ts +3013 -152
  134. package/src/web/NativeListGeneratedIcons.ts +28 -0
  135. package/src/web/NativeListWebEngine.ts +818 -343
  136. package/src/web/templates/ActivityRowRenderer.ts +29 -59
  137. package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
  138. package/src/web/templates/DataRowRenderer.ts +93 -20
  139. package/src/web/templates/IdentityRowRenderer.ts +231 -6
  140. package/src/web/templates/MarketTableRowRenderer.ts +53 -33
  141. package/src/web/templates/MediaTileRowRenderer.ts +90 -28
  142. package/src/web/templates/MessageRowRenderer.ts +23 -7
  143. package/src/web/templates/RowContainerStyle.ts +2 -0
  144. package/src/web/templates/RowRendererRegistry.ts +11 -1
  145. package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
  146. package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
  147. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
  148. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
  149. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
  150. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
  151. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
  152. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
  153. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
  154. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
  155. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
  156. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
  157. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
  158. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
  159. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
  160. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
  161. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
  162. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
  163. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
  164. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
  165. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
  166. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
  167. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
  168. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
  169. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
  170. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
  171. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
  172. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
  173. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
  174. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
  175. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
  176. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
  177. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
  178. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
  179. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
  180. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
  181. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
  182. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
  183. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
  184. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
  185. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
  186. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
  187. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
  188. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
  189. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
  190. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
  191. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
  192. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
  193. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
  194. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
  195. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
  196. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
  197. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
  198. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
  199. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
  200. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
  201. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
  202. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
  203. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
  204. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
  205. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
  206. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
  207. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
  208. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
  209. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
  210. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
  211. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
  212. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
  213. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
  214. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
package/src/models.ts CHANGED
@@ -185,6 +185,7 @@ export const ROW_BOX_STYLE_KEYS_BY_TYPE = {
185
185
  'trailingGap',
186
186
  'image',
187
187
  ],
188
+ buttonGroup: [],
188
189
  system: ['horizontalPadding', 'verticalPadding', 'lineGap'],
189
190
  } as const;
190
191
 
@@ -201,6 +202,7 @@ type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<
201
202
  */
202
203
  export type IdentityRowStyle = TemplateBoxStyle<'identity'> &
203
204
  Readonly<{
205
+ leadingContentMaxWidthRatio?: number;
204
206
  title?: NativeListTextStyle;
205
207
  subtitle?: NativeListTextStyle;
206
208
  tertiary?: NativeListTextStyle;
@@ -279,8 +281,16 @@ export type SectionHeaderRowStyle = TemplateBoxStyle<'sectionHeader'> &
279
281
  title?: NativeListTextStyle;
280
282
  subtitle?: NativeListTextStyle;
281
283
  value?: NativeListTextStyle;
284
+ valuePlacement?: 'afterTitle';
285
+ titleDecoration?: 'none' | 'dashed';
282
286
  }>;
283
287
 
288
+ export type RowTextHelp = Readonly<{
289
+ actionKey: string;
290
+ presentation: 'tooltip' | 'popover';
291
+ underline?: 'dashed';
292
+ }>;
293
+
284
294
  export type ActionRowStyle = TemplateBoxStyle<'action'> &
285
295
  Readonly<{
286
296
  title?: NativeListTextStyle;
@@ -344,19 +354,27 @@ export type VisualOverlay = Readonly<{
344
354
  offsetX?: number;
345
355
  offsetY?: number;
346
356
  image?: ImageSource;
357
+ fallbackIcon?: Readonly<{ name: string; tintColor?: string }>;
347
358
  name?: string;
348
359
  text?: string;
360
+ fontWeight?: NativeListTextStyle['fontWeight'];
349
361
  tintColor?: string;
350
362
  backgroundColor?: string;
351
363
  }>;
352
364
 
353
365
  type VisualWithImage = Readonly<{
354
- fallbackIcon?: Readonly<{ name: string; tintColor?: string }>;
366
+ fallbackIcon?: Readonly<{
367
+ name: string;
368
+ tintColor?: string;
369
+ size?: number;
370
+ backgroundColor?: string;
371
+ }>;
355
372
  overlays?: readonly VisualOverlay[];
356
373
  borderStyle?: 'dashed';
357
374
  borderColor?: string;
358
375
  image?: ImageSource;
359
376
  fallbackText?: string;
377
+ fallbackTextColor?: string;
360
378
  backgroundColor?: string;
361
379
  shape?: 'circle' | 'rounded' | 'square';
362
380
  cornerIcon?: Readonly<{
@@ -408,9 +426,26 @@ export type TrailingAccessory =
408
426
  kind: 'valuePair';
409
427
  primary: string;
410
428
  secondary: string;
429
+ primaryFontWeight?: 'medium';
430
+ primaryHelp?: RowTextHelp;
431
+ primaryTextSegments?: readonly ValueTextSegment[];
432
+ secondaryTextSegments?: readonly ValueTextSegment[];
411
433
  primaryTone?: TextTone;
412
434
  secondaryTone?: TextTone;
413
435
  }>
436
+ | Readonly<{
437
+ kind: 'button';
438
+ label: string;
439
+ actionKey: string;
440
+ disabled?: boolean;
441
+ testID?: string;
442
+ accessibilityLabel?: string;
443
+ textColor?: string;
444
+ backgroundColor?: string;
445
+ pressedBackgroundColor?: string;
446
+ hoverBackgroundColor?: string;
447
+ focusRingColor?: string;
448
+ }>
414
449
  | Readonly<{
415
450
  kind: 'checkbox';
416
451
  state: CheckboxState;
@@ -438,6 +473,7 @@ export type TrailingAccessory =
438
473
  kind: 'icon';
439
474
  name: string;
440
475
  tintColor?: string;
476
+ buttonStyle?: 'tertiary';
441
477
  disabled?: boolean;
442
478
  actionKey?: string;
443
479
  testID?: string;
@@ -480,6 +516,10 @@ export type RowBase = Readonly<{
480
516
  export type IdentityRow = RowBase &
481
517
  Readonly<{
482
518
  type: 'identity';
519
+ /** Opt in to content-based height; explicit row/container height still wins. */
520
+ contentHeight?: 'auto';
521
+ /** Emits a row action instead of a press after a successful long press. */
522
+ longPressActionKey?: string;
483
523
  // OneKey patch: UTF-16 ranges match Fuse indices and native attributed strings.
484
524
  titleMatch?: readonly Readonly<{ start: number; end: number }>[];
485
525
  titleActionKey?: string;
@@ -489,11 +529,34 @@ export type IdentityRow = RowBase &
489
529
  leading: LeadingVisual;
490
530
  leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
491
531
  title: string;
532
+ /** Plain 12/16 labels beside the title, preserving independent tones. */
533
+ titleSuffixes?: readonly Readonly<{
534
+ text: string;
535
+ tone: 'secondary' | 'disabled';
536
+ maxWidth?: number;
537
+ }>[];
538
+ titleIcon?: Readonly<{
539
+ name: string;
540
+ tintColor?: string;
541
+ accessibilityLabel?: string;
542
+ /** Web-only anchored help from this icon; does not add a click action. */
543
+ hoverActionKey?: string;
544
+ }>;
545
+ /** Web-only additional help icon after titleIcon. */
546
+ secondaryTitleIcon?: IdentityRow['titleIcon'];
547
+ /** Circular image after title icons; image dimensions must be square, 1...40. */
548
+ titleImage?: Readonly<{
549
+ image: ImageSource;
550
+ accessibilityLabel?: string;
551
+ /** Web-only help anchor; the consumer owns tooltip content. */
552
+ hoverActionKey?: string;
553
+ }>;
492
554
  subtitle?: string;
493
555
  tertiary?: string;
494
556
  tertiaryTone?: 'secondary' | 'info';
495
557
  titleLines?: 1 | 2;
496
- subtitleLines?: 1 | 2;
558
+ /** Zero displays the complete subtitle. */
559
+ subtitleLines?: 0 | 1 | 2;
497
560
  badges?: readonly BadgeModel[];
498
561
  trailing?: readonly TrailingAccessory[];
499
562
  draggable?: boolean;
@@ -534,6 +597,7 @@ export type ActivityRow = RowBase &
534
597
  Readonly<{
535
598
  type: 'activity';
536
599
  leading: LeadingVisual;
600
+ hideLeading?: boolean;
537
601
  secondaryLeading?: LeadingVisual;
538
602
  title: string;
539
603
  description?: string;
@@ -559,11 +623,14 @@ export type ActivityRow = RowBase &
559
623
  export type MessageRow = RowBase &
560
624
  Readonly<{
561
625
  type: 'message';
626
+ /** Draws only top and bottom container borders when a border is supplied. */
627
+ presentation?: 'inlineWarning';
562
628
  unread?: boolean;
563
629
  leading?: LeadingVisual;
564
630
  title: string;
565
631
  body: string;
566
- bodyLines?: 1 | 2 | 3;
632
+ /** Zero displays the complete body. */
633
+ bodyLines?: 0 | 1 | 2 | 3;
567
634
  time: string;
568
635
  thumbnail?: ImageSource;
569
636
  style?: MessageRowStyle;
@@ -572,8 +639,12 @@ export type MessageRow = RowBase &
572
639
  export type DataColumn = Readonly<{
573
640
  key: string;
574
641
  text: string;
642
+ textSegments?: readonly ValueTextSegment[];
643
+ titleIcon?: IdentityRow['titleIcon'];
644
+ secondaryTitleIcon?: IdentityRow['titleIcon'];
575
645
  secondaryLeadingText?: string;
576
646
  secondaryText?: string;
647
+ secondaryTextSegments?: readonly ValueTextSegment[];
577
648
  weight?: 1 | 2 | 3;
578
649
  alignment?: 'start' | 'center' | 'end';
579
650
  tone?: 'primary' | 'secondary' | 'positive' | 'negative';
@@ -585,6 +656,7 @@ export type DataRow = RowBase &
585
656
  type: 'dataRow';
586
657
  leading?: LeadingVisual;
587
658
  columns: readonly DataColumn[];
659
+ trailing?: readonly TrailingAccessory[];
588
660
  checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
589
661
  index?: number;
590
662
  badge?: BadgeModel;
@@ -683,6 +755,19 @@ export type MarketRow = RowBase &
683
755
  variant: 'token' | 'stock' | 'perp';
684
756
  /** Web-only bounded table presentation; native reads the ordinary Market fields. */
685
757
  webTable?: WebMarketTablePresentation;
758
+ /** Two or three ordered native text metrics; omitting them keeps the compact quote. */
759
+ metrics?: readonly Pick<
760
+ DataColumn,
761
+ | 'key'
762
+ | 'text'
763
+ | 'textSegments'
764
+ | 'secondaryText'
765
+ | 'secondaryTextSegments'
766
+ | 'weight'
767
+ | 'alignment'
768
+ | 'tone'
769
+ | 'secondaryTone'
770
+ >[];
686
771
  leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
687
772
  leading: LeadingVisual;
688
773
  title: string;
@@ -766,9 +851,11 @@ export type SectionHeaderRow = RowBase &
766
851
  indexTitle?: string;
767
852
  variant?: 'summary' | 'gallery' | 'history';
768
853
  title: string;
854
+ leadingBadge?: BadgeModel;
769
855
  titleLoading?: boolean;
770
856
  subtitle?: string;
771
857
  value?: string;
858
+ valueHelp?: RowTextHelp;
772
859
  valueActionKey?: string;
773
860
  titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
774
861
  valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
@@ -789,6 +876,21 @@ export type ActionRow = RowBase &
789
876
  style?: ActionRowStyle;
790
877
  }>;
791
878
 
879
+ export type ButtonGroupRow = RowBase &
880
+ Readonly<{
881
+ type: 'buttonGroup';
882
+ buttons: readonly Readonly<{
883
+ key: string;
884
+ label: string;
885
+ actionKey: string;
886
+ disabled?: boolean;
887
+ loading?: boolean;
888
+ testID?: string;
889
+ accessibilityLabel?: string;
890
+ }>[];
891
+ style?: TemplateBoxStyle<'buttonGroup'>;
892
+ }>;
893
+
792
894
  export type SystemRow = RowBase &
793
895
  Readonly<{ style?: SystemRowStyle }> &
794
896
  (
@@ -841,6 +943,7 @@ export type RowModel =
841
943
  | MetricCardRow
842
944
  | SectionHeaderRow
843
945
  | ActionRow
946
+ | ButtonGroupRow
844
947
  | SystemRow;
845
948
 
846
949
  export type NativeListTheme = Readonly<{
@@ -853,6 +956,8 @@ export type NativeListTheme = Readonly<{
853
956
  rowBackground: string;
854
957
  rowSelectedBackground: string;
855
958
  rowPressedBackground?: string;
959
+ /** Web-only enabled-row hover color; defaults to rowPressedBackground. */
960
+ rowHoverBackground?: string;
856
961
  subduedBackground?: string;
857
962
  strongBackground?: string;
858
963
  /** Web-only background for a displayed declared image fallback. */
@@ -865,6 +970,8 @@ export type NativeListTheme = Readonly<{
865
970
  separator: string;
866
971
  accent: string;
867
972
  positive: string;
973
+ /** Optional exact background for the success tone of section leading badges. */
974
+ successBackground?: string;
868
975
  negative: string;
869
976
  criticalBackground?: string;
870
977
  inverseBackground?: string;
@@ -911,6 +1018,16 @@ export type NativeListListStyle = Readonly<{
911
1018
  export type NativeListSnapshot = Readonly<{
912
1019
  schemaVersion: 1;
913
1020
  generation: number;
1021
+ /** One-shot animation for a user-initiated row-key insertion or removal. */
1022
+ structuralTransition?: Readonly<{
1023
+ id: string;
1024
+ durationMs?: number;
1025
+ anchorKey?: string;
1026
+ }>;
1027
+ disclosure?: Readonly<{
1028
+ expanded: boolean;
1029
+ expandedTrailingInset?: number;
1030
+ }>;
914
1031
  layout: Readonly<{
915
1032
  kind: NativeListLayout;
916
1033
  orientation?: NativeListOrientation;
@@ -959,202 +1076,203 @@ type CommonPatchFields =
959
1076
  | 'accessibilityLabel'
960
1077
  | 'style';
961
1078
 
1079
+ /** Null removes optional fields; undefined leaves the existing value unchanged. */
1080
+ export type PatchClearableChanges<Row, Keys extends keyof Row> = Readonly<{
1081
+ [K in Keys]?: undefined extends Row[K] ? Row[K] | null : Row[K];
1082
+ }>;
1083
+
962
1084
  export type RowPatch =
963
1085
  | Readonly<{
964
1086
  type: 'identity';
965
1087
  key: string;
966
- changes: Partial<
967
- Pick<
968
- IdentityRow,
969
- | CommonPatchFields
970
- | 'title'
971
- | 'subtitle'
972
- | 'tertiary'
973
- | 'tertiaryTone'
974
- | 'badges'
975
- | 'trailing'
976
- | 'leading'
977
- | 'leadingAction'
978
- | 'titleMatch'
979
- | 'titleActionKey'
980
- | 'titleActionOnHover'
981
- | 'subtitleSegments'
982
- >
1088
+ changes: PatchClearableChanges<
1089
+ IdentityRow,
1090
+ | CommonPatchFields
1091
+ | 'title'
1092
+ | 'titleSuffixes'
1093
+ | 'titleIcon'
1094
+ | 'secondaryTitleIcon'
1095
+ | 'titleImage'
1096
+ | 'subtitle'
1097
+ | 'subtitleLines'
1098
+ | 'contentHeight'
1099
+ | 'longPressActionKey'
1100
+ | 'tertiary'
1101
+ | 'tertiaryTone'
1102
+ | 'badges'
1103
+ | 'trailing'
1104
+ | 'leading'
1105
+ | 'leadingAction'
1106
+ | 'titleMatch'
1107
+ | 'titleActionKey'
1108
+ | 'titleActionOnHover'
1109
+ | 'subtitleSegments'
983
1110
  >;
984
1111
  }>
985
1112
  | Readonly<{
986
1113
  type: 'rail';
987
1114
  key: string;
988
- changes: Partial<
989
- Pick<
990
- RailRow,
991
- CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
992
- >
1115
+ changes: PatchClearableChanges<
1116
+ RailRow,
1117
+ CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
993
1118
  >;
994
1119
  }>
995
1120
  | Readonly<{
996
1121
  type: 'activity';
997
1122
  key: string;
998
- changes: Partial<
999
- Pick<
1000
- ActivityRow,
1001
- | CommonPatchFields
1002
- | 'title'
1003
- | 'description'
1004
- | 'status'
1005
- | 'amounts'
1006
- | 'badges'
1007
- | 'presentation'
1008
- | 'fee'
1009
- | 'descriptionActionKey'
1010
- | 'primaryAmount'
1011
- | 'secondaryAmount'
1012
- | 'leading'
1013
- | 'secondaryLeading'
1014
- | 'footerActions'
1015
- >
1123
+ changes: PatchClearableChanges<
1124
+ ActivityRow,
1125
+ | CommonPatchFields
1126
+ | 'title'
1127
+ | 'description'
1128
+ | 'status'
1129
+ | 'amounts'
1130
+ | 'badges'
1131
+ | 'presentation'
1132
+ | 'fee'
1133
+ | 'descriptionActionKey'
1134
+ | 'primaryAmount'
1135
+ | 'secondaryAmount'
1136
+ | 'leading'
1137
+ | 'hideLeading'
1138
+ | 'secondaryLeading'
1139
+ | 'footerActions'
1016
1140
  >;
1017
1141
  }>
1018
1142
  | Readonly<{
1019
1143
  type: 'message';
1020
1144
  key: string;
1021
- changes: Partial<
1022
- Pick<
1023
- MessageRow,
1024
- | CommonPatchFields
1025
- | 'unread'
1026
- | 'title'
1027
- | 'body'
1028
- | 'bodyLines'
1029
- | 'time'
1030
- | 'thumbnail'
1031
- >
1145
+ changes: PatchClearableChanges<
1146
+ MessageRow,
1147
+ | CommonPatchFields
1148
+ | 'unread'
1149
+ | 'title'
1150
+ | 'body'
1151
+ | 'bodyLines'
1152
+ | 'presentation'
1153
+ | 'time'
1154
+ | 'thumbnail'
1032
1155
  >;
1033
1156
  }>
1034
1157
  | Readonly<{
1035
1158
  type: 'dataRow';
1036
1159
  key: string;
1037
- changes: Partial<
1038
- Pick<
1039
- DataRow,
1040
- | CommonPatchFields
1041
- | 'leading'
1042
- | 'columns'
1043
- | 'checkbox'
1044
- | 'index'
1045
- | 'badge'
1046
- | 'badges'
1047
- | 'favorite'
1048
- | 'favoriteActive'
1049
- >
1160
+ changes: PatchClearableChanges<
1161
+ DataRow,
1162
+ | CommonPatchFields
1163
+ | 'leading'
1164
+ | 'columns'
1165
+ | 'trailing'
1166
+ | 'checkbox'
1167
+ | 'index'
1168
+ | 'badge'
1169
+ | 'badges'
1170
+ | 'favorite'
1171
+ | 'favoriteActive'
1050
1172
  >;
1051
1173
  }>
1052
1174
  | Readonly<{
1053
1175
  type: 'market';
1054
1176
  key: string;
1055
- changes: Partial<
1056
- Pick<
1057
- MarketRow,
1058
- | CommonPatchFields
1059
- | 'leadingAction'
1060
- | 'leading'
1061
- | 'title'
1062
- | 'subtitle'
1063
- | 'subtitleSegments'
1064
- | 'price'
1065
- | 'priceSegments'
1066
- | 'change'
1067
- | 'badges'
1068
- | 'pressActionKey'
1069
- | 'pressInActionKey'
1070
- | 'longPressActionKey'
1071
- | 'diagnostics'
1072
- | 'webTable'
1073
- | 'style'
1074
- >
1177
+ changes: PatchClearableChanges<
1178
+ MarketRow,
1179
+ | CommonPatchFields
1180
+ | 'leadingAction'
1181
+ | 'leading'
1182
+ | 'title'
1183
+ | 'subtitle'
1184
+ | 'subtitleSegments'
1185
+ | 'price'
1186
+ | 'priceSegments'
1187
+ | 'change'
1188
+ | 'badges'
1189
+ | 'pressActionKey'
1190
+ | 'pressInActionKey'
1191
+ | 'longPressActionKey'
1192
+ | 'diagnostics'
1193
+ | 'webTable'
1194
+ | 'metrics'
1195
+ | 'style'
1075
1196
  >;
1076
1197
  }>
1077
1198
  | Readonly<{
1078
1199
  type: 'mediaTile';
1079
1200
  key: string;
1080
- changes: Partial<
1081
- Pick<
1082
- MediaTileRow,
1083
- | CommonPatchFields
1084
- | 'image'
1085
- | 'imageState'
1086
- | 'media'
1087
- | 'networkImage'
1088
- | 'title'
1089
- | 'subtitle'
1090
- | 'badge'
1091
- | 'closeActionKey'
1092
- >
1201
+ changes: PatchClearableChanges<
1202
+ MediaTileRow,
1203
+ | CommonPatchFields
1204
+ | 'image'
1205
+ | 'imageState'
1206
+ | 'media'
1207
+ | 'networkImage'
1208
+ | 'title'
1209
+ | 'subtitle'
1210
+ | 'badge'
1211
+ | 'closeActionKey'
1093
1212
  >;
1094
1213
  }>
1095
1214
  | Readonly<{
1096
1215
  type: 'metricCard';
1097
1216
  key: string;
1098
- changes: Partial<
1099
- Pick<
1100
- MetricCardRow,
1101
- | CommonPatchFields
1102
- | 'variant'
1103
- | 'title'
1104
- | 'value'
1105
- | 'subtitle'
1106
- | 'trend'
1107
- | 'trendTone'
1108
- | 'visual'
1109
- | 'badge'
1110
- | 'metrics'
1111
- | 'progress'
1112
- >
1217
+ changes: PatchClearableChanges<
1218
+ MetricCardRow,
1219
+ | CommonPatchFields
1220
+ | 'variant'
1221
+ | 'title'
1222
+ | 'value'
1223
+ | 'subtitle'
1224
+ | 'trend'
1225
+ | 'trendTone'
1226
+ | 'visual'
1227
+ | 'badge'
1228
+ | 'metrics'
1229
+ | 'progress'
1113
1230
  >;
1114
1231
  }>
1115
1232
  | Readonly<{
1116
1233
  type: 'sectionHeader';
1117
1234
  key: string;
1118
- changes: Partial<
1119
- Pick<
1120
- SectionHeaderRow,
1121
- | CommonPatchFields
1122
- | 'variant'
1123
- | 'titleLoading'
1124
- | 'title'
1125
- | 'subtitle'
1126
- | 'value'
1127
- | 'valueActionKey'
1128
- | 'titleActionKey'
1129
- | 'titleActionOnHover'
1130
- | 'titleIcon'
1131
- | 'valueIcon'
1132
- | 'checkbox'
1133
- >
1235
+ changes: PatchClearableChanges<
1236
+ SectionHeaderRow,
1237
+ | CommonPatchFields
1238
+ | 'variant'
1239
+ | 'titleLoading'
1240
+ | 'title'
1241
+ | 'subtitle'
1242
+ | 'value'
1243
+ | 'valueHelp'
1244
+ | 'leadingBadge'
1245
+ | 'valueActionKey'
1246
+ | 'titleActionKey'
1247
+ | 'titleActionOnHover'
1248
+ | 'titleIcon'
1249
+ | 'valueIcon'
1250
+ | 'checkbox'
1134
1251
  >;
1135
1252
  }>
1136
1253
  | Readonly<{
1137
1254
  type: 'action';
1138
1255
  key: string;
1139
- changes: Partial<
1140
- Pick<
1141
- ActionRow,
1142
- | CommonPatchFields
1143
- | 'title'
1144
- | 'tone'
1145
- | 'icon'
1146
- | 'checkbox'
1147
- | 'trailing'
1148
- >
1256
+ changes: PatchClearableChanges<
1257
+ ActionRow,
1258
+ CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'
1259
+ >;
1260
+ }>
1261
+ | Readonly<{
1262
+ type: 'buttonGroup';
1263
+ key: string;
1264
+ changes: PatchClearableChanges<
1265
+ ButtonGroupRow,
1266
+ CommonPatchFields | 'buttons'
1149
1267
  >;
1150
1268
  }>
1151
1269
  | Readonly<{
1152
1270
  type: 'system';
1153
1271
  key: string;
1154
1272
  changes: Readonly<{
1155
- revision?: number;
1156
- disabled?: boolean;
1157
- message?: string;
1273
+ revision?: number | null;
1274
+ disabled?: boolean | null;
1275
+ message?: string | null;
1158
1276
  }>;
1159
1277
  }>;
1160
1278
 
@@ -1164,6 +1282,7 @@ export type NativeListActionSource =
1164
1282
  | 'leadingAction'
1165
1283
  | 'trailingAccessory'
1166
1284
  | 'footerAction'
1285
+ | 'buttonGroup'
1167
1286
  | 'description'
1168
1287
  | 'mediaClose';
1169
1288
 
package/src/selection.ts CHANGED
@@ -39,6 +39,7 @@ export function isRowPressEnabled(row: RowModel): boolean {
39
39
  return (
40
40
  !row.disabled &&
41
41
  !row.pressDisabled &&
42
+ row.type !== 'buttonGroup' &&
42
43
  (row.type !== 'system' || row.variant === 'retry')
43
44
  );
44
45
  }