@onekeyfe/react-native-native-list 3.0.114 → 3.0.115
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 +57 -3
- package/android/build.gradle +1 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListRowView.kt +543 -26
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +404 -90
- package/ios/NativeListCell.swift +506 -20
- package/ios/NativeListDesignAssets.swift +8 -0
- package/ios/RNCNativeListView.swift +271 -42
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +1 -0
- package/lib/module/validation.js +129 -1
- package/lib/module/web/NativeListWebEngine.js +461 -51
- package/lib/typescript/src/models.d.ts +82 -2
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +37 -3
- package/package.json +4 -2
- package/src/models.ts +121 -3
- package/src/validation.ts +206 -0
- package/src/web/NativeListWebEngine.ts +766 -91
|
@@ -28,6 +28,57 @@ export type BadgeModel = Readonly<{
|
|
|
28
28
|
text: string;
|
|
29
29
|
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
30
30
|
}>;
|
|
31
|
+
export type MarketTextStyle = Readonly<{
|
|
32
|
+
fontSize?: number;
|
|
33
|
+
fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
|
|
34
|
+
color?: string;
|
|
35
|
+
lineHeight?: number;
|
|
36
|
+
lines?: 1 | 2;
|
|
37
|
+
alignment?: 'start' | 'center' | 'end';
|
|
38
|
+
}>;
|
|
39
|
+
export type MarketImageStyle = Readonly<{
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
shape?: 'circle' | 'rounded' | 'square';
|
|
43
|
+
cornerRadius?: number;
|
|
44
|
+
contentFit?: ImageContentFit;
|
|
45
|
+
}>;
|
|
46
|
+
export type MarketRowStyle = Readonly<{
|
|
47
|
+
horizontalPadding?: number;
|
|
48
|
+
verticalPadding?: number;
|
|
49
|
+
leadingGap?: number;
|
|
50
|
+
/** Space between title and subtitle; 0 by default, bounded to 0..16. */
|
|
51
|
+
lineGap?: number;
|
|
52
|
+
titleBadgeGap?: number;
|
|
53
|
+
trailingGap?: number;
|
|
54
|
+
image?: MarketImageStyle;
|
|
55
|
+
title?: MarketTextStyle;
|
|
56
|
+
subtitle?: MarketTextStyle;
|
|
57
|
+
price?: MarketTextStyle;
|
|
58
|
+
change?: MarketTextStyle;
|
|
59
|
+
changeWidth?: number;
|
|
60
|
+
changeHeight?: number;
|
|
61
|
+
changeCornerRadius?: number;
|
|
62
|
+
}>;
|
|
63
|
+
export type MarketBadgeModel = Readonly<{
|
|
64
|
+
key: string;
|
|
65
|
+
text?: string;
|
|
66
|
+
/** Finite native glyph set; currently only the community verified mark. */
|
|
67
|
+
iconName?: 'verified';
|
|
68
|
+
icon?: ImageSource;
|
|
69
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
70
|
+
textColor?: string;
|
|
71
|
+
backgroundColor?: string;
|
|
72
|
+
actionKey?: string;
|
|
73
|
+
accessibilityLabel?: string;
|
|
74
|
+
}>;
|
|
75
|
+
export type MarketChangeModel = Readonly<{
|
|
76
|
+
text: string;
|
|
77
|
+
textSegments?: readonly ValueTextSegment[];
|
|
78
|
+
tone: 'positive' | 'negative' | 'neutral';
|
|
79
|
+
textColor?: string;
|
|
80
|
+
backgroundColor?: string;
|
|
81
|
+
}>;
|
|
31
82
|
export type SelectorTextSegment = Readonly<{
|
|
32
83
|
text: string;
|
|
33
84
|
textSegments?: readonly ValueTextSegment[];
|
|
@@ -261,6 +312,26 @@ export type DataRow = RowBase & Readonly<{
|
|
|
261
312
|
favorite?: boolean;
|
|
262
313
|
favoriteActive?: boolean;
|
|
263
314
|
}>;
|
|
315
|
+
/** Native Market quote row. All values are already localized/formatted strings. */
|
|
316
|
+
export type MarketRow = RowBase & Readonly<{
|
|
317
|
+
type: 'market';
|
|
318
|
+
variant: 'token' | 'stock' | 'perp';
|
|
319
|
+
leading: LeadingVisual;
|
|
320
|
+
title: string;
|
|
321
|
+
subtitle?: string;
|
|
322
|
+
subtitleSegments?: readonly ValueTextSegment[];
|
|
323
|
+
price: string;
|
|
324
|
+
priceSegments?: readonly ValueTextSegment[];
|
|
325
|
+
change: MarketChangeModel;
|
|
326
|
+
badges?: readonly MarketBadgeModel[];
|
|
327
|
+
pressActionKey?: string;
|
|
328
|
+
pressInActionKey?: string;
|
|
329
|
+
longPressActionKey?: string;
|
|
330
|
+
diagnostics?: Readonly<{
|
|
331
|
+
imageBindActionKey?: string;
|
|
332
|
+
}>;
|
|
333
|
+
style?: MarketRowStyle;
|
|
334
|
+
}>;
|
|
264
335
|
export type MediaTileRow = RowBase & Readonly<{
|
|
265
336
|
type: 'mediaTile';
|
|
266
337
|
variant: 'gallery' | 'browserPreview';
|
|
@@ -335,10 +406,13 @@ export type ActionRow = RowBase & Readonly<{
|
|
|
335
406
|
export type SystemRow = RowBase & (Readonly<{
|
|
336
407
|
type: 'system';
|
|
337
408
|
variant: 'loading';
|
|
409
|
+
presentation?: 'market';
|
|
410
|
+
loadingStyle?: 'skeleton' | 'spinner';
|
|
338
411
|
message?: string;
|
|
339
412
|
}> | Readonly<{
|
|
340
413
|
type: 'system';
|
|
341
414
|
variant: 'retry';
|
|
415
|
+
presentation?: 'market';
|
|
342
416
|
message: string;
|
|
343
417
|
actionKey: string;
|
|
344
418
|
}> | Readonly<{
|
|
@@ -350,17 +424,19 @@ export type SystemRow = RowBase & (Readonly<{
|
|
|
350
424
|
}> | Readonly<{
|
|
351
425
|
type: 'system';
|
|
352
426
|
variant: 'noMatch';
|
|
427
|
+
presentation?: 'market';
|
|
353
428
|
message: string;
|
|
354
429
|
}> | Readonly<{
|
|
355
430
|
type: 'system';
|
|
356
431
|
variant: 'end';
|
|
432
|
+
presentation?: 'market';
|
|
357
433
|
message?: string;
|
|
358
434
|
}> | Readonly<{
|
|
359
435
|
type: 'system';
|
|
360
436
|
variant: 'spacer';
|
|
361
437
|
height: number;
|
|
362
438
|
}>);
|
|
363
|
-
export type RowModel = IdentityRow | WalletGroupRow | RailRow | ActivityRow | MessageRow | DataRow | MediaTileRow | MetricCardRow | SectionHeaderRow | ActionRow | SystemRow;
|
|
439
|
+
export type RowModel = IdentityRow | WalletGroupRow | RailRow | ActivityRow | MessageRow | DataRow | MarketRow | MediaTileRow | MetricCardRow | SectionHeaderRow | ActionRow | SystemRow;
|
|
364
440
|
export type NativeListTheme = Readonly<{
|
|
365
441
|
checkboxBackground?: string;
|
|
366
442
|
checkboxBorder?: string;
|
|
@@ -445,6 +521,10 @@ export type RowPatch = Readonly<{
|
|
|
445
521
|
type: 'dataRow';
|
|
446
522
|
key: string;
|
|
447
523
|
changes: Partial<Pick<DataRow, CommonPatchFields | 'leading' | 'columns' | 'checkbox' | 'index' | 'badge' | 'badges' | 'favorite' | 'favoriteActive'>>;
|
|
524
|
+
}> | Readonly<{
|
|
525
|
+
type: 'market';
|
|
526
|
+
key: string;
|
|
527
|
+
changes: Partial<Pick<MarketRow, CommonPatchFields | 'leading' | 'title' | 'subtitle' | 'subtitleSegments' | 'price' | 'priceSegments' | 'change' | 'badges' | 'pressActionKey' | 'pressInActionKey' | 'longPressActionKey' | 'diagnostics' | 'style'>>;
|
|
448
528
|
}> | Readonly<{
|
|
449
529
|
type: 'mediaTile';
|
|
450
530
|
key: string;
|
|
@@ -470,7 +550,7 @@ export type RowPatch = Readonly<{
|
|
|
470
550
|
message?: string;
|
|
471
551
|
}>;
|
|
472
552
|
}>;
|
|
473
|
-
export type NativeListActionSource = 'row' | 'leadingAction' | 'trailingAccessory' | 'footerAction' | 'mediaClose';
|
|
553
|
+
export type NativeListActionSource = 'row' | 'marketBadge' | 'leadingAction' | 'trailingAccessory' | 'footerAction' | 'mediaClose';
|
|
474
554
|
export type NativeListWindowRect = Readonly<{
|
|
475
555
|
x: number;
|
|
476
556
|
y: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionAnchorInvalidatedEvent, NativeListSnapshot, NativeListActionAnchor, NativeListActionSource, ReorderEvent, RowActionEvent, RowModel, RowPatch, SelectionDeltaEvent, VisibleRangeChangedEvent } from '../models';
|
|
1
|
+
import type { ActionAnchorInvalidatedEvent, MarketRow, NativeListSnapshot, NativeListActionAnchor, NativeListActionSource, ReorderEvent, RowActionEvent, RowModel, RowPatch, SelectionDeltaEvent, VisibleRangeChangedEvent } from '../models';
|
|
2
2
|
import type { ActionAnchorState, ScrollToIndexFailedInfo, ScrollToLocationParams } from '../NativeList.types';
|
|
3
3
|
import { type NormalizedPositionScroll } from '../scrolling';
|
|
4
4
|
export declare const WEB_REORDER_ANIMATION: {
|
|
@@ -7,6 +7,7 @@ export declare const WEB_REORDER_ANIMATION: {
|
|
|
7
7
|
readonly dropDurationMs: 80;
|
|
8
8
|
readonly dropTimingFunction: "ease";
|
|
9
9
|
};
|
|
10
|
+
export declare const WEB_MARKET_VERIFIED_PATH = "M9.483 11.458v3.5h-1v-3.5z M10.467 2.698a2.03 2.03 0 0 1 3.065 0l1.358 1.564a.03.03 0 0 0 .028.01l2.046-.325a2.03 2.03 0 0 1 2.347 1.971l.037 2.07q0 .016.014.026l1.776 1.066a2.03 2.03 0 0 1 .532 3.019l-1.304 1.609a.03.03 0 0 0-.005.03l.675 1.956a2.03 2.03 0 0 1-1.533 2.656l-2.033.394a.03.03 0 0 0-.023.019l-.741 1.933a2.03 2.03 0 0 1-2.88 1.05l-1.811-1.006a.03.03 0 0 0-.03 0l-1.811 1.005a2.03 2.03 0 0 1-2.88-1.049l-.742-1.933a.03.03 0 0 0-.023-.019l-2.033-.394a2.03 2.03 0 0 1-1.532-2.656l.675-1.957a.03.03 0 0 0-.005-.029l-1.304-1.61a2.03 2.03 0 0 1 .532-3.018l1.776-1.066a.03.03 0 0 0 .014-.026l.035-2.07a2.03 2.03 0 0 1 2.349-1.97l2.045.324a.03.03 0 0 0 .028-.01zm1.516 3.76a.5.5 0 0 0-.447.276l-1.861 3.724H8.483a1 1 0 0 0-1 1v3.5a1 1 0 0 0 1 1h6.692a2 2 0 0 0 1.981-1.73l.341-2.5a2 2 0 0 0-1.982-2.27h-1.939l.197-1.269a1.5 1.5 0 0 0-1.481-1.731z";
|
|
10
11
|
export type WebLayoutItem = Readonly<{
|
|
11
12
|
index: number;
|
|
12
13
|
key: string;
|
|
@@ -21,6 +22,21 @@ export type WebListLayout = Readonly<{
|
|
|
21
22
|
contentHeight: number;
|
|
22
23
|
horizontal: boolean;
|
|
23
24
|
}>;
|
|
25
|
+
export type WebMarketLayoutStyle = Readonly<{
|
|
26
|
+
horizontalPadding: number;
|
|
27
|
+
verticalPadding: number;
|
|
28
|
+
leadingGap: number;
|
|
29
|
+
titleBadgeGap: number;
|
|
30
|
+
trailingGap: number;
|
|
31
|
+
imageWidth: number;
|
|
32
|
+
imageHeight: number;
|
|
33
|
+
imageCornerRadius: number;
|
|
34
|
+
changeWidth: number;
|
|
35
|
+
changeHeight: number;
|
|
36
|
+
changeCornerRadius: number;
|
|
37
|
+
}>;
|
|
38
|
+
/** Resolves every reusable Market geometry field, including legacy defaults. */
|
|
39
|
+
export declare function resolveWebMarketLayoutStyle(row: MarketRow): WebMarketLayoutStyle;
|
|
24
40
|
export type NativeListWebCallbacks = Readonly<{
|
|
25
41
|
onRowAction?: (event: RowActionEvent) => void;
|
|
26
42
|
onActionAnchorInvalidated?: (event: ActionAnchorInvalidatedEvent) => void;
|
|
@@ -50,8 +66,17 @@ export declare function estimateWebRowHeight(row: RowModel, snapshot: NativeList
|
|
|
50
66
|
export declare function computeWebListLayout(snapshot: NativeListSnapshot, viewportWidth: number, viewportHeight: number, compactRowKey?: string): WebListLayout;
|
|
51
67
|
export declare function webWalletGroupReorderBadge(row: RowModel): string | undefined;
|
|
52
68
|
export declare function visibleWebLayoutItems(layout: WebListLayout, offset: number, viewportLength: number, overscan?: number): readonly WebLayoutItem[];
|
|
69
|
+
export type WebCollapsiblePagerScrollMetrics = Readonly<{
|
|
70
|
+
offset: number;
|
|
71
|
+
viewportLength: number;
|
|
72
|
+
}>;
|
|
73
|
+
export declare function resolveWebCollapsiblePagerScrollMetrics(rawOffset: number, rawViewportLength: number, headerInset: number, stickyInset: number): WebCollapsiblePagerScrollMetrics;
|
|
74
|
+
export declare function resolveWebCollapsiblePagerRawOffset(logicalOffset: number, headerInset: number): number;
|
|
53
75
|
export declare function webLayoutItemsForMount(layout: WebListLayout, offset: number, viewportLength: number, virtualizationEnabled: boolean, overscan?: number): readonly WebLayoutItem[];
|
|
54
76
|
export declare function webRowRenderSignature(row: RowModel): string;
|
|
77
|
+
export declare function isWebMarketQuotePatch(patch: RowPatch): boolean;
|
|
78
|
+
/** Number of Market image-binding passes caused by one Web patch transaction. */
|
|
79
|
+
export declare function webMarketImageBindDeltaForPatches(patches: readonly RowPatch[]): 0 | 1;
|
|
55
80
|
export declare const WEB_LIST_CSS: string;
|
|
56
81
|
export declare class NativeListWebEngine {
|
|
57
82
|
private readonly document;
|
|
@@ -62,7 +87,6 @@ export declare class NativeListWebEngine {
|
|
|
62
87
|
private readonly footer;
|
|
63
88
|
private readonly sticky;
|
|
64
89
|
private readonly indexRail;
|
|
65
|
-
private readonly indexPreview;
|
|
66
90
|
private readonly refreshIndicator;
|
|
67
91
|
private readonly reorderPreview;
|
|
68
92
|
private readonly previousHostPosition;
|
|
@@ -82,7 +106,6 @@ export declare class NativeListWebEngine {
|
|
|
82
106
|
private avatarDirection;
|
|
83
107
|
private reachedGeneration;
|
|
84
108
|
private stickyKey;
|
|
85
|
-
private previewTimer;
|
|
86
109
|
private sectionIndexEntries;
|
|
87
110
|
private pointerReorder;
|
|
88
111
|
private keyboardReorder;
|
|
@@ -101,6 +124,8 @@ export declare class NativeListWebEngine {
|
|
|
101
124
|
private readonly actionAnchorInstanceId;
|
|
102
125
|
private actionAnchorCounter;
|
|
103
126
|
private bindingEpochCounter;
|
|
127
|
+
private marketPointer;
|
|
128
|
+
private marketLongPressFired;
|
|
104
129
|
private lastViewportWidth;
|
|
105
130
|
private lastViewportHeight;
|
|
106
131
|
private destroyed;
|
|
@@ -128,6 +153,7 @@ export declare class NativeListWebEngine {
|
|
|
128
153
|
private renderElement;
|
|
129
154
|
private renderFooter;
|
|
130
155
|
private sectionIndexVisibleEntryIndices;
|
|
156
|
+
private sectionIndexMetrics;
|
|
131
157
|
private renderSectionIndex;
|
|
132
158
|
private updateVisibleSelection;
|
|
133
159
|
private updateVisibleState;
|
|
@@ -139,6 +165,9 @@ export declare class NativeListWebEngine {
|
|
|
139
165
|
private viewportLength;
|
|
140
166
|
private contentLength;
|
|
141
167
|
private currentOffset;
|
|
168
|
+
private collapsiblePagerInsets;
|
|
169
|
+
private verticalScrollMetrics;
|
|
170
|
+
private handleCollapsiblePagerInsetsChanged;
|
|
142
171
|
private scrollToAbsoluteOffset;
|
|
143
172
|
private performPendingScroll;
|
|
144
173
|
private rowAtElement;
|
|
@@ -152,6 +181,10 @@ export declare class NativeListWebEngine {
|
|
|
152
181
|
private invalidateActionAnchor;
|
|
153
182
|
private emitActionAnchorInvalidated;
|
|
154
183
|
private handleRowPress;
|
|
184
|
+
private cancelMarketPointer;
|
|
185
|
+
private handleMarketPointerDown;
|
|
186
|
+
private handleMarketPointerMove;
|
|
187
|
+
private handleMarketPointerEnd;
|
|
155
188
|
private handleTitlePointerOver;
|
|
156
189
|
private handleTitlePointerOut;
|
|
157
190
|
private handleClick;
|
|
@@ -168,6 +201,7 @@ export declare class NativeListWebEngine {
|
|
|
168
201
|
private selectIndexPosition;
|
|
169
202
|
private sectionIndexEntryAtEvent;
|
|
170
203
|
private handleIndexPointer;
|
|
204
|
+
private handleIndexPointerEnd;
|
|
171
205
|
private handleIndexClick;
|
|
172
206
|
private handlePullStart;
|
|
173
207
|
private handlePullMove;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-native-list",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.115",
|
|
4
4
|
"description": "Template-driven native RecyclerView and UICollectionView for React Native",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"eslint-config-prettier": "^10.1.8",
|
|
74
74
|
"eslint-plugin-prettier": "^5.5.4",
|
|
75
75
|
"jest": "^29.7.0",
|
|
76
|
+
"jsdom": "26.1.0",
|
|
76
77
|
"nitrogen": "0.37.0",
|
|
77
78
|
"prettier": "^2.8.8",
|
|
78
79
|
"react": "19.2.3",
|
|
@@ -82,7 +83,8 @@
|
|
|
82
83
|
"typescript": "^5.9.2"
|
|
83
84
|
},
|
|
84
85
|
"peerDependencies": {
|
|
85
|
-
"@onekeyfe/react-native-image": "3.0.
|
|
86
|
+
"@onekeyfe/react-native-image": "3.0.115",
|
|
87
|
+
"@onekeyfe/react-native-native-logger": "3.0.115",
|
|
86
88
|
"react": "*",
|
|
87
89
|
"react-native": "*",
|
|
88
90
|
"react-native-nitro-modules": "0.37.0"
|
package/src/models.ts
CHANGED
|
@@ -33,6 +33,62 @@ export type BadgeModel = Readonly<{
|
|
|
33
33
|
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
34
34
|
}>;
|
|
35
35
|
|
|
36
|
+
export type MarketTextStyle = Readonly<{
|
|
37
|
+
fontSize?: number;
|
|
38
|
+
fontWeight?: 'regular' | 'medium' | 'semibold' | 'bold';
|
|
39
|
+
color?: string;
|
|
40
|
+
lineHeight?: number;
|
|
41
|
+
lines?: 1 | 2;
|
|
42
|
+
alignment?: 'start' | 'center' | 'end';
|
|
43
|
+
}>;
|
|
44
|
+
|
|
45
|
+
export type MarketImageStyle = Readonly<{
|
|
46
|
+
width?: number;
|
|
47
|
+
height?: number;
|
|
48
|
+
shape?: 'circle' | 'rounded' | 'square';
|
|
49
|
+
cornerRadius?: number;
|
|
50
|
+
contentFit?: ImageContentFit;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
export type MarketRowStyle = Readonly<{
|
|
54
|
+
horizontalPadding?: number;
|
|
55
|
+
verticalPadding?: number;
|
|
56
|
+
leadingGap?: number;
|
|
57
|
+
/** Space between title and subtitle; 0 by default, bounded to 0..16. */
|
|
58
|
+
lineGap?: number;
|
|
59
|
+
titleBadgeGap?: number;
|
|
60
|
+
trailingGap?: number;
|
|
61
|
+
image?: MarketImageStyle;
|
|
62
|
+
title?: MarketTextStyle;
|
|
63
|
+
subtitle?: MarketTextStyle;
|
|
64
|
+
price?: MarketTextStyle;
|
|
65
|
+
change?: MarketTextStyle;
|
|
66
|
+
changeWidth?: number;
|
|
67
|
+
changeHeight?: number;
|
|
68
|
+
changeCornerRadius?: number;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
export type MarketBadgeModel = Readonly<{
|
|
72
|
+
key: string;
|
|
73
|
+
text?: string;
|
|
74
|
+
/** Finite native glyph set; currently only the community verified mark. */
|
|
75
|
+
iconName?: 'verified';
|
|
76
|
+
icon?: ImageSource;
|
|
77
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
78
|
+
textColor?: string;
|
|
79
|
+
backgroundColor?: string;
|
|
80
|
+
actionKey?: string;
|
|
81
|
+
accessibilityLabel?: string;
|
|
82
|
+
}>;
|
|
83
|
+
|
|
84
|
+
export type MarketChangeModel = Readonly<{
|
|
85
|
+
text: string;
|
|
86
|
+
textSegments?: readonly ValueTextSegment[];
|
|
87
|
+
tone: 'positive' | 'negative' | 'neutral';
|
|
88
|
+
textColor?: string;
|
|
89
|
+
backgroundColor?: string;
|
|
90
|
+
}>;
|
|
91
|
+
|
|
36
92
|
// OneKey patch: keep selector decoration and text data serializable.
|
|
37
93
|
export type SelectorTextSegment = Readonly<{
|
|
38
94
|
text: string;
|
|
@@ -272,6 +328,26 @@ export type DataRow = RowBase &
|
|
|
272
328
|
favoriteActive?: boolean;
|
|
273
329
|
}>;
|
|
274
330
|
|
|
331
|
+
/** Native Market quote row. All values are already localized/formatted strings. */
|
|
332
|
+
export type MarketRow = RowBase &
|
|
333
|
+
Readonly<{
|
|
334
|
+
type: 'market';
|
|
335
|
+
variant: 'token' | 'stock' | 'perp';
|
|
336
|
+
leading: LeadingVisual;
|
|
337
|
+
title: string;
|
|
338
|
+
subtitle?: string;
|
|
339
|
+
subtitleSegments?: readonly ValueTextSegment[];
|
|
340
|
+
price: string;
|
|
341
|
+
priceSegments?: readonly ValueTextSegment[];
|
|
342
|
+
change: MarketChangeModel;
|
|
343
|
+
badges?: readonly MarketBadgeModel[];
|
|
344
|
+
pressActionKey?: string;
|
|
345
|
+
pressInActionKey?: string;
|
|
346
|
+
longPressActionKey?: string;
|
|
347
|
+
diagnostics?: Readonly<{ imageBindActionKey?: string }>;
|
|
348
|
+
style?: MarketRowStyle;
|
|
349
|
+
}>;
|
|
350
|
+
|
|
275
351
|
export type MediaTileRow = RowBase &
|
|
276
352
|
Readonly<{
|
|
277
353
|
type: 'mediaTile';
|
|
@@ -345,10 +421,17 @@ export type ActionRow = RowBase &
|
|
|
345
421
|
|
|
346
422
|
export type SystemRow = RowBase &
|
|
347
423
|
(
|
|
348
|
-
| Readonly<{
|
|
424
|
+
| Readonly<{
|
|
425
|
+
type: 'system';
|
|
426
|
+
variant: 'loading';
|
|
427
|
+
presentation?: 'market';
|
|
428
|
+
loadingStyle?: 'skeleton' | 'spinner';
|
|
429
|
+
message?: string;
|
|
430
|
+
}>
|
|
349
431
|
| Readonly<{
|
|
350
432
|
type: 'system';
|
|
351
433
|
variant: 'retry';
|
|
434
|
+
presentation?: 'market';
|
|
352
435
|
message: string;
|
|
353
436
|
actionKey: string;
|
|
354
437
|
}>
|
|
@@ -359,8 +442,18 @@ export type SystemRow = RowBase &
|
|
|
359
442
|
message: string;
|
|
360
443
|
borderColor?: string;
|
|
361
444
|
}>
|
|
362
|
-
| Readonly<{
|
|
363
|
-
|
|
445
|
+
| Readonly<{
|
|
446
|
+
type: 'system';
|
|
447
|
+
variant: 'noMatch';
|
|
448
|
+
presentation?: 'market';
|
|
449
|
+
message: string;
|
|
450
|
+
}>
|
|
451
|
+
| Readonly<{
|
|
452
|
+
type: 'system';
|
|
453
|
+
variant: 'end';
|
|
454
|
+
presentation?: 'market';
|
|
455
|
+
message?: string;
|
|
456
|
+
}>
|
|
364
457
|
| Readonly<{ type: 'system'; variant: 'spacer'; height: number }>
|
|
365
458
|
);
|
|
366
459
|
|
|
@@ -371,6 +464,7 @@ export type RowModel =
|
|
|
371
464
|
| ActivityRow
|
|
372
465
|
| MessageRow
|
|
373
466
|
| DataRow
|
|
467
|
+
| MarketRow
|
|
374
468
|
| MediaTileRow
|
|
375
469
|
| MetricCardRow
|
|
376
470
|
| SectionHeaderRow
|
|
@@ -545,6 +639,29 @@ export type RowPatch =
|
|
|
545
639
|
>
|
|
546
640
|
>;
|
|
547
641
|
}>
|
|
642
|
+
| Readonly<{
|
|
643
|
+
type: 'market';
|
|
644
|
+
key: string;
|
|
645
|
+
changes: Partial<
|
|
646
|
+
Pick<
|
|
647
|
+
MarketRow,
|
|
648
|
+
| CommonPatchFields
|
|
649
|
+
| 'leading'
|
|
650
|
+
| 'title'
|
|
651
|
+
| 'subtitle'
|
|
652
|
+
| 'subtitleSegments'
|
|
653
|
+
| 'price'
|
|
654
|
+
| 'priceSegments'
|
|
655
|
+
| 'change'
|
|
656
|
+
| 'badges'
|
|
657
|
+
| 'pressActionKey'
|
|
658
|
+
| 'pressInActionKey'
|
|
659
|
+
| 'longPressActionKey'
|
|
660
|
+
| 'diagnostics'
|
|
661
|
+
| 'style'
|
|
662
|
+
>
|
|
663
|
+
>;
|
|
664
|
+
}>
|
|
548
665
|
| Readonly<{
|
|
549
666
|
type: 'mediaTile';
|
|
550
667
|
key: string;
|
|
@@ -629,6 +746,7 @@ export type RowPatch =
|
|
|
629
746
|
|
|
630
747
|
export type NativeListActionSource =
|
|
631
748
|
| 'row'
|
|
749
|
+
| 'marketBadge'
|
|
632
750
|
| 'leadingAction'
|
|
633
751
|
| 'trailingAccessory'
|
|
634
752
|
| 'footerAction'
|