@onekeyfe/react-native-native-list 3.0.157 → 3.0.159
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 +21 -5
- package/android/build.gradle +7 -0
- package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +20 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +711 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListActionRenderer.kt +169 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +179 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +264 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +20 -6
- package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +53 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +487 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListEndAlignment.kt +5 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +820 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListImageSlot.kt +147 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +453 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +997 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +268 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +243 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +232 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMetricCardRenderer.kt +551 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +27 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +475 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRailRenderer.kt +143 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +42 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +415 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +163 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRowHost.kt +70 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListScrollPositionTracker.kt +59 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +763 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListSystemRenderer.kt +464 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +432 -124
- package/android/src/main/java/com/onekey/nativelist/NativeListWalletGroupRenderer.kt +407 -0
- package/android/src/main/res/values/native_scroll_coordinator_ids.xml +5 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListEndAlignmentTest.kt +34 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListScrollPositionTrackerTest.kt +44 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListSelectorBackgroundColorTest.kt +34 -0
- package/docs/DESIGN.md +520 -9
- package/docs/MIGRATION_BASELINE.md +117 -0
- package/docs/ROW_TEMPLATES.md +404 -0
- package/docs/SPEC.md +621 -0
- package/docs/STYLE_SPEC.md +988 -0
- package/docs/images/list-capabilities.svg +39 -0
- package/docs/images/row-action.svg +17 -0
- package/docs/images/row-activity.svg +24 -0
- package/docs/images/row-data.svg +24 -0
- package/docs/images/row-identity.svg +25 -0
- package/docs/images/row-market.svg +23 -0
- package/docs/images/row-media-tile.svg +26 -0
- package/docs/images/row-message.svg +20 -0
- package/docs/images/row-metric-card.svg +33 -0
- package/docs/images/row-rail.svg +18 -0
- package/docs/images/row-section-header.svg +19 -0
- package/docs/images/row-style-regions.svg +30 -0
- package/docs/images/row-system.svg +30 -0
- package/docs/images/row-wallet-group.svg +26 -0
- package/ios/HybridNativeList.swift +30 -0
- package/ios/NativeListAccessoryStack.swift +680 -0
- package/ios/NativeListActionRenderer.swift +108 -0
- package/ios/NativeListActivityDetailsView.swift +291 -0
- package/ios/NativeListActivityRenderer.swift +201 -0
- package/ios/NativeListDataRowRenderer.swift +444 -0
- package/ios/NativeListIdentityRenderer.swift +685 -0
- package/ios/NativeListImageSlot.swift +140 -0
- package/ios/NativeListLeadingVisual.swift +372 -0
- package/ios/NativeListMarketRenderer.swift +698 -0
- package/ios/NativeListMediaPreviewSlot.swift +259 -0
- package/ios/NativeListMediaTileRenderer.swift +190 -0
- package/ios/NativeListMessageRenderer.swift +168 -0
- package/ios/NativeListMetricCardRenderer.swift +420 -0
- package/ios/NativeListModels.swift +36 -1
- package/ios/NativeListRailRenderer.swift +152 -0
- package/ios/NativeListRendererCell.swift +311 -0
- package/ios/NativeListRendererRegistry.swift +50 -0
- package/ios/NativeListResolvedText.swift +130 -0
- package/ios/NativeListRowHost.swift +63 -0
- package/ios/NativeListScrollPositionTracker.swift +30 -0
- package/ios/NativeListSectionHeaderRenderer.swift +734 -0
- package/ios/NativeListSystemRenderer.swift +568 -0
- package/ios/NativeListTextLabel.swift +42 -0
- package/ios/NativeListTextStyles.swift +236 -0
- package/ios/NativeListWalletGroupRenderer.swift +255 -0
- package/ios/RNCNativeListView.swift +282 -184
- package/ios/tests/NativeListActivityPresentationTests.swift +97 -0
- package/ios/tests/NativeListLifecycleTests.swift +241 -0
- package/ios/tests/NativeListMediaVisibilityTests.swift +109 -0
- package/ios/tests/NativeListScrollPositionTrackerTests.swift +25 -0
- package/lib/module/NativeList.js +56 -3
- package/lib/module/NativeList.web.js +5 -0
- package/lib/module/models.js +54 -0
- package/lib/module/validation.js +386 -28
- package/lib/module/web/NativeListWebEngine.js +148 -936
- package/lib/module/web/templates/ActionRowRenderer.js +97 -0
- package/lib/module/web/templates/ActivityRowRenderer.js +95 -0
- package/lib/module/web/templates/DataRowRenderer.js +145 -0
- package/lib/module/web/templates/IdentityRowRenderer.js +289 -0
- package/lib/module/web/templates/MarketRowRenderer.js +310 -0
- package/lib/module/web/templates/MediaTileRowRenderer.js +132 -0
- package/lib/module/web/templates/MessageRowRenderer.js +165 -0
- package/lib/module/web/templates/MetricCardRowRenderer.js +172 -0
- package/lib/module/web/templates/RailRowRenderer.js +98 -0
- package/lib/module/web/templates/RowContainerStyle.js +100 -0
- package/lib/module/web/templates/RowElements.js +93 -0
- package/lib/module/web/templates/RowRendererRegistry.js +70 -0
- package/lib/module/web/templates/RowText.js +121 -0
- package/lib/module/web/templates/RowVisual.js +43 -0
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +146 -0
- package/lib/module/web/templates/SystemRowRenderer.js +161 -0
- package/lib/module/web/templates/WalletGroupRowRenderer.js +96 -0
- package/lib/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +39 -3
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +6 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +15 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_bool.kt +78 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +26 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +24 -9
- package/lib/nitrogen/generated/android/nativelistOnLoad.cpp +2 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +8 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +37 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +23 -2
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +32 -0
- package/lib/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +3 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +54 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +6 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +8 -2
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +6 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +11 -2
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +3 -0
- package/lib/typescript/src/NativeList.nitro.d.ts +3 -0
- package/lib/typescript/src/NativeList.types.d.ts +14 -1
- package/lib/typescript/src/models.d.ts +199 -18
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +18 -16
- package/lib/typescript/src/web/templates/ActionRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/ActivityRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/DataRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +16 -0
- package/lib/typescript/src/web/templates/MarketRowRenderer.d.ts +30 -0
- package/lib/typescript/src/web/templates/MediaTileRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +44 -0
- package/lib/typescript/src/web/templates/MetricCardRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/RailRowRenderer.d.ts +28 -0
- package/lib/typescript/src/web/templates/RowContainerStyle.d.ts +9 -0
- package/lib/typescript/src/web/templates/RowElements.d.ts +38 -0
- package/lib/typescript/src/web/templates/RowRendererRegistry.d.ts +83 -0
- package/lib/typescript/src/web/templates/RowText.d.ts +9 -0
- package/lib/typescript/src/web/templates/RowVisual.d.ts +20 -0
- package/lib/typescript/src/web/templates/SectionHeaderRowRenderer.d.ts +15 -0
- package/lib/typescript/src/web/templates/SystemRowRenderer.d.ts +16 -0
- package/lib/typescript/src/web/templates/WalletGroupRowRenderer.d.ts +20 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +39 -3
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +6 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/Func_void_bool.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/views/HybridNativeListManager.kt +24 -9
- package/nitrogen/generated/android/nativelistOnLoad.cpp +2 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Bridge.hpp +37 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +23 -2
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +32 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +3 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +54 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +6 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +8 -2
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +6 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +11 -2
- package/nitrogen/generated/shared/json/NativeListConfig.json +3 -0
- package/package.json +7 -6
- package/react-native-native-list.podspec +6 -0
- package/scripts/enable-container-slots.mjs +58 -0
- package/scripts/enable-container-slots.test.mjs +58 -0
- package/src/NativeList.nitro.ts +3 -0
- package/src/NativeList.tsx +84 -2
- package/src/NativeList.types.ts +14 -1
- package/src/NativeList.web.tsx +5 -0
- package/src/models.ts +320 -20
- package/src/validation.ts +641 -49
- package/src/web/NativeListWebEngine.ts +361 -1932
- package/src/web/templates/ActionRowRenderer.ts +123 -0
- package/src/web/templates/ActivityRowRenderer.ts +159 -0
- package/src/web/templates/DataRowRenderer.ts +212 -0
- package/src/web/templates/IdentityRowRenderer.ts +527 -0
- package/src/web/templates/MarketRowRenderer.ts +467 -0
- package/src/web/templates/MediaTileRowRenderer.ts +182 -0
- package/src/web/templates/MessageRowRenderer.ts +306 -0
- package/src/web/templates/MetricCardRowRenderer.ts +337 -0
- package/src/web/templates/RailRowRenderer.ts +136 -0
- package/src/web/templates/RowContainerStyle.ts +131 -0
- package/src/web/templates/RowElements.ts +160 -0
- package/src/web/templates/RowRendererRegistry.ts +111 -0
- package/src/web/templates/RowText.ts +181 -0
- package/src/web/templates/RowVisual.ts +115 -0
- package/src/web/templates/SectionHeaderRowRenderer.ts +243 -0
- package/src/web/templates/SystemRowRenderer.ts +282 -0
- package/src/web/templates/WalletGroupRowRenderer.ts +131 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRowView.kt +0 -4538
- package/ios/NativeListCell.swift +0 -4300
package/src/models.ts
CHANGED
|
@@ -34,16 +34,42 @@ export type BadgeModel = Readonly<{
|
|
|
34
34
|
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
35
35
|
}>;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Named typography steps, shared with the application's design scale. Resolved
|
|
39
|
+
* to fontSize/lineHeight/fontWeight in JavaScript before the snapshot is
|
|
40
|
+
* serialized, so no native renderer needs to know the vocabulary.
|
|
41
|
+
* See docs/STYLE_SPEC.md §3.2.
|
|
42
|
+
*/
|
|
43
|
+
export type NativeListTypographyToken =
|
|
44
|
+
| '$headingXl'
|
|
45
|
+
| '$headingLg'
|
|
46
|
+
| '$headingMd'
|
|
47
|
+
| '$headingSm'
|
|
48
|
+
| '$headingXs'
|
|
49
|
+
| '$bodyLg'
|
|
50
|
+
| '$bodyMd'
|
|
51
|
+
| '$bodySm'
|
|
52
|
+
| '$bodyXs';
|
|
53
|
+
|
|
54
|
+
export type NativeListTextStyle = Readonly<{
|
|
55
|
+
token?: NativeListTypographyToken;
|
|
38
56
|
fontSize?: number;
|
|
39
57
|
fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
|
|
40
58
|
color?: string;
|
|
41
59
|
lineHeight?: number;
|
|
42
|
-
lines
|
|
60
|
+
/** Maximum visible lines; does not reserve empty lines or enlarge the row. */
|
|
61
|
+
lines?: 1 | 2 | 3;
|
|
62
|
+
truncate?: 'tail' | 'clip';
|
|
43
63
|
alignment?: 'start' | 'center' | 'end';
|
|
64
|
+
verticalAlignment?: 'top' | 'center' | 'bottom';
|
|
65
|
+
/** Optical translation in logical units; does not affect layout. */
|
|
66
|
+
offsetY?: number;
|
|
44
67
|
}>;
|
|
45
68
|
|
|
46
|
-
|
|
69
|
+
/** Retained alias: Market shipped this name before the style surface was shared. */
|
|
70
|
+
export type MarketTextStyle = NativeListTextStyle;
|
|
71
|
+
|
|
72
|
+
export type NativeListImageStyle = Readonly<{
|
|
47
73
|
width?: number;
|
|
48
74
|
height?: number;
|
|
49
75
|
shape?: 'circle' | 'rounded' | 'square';
|
|
@@ -51,29 +77,225 @@ export type MarketImageStyle = Readonly<{
|
|
|
51
77
|
contentFit?: ImageContentFit;
|
|
52
78
|
}>;
|
|
53
79
|
|
|
54
|
-
export type
|
|
80
|
+
export type MarketImageStyle = NativeListImageStyle;
|
|
81
|
+
|
|
82
|
+
export type NativeListRowContainerStyle = Readonly<{
|
|
83
|
+
/** Explicit row height in logical units; overrides RowBase.height. */
|
|
84
|
+
height?: number;
|
|
85
|
+
backgroundColor?: string;
|
|
86
|
+
opacity?: number;
|
|
87
|
+
cornerRadius?: number;
|
|
88
|
+
borderWidth?: number;
|
|
89
|
+
borderColor?: string;
|
|
90
|
+
contentVerticalAlignment?: 'top' | 'center' | 'bottom';
|
|
91
|
+
}>;
|
|
92
|
+
|
|
93
|
+
/** Local box vocabulary. Each template exposes only parameters for its own slots. */
|
|
94
|
+
export type RowBoxStyle = Readonly<{
|
|
95
|
+
container?: NativeListRowContainerStyle;
|
|
55
96
|
horizontalPadding?: number;
|
|
56
97
|
verticalPadding?: number;
|
|
57
98
|
leadingGap?: number;
|
|
58
|
-
/**
|
|
99
|
+
/** Gap between the template's text rows. Omission preserves its default. */
|
|
59
100
|
lineGap?: number;
|
|
60
101
|
titleBadgeGap?: number;
|
|
61
|
-
/** OneKey patch: keep badges next to the intrinsic title width. */
|
|
62
|
-
titleBadgeLayout?: 'inline';
|
|
63
102
|
trailingGap?: number;
|
|
64
|
-
|
|
65
|
-
contentTrailingGap?: number;
|
|
66
|
-
subtitleTrailingPadding?: number;
|
|
67
|
-
image?: MarketImageStyle;
|
|
68
|
-
title?: MarketTextStyle;
|
|
69
|
-
subtitle?: MarketTextStyle;
|
|
70
|
-
price?: MarketTextStyle;
|
|
71
|
-
change?: MarketTextStyle;
|
|
72
|
-
changeWidth?: number;
|
|
73
|
-
changeHeight?: number;
|
|
74
|
-
changeCornerRadius?: number;
|
|
103
|
+
image?: NativeListImageStyle;
|
|
75
104
|
}>;
|
|
76
105
|
|
|
106
|
+
/** Template-owned slots determine which local box parameters exist, on every platform. */
|
|
107
|
+
export const ROW_BOX_STYLE_KEYS_BY_TYPE = {
|
|
108
|
+
identity: [
|
|
109
|
+
'horizontalPadding',
|
|
110
|
+
'verticalPadding',
|
|
111
|
+
'leadingGap',
|
|
112
|
+
'lineGap',
|
|
113
|
+
'titleBadgeGap',
|
|
114
|
+
'trailingGap',
|
|
115
|
+
'image',
|
|
116
|
+
],
|
|
117
|
+
walletGroup: ['horizontalPadding', 'verticalPadding'],
|
|
118
|
+
rail: [
|
|
119
|
+
'horizontalPadding',
|
|
120
|
+
'verticalPadding',
|
|
121
|
+
'leadingGap',
|
|
122
|
+
'titleBadgeGap',
|
|
123
|
+
'trailingGap',
|
|
124
|
+
'image',
|
|
125
|
+
],
|
|
126
|
+
activity: [
|
|
127
|
+
'horizontalPadding',
|
|
128
|
+
'verticalPadding',
|
|
129
|
+
'leadingGap',
|
|
130
|
+
'lineGap',
|
|
131
|
+
'titleBadgeGap',
|
|
132
|
+
'trailingGap',
|
|
133
|
+
'image',
|
|
134
|
+
],
|
|
135
|
+
message: [
|
|
136
|
+
'horizontalPadding',
|
|
137
|
+
'verticalPadding',
|
|
138
|
+
'leadingGap',
|
|
139
|
+
'lineGap',
|
|
140
|
+
'image',
|
|
141
|
+
],
|
|
142
|
+
dataRow: [
|
|
143
|
+
'horizontalPadding',
|
|
144
|
+
'verticalPadding',
|
|
145
|
+
'leadingGap',
|
|
146
|
+
'lineGap',
|
|
147
|
+
'titleBadgeGap',
|
|
148
|
+
'image',
|
|
149
|
+
],
|
|
150
|
+
market: [
|
|
151
|
+
'horizontalPadding',
|
|
152
|
+
'verticalPadding',
|
|
153
|
+
'leadingGap',
|
|
154
|
+
'lineGap',
|
|
155
|
+
'titleBadgeGap',
|
|
156
|
+
'trailingGap',
|
|
157
|
+
'image',
|
|
158
|
+
],
|
|
159
|
+
mediaTile: [
|
|
160
|
+
'horizontalPadding',
|
|
161
|
+
'verticalPadding',
|
|
162
|
+
'leadingGap',
|
|
163
|
+
'lineGap',
|
|
164
|
+
'image',
|
|
165
|
+
],
|
|
166
|
+
metricCard: [
|
|
167
|
+
'horizontalPadding',
|
|
168
|
+
'verticalPadding',
|
|
169
|
+
'leadingGap',
|
|
170
|
+
'lineGap',
|
|
171
|
+
'image',
|
|
172
|
+
],
|
|
173
|
+
sectionHeader: [
|
|
174
|
+
'horizontalPadding',
|
|
175
|
+
'verticalPadding',
|
|
176
|
+
'lineGap',
|
|
177
|
+
'trailingGap',
|
|
178
|
+
],
|
|
179
|
+
action: [
|
|
180
|
+
'horizontalPadding',
|
|
181
|
+
'verticalPadding',
|
|
182
|
+
'leadingGap',
|
|
183
|
+
'trailingGap',
|
|
184
|
+
'image',
|
|
185
|
+
],
|
|
186
|
+
system: ['horizontalPadding', 'verticalPadding', 'lineGap'],
|
|
187
|
+
} as const;
|
|
188
|
+
|
|
189
|
+
type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<
|
|
190
|
+
RowBoxStyle,
|
|
191
|
+
(typeof ROW_BOX_STYLE_KEYS_BY_TYPE)[T][number] | 'container'
|
|
192
|
+
>;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* A style key names the model field it modifies, never the view that carries
|
|
196
|
+
* it. Each template renderer owns its views and maps the key to whichever view
|
|
197
|
+
* renders that field (for example metricCard `value` is its large number), so
|
|
198
|
+
* the same key name keeps one meaning across platforms. See docs/STYLE_SPEC.md §4.
|
|
199
|
+
*/
|
|
200
|
+
export type IdentityRowStyle = TemplateBoxStyle<'identity'> &
|
|
201
|
+
Readonly<{
|
|
202
|
+
title?: NativeListTextStyle;
|
|
203
|
+
subtitle?: NativeListTextStyle;
|
|
204
|
+
tertiary?: NativeListTextStyle;
|
|
205
|
+
badge?: NativeListTextStyle;
|
|
206
|
+
value?: NativeListTextStyle;
|
|
207
|
+
valueSecondary?: NativeListTextStyle;
|
|
208
|
+
}>;
|
|
209
|
+
|
|
210
|
+
export type WalletGroupRowStyle = TemplateBoxStyle<'walletGroup'>;
|
|
211
|
+
|
|
212
|
+
export type RailRowStyle = TemplateBoxStyle<'rail'> &
|
|
213
|
+
Readonly<{
|
|
214
|
+
title?: NativeListTextStyle;
|
|
215
|
+
badge?: NativeListTextStyle;
|
|
216
|
+
status?: NativeListTextStyle;
|
|
217
|
+
}>;
|
|
218
|
+
|
|
219
|
+
export type ActivityRowStyle = TemplateBoxStyle<'activity'> &
|
|
220
|
+
Readonly<{
|
|
221
|
+
title?: NativeListTextStyle;
|
|
222
|
+
description?: NativeListTextStyle;
|
|
223
|
+
status?: NativeListTextStyle;
|
|
224
|
+
primaryAmount?: NativeListTextStyle;
|
|
225
|
+
secondaryAmount?: NativeListTextStyle;
|
|
226
|
+
}>;
|
|
227
|
+
|
|
228
|
+
export type MessageRowStyle = TemplateBoxStyle<'message'> &
|
|
229
|
+
Readonly<{
|
|
230
|
+
title?: NativeListTextStyle;
|
|
231
|
+
body?: NativeListTextStyle;
|
|
232
|
+
time?: NativeListTextStyle;
|
|
233
|
+
}>;
|
|
234
|
+
|
|
235
|
+
export type DataRowStyle = TemplateBoxStyle<'dataRow'> &
|
|
236
|
+
Readonly<{
|
|
237
|
+
columns?: NativeListTextStyle;
|
|
238
|
+
columnSecondary?: NativeListTextStyle;
|
|
239
|
+
index?: NativeListTextStyle;
|
|
240
|
+
}>;
|
|
241
|
+
|
|
242
|
+
export type MarketRowStyle = TemplateBoxStyle<'market'> &
|
|
243
|
+
Readonly<{
|
|
244
|
+
/** OneKey patch: keep badges next to the intrinsic title width. */
|
|
245
|
+
titleBadgeLayout?: 'inline';
|
|
246
|
+
/** OneKey patch: preserve separate Market content and subtitle insets. */
|
|
247
|
+
contentTrailingGap?: number;
|
|
248
|
+
subtitleTrailingPadding?: number;
|
|
249
|
+
title?: NativeListTextStyle;
|
|
250
|
+
subtitle?: NativeListTextStyle;
|
|
251
|
+
price?: NativeListTextStyle;
|
|
252
|
+
change?: NativeListTextStyle;
|
|
253
|
+
changeWidth?: number;
|
|
254
|
+
changeHeight?: number;
|
|
255
|
+
changeCornerRadius?: number;
|
|
256
|
+
}>;
|
|
257
|
+
|
|
258
|
+
export type MediaTileRowStyle = TemplateBoxStyle<'mediaTile'> &
|
|
259
|
+
Readonly<{
|
|
260
|
+
title?: NativeListTextStyle;
|
|
261
|
+
subtitle?: NativeListTextStyle;
|
|
262
|
+
badge?: NativeListTextStyle;
|
|
263
|
+
}>;
|
|
264
|
+
|
|
265
|
+
export type MetricCardRowStyle = TemplateBoxStyle<'metricCard'> &
|
|
266
|
+
Readonly<{
|
|
267
|
+
/** Standard-card label or composite-card heading. */
|
|
268
|
+
title?: NativeListTextStyle;
|
|
269
|
+
/** Large number in the standard template; absent in composite variants. */
|
|
270
|
+
value?: NativeListTextStyle;
|
|
271
|
+
subtitle?: NativeListTextStyle;
|
|
272
|
+
trend?: NativeListTextStyle;
|
|
273
|
+
}>;
|
|
274
|
+
|
|
275
|
+
export type SectionHeaderRowStyle = TemplateBoxStyle<'sectionHeader'> &
|
|
276
|
+
Readonly<{
|
|
277
|
+
title?: NativeListTextStyle;
|
|
278
|
+
subtitle?: NativeListTextStyle;
|
|
279
|
+
value?: NativeListTextStyle;
|
|
280
|
+
}>;
|
|
281
|
+
|
|
282
|
+
export type ActionRowStyle = TemplateBoxStyle<'action'> &
|
|
283
|
+
Readonly<{
|
|
284
|
+
title?: NativeListTextStyle;
|
|
285
|
+
value?: NativeListTextStyle;
|
|
286
|
+
}>;
|
|
287
|
+
|
|
288
|
+
export type SystemRowStyle = TemplateBoxStyle<'system'> &
|
|
289
|
+
Readonly<{
|
|
290
|
+
title?: NativeListTextStyle;
|
|
291
|
+
message?: NativeListTextStyle;
|
|
292
|
+
/**
|
|
293
|
+
* Retry button text. Web draws a retry button only for the Market retry;
|
|
294
|
+
* a non-Market Web retry is message-only, so this has no target there.
|
|
295
|
+
*/
|
|
296
|
+
actionText?: NativeListTextStyle;
|
|
297
|
+
}>;
|
|
298
|
+
|
|
77
299
|
export type MarketBadgeModel = Readonly<{
|
|
78
300
|
key: string;
|
|
79
301
|
text?: string;
|
|
@@ -273,6 +495,7 @@ export type IdentityRow = RowBase &
|
|
|
273
495
|
badges?: readonly BadgeModel[];
|
|
274
496
|
trailing?: readonly TrailingAccessory[];
|
|
275
497
|
draggable?: boolean;
|
|
498
|
+
style?: IdentityRowStyle;
|
|
276
499
|
}>;
|
|
277
500
|
|
|
278
501
|
export type WalletGroupRow = RowBase &
|
|
@@ -281,6 +504,7 @@ export type WalletGroupRow = RowBase &
|
|
|
281
504
|
parent: IdentityRow;
|
|
282
505
|
children: readonly IdentityRow[];
|
|
283
506
|
draggable?: boolean;
|
|
507
|
+
style?: WalletGroupRowStyle;
|
|
284
508
|
}>;
|
|
285
509
|
|
|
286
510
|
export type RailRow = RowBase &
|
|
@@ -291,8 +515,19 @@ export type RailRow = RowBase &
|
|
|
291
515
|
status?: 'none' | 'online' | 'warning' | 'error';
|
|
292
516
|
badge?: BadgeModel;
|
|
293
517
|
draggable?: boolean;
|
|
518
|
+
style?: RailRowStyle;
|
|
294
519
|
}>;
|
|
295
520
|
|
|
521
|
+
export type ActivityAmount = Readonly<{
|
|
522
|
+
key: string;
|
|
523
|
+
text: string;
|
|
524
|
+
textSegments?: readonly ValueTextSegment[];
|
|
525
|
+
leading?: LeadingVisual;
|
|
526
|
+
tone?: TextTone;
|
|
527
|
+
secondaryText?: string;
|
|
528
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
529
|
+
}>;
|
|
530
|
+
|
|
296
531
|
export type ActivityRow = RowBase &
|
|
297
532
|
Readonly<{
|
|
298
533
|
type: 'activity';
|
|
@@ -303,7 +538,20 @@ export type ActivityRow = RowBase &
|
|
|
303
538
|
status?: string;
|
|
304
539
|
primaryAmount?: string;
|
|
305
540
|
secondaryAmount?: string;
|
|
541
|
+
amounts?: readonly ActivityAmount[];
|
|
542
|
+
badges?: readonly BadgeModel[];
|
|
543
|
+
presentation?: 'stacked' | 'table';
|
|
544
|
+
fee?: Readonly<{
|
|
545
|
+
label?: string;
|
|
546
|
+
primary: string;
|
|
547
|
+
primaryTextSegments?: readonly ValueTextSegment[];
|
|
548
|
+
secondary?: string;
|
|
549
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
550
|
+
hidden?: boolean;
|
|
551
|
+
}>;
|
|
552
|
+
descriptionActionKey?: string;
|
|
306
553
|
footerActions?: readonly FooterAction[];
|
|
554
|
+
style?: ActivityRowStyle;
|
|
307
555
|
}>;
|
|
308
556
|
|
|
309
557
|
export type MessageRow = RowBase &
|
|
@@ -316,6 +564,7 @@ export type MessageRow = RowBase &
|
|
|
316
564
|
bodyLines?: 1 | 2 | 3;
|
|
317
565
|
time: string;
|
|
318
566
|
thumbnail?: ImageSource;
|
|
567
|
+
style?: MessageRowStyle;
|
|
319
568
|
}>;
|
|
320
569
|
|
|
321
570
|
export type DataColumn = Readonly<{
|
|
@@ -340,6 +589,7 @@ export type DataRow = RowBase &
|
|
|
340
589
|
badges?: readonly BadgeModel[];
|
|
341
590
|
favorite?: boolean;
|
|
342
591
|
favoriteActive?: boolean;
|
|
592
|
+
style?: DataRowStyle;
|
|
343
593
|
}>;
|
|
344
594
|
|
|
345
595
|
/** Native Market quote row. All values are already localized/formatted strings. */
|
|
@@ -374,6 +624,11 @@ export type MediaTileRow = RowBase &
|
|
|
374
624
|
Readonly<{
|
|
375
625
|
type: 'mediaTile';
|
|
376
626
|
variant: 'gallery' | 'browserPreview';
|
|
627
|
+
/** Native preview; video candidates display a silent first frame, never autoplay. */
|
|
628
|
+
media?: Readonly<{
|
|
629
|
+
source: ImageSource;
|
|
630
|
+
probeOrder: readonly ('image' | 'video')[];
|
|
631
|
+
}>;
|
|
377
632
|
image?: ImageSource;
|
|
378
633
|
imageState?: 'empty' | 'error';
|
|
379
634
|
networkImage?: ImageSource;
|
|
@@ -381,6 +636,7 @@ export type MediaTileRow = RowBase &
|
|
|
381
636
|
subtitle?: string;
|
|
382
637
|
badge?: BadgeModel;
|
|
383
638
|
closeActionKey?: string;
|
|
639
|
+
style?: MediaTileRowStyle;
|
|
384
640
|
}>;
|
|
385
641
|
|
|
386
642
|
/** Compact KPI card for dashboards and grids. */
|
|
@@ -405,6 +661,7 @@ export type MetricCardRow = RowBase &
|
|
|
405
661
|
badge?: BadgeModel;
|
|
406
662
|
metrics?: readonly MetricValue[];
|
|
407
663
|
progress?: number;
|
|
664
|
+
style?: MetricCardRowStyle;
|
|
408
665
|
}>;
|
|
409
666
|
|
|
410
667
|
export type SectionHeaderRow = RowBase &
|
|
@@ -421,12 +678,14 @@ export type SectionHeaderRow = RowBase &
|
|
|
421
678
|
indexTitle?: string;
|
|
422
679
|
variant?: 'summary' | 'gallery' | 'history';
|
|
423
680
|
title: string;
|
|
681
|
+
titleLoading?: boolean;
|
|
424
682
|
subtitle?: string;
|
|
425
683
|
value?: string;
|
|
426
684
|
valueActionKey?: string;
|
|
427
685
|
titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
428
686
|
valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
429
687
|
checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
|
|
688
|
+
style?: SectionHeaderRowStyle;
|
|
430
689
|
}>;
|
|
431
690
|
|
|
432
691
|
export type ActionRow = RowBase &
|
|
@@ -439,9 +698,11 @@ export type ActionRow = RowBase &
|
|
|
439
698
|
icon?: Extract<LeadingVisual, { kind: 'icon' }>;
|
|
440
699
|
checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
|
|
441
700
|
trailing?: readonly TrailingAccessory[];
|
|
701
|
+
style?: ActionRowStyle;
|
|
442
702
|
}>;
|
|
443
703
|
|
|
444
704
|
export type SystemRow = RowBase &
|
|
705
|
+
Readonly<{ style?: SystemRowStyle }> &
|
|
445
706
|
(
|
|
446
707
|
| Readonly<{
|
|
447
708
|
type: 'system';
|
|
@@ -529,13 +790,41 @@ export type SectionIndexConfig = Readonly<{
|
|
|
529
790
|
centeredInWindow?: boolean;
|
|
530
791
|
}>;
|
|
531
792
|
|
|
793
|
+
export type NativeListSeparatorStyle = Readonly<{
|
|
794
|
+
/**
|
|
795
|
+
* Leading inset in logical pixels. Omitted keeps each platform's own default,
|
|
796
|
+
* which is not the same everywhere — see docs/STYLE_SPEC.md §6.2.
|
|
797
|
+
*/
|
|
798
|
+
inset?: number;
|
|
799
|
+
/**
|
|
800
|
+
* Overrides the `separator` theme token for this list only. Must be
|
|
801
|
+
* `#RRGGBB` or `#RRGGBBAA`, like every row style color.
|
|
802
|
+
*/
|
|
803
|
+
color?: string;
|
|
804
|
+
}>;
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* List chrome that every platform can honour. Pull to refresh, the section index
|
|
808
|
+
* rail and the reorder preview are deliberately absent: the first two are system
|
|
809
|
+
* controls or three independent constant sets, and the third is drawn with
|
|
810
|
+
* platform-specific primitives. See docs/STYLE_SPEC.md §5.
|
|
811
|
+
*/
|
|
812
|
+
export type NativeListListStyle = Readonly<{
|
|
813
|
+
separator?: NativeListSeparatorStyle;
|
|
814
|
+
/**
|
|
815
|
+
* Corner radius of a `groupId` card, `0…40` logical units. Does not affect
|
|
816
|
+
* rail or media tiles.
|
|
817
|
+
*/
|
|
818
|
+
groupCornerRadius?: number;
|
|
819
|
+
}>;
|
|
820
|
+
|
|
532
821
|
export type NativeListSnapshot = Readonly<{
|
|
533
822
|
schemaVersion: 1;
|
|
534
823
|
generation: number;
|
|
535
824
|
layout: Readonly<{
|
|
536
825
|
kind: NativeListLayout;
|
|
537
826
|
orientation?: NativeListOrientation;
|
|
538
|
-
gridColumns?: 2 | 3 | 4;
|
|
827
|
+
gridColumns?: 2 | 3 | 4 | 5 | 6 | 7;
|
|
539
828
|
stickyHeaders?: boolean;
|
|
540
829
|
contentPadding?: number;
|
|
541
830
|
contentPaddingHorizontal?: number;
|
|
@@ -553,6 +842,7 @@ export type NativeListSnapshot = Readonly<{
|
|
|
553
842
|
reorderable?: boolean;
|
|
554
843
|
pullToRefresh?: boolean;
|
|
555
844
|
refreshing?: boolean;
|
|
845
|
+
refreshTriggerDistance?: number;
|
|
556
846
|
loadMore?: boolean;
|
|
557
847
|
endReachedThreshold?: number;
|
|
558
848
|
sectionIndex?: SectionIndexConfig;
|
|
@@ -560,6 +850,7 @@ export type NativeListSnapshot = Readonly<{
|
|
|
560
850
|
emptyState?: ActionRow | SystemRow;
|
|
561
851
|
fixedFooter?: ActionRow | SystemRow;
|
|
562
852
|
theme?: NativeListTheme;
|
|
853
|
+
listStyle?: NativeListListStyle;
|
|
563
854
|
}>;
|
|
564
855
|
|
|
565
856
|
// OneKey patch: include selector-only mutable presentation fields.
|
|
@@ -575,7 +866,8 @@ type CommonPatchFields =
|
|
|
575
866
|
| 'heightRounding'
|
|
576
867
|
| 'opacity'
|
|
577
868
|
| 'pressDisabled'
|
|
578
|
-
| 'accessibilityLabel'
|
|
869
|
+
| 'accessibilityLabel'
|
|
870
|
+
| 'style';
|
|
579
871
|
|
|
580
872
|
export type RowPatch =
|
|
581
873
|
| Readonly<{
|
|
@@ -620,6 +912,11 @@ export type RowPatch =
|
|
|
620
912
|
| 'title'
|
|
621
913
|
| 'description'
|
|
622
914
|
| 'status'
|
|
915
|
+
| 'amounts'
|
|
916
|
+
| 'badges'
|
|
917
|
+
| 'presentation'
|
|
918
|
+
| 'fee'
|
|
919
|
+
| 'descriptionActionKey'
|
|
623
920
|
| 'primaryAmount'
|
|
624
921
|
| 'secondaryAmount'
|
|
625
922
|
| 'leading'
|
|
@@ -695,6 +992,7 @@ export type RowPatch =
|
|
|
695
992
|
| CommonPatchFields
|
|
696
993
|
| 'image'
|
|
697
994
|
| 'imageState'
|
|
995
|
+
| 'media'
|
|
698
996
|
| 'networkImage'
|
|
699
997
|
| 'title'
|
|
700
998
|
| 'subtitle'
|
|
@@ -731,6 +1029,7 @@ export type RowPatch =
|
|
|
731
1029
|
SectionHeaderRow,
|
|
732
1030
|
| CommonPatchFields
|
|
733
1031
|
| 'variant'
|
|
1032
|
+
| 'titleLoading'
|
|
734
1033
|
| 'title'
|
|
735
1034
|
| 'subtitle'
|
|
736
1035
|
| 'value'
|
|
@@ -774,6 +1073,7 @@ export type NativeListActionSource =
|
|
|
774
1073
|
| 'leadingAction'
|
|
775
1074
|
| 'trailingAccessory'
|
|
776
1075
|
| 'footerAction'
|
|
1076
|
+
| 'description'
|
|
777
1077
|
| 'mediaClose';
|
|
778
1078
|
|
|
779
1079
|
export type NativeListWindowRect = Readonly<{
|