@onekeyfe/react-native-native-list 6.7.0-alpha.398 → 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/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: Partial<
1064
- Pick<
1065
- IdentityRow,
1066
- | CommonPatchFields
1067
- | 'title'
1068
- | 'titleSuffixes'
1069
- | 'titleIcon'
1070
- | 'secondaryTitleIcon'
1071
- | 'subtitle'
1072
- | 'subtitleLines'
1073
- | 'contentHeight'
1074
- | 'longPressActionKey'
1075
- | 'tertiary'
1076
- | 'tertiaryTone'
1077
- | 'badges'
1078
- | 'trailing'
1079
- | 'leading'
1080
- | 'leadingAction'
1081
- | 'titleMatch'
1082
- | 'titleActionKey'
1083
- | 'titleActionOnHover'
1084
- | 'subtitleSegments'
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: Partial<
1092
- Pick<
1093
- RailRow,
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: Partial<
1102
- Pick<
1103
- ActivityRow,
1104
- | CommonPatchFields
1105
- | 'title'
1106
- | 'description'
1107
- | 'status'
1108
- | 'amounts'
1109
- | 'badges'
1110
- | 'presentation'
1111
- | 'fee'
1112
- | 'descriptionActionKey'
1113
- | 'primaryAmount'
1114
- | 'secondaryAmount'
1115
- | 'leading'
1116
- | 'hideLeading'
1117
- | 'secondaryLeading'
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: Partial<
1126
- Pick<
1127
- MessageRow,
1128
- | CommonPatchFields
1129
- | 'unread'
1130
- | 'title'
1131
- | 'body'
1132
- | 'bodyLines'
1133
- | 'presentation'
1134
- | 'time'
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: Partial<
1143
- Pick<
1144
- DataRow,
1145
- | CommonPatchFields
1146
- | 'leading'
1147
- | 'columns'
1148
- | 'trailing'
1149
- | 'checkbox'
1150
- | 'index'
1151
- | 'badge'
1152
- | 'badges'
1153
- | 'favorite'
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: Partial<
1162
- Pick<
1163
- MarketRow,
1164
- | CommonPatchFields
1165
- | 'leadingAction'
1166
- | 'leading'
1167
- | 'title'
1168
- | 'subtitle'
1169
- | 'subtitleSegments'
1170
- | 'price'
1171
- | 'priceSegments'
1172
- | 'change'
1173
- | 'badges'
1174
- | 'pressActionKey'
1175
- | 'pressInActionKey'
1176
- | 'longPressActionKey'
1177
- | 'diagnostics'
1178
- | 'webTable'
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: Partial<
1187
- Pick<
1188
- MediaTileRow,
1189
- | CommonPatchFields
1190
- | 'image'
1191
- | 'imageState'
1192
- | 'media'
1193
- | 'networkImage'
1194
- | 'title'
1195
- | 'subtitle'
1196
- | 'badge'
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: Partial<
1205
- Pick<
1206
- MetricCardRow,
1207
- | CommonPatchFields
1208
- | 'variant'
1209
- | 'title'
1210
- | 'value'
1211
- | 'subtitle'
1212
- | 'trend'
1213
- | 'trendTone'
1214
- | 'visual'
1215
- | 'badge'
1216
- | 'metrics'
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: Partial<
1225
- Pick<
1226
- SectionHeaderRow,
1227
- | CommonPatchFields
1228
- | 'variant'
1229
- | 'titleLoading'
1230
- | 'title'
1231
- | 'subtitle'
1232
- | 'value'
1233
- | 'valueHelp'
1234
- | 'leadingBadge'
1235
- | 'valueActionKey'
1236
- | 'titleActionKey'
1237
- | 'titleActionOnHover'
1238
- | 'titleIcon'
1239
- | 'valueIcon'
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: Partial<
1248
- Pick<
1249
- ActionRow,
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: Partial<Pick<ButtonGroupRow, CommonPatchFields | 'buttons'>>;
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