@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.
- package/README.md +342 -0
- package/android/CMakeLists.txt +20 -0
- package/android/build.gradle +105 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +125 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +165 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +147 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListPackage.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRowView.kt +2939 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1794 -0
- package/common/fonts/Roobert-Bold.ttf +0 -0
- package/common/fonts/Roobert-Medium.ttf +0 -0
- package/common/fonts/Roobert-Regular.ttf +0 -0
- package/common/fonts/Roobert-SemiBold.ttf +0 -0
- package/docs/DESIGN.md +129 -0
- package/ios/HybridNativeList.swift +131 -0
- package/ios/NativeListCell.swift +2858 -0
- package/ios/NativeListDesignAssets.swift +110 -0
- package/ios/NativeListModels.swift +215 -0
- package/ios/RNCNativeListView.swift +1737 -0
- package/ios/Resources/NativeListIcons.xcassets/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +1 -0
- package/lib/module/NativeList.js +183 -0
- package/lib/module/NativeList.nitro.js +4 -0
- package/lib/module/NativeList.types.js +4 -0
- package/lib/module/NativeList.web.js +167 -0
- package/lib/module/index.js +6 -0
- package/lib/module/models.js +2 -0
- package/lib/module/package.json +1 -0
- package/lib/module/scrolling.js +121 -0
- package/lib/module/selection.js +85 -0
- package/lib/module/validation.js +562 -0
- package/lib/module/web/NativeListWebEngine.js +2238 -0
- package/lib/nitrogen/generated/.gitattributes +1 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +201 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +84 -0
- package/lib/nitrogen/generated/android/c++/JNativeListScrollAlignment.hpp +64 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +104 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.hpp +54 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_std__string.kt +78 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +177 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollAlignment.kt +25 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/nativelistOnLoad.kt +35 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +96 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListStateUpdater.kt +23 -0
- package/lib/nitrogen/generated/android/nativelist+autolinking.cmake +83 -0
- package/lib/nitrogen/generated/android/nativelist+autolinking.gradle +27 -0
- package/lib/nitrogen/generated/android/nativelistOnLoad.cpp +58 -0
- package/lib/nitrogen/generated/android/nativelistOnLoad.hpp +34 -0
- package/lib/nitrogen/generated/ios/NativeListModule+autolinking.rb +62 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +41 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +91 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +49 -0
- package/lib/nitrogen/generated/ios/NativeListModuleAutolinking.mm +33 -0
- package/lib/nitrogen/generated/ios/NativeListModuleAutolinking.swift +26 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.cpp +11 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +180 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +180 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +69 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +447 -0
- package/lib/nitrogen/generated/ios/swift/NativeListScrollAlignment.swift +48 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +43 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +87 -0
- package/lib/nitrogen/generated/shared/c++/NativeListScrollAlignment.hpp +84 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +46 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +103 -0
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +16 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeList.d.ts +18 -0
- package/lib/typescript/src/NativeList.nitro.d.ts +29 -0
- package/lib/typescript/src/NativeList.types.d.ts +87 -0
- package/lib/typescript/src/NativeList.web.d.ts +19 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/models.d.ts +456 -0
- package/lib/typescript/src/scrolling.d.ts +32 -0
- package/lib/typescript/src/selection.d.ts +27 -0
- package/lib/typescript/src/validation.d.ts +7 -0
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +203 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +201 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +84 -0
- package/nitrogen/generated/android/c++/JNativeListScrollAlignment.hpp +64 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +104 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.hpp +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_std__string.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +177 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollAlignment.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/nativelistOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListStateUpdater.kt +23 -0
- package/nitrogen/generated/android/nativelist+autolinking.cmake +83 -0
- package/nitrogen/generated/android/nativelist+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nativelistOnLoad.cpp +58 -0
- package/nitrogen/generated/android/nativelistOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/NativeListModule+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +41 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +91 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +49 -0
- package/nitrogen/generated/ios/NativeListModuleAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NativeListModuleAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +180 -0
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +180 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +69 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +447 -0
- package/nitrogen/generated/ios/swift/NativeListScrollAlignment.swift +48 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +43 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +87 -0
- package/nitrogen/generated/shared/c++/NativeListScrollAlignment.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +46 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +103 -0
- package/nitrogen/generated/shared/json/NativeListConfig.json +16 -0
- package/package.json +126 -0
- package/react-native-native-list.podspec +38 -0
- package/react-native.config.js +19 -0
- package/src/NativeList.nitro.ts +48 -0
- package/src/NativeList.tsx +298 -0
- package/src/NativeList.types.ts +125 -0
- package/src/NativeList.web.tsx +258 -0
- package/src/index.ts +35 -0
- package/src/models.ts +604 -0
- package/src/scrolling.ts +189 -0
- package/src/selection.ts +159 -0
- package/src/validation.ts +877 -0
- 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
|
+
}>;
|