@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
@@ -0,0 +1,456 @@
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
+ export type ImageContentFit = 'cover' | 'contain' | 'fill' | 'center';
10
+ export type ImageCachePolicy = 'memory-disk' | 'memory' | 'disk' | 'none';
11
+ export type ImageLoadingStrategy = 'static' | 'skeleton' | 'none';
12
+ export type ImageSource = Readonly<{
13
+ uri: string;
14
+ width: number;
15
+ height: number;
16
+ headers?: Readonly<Record<string, string>>;
17
+ contentFit?: ImageContentFit;
18
+ cachePolicy?: ImageCachePolicy;
19
+ autoplay?: boolean;
20
+ optimizeTos?: boolean;
21
+ overscan?: number;
22
+ loadingStrategy?: ImageLoadingStrategy;
23
+ }>;
24
+ export type BadgeModel = Readonly<{
25
+ key: string;
26
+ text: string;
27
+ tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
28
+ }>;
29
+ type VisualWithImage = Readonly<{
30
+ image?: ImageSource;
31
+ fallbackText?: string;
32
+ backgroundColor?: string;
33
+ shape?: 'circle' | 'rounded' | 'square';
34
+ cornerIcon?: Readonly<{
35
+ name: string;
36
+ tintColor?: string;
37
+ backgroundColor?: string;
38
+ }>;
39
+ }>;
40
+ export type LeadingVisual = (VisualWithImage & Readonly<{
41
+ kind: 'token';
42
+ networkImage?: ImageSource;
43
+ }>) | (VisualWithImage & Readonly<{
44
+ kind: 'account';
45
+ }>) | (VisualWithImage & Readonly<{
46
+ kind: 'wallet';
47
+ }>) | (VisualWithImage & Readonly<{
48
+ kind: 'network';
49
+ }>) | Readonly<{
50
+ kind: 'image';
51
+ image: ImageSource;
52
+ shape?: 'circle' | 'rounded' | 'square';
53
+ }> | Readonly<{
54
+ kind: 'icon';
55
+ name: string;
56
+ tintColor?: string;
57
+ backgroundColor?: string;
58
+ }> | Readonly<{
59
+ kind: 'stackedImages';
60
+ images: readonly [ImageSource, ImageSource] | readonly [ImageSource, ImageSource, ImageSource];
61
+ }>;
62
+ export type SelectionTarget = Readonly<{
63
+ scope: 'row';
64
+ }> | Readonly<{
65
+ scope: 'section';
66
+ sectionKey: string;
67
+ }> | Readonly<{
68
+ scope: 'list';
69
+ }>;
70
+ export type TrailingAccessory = Readonly<{
71
+ kind: 'value';
72
+ text: string;
73
+ secondary?: boolean;
74
+ }> | Readonly<{
75
+ kind: 'valuePair';
76
+ primary: string;
77
+ secondary: string;
78
+ primaryTone?: TextTone;
79
+ secondaryTone?: TextTone;
80
+ }> | Readonly<{
81
+ kind: 'checkbox';
82
+ state: CheckboxState;
83
+ disabled?: boolean;
84
+ loading?: boolean;
85
+ target?: SelectionTarget;
86
+ actionKey?: string;
87
+ }> | Readonly<{
88
+ kind: 'radio';
89
+ checked: boolean;
90
+ disabled?: boolean;
91
+ actionKey?: string;
92
+ }> | Readonly<{
93
+ kind: 'switch';
94
+ value: boolean;
95
+ disabled?: boolean;
96
+ actionKey: string;
97
+ }> | Readonly<{
98
+ kind: 'chevron';
99
+ actionKey?: string;
100
+ }> | Readonly<{
101
+ kind: 'menu';
102
+ actionKey: string;
103
+ }> | Readonly<{
104
+ kind: 'drag';
105
+ actionKey?: string;
106
+ }> | Readonly<{
107
+ kind: 'icon';
108
+ name: string;
109
+ tintColor?: string;
110
+ disabled?: boolean;
111
+ actionKey?: string;
112
+ }> | Readonly<{
113
+ kind: 'spinner';
114
+ }> | Readonly<{
115
+ kind: 'progress';
116
+ value: number;
117
+ }>;
118
+ export type FooterAction = Readonly<{
119
+ key: string;
120
+ label: string;
121
+ tone?: 'primary' | 'neutral' | 'danger';
122
+ disabled?: boolean;
123
+ }>;
124
+ export type RowBase = Readonly<{
125
+ key: string;
126
+ revision?: number;
127
+ sectionKey?: string;
128
+ groupId?: string;
129
+ groupPosition?: GroupPosition;
130
+ size?: RowSize;
131
+ density?: RowDensity;
132
+ disabled?: boolean;
133
+ selected?: boolean;
134
+ accessibilityLabel?: string;
135
+ separator?: boolean;
136
+ }>;
137
+ export type IdentityRow = RowBase & Readonly<{
138
+ type: 'identity';
139
+ presentation?: 'walletSidebar' | 'accountSelector' | 'networkSelector';
140
+ leading: LeadingVisual;
141
+ leadingAction?: Extract<TrailingAccessory, {
142
+ kind: 'icon';
143
+ }>;
144
+ title: string;
145
+ subtitle?: string;
146
+ tertiary?: string;
147
+ tertiaryTone?: 'secondary' | 'info';
148
+ titleLines?: 1 | 2;
149
+ subtitleLines?: 1 | 2;
150
+ badges?: readonly BadgeModel[];
151
+ trailing?: readonly TrailingAccessory[];
152
+ draggable?: boolean;
153
+ }>;
154
+ export type WalletGroupRow = RowBase & Readonly<{
155
+ type: 'walletGroup';
156
+ parent: IdentityRow;
157
+ children: readonly IdentityRow[];
158
+ draggable?: boolean;
159
+ }>;
160
+ export type RailRow = RowBase & Readonly<{
161
+ type: 'rail';
162
+ visual: LeadingVisual;
163
+ title: string;
164
+ status?: 'none' | 'online' | 'warning' | 'error';
165
+ badge?: BadgeModel;
166
+ draggable?: boolean;
167
+ }>;
168
+ export type ActivityRow = RowBase & Readonly<{
169
+ type: 'activity';
170
+ leading: LeadingVisual;
171
+ secondaryLeading?: LeadingVisual;
172
+ title: string;
173
+ description?: string;
174
+ status?: string;
175
+ primaryAmount?: string;
176
+ secondaryAmount?: string;
177
+ footerActions?: readonly FooterAction[];
178
+ }>;
179
+ export type MessageRow = RowBase & Readonly<{
180
+ type: 'message';
181
+ unread?: boolean;
182
+ leading?: LeadingVisual;
183
+ title: string;
184
+ body: string;
185
+ bodyLines?: 1 | 2 | 3;
186
+ time: string;
187
+ thumbnail?: ImageSource;
188
+ }>;
189
+ export type DataColumn = Readonly<{
190
+ key: string;
191
+ text: string;
192
+ secondaryLeadingText?: string;
193
+ secondaryText?: string;
194
+ weight?: 1 | 2 | 3;
195
+ alignment?: 'start' | 'center' | 'end';
196
+ tone?: 'primary' | 'secondary' | 'positive' | 'negative';
197
+ secondaryTone?: TextTone;
198
+ }>;
199
+ export type DataRow = RowBase & Readonly<{
200
+ type: 'dataRow';
201
+ leading?: LeadingVisual;
202
+ columns: readonly DataColumn[];
203
+ checkbox?: Extract<TrailingAccessory, {
204
+ kind: 'checkbox';
205
+ }>;
206
+ index?: number;
207
+ badge?: BadgeModel;
208
+ badges?: readonly BadgeModel[];
209
+ favorite?: boolean;
210
+ favoriteActive?: boolean;
211
+ }>;
212
+ export type MediaTileRow = RowBase & Readonly<{
213
+ type: 'mediaTile';
214
+ variant: 'gallery' | 'browserPreview';
215
+ image?: ImageSource;
216
+ imageState?: 'empty' | 'error';
217
+ networkImage?: ImageSource;
218
+ title: string;
219
+ subtitle?: string;
220
+ badge?: BadgeModel;
221
+ closeActionKey?: string;
222
+ }>;
223
+ /** Compact KPI card for dashboards and grids. */
224
+ export type MetricValue = Readonly<{
225
+ key: string;
226
+ label: string;
227
+ value: string;
228
+ tone?: TextTone;
229
+ visual?: LeadingVisual;
230
+ }>;
231
+ export type MetricCardRow = RowBase & Readonly<{
232
+ type: 'metricCard';
233
+ variant?: 'standard' | 'activity' | 'performance';
234
+ title: string;
235
+ value: string;
236
+ subtitle?: string;
237
+ trend?: string;
238
+ trendTone?: 'positive' | 'negative' | 'neutral';
239
+ visual?: LeadingVisual;
240
+ badge?: BadgeModel;
241
+ metrics?: readonly MetricValue[];
242
+ progress?: number;
243
+ }>;
244
+ export type SectionHeaderRow = RowBase & Readonly<{
245
+ type: 'sectionHeader';
246
+ sectionKey: string;
247
+ presentation?: 'networkSelector';
248
+ indexTitle?: string;
249
+ variant?: 'summary' | 'gallery' | 'history';
250
+ title: string;
251
+ subtitle?: string;
252
+ value?: string;
253
+ valueActionKey?: string;
254
+ titleIcon?: Extract<TrailingAccessory, {
255
+ kind: 'icon';
256
+ }>;
257
+ valueIcon?: Extract<TrailingAccessory, {
258
+ kind: 'icon';
259
+ }>;
260
+ checkbox?: Extract<TrailingAccessory, {
261
+ kind: 'checkbox';
262
+ }>;
263
+ }>;
264
+ export type ActionRow = RowBase & Readonly<{
265
+ type: 'action';
266
+ presentation?: 'accountSelector';
267
+ title: string;
268
+ actionKey: string;
269
+ tone?: 'primary' | 'neutral' | 'danger';
270
+ icon?: Extract<LeadingVisual, {
271
+ kind: 'icon';
272
+ }>;
273
+ checkbox?: Extract<TrailingAccessory, {
274
+ kind: 'checkbox';
275
+ }>;
276
+ trailing?: readonly TrailingAccessory[];
277
+ }>;
278
+ export type SystemRow = RowBase & (Readonly<{
279
+ type: 'system';
280
+ variant: 'loading';
281
+ message?: string;
282
+ }> | Readonly<{
283
+ type: 'system';
284
+ variant: 'retry';
285
+ message: string;
286
+ actionKey: string;
287
+ }> | Readonly<{
288
+ type: 'system';
289
+ variant: 'noMatch';
290
+ message: string;
291
+ }> | Readonly<{
292
+ type: 'system';
293
+ variant: 'end';
294
+ message?: string;
295
+ }> | Readonly<{
296
+ type: 'system';
297
+ variant: 'spacer';
298
+ height: number;
299
+ }>);
300
+ export type RowModel = IdentityRow | WalletGroupRow | RailRow | ActivityRow | MessageRow | DataRow | MediaTileRow | MetricCardRow | SectionHeaderRow | ActionRow | SystemRow;
301
+ export type NativeListTheme = Readonly<{
302
+ background: string;
303
+ rowBackground: string;
304
+ rowSelectedBackground: string;
305
+ rowPressedBackground?: string;
306
+ subduedBackground?: string;
307
+ strongBackground?: string;
308
+ primaryText: string;
309
+ secondaryText: string;
310
+ disabledText?: string;
311
+ icon?: string;
312
+ iconSubdued?: string;
313
+ separator: string;
314
+ accent: string;
315
+ positive: string;
316
+ negative: string;
317
+ criticalBackground?: string;
318
+ inverseBackground?: string;
319
+ inverseText?: string;
320
+ info?: string;
321
+ }>;
322
+ export type SectionIndexConfig = Readonly<{
323
+ enabled: boolean;
324
+ hapticsEnabled?: boolean;
325
+ }>;
326
+ export type NativeListSnapshot = Readonly<{
327
+ schemaVersion: 1;
328
+ generation: number;
329
+ layout: Readonly<{
330
+ kind: NativeListLayout;
331
+ orientation?: NativeListOrientation;
332
+ gridColumns?: 2 | 3 | 4;
333
+ stickyHeaders?: boolean;
334
+ contentPadding?: number;
335
+ contentPaddingHorizontal?: number;
336
+ contentPaddingTop?: number;
337
+ contentPaddingBottom?: number;
338
+ itemSpacing?: number;
339
+ }>;
340
+ rows: readonly RowModel[];
341
+ selection?: Readonly<{
342
+ mode: SelectionMode;
343
+ selectedKeys: readonly string[];
344
+ rowPressToggles?: boolean;
345
+ }>;
346
+ capabilities?: Readonly<{
347
+ reorderable?: boolean;
348
+ pullToRefresh?: boolean;
349
+ refreshing?: boolean;
350
+ loadMore?: boolean;
351
+ endReachedThreshold?: number;
352
+ sectionIndex?: SectionIndexConfig;
353
+ }>;
354
+ emptyState?: ActionRow | SystemRow;
355
+ fixedFooter?: ActionRow | SystemRow;
356
+ theme?: NativeListTheme;
357
+ }>;
358
+ type CommonPatchFields = 'revision' | 'disabled' | 'selected' | 'separator';
359
+ export type RowPatch = Readonly<{
360
+ type: 'identity';
361
+ key: string;
362
+ changes: Partial<Pick<IdentityRow, CommonPatchFields | 'title' | 'subtitle' | 'tertiary' | 'tertiaryTone' | 'badges' | 'trailing' | 'leading' | 'leadingAction'>>;
363
+ }> | Readonly<{
364
+ type: 'rail';
365
+ key: string;
366
+ changes: Partial<Pick<RailRow, CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'>>;
367
+ }> | Readonly<{
368
+ type: 'activity';
369
+ key: string;
370
+ changes: Partial<Pick<ActivityRow, CommonPatchFields | 'title' | 'description' | 'status' | 'primaryAmount' | 'secondaryAmount' | 'leading' | 'secondaryLeading' | 'footerActions'>>;
371
+ }> | Readonly<{
372
+ type: 'message';
373
+ key: string;
374
+ changes: Partial<Pick<MessageRow, CommonPatchFields | 'unread' | 'title' | 'body' | 'bodyLines' | 'time' | 'thumbnail'>>;
375
+ }> | Readonly<{
376
+ type: 'dataRow';
377
+ key: string;
378
+ changes: Partial<Pick<DataRow, CommonPatchFields | 'leading' | 'columns' | 'checkbox' | 'index' | 'badge' | 'badges' | 'favorite' | 'favoriteActive'>>;
379
+ }> | Readonly<{
380
+ type: 'mediaTile';
381
+ key: string;
382
+ changes: Partial<Pick<MediaTileRow, CommonPatchFields | 'image' | 'imageState' | 'networkImage' | 'title' | 'subtitle' | 'badge' | 'closeActionKey'>>;
383
+ }> | Readonly<{
384
+ type: 'metricCard';
385
+ key: string;
386
+ changes: Partial<Pick<MetricCardRow, CommonPatchFields | 'variant' | 'title' | 'value' | 'subtitle' | 'trend' | 'trendTone' | 'visual' | 'badge' | 'metrics' | 'progress'>>;
387
+ }> | Readonly<{
388
+ type: 'sectionHeader';
389
+ key: string;
390
+ changes: Partial<Pick<SectionHeaderRow, CommonPatchFields | 'variant' | 'title' | 'subtitle' | 'value' | 'valueActionKey' | 'titleIcon' | 'valueIcon' | 'checkbox'>>;
391
+ }> | Readonly<{
392
+ type: 'action';
393
+ key: string;
394
+ changes: Partial<Pick<ActionRow, CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'>>;
395
+ }> | Readonly<{
396
+ type: 'system';
397
+ key: string;
398
+ changes: Readonly<{
399
+ revision?: number;
400
+ disabled?: boolean;
401
+ message?: string;
402
+ }>;
403
+ }>;
404
+ export type NativeListActionSource = 'row' | 'leadingAction' | 'trailingAccessory' | 'footerAction' | 'mediaClose';
405
+ export type NativeListWindowRect = Readonly<{
406
+ x: number;
407
+ y: number;
408
+ width: number;
409
+ height: number;
410
+ }>;
411
+ export type NativeListActionAnchor = Readonly<{
412
+ /** Opaque identity for one concrete native/DOM control binding. */
413
+ token: string;
414
+ /** Window-relative logical units: CSS px on Web, points on iOS, dp on Android. */
415
+ windowRect: NativeListWindowRect;
416
+ source: NativeListActionSource;
417
+ slot?: number;
418
+ generation: number;
419
+ layoutDirection: 'ltr' | 'rtl';
420
+ }>;
421
+ export type RowActionEvent = Readonly<{
422
+ rowKey?: string;
423
+ actionKey: string;
424
+ sectionKey?: string;
425
+ anchor?: NativeListActionAnchor;
426
+ }>;
427
+ export type ActionAnchorInvalidationReason = 'scroll' | 'rebind' | 'snapshot' | 'layout' | 'destroy';
428
+ export type ActionAnchorInvalidatedEvent = Readonly<{
429
+ token: string;
430
+ reason: ActionAnchorInvalidationReason;
431
+ }>;
432
+ export type SelectionDeltaEvent = Readonly<{
433
+ addedKeys: readonly string[];
434
+ removedKeys: readonly string[];
435
+ source: 'row' | 'section' | 'list' | 'nativeReorder';
436
+ sourceKey?: string;
437
+ }>;
438
+ export type ReorderEvent = Readonly<{
439
+ key: string;
440
+ fromIndex: number;
441
+ toIndex: number;
442
+ beforeKey?: string;
443
+ afterKey?: string;
444
+ }>;
445
+ export type EndReachedEvent = Readonly<{
446
+ generation: number;
447
+ lastKey?: string;
448
+ }>;
449
+ export type VisibleRangeChangedEvent = Readonly<{
450
+ firstKey?: string;
451
+ lastKey?: string;
452
+ firstIndex: number;
453
+ lastIndex: number;
454
+ }>;
455
+ export {};
456
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { ScrollAlignment, ScrollPositionOptions, ScrollToIndexFailedInfo, ScrollToIndexParams, ScrollToKeyParams, ScrollToLocationParams } from './NativeList.types';
2
+ import type { RowModel } from './models';
3
+ export type NormalizedPositionScroll = Readonly<{
4
+ animated: boolean;
5
+ alignment: ScrollAlignment;
6
+ viewPosition: number;
7
+ viewOffset: number;
8
+ }>;
9
+ export type AlignedOffsetInput = Readonly<{
10
+ itemOffset: number;
11
+ itemLength: number;
12
+ viewportLength: number;
13
+ contentLength: number;
14
+ currentOffset: number;
15
+ alignment: ScrollAlignment;
16
+ viewPosition: number;
17
+ viewOffset: number;
18
+ }>;
19
+ export declare function normalizePositionScroll(options: ScrollPositionOptions, defaultAlignment: ScrollAlignment): NormalizedPositionScroll;
20
+ export declare function normalizeIndexScroll(paramsOrIndex: ScrollToIndexParams | number, animated?: boolean, alignment?: ScrollAlignment): Readonly<{
21
+ index: number;
22
+ scroll: NormalizedPositionScroll;
23
+ }>;
24
+ export declare function normalizeKeyScroll(paramsOrKey: ScrollToKeyParams | string, animated?: boolean, alignment?: ScrollAlignment): Readonly<{
25
+ key: string;
26
+ scroll: NormalizedPositionScroll;
27
+ }>;
28
+ export declare function validateOffset(offset: number): void;
29
+ export declare function resolveLocationIndex(rows: readonly RowModel[], params: ScrollToLocationParams): number | undefined;
30
+ export declare function scrollFailure(rows: readonly RowModel[], index: number, reason: ScrollToIndexFailedInfo['reason'], averageItemLength?: number): ScrollToIndexFailedInfo;
31
+ export declare function calculateAlignedScrollOffset({ itemOffset, itemLength, viewportLength, contentLength, currentOffset, alignment, viewPosition, viewOffset, }: AlignedOffsetInput): number;
32
+ //# sourceMappingURL=scrolling.d.ts.map
@@ -0,0 +1,27 @@
1
+ import type { CheckboxState, NativeListSnapshot, RowModel, SelectionDeltaEvent, SelectionMode } from './models';
2
+ export type SelectionState = Readonly<{
3
+ mode: SelectionMode;
4
+ selectedKeys: ReadonlySet<string>;
5
+ }>;
6
+ export type SelectionAction = Readonly<{
7
+ scope: 'row';
8
+ key: string;
9
+ }> | Readonly<{
10
+ scope: 'section';
11
+ sectionKey: string;
12
+ }> | Readonly<{
13
+ scope: 'list';
14
+ }> | Readonly<{
15
+ scope: 'replace';
16
+ selectedKeys: readonly string[];
17
+ }>;
18
+ export type SelectionResult = Readonly<{
19
+ state: SelectionState;
20
+ delta: SelectionDeltaEvent;
21
+ }>;
22
+ export declare function isSelectableRow(row: RowModel): boolean;
23
+ export declare function reduceSelection(state: SelectionState, action: SelectionAction, rows: readonly RowModel[]): SelectionResult;
24
+ export declare function checkboxStateForKeys(keys: readonly string[], selectedKeys: ReadonlySet<string>): CheckboxState;
25
+ export declare function checkboxStateForSection(sectionKey: string, rows: readonly RowModel[], selectedKeys: ReadonlySet<string>): CheckboxState;
26
+ export declare function selectionStateFromSnapshot(snapshot: NativeListSnapshot): SelectionState;
27
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1,7 @@
1
+ import type { NativeListSnapshot, RowPatch } from './models';
2
+ export declare function validateSnapshot(snapshot: NativeListSnapshot): NativeListSnapshot;
3
+ export declare function validatePatches(patches: readonly RowPatch[]): readonly RowPatch[];
4
+ export declare function applyRowPatches(snapshot: NativeListSnapshot, patches: readonly RowPatch[]): NativeListSnapshot;
5
+ export declare function serializeSnapshot(snapshot: NativeListSnapshot): string;
6
+ export declare function serializePatches(patches: readonly RowPatch[]): string;
7
+ //# sourceMappingURL=validation.d.ts.map