@onekeyfe/react-native-native-list 6.7.0-6 → 6.7.0-61

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 (216) 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 +50 -13
  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 +209 -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 +8 -3
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
  24. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +130 -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/NativeListDescriptionTouchPolicyTest.kt +153 -0
  28. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
  29. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
  30. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
  31. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
  32. package/docs/ROW_TEMPLATES.md +78 -14
  33. package/docs/SPEC.md +1318 -16
  34. package/docs/STYLE_SPEC.md +18 -0
  35. package/ios/HybridNativeList.swift +21 -2
  36. package/ios/NativeListAccessoryStack.swift +237 -51
  37. package/ios/NativeListActivityDetailsView.swift +43 -16
  38. package/ios/NativeListActivityRenderer.swift +8 -2
  39. package/ios/NativeListButtonGroupRenderer.swift +89 -0
  40. package/ios/NativeListDataRowRenderer.swift +167 -30
  41. package/ios/NativeListDesignAssets.swift +13 -75
  42. package/ios/NativeListGeneratedIcons.swift +55 -0
  43. package/ios/NativeListIconBinding.swift +171 -0
  44. package/ios/NativeListIdentityRenderer.swift +256 -39
  45. package/ios/NativeListLeadingVisual.swift +127 -28
  46. package/ios/NativeListMarketRenderer.swift +120 -31
  47. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  48. package/ios/NativeListMediaPreviewSlot.swift +122 -61
  49. package/ios/NativeListMediaTileRenderer.swift +15 -11
  50. package/ios/NativeListMessageRenderer.swift +34 -1
  51. package/ios/NativeListMetricCardRenderer.swift +4 -2
  52. package/ios/NativeListModels.swift +42 -2
  53. package/ios/NativeListRendererRegistry.swift +1 -0
  54. package/ios/NativeListResolvedText.swift +17 -5
  55. package/ios/NativeListRowHost.swift +14 -0
  56. package/ios/NativeListSectionHeaderRenderer.swift +100 -4
  57. package/ios/NativeListTextLabel.swift +106 -0
  58. package/ios/RNCNativeListView.swift +1097 -60
  59. package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
  60. package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
  61. package/ios/tests/NativeListActivityPresentationTests.swift +423 -0
  62. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
  63. package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
  64. package/ios/tests/NativeListLifecycleTests.swift +2959 -4
  65. package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
  66. package/ios/tests/NativeListMediaVisibilityTests.swift +41 -7
  67. package/ios/tests/NativeListSharedIconTests.swift +236 -0
  68. package/lib/module/NativeList.js +236 -38
  69. package/lib/module/NativeList.web.js +163 -45
  70. package/lib/module/index.js +1 -1
  71. package/lib/module/models.js +3 -0
  72. package/lib/module/selection.js +1 -1
  73. package/lib/module/validation.js +1263 -48
  74. package/lib/module/web/NativeListGeneratedIcons.js +31 -0
  75. package/lib/module/web/NativeListWebEngine.js +513 -275
  76. package/lib/module/web/templates/ActivityRowRenderer.js +41 -54
  77. package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
  78. package/lib/module/web/templates/DataRowRenderer.js +56 -5
  79. package/lib/module/web/templates/IdentityRowRenderer.js +161 -7
  80. package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
  81. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -25
  82. package/lib/module/web/templates/MessageRowRenderer.js +18 -2
  83. package/lib/module/web/templates/RowContainerStyle.js +1 -0
  84. package/lib/module/web/templates/RowRendererRegistry.js +3 -0
  85. package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
  86. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  87. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  88. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  89. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  90. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  91. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  92. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  93. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  94. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  95. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  96. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  97. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  98. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  99. package/lib/typescript/src/NativeList.d.ts +3 -3
  100. package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
  101. package/lib/typescript/src/NativeList.types.d.ts +20 -2
  102. package/lib/typescript/src/index.d.ts +2 -2
  103. package/lib/typescript/src/models.d.ts +134 -17
  104. package/lib/typescript/src/validation.d.ts +20 -0
  105. package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
  106. package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
  107. package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
  108. package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
  109. package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +9 -3
  110. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  111. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  112. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  113. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  114. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  115. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  116. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  117. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  118. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  119. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  120. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  121. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  122. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  123. package/package.json +16 -10
  124. package/react-native-native-list.podspec +2 -6
  125. package/scripts/generate-icons.mjs +150 -0
  126. package/scripts/generate-icons.test.mjs +288 -0
  127. package/scripts/native-list-icons.json +260 -0
  128. package/src/NativeList.nitro.ts +2 -0
  129. package/src/NativeList.tsx +439 -91
  130. package/src/NativeList.types.ts +24 -2
  131. package/src/NativeList.web.tsx +286 -88
  132. package/src/index.ts +2 -0
  133. package/src/models.ts +272 -144
  134. package/src/selection.ts +1 -0
  135. package/src/validation.ts +3041 -146
  136. package/src/web/NativeListGeneratedIcons.ts +28 -0
  137. package/src/web/NativeListWebEngine.ts +818 -343
  138. package/src/web/templates/ActivityRowRenderer.ts +71 -91
  139. package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
  140. package/src/web/templates/DataRowRenderer.ts +121 -20
  141. package/src/web/templates/IdentityRowRenderer.ts +234 -9
  142. package/src/web/templates/MarketTableRowRenderer.ts +53 -33
  143. package/src/web/templates/MediaTileRowRenderer.ts +90 -28
  144. package/src/web/templates/MessageRowRenderer.ts +23 -7
  145. package/src/web/templates/RowContainerStyle.ts +2 -0
  146. package/src/web/templates/RowRendererRegistry.ts +11 -1
  147. package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
  148. package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
  149. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
  150. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
  151. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
  152. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
  153. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
  154. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
  155. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
  156. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
  157. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
  158. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
  159. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
  160. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
  161. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
  162. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
  163. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
  164. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
  165. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
  166. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
  167. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
  168. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
  169. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
  170. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
  171. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
  172. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
  173. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
  174. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
  175. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
  176. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
  177. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
  178. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
  179. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
  180. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
  181. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
  182. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
  183. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
  184. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
  185. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
  186. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
  187. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
  188. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
  189. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
  190. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
  191. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
  192. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
  193. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
  194. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
  195. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
  196. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
  197. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
  198. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
  199. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
  200. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
  201. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
  202. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
  203. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
  204. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
  205. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
  206. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
  207. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
  208. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
  209. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
  210. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
  211. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
  212. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
  213. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
  214. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
  215. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
  216. 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;
