@onekeyfe/react-native-native-list 3.0.105

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 (181) hide show
  1. package/README.md +342 -0
  2. package/android/CMakeLists.txt +20 -0
  3. package/android/build.gradle +105 -0
  4. package/android/gradle.properties +4 -0
  5. package/android/src/main/AndroidManifest.xml +1 -0
  6. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  7. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +125 -0
  8. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +165 -0
  9. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +147 -0
  10. package/android/src/main/java/com/onekey/nativelist/NativeListPackage.kt +25 -0
  11. package/android/src/main/java/com/onekey/nativelist/NativeListRowView.kt +2939 -0
  12. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1794 -0
  13. package/common/fonts/Roobert-Bold.ttf +0 -0
  14. package/common/fonts/Roobert-Medium.ttf +0 -0
  15. package/common/fonts/Roobert-Regular.ttf +0 -0
  16. package/common/fonts/Roobert-SemiBold.ttf +0 -0
  17. package/docs/DESIGN.md +129 -0
  18. package/ios/HybridNativeList.swift +131 -0
  19. package/ios/NativeListCell.swift +2858 -0
  20. package/ios/NativeListDesignAssets.swift +110 -0
  21. package/ios/NativeListModels.swift +215 -0
  22. package/ios/RNCNativeListView.swift +1737 -0
  23. package/ios/Resources/NativeListIcons.xcassets/Contents.json +1 -0
  24. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +1 -0
  25. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +1 -0
  26. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +1 -0
  27. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +1 -0
  28. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +1 -0
  29. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +1 -0
  30. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +1 -0
  31. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +1 -0
  32. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +1 -0
  33. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +1 -0
  34. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +1 -0
  35. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +1 -0
  36. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +1 -0
  37. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +1 -0
  38. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +1 -0
  39. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +1 -0
  40. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +1 -0
  41. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +1 -0
  42. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +1 -0
  43. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +1 -0
  44. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +1 -0
  45. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +1 -0
  46. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +1 -0
  47. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +1 -0
  48. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +1 -0
  49. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +1 -0
  50. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +1 -0
  51. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +1 -0
  52. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +1 -0
  53. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +1 -0
  54. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +1 -0
  55. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +1 -0
  56. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +1 -0
  57. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +1 -0
  58. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +1 -0
  59. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +1 -0
  60. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +1 -0
  61. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +1 -0
  62. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +1 -0
  63. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +1 -0
  64. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +1 -0
  65. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +1 -0
  66. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +1 -0
  67. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +1 -0
  68. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +1 -0
  69. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +1 -0
  70. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +1 -0
  71. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +1 -0
  72. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +1 -0
  73. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +1 -0
  74. package/lib/module/NativeList.js +183 -0
  75. package/lib/module/NativeList.nitro.js +4 -0
  76. package/lib/module/NativeList.types.js +4 -0
  77. package/lib/module/NativeList.web.js +167 -0
  78. package/lib/module/index.js +6 -0
  79. package/lib/module/models.js +2 -0
  80. package/lib/module/package.json +1 -0
  81. package/lib/module/scrolling.js +121 -0
  82. package/lib/module/selection.js +85 -0
  83. package/lib/module/validation.js +562 -0
  84. package/lib/module/web/NativeListWebEngine.js +2238 -0
  85. package/lib/nitrogen/generated/.gitattributes +1 -0
  86. package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  87. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +201 -0
  88. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +84 -0
  89. package/lib/nitrogen/generated/android/c++/JNativeListScrollAlignment.hpp +64 -0
  90. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +104 -0
  91. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.hpp +54 -0
  92. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_std__string.kt +78 -0
  93. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +177 -0
  94. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollAlignment.kt +25 -0
  95. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/nativelistOnLoad.kt +35 -0
  96. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +96 -0
  97. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListStateUpdater.kt +23 -0
  98. package/lib/nitrogen/generated/android/nativelist+autolinking.cmake +83 -0
  99. package/lib/nitrogen/generated/android/nativelist+autolinking.gradle +27 -0
  100. package/lib/nitrogen/generated/android/nativelistOnLoad.cpp +58 -0
  101. package/lib/nitrogen/generated/android/nativelistOnLoad.hpp +34 -0
  102. package/lib/nitrogen/generated/ios/NativeListModule+autolinking.rb +62 -0
  103. package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +41 -0
  104. package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +91 -0
  105. package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +49 -0
  106. package/lib/nitrogen/generated/ios/NativeListModuleAutolinking.mm +33 -0
  107. package/lib/nitrogen/generated/ios/NativeListModuleAutolinking.swift +26 -0
  108. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.cpp +11 -0
  109. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +180 -0
  110. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +180 -0
  111. package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  112. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +69 -0
  113. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +447 -0
  114. package/lib/nitrogen/generated/ios/swift/NativeListScrollAlignment.swift +48 -0
  115. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +43 -0
  116. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +87 -0
  117. package/lib/nitrogen/generated/shared/c++/NativeListScrollAlignment.hpp +84 -0
  118. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +46 -0
  119. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +103 -0
  120. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +16 -0
  121. package/lib/typescript/package.json +1 -0
  122. package/lib/typescript/src/NativeList.d.ts +18 -0
  123. package/lib/typescript/src/NativeList.nitro.d.ts +29 -0
  124. package/lib/typescript/src/NativeList.types.d.ts +87 -0
  125. package/lib/typescript/src/NativeList.web.d.ts +19 -0
  126. package/lib/typescript/src/index.d.ts +7 -0
  127. package/lib/typescript/src/models.d.ts +456 -0
  128. package/lib/typescript/src/scrolling.d.ts +32 -0
  129. package/lib/typescript/src/selection.d.ts +27 -0
  130. package/lib/typescript/src/validation.d.ts +7 -0
  131. package/lib/typescript/src/web/NativeListWebEngine.d.ts +203 -0
  132. package/nitro.json +23 -0
  133. package/nitrogen/generated/.gitattributes +1 -0
  134. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  135. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +201 -0
  136. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +84 -0
  137. package/nitrogen/generated/android/c++/JNativeListScrollAlignment.hpp +64 -0
  138. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +104 -0
  139. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.hpp +54 -0
  140. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_std__string.kt +78 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +177 -0
  142. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollAlignment.kt +25 -0
  143. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/nativelistOnLoad.kt +35 -0
  144. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +96 -0
  145. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListStateUpdater.kt +23 -0
  146. package/nitrogen/generated/android/nativelist+autolinking.cmake +83 -0
  147. package/nitrogen/generated/android/nativelist+autolinking.gradle +27 -0
  148. package/nitrogen/generated/android/nativelistOnLoad.cpp +58 -0
  149. package/nitrogen/generated/android/nativelistOnLoad.hpp +34 -0
  150. package/nitrogen/generated/ios/NativeListModule+autolinking.rb +62 -0
  151. package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +41 -0
  152. package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +91 -0
  153. package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +49 -0
  154. package/nitrogen/generated/ios/NativeListModuleAutolinking.mm +33 -0
  155. package/nitrogen/generated/ios/NativeListModuleAutolinking.swift +26 -0
  156. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.cpp +11 -0
  157. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +180 -0
  158. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +180 -0
  159. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  160. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +69 -0
  161. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +447 -0
  162. package/nitrogen/generated/ios/swift/NativeListScrollAlignment.swift +48 -0
  163. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +43 -0
  164. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +87 -0
  165. package/nitrogen/generated/shared/c++/NativeListScrollAlignment.hpp +84 -0
  166. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +46 -0
  167. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +103 -0
  168. package/nitrogen/generated/shared/json/NativeListConfig.json +16 -0
  169. package/package.json +126 -0
  170. package/react-native-native-list.podspec +38 -0
  171. package/react-native.config.js +19 -0
  172. package/src/NativeList.nitro.ts +48 -0
  173. package/src/NativeList.tsx +298 -0
  174. package/src/NativeList.types.ts +125 -0
  175. package/src/NativeList.web.tsx +258 -0
  176. package/src/index.ts +35 -0
  177. package/src/models.ts +604 -0
  178. package/src/scrolling.ts +189 -0
  179. package/src/selection.ts +159 -0
  180. package/src/validation.ts +877 -0
  181. package/src/web/NativeListWebEngine.ts +3767 -0
