@onekeyfe/react-native-native-list 6.7.0-20 → 6.7.0-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +29 -4
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +6 -10
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +15 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +33 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +13 -10
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +33 -8
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +11 -5
- package/docs/ROW_TEMPLATES.md +10 -2
- package/docs/SPEC.md +270 -42
- package/ios/NativeListActivityDetailsView.swift +13 -4
- package/ios/NativeListIdentityRenderer.swift +50 -3
- package/ios/NativeListMarketRenderer.swift +113 -18
- package/ios/RNCNativeListView.swift +21 -3
- package/ios/tests/NativeListActivityPresentationTests.swift +97 -0
- package/ios/tests/NativeListLifecycleTests.swift +73 -4
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/lib/module/NativeList.js +25 -6
- package/lib/module/NativeList.web.js +9 -12
- package/lib/module/models.js +2 -0
- package/lib/module/validation.js +695 -114
- package/lib/module/web/NativeListWebEngine.js +3 -9
- package/lib/module/web/templates/IdentityRowRenderer.js +58 -4
- package/lib/typescript/src/models.d.ts +27 -14
- package/lib/typescript/src/validation.d.ts +7 -2
- package/package.json +3 -3
- package/src/NativeList.tsx +30 -10
- package/src/NativeList.web.tsx +10 -14
- package/src/models.ts +158 -153
- package/src/validation.ts +1757 -167
- package/src/web/NativeListWebEngine.ts +6 -10
- package/src/web/templates/IdentityRowRenderer.ts +70 -4
package/src/models.ts
CHANGED
|
@@ -544,6 +544,13 @@ export type IdentityRow = RowBase &
|
|
|
544
544
|
}>;
|
|
545
545
|
/** Web-only additional help icon after titleIcon. */
|
|
546
546
|
secondaryTitleIcon?: IdentityRow['titleIcon'];
|
|
547
|
+
/** Circular image after title icons; image dimensions must be square, 1...40. */
|
|
548
|
+
titleImage?: Readonly<{
|
|
549
|
+
image: ImageSource;
|
|
550
|
+
accessibilityLabel?: string;
|
|
551
|
+
/** Web-only help anchor; the consumer owns tooltip content. */
|
|
552
|
+
hoverActionKey?: string;
|
|
553
|
+
}>;
|
|
547
554
|
subtitle?: string;
|
|
548
555
|
tertiary?: string;
|
|
549
556
|
tertiaryTone?: 'secondary' | 'info';
|
|
@@ -748,6 +755,19 @@ export type MarketRow = RowBase &
|
|
|
748
755
|
variant: 'token' | 'stock' | 'perp';
|
|
749
756
|
/** Web-only bounded table presentation; native reads the ordinary Market fields. */
|
|
750
757
|
webTable?: WebMarketTablePresentation;
|
|
758
|
+
/** Two or three ordered native text metrics; omitting them keeps the compact quote. */
|
|
759
|
+
metrics?: readonly Pick<
|
|
760
|
+
DataColumn,
|
|
761
|
+
| 'key'
|
|
762
|
+
| 'text'
|
|
763
|
+
| 'textSegments'
|
|
764
|
+
| 'secondaryText'
|
|
765
|
+
| 'secondaryTextSegments'
|
|
766
|
+
| 'weight'
|
|
767
|
+
| 'alignment'
|
|
768
|
+
| 'tone'
|
|
769
|
+
| 'secondaryTone'
|
|
770
|
+
>[];
|
|
751
771
|
leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
752
772
|
leading: LeadingVisual;
|
|
753
773
|
title: string;
|
|
@@ -1056,218 +1076,203 @@ type CommonPatchFields =
|
|
|
1056
1076
|
| 'accessibilityLabel'
|
|
1057
1077
|
| 'style';
|
|
1058
1078
|
|
|
1079
|
+
/** Null removes optional fields; undefined leaves the existing value unchanged. */
|
|
1080
|
+
export type PatchClearableChanges<Row, Keys extends keyof Row> = Readonly<{
|
|
1081
|
+
[K in Keys]?: undefined extends Row[K] ? Row[K] | null : Row[K];
|
|
1082
|
+
}>;
|
|
1083
|
+
|
|
1059
1084
|
export type RowPatch =
|
|
1060
1085
|
| Readonly<{
|
|
1061
1086
|
type: 'identity';
|
|
1062
1087
|
key: string;
|
|
1063
|
-
changes:
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
>
|
|
1088
|
+
changes: PatchClearableChanges<
|
|
1089
|
+
IdentityRow,
|
|
1090
|
+
| CommonPatchFields
|
|
1091
|
+
| 'title'
|
|
1092
|
+
| 'titleSuffixes'
|
|
1093
|
+
| 'titleIcon'
|
|
1094
|
+
| 'secondaryTitleIcon'
|
|
1095
|
+
| 'titleImage'
|
|
1096
|
+
| 'subtitle'
|
|
1097
|
+
| 'subtitleLines'
|
|
1098
|
+
| 'contentHeight'
|
|
1099
|
+
| 'longPressActionKey'
|
|
1100
|
+
| 'tertiary'
|
|
1101
|
+
| 'tertiaryTone'
|
|
1102
|
+
| 'badges'
|
|
1103
|
+
| 'trailing'
|
|
1104
|
+
| 'leading'
|
|
1105
|
+
| 'leadingAction'
|
|
1106
|
+
| 'titleMatch'
|
|
1107
|
+
| 'titleActionKey'
|
|
1108
|
+
| 'titleActionOnHover'
|
|
1109
|
+
| 'subtitleSegments'
|
|
1086
1110
|
>;
|
|
1087
1111
|
}>
|
|
1088
1112
|
| Readonly<{
|
|
1089
1113
|
type: 'rail';
|
|
1090
1114
|
key: string;
|
|
1091
|
-
changes:
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
1095
|
-
>
|
|
1115
|
+
changes: PatchClearableChanges<
|
|
1116
|
+
RailRow,
|
|
1117
|
+
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
1096
1118
|
>;
|
|
1097
1119
|
}>
|
|
1098
1120
|
| Readonly<{
|
|
1099
1121
|
type: 'activity';
|
|
1100
1122
|
key: string;
|
|
1101
|
-
changes:
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
| 'footerActions'
|
|
1119
|
-
>
|
|
1123
|
+
changes: PatchClearableChanges<
|
|
1124
|
+
ActivityRow,
|
|
1125
|
+
| CommonPatchFields
|
|
1126
|
+
| 'title'
|
|
1127
|
+
| 'description'
|
|
1128
|
+
| 'status'
|
|
1129
|
+
| 'amounts'
|
|
1130
|
+
| 'badges'
|
|
1131
|
+
| 'presentation'
|
|
1132
|
+
| 'fee'
|
|
1133
|
+
| 'descriptionActionKey'
|
|
1134
|
+
| 'primaryAmount'
|
|
1135
|
+
| 'secondaryAmount'
|
|
1136
|
+
| 'leading'
|
|
1137
|
+
| 'hideLeading'
|
|
1138
|
+
| 'secondaryLeading'
|
|
1139
|
+
| 'footerActions'
|
|
1120
1140
|
>;
|
|
1121
1141
|
}>
|
|
1122
1142
|
| Readonly<{
|
|
1123
1143
|
type: 'message';
|
|
1124
1144
|
key: string;
|
|
1125
|
-
changes:
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
| 'thumbnail'
|
|
1136
|
-
>
|
|
1145
|
+
changes: PatchClearableChanges<
|
|
1146
|
+
MessageRow,
|
|
1147
|
+
| CommonPatchFields
|
|
1148
|
+
| 'unread'
|
|
1149
|
+
| 'title'
|
|
1150
|
+
| 'body'
|
|
1151
|
+
| 'bodyLines'
|
|
1152
|
+
| 'presentation'
|
|
1153
|
+
| 'time'
|
|
1154
|
+
| 'thumbnail'
|
|
1137
1155
|
>;
|
|
1138
1156
|
}>
|
|
1139
1157
|
| Readonly<{
|
|
1140
1158
|
type: 'dataRow';
|
|
1141
1159
|
key: string;
|
|
1142
|
-
changes:
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
| 'favoriteActive'
|
|
1155
|
-
>
|
|
1160
|
+
changes: PatchClearableChanges<
|
|
1161
|
+
DataRow,
|
|
1162
|
+
| CommonPatchFields
|
|
1163
|
+
| 'leading'
|
|
1164
|
+
| 'columns'
|
|
1165
|
+
| 'trailing'
|
|
1166
|
+
| 'checkbox'
|
|
1167
|
+
| 'index'
|
|
1168
|
+
| 'badge'
|
|
1169
|
+
| 'badges'
|
|
1170
|
+
| 'favorite'
|
|
1171
|
+
| 'favoriteActive'
|
|
1156
1172
|
>;
|
|
1157
1173
|
}>
|
|
1158
1174
|
| Readonly<{
|
|
1159
1175
|
type: 'market';
|
|
1160
1176
|
key: string;
|
|
1161
|
-
changes:
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
>
|
|
1177
|
+
changes: PatchClearableChanges<
|
|
1178
|
+
MarketRow,
|
|
1179
|
+
| CommonPatchFields
|
|
1180
|
+
| 'leadingAction'
|
|
1181
|
+
| 'leading'
|
|
1182
|
+
| 'title'
|
|
1183
|
+
| 'subtitle'
|
|
1184
|
+
| 'subtitleSegments'
|
|
1185
|
+
| 'price'
|
|
1186
|
+
| 'priceSegments'
|
|
1187
|
+
| 'change'
|
|
1188
|
+
| 'badges'
|
|
1189
|
+
| 'pressActionKey'
|
|
1190
|
+
| 'pressInActionKey'
|
|
1191
|
+
| 'longPressActionKey'
|
|
1192
|
+
| 'diagnostics'
|
|
1193
|
+
| 'webTable'
|
|
1194
|
+
| 'metrics'
|
|
1195
|
+
| 'style'
|
|
1181
1196
|
>;
|
|
1182
1197
|
}>
|
|
1183
1198
|
| Readonly<{
|
|
1184
1199
|
type: 'mediaTile';
|
|
1185
1200
|
key: string;
|
|
1186
|
-
changes:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
| 'closeActionKey'
|
|
1198
|
-
>
|
|
1201
|
+
changes: PatchClearableChanges<
|
|
1202
|
+
MediaTileRow,
|
|
1203
|
+
| CommonPatchFields
|
|
1204
|
+
| 'image'
|
|
1205
|
+
| 'imageState'
|
|
1206
|
+
| 'media'
|
|
1207
|
+
| 'networkImage'
|
|
1208
|
+
| 'title'
|
|
1209
|
+
| 'subtitle'
|
|
1210
|
+
| 'badge'
|
|
1211
|
+
| 'closeActionKey'
|
|
1199
1212
|
>;
|
|
1200
1213
|
}>
|
|
1201
1214
|
| Readonly<{
|
|
1202
1215
|
type: 'metricCard';
|
|
1203
1216
|
key: string;
|
|
1204
|
-
changes:
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
| 'progress'
|
|
1218
|
-
>
|
|
1217
|
+
changes: PatchClearableChanges<
|
|
1218
|
+
MetricCardRow,
|
|
1219
|
+
| CommonPatchFields
|
|
1220
|
+
| 'variant'
|
|
1221
|
+
| 'title'
|
|
1222
|
+
| 'value'
|
|
1223
|
+
| 'subtitle'
|
|
1224
|
+
| 'trend'
|
|
1225
|
+
| 'trendTone'
|
|
1226
|
+
| 'visual'
|
|
1227
|
+
| 'badge'
|
|
1228
|
+
| 'metrics'
|
|
1229
|
+
| 'progress'
|
|
1219
1230
|
>;
|
|
1220
1231
|
}>
|
|
1221
1232
|
| Readonly<{
|
|
1222
1233
|
type: 'sectionHeader';
|
|
1223
1234
|
key: string;
|
|
1224
|
-
changes:
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
| 'checkbox'
|
|
1241
|
-
>
|
|
1235
|
+
changes: PatchClearableChanges<
|
|
1236
|
+
SectionHeaderRow,
|
|
1237
|
+
| CommonPatchFields
|
|
1238
|
+
| 'variant'
|
|
1239
|
+
| 'titleLoading'
|
|
1240
|
+
| 'title'
|
|
1241
|
+
| 'subtitle'
|
|
1242
|
+
| 'value'
|
|
1243
|
+
| 'valueHelp'
|
|
1244
|
+
| 'leadingBadge'
|
|
1245
|
+
| 'valueActionKey'
|
|
1246
|
+
| 'titleActionKey'
|
|
1247
|
+
| 'titleActionOnHover'
|
|
1248
|
+
| 'titleIcon'
|
|
1249
|
+
| 'valueIcon'
|
|
1250
|
+
| 'checkbox'
|
|
1242
1251
|
>;
|
|
1243
1252
|
}>
|
|
1244
1253
|
| Readonly<{
|
|
1245
1254
|
type: 'action';
|
|
1246
1255
|
key: string;
|
|
1247
|
-
changes:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
| CommonPatchFields
|
|
1251
|
-
| 'title'
|
|
1252
|
-
| 'tone'
|
|
1253
|
-
| 'icon'
|
|
1254
|
-
| 'checkbox'
|
|
1255
|
-
| 'trailing'
|
|
1256
|
-
>
|
|
1256
|
+
changes: PatchClearableChanges<
|
|
1257
|
+
ActionRow,
|
|
1258
|
+
CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'
|
|
1257
1259
|
>;
|
|
1258
1260
|
}>
|
|
1259
1261
|
| Readonly<{
|
|
1260
1262
|
type: 'buttonGroup';
|
|
1261
1263
|
key: string;
|
|
1262
|
-
changes:
|
|
1264
|
+
changes: PatchClearableChanges<
|
|
1265
|
+
ButtonGroupRow,
|
|
1266
|
+
CommonPatchFields | 'buttons'
|
|
1267
|
+
>;
|
|
1263
1268
|
}>
|
|
1264
1269
|
| Readonly<{
|
|
1265
1270
|
type: 'system';
|
|
1266
1271
|
key: string;
|
|
1267
1272
|
changes: Readonly<{
|
|
1268
|
-
revision?: number;
|
|
1269
|
-
disabled?: boolean;
|
|
1270
|
-
message?: string;
|
|
1273
|
+
revision?: number | null;
|
|
1274
|
+
disabled?: boolean | null;
|
|
1275
|
+
message?: string | null;
|
|
1271
1276
|
}>;
|
|
1272
1277
|
}>;
|
|
1273
1278
|
|