@onekeyfe/react-native-native-list 6.7.0-2 → 6.7.0-21

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 (148) hide show
  1. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
  2. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +245 -9
  3. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
  4. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
  5. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
  6. package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
  7. package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
  8. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
  9. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
  10. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +147 -33
  11. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
  12. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
  13. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
  14. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +51 -0
  15. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
  16. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +2 -0
  17. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
  18. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
  19. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
  20. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1953 -117
  21. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
  22. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
  23. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
  24. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
  25. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
  26. package/docs/ROW_TEMPLATES.md +70 -11
  27. package/docs/SPEC.md +1235 -20
  28. package/docs/STYLE_SPEC.md +6 -0
  29. package/ios/HybridNativeList.swift +21 -2
  30. package/ios/NativeListAccessoryStack.swift +235 -39
  31. package/ios/NativeListActivityDetailsView.swift +30 -11
  32. package/ios/NativeListActivityRenderer.swift +8 -2
  33. package/ios/NativeListButtonGroupRenderer.swift +89 -0
  34. package/ios/NativeListDataRowRenderer.swift +155 -27
  35. package/ios/NativeListDesignAssets.swift +9 -0
  36. package/ios/NativeListIdentityRenderer.swift +239 -31
  37. package/ios/NativeListLeadingVisual.swift +119 -22
  38. package/ios/NativeListMarketRenderer.swift +113 -18
  39. package/ios/NativeListMessageRenderer.swift +34 -1
  40. package/ios/NativeListModels.swift +42 -2
  41. package/ios/NativeListRendererRegistry.swift +1 -0
  42. package/ios/NativeListResolvedText.swift +2 -1
  43. package/ios/NativeListRowHost.swift +14 -0
  44. package/ios/NativeListSectionHeaderRenderer.swift +88 -0
  45. package/ios/RNCNativeListView.swift +1052 -58
  46. package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/Contents.json +15 -0
  47. package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/icon.svg +4 -0
  48. package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/Contents.json +1 -0
  49. package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/icon.svg +1 -0
  50. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/Contents.json +1 -0
  51. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/icon.svg +1 -0
  52. package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/Contents.json +15 -0
  53. package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/icon.svg +3 -0
  54. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/Contents.json +1 -0
  55. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/icon.svg +1 -0
  56. package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/Contents.json +15 -0
  57. package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/icon.svg +3 -0
  58. package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/Contents.json +1 -0
  59. package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/icon.svg +1 -0
  60. package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/Contents.json +1 -0
  61. package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/icon.svg +1 -0
  62. package/ios/tests/NativeListAccessoryStackTests.swift +89 -0
  63. package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
  64. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
  65. package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
  66. package/ios/tests/NativeListLifecycleTests.swift +2789 -3
  67. package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
  68. package/lib/module/NativeList.js +223 -36
  69. package/lib/module/NativeList.web.js +260 -33
  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 +1386 -81
  74. package/lib/module/web/NativeListWebEngine.js +914 -80
  75. package/lib/module/web/templates/ActivityRowRenderer.js +487 -7
  76. package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
  77. package/lib/module/web/templates/DataRowRenderer.js +40 -5
  78. package/lib/module/web/templates/IdentityRowRenderer.js +145 -5
  79. package/lib/module/web/templates/MarketRowRenderer.js +8 -3
  80. package/lib/module/web/templates/MarketTableRowRenderer.js +577 -0
  81. package/lib/module/web/templates/MediaTileRowRenderer.js +260 -5
  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 +8 -3
  85. package/lib/module/web/templates/SectionHeaderRowRenderer.js +70 -3
  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 +29 -1
  102. package/lib/typescript/src/NativeList.web.d.ts +2 -2
  103. package/lib/typescript/src/index.d.ts +2 -2
  104. package/lib/typescript/src/models.d.ts +196 -17
  105. package/lib/typescript/src/validation.d.ts +20 -0
  106. package/lib/typescript/src/web/NativeListWebEngine.d.ts +58 -1
  107. package/lib/typescript/src/web/templates/ActivityRowRenderer.d.ts +3 -3
  108. package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
  109. package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
  110. package/lib/typescript/src/web/templates/MarketTableRowRenderer.d.ts +17 -0
  111. package/lib/typescript/src/web/templates/MediaTileRowRenderer.d.ts +3 -3
  112. package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +10 -4
  113. package/lib/typescript/src/web/templates/RowRendererRegistry.d.ts +3 -1
  114. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  115. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  116. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  117. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  118. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  119. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  120. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  121. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  122. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  123. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  124. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  125. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  126. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  127. package/package.json +3 -3
  128. package/react-native-native-list.podspec +1 -0
  129. package/src/NativeList.nitro.ts +2 -0
  130. package/src/NativeList.tsx +418 -89
  131. package/src/NativeList.types.ts +34 -1
  132. package/src/NativeList.web.tsx +417 -66
  133. package/src/index.ts +2 -0
  134. package/src/models.ts +355 -143
  135. package/src/selection.ts +1 -0
  136. package/src/validation.ts +3315 -166
  137. package/src/web/NativeListWebEngine.ts +1473 -113
  138. package/src/web/templates/ActivityRowRenderer.ts +732 -8
  139. package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
  140. package/src/web/templates/DataRowRenderer.ts +93 -20
  141. package/src/web/templates/IdentityRowRenderer.ts +217 -6
  142. package/src/web/templates/MarketRowRenderer.ts +19 -3
  143. package/src/web/templates/MarketTableRowRenderer.ts +755 -0
  144. package/src/web/templates/MediaTileRowRenderer.ts +313 -5
  145. package/src/web/templates/MessageRowRenderer.ts +23 -7
  146. package/src/web/templates/RowContainerStyle.ts +2 -0
  147. package/src/web/templates/RowRendererRegistry.ts +21 -6
  148. package/src/web/templates/SectionHeaderRowRenderer.ts +89 -5