@@ -552,6 +616,14 @@ export type ActivityRow = RowBase &
552
616
  hidden?: boolean;
553
617
  }>;
554
618
  descriptionActionKey?: string;
619
+ /**
620
+ * UTF-16 offset into `description` where the text that opens
621
+ * `descriptionActionKey` starts; the text before it stays plain. An integer
622
+ * in `0...description.length`: `0`, the default, makes the whole
623
+ * description the action and `description.length` leaves no action text.
624
+ * Ignored without `descriptionActionKey`.
625
+ */
626
+ descriptionActionStart?: number;
555
627
  footerActions?: readonly FooterAction[];
556
628
  style?: ActivityRowStyle;
557
629
  }>;
@@ -559,11 +631,14 @@ export type ActivityRow = RowBase &
559
631
  export type MessageRow = RowBase &
560
632
  Readonly<{
561
633
  type: 'message';
634
+ /** Draws only top and bottom container borders when a border is supplied. */
635
+ presentation?: 'inlineWarning';
562
636
  unread?: boolean;
563
637
  leading?: LeadingVisual;
564
638
  title: string;
565
639
  body: string;
566
- bodyLines?: 1 | 2 | 3;
640
+ /** Zero displays the complete body. */
641
+ bodyLines?: 0 | 1 | 2 | 3;
567
642
  time: string;
568
643
  thumbnail?: ImageSource;
569
644
  style?: MessageRowStyle;
@@ -572,8 +647,12 @@ export type MessageRow = RowBase &
572
647
  export type DataColumn = Readonly<{
573
648
  key: string;
574
649
  text: string;
650
+ textSegments?: readonly ValueTextSegment[];
651
+ titleIcon?: IdentityRow['titleIcon'];
652
+ secondaryTitleIcon?: IdentityRow['titleIcon'];
575
653
  secondaryLeadingText?: string;
576
654
  secondaryText?: string;
655
+ secondaryTextSegments?: readonly ValueTextSegment[];
577
656
  weight?: 1 | 2 | 3;
578
657
  alignment?: 'start' | 'center' | 'end';
579
658
  tone?: 'primary' | 'secondary' | 'positive' | 'negative';
@@ -585,6 +664,7 @@ export type DataRow = RowBase &
585
664
  type: 'dataRow';
586
665
  leading?: LeadingVisual;
587
666
  columns: readonly DataColumn[];
667
+ trailing?: readonly TrailingAccessory[];
588
668
  checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
589
669
  index?: number;
590
670
  badge?: BadgeModel;
@@ -683,6 +763,19 @@ export type MarketRow = RowBase &
683
763
  variant: 'token' | 'stock' | 'perp';
684
764
  /** Web-only bounded table presentation; native reads the ordinary Market fields. */
685
765
  webTable?: WebMarketTablePresentation;
766
+ /** Two or three ordered native text metrics; omitting them keeps the compact quote. */
767
+ metrics?: readonly Pick<
768
+ DataColumn,
769
+ | 'key'
770
+ | 'text'
771
+ | 'textSegments'
772
+ | 'secondaryText'
773
+ | 'secondaryTextSegments'
774
+ | 'weight'
775
+ | 'alignment'
776
+ | 'tone'
777
+ | 'secondaryTone'
778
+ >[];
686
779
  leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
687
780
  leading: LeadingVisual;
688
781
  title: string;
@@ -766,9 +859,11 @@ export type SectionHeaderRow = RowBase &
766
859
  indexTitle?: string;
767
860
  variant?: 'summary' | 'gallery' | 'history';
768
861
  title: string;
862
+ leadingBadge?: BadgeModel;
769
863
  titleLoading?: boolean;
770
864
  subtitle?: string;
771
865
  value?: string;
866
+ valueHelp?: RowTextHelp;
772
867
  valueActionKey?: string;
773
868
  titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
774
869
  valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
@@ -789,6 +884,21 @@ export type ActionRow = RowBase &
789
884
  style?: ActionRowStyle;
790
885
  }>;
791
886
 
887
+ export type ButtonGroupRow = RowBase &
888
+ Readonly<{
889
+ type: 'buttonGroup';
890
+ buttons: readonly Readonly<{
891
+ key: string;
892
+ label: string;
893
+ actionKey: string;
894
+ disabled?: boolean;
895
+ loading?: boolean;
896
+ testID?: string;
897
+ accessibilityLabel?: string;
898
+ }>[];
899
+ style?: TemplateBoxStyle<'buttonGroup'>;
900
+ }>;
901
+
792
902
  export type SystemRow = RowBase &
793
903
  Readonly<{ style?: SystemRowStyle }> &
794
904
  (
@@ -841,6 +951,7 @@ export type RowModel =
841
951
  | MetricCardRow
842
952
  | SectionHeaderRow
843
953
  | ActionRow
954
+ | ButtonGroupRow
844
955
  | SystemRow;
845
956
 
846
957
  export type NativeListTheme = Readonly<{
@@ -853,6 +964,8 @@ export type NativeListTheme = Readonly<{
853
964
  rowBackground: string;
854
965
  rowSelectedBackground: string;
855
966
  rowPressedBackground?: string;
967
+ /** Web-only enabled-row hover color; defaults to rowPressedBackground. */
968
+ rowHoverBackground?: string;
856
969
  subduedBackground?: string;
857
970
  strongBackground?: string;
858
971
  /** Web-only background for a displayed declared image fallback. */
@@ -865,6 +978,8 @@ export type NativeListTheme = Readonly<{
865
978
  separator: string;
866
979
  accent: string;
867
980
  positive: string;
981
+ /** Optional exact background for the success tone of section leading badges. */
982
+ successBackground?: string;
868
983
  negative: string;
869
984
  criticalBackground?: string;
870
985
  inverseBackground?: string;
@@ -911,6 +1026,16 @@ export type NativeListListStyle = Readonly<{
911
1026
  export type NativeListSnapshot = Readonly<{
912
1027
  schemaVersion: 1;
913
1028
  generation: number;
1029
+ /** One-shot animation for a user-initiated row-key insertion or removal. */
1030
+ structuralTransition?: Readonly<{
1031
+ id: string;
1032
+ durationMs?: number;
1033
+ anchorKey?: string;
1034
+ }>;
1035
+ disclosure?: Readonly<{
1036
+ expanded: boolean;
1037
+ expandedTrailingInset?: number;
1038
+ }>;
914
1039
  layout: Readonly<{
915
1040
  kind: NativeListLayout;
916
1041
  orientation?: NativeListOrientation;
@@ -959,202 +1084,204 @@ type CommonPatchFields =
959
1084
  | 'accessibilityLabel'
960
1085
  | 'style';
961
1086
 
1087
+ /** Null removes optional fields; undefined leaves the existing value unchanged. */
1088
+ export type PatchClearableChanges<Row, Keys extends keyof Row> = Readonly<{
1089
+ [K in Keys]?: undefined extends Row[K] ? Row[K] | null : Row[K];
1090
+ }>;
1091
+
962
1092
  export type RowPatch =
963
1093
  | Readonly<{
964
1094
  type: 'identity';
965
1095
  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
- >
1096
+ changes: PatchClearableChanges<
1097
+ IdentityRow,
1098
+ | CommonPatchFields
1099
+ | 'title'
1100
+ | 'titleSuffixes'
1101
+ | 'titleIcon'
1102
+ | 'secondaryTitleIcon'
1103
+ | 'titleImage'
1104
+ | 'subtitle'
1105
+ | 'subtitleLines'
1106
+ | 'contentHeight'
1107
+ | 'longPressActionKey'
1108
+ | 'tertiary'
1109
+ | 'tertiaryTone'
1110
+ | 'badges'
1111
+ | 'trailing'
1112
+ | 'leading'
1113
+ | 'leadingAction'
1114
+ | 'titleMatch'
1115
+ | 'titleActionKey'
1116
+ | 'titleActionOnHover'
1117
+ | 'subtitleSegments'
983
1118
  >;
984
1119
  }>
985
1120
  | Readonly<{
986
1121
  type: 'rail';
987
1122
  key: string;
988
- changes: Partial<
989
- Pick<
990
- RailRow,
991
- CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
992
- >
1123
+ changes: PatchClearableChanges<
1124
+ RailRow,
1125
+ CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
993
1126
  >;
994
1127
  }>
995
1128
  | Readonly<{
996
1129
  type: 'activity';
997
1130
  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
- >
1131
+ changes: PatchClearableChanges<
1132
+ ActivityRow,
1133
+ | CommonPatchFields
1134
+ | 'title'
1135
+ | 'description'
1136
+ | 'status'
1137
+ | 'amounts'
1138
+ | 'badges'
1139
+ | 'presentation'
1140
+ | 'fee'
1141
+ | 'descriptionActionKey'
1142
+ | 'descriptionActionStart'
1143
+ | 'primaryAmount'
1144
+ | 'secondaryAmount'
1145
+ | 'leading'
1146
+ | 'hideLeading'
1147
+ | 'secondaryLeading'
1148
+ | 'footerActions'
1016
1149
  >;
1017
1150
  }>
1018
1151
  | Readonly<{
1019
1152
  type: 'message';
1020
1153
  key: string;
1021
- changes: Partial<
1022
- Pick<
1023
- MessageRow,
1024
- | CommonPatchFields
1025
- | 'unread'
1026
- | 'title'
1027
- | 'body'
1028
- | 'bodyLines'
1029
- | 'time'
1030
- | 'thumbnail'
1031
- >
1154
+ changes: PatchClearableChanges<
1155
+ MessageRow,
1156
+ | CommonPatchFields
1157
+ | 'unread'
1158
+ | 'title'
1159
+ | 'body'
1160
+ | 'bodyLines'
1161
+ | 'presentation'
1162
+ | 'time'
1163
+ | 'thumbnail'
1032
1164
  >;
1033
1165
  }>
1034
1166
  | Readonly<{
1035
1167
  type: 'dataRow';
1036
1168
  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
- >
1169
+ changes: PatchClearableChanges<
1170
+ DataRow,
1171
+ | CommonPatchFields
1172
+ | 'leading'
1173
+ | 'columns'
1174
+ | 'trailing'
1175
+ | 'checkbox'
1176
+ | 'index'
1177
+ | 'badge'
1178
+ | 'badges'
1179
+ | 'favorite'
1180
+ | 'favoriteActive'
1050
1181
  >;
1051
1182
  }>
1052
1183
  | Readonly<{
1053
1184
  type: 'market';
1054
1185
  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
- >
1186
+ changes: PatchClearableChanges<
1187
+ MarketRow,
1188
+ | CommonPatchFields
1189
+ | 'leadingAction'
1190
+ | 'leading'
1191
+ | 'title'
1192
+ | 'subtitle'
1193
+ | 'subtitleSegments'
1194
+ | 'price'
1195
+ | 'priceSegments'
1196
+ | 'change'
1197
+ | 'badges'
1198
+ | 'pressActionKey'
1199
+ | 'pressInActionKey'
1200
+ | 'longPressActionKey'
1201
+ | 'diagnostics'
1202
+ | 'webTable'
1203
+ | 'metrics'
1204
+ | 'style'
1075
1205
  >;
1076
1206
  }>
1077
1207
  | Readonly<{
1078
1208
  type: 'mediaTile';
1079
1209
  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
- >
1210
+ changes: PatchClearableChanges<
1211
+ MediaTileRow,
1212
+ | CommonPatchFields
1213
+ | 'image'
1214
+ | 'imageState'
1215
+ | 'media'
1216
+ | 'networkImage'
1217
+ | 'title'
1218
+ | 'subtitle'
1219
+ | 'badge'
1220
+ | 'closeActionKey'
1093
1221
  >;
1094
1222
  }>
1095
1223
  | Readonly<{
1096
1224
  type: 'metricCard';
1097
1225
  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
- >
1226
+ changes: PatchClearableChanges<
1227
+ MetricCardRow,
1228
+ | CommonPatchFields
1229
+ | 'variant'
1230
+ | 'title'
1231
+ | 'value'
1232
+ | 'subtitle'
1233
+ | 'trend'
1234
+ | 'trendTone'
1235
+ | 'visual'
1236
+ | 'badge'
1237
+ | 'metrics'
1238
+ | 'progress'
1113
1239
  >;
1114
1240
  }>
1115
1241
  | Readonly<{
1116
1242
  type: 'sectionHeader';
1117
1243
  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
- >
1244
+ changes: PatchClearableChanges<
1245
+ SectionHeaderRow,
1246
+ | CommonPatchFields
1247
+ | 'variant'
1248
+ | 'titleLoading'
1249
+ | 'title'
1250
+ | 'subtitle'
1251
+ | 'value'
1252
+ | 'valueHelp'
1253
+ | 'leadingBadge'
1254
+ | 'valueActionKey'
1255
+ | 'titleActionKey'
1256
+ | 'titleActionOnHover'
1257
+ | 'titleIcon'
1258
+ | 'valueIcon'
1259
+ | 'checkbox'
1134
1260
  >;
1135
1261
  }>
1136
1262
  | Readonly<{
1137
1263
  type: 'action';
1138
1264
  key: string;
1139
- changes: Partial<
1140
- Pick<
1141
- ActionRow,
1142
- | CommonPatchFields
1143
- | 'title'
1144
- | 'tone'
1145
- | 'icon'
1146
- | 'checkbox'
1147
- | 'trailing'
1148
- >
1265
+ changes: PatchClearableChanges<
1266
+ ActionRow,
1267
+ CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'
1268
+ >;
1269
+ }>
1270
+ | Readonly<{
1271
+ type: 'buttonGroup';
1272
+ key: string;
1273
+ changes: PatchClearableChanges<
1274
+ ButtonGroupRow,
1275
+ CommonPatchFields | 'buttons'
1149
1276
  >;
1150
1277
  }>
1151
1278
  | Readonly<{
1152
1279
  type: 'system';
1153
1280
  key: string;
1154
1281
  changes: Readonly<{
1155
- revision?: number;
1156
- disabled?: boolean;
1157
- message?: string;
1282
+ revision?: number | null;
1283
+ disabled?: boolean | null;
1284
+ message?: string | null;
1158
1285
  }>;
1159
1286
  }>;
1160
1287
 
@@ -1164,6 +1291,7 @@ export type NativeListActionSource =
1164
1291
  | 'leadingAction'
1165
1292
  | 'trailingAccessory'
1166
1293
  | 'footerAction'
1294
+ | 'buttonGroup'
1167
1295
  | 'description'
1168
1296
  | 'mediaClose';
1169
1297
 
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
  }