package/src/models.ts ADDED
@@ -0,0 +1,604 @@
1
+ export type NativeListLayout = 'linear' | 'sectioned' | 'grid' | 'table';
2
+ export type NativeListOrientation = 'vertical' | 'horizontal';
3
+ export type RowSize = 'small' | 'medium' | 'large';
4
+ export type RowDensity = 'dense' | 'regular';
5
+ export type GroupPosition = 'first' | 'middle' | 'last' | 'single';
6
+ export type CheckboxState = 'checked' | 'unchecked' | 'indeterminate';
7
+ export type SelectionMode = 'none' | 'single' | 'multiple';
8
+ export type TextTone = 'primary' | 'secondary' | 'positive' | 'negative';
9
+
10
+ export type ImageContentFit = 'cover' | 'contain' | 'fill' | 'center';
11
+ export type ImageCachePolicy = 'memory-disk' | 'memory' | 'disk' | 'none';
12
+ export type ImageLoadingStrategy = 'static' | 'skeleton' | 'none';
13
+
14
+ export type ImageSource = Readonly<{
15
+ uri: string;
16
+ width: number;
17
+ height: number;
18
+ headers?: Readonly<Record<string, string>>;
19
+ contentFit?: ImageContentFit;
20
+ cachePolicy?: ImageCachePolicy;
21
+ autoplay?: boolean;
22
+ optimizeTos?: boolean;
23
+ overscan?: number;
24
+ loadingStrategy?: ImageLoadingStrategy;
25
+ }>;
26
+
27
+ export type BadgeModel = Readonly<{
28
+ key: string;
29
+ text: string;
30
+ tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
31
+ }>;
32
+
33
+ type VisualWithImage = Readonly<{
34
+ image?: ImageSource;
35
+ fallbackText?: string;
36
+ backgroundColor?: string;
37
+ shape?: 'circle' | 'rounded' | 'square';
38
+ cornerIcon?: Readonly<{
39
+ name: string;
40
+ tintColor?: string;
41
+ backgroundColor?: string;
42
+ }>;
43
+ }>;
44
+
45
+ export type LeadingVisual =
46
+ | (VisualWithImage & Readonly<{ kind: 'token'; networkImage?: ImageSource }>)
47
+ | (VisualWithImage & Readonly<{ kind: 'account' }>)
48
+ | (VisualWithImage & Readonly<{ kind: 'wallet' }>)
49
+ | (VisualWithImage & Readonly<{ kind: 'network' }>)
50
+ | Readonly<{
51
+ kind: 'image';
52
+ image: ImageSource;
53
+ shape?: 'circle' | 'rounded' | 'square';
54
+ }>
55
+ | Readonly<{
56
+ kind: 'icon';
57
+ name: string;
58
+ tintColor?: string;
59
+ backgroundColor?: string;
60
+ }>
61
+ | Readonly<{
62
+ kind: 'stackedImages';
63
+ images:
64
+ | readonly [ImageSource, ImageSource]
65
+ | readonly [ImageSource, ImageSource, ImageSource];
66
+ }>;
67
+
68
+ export type SelectionTarget =
69
+ | Readonly<{ scope: 'row' }>
70
+ | Readonly<{ scope: 'section'; sectionKey: string }>
71
+ | Readonly<{ scope: 'list' }>;
72
+
73
+ export type TrailingAccessory =
74
+ | Readonly<{ kind: 'value'; text: string; secondary?: boolean }>
75
+ | Readonly<{
76
+ kind: 'valuePair';
77
+ primary: string;
78
+ secondary: string;
79
+ primaryTone?: TextTone;
80
+ secondaryTone?: TextTone;
81
+ }>
82
+ | Readonly<{
83
+ kind: 'checkbox';
84
+ state: CheckboxState;
85
+ disabled?: boolean;
86
+ loading?: boolean;
87
+ target?: SelectionTarget;
88
+ actionKey?: string;
89
+ }>
90
+ | Readonly<{
91
+ kind: 'radio';
92
+ checked: boolean;
93
+ disabled?: boolean;
94
+ actionKey?: string;
95
+ }>
96
+ | Readonly<{
97
+ kind: 'switch';
98
+ value: boolean;
99
+ disabled?: boolean;
100
+ actionKey: string;
101
+ }>
102
+ | Readonly<{ kind: 'chevron'; actionKey?: string }>
103
+ | Readonly<{ kind: 'menu'; actionKey: string }>
104
+ | Readonly<{ kind: 'drag'; actionKey?: string }>
105
+ | Readonly<{
106
+ kind: 'icon';
107
+ name: string;
108
+ tintColor?: string;
109
+ disabled?: boolean;
110
+ actionKey?: string;
111
+ }>
112
+ | Readonly<{ kind: 'spinner' }>
113
+ | Readonly<{ kind: 'progress'; value: number }>;
114
+
115
+ export type FooterAction = Readonly<{
116
+ key: string;
117
+ label: string;
118
+ tone?: 'primary' | 'neutral' | 'danger';
119
+ disabled?: boolean;
120
+ }>;
121
+
122
+ export type RowBase = Readonly<{
123
+ key: string;
124
+ revision?: number;
125
+ sectionKey?: string;
126
+ groupId?: string;
127
+ groupPosition?: GroupPosition;
128
+ size?: RowSize;
129
+ density?: RowDensity;
130
+ disabled?: boolean;
131
+ selected?: boolean;
132
+ accessibilityLabel?: string;
133
+ separator?: boolean;
134
+ }>;
135
+
136
+ export type IdentityRow = RowBase &
137
+ Readonly<{
138
+ type: 'identity';
139
+ presentation?: 'walletSidebar' | 'accountSelector' | 'networkSelector';
140
+ leading: LeadingVisual;
141
+ leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
142
+ title: string;
143
+ subtitle?: string;
144
+ tertiary?: string;
145
+ tertiaryTone?: 'secondary' | 'info';
146
+ titleLines?: 1 | 2;
147
+ subtitleLines?: 1 | 2;
148
+ badges?: readonly BadgeModel[];
149
+ trailing?: readonly TrailingAccessory[];
150
+ draggable?: boolean;
151
+ }>;
152
+
153
+ export type WalletGroupRow = RowBase &
154
+ Readonly<{
155
+ type: 'walletGroup';
156
+ parent: IdentityRow;
157
+ children: readonly IdentityRow[];
158
+ draggable?: boolean;
159
+ }>;
160
+
161
+ export type RailRow = RowBase &
162
+ Readonly<{
163
+ type: 'rail';
164
+ visual: LeadingVisual;
165
+ title: string;
166
+ status?: 'none' | 'online' | 'warning' | 'error';
167
+ badge?: BadgeModel;
168
+ draggable?: boolean;
169
+ }>;
170
+
171
+ export type ActivityRow = RowBase &
172
+ Readonly<{
173
+ type: 'activity';
174
+ leading: LeadingVisual;
175
+ secondaryLeading?: LeadingVisual;
176
+ title: string;
177
+ description?: string;
178
+ status?: string;
179
+ primaryAmount?: string;
180
+ secondaryAmount?: string;
181
+ footerActions?: readonly FooterAction[];
182
+ }>;
183
+
184
+ export type MessageRow = RowBase &
185
+ Readonly<{
186
+ type: 'message';
187
+ unread?: boolean;
188
+ leading?: LeadingVisual;
189
+ title: string;
190
+ body: string;
191
+ bodyLines?: 1 | 2 | 3;
192
+ time: string;
193
+ thumbnail?: ImageSource;
194
+ }>;
195
+
196
+ export type DataColumn = Readonly<{
197
+ key: string;
198
+ text: string;
199
+ secondaryLeadingText?: string;
200
+ secondaryText?: string;
201
+ weight?: 1 | 2 | 3;
202
+ alignment?: 'start' | 'center' | 'end';
203
+ tone?: 'primary' | 'secondary' | 'positive' | 'negative';
204
+ secondaryTone?: TextTone;
205
+ }>;
206
+
207
+ export type DataRow = RowBase &
208
+ Readonly<{
209
+ type: 'dataRow';
210
+ leading?: LeadingVisual;
211
+ columns: readonly DataColumn[];
212
+ checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
213
+ index?: number;
214
+ badge?: BadgeModel;
215
+ badges?: readonly BadgeModel[];
216
+ favorite?: boolean;
217
+ favoriteActive?: boolean;
218
+ }>;
219
+
220
+ export type MediaTileRow = RowBase &
221
+ Readonly<{
222
+ type: 'mediaTile';
223
+ variant: 'gallery' | 'browserPreview';
224
+ image?: ImageSource;
225
+ imageState?: 'empty' | 'error';
226
+ networkImage?: ImageSource;
227
+ title: string;
228
+ subtitle?: string;
229
+ badge?: BadgeModel;
230
+ closeActionKey?: string;
231
+ }>;
232
+
233
+ /** Compact KPI card for dashboards and grids. */
234
+ export type MetricValue = Readonly<{
235
+ key: string;
236
+ label: string;
237
+ value: string;
238
+ tone?: TextTone;
239
+ visual?: LeadingVisual;
240
+ }>;
241
+
242
+ export type MetricCardRow = RowBase &
243
+ Readonly<{
244
+ type: 'metricCard';
245
+ variant?: 'standard' | 'activity' | 'performance';
246
+ title: string;
247
+ value: string;
248
+ subtitle?: string;
249
+ trend?: string;
250
+ trendTone?: 'positive' | 'negative' | 'neutral';
251
+ visual?: LeadingVisual;
252
+ badge?: BadgeModel;
253
+ metrics?: readonly MetricValue[];
254
+ progress?: number;
255
+ }>;
256
+
257
+ export type SectionHeaderRow = RowBase &
258
+ Readonly<{
259
+ type: 'sectionHeader';
260
+ sectionKey: string;
261
+ presentation?: 'networkSelector';
262
+ indexTitle?: string;
263
+ variant?: 'summary' | 'gallery' | 'history';
264
+ title: string;
265
+ subtitle?: string;
266
+ value?: string;
267
+ valueActionKey?: string;
268
+ titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
269
+ valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
270
+ checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
271
+ }>;
272
+
273
+ export type ActionRow = RowBase &
274
+ Readonly<{
275
+ type: 'action';
276
+ presentation?: 'accountSelector';
277
+ title: string;
278
+ actionKey: string;
279
+ tone?: 'primary' | 'neutral' | 'danger';
280
+ icon?: Extract<LeadingVisual, { kind: 'icon' }>;
281
+ checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
282
+ trailing?: readonly TrailingAccessory[];
283
+ }>;
284
+
285
+ export type SystemRow = RowBase &
286
+ (
287
+ | Readonly<{ type: 'system'; variant: 'loading'; message?: string }>
288
+ | Readonly<{
289
+ type: 'system';
290
+ variant: 'retry';
291
+ message: string;
292
+ actionKey: string;
293
+ }>
294
+ | Readonly<{ type: 'system'; variant: 'noMatch'; message: string }>
295
+ | Readonly<{ type: 'system'; variant: 'end'; message?: string }>
296
+ | Readonly<{ type: 'system'; variant: 'spacer'; height: number }>
297
+ );
298
+
299
+ export type RowModel =
300
+ | IdentityRow
301
+ | WalletGroupRow
302
+ | RailRow
303
+ | ActivityRow
304
+ | MessageRow
305
+ | DataRow
306
+ | MediaTileRow
307
+ | MetricCardRow
308
+ | SectionHeaderRow
309
+ | ActionRow
310
+ | SystemRow;
311
+
312
+ export type NativeListTheme = Readonly<{
313
+ background: string;
314
+ rowBackground: string;
315
+ rowSelectedBackground: string;
316
+ rowPressedBackground?: string;
317
+ subduedBackground?: string;
318
+ strongBackground?: string;
319
+ primaryText: string;
320
+ secondaryText: string;
321
+ disabledText?: string;
322
+ icon?: string;
323
+ iconSubdued?: string;
324
+ separator: string;
325
+ accent: string;
326
+ positive: string;
327
+ negative: string;
328
+ criticalBackground?: string;
329
+ inverseBackground?: string;
330
+ inverseText?: string;
331
+ info?: string;
332
+ }>;
333
+
334
+ export type SectionIndexConfig = Readonly<{
335
+ enabled: boolean;
336
+ hapticsEnabled?: boolean;
337
+ }>;
338
+
339
+ export type NativeListSnapshot = Readonly<{
340
+ schemaVersion: 1;
341
+ generation: number;
342
+ layout: Readonly<{
343
+ kind: NativeListLayout;
344
+ orientation?: NativeListOrientation;
345
+ gridColumns?: 2 | 3 | 4;
346
+ stickyHeaders?: boolean;
347
+ contentPadding?: number;
348
+ contentPaddingHorizontal?: number;
349
+ contentPaddingTop?: number;
350
+ contentPaddingBottom?: number;
351
+ itemSpacing?: number;
352
+ }>;
353
+ rows: readonly RowModel[];
354
+ selection?: Readonly<{
355
+ mode: SelectionMode;
356
+ selectedKeys: readonly string[];
357
+ rowPressToggles?: boolean;
358
+ }>;
359
+ capabilities?: Readonly<{
360
+ reorderable?: boolean;
361
+ pullToRefresh?: boolean;
362
+ refreshing?: boolean;
363
+ loadMore?: boolean;
364
+ endReachedThreshold?: number;
365
+ sectionIndex?: SectionIndexConfig;
366
+ }>;
367
+ emptyState?: ActionRow | SystemRow;
368
+ fixedFooter?: ActionRow | SystemRow;
369
+ theme?: NativeListTheme;
370
+ }>;
371
+
372
+ type CommonPatchFields = 'revision' | 'disabled' | 'selected' | 'separator';
373
+
374
+ export type RowPatch =
375
+ | Readonly<{
376
+ type: 'identity';
377
+ key: string;
378
+ changes: Partial<
379
+ Pick<
380
+ IdentityRow,
381
+ | CommonPatchFields
382
+ | 'title'
383
+ | 'subtitle'
384
+ | 'tertiary'
385
+ | 'tertiaryTone'
386
+ | 'badges'
387
+ | 'trailing'
388
+ | 'leading'
389
+ | 'leadingAction'
390
+ >
391
+ >;
392
+ }>
393
+ | Readonly<{
394
+ type: 'rail';
395
+ key: string;
396
+ changes: Partial<
397
+ Pick<
398
+ RailRow,
399
+ CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
400
+ >
401
+ >;
402
+ }>
403
+ | Readonly<{
404
+ type: 'activity';
405
+ key: string;
406
+ changes: Partial<
407
+ Pick<
408
+ ActivityRow,
409
+ | CommonPatchFields
410
+ | 'title'
411
+ | 'description'
412
+ | 'status'
413
+ | 'primaryAmount'
414
+ | 'secondaryAmount'
415
+ | 'leading'
416
+ | 'secondaryLeading'
417
+ | 'footerActions'
418
+ >
419
+ >;
420
+ }>
421
+ | Readonly<{
422
+ type: 'message';
423
+ key: string;
424
+ changes: Partial<
425
+ Pick<
426
+ MessageRow,
427
+ | CommonPatchFields
428
+ | 'unread'
429
+ | 'title'
430
+ | 'body'
431
+ | 'bodyLines'
432
+ | 'time'
433
+ | 'thumbnail'
434
+ >
435
+ >;
436
+ }>
437
+ | Readonly<{
438
+ type: 'dataRow';
439
+ key: string;
440
+ changes: Partial<
441
+ Pick<
442
+ DataRow,
443
+ | CommonPatchFields
444
+ | 'leading'
445
+ | 'columns'
446
+ | 'checkbox'
447
+ | 'index'
448
+ | 'badge'
449
+ | 'badges'
450
+ | 'favorite'
451
+ | 'favoriteActive'
452
+ >
453
+ >;
454
+ }>
455
+ | Readonly<{
456
+ type: 'mediaTile';
457
+ key: string;
458
+ changes: Partial<
459
+ Pick<
460
+ MediaTileRow,
461
+ | CommonPatchFields
462
+ | 'image'
463
+ | 'imageState'
464
+ | 'networkImage'
465
+ | 'title'
466
+ | 'subtitle'
467
+ | 'badge'
468
+ | 'closeActionKey'
469
+ >
470
+ >;
471
+ }>
472
+ | Readonly<{
473
+ type: 'metricCard';
474
+ key: string;
475
+ changes: Partial<
476
+ Pick<
477
+ MetricCardRow,
478
+ | CommonPatchFields
479
+ | 'variant'
480
+ | 'title'
481
+ | 'value'
482
+ | 'subtitle'
483
+ | 'trend'
484
+ | 'trendTone'
485
+ | 'visual'
486
+ | 'badge'
487
+ | 'metrics'
488
+ | 'progress'
489
+ >
490
+ >;
491
+ }>
492
+ | Readonly<{
493
+ type: 'sectionHeader';
494
+ key: string;
495
+ changes: Partial<
496
+ Pick<
497
+ SectionHeaderRow,
498
+ | CommonPatchFields
499
+ | 'variant'
500
+ | 'title'
501
+ | 'subtitle'
502
+ | 'value'
503
+ | 'valueActionKey'
504
+ | 'titleIcon'
505
+ | 'valueIcon'
506
+ | 'checkbox'
507
+ >
508
+ >;
509
+ }>
510
+ | Readonly<{
511
+ type: 'action';
512
+ key: string;
513
+ changes: Partial<
514
+ Pick<
515
+ ActionRow,
516
+ | CommonPatchFields
517
+ | 'title'
518
+ | 'tone'
519
+ | 'icon'
520
+ | 'checkbox'
521
+ | 'trailing'
522
+ >
523
+ >;
524
+ }>
525
+ | Readonly<{
526
+ type: 'system';
527
+ key: string;
528
+ changes: Readonly<{
529
+ revision?: number;
530
+ disabled?: boolean;
531
+ message?: string;
532
+ }>;
533
+ }>;
534
+
535
+ export type NativeListActionSource =
536
+ | 'row'
537
+ | 'leadingAction'
538
+ | 'trailingAccessory'
539
+ | 'footerAction'
540
+ | 'mediaClose';
541
+
542
+ export type NativeListWindowRect = Readonly<{
543
+ x: number;
544
+ y: number;
545
+ width: number;
546
+ height: number;
547
+ }>;
548
+
549
+ export type NativeListActionAnchor = Readonly<{
550
+ /** Opaque identity for one concrete native/DOM control binding. */
551
+ token: string;
552
+ /** Window-relative logical units: CSS px on Web, points on iOS, dp on Android. */
553
+ windowRect: NativeListWindowRect;
554
+ source: NativeListActionSource;
555
+ slot?: number;
556
+ generation: number;
557
+ layoutDirection: 'ltr' | 'rtl';
558
+ }>;
559
+
560
+ export type RowActionEvent = Readonly<{
561
+ rowKey?: string;
562
+ actionKey: string;
563
+ sectionKey?: string;
564
+ anchor?: NativeListActionAnchor;
565
+ }>;
566
+
567
+ export type ActionAnchorInvalidationReason =
568
+ | 'scroll'
569
+ | 'rebind'
570
+ | 'snapshot'
571
+ | 'layout'
572
+ | 'destroy';
573
+
574
+ export type ActionAnchorInvalidatedEvent = Readonly<{
575
+ token: string;
576
+ reason: ActionAnchorInvalidationReason;
577
+ }>;
578
+
579
+ export type SelectionDeltaEvent = Readonly<{
580
+ addedKeys: readonly string[];
581
+ removedKeys: readonly string[];
582
+ source: 'row' | 'section' | 'list' | 'nativeReorder';
583
+ sourceKey?: string;
584
+ }>;
585
+
586
+ export type ReorderEvent = Readonly<{
587
+ key: string;
588
+ fromIndex: number;
589
+ toIndex: number;
590
+ beforeKey?: string;
591
+ afterKey?: string;
592
+ }>;
593
+
594
+ export type EndReachedEvent = Readonly<{
595
+ generation: number;
596
+ lastKey?: string;
597
+ }>;
598
+
599
+ export type VisibleRangeChangedEvent = Readonly<{
600
+ firstKey?: string;
601
+ lastKey?: string;
602
+ firstIndex: number;
603
+ lastIndex: number;
604
+ }>;