@onekeyfe/react-native-native-list 6.7.0-alpha.397 → 6.7.0-alpha.399
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/NativeListActivityRenderer.kt +23 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +43 -15
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +88 -19
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +94 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +29 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +29 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
- package/docs/ROW_TEMPLATES.md +4 -0
- package/docs/SPEC.md +180 -37
- package/ios/NativeListDesignAssets.swift +6 -0
- package/ios/NativeListIdentityRenderer.swift +76 -4
- package/ios/NativeListLeadingVisual.swift +70 -8
- package/ios/RNCNativeListView.swift +6 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/icon.svg +1 -0
- package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
- package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
- package/ios/tests/NativeListLifecycleTests.swift +60 -0
- package/lib/module/NativeList.web.js +9 -12
- package/lib/module/models.js +2 -0
- package/lib/module/validation.js +627 -114
- package/lib/module/web/NativeListWebEngine.js +49 -9
- package/lib/module/web/templates/IdentityRowRenderer.js +58 -4
- package/lib/typescript/src/models.d.ts +25 -14
- package/lib/typescript/src/validation.d.ts +7 -2
- package/package.json +3 -3
- package/src/NativeList.web.tsx +10 -14
- package/src/models.ts +144 -153
- package/src/validation.ts +1617 -167
- package/src/web/NativeListWebEngine.ts +62 -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';
|
|
@@ -1056,218 +1063,202 @@ type CommonPatchFields =
|
|
|
1056
1063
|
| 'accessibilityLabel'
|
|
1057
1064
|
| 'style';
|
|
1058
1065
|
|
|
1066
|
+
/** Null removes optional fields; undefined leaves the existing value unchanged. */
|
|
1067
|
+
export type PatchClearableChanges<Row, Keys extends keyof Row> = Readonly<{
|
|
1068
|
+
[K in Keys]?: undefined extends Row[K] ? Row[K] | null : Row[K];
|
|
1069
|
+
}>;
|
|
1070
|
+
|
|
1059
1071
|
export type RowPatch =
|
|
1060
1072
|
| Readonly<{
|
|
1061
1073
|
type: 'identity';
|
|
1062
1074
|
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
|
-
>
|
|
1075
|
+
changes: PatchClearableChanges<
|
|
1076
|
+
IdentityRow,
|
|
1077
|
+
| CommonPatchFields
|
|
1078
|
+
| 'title'
|
|
1079
|
+
| 'titleSuffixes'
|
|
1080
|
+
| 'titleIcon'
|
|
1081
|
+
| 'secondaryTitleIcon'
|
|
1082
|
+
| 'titleImage'
|
|
1083
|
+
| 'subtitle'
|
|
1084
|
+
| 'subtitleLines'
|
|
1085
|
+
| 'contentHeight'
|
|
1086
|
+
| 'longPressActionKey'
|
|
1087
|
+
| 'tertiary'
|
|
1088
|
+
| 'tertiaryTone'
|
|
1089
|
+
| 'badges'
|
|
1090
|
+
| 'trailing'
|
|
1091
|
+
| 'leading'
|
|
1092
|
+
| 'leadingAction'
|
|
1093
|
+
| 'titleMatch'
|
|
1094
|
+
| 'titleActionKey'
|
|
1095
|
+
| 'titleActionOnHover'
|
|
1096
|
+
| 'subtitleSegments'
|
|
1086
1097
|
>;
|
|
1087
1098
|
}>
|
|
1088
1099
|
| Readonly<{
|
|
1089
1100
|
type: 'rail';
|
|
1090
1101
|
key: string;
|
|
1091
|
-
changes:
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
1095
|
-
>
|
|
1102
|
+
changes: PatchClearableChanges<
|
|
1103
|
+
RailRow,
|
|
1104
|
+
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
1096
1105
|
>;
|
|
1097
1106
|
}>
|
|
1098
1107
|
| Readonly<{
|
|
1099
1108
|
type: 'activity';
|
|
1100
1109
|
key: string;
|
|
1101
|
-
changes:
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
| 'footerActions'
|
|
1119
|
-
>
|
|
1110
|
+
changes: PatchClearableChanges<
|
|
1111
|
+
ActivityRow,
|
|
1112
|
+
| CommonPatchFields
|
|
1113
|
+
| 'title'
|
|
1114
|
+
| 'description'
|
|
1115
|
+
| 'status'
|
|
1116
|
+
| 'amounts'
|
|
1117
|
+
| 'badges'
|
|
1118
|
+
| 'presentation'
|
|
1119
|
+
| 'fee'
|
|
1120
|
+
| 'descriptionActionKey'
|
|
1121
|
+
| 'primaryAmount'
|
|
1122
|
+
| 'secondaryAmount'
|
|
1123
|
+
| 'leading'
|
|
1124
|
+
| 'hideLeading'
|
|
1125
|
+
| 'secondaryLeading'
|
|
1126
|
+
| 'footerActions'
|
|
1120
1127
|
>;
|
|
1121
1128
|
}>
|
|
1122
1129
|
| Readonly<{
|
|
1123
1130
|
type: 'message';
|
|
1124
1131
|
key: string;
|
|
1125
|
-
changes:
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
| 'thumbnail'
|
|
1136
|
-
>
|
|
1132
|
+
changes: PatchClearableChanges<
|
|
1133
|
+
MessageRow,
|
|
1134
|
+
| CommonPatchFields
|
|
1135
|
+
| 'unread'
|
|
1136
|
+
| 'title'
|
|
1137
|
+
| 'body'
|
|
1138
|
+
| 'bodyLines'
|
|
1139
|
+
| 'presentation'
|
|
1140
|
+
| 'time'
|
|
1141
|
+
| 'thumbnail'
|
|
1137
1142
|
>;
|
|
1138
1143
|
}>
|
|
1139
1144
|
| Readonly<{
|
|
1140
1145
|
type: 'dataRow';
|
|
1141
1146
|
key: string;
|
|
1142
|
-
changes:
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
| 'favoriteActive'
|
|
1155
|
-
>
|
|
1147
|
+
changes: PatchClearableChanges<
|
|
1148
|
+
DataRow,
|
|
1149
|
+
| CommonPatchFields
|
|
1150
|
+
| 'leading'
|
|
1151
|
+
| 'columns'
|
|
1152
|
+
| 'trailing'
|
|
1153
|
+
| 'checkbox'
|
|
1154
|
+
| 'index'
|
|
1155
|
+
| 'badge'
|
|
1156
|
+
| 'badges'
|
|
1157
|
+
| 'favorite'
|
|
1158
|
+
| 'favoriteActive'
|
|
1156
1159
|
>;
|
|
1157
1160
|
}>
|
|
1158
1161
|
| Readonly<{
|
|
1159
1162
|
type: 'market';
|
|
1160
1163
|
key: string;
|
|
1161
|
-
changes:
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
| 'style'
|
|
1180
|
-
>
|
|
1164
|
+
changes: PatchClearableChanges<
|
|
1165
|
+
MarketRow,
|
|
1166
|
+
| CommonPatchFields
|
|
1167
|
+
| 'leadingAction'
|
|
1168
|
+
| 'leading'
|
|
1169
|
+
| 'title'
|
|
1170
|
+
| 'subtitle'
|
|
1171
|
+
| 'subtitleSegments'
|
|
1172
|
+
| 'price'
|
|
1173
|
+
| 'priceSegments'
|
|
1174
|
+
| 'change'
|
|
1175
|
+
| 'badges'
|
|
1176
|
+
| 'pressActionKey'
|
|
1177
|
+
| 'pressInActionKey'
|
|
1178
|
+
| 'longPressActionKey'
|
|
1179
|
+
| 'diagnostics'
|
|
1180
|
+
| 'webTable'
|
|
1181
|
+
| 'style'
|
|
1181
1182
|
>;
|
|
1182
1183
|
}>
|
|
1183
1184
|
| Readonly<{
|
|
1184
1185
|
type: 'mediaTile';
|
|
1185
1186
|
key: string;
|
|
1186
|
-
changes:
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
| 'closeActionKey'
|
|
1198
|
-
>
|
|
1187
|
+
changes: PatchClearableChanges<
|
|
1188
|
+
MediaTileRow,
|
|
1189
|
+
| CommonPatchFields
|
|
1190
|
+
| 'image'
|
|
1191
|
+
| 'imageState'
|
|
1192
|
+
| 'media'
|
|
1193
|
+
| 'networkImage'
|
|
1194
|
+
| 'title'
|
|
1195
|
+
| 'subtitle'
|
|
1196
|
+
| 'badge'
|
|
1197
|
+
| 'closeActionKey'
|
|
1199
1198
|
>;
|
|
1200
1199
|
}>
|
|
1201
1200
|
| Readonly<{
|
|
1202
1201
|
type: 'metricCard';
|
|
1203
1202
|
key: string;
|
|
1204
|
-
changes:
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
| 'progress'
|
|
1218
|
-
>
|
|
1203
|
+
changes: PatchClearableChanges<
|
|
1204
|
+
MetricCardRow,
|
|
1205
|
+
| CommonPatchFields
|
|
1206
|
+
| 'variant'
|
|
1207
|
+
| 'title'
|
|
1208
|
+
| 'value'
|
|
1209
|
+
| 'subtitle'
|
|
1210
|
+
| 'trend'
|
|
1211
|
+
| 'trendTone'
|
|
1212
|
+
| 'visual'
|
|
1213
|
+
| 'badge'
|
|
1214
|
+
| 'metrics'
|
|
1215
|
+
| 'progress'
|
|
1219
1216
|
>;
|
|
1220
1217
|
}>
|
|
1221
1218
|
| Readonly<{
|
|
1222
1219
|
type: 'sectionHeader';
|
|
1223
1220
|
key: string;
|
|
1224
|
-
changes:
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
| 'checkbox'
|
|
1241
|
-
>
|
|
1221
|
+
changes: PatchClearableChanges<
|
|
1222
|
+
SectionHeaderRow,
|
|
1223
|
+
| CommonPatchFields
|
|
1224
|
+
| 'variant'
|
|
1225
|
+
| 'titleLoading'
|
|
1226
|
+
| 'title'
|
|
1227
|
+
| 'subtitle'
|
|
1228
|
+
| 'value'
|
|
1229
|
+
| 'valueHelp'
|
|
1230
|
+
| 'leadingBadge'
|
|
1231
|
+
| 'valueActionKey'
|
|
1232
|
+
| 'titleActionKey'
|
|
1233
|
+
| 'titleActionOnHover'
|
|
1234
|
+
| 'titleIcon'
|
|
1235
|
+
| 'valueIcon'
|
|
1236
|
+
| 'checkbox'
|
|
1242
1237
|
>;
|
|
1243
1238
|
}>
|
|
1244
1239
|
| Readonly<{
|
|
1245
1240
|
type: 'action';
|
|
1246
1241
|
key: string;
|
|
1247
|
-
changes:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
| CommonPatchFields
|
|
1251
|
-
| 'title'
|
|
1252
|
-
| 'tone'
|
|
1253
|
-
| 'icon'
|
|
1254
|
-
| 'checkbox'
|
|
1255
|
-
| 'trailing'
|
|
1256
|
-
>
|
|
1242
|
+
changes: PatchClearableChanges<
|
|
1243
|
+
ActionRow,
|
|
1244
|
+
CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'
|
|
1257
1245
|
>;
|
|
1258
1246
|
}>
|
|
1259
1247
|
| Readonly<{
|
|
1260
1248
|
type: 'buttonGroup';
|
|
1261
1249
|
key: string;
|
|
1262
|
-
changes:
|
|
1250
|
+
changes: PatchClearableChanges<
|
|
1251
|
+
ButtonGroupRow,
|
|
1252
|
+
CommonPatchFields | 'buttons'
|
|
1253
|
+
>;
|
|
1263
1254
|
}>
|
|
1264
1255
|
| Readonly<{
|
|
1265
1256
|
type: 'system';
|
|
1266
1257
|
key: string;
|
|
1267
1258
|
changes: Readonly<{
|
|
1268
|
-
revision?: number;
|
|
1269
|
-
disabled?: boolean;
|
|
1270
|
-
message?: string;
|
|
1259
|
+
revision?: number | null;
|
|
1260
|
+
disabled?: boolean | null;
|
|
1261
|
+
message?: string | null;
|
|
1271
1262
|
}>;
|
|
1272
1263
|
}>;
|
|
1273
1264
|
|