package/src/models.ts CHANGED
@@ -25,6 +25,8 @@ export type ImageSource = Readonly<{
25
25
  loadingStrategy?: ImageLoadingStrategy;
26
26
  // OneKey patch: fallbackUri is Web-only; retryTimes opts all platforms into terminal retries.
27
27
  fallbackUri?: string;
28
+ /** Web-only ordered continuation; retries each source before advancing. */
29
+ fallbackUris?: readonly string[];
28
30
  retryTimes?: number;
29
31
  }>;
30
32
 
@@ -183,6 +185,7 @@ export const ROW_BOX_STYLE_KEYS_BY_TYPE = {
183
185
  'trailingGap',
184
186
  'image',
185
187
  ],
188
+ buttonGroup: [],
186
189
  system: ['horizontalPadding', 'verticalPadding', 'lineGap'],
187
190
  } as const;
188
191
 
@@ -199,6 +202,7 @@ type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<
199
202
  */
200
203
  export type IdentityRowStyle = TemplateBoxStyle<'identity'> &
201
204
  Readonly<{
205
+ leadingContentMaxWidthRatio?: number;
202
206
  title?: NativeListTextStyle;
203
207
  subtitle?: NativeListTextStyle;
204
208
  tertiary?: NativeListTextStyle;
@@ -277,8 +281,16 @@ export type SectionHeaderRowStyle = TemplateBoxStyle<'sectionHeader'> &
277
281
  title?: NativeListTextStyle;
278
282
  subtitle?: NativeListTextStyle;
279
283
  value?: NativeListTextStyle;
284
+ valuePlacement?: 'afterTitle';
285
+ titleDecoration?: 'none' | 'dashed';
280
286
  }>;
281
287
 
288
+ export type RowTextHelp = Readonly<{
289
+ actionKey: string;
290
+ presentation: 'tooltip' | 'popover';
291
+ underline?: 'dashed';
292
+ }>;
293
+
282
294
  export type ActionRowStyle = TemplateBoxStyle<'action'> &
