@onekeyfe/react-native-native-list 6.7.0-2 → 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/HybridNativeList.kt +14 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +245 -9
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +147 -33
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +51 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1953 -117
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -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/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
- package/docs/ROW_TEMPLATES.md +70 -11
- package/docs/SPEC.md +1235 -20
- package/docs/STYLE_SPEC.md +6 -0
- package/ios/HybridNativeList.swift +21 -2
- package/ios/NativeListAccessoryStack.swift +235 -39
- package/ios/NativeListActivityDetailsView.swift +30 -11
- package/ios/NativeListActivityRenderer.swift +8 -2
- package/ios/NativeListButtonGroupRenderer.swift +89 -0
- package/ios/NativeListDataRowRenderer.swift +155 -27
- package/ios/NativeListDesignAssets.swift +9 -0
- package/ios/NativeListIdentityRenderer.swift +239 -31
- package/ios/NativeListLeadingVisual.swift +119 -22
- package/ios/NativeListMarketRenderer.swift +113 -18
- package/ios/NativeListMessageRenderer.swift +34 -1
- package/ios/NativeListModels.swift +42 -2
- package/ios/NativeListRendererRegistry.swift +1 -0
- package/ios/NativeListResolvedText.swift +2 -1
- package/ios/NativeListRowHost.swift +14 -0
- package/ios/NativeListSectionHeaderRenderer.swift +88 -0
- package/ios/RNCNativeListView.swift +1052 -58
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/icon.svg +4 -0
- 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_gas_solid.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/icon.svg +3 -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_refresh_ccw_outline.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/icon.svg +3 -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/NativeListAccessoryStackTests.swift +89 -0
- package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
- package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
- package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
- package/ios/tests/NativeListLifecycleTests.swift +2789 -3
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/lib/module/NativeList.js +223 -36
- package/lib/module/NativeList.web.js +260 -33
- package/lib/module/index.js +1 -1
- package/lib/module/models.js +3 -0
- package/lib/module/selection.js +1 -1
- package/lib/module/validation.js +1386 -81
- package/lib/module/web/NativeListWebEngine.js +914 -80
- package/lib/module/web/templates/ActivityRowRenderer.js +487 -7
- package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
- package/lib/module/web/templates/DataRowRenderer.js +40 -5
- package/lib/module/web/templates/IdentityRowRenderer.js +145 -5
- package/lib/module/web/templates/MarketRowRenderer.js +8 -3
- package/lib/module/web/templates/MarketTableRowRenderer.js +577 -0
- package/lib/module/web/templates/MediaTileRowRenderer.js +260 -5
- package/lib/module/web/templates/MessageRowRenderer.js +18 -2
- package/lib/module/web/templates/RowContainerStyle.js +1 -0
- package/lib/module/web/templates/RowRendererRegistry.js +8 -3
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +70 -3
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/lib/typescript/src/NativeList.d.ts +3 -3
- package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
- package/lib/typescript/src/NativeList.types.d.ts +29 -1
- package/lib/typescript/src/NativeList.web.d.ts +2 -2
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/models.d.ts +196 -17
- package/lib/typescript/src/validation.d.ts +20 -0
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +58 -1
- package/lib/typescript/src/web/templates/ActivityRowRenderer.d.ts +3 -3
- package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
- package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
- package/lib/typescript/src/web/templates/MarketTableRowRenderer.d.ts +17 -0
- package/lib/typescript/src/web/templates/MediaTileRowRenderer.d.ts +3 -3
- package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +10 -4
- package/lib/typescript/src/web/templates/RowRendererRegistry.d.ts +3 -1
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/package.json +3 -3
- package/react-native-native-list.podspec +1 -0
- package/src/NativeList.nitro.ts +2 -0
- package/src/NativeList.tsx +418 -89
- package/src/NativeList.types.ts +34 -1
- package/src/NativeList.web.tsx +417 -66
- package/src/index.ts +2 -0
- package/src/models.ts +355 -143
- package/src/selection.ts +1 -0
- package/src/validation.ts +3315 -166
- package/src/web/NativeListWebEngine.ts +1473 -113
- package/src/web/templates/ActivityRowRenderer.ts +732 -8
- package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
- package/src/web/templates/DataRowRenderer.ts +93 -20
- package/src/web/templates/IdentityRowRenderer.ts +217 -6
- package/src/web/templates/MarketRowRenderer.ts +19 -3
- package/src/web/templates/MarketTableRowRenderer.ts +755 -0
- package/src/web/templates/MediaTileRowRenderer.ts +313 -5
- package/src/web/templates/MessageRowRenderer.ts +23 -7
- package/src/web/templates/RowContainerStyle.ts +2 -0
- package/src/web/templates/RowRendererRegistry.ts +21 -6
- package/src/web/templates/SectionHeaderRowRenderer.ts +89 -5
package/src/models.ts
CHANGED
|
@@ -25,6 +25,8 @@ export type ImageSource = Readonly<{
|
|
|
25
25
|
loadingStrategy?: ImageLoadingStrategy;
|
|
26
26
|
// OneKey patch: fallbackUri is Web-only; retryTimes opts all platforms into terminal retries.
|
|
27
27
|
fallbackUri?: string;
|
|
28
|
+
/** Web-only ordered continuation; retries each source before advancing. */
|
|
29
|
+
fallbackUris?: readonly string[];
|
|
28
30
|
retryTimes?: number;
|
|
29
31
|
}>;
|
|
30
32
|
|
|
@@ -183,6 +185,7 @@ export const ROW_BOX_STYLE_KEYS_BY_TYPE = {
|
|
|
183
185
|
'trailingGap',
|
|
184
186
|
'image',
|
|
185
187
|
],
|
|
188
|
+
buttonGroup: [],
|
|
186
189
|
system: ['horizontalPadding', 'verticalPadding', 'lineGap'],
|
|
187
190
|
} as const;
|
|
188
191
|
|
|
@@ -199,6 +202,7 @@ type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<
|
|
|
199
202
|
*/
|
|
200
203
|
export type IdentityRowStyle = TemplateBoxStyle<'identity'> &
|
|
201
204
|
Readonly<{
|
|
205
|
+
leadingContentMaxWidthRatio?: number;
|
|
202
206
|
title?: NativeListTextStyle;
|
|
203
207
|
subtitle?: NativeListTextStyle;
|
|
204
208
|
tertiary?: NativeListTextStyle;
|
|
@@ -277,8 +281,16 @@ export type SectionHeaderRowStyle = TemplateBoxStyle<'sectionHeader'> &
|
|
|
277
281
|
title?: NativeListTextStyle;
|
|
278
282
|
subtitle?: NativeListTextStyle;
|
|
279
283
|
value?: NativeListTextStyle;
|
|
284
|
+
valuePlacement?: 'afterTitle';
|
|
285
|
+
titleDecoration?: 'none' | 'dashed';
|
|
280
286
|
}>;
|
|
281
287
|
|
|
288
|
+
export type RowTextHelp = Readonly<{
|
|
289
|
+
actionKey: string;
|
|
290
|
+
presentation: 'tooltip' | 'popover';
|
|
291
|
+
underline?: 'dashed';
|
|
292
|
+
}>;
|
|
293
|
+
|
|
282
294
|
export type ActionRowStyle = TemplateBoxStyle<'action'> &
|
|
283
295
|
Readonly<{
|
|
284
296
|
title?: NativeListTextStyle;
|
|
@@ -342,19 +354,27 @@ export type VisualOverlay = Readonly<{
|
|
|
342
354
|
offsetX?: number;
|
|
343
355
|
offsetY?: number;
|
|
344
356
|
image?: ImageSource;
|
|
357
|
+
fallbackIcon?: Readonly<{ name: string; tintColor?: string }>;
|
|
345
358
|
name?: string;
|
|
346
359
|
text?: string;
|
|
360
|
+
fontWeight?: NativeListTextStyle['fontWeight'];
|
|
347
361
|
tintColor?: string;
|
|
348
362
|
backgroundColor?: string;
|
|
349
363
|
}>;
|
|
350
364
|
|
|
351
365
|
type VisualWithImage = Readonly<{
|
|
352
|
-
fallbackIcon?: Readonly<{
|
|
366
|
+
fallbackIcon?: Readonly<{
|
|
367
|
+
name: string;
|
|
368
|
+
tintColor?: string;
|
|
369
|
+
size?: number;
|
|
370
|
+
backgroundColor?: string;
|
|
371
|
+
}>;
|
|
353
372
|
overlays?: readonly VisualOverlay[];
|
|
354
373
|
borderStyle?: 'dashed';
|
|
355
374
|
borderColor?: string;
|
|
356
375
|
image?: ImageSource;
|
|
357
376
|
fallbackText?: string;
|
|
377
|
+
fallbackTextColor?: string;
|
|
358
378
|
backgroundColor?: string;
|
|
359
379
|
shape?: 'circle' | 'rounded' | 'square';
|
|
360
380
|
cornerIcon?: Readonly<{
|
|
@@ -406,9 +426,26 @@ export type TrailingAccessory =
|
|
|
406
426
|
kind: 'valuePair';
|
|
407
427
|
primary: string;
|
|
408
428
|
secondary: string;
|
|
429
|
+
primaryFontWeight?: 'medium';
|
|
430
|
+
primaryHelp?: RowTextHelp;
|
|
431
|
+
primaryTextSegments?: readonly ValueTextSegment[];
|
|
432
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
409
433
|
primaryTone?: TextTone;
|
|
410
434
|
secondaryTone?: TextTone;
|
|
411
435
|
}>
|
|
436
|
+
| Readonly<{
|
|
437
|
+
kind: 'button';
|
|
438
|
+
label: string;
|
|
439
|
+
actionKey: string;
|
|
440
|
+
disabled?: boolean;
|
|
441
|
+
testID?: string;
|
|
442
|
+
accessibilityLabel?: string;
|
|
443
|
+
textColor?: string;
|
|
444
|
+
backgroundColor?: string;
|
|
445
|
+
pressedBackgroundColor?: string;
|
|
446
|
+
hoverBackgroundColor?: string;
|
|
447
|
+
focusRingColor?: string;
|
|
448
|
+
}>
|
|
412
449
|
| Readonly<{
|
|
413
450
|
kind: 'checkbox';
|
|
414
451
|
state: CheckboxState;
|
|
@@ -436,6 +473,7 @@ export type TrailingAccessory =
|
|
|
436
473
|
kind: 'icon';
|
|
437
474
|
name: string;
|
|
438
475
|
tintColor?: string;
|
|
476
|
+
buttonStyle?: 'tertiary';
|
|
439
477
|
disabled?: boolean;
|
|
440
478
|
actionKey?: string;
|
|
441
479
|
testID?: string;
|
|
@@ -478,6 +516,10 @@ export type RowBase = Readonly<{
|
|
|
478
516
|
export type IdentityRow = RowBase &
|
|
479
517
|
Readonly<{
|
|
480
518
|
type: 'identity';
|
|
519
|
+
/** Opt in to content-based height; explicit row/container height still wins. */
|
|
520
|
+
contentHeight?: 'auto';
|
|
521
|
+
/** Emits a row action instead of a press after a successful long press. */
|
|
522
|
+
longPressActionKey?: string;
|
|
481
523
|
// OneKey patch: UTF-16 ranges match Fuse indices and native attributed strings.
|
|
482
524
|
titleMatch?: readonly Readonly<{ start: number; end: number }>[];
|
|
483
525
|
titleActionKey?: string;
|
|
@@ -487,11 +529,34 @@ export type IdentityRow = RowBase &
|
|
|
487
529
|
leading: LeadingVisual;
|
|
488
530
|
leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
489
531
|
title: string;
|
|
532
|
+
/** Plain 12/16 labels beside the title, preserving independent tones. */
|
|
533
|
+
titleSuffixes?: readonly Readonly<{
|
|
534
|
+
text: string;
|
|
535
|
+
tone: 'secondary' | 'disabled';
|
|
536
|
+
maxWidth?: number;
|
|
537
|
+
}>[];
|
|
538
|
+
titleIcon?: Readonly<{
|
|
539
|
+
name: string;
|
|
540
|
+
tintColor?: string;
|
|
541
|
+
accessibilityLabel?: string;
|
|
542
|
+
/** Web-only anchored help from this icon; does not add a click action. */
|
|
543
|
+
hoverActionKey?: string;
|
|
544
|
+
}>;
|
|
545
|
+
/** Web-only additional help icon after titleIcon. */
|
|
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
|
+
}>;
|
|
490
554
|
subtitle?: string;
|
|
491
555
|
tertiary?: string;
|
|
492
556
|
tertiaryTone?: 'secondary' | 'info';
|
|
493
557
|
titleLines?: 1 | 2;
|
|
494
|
-
|
|
558
|
+
/** Zero displays the complete subtitle. */
|
|
559
|
+
subtitleLines?: 0 | 1 | 2;
|
|
495
560
|
badges?: readonly BadgeModel[];
|
|
496
561
|
trailing?: readonly TrailingAccessory[];
|
|
497
562
|
draggable?: boolean;
|
|
@@ -532,6 +597,7 @@ export type ActivityRow = RowBase &
|
|
|
532
597
|
Readonly<{
|
|
533
598
|
type: 'activity';
|
|
534
599
|
leading: LeadingVisual;
|
|
600
|
+
hideLeading?: boolean;
|
|
535
601
|
secondaryLeading?: LeadingVisual;
|
|
536
602
|
title: string;
|
|
537
603
|
description?: string;
|
|
@@ -557,11 +623,14 @@ export type ActivityRow = RowBase &
|
|
|
557
623
|
export type MessageRow = RowBase &
|
|
558
624
|
Readonly<{
|
|
559
625
|
type: 'message';
|
|
626
|
+
/** Draws only top and bottom container borders when a border is supplied. */
|
|
627
|
+
presentation?: 'inlineWarning';
|
|
560
628
|
unread?: boolean;
|
|
561
629
|
leading?: LeadingVisual;
|
|
562
630
|
title: string;
|
|
563
631
|
body: string;
|
|
564
|
-
|
|
632
|
+
/** Zero displays the complete body. */
|
|
633
|
+
bodyLines?: 0 | 1 | 2 | 3;
|
|
565
634
|
time: string;
|
|
566
635
|
thumbnail?: ImageSource;
|
|
567
636
|
style?: MessageRowStyle;
|
|
@@ -570,8 +639,12 @@ export type MessageRow = RowBase &
|
|
|
570
639
|
export type DataColumn = Readonly<{
|
|
571
640
|
key: string;
|
|
572
641
|
text: string;
|
|
642
|
+
textSegments?: readonly ValueTextSegment[];
|
|
643
|
+
titleIcon?: IdentityRow['titleIcon'];
|
|
644
|
+
secondaryTitleIcon?: IdentityRow['titleIcon'];
|
|
573
645
|
secondaryLeadingText?: string;
|
|
574
646
|
secondaryText?: string;
|
|
647
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
575
648
|
weight?: 1 | 2 | 3;
|
|
576
649
|
alignment?: 'start' | 'center' | 'end';
|
|
577
650
|
tone?: 'primary' | 'secondary' | 'positive' | 'negative';
|
|
@@ -583,6 +656,7 @@ export type DataRow = RowBase &
|
|
|
583
656
|
type: 'dataRow';
|
|
584
657
|
leading?: LeadingVisual;
|
|
585
658
|
columns: readonly DataColumn[];
|
|
659
|
+
trailing?: readonly TrailingAccessory[];
|
|
586
660
|
checkbox?: Extract<TrailingAccessory, { kind: 'checkbox' }>;
|
|
587
661
|
index?: number;
|
|
588
662
|
badge?: BadgeModel;
|
|
@@ -592,11 +666,108 @@ export type DataRow = RowBase &
|
|
|
592
666
|
style?: DataRowStyle;
|
|
593
667
|
}>;
|
|
594
668
|
|
|
669
|
+
export type WebMarketTableColumn = Readonly<{
|
|
670
|
+
key: string;
|
|
671
|
+
width?: number;
|
|
672
|
+
minWidth?: number;
|
|
673
|
+
flex?: number;
|
|
674
|
+
alignment?: 'start' | 'center' | 'end';
|
|
675
|
+
paddingStart?: number;
|
|
676
|
+
paddingEnd?: number;
|
|
677
|
+
}>;
|
|
678
|
+
|
|
679
|
+
export type WebMarketTableText = Readonly<{
|
|
680
|
+
text: string;
|
|
681
|
+
segments?: readonly ValueTextSegment[];
|
|
682
|
+
tone?: TextTone;
|
|
683
|
+
style?: Pick<
|
|
684
|
+
NativeListTextStyle,
|
|
685
|
+
'fontSize' | 'fontWeight' | 'lineHeight' | 'color'
|
|
686
|
+
>;
|
|
687
|
+
}>;
|
|
688
|
+
|
|
689
|
+
export type WebMarketTableCell = Readonly<{ key: string }> &
|
|
690
|
+
(
|
|
691
|
+
| Readonly<{
|
|
692
|
+
kind: 'favorite';
|
|
693
|
+
active: boolean;
|
|
694
|
+
disabled?: boolean;
|
|
695
|
+
testID?: string;
|
|
696
|
+
hoverActionKey?: string;
|
|
697
|
+
actionKey: string;
|
|
698
|
+
accessibilityLabel: string;
|
|
699
|
+
}>
|
|
700
|
+
| Readonly<{
|
|
701
|
+
kind: 'asset';
|
|
702
|
+
leading: LeadingVisual;
|
|
703
|
+
title: WebMarketTableText;
|
|
704
|
+
secondary?: readonly WebMarketTableText[];
|
|
705
|
+
lineGap?: number;
|
|
706
|
+
secondaryBadges?: readonly Pick<
|
|
707
|
+
MarketBadgeModel,
|
|
708
|
+
'key' | 'text' | 'style'
|
|
709
|
+
>[];
|
|
710
|
+
hoverImages?: readonly (ImageSource | null)[];
|
|
711
|
+
hoverSecondary?: readonly WebMarketTableText[];
|
|
712
|
+
hoverActionKey?: string;
|
|
713
|
+
hoverActionLabel?: string;
|
|
714
|
+
badges?: readonly Pick<
|
|
715
|
+
MarketBadgeModel,
|
|
716
|
+
| 'key'
|
|
717
|
+
| 'text'
|
|
718
|
+
| 'iconName'
|
|
719
|
+
| 'icon'
|
|
720
|
+
| 'textColor'
|
|
721
|
+
| 'backgroundColor'
|
|
722
|
+
| 'actionKey'
|
|
723
|
+
| 'accessibilityLabel'
|
|
724
|
+
| 'style'
|
|
725
|
+
>[];
|
|
726
|
+
}>
|
|
727
|
+
| Readonly<{
|
|
728
|
+
kind: 'text';
|
|
729
|
+
primary: readonly WebMarketTableText[];
|
|
730
|
+
partGap?: number;
|
|
731
|
+
secondary?: readonly WebMarketTableText[];
|
|
732
|
+
}>
|
|
733
|
+
| Readonly<{
|
|
734
|
+
kind: 'sparkline';
|
|
735
|
+
points: readonly number[];
|
|
736
|
+
width: number;
|
|
737
|
+
height: number;
|
|
738
|
+
strokeColor: string;
|
|
739
|
+
fillColor: string;
|
|
740
|
+
}>
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
export type WebMarketTablePresentation = Readonly<{
|
|
744
|
+
draggable?: boolean;
|
|
745
|
+
contextMenuActionKey?: string;
|
|
746
|
+
testID?: string;
|
|
747
|
+
columns: readonly WebMarketTableColumn[];
|
|
748
|
+
cells: readonly WebMarketTableCell[];
|
|
749
|
+
}>;
|
|
750
|
+
|
|
595
751
|
/** Native Market quote row. All values are already localized/formatted strings. */
|
|
596
752
|
export type MarketRow = RowBase &
|
|
597
753
|
Readonly<{
|
|
598
754
|
type: 'market';
|
|
599
755
|
variant: 'token' | 'stock' | 'perp';
|
|
756
|
+
/** Web-only bounded table presentation; native reads the ordinary Market fields. */
|
|
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
|
+
>[];
|
|
600
771
|
leadingAction?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
601
772
|
leading: LeadingVisual;
|
|
602
773
|
title: string;
|
|
@@ -604,6 +775,8 @@ export type MarketRow = RowBase &
|
|
|
604
775
|
/** OneKey patch: localized name shrinks independently of the volume. */
|
|
605
776
|
subtitlePrefix?: Readonly<{
|
|
606
777
|
text: string;
|
|
778
|
+
/** Web-only anchored help for a truncated name. */
|
|
779
|
+
hoverActionKey?: string;
|
|
607
780
|
gap?: number;
|
|
608
781
|
maxWidth?: number;
|
|
609
782
|
style?: MarketTextStyle;
|
|
@@ -678,9 +851,11 @@ export type SectionHeaderRow = RowBase &
|
|
|
678
851
|
indexTitle?: string;
|
|
679
852
|
variant?: 'summary' | 'gallery' | 'history';
|
|
680
853
|
title: string;
|
|
854
|
+
leadingBadge?: BadgeModel;
|
|
681
855
|
titleLoading?: boolean;
|
|
682
856
|
subtitle?: string;
|
|
683
857
|
value?: string;
|
|
858
|
+
valueHelp?: RowTextHelp;
|
|
684
859
|
valueActionKey?: string;
|
|
685
860
|
titleIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
686
861
|
valueIcon?: Extract<TrailingAccessory, { kind: 'icon' }>;
|
|
@@ -701,6 +876,21 @@ export type ActionRow = RowBase &
|
|
|
701
876
|
style?: ActionRowStyle;
|
|
702
877
|
}>;
|
|
703
878
|
|
|
879
|
+
export type ButtonGroupRow = RowBase &
|
|
880
|
+
Readonly<{
|
|
881
|
+
type: 'buttonGroup';
|
|
882
|
+
buttons: readonly Readonly<{
|
|
883
|
+
key: string;
|
|
884
|
+
label: string;
|
|
885
|
+
actionKey: string;
|
|
886
|
+
disabled?: boolean;
|
|
887
|
+
loading?: boolean;
|
|
888
|
+
testID?: string;
|
|
889
|
+
accessibilityLabel?: string;
|
|
890
|
+
}>[];
|
|
891
|
+
style?: TemplateBoxStyle<'buttonGroup'>;
|
|
892
|
+
}>;
|
|
893
|
+
|
|
704
894
|
export type SystemRow = RowBase &
|
|
705
895
|
Readonly<{ style?: SystemRowStyle }> &
|
|
706
896
|
(
|
|
@@ -753,6 +943,7 @@ export type RowModel =
|
|
|
753
943
|
| MetricCardRow
|
|
754
944
|
| SectionHeaderRow
|
|
755
945
|
| ActionRow
|
|
946
|
+
| ButtonGroupRow
|
|
756
947
|
| SystemRow;
|
|
757
948
|
|
|
758
949
|
export type NativeListTheme = Readonly<{
|
|
@@ -765,8 +956,12 @@ export type NativeListTheme = Readonly<{
|
|
|
765
956
|
rowBackground: string;
|
|
766
957
|
rowSelectedBackground: string;
|
|
767
958
|
rowPressedBackground?: string;
|
|
959
|
+
/** Web-only enabled-row hover color; defaults to rowPressedBackground. */
|
|
960
|
+
rowHoverBackground?: string;
|
|
768
961
|
subduedBackground?: string;
|
|
769
962
|
strongBackground?: string;
|
|
963
|
+
/** Web-only background for a displayed declared image fallback. */
|
|
964
|
+
imageFallbackBackground?: string;
|
|
770
965
|
primaryText: string;
|
|
771
966
|
secondaryText: string;
|
|
772
967
|
disabledText?: string;
|
|
@@ -775,6 +970,8 @@ export type NativeListTheme = Readonly<{
|
|
|
775
970
|
separator: string;
|
|
776
971
|
accent: string;
|
|
777
972
|
positive: string;
|
|
973
|
+
/** Optional exact background for the success tone of section leading badges. */
|
|
974
|
+
successBackground?: string;
|
|
778
975
|
negative: string;
|
|
779
976
|
criticalBackground?: string;
|
|
780
977
|
inverseBackground?: string;
|
|
@@ -821,6 +1018,16 @@ export type NativeListListStyle = Readonly<{
|
|
|
821
1018
|
export type NativeListSnapshot = Readonly<{
|
|
822
1019
|
schemaVersion: 1;
|
|
823
1020
|
generation: number;
|
|
1021
|
+
/** One-shot animation for a user-initiated row-key insertion or removal. */
|
|
1022
|
+
structuralTransition?: Readonly<{
|
|
1023
|
+
id: string;
|
|
1024
|
+
durationMs?: number;
|
|
1025
|
+
anchorKey?: string;
|
|
1026
|
+
}>;
|
|
1027
|
+
disclosure?: Readonly<{
|
|
1028
|
+
expanded: boolean;
|
|
1029
|
+
expandedTrailingInset?: number;
|
|
1030
|
+
}>;
|
|
824
1031
|
layout: Readonly<{
|
|
825
1032
|
kind: NativeListLayout;
|
|
826
1033
|
orientation?: NativeListOrientation;
|
|
@@ -869,201 +1076,203 @@ type CommonPatchFields =
|
|
|
869
1076
|
| 'accessibilityLabel'
|
|
870
1077
|
| 'style';
|
|
871
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
|
+
|
|
872
1084
|
export type RowPatch =
|
|
873
1085
|
| Readonly<{
|
|
874
1086
|
type: 'identity';
|
|
875
1087
|
key: string;
|
|
876
|
-
changes:
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
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'
|
|
893
1110
|
>;
|
|
894
1111
|
}>
|
|
895
1112
|
| Readonly<{
|
|
896
1113
|
type: 'rail';
|
|
897
1114
|
key: string;
|
|
898
|
-
changes:
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
902
|
-
>
|
|
1115
|
+
changes: PatchClearableChanges<
|
|
1116
|
+
RailRow,
|
|
1117
|
+
CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'
|
|
903
1118
|
>;
|
|
904
1119
|
}>
|
|
905
1120
|
| Readonly<{
|
|
906
1121
|
type: 'activity';
|
|
907
1122
|
key: string;
|
|
908
|
-
changes:
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
>
|
|
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'
|
|
926
1140
|
>;
|
|
927
1141
|
}>
|
|
928
1142
|
| Readonly<{
|
|
929
1143
|
type: 'message';
|
|
930
1144
|
key: string;
|
|
931
|
-
changes:
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
>
|
|
1145
|
+
changes: PatchClearableChanges<
|
|
1146
|
+
MessageRow,
|
|
1147
|
+
| CommonPatchFields
|
|
1148
|
+
| 'unread'
|
|
1149
|
+
| 'title'
|
|
1150
|
+
| 'body'
|
|
1151
|
+
| 'bodyLines'
|
|
1152
|
+
| 'presentation'
|
|
1153
|
+
| 'time'
|
|
1154
|
+
| 'thumbnail'
|
|
942
1155
|
>;
|
|
943
1156
|
}>
|
|
944
1157
|
| Readonly<{
|
|
945
1158
|
type: 'dataRow';
|
|
946
1159
|
key: string;
|
|
947
|
-
changes:
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
>
|
|
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'
|
|
960
1172
|
>;
|
|
961
1173
|
}>
|
|
962
1174
|
| Readonly<{
|
|
963
1175
|
type: 'market';
|
|
964
1176
|
key: string;
|
|
965
|
-
changes:
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
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'
|
|
984
1196
|
>;
|
|
985
1197
|
}>
|
|
986
1198
|
| Readonly<{
|
|
987
1199
|
type: 'mediaTile';
|
|
988
1200
|
key: string;
|
|
989
|
-
changes:
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
| 'closeActionKey'
|
|
1001
|
-
>
|
|
1201
|
+
changes: PatchClearableChanges<
|
|
1202
|
+
MediaTileRow,
|
|
1203
|
+
| CommonPatchFields
|
|
1204
|
+
| 'image'
|
|
1205
|
+
| 'imageState'
|
|
1206
|
+
| 'media'
|
|
1207
|
+
| 'networkImage'
|
|
1208
|
+
| 'title'
|
|
1209
|
+
| 'subtitle'
|
|
1210
|
+
| 'badge'
|
|
1211
|
+
| 'closeActionKey'
|
|
1002
1212
|
>;
|
|
1003
1213
|
}>
|
|
1004
1214
|
| Readonly<{
|
|
1005
1215
|
type: 'metricCard';
|
|
1006
1216
|
key: string;
|
|
1007
|
-
changes:
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
| 'progress'
|
|
1021
|
-
>
|
|
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'
|
|
1022
1230
|
>;
|
|
1023
1231
|
}>
|
|
1024
1232
|
| Readonly<{
|
|
1025
1233
|
type: 'sectionHeader';
|
|
1026
1234
|
key: string;
|
|
1027
|
-
changes:
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
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'
|
|
1043
1251
|
>;
|
|
1044
1252
|
}>
|
|
1045
1253
|
| Readonly<{
|
|
1046
1254
|
type: 'action';
|
|
1047
1255
|
key: string;
|
|
1048
|
-
changes:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1256
|
+
changes: PatchClearableChanges<
|
|
1257
|
+
ActionRow,
|
|
1258
|
+
CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'
|
|
1259
|
+
>;
|
|
1260
|
+
}>
|
|
1261
|
+
| Readonly<{
|
|
1262
|
+
type: 'buttonGroup';
|
|
1263
|
+
key: string;
|
|
1264
|
+
changes: PatchClearableChanges<
|
|
1265
|
+
ButtonGroupRow,
|
|
1266
|
+
CommonPatchFields | 'buttons'
|
|
1058
1267
|
>;
|
|
1059
1268
|
}>
|
|
1060
1269
|
| Readonly<{
|
|
1061
1270
|
type: 'system';
|
|
1062
1271
|
key: string;
|
|
1063
1272
|
changes: Readonly<{
|
|
1064
|
-
revision?: number;
|
|
1065
|
-
disabled?: boolean;
|
|
1066
|
-
message?: string;
|
|
1273
|
+
revision?: number | null;
|
|
1274
|
+
disabled?: boolean | null;
|
|
1275
|
+
message?: string | null;
|
|
1067
1276
|
}>;
|
|
1068
1277
|
}>;
|
|
1069
1278
|
|
|
@@ -1073,6 +1282,7 @@ export type NativeListActionSource =
|
|
|
1073
1282
|
| 'leadingAction'
|
|
1074
1283
|
| 'trailingAccessory'
|
|
1075
1284
|
| 'footerAction'
|
|
1285
|
+
| 'buttonGroup'
|
|
1076
1286
|
| 'description'
|
|
1077
1287
|
| 'mediaClose';
|
|
1078
1288
|
|
|
@@ -1097,6 +1307,8 @@ export type NativeListActionAnchor = Readonly<{
|
|
|
1097
1307
|
}>;
|
|
1098
1308
|
|
|
1099
1309
|
export type RowActionEvent = Readonly<{
|
|
1310
|
+
/** Web-only client/window CSS pixel pointer location. */
|
|
1311
|
+
windowPoint?: Readonly<{ x: number; y: number }>;
|
|
1100
1312
|
rowKey?: string;
|
|
1101
1313
|
actionKey: string;
|
|
1102
1314
|
sectionKey?: string;
|