283
295
  Readonly<{
284
296
  title?: NativeListTextStyle;
@@ -342,19 +354,27 @@ export type VisualOverlay = Readonly<{
342
354
  offsetX?: number;
343
355
  offsetY?: number;
344
356
  image?: ImageSource;
357
+ fallbackIcon?: Readonly<{ name: string; tintColor?: string }>;
345
358
  name?: string;
346
359
  text?: string;
360
+ fontWeight?: NativeListTextStyle['fontWeight'];
347
361
  tintColor?: string;
348
362
  backgroundColor?: string;
349
363
  }>;
350
364
 
351
365
  type VisualWithImage = Readonly<{
352
- fallbackIcon?: Readonly<{ name: string; tintColor?: string }>;
366
+ fallbackIcon?: Readonly<{
367
+ name: string;
368
+ tintColor?: string;
369
+ size?: number;
370
+ backgroundColor?: string;
371
+ }>;
353
372
  overlays?: readonly VisualOverlay[];
354
373
  borderStyle?: 'dashed';
355
374
  borderColor?: string;
356
375
  image?: ImageSource;
357
376
  fallbackText?: string;
377
+ fallbackTextColor?: string;
358
378
  backgroundColor?: string;
359
379
  shape?: 'circle' | 'rounded' | 'square';
360
380
  cornerIcon?: Readonly<{
@@ -406,9 +426,26 @@ export type TrailingAccessory =
406
426
  kind: 'valuePair';
407
427
  primary: string;
408
428
  secondary: string;
429
+ primaryFontWeight?: 'medium';
430
+ primaryHelp?: RowTextHelp;
431
+ primaryTextSegments?: readonly ValueTextSegment[];
432
+ secondaryTextSegments?: readonly ValueTextSegment[];
409
433
  primaryTone?: TextTone;
410
434
  secondaryTone?: TextTone;
411
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
+ }>
412
449
  | Readonly<{
413
450
  kind: 'checkbox';
414
451
  state: CheckboxState;
@@ -436,6 +473,7 @@ export type TrailingAccessory =
436
473
  kind: 'icon';
437
474
  name: string;
438
475
  tintColor?: string;
476
+ buttonStyle?: 'tertiary';
439
477
  disabled?: boolean;
440
478
  actionKey?: string;
441
479
  testID?: string;
@@ -478,6 +516,10 @@ export type RowBase = Readonly<{
478
516
  export type IdentityRow = RowBase &
479
517
  Readonly<{
480
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;
481
523
  // OneKey patch: UTF-16 ranges match Fuse indices and native attributed strings.
482
524
  titleMatch?: readonly Readonly<{ start: number; end: number }>[];
483
525
  titleActionKey?: string;
@@ -487,11 +529,34 @@ export type IdentityRow = RowBase &
487
529
  leading: LeadingVisual;
488
530
  leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
489
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
+ }>;
490
554
  subtitle?: string;
491
555
  tertiary?: string;
492
556
  tertiaryTone?: 'secondary' | 'info';
493
557
  titleLines?: 1 | 2;
494
- subtitleLines?: 1 | 2;
558
+ /** Zero displays the complete subtitle. */
559
+ subtitleLines?: 0 | 1 | 2;
495
560
  badges?: readonly BadgeModel[];
496
561
  trailing?: readonly TrailingAccessory[];
497
562
  draggable?: boolean;
@@ -532,6 +597,7 @@ export type ActivityRow = RowBase &
532
597
  Readonly<{
533
598
  type: 'activity';
534
599
  leading: LeadingVisual;
600
+ hideLeading?: boolean;
535
601
  secondaryLeading?: LeadingVisual;
536
602
  title: string;
537
603
  description?: string;
@@ -557,11 +623,14 @@ export type ActivityRow = RowBase &
557
623
  export type MessageRow = RowBase &
558
624
  Readonly<{
559
625
  type: 'message';
626
+ /** Draws only top and bottom container borders when a border is supplied. */
627
+ presentation?: 'inlineWarning';
560
628
  unread?: boolean;
561
629
  leading?: LeadingVisual;
562
630
  title: string;
563
631
  body: string;
564
- bodyLines?: 1 | 2 | 3;
632
+ /** Zero displays the complete body. */
633
+ bodyLines?: 0 | 1 | 2 | 3;
565
634
  time: string;
566
635
  thumbnail?: ImageSource;
567
636
  style?: MessageRowStyle;
@@ -570,8 +639,12 @@ export type MessageRow = RowBase &
570
639
  export type DataColumn = Readonly<{
571
640
  key: string;
572
641
  text: string;
642
+ textSegments?: readonly ValueTextSegment[];
643
+ titleIcon?: IdentityRow['titleIcon'];
644
+ secondaryTitleIcon?: IdentityRow['titleIcon'];
573
645
  secondaryLeadingText?: string;
574
646
  secondaryText?: string;
647
+ secondaryTextSegments?: readonly ValueTextSegment[];
575
648
  weight?: 1 | 2 | 3;
576
649
  alignment?: 'start' | 'center' | 'end';
577
650
  tone?: 'primary' | 'secondary' | 'positive' | 'negative';
@@ -583,6 +656,7 @@ export type DataRow = RowBase &
583
656
  type: 'dataRow';
584
657
  leading?: LeadingVisual;
585
658
  columns: readonly DataColumn[];
659
+ trailing?: readonly TrailingAccessory[];
586
660
  checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
587
661
  index?: number;
588
662
  badge?: BadgeModel;
@@ -592,11 +666,108 @@ export type DataRow = RowBase &
592
666
  style?: DataRowStyle;
593
667
  }>;
594
668
 
669
+ export type WebMarketTableColumn = Readonly<{
670
+ key: string;
671
+ width?: number;
672
+ minWidth?: number;
673
+ flex?: number;
674
+ alignment?: 'start' | 'center' | 'end';
675
+ paddingStart?: number;
676
+ paddingEnd?: number;
677
+ }>;
678
+
679
+ export type WebMarketTableText = Readonly<{
680
+ text: string;
681
+ segments?: readonly ValueTextSegment[];
682
+ tone?: TextTone;
683
+ style?: Pick<
684
+ NativeListTextStyle,
685
+ 'fontSize' | 'fontWeight' | 'lineHeight' | 'color'
686
+ >;
687
+ }>;
688
+
689
+ export type WebMarketTableCell = Readonly<{ key: string }> &
690
+ (
691
+ | Readonly<{
692
+ kind: 'favorite';
693
+ active: boolean;
694
+ disabled?: boolean;
695
+ testID?: string;
696
+ hoverActionKey?: string;
697
+ actionKey: string;
698
+ accessibilityLabel: string;
699
+ }>
700
+ | Readonly<{
701
+ kind: 'asset';
702
+ leading: LeadingVisual;
703
+ title: WebMarketTableText;
704
+ secondary?: readonly WebMarketTableText[];
705
+ lineGap?: number;
706
+ secondaryBadges?: readonly Pick<
707
+ MarketBadgeModel,
708
+ 'key' | 'text' | 'style'
709
+ >[];
710
+ hoverImages?: readonly (ImageSource | null)[];
711
+ hoverSecondary?: readonly WebMarketTableText[];
712
+ hoverActionKey?: string;
713
+ hoverActionLabel?: string;
714
+ badges?: readonly Pick<
715
+ MarketBadgeModel,
716
+ | 'key'
717
+ | 'text'
718
+ | 'iconName'
719
+ | 'icon'
720
+ | 'textColor'
721
+ | 'backgroundColor'
722
+ | 'actionKey'
723
+ | 'accessibilityLabel'
724
+ | 'style'
725
+ >[];
726
+ }>
727
+ | Readonly<{
728
+ kind: 'text';
729
+ primary: readonly WebMarketTableText[];
730
+ partGap?: number;
731
+ secondary?: readonly WebMarketTableText[];
732
+ }>
733
+ | Readonly<{
734
+ kind: 'sparkline';
735
+ points: readonly number[];
736
+ width: number;
737
+ height: number;
738
+ strokeColor: string;
739
+ fillColor: string;
740
+ }>
741
+ );
742
+
743
+ export type WebMarketTablePresentation = Readonly<{
744
+ draggable?: boolean;
745
+ contextMenuActionKey?: string;
746
+ testID?: string;
747
+ columns: readonly WebMarketTableColumn[];
748
+ cells: readonly WebMarketTableCell[];
749
+ }>;
750
+
595
751
  /** Native Market quote row. All values are already localized/formatted strings. */
596
752
  export type MarketRow = RowBase &
597
753
  Readonly<{
598
754
  type: 'market';
599
755
  variant: 'token' | 'stock' | 'perp';
756
+ /** Web-only bounded table presentation; native reads the ordinary Market fields. */
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
+ >[];
600
771
  leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
601
772
  leading: LeadingVisual;
602
773
  title: string;
@@ -604,6 +775,8 @@ export type MarketRow = RowBase &
604
775
  /** OneKey patch: localized name shrinks independently of the volume. */
605
776
  subtitlePrefix?: Readonly<{
606
777
  text: string;
778
+ /** Web-only anchored help for a truncated name. */
779
+ hoverActionKey?: string;
607
780
  gap?: number;
608
781
  maxWidth?: number;
609
782
  style?: MarketTextStyle;
@@ -678,9 +851,11 @@ export type SectionHeaderRow = RowBase &
678
851
  indexTitle?: string;
679
852
  variant?: 'summary' | 'gallery' | 'history';
680
853
  title: string;
854
+ leadingBadge?: BadgeModel;
681
855
  titleLoading?: boolean;
682
856
  subtitle?: string;
683
857
  value?: string;
858
+ valueHelp?: RowTextHelp;
684
859
  valueActionKey?: string;
685
860
  titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
686
861
  valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
@@ -701,6 +876,21 @@ export type ActionRow = RowBase &
701
876
  style?: ActionRowStyle;
702
877
  }>;
703
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
+
704
894
  export type SystemRow = RowBase &
705
895
  Readonly<{ style?: SystemRowStyle }> &
706
896
  (
@@ -753,6 +943,7 @@ export type RowModel =
753
943
  | MetricCardRow
754
944
  | SectionHeaderRow
755
945
  | ActionRow
946
+ | ButtonGroupRow
756
947
  | SystemRow;
757
948
 
758
949
  export type NativeListTheme = Readonly<{
@@ -765,8 +956,12 @@ export type NativeListTheme = Readonly<{
765
956
  rowBackground: string;
766
957
  rowSelectedBackground: string;
767
958
  rowPressedBackground?: string;
959
+ /** Web-only enabled-row hover color; defaults to rowPressedBackground. */
960
+ rowHoverBackground?: string;
768
961
  subduedBackground?: string;
769
962
  strongBackground?: string;
963
+ /** Web-only background for a displayed declared image fallback. */
964
+ imageFallbackBackground?: string;
770
965
  primaryText: string;
771
966
  secondaryText: string;
772
967
  disabledText?: string;
@@ -775,6 +970,8 @@ export type NativeListTheme = Readonly<{
775
970
  separator: string;
776
971
  accent: string;
777
972
  positive: string;
973
+ /** Optional exact background for the success tone of section leading badges. */
974
+ successBackground?: string;
778
975
  negative: string;
779
976
  criticalBackground?: string;
780
977
  inverseBackground?: string;
@@ -821,6 +1018,16 @@ export type NativeListListStyle = Readonly<{
821
1018
  export type NativeListSnapshot = Readonly<{
822
1019
  schemaVersion: 1;
823
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
+ }>;
824
1031
  layout: Readonly<{
825
1032
  kind: NativeListLayout;
826
1033
  orientation?: NativeListOrientation;
@@ -869,201 +1076,203 @@ type CommonPatchFields =
869
1076
  | 'accessibilityLabel'
870
1077
  | 'style';
871
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
+
872
1084
  export type RowPatch =
873
1085
  | Readonly<{
874
1086
  type: 'identity';
875
1087
  key: string;
876
- changes: Partial<
877
- Pick<
878
- IdentityRow,
879
- | CommonPatchFields
880
- | 'title'
881
- | 'subtitle'
882
- | 'tertiary'
883
- | 'tertiaryTone'
884
- | 'badges'
885
- | 'trailing'
886
- | 'leading'
887
- | 'leadingAction'
888
- | 'titleMatch'
889
- | 'titleActionKey'
890
- | 'titleActionOnHover'
891
- | 'subtitleSegments'
892
- >
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'
893
1110
  >;
894
1111
  }>
895
1112
  | Readonly<{
896
1113
  type: 'rail';
897
1114
  key: string;
898
- changes: Partial<
899
- Pick<
900
- RailRow,
901
- CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
902
- >
1115
+ changes: PatchClearableChanges<
1116
+ RailRow,
1117
+ CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
903
1118
  >;
904
1119
  }>
905
1120
  | Readonly<{
906
1121
  type: 'activity';
907
1122
  key: string;
908
- changes: Partial<
909
- Pick<
910
- ActivityRow,
911
- | CommonPatchFields
912
- | 'title'
913
- | 'description'
914
- | 'status'
915
- | 'amounts'
916
- | 'badges'
917
- | 'presentation'
918
- | 'fee'
919
- | 'descriptionActionKey'
920
- | 'primaryAmount'
921
- | 'secondaryAmount'
922
- | 'leading'
923
- | 'secondaryLeading'
924
- | 'footerActions'
925
- >
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'
926
1140
  >;
927
1141
  }>
928
1142
  | Readonly<{
929
1143
  type: 'message';
930
1144
  key: string;
931
- changes: Partial<
932
- Pick<
933
- MessageRow,
934
- | CommonPatchFields
935
- | 'unread'
936
- | 'title'
937
- | 'body'
938
- | 'bodyLines'
939
- | 'time'
940
- | 'thumbnail'
941
- >
1145
+ changes: PatchClearableChanges<
1146
+ MessageRow,
1147
+ | CommonPatchFields
1148
+ | 'unread'
1149
+ | 'title'
1150
+ | 'body'
1151
+ | 'bodyLines'
1152
+ | 'presentation'
1153
+ | 'time'
1154
+ | 'thumbnail'
942
1155
  >;
943
1156
  }>
944
1157
  | Readonly<{
945
1158
  type: 'dataRow';
946
1159
  key: string;
947
- changes: Partial<
948
- Pick<
949
- DataRow,
950
- | CommonPatchFields
951
- | 'leading'
952
- | 'columns'
953
- | 'checkbox'
954
- | 'index'
955
- | 'badge'
956
- | 'badges'
957
- | 'favorite'
958
- | 'favoriteActive'
959
- >
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'
960
1172
  >;
961
1173
  }>
962
1174
  | Readonly<{
963
1175
  type: 'market';
964
1176
  key: string;
965
- changes: Partial<
966
- Pick<
967
- MarketRow,
968
- | CommonPatchFields
969
- | 'leadingAction'
970
- | 'leading'
971
- | 'title'
972
- | 'subtitle'
973
- | 'subtitleSegments'
974
- | 'price'
975
- | 'priceSegments'
976
- | 'change'
977
- | 'badges'
978
- | 'pressActionKey'
979
- | 'pressInActionKey'
980
- | 'longPressActionKey'
981
- | 'diagnostics'
982
- | 'style'
983
- >
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'
984
1196
  >;
985
1197
  }>
986
1198
  | Readonly<{
987
1199
  type: 'mediaTile';
988
1200
  key: string;
989
- changes: Partial<
990
- Pick<
991
- MediaTileRow,
992
- | CommonPatchFields
993
- | 'image'
994
- | 'imageState'
995
- | 'media'
996
- | 'networkImage'
997
- | 'title'
998
- | 'subtitle'
999
- | 'badge'
1000
- | 'closeActionKey'
1001
- >
1201
+ changes: PatchClearableChanges<
1202
+ MediaTileRow,
1203
+ | CommonPatchFields
1204
+ | 'image'
1205
+ | 'imageState'
1206
+ | 'media'
1207
+ | 'networkImage'
1208
+ | 'title'
1209
+ | 'subtitle'
1210
+ | 'badge'
1211
+ | 'closeActionKey'
1002
1212
  >;
1003
1213
  }>
1004
1214
  | Readonly<{
1005
1215
  type: 'metricCard';
1006
1216
  key: string;
1007
- changes: Partial<
1008
- Pick<
1009
- MetricCardRow,
1010
- | CommonPatchFields
1011
- | 'variant'
1012
- | 'title'
1013
- | 'value'
1014
- | 'subtitle'
1015
- | 'trend'
1016
- | 'trendTone'
1017
- | 'visual'
1018
- | 'badge'
1019
- | 'metrics'
1020
- | 'progress'
1021
- >
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'
1022
1230
  >;
1023
1231
  }>
1024
1232
  | Readonly<{
1025
1233
  type: 'sectionHeader';
1026
1234
  key: string;
1027
- changes: Partial<
1028
- Pick<
1029
- SectionHeaderRow,
1030
- | CommonPatchFields
1031
- | 'variant'
1032
- | 'titleLoading'
1033
- | 'title'
1034
- | 'subtitle'
1035
- | 'value'
1036
- | 'valueActionKey'
1037
- | 'titleActionKey'
1038
- | 'titleActionOnHover'
1039
- | 'titleIcon'
1040
- | 'valueIcon'
1041
- | 'checkbox'
1042
- >
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'
1043
1251
  >;
1044
1252
  }>
1045
1253
  | Readonly<{
1046
1254
  type: 'action';
1047
1255
  key: string;
1048
- changes: Partial<
1049
- Pick<
1050
- ActionRow,
1051
- | CommonPatchFields
1052
- | 'title'
1053
- | 'tone'
1054
- | 'icon'
1055
- | 'checkbox'
1056
- | 'trailing'
1057
- >
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'
1058
1267
  >;
1059
1268
  }>
1060
1269
  | Readonly<{
1061
1270
  type: 'system';
1062
1271
  key: string;
1063
1272
  changes: Readonly<{
1064
- revision?: number;
1065
- disabled?: boolean;
1066
- message?: string;
1273
+ revision?: number | null;
1274
+ disabled?: boolean | null;
1275
+ message?: string | null;
1067
1276
  }>;
1068
1277
  }>;
1069
1278
 
@@ -1073,6 +1282,7 @@ export type NativeListActionSource =
1073
1282
  | 'leadingAction'
1074
1283
  | 'trailingAccessory'
1075
1284
  | 'footerAction'
1285
+ | 'buttonGroup'
1076
1286
  | 'description'
1077
1287
  | 'mediaClose';
1078
1288
 
@@ -1097,6 +1307,8 @@ export type NativeListActionAnchor = Readonly<{
1097
1307
  }>;
1098
1308
 
1099
1309
  export type RowActionEvent = Readonly<{
1310
+ /** Web-only client/window CSS pixel pointer location. */
1311
+ windowPoint?: Readonly<{ x: number; y: number }>;
1100
1312
  rowKey?: string;
1101
1313
  actionKey: string;
1102
1314
  sectionKey?: string;