@onekeyfe/react-native-native-list 3.0.179-alpha.2026101503 → 3.0.179-alpha.302

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.
Files changed (113) hide show
  1. package/LICENSE +36 -0
  2. package/README.md +32 -3
  3. package/android/build.gradle +0 -1
  4. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +22 -3
  5. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +8 -8
  6. package/android/src/main/java/com/onekey/nativelist/NativeListActionRenderer.kt +5 -5
  7. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +4 -4
  8. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +6 -6
  9. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +6 -1
  10. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +11 -11
  11. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +20 -20
  12. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +5 -4
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +7 -7
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +5 -5
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +8 -7
  16. package/android/src/main/java/com/onekey/nativelist/NativeListMetricCardRenderer.kt +14 -14
  17. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +28 -15
  18. package/android/src/main/java/com/onekey/nativelist/NativeListRailRenderer.kt +4 -4
  19. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +3 -3
  20. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +3 -2
  21. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +5 -4
  22. package/android/src/main/java/com/onekey/nativelist/NativeListRowHost.kt +1 -1
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +20 -20
  24. package/android/src/main/java/com/onekey/nativelist/NativeListSystemRenderer.kt +3 -3
  25. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +104 -18
  26. package/android/src/main/java/com/onekey/nativelist/NativeListWalletGroupRenderer.kt +6 -5
  27. package/docs/SPEC.md +69 -19
  28. package/docs/STYLE_SPEC.md +12 -2
  29. package/ios/HybridNativeList.swift +15 -21
  30. package/ios/NativeListAccessoryStack.swift +14 -10
  31. package/ios/NativeListActionRenderer.swift +7 -4
  32. package/ios/NativeListActivityDetailsView.swift +63 -24
  33. package/ios/NativeListActivityRenderer.swift +19 -10
  34. package/ios/NativeListDataRowRenderer.swift +23 -19
  35. package/ios/NativeListDesignAssets.swift +43 -34
  36. package/ios/NativeListIdentityRenderer.swift +23 -19
  37. package/ios/NativeListLeadingVisual.swift +9 -4
  38. package/ios/NativeListMarketRenderer.swift +19 -11
  39. package/ios/NativeListMediaTileRenderer.swift +11 -7
  40. package/ios/NativeListMessageRenderer.swift +20 -10
  41. package/ios/NativeListMetricCardRenderer.swift +16 -12
  42. package/ios/NativeListRailRenderer.swift +9 -7
  43. package/ios/NativeListRendererCell.swift +6 -4
  44. package/ios/NativeListRendererRegistry.swift +8 -3
  45. package/ios/NativeListResolvedText.swift +3 -3
  46. package/ios/NativeListRowHost.swift +7 -2
  47. package/ios/NativeListSectionHeaderRenderer.swift +22 -19
  48. package/ios/NativeListSystemRenderer.swift +18 -16
  49. package/ios/NativeListTextStyles.swift +18 -12
  50. package/ios/NativeListWalletGroupRenderer.swift +6 -4
  51. package/ios/RNCNativeListView.swift +38 -92
  52. package/ios/tests/NativeListActivityPresentationTests.swift +5 -3
  53. package/ios/tests/NativeListLifecycleTests.swift +77 -2
  54. package/lib/module/NativeList.js +8 -24
  55. package/lib/module/NativeList.web.js +8 -3
  56. package/lib/module/fonts.js +44 -0
  57. package/lib/module/index.js +1 -0
  58. package/lib/module/web/NativeListWebEngine.js +48 -24
  59. package/lib/module/web/templates/ActionRowRenderer.js +2 -1
  60. package/lib/module/web/templates/IdentityRowRenderer.js +4 -3
  61. package/lib/module/web/templates/MarketRowRenderer.js +2 -1
  62. package/lib/module/web/templates/RowText.js +13 -3
  63. package/lib/module/web/templates/SectionHeaderRowRenderer.js +3 -2
  64. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +9 -18
  65. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +2 -4
  66. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +5 -10
  67. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +2 -8
  68. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +7 -12
  69. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +6 -12
  70. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +1 -2
  71. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +6 -17
  72. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +2 -4
  73. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +2 -4
  74. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +2 -4
  75. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +3 -6
  76. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +1 -2
  77. package/lib/typescript/src/NativeList.nitro.d.ts +1 -2
  78. package/lib/typescript/src/NativeList.types.d.ts +0 -4
  79. package/lib/typescript/src/fonts.d.ts +10 -0
  80. package/lib/typescript/src/index.d.ts +2 -0
  81. package/lib/typescript/src/web/NativeListWebEngine.d.ts +4 -1
  82. package/lib/typescript/src/web/templates/RowText.d.ts +1 -0
  83. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +9 -18
  84. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +2 -4
  85. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +5 -10
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +2 -8
  87. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +7 -12
  88. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +6 -12
  89. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +1 -2
  90. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +6 -17
  91. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +2 -4
  92. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +2 -4
  93. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +2 -4
  94. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +3 -6
  95. package/nitrogen/generated/shared/json/NativeListConfig.json +1 -2
  96. package/package.json +4 -5
  97. package/react-native-native-list.podspec +0 -1
  98. package/src/NativeList.nitro.ts +1 -2
  99. package/src/NativeList.tsx +4 -25
  100. package/src/NativeList.types.ts +0 -4
  101. package/src/NativeList.web.tsx +10 -3
  102. package/src/fonts.ts +64 -0
  103. package/src/index.ts +3 -0
  104. package/src/web/NativeListWebEngine.ts +53 -24
  105. package/src/web/templates/ActionRowRenderer.ts +2 -1
  106. package/src/web/templates/IdentityRowRenderer.ts +4 -3
  107. package/src/web/templates/MarketRowRenderer.ts +4 -2
  108. package/src/web/templates/RowText.ts +15 -3
  109. package/src/web/templates/SectionHeaderRowRenderer.ts +6 -3
  110. package/common/fonts/Roobert-Bold.ttf +0 -0
  111. package/common/fonts/Roobert-Medium.ttf +0 -0
  112. package/common/fonts/Roobert-Regular.ttf +0 -0
  113. package/common/fonts/Roobert-SemiBold.ttf +0 -0
@@ -16,12 +16,10 @@ namespace margelo::nitro::nativelist {
16
16
  registerHybrids(this, [](Prototype& prototype) {
17
17
  prototype.registerHybridGetter("snapshotJson", &HybridNativeListSpec::getSnapshotJson);
18
18
  prototype.registerHybridSetter("snapshotJson", &HybridNativeListSpec::setSnapshotJson);
19
+ prototype.registerHybridGetter("fontFamiliesJson", &HybridNativeListSpec::getFontFamiliesJson);
20
+ prototype.registerHybridSetter("fontFamiliesJson", &HybridNativeListSpec::setFontFamiliesJson);
19
21
  prototype.registerHybridGetter("containerSlotHeightsJson", &HybridNativeListSpec::getContainerSlotHeightsJson);
20
22
  prototype.registerHybridSetter("containerSlotHeightsJson", &HybridNativeListSpec::setContainerSlotHeightsJson);
21
- prototype.registerHybridGetter("topScrollEdgeHard", &HybridNativeListSpec::getTopScrollEdgeHard);
22
- prototype.registerHybridSetter("topScrollEdgeHard", &HybridNativeListSpec::setTopScrollEdgeHard);
23
- prototype.registerHybridGetter("topOverlayHeight", &HybridNativeListSpec::getTopOverlayHeight);
24
- prototype.registerHybridSetter("topOverlayHeight", &HybridNativeListSpec::setTopOverlayHeight);
25
23
  prototype.registerHybridGetter("scrollPositionThresholdsJson", &HybridNativeListSpec::getScrollPositionThresholdsJson);
26
24
  prototype.registerHybridSetter("scrollPositionThresholdsJson", &HybridNativeListSpec::setScrollPositionThresholdsJson);
27
25
  prototype.registerHybridGetter("onScrollPositionThresholdChange", &HybridNativeListSpec::getOnScrollPositionThresholdChange);
@@ -56,12 +56,10 @@ namespace margelo::nitro::nativelist {
56
56
  // Properties
57
57
  virtual std::string getSnapshotJson() = 0;
58
58
  virtual void setSnapshotJson(const std::string& snapshotJson) = 0;
59
+ virtual std::string getFontFamiliesJson() = 0;
60
+ virtual void setFontFamiliesJson(const std::string& fontFamiliesJson) = 0;
59
61
  virtual std::string getContainerSlotHeightsJson() = 0;
60
62
  virtual void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) = 0;
61
- virtual bool getTopScrollEdgeHard() = 0;
62
- virtual void setTopScrollEdgeHard(bool topScrollEdgeHard) = 0;
63
- virtual double getTopOverlayHeight() = 0;
64
- virtual void setTopOverlayHeight(double topOverlayHeight) = 0;
65
63
  virtual std::string getScrollPositionThresholdsJson() = 0;
66
64
  virtual void setScrollPositionThresholdsJson(const std::string& scrollPositionThresholdsJson) = 0;
67
65
  virtual std::optional<std::function<void(bool /* isBeyondThreshold */)>> getOnScrollPositionThresholdChange() = 0;
@@ -21,9 +21,8 @@ namespace margelo::nitro::nativelist::views {
21
21
  const react::RawProps& rawProps):
22
22
  react::ViewProps(context, sourceProps, rawProps, filterObjectKeys),
23
23
  snapshotJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "snapshotJson", rawProps, sourceProps.snapshotJson)),
24
+ fontFamiliesJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "fontFamiliesJson", rawProps, sourceProps.fontFamiliesJson)),
24
25
  containerSlotHeightsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "containerSlotHeightsJson", rawProps, sourceProps.containerSlotHeightsJson)),
25
- topScrollEdgeHard(nitro::ReactProp<bool>::fromRawValue("NativeList", "topScrollEdgeHard", rawProps, sourceProps.topScrollEdgeHard)),
26
- topOverlayHeight(nitro::ReactProp<double>::fromRawValue("NativeList", "topOverlayHeight", rawProps, sourceProps.topOverlayHeight)),
27
26
  scrollPositionThresholdsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "scrollPositionThresholdsJson", rawProps, sourceProps.scrollPositionThresholdsJson)),
28
27
  onScrollPositionThresholdChange(nitro::ReactProp<std::optional<std::function<void(bool /* isBeyondThreshold */)>>>::fromRawValue("NativeList", "onScrollPositionThresholdChange", rawProps, sourceProps.onScrollPositionThresholdChange)),
29
28
  keyboardDismissMode(nitro::ReactProp<NativeListKeyboardDismissMode>::fromRawValue("NativeList", "keyboardDismissMode", rawProps, sourceProps.keyboardDismissMode)),
@@ -39,9 +38,8 @@ namespace margelo::nitro::nativelist::views {
39
38
  bool HybridNativeListProps::filterObjectKeys(const std::string& propName) {
40
39
  switch (hashString(propName)) {
41
40
  case hashString("snapshotJson"): return true;
41
+ case hashString("fontFamiliesJson"): return true;
42
42
  case hashString("containerSlotHeightsJson"): return true;
43
- case hashString("topScrollEdgeHard"): return true;
44
- case hashString("topOverlayHeight"): return true;
45
43
  case hashString("scrollPositionThresholdsJson"): return true;
46
44
  case hashString("onScrollPositionThresholdChange"): return true;
47
45
  case hashString("keyboardDismissMode"): return true;
@@ -46,9 +46,8 @@ namespace margelo::nitro::nativelist::views {
46
46
 
47
47
  public:
48
48
  nitro::ReactProp<std::string> snapshotJson;
49
+ nitro::ReactProp<std::string> fontFamiliesJson;
49
50
  nitro::ReactProp<std::string> containerSlotHeightsJson;
50
- nitro::ReactProp<bool> topScrollEdgeHard;
51
- nitro::ReactProp<double> topOverlayHeight;
52
51
  nitro::ReactProp<std::string> scrollPositionThresholdsJson;
53
52
  nitro::ReactProp<std::optional<std::function<void(bool /* isBeyondThreshold */)>>> onScrollPositionThresholdChange;
54
53
  nitro::ReactProp<NativeListKeyboardDismissMode> keyboardDismissMode;
@@ -64,9 +63,8 @@ namespace margelo::nitro::nativelist::views {
64
63
  [[nodiscard]]
65
64
  bool hasSameProps(const HybridNativeListProps& other) const noexcept {
66
65
  return snapshotJson.hasSameValue(other.snapshotJson) &&
66
+ fontFamiliesJson.hasSameValue(other.fontFamiliesJson) &&
67
67
  containerSlotHeightsJson.hasSameValue(other.containerSlotHeightsJson) &&
68
- topScrollEdgeHard.hasSameValue(other.topScrollEdgeHard) &&
69
- topOverlayHeight.hasSameValue(other.topOverlayHeight) &&
70
68
  scrollPositionThresholdsJson.hasSameValue(other.scrollPositionThresholdsJson) &&
71
69
  onScrollPositionThresholdChange.hasSameValue(other.onScrollPositionThresholdChange) &&
72
70
  keyboardDismissMode.hasSameValue(other.keyboardDismissMode) &&
@@ -83,9 +81,8 @@ namespace margelo::nitro::nativelist::views {
83
81
  [[nodiscard]]
84
82
  bool hasAnyProvidedProps() const noexcept {
85
83
  return snapshotJson.isProvided() ||
84
+ fontFamiliesJson.isProvided() ||
86
85
  containerSlotHeightsJson.isProvided() ||
87
- topScrollEdgeHard.isProvided() ||
88
- topOverlayHeight.isProvided() ||
89
86
  scrollPositionThresholdsJson.isProvided() ||
90
87
  onScrollPositionThresholdChange.isProvided() ||
91
88
  keyboardDismissMode.isProvided() ||
@@ -5,9 +5,8 @@
5
5
  "directEventTypes": {},
6
6
  "validAttributes": {
7
7
  "snapshotJson": true,
8
+ "fontFamiliesJson": true,
8
9
  "containerSlotHeightsJson": true,
9
- "topScrollEdgeHard": true,
10
- "topOverlayHeight": true,
11
10
  "scrollPositionThresholdsJson": true,
12
11
  "onScrollPositionThresholdChange": true,
13
12
  "keyboardDismissMode": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-native-list",
3
- "version": "3.0.179-alpha.2026101503",
3
+ "version": "3.0.179-alpha.302",
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",
@@ -19,7 +19,6 @@
19
19
  "lib",
20
20
  "android",
21
21
  "ios",
22
- "common",
23
22
  "cpp",
24
23
  "nitrogen",
25
24
  "nitro.json",
@@ -59,7 +58,7 @@
59
58
  "url": "https://github.com/OneKeyHQ/app-modules/issues"
60
59
  },
61
60
  "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-views/react-native-native-list#readme",
62
- "license": "MIT",
61
+ "license": "SEE LICENSE IN LICENSE",
63
62
  "publishConfig": {
64
63
  "registry": "https://registry.npmjs.org/",
65
64
  "access": "public"
@@ -87,8 +86,8 @@
87
86
  "typescript": "^5.9.2"
88
87
  },
89
88
  "peerDependencies": {
90
- "@onekeyfe/react-native-image": "3.0.179-alpha.2026101503",
91
- "@onekeyfe/react-native-native-logger": "3.0.179-alpha.2026101503",
89
+ "@onekeyfe/react-native-image": "3.0.179-alpha.302",
90
+ "@onekeyfe/react-native-native-logger": "3.0.179-alpha.302",
92
91
  "react": "*",
93
92
  "react-native": "*",
94
93
  "react-native-nitro-modules": "0.37.0"
@@ -16,7 +16,6 @@ Pod::Spec.new do |s|
16
16
  s.exclude_files = "ios/tests/**/*"
17
17
  s.resource_bundles = {
18
18
  "NativeListResources" => [
19
- "common/fonts/*.ttf",
20
19
  "ios/Resources/NativeListIcons.xcassets"
21
20
  ]
22
21
  }
@@ -11,9 +11,8 @@ import type {
11
11
  */
12
12
  export interface NativeListNativeProps extends HybridViewProps {
13
13
  snapshotJson: string;
14
+ fontFamiliesJson: string;
14
15
  containerSlotHeightsJson: string;
15
- topScrollEdgeHard: boolean;
16
- topOverlayHeight: number;
17
16
  scrollPositionThresholdsJson: string;
18
17
  onScrollPositionThresholdChange?: (isBeyondThreshold: boolean) => void;
19
18
  keyboardDismissMode: NativeListKeyboardDismissMode;
@@ -1,3 +1,4 @@
1
+ import { useNativeListFontFamiliesJson } from './fonts';
1
2
  import React, {
2
3
  forwardRef,
3
4
  useEffect,
@@ -14,7 +15,7 @@ import {
14
15
  NativeAvatarPrefetchModel,
15
16
  NativeAvatarPrefetchQueue,
16
17
  } from './avatarPrefetch';
17
- import { Platform, View } from 'react-native';
18
+ import { View } from 'react-native';
18
19
  import { callback, getHostComponent } from 'react-native-nitro-modules';
19
20
  import type {
20
21
  NativeListMethods,
@@ -101,8 +102,6 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
101
102
  listHeader,
102
103
  listFooter,
103
104
  listEmpty,
104
- topOverlay,
105
- topScrollEdgeEffect,
106
105
  scrollPositionThresholds,
107
106
  webVirtualizationEnabled: _webVirtualizationEnabled,
108
107
  webSectionIndexContainerRef: _webSectionIndexContainerRef,
@@ -125,13 +124,8 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
125
124
  },
126
125
  forwardedRef
127
126
  ) {
127
+ const fontFamiliesJson = useNativeListFontFamiliesJson();
128
128
  const [slotHeights, setSlotHeights] = useState([0, 0, 0]);
129
- const [topOverlayHeight, setTopOverlayHeight] = useState(0);
130
- const hasTopOverlay =
131
- Platform?.OS === 'ios' &&
132
- parseInt(String(Platform.Version), 10) >= 26 &&
133
- topScrollEdgeEffect === 'hard' &&
134
- topOverlay != null;
135
129
  const containerSlotHeightsJson = JSON.stringify(slotHeights);
136
130
  const slotInset =
137
131
  snapshot.layout.contentPaddingHorizontal ??
@@ -512,10 +506,9 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
512
506
  <NativeListHost
513
507
  {...viewProps}
514
508
  {...nativeCallbacks}
509
+ fontFamiliesJson={fontFamiliesJson}
515
510
  snapshotJson={snapshotJson}
516
511
  containerSlotHeightsJson={containerSlotHeightsJson}
517
- topScrollEdgeHard={hasTopOverlay}
518
- topOverlayHeight={hasTopOverlay ? topOverlayHeight : 0}
519
512
  scrollPositionThresholdsJson={scrollPositionThresholdsJson}
520
513
  keyboardDismissMode={keyboardDismissMode}
521
514
  keyboardShouldPersistTaps={normalizedKeyboardShouldPersistTaps}
@@ -544,20 +537,6 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
544
537
  {content}
545
538
  </View>
546
539
  ))}
547
- {hasTopOverlay ? (
548
- <View
549
- collapsable={false}
550
- style={{ position: 'absolute', top: 0, left: 0, right: 0 }}
551
- onLayout={(event) => {
552
- const height = Math.ceil(event.nativeEvent.layout.height);
553
- setTopOverlayHeight((previous) =>
554
- previous === height ? previous : height
555
- );
556
- }}
557
- >
558
- {topOverlay}
559
- </View>
560
- ) : null}
561
540
  </NativeListHost>
562
541
  );
563
542
  }
@@ -123,10 +123,6 @@ export type NativeListProps = Omit<ViewProps, 'children'> &
123
123
  listHeader?: ReactNode;
124
124
  listFooter?: ReactNode;
125
125
  listEmpty?: ReactNode;
126
- /** Fixed overlay above scrolling rows on iOS 26 and newer. */
127
- topOverlay?: ReactNode;
128
- /** Enables UIKit's hard top scroll-edge effect on iOS 26 and newer. */
129
- topScrollEdgeEffect?: 'hard';
130
126
  /** Web only. Defaults to true and is ignored by the native host. */
131
127
  webVirtualizationEnabled?: boolean;
132
128
  /** Web only. Hosts the section index inside this container. */
@@ -1,3 +1,4 @@
1
+ import { useNativeListFontFamiliesJson } from './fonts';
1
2
  import React, {
2
3
  forwardRef,
3
4
  useCallback,
@@ -85,8 +86,6 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
85
86
  listHeader: _listHeader,
86
87
  listEmpty: _listEmpty,
87
88
  listFooter: _listFooter,
88
- topOverlay: _topOverlay,
89
- topScrollEdgeEffect: _topScrollEdgeEffect,
90
89
  scrollPositionThresholds: _scrollPositionThresholds,
91
90
  onScrollPositionThresholdChange: _onScrollPositionThresholdChange,
92
91
  webVirtualizationEnabled = true,
@@ -109,6 +108,9 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
109
108
  },
110
109
  forwardedRef
111
110
  ) {
111
+ const fontFamiliesJson = useNativeListFontFamiliesJson();
112
+ const fontFamiliesJsonRef = useRef(fontFamiliesJson);
113
+ fontFamiliesJsonRef.current = fontFamiliesJson;
112
114
  const [host, setHost] = useState<HTMLElement | null>(null);
113
115
  const engineRef = useRef<NativeListWebEngine | undefined>(undefined);
114
116
  const webVirtualizationEnabledRef = useRef(webVirtualizationEnabled);
@@ -184,7 +186,8 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
184
186
  snapshotRef.current,
185
187
  callbacksRef.current,
186
188
  webVirtualizationEnabledRef.current,
187
- webSectionIndexContainerRef?.current as unknown as HTMLElement | null
189
+ webSectionIndexContainerRef?.current as unknown as HTMLElement | null,
190
+ fontFamiliesJsonRef.current
188
191
  );
189
192
  engineRef.current = engine;
190
193
  appliedSnapshotRef.current = snapshotRef.current;
@@ -206,6 +209,10 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
206
209
  };
207
210
  }, [host, webSectionIndexContainerRef]);
208
211
 
212
+ useEffect(() => {
213
+ engineRef.current?.setFontFamiliesJson(fontFamiliesJson);
214
+ }, [fontFamiliesJson]);
215
+
209
216
  useEffect(() => {
210
217
  engineRef.current?.setVirtualizationEnabled(webVirtualizationEnabled);
211
218
  }, [webVirtualizationEnabled]);
package/src/fonts.ts ADDED
@@ -0,0 +1,64 @@
1
+ import { useSyncExternalStore } from 'react';
2
+
3
+ export type NativeListFontFamilies = Readonly<{
4
+ regular?: string;
5
+ medium?: string;
6
+ semibold?: string;
7
+ bold?: string;
8
+ }>;
9
+
10
+ const weights = ['regular', 'medium', 'semibold', 'bold'] as const;
11
+ let configuration = '{}';
12
+ const listeners = new Set<() => void>();
13
+
14
+ /** Configure names already provided by the host in this JavaScript runtime. */
15
+ export function configureNativeListFonts(
16
+ families: NativeListFontFamilies
17
+ ): void {
18
+ if (!families || typeof families !== 'object' || Array.isArray(families)) {
19
+ throw new TypeError('NativeList font families must be an object');
20
+ }
21
+ if (
22
+ Object.keys(families).some(
23
+ (key) => !weights.includes(key as (typeof weights)[number])
24
+ )
25
+ ) {
26
+ throw new TypeError('Unknown NativeList font weight');
27
+ }
28
+ const normalized: Record<string, string> = {};
29
+ for (const weight of weights) {
30
+ const name = families[weight];
31
+ if (name === undefined) continue;
32
+ if (
33
+ typeof name !== 'string' ||
34
+ Array.from(name).some(
35
+ (character) =>
36
+ character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127
37
+ )
38
+ ) {
39
+ throw new TypeError(`Invalid NativeList ${weight} font family`);
40
+ }
41
+ const trimmed = name.trim();
42
+ if (trimmed.length === 0 || trimmed.length > 128) {
43
+ throw new TypeError(`Invalid NativeList ${weight} font family`);
44
+ }
45
+ normalized[weight] = trimmed;
46
+ }
47
+ const next = JSON.stringify(normalized);
48
+ if (next === configuration) return;
49
+ configuration = next;
50
+ listeners.forEach((listener) => listener());
51
+ }
52
+
53
+ function subscribe(listener: () => void): () => void {
54
+ listeners.add(listener);
55
+ return () => listeners.delete(listener);
56
+ }
57
+
58
+ function getSnapshot(): string {
59
+ return configuration;
60
+ }
61
+
62
+ export function useNativeListFontFamiliesJson(): string {
63
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
64
+ }
package/src/index.ts CHANGED
@@ -35,3 +35,6 @@ export type {
35
35
  SelectionResult,
36
36
  SelectionState,
37
37
  } from './selection';
38
+
39
+ export { configureNativeListFonts } from './fonts';
40
+ export type { NativeListFontFamilies } from './fonts';
@@ -1,3 +1,4 @@
1
+ import { applyTextWeight } from './templates/RowText';
1
2
  import {
2
3
  applyRowContainerStyle,
3
4
  resetRowContainerStyle,
@@ -789,7 +790,7 @@ export function webMarketImageBindDeltaForPatches(
789
790
  // OneKey patch: selector names must shrink before the sidebar clips their contents.
790
791
  export const WEB_LIST_CSS = `
791
792
  [data-native-list-selector="walletSidebar"] .ok-native-list-title{max-width:100%;min-width:0}
792
- .ok-native-list-root{--nl-bg:#f7f7f7;--nl-row:#fff;--nl-selected:#eaf2ff;--nl-pressed:#e8e8e8;--nl-subdued:#f9f9f9;--nl-strong:#0000000f;--nl-primary:#111;--nl-secondary:#6b7280;--nl-disabled:#8d8d8d;--nl-icon:#111;--nl-icon-subdued:#8d8d8d;--nl-separator:#e5e7eb;--nl-accent:#2f6bff;--nl-positive:#15803d;--nl-negative:#dc2626;--nl-critical:#feecec;--nl-inverse:#202020;--nl-inverse-text:#fcfcfc;--nl-info:#0d74ce;position:absolute;inset:0;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--nl-bg);color:var(--nl-primary);font-family:Roobert,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none}
793
+ .ok-native-list-root{--nl-bg:#f7f7f7;--nl-row:#fff;--nl-selected:#eaf2ff;--nl-pressed:#e8e8e8;--nl-subdued:#f9f9f9;--nl-strong:#0000000f;--nl-primary:#111;--nl-secondary:#6b7280;--nl-disabled:#8d8d8d;--nl-icon:#111;--nl-icon-subdued:#8d8d8d;--nl-separator:#e5e7eb;--nl-accent:#2f6bff;--nl-positive:#15803d;--nl-negative:#dc2626;--nl-critical:#feecec;--nl-inverse:#202020;--nl-inverse-text:#fcfcfc;--nl-info:#0d74ce;position:absolute;inset:0;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--nl-bg);color:var(--nl-primary);font-family:var(--nl-font-regular);font-synthesis:none}
793
794
  .ok-native-list-viewport-frame{position:relative;flex:1;min-width:0;min-height:0;overflow:hidden}
794
795
  .ok-native-list-viewport{position:absolute;inset:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
795
796
  .ok-native-list-content{position:relative;min-width:100%;min-height:100%}
@@ -818,10 +819,10 @@ export const WEB_LIST_CSS = `
818
819
  .ok-native-list-item[data-native-list-dragging="true"]>.ok-native-list-row>*{visibility:hidden}
819
820
  .ok-native-list-item[data-native-list-dragging="true"]>.ok-native-list-wallet-group{border-color:transparent;background:var(--nl-pressed)}
820
821
  .ok-native-list-item[data-native-list-dragging="true"]>.ok-native-list-wallet-group>*{visibility:hidden}
821
- .ok-native-list-reorder-preview{position:fixed;left:0;top:0;z-index:100001;pointer-events:none;overflow:hidden;border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,.12);transform-origin:center;will-change:transform;font-family:Roobert,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
822
+ .ok-native-list-reorder-preview{position:fixed;left:0;top:0;z-index:100001;pointer-events:none;overflow:hidden;border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,.12);transform-origin:center;will-change:transform;font-synthesis:none;font-family:var(--nl-font-regular)}
822
823
  .ok-native-list-reorder-preview>.ok-native-list-row{background:var(--nl-pressed);cursor:grabbing}
823
824
  .ok-native-list-reorder-preview[data-native-list-selected="true"]>.ok-native-list-row{background:var(--nl-selected)}
824
- .ok-native-list-reorder-count{position:absolute;right:4px;bottom:4px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:24px;height:24px;padding:0 6px;border:1px solid var(--nl-row);border-radius:12px;background:var(--nl-inverse);color:var(--nl-inverse-text);font-size:12px;line-height:22px;font-weight:600}
825
+ .ok-native-list-reorder-count{position:absolute;right:4px;bottom:4px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:24px;height:24px;padding:0 6px;border:1px solid var(--nl-row);border-radius:12px;background:var(--nl-inverse);color:var(--nl-inverse-text);font-size:12px;line-height:22px;font-weight:600;font-family:var(--nl-font-semibold)}
825
826
  .ok-native-list-item[data-separator="true"]>.ok-native-list-row{border-bottom:1px solid var(--nl-separator-color,var(--nl-separator))}
826
827
  /* An inset separator keeps the transparent border so the row's height is unchanged, and paints the visible line with a logical-inset overlay so it follows RTL. */
827
828
  .ok-native-list-root[data-separator-inset="true"] .ok-native-list-item[data-separator="true"]>.ok-native-list-row{position:relative;border-bottom-color:transparent}
@@ -830,30 +831,30 @@ export const WEB_LIST_CSS = `
830
831
  .ok-native-list-item[data-group-position="last"]>.ok-native-list-row{border-radius:0 0 var(--nl-group-radius,12px) var(--nl-group-radius,12px)}
831
832
  .ok-native-list-item[data-group-position="single"]>.ok-native-list-row{border-radius:var(--nl-group-radius,12px)}
832
833
  .ok-native-list-standard{padding:8px 12px}.ok-native-list-network-row{padding:0 12px}.ok-native-list-wallet-row{padding:4px 8px;flex-direction:column;justify-content:center;gap:4px}.ok-native-list-account-row{padding:4px 12px;gap:8px}
833
- .ok-native-list-account-row .ok-native-list-visual,.ok-native-list-account-action-row .ok-native-list-visual{width:32px;height:32px;flex-basis:32px}.ok-native-list-account-row .ok-native-list-visual>img,.ok-native-list-account-row .ok-native-list-visual-main,.ok-native-list-account-action-row .ok-native-list-visual>img,.ok-native-list-account-action-row .ok-native-list-visual-main{width:32px;height:32px}.ok-native-list-account-row .ok-native-list-visual>.ok-native-list-visual-corner{width:20px;height:20px;padding:2px}.ok-native-list-account-action-row .ok-native-list-visual{border-radius:8px!important}.ok-native-list-wallet-row .ok-native-list-title{color:var(--nl-secondary);font-size:12px;line-height:16px;font-weight:400}.ok-native-list-item[data-native-list-selected="true"]>.ok-native-list-wallet-row .ok-native-list-title{color:var(--nl-primary)}.ok-native-list-account-row .ok-native-list-title{font-size:16px;line-height:20px;font-weight:400}.ok-native-list-account-row .ok-native-list-secondary{font-size:14px;line-height:20px;font-weight:400}
834
- .ok-native-list-flex{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center}.ok-native-list-title{font-size:15px;line-height:20px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-secondary{font-size:13px;line-height:18px;color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-tertiary{color:var(--nl-secondary)}.ok-native-list-info{color:var(--nl-info)}
834
+ .ok-native-list-account-row .ok-native-list-visual,.ok-native-list-account-action-row .ok-native-list-visual{width:32px;height:32px;flex-basis:32px}.ok-native-list-account-row .ok-native-list-visual>img,.ok-native-list-account-row .ok-native-list-visual-main,.ok-native-list-account-action-row .ok-native-list-visual>img,.ok-native-list-account-action-row .ok-native-list-visual-main{width:32px;height:32px}.ok-native-list-account-row .ok-native-list-visual>.ok-native-list-visual-corner{width:20px;height:20px;padding:2px}.ok-native-list-account-action-row .ok-native-list-visual{border-radius:8px!important}.ok-native-list-wallet-row .ok-native-list-title{color:var(--nl-secondary);font-size:12px;line-height:16px;font-weight:400;font-family:var(--nl-font-regular)}.ok-native-list-item[data-native-list-selected="true"]>.ok-native-list-wallet-row .ok-native-list-title{color:var(--nl-primary)}.ok-native-list-account-row .ok-native-list-title{font-size:16px;line-height:20px;font-weight:400;font-family:var(--nl-font-regular)}.ok-native-list-account-row .ok-native-list-secondary{font-size:14px;line-height:20px;font-weight:400;font-family:var(--nl-font-regular)}
835
+ .ok-native-list-flex{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center}.ok-native-list-title{font-size:15px;line-height:20px;font-weight:600;font-family:var(--nl-font-semibold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-secondary{font-size:13px;line-height:18px;color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-tertiary{color:var(--nl-secondary)}.ok-native-list-info{color:var(--nl-info)}
835
836
  .ok-native-list-identity-row .ok-native-list-title,.ok-native-list-identity-row .ok-native-list-amounts>span:first-child{font-size:16px;line-height:20px}.ok-native-list-identity-row .ok-native-list-secondary{font-size:14px;line-height:20px}
836
- .ok-native-list-value{font-size:14px;line-height:20px;font-weight:500;white-space:nowrap}.ok-native-list-time{font-size:11px;line-height:16px;color:var(--nl-secondary);align-self:flex-start}.ok-native-list-amounts{display:flex;flex-direction:column;align-items:flex-end;min-width:0}.ok-native-list-actions{display:flex;gap:16px;margin-top:6px}
837
- .ok-native-list-action-button{appearance:none;border:0;background:transparent;padding:2px;color:var(--nl-accent);font:600 12px/16px inherit;cursor:pointer}.ok-native-list-action-button[data-tone="danger"]{color:var(--nl-negative)}.ok-native-list-action-button:disabled{opacity:.5;cursor:default}
838
- .ok-native-list-visual{position:relative;flex:0 0 40px;width:40px;height:40px;border-radius:20px;overflow:visible;background:var(--nl-strong)}.ok-native-list-visual>img,.ok-native-list-visual-main{display:block;width:40px;height:40px;border-radius:inherit;object-fit:cover}.ok-native-list-visual-fallback{display:flex;width:100%;height:100%;align-items:center;justify-content:center;border-radius:inherit;color:var(--nl-primary);font-size:15px;font-weight:600;overflow:hidden}.ok-native-list-visual>.ok-native-list-visual-corner{position:absolute;right:-4px;bottom:-4px;width:18px;height:18px;padding:2px;border-radius:50%;background:var(--nl-row);object-fit:cover}.ok-native-list-stacked{display:flex;align-items:center;width:48px;flex-basis:48px}.ok-native-list-stacked img{width:28px;height:28px;border:2px solid var(--nl-row);border-radius:50%;object-fit:cover;margin-left:-10px}.ok-native-list-stacked img:first-child{margin-left:0}
839
- .ok-native-list-accessories{display:flex;align-items:center;gap:10px;min-width:0}.ok-native-list-accessory{font-size:14px;color:var(--nl-primary);white-space:nowrap}.ok-native-list-accessory-secondary{color:var(--nl-secondary)}.ok-native-list-icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;border:0;background:transparent;color:var(--nl-icon);font-size:20px;line-height:1;font-weight:500;font-family:inherit;cursor:pointer}.ok-native-list-checkbox{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;border:2px solid color-mix(in srgb,var(--nl-primary) 19%,transparent);border-radius:5px;background:var(--nl-row);cursor:pointer}.ok-native-list-checkbox[data-state="checked"],.ok-native-list-checkbox[data-state="indeterminate"]{border-color:transparent;background:var(--nl-primary)}.ok-native-list-checkbox[data-state="checked"]::after{content:"";width:6px;height:10px;margin-top:-2px;border-right:2px solid var(--nl-row);border-bottom:2px solid var(--nl-row);transform:rotate(45deg)}.ok-native-list-checkbox[data-state="indeterminate"]::after{content:"";width:8px;height:2px;border-radius:1px;background:var(--nl-row)}.ok-native-list-spinner{width:16px;height:16px;border:2px solid var(--nl-separator);border-top-color:var(--nl-primary);border-radius:50%;animation:ok-native-list-spin .8s linear infinite}@keyframes ok-native-list-spin{to{transform:rotate(360deg)}}
837
+ .ok-native-list-value{font-size:14px;line-height:20px;font-weight:500;font-family:var(--nl-font-medium);white-space:nowrap}.ok-native-list-time{font-size:11px;line-height:16px;color:var(--nl-secondary);align-self:flex-start}.ok-native-list-amounts{display:flex;flex-direction:column;align-items:flex-end;min-width:0}.ok-native-list-actions{display:flex;gap:16px;margin-top:6px}
838
+ .ok-native-list-action-button{appearance:none;border:0;background:transparent;padding:2px;color:var(--nl-accent);font:600 12px/16px var(--nl-font-semibold);cursor:pointer}.ok-native-list-action-button[data-tone="danger"]{color:var(--nl-negative)}.ok-native-list-action-button:disabled{opacity:.5;cursor:default}
839
+ .ok-native-list-visual{position:relative;flex:0 0 40px;width:40px;height:40px;border-radius:20px;overflow:visible;background:var(--nl-strong)}.ok-native-list-visual>img,.ok-native-list-visual-main{display:block;width:40px;height:40px;border-radius:inherit;object-fit:cover}.ok-native-list-visual-fallback{display:flex;width:100%;height:100%;align-items:center;justify-content:center;border-radius:inherit;color:var(--nl-primary);font-size:15px;font-weight:600;font-family:var(--nl-font-semibold);overflow:hidden}.ok-native-list-visual>.ok-native-list-visual-corner{position:absolute;right:-4px;bottom:-4px;width:18px;height:18px;padding:2px;border-radius:50%;background:var(--nl-row);object-fit:cover}.ok-native-list-stacked{display:flex;align-items:center;width:48px;flex-basis:48px}.ok-native-list-stacked img{width:28px;height:28px;border:2px solid var(--nl-row);border-radius:50%;object-fit:cover;margin-left:-10px}.ok-native-list-stacked img:first-child{margin-left:0}
840
+ .ok-native-list-accessories{display:flex;align-items:center;gap:10px;min-width:0}.ok-native-list-accessory{font-size:14px;color:var(--nl-primary);white-space:nowrap}.ok-native-list-accessory-secondary{color:var(--nl-secondary)}.ok-native-list-icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;border:0;background:transparent;color:var(--nl-icon);font-size:20px;line-height:1;font-weight:500;font-family:var(--nl-font-medium);cursor:pointer}.ok-native-list-checkbox{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:20px;height:20px;border:2px solid color-mix(in srgb,var(--nl-primary) 19%,transparent);border-radius:5px;background:var(--nl-row);cursor:pointer}.ok-native-list-checkbox[data-state="checked"],.ok-native-list-checkbox[data-state="indeterminate"]{border-color:transparent;background:var(--nl-primary)}.ok-native-list-checkbox[data-state="checked"]::after{content:"";width:6px;height:10px;margin-top:-2px;border-right:2px solid var(--nl-row);border-bottom:2px solid var(--nl-row);transform:rotate(45deg)}.ok-native-list-checkbox[data-state="indeterminate"]::after{content:"";width:8px;height:2px;border-radius:1px;background:var(--nl-row)}.ok-native-list-spinner{width:16px;height:16px;border:2px solid var(--nl-separator);border-top-color:var(--nl-primary);border-radius:50%;animation:ok-native-list-spin .8s linear infinite}@keyframes ok-native-list-spin{to{transform:rotate(360deg)}}
840
841
  .ok-native-list-badge{display:inline-flex;align-items:center;max-width:100%;height:18px;padding:0 5px;border-radius:5px;background:color-mix(in srgb,var(--nl-accent) 12%,transparent);color:var(--nl-accent);font-size:11px;line-height:18px;white-space:nowrap}.ok-native-list-badge[data-tone="danger"]{background:var(--nl-critical);color:var(--nl-negative)}.ok-native-list-badges{display:inline-flex;gap:4px;margin-left:6px;vertical-align:middle}
841
- .ok-native-list-section{padding:0 8px;background:var(--nl-bg);gap:8px}.ok-native-list-section[data-variant="summary"]{padding:0 20px}.ok-native-list-section[data-variant="gallery"]{padding:0 12px}.ok-native-list-section[data-variant="history"]{padding:0 8px}.ok-native-list-section-title{font-size:13px;line-height:18px;font-weight:700;color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-section[data-variant="summary"] .ok-native-list-section-title{font-size:16px;font-weight:500;color:var(--nl-primary)}.ok-native-list-section[data-variant="gallery"] .ok-native-list-section-title{font-size:16px;color:var(--nl-primary)}.ok-native-list-section[data-variant="history"] .ok-native-list-section-title{font-size:12px;line-height:16px}.ok-native-list-section-value{margin-left:auto}
842
- .ok-native-list-action-row{justify-content:space-between;padding:0 16px}.ok-native-list-action-title{font-size:15px;font-weight:600;color:var(--nl-accent)}.ok-native-list-action-title[data-tone="danger"]{color:var(--nl-negative)}
843
- .ok-native-list-account-action-row{justify-content:flex-start;gap:12px;padding:0 12px}.ok-native-list-account-action-row .ok-native-list-action-title{color:var(--nl-secondary);font-size:16px;line-height:24px;font-weight:400}
842
+ .ok-native-list-section{padding:0 8px;background:var(--nl-bg);gap:8px}.ok-native-list-section[data-variant="summary"]{padding:0 20px}.ok-native-list-section[data-variant="gallery"]{padding:0 12px}.ok-native-list-section[data-variant="history"]{padding:0 8px}.ok-native-list-section-title{font-size:13px;line-height:18px;font-weight:700;font-family:var(--nl-font-bold);color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-section[data-variant="summary"] .ok-native-list-section-title{font-size:16px;font-weight:500;font-family:var(--nl-font-medium);color:var(--nl-primary)}.ok-native-list-section[data-variant="gallery"] .ok-native-list-section-title{font-size:16px;color:var(--nl-primary)}.ok-native-list-section[data-variant="history"] .ok-native-list-section-title{font-size:12px;line-height:16px}.ok-native-list-section-value{margin-left:auto}
843
+ .ok-native-list-action-row{justify-content:space-between;padding:0 16px}.ok-native-list-action-title{font-size:15px;font-weight:600;font-family:var(--nl-font-semibold);color:var(--nl-accent)}.ok-native-list-action-title[data-tone="danger"]{color:var(--nl-negative)}
844
+ .ok-native-list-account-action-row{justify-content:flex-start;gap:12px;padding:0 12px}.ok-native-list-account-action-row .ok-native-list-action-title{color:var(--nl-secondary);font-size:16px;line-height:24px;font-weight:400;font-family:var(--nl-font-regular)}
844
845
  .ok-native-list-system{justify-content:center;padding:8px 12px;background:var(--nl-bg);color:var(--nl-secondary);cursor:default}.ok-native-list-system[data-variant="retry"],.ok-native-list-system[data-variant="noMatch"],.ok-native-list-system[data-variant="end"]{justify-content:flex-start}.ok-native-list-system[data-variant="retry"]{cursor:pointer}
845
- .ok-native-list-rail{padding:4px;gap:6px;border-radius:8px}.ok-native-list-rail .ok-native-list-visual{width:20px;height:20px;flex-basis:20px}.ok-native-list-rail .ok-native-list-visual>img,.ok-native-list-rail .ok-native-list-visual-main{width:20px;height:20px}.ok-native-list-rail-title{font-size:12px;font-weight:500;white-space:nowrap}
846
- .ok-native-list-media{display:block;padding:0 5px;background:transparent;border-radius:16px}.ok-native-list-media-image{display:block;width:100%;aspect-ratio:1;border-radius:10px;background:var(--nl-strong);object-fit:cover}.ok-native-list-media-image[data-state="empty"]{background:transparent}.ok-native-list-media-image[data-state="error"]{display:flex;align-items:center;justify-content:center;color:var(--nl-icon-subdued);font-size:24px}.ok-native-list-media-meta{padding-top:7px}.ok-native-list-media-subtitle-row{display:flex;align-items:center;gap:6px}.ok-native-list-media-subtitle{flex:1;min-width:0;font-size:12px;color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-media-network{width:14px;height:14px;border-radius:50%}.ok-native-list-media-title{font-size:16px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-media-close{position:absolute;right:9px;top:4px;border:0;background:color-mix(in srgb,var(--nl-inverse) 72%,transparent);color:var(--nl-inverse-text);width:24px;height:24px;border-radius:50%;font:18px/20px inherit;cursor:pointer}
847
- .ok-native-list-metric{display:flex;flex-direction:column;align-items:flex-start;padding:12px;border-radius:12px;gap:5px;background:var(--nl-row)}.ok-native-list-metric-value{font-size:22px;line-height:28px;font-weight:700}.ok-native-list-composite{display:flex;flex-direction:column;align-items:stretch;padding:14px;border-radius:12px;gap:12px;background:var(--nl-subdued)}.ok-native-list-composite-heading{font-size:14px;letter-spacing:1px;color:var(--nl-secondary)}.ok-native-list-composite-row{display:flex;gap:12px}.ok-native-list-composite-cell{flex:1;min-width:0}.ok-native-list-composite-cell[data-shaded="true"]{padding:10px;border-radius:10px;background:color-mix(in srgb,var(--nl-primary) 5%,transparent)}.ok-native-list-composite-value{font-size:18px;font-weight:600}.ok-native-list-divider{height:1px;background:var(--nl-separator)}.ok-native-list-progress{height:4px;border-radius:2px;overflow:hidden;background:var(--nl-negative)}.ok-native-list-progress>span{display:block;height:100%;border-radius:2px;background:var(--nl-positive)}
848
- .ok-native-list-data{padding:6px 12px}.ok-native-list-index{flex:0 0 28px;color:var(--nl-secondary);font-size:13px}.ok-native-list-favorite{flex:0 0 24px;color:var(--nl-icon-subdued);font-size:22px}.ok-native-list-favorite[data-active="true"]{color:var(--nl-accent)}.ok-native-list-data-cell{display:flex;flex-direction:column;min-width:0}.ok-native-list-data-cell[data-align="center"]{align-items:center}.ok-native-list-data-cell[data-align="end"]{align-items:flex-end}.ok-native-list-data-primary{display:flex;align-items:center;gap:5px;max-width:100%;font-size:16px;font-weight:500;white-space:nowrap}.ok-native-list-unread{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--nl-accent)}.ok-native-list-thumbnail{width:64px;height:64px;border-radius:10px;object-fit:cover}
849
- .ok-native-list-market{padding:12px 20px;gap:14px}.ok-native-list-market>.ok-native-list-visual{width:32px;height:32px;flex-basis:32px}.ok-native-list-market[data-variant="stock"]>.ok-native-list-visual{width:40px;height:40px;flex-basis:40px}.ok-native-list-market>.ok-native-list-visual>.ok-native-list-visual-main{width:100%;height:100%}.ok-native-list-market-main{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center}.ok-native-list-market-title-line{display:flex;align-items:center;min-width:0;gap:4px}.ok-native-list-market-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--nl-primary);font-size:16px;line-height:24px;font-weight:500}.ok-native-list-market-subtitle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--nl-secondary);font-size:14px;line-height:20px;font-weight:400}.ok-native-list-market-badge{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;max-width:72px;height:18px;padding:0 5px;border:0;border-radius:4px;background:var(--nl-strong);color:var(--nl-secondary);font:500 11px/18px inherit;overflow:hidden;white-space:nowrap}.ok-native-list-market-badge img{width:14px;height:14px;object-fit:contain}.ok-native-list-market-trailing{display:flex;flex:0 0 auto;align-items:center;gap:8px}.ok-native-list-market-price{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;color:var(--nl-primary);font-size:16px;line-height:24px;font-weight:500;font-variant-numeric:tabular-nums}.ok-native-list-market-change{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:80px;height:32px;border-radius:8px;color:#fff;background:#8d8d8d;font-size:14px;line-height:20px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}.ok-native-list-market-change[data-tone="positive"]{background:var(--nl-positive)}.ok-native-list-market-change[data-tone="negative"]{background:var(--nl-negative)}
846
+ .ok-native-list-rail{padding:4px;gap:6px;border-radius:8px}.ok-native-list-rail .ok-native-list-visual{width:20px;height:20px;flex-basis:20px}.ok-native-list-rail .ok-native-list-visual>img,.ok-native-list-rail .ok-native-list-visual-main{width:20px;height:20px}.ok-native-list-rail-title{font-size:12px;font-weight:500;font-family:var(--nl-font-medium);white-space:nowrap}
847
+ .ok-native-list-media{display:block;padding:0 5px;background:transparent;border-radius:16px}.ok-native-list-media-image{display:block;width:100%;aspect-ratio:1;border-radius:10px;background:var(--nl-strong);object-fit:cover}.ok-native-list-media-image[data-state="empty"]{background:transparent}.ok-native-list-media-image[data-state="error"]{display:flex;align-items:center;justify-content:center;color:var(--nl-icon-subdued);font-size:24px}.ok-native-list-media-meta{padding-top:7px}.ok-native-list-media-subtitle-row{display:flex;align-items:center;gap:6px}.ok-native-list-media-subtitle{flex:1;min-width:0;font-size:12px;color:var(--nl-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-media-network{width:14px;height:14px;border-radius:50%}.ok-native-list-media-title{font-size:16px;font-weight:500;font-family:var(--nl-font-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ok-native-list-media-close{position:absolute;right:9px;top:4px;border:0;background:color-mix(in srgb,var(--nl-inverse) 72%,transparent);color:var(--nl-inverse-text);width:24px;height:24px;border-radius:50%;font:18px/20px var(--nl-font-regular);cursor:pointer}
848
+ .ok-native-list-metric{display:flex;flex-direction:column;align-items:flex-start;padding:12px;border-radius:12px;gap:5px;background:var(--nl-row)}.ok-native-list-metric-value{font-size:22px;line-height:28px;font-weight:700;font-family:var(--nl-font-bold)}.ok-native-list-composite{display:flex;flex-direction:column;align-items:stretch;padding:14px;border-radius:12px;gap:12px;background:var(--nl-subdued)}.ok-native-list-composite-heading{font-size:14px;letter-spacing:1px;color:var(--nl-secondary)}.ok-native-list-composite-row{display:flex;gap:12px}.ok-native-list-composite-cell{flex:1;min-width:0}.ok-native-list-composite-cell[data-shaded="true"]{padding:10px;border-radius:10px;background:color-mix(in srgb,var(--nl-primary) 5%,transparent)}.ok-native-list-composite-value{font-size:18px;font-weight:600;font-family:var(--nl-font-semibold)}.ok-native-list-divider{height:1px;background:var(--nl-separator)}.ok-native-list-progress{height:4px;border-radius:2px;overflow:hidden;background:var(--nl-negative)}.ok-native-list-progress>span{display:block;height:100%;border-radius:2px;background:var(--nl-positive)}
849
+ .ok-native-list-data{padding:6px 12px}.ok-native-list-index{flex:0 0 28px;color:var(--nl-secondary);font-size:13px}.ok-native-list-favorite{flex:0 0 24px;color:var(--nl-icon-subdued);font-size:22px}.ok-native-list-favorite[data-active="true"]{color:var(--nl-accent)}.ok-native-list-data-cell{display:flex;flex-direction:column;min-width:0}.ok-native-list-data-cell[data-align="center"]{align-items:center}.ok-native-list-data-cell[data-align="end"]{align-items:flex-end}.ok-native-list-data-primary{display:flex;align-items:center;gap:5px;max-width:100%;font-size:16px;font-weight:500;font-family:var(--nl-font-medium);white-space:nowrap}.ok-native-list-unread{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--nl-accent)}.ok-native-list-thumbnail{width:64px;height:64px;border-radius:10px;object-fit:cover}
850
+ .ok-native-list-market{padding:12px 20px;gap:14px}.ok-native-list-market>.ok-native-list-visual{width:32px;height:32px;flex-basis:32px}.ok-native-list-market[data-variant="stock"]>.ok-native-list-visual{width:40px;height:40px;flex-basis:40px}.ok-native-list-market>.ok-native-list-visual>.ok-native-list-visual-main{width:100%;height:100%}.ok-native-list-market-main{display:flex;flex:1;min-width:0;flex-direction:column;justify-content:center}.ok-native-list-market-title-line{display:flex;align-items:center;min-width:0;gap:4px}.ok-native-list-market-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--nl-primary);font-size:16px;line-height:24px;font-weight:500;font-family:var(--nl-font-medium)}.ok-native-list-market-subtitle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--nl-secondary);font-size:14px;line-height:20px;font-weight:400;font-family:var(--nl-font-regular)}.ok-native-list-market-badge{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;box-sizing:border-box;max-width:72px;height:18px;padding:0 5px;border:0;border-radius:4px;background:var(--nl-strong);color:var(--nl-secondary);font:500 11px/18px var(--nl-font-medium);overflow:hidden;white-space:nowrap}.ok-native-list-market-badge img{width:14px;height:14px;object-fit:contain}.ok-native-list-market-trailing{display:flex;flex:0 0 auto;align-items:center;gap:8px}.ok-native-list-market-price{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;color:var(--nl-primary);font-size:16px;line-height:24px;font-weight:500;font-family:var(--nl-font-medium);font-variant-numeric:tabular-nums}.ok-native-list-market-change{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:80px;height:32px;border-radius:8px;color:#fff;background:#8d8d8d;font-size:14px;line-height:20px;font-weight:500;font-family:var(--nl-font-medium);font-variant-numeric:tabular-nums;white-space:nowrap}.ok-native-list-market-change[data-tone="positive"]{background:var(--nl-positive)}.ok-native-list-market-change[data-tone="negative"]{background:var(--nl-negative)}
850
851
  .ok-native-list-market-badge>svg,.ok-native-list-market-badge>.ok-native-list-market-badge-icon>svg{display:block;width:16px;height:16px;flex:0 0 16px}.ok-native-list-system[data-native-list-presentation="market"]{box-sizing:border-box;padding:12px 20px}.ok-native-list-system[data-native-list-presentation="market"]>.ok-native-list-spinner{width:32px;height:32px}
851
- .ok-native-list-index-preview{position:absolute;z-index:8;right:40px;top:50%;display:flex;width:48px;height:48px;align-items:center;justify-content:center;transform:translateY(-50%) scale(.92);border-radius:14px;background:var(--nl-inverse);color:var(--nl-inverse-text);font-size:22px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .15s ease,transform .15s ease}.ok-native-list-index-preview[data-visible="true"]{opacity:1;transform:translateY(-50%) scale(1)}
852
+ .ok-native-list-index-preview{position:absolute;z-index:8;right:40px;top:50%;display:flex;width:48px;height:48px;align-items:center;justify-content:center;transform:translateY(-50%) scale(.92);border-radius:14px;background:var(--nl-inverse);color:var(--nl-inverse-text);font-size:22px;font-weight:600;font-family:var(--nl-font-semibold);opacity:0;pointer-events:none;transition:opacity .15s ease,transform .15s ease}.ok-native-list-index-preview[data-visible="true"]{opacity:1;transform:translateY(-50%) scale(1)}
852
853
  .ok-native-list-row.ok-native-list-market-skeleton{padding:12px 20px;gap:0}.ok-native-list-skeleton-left{display:flex;align-items:center;gap:12px;flex:1}.ok-native-list-skeleton-text{display:flex;flex-direction:column;gap:4px}.ok-native-list-skeleton-right{display:flex;align-items:center;gap:8px}.ok-native-list-skeleton-mark{display:block;flex-shrink:0;border-radius:8px;animation:ok-native-list-skeleton 1.5s linear infinite alternate}@keyframes ok-native-list-skeleton{from{background-color:var(--nl-skeleton-base)}to{background-color:var(--nl-skeleton-highlight)}}.ok-native-list-market-spinner{display:block;width:20px;height:20px;flex-shrink:0;color:var(--nl-icon);animation:ok-native-list-spin .75s linear infinite}
853
854
  @media (prefers-reduced-motion:reduce){.ok-native-list-index-preview,.ok-native-list-refresh{transition:none}.ok-native-list-spinner,.ok-native-list-market-spinner{animation:none}.ok-native-list-skeleton-mark{animation:none;background:var(--nl-skeleton-base)}}
854
- .ok-native-list-footer{flex:0 0 auto;min-height:0}.ok-native-list-sticky{position:absolute;z-index:4;left:0;right:0;top:0;pointer-events:auto;box-shadow:0 1px 0 var(--nl-separator)}.ok-native-list-viewport-frame:has(>.ok-native-list-index-rail:not([hidden]))>.ok-native-list-viewport,.ok-native-list-viewport-frame[data-section-index-visible="true"]>.ok-native-list-viewport{scrollbar-width:none}.ok-native-list-viewport-frame:has(>.ok-native-list-index-rail:not([hidden]))>.ok-native-list-viewport::-webkit-scrollbar,.ok-native-list-viewport-frame[data-section-index-visible="true"]>.ok-native-list-viewport::-webkit-scrollbar{display:none}.ok-native-list-index-rail{position:absolute;z-index:6;top:0;right:0;bottom:0;width:${SECTION_INDEX_RAIL_WIDTH}px;touch-action:none;cursor:pointer;font-family:Roobert,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.ok-native-list-index-rail[hidden]{display:none}.ok-native-list-index-button{appearance:none;position:absolute;left:15px;display:flex;width:14px;height:14px;align-items:center;justify-content:center;padding:0;transform:translateY(-50%);border:0;border-radius:7px;background:transparent;color:var(--nl-disabled);font-family:inherit;font-size:10px;font-weight:400;line-height:1;cursor:pointer;opacity:.5;transition:opacity .15s ease}.ok-native-list-index-rail:hover .ok-native-list-index-button,.ok-native-list-index-rail:focus-within .ok-native-list-index-button,.ok-native-list-index-button[data-active="true"]{opacity:1}.ok-native-list-index-button[data-active="true"]{background:var(--nl-positive);color:var(--nl-inverse-text);font-weight:500}.ok-native-list-index-button:focus-visible{outline:2px solid var(--nl-positive);outline-offset:1px}
855
+ .ok-native-list-footer{flex:0 0 auto;min-height:0}.ok-native-list-sticky{position:absolute;z-index:4;left:0;right:0;top:0;pointer-events:auto;box-shadow:0 1px 0 var(--nl-separator)}.ok-native-list-viewport-frame:has(>.ok-native-list-index-rail:not([hidden]))>.ok-native-list-viewport,.ok-native-list-viewport-frame[data-section-index-visible="true"]>.ok-native-list-viewport{scrollbar-width:none}.ok-native-list-viewport-frame:has(>.ok-native-list-index-rail:not([hidden]))>.ok-native-list-viewport::-webkit-scrollbar,.ok-native-list-viewport-frame[data-section-index-visible="true"]>.ok-native-list-viewport::-webkit-scrollbar{display:none}.ok-native-list-index-rail{position:absolute;z-index:6;top:0;right:0;bottom:0;width:${SECTION_INDEX_RAIL_WIDTH}px;touch-action:none;cursor:pointer;font-synthesis:none;font-family:var(--nl-font-regular)}.ok-native-list-index-rail[hidden]{display:none}.ok-native-list-index-button{appearance:none;position:absolute;left:15px;display:flex;width:14px;height:14px;align-items:center;justify-content:center;padding:0;transform:translateY(-50%);border:0;border-radius:7px;background:transparent;color:var(--nl-disabled);font-family:inherit;font-size:10px;font-weight:400;font-family:var(--nl-font-regular);line-height:1;cursor:pointer;opacity:.5;transition:opacity .15s ease}.ok-native-list-index-rail:hover .ok-native-list-index-button,.ok-native-list-index-rail:focus-within .ok-native-list-index-button,.ok-native-list-index-button[data-active="true"]{opacity:1}.ok-native-list-index-button[data-active="true"]{background:var(--nl-positive);color:var(--nl-inverse-text);font-weight:500;font-family:var(--nl-font-medium)}.ok-native-list-index-button:focus-visible{outline:2px solid var(--nl-positive);outline-offset:1px}
855
856
  .ok-native-list-refresh{position:absolute;z-index:7;left:50%;top:8px;display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:var(--nl-inverse);color:var(--nl-inverse-text);font-size:12px;opacity:0;transform:translate(-50%,-16px);transition:opacity .15s ease,transform .15s ease;pointer-events:none}.ok-native-list-refresh[data-visible="true"]{opacity:1;transform:translate(-50%,0)}
856
- .ok-native-list-warning{height:auto;display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:14px 12px;border-top:1px solid;border-bottom:1px solid;box-sizing:border-box;cursor:default}.ok-native-list-warning-title,.ok-native-list-warning-message{font-size:14px;line-height:20px;white-space:normal;overflow-wrap:anywhere}.ok-native-list-warning-title{font-weight:500;color:var(--nl-primary)}.ok-native-list-warning-message{font-weight:400;color:var(--nl-secondary)}
857
+ .ok-native-list-warning{height:auto;display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:14px 12px;border-top:1px solid;border-bottom:1px solid;box-sizing:border-box;cursor:default}.ok-native-list-warning-title,.ok-native-list-warning-message{font-size:14px;line-height:20px;white-space:normal;overflow-wrap:anywhere}.ok-native-list-warning-title{font-weight:500;font-family:var(--nl-font-medium);color:var(--nl-primary)}.ok-native-list-warning-message{font-weight:400;font-family:var(--nl-font-regular);color:var(--nl-secondary)}
857
858
  .ok-native-list-subtitle-segments{display:flex;align-items:center;min-width:0;max-width:100%;height:20px}.ok-native-list-subtitle-segments>.ok-native-list-secondary{flex:0 1 auto;min-width:0}.ok-native-list-subtitle-dot{flex:0 0 4px;width:4px;height:4px;margin:0 6px;border-radius:50%;background:var(--nl-disabled)}.ok-native-list-wallet-row>.ok-native-list-flex{flex:0 1 auto;width:100%;align-items:center}.ok-native-list-wallet-badges{display:flex;gap:4px;justify-content:center;margin-top:4px;height:20px;max-width:100%}.ok-native-list-wallet-badges>.ok-native-list-badge{background:var(--nl-strong);color:var(--nl-secondary);font-size:12px;line-height:16px;height:20px;box-sizing:border-box;padding:2px 4px}.ok-native-list-visual-overlay{position:absolute;display:flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:50%;overflow:hidden;line-height:1;font-size:10px}.ok-native-list-visual-overlay img,.ok-native-list-visual-overlay svg{width:100%;height:100%;object-fit:contain}/* OneKey patch: selector controls follow their original semantic colors and geometry. */
858
859
  .ok-native-list-checkbox[data-selector="networkSelector"]{padding:0;border-radius:4px;border-color:var(--nl-checkbox-border,var(--nl-separator));background:var(--nl-checkbox-icon,var(--nl-inverse-text))}
859
860
  .ok-native-list-checkbox[data-selector="networkSelector"]::after{display:none}
@@ -865,7 +866,7 @@ export const WEB_LIST_CSS = `
865
866
  /* OneKey patch: selected group members use the same primary title color as standalone wallets. */
866
867
  .ok-native-list-wallet-member[data-native-list-selected="true"]>.ok-native-list-wallet-row[data-native-list-selector="walletSidebar"] .ok-native-list-title{color:var(--nl-primary)}
867
868
  .ok-native-list-wallet-row[data-native-list-selector="walletSidebar"] .ok-native-list-wallet-badges{height:18px}
868
- .ok-native-list-wallet-row[data-native-list-selector="walletSidebar"] .ok-native-list-wallet-badges>.ok-native-list-badge{font-size:11px;line-height:14px;font-weight:400;height:18px;padding:2px 6px;border-radius:4px;background:var(--nl-subdued);color:var(--nl-secondary)}
869
+ .ok-native-list-wallet-row[data-native-list-selector="walletSidebar"] .ok-native-list-wallet-badges>.ok-native-list-badge{font-size:11px;line-height:14px;font-weight:400;font-family:var(--nl-font-regular);height:18px;padding:2px 6px;border-radius:4px;background:var(--nl-subdued);color:var(--nl-secondary)}
869
870
  .ok-native-list-wallet-row[data-native-list-selector="walletSidebar"] .ok-native-list-wallet-badges>.ok-native-list-badge[data-tone="warning"]{background:var(--nl-caution-background);color:var(--nl-caution)}
870
871
  .ok-native-list-account-row[data-native-list-selector="accountSelector"] .ok-native-list-accessories>.ok-native-list-icon-button{box-sizing:border-box;flex:0 0 38px;width:38px;height:38px;margin:-7px;padding:7px}
871
872
  .ok-native-list-account-row[data-native-list-selector="accountSelector"] .ok-native-list-accessories>.ok-native-list-icon-button[data-native-list-action]:not([data-native-list-account-control="createAddress"]):hover{background:var(--nl-strong);border-radius:50%}
@@ -873,7 +874,7 @@ export const WEB_LIST_CSS = `
873
874
  /* OneKey patch: AccountSelectorAccountListItem fixes the borderless Plus slot at top18/right20. */
874
875
  .ok-native-list-account-row[data-native-list-selector="accountSelector"]>.ok-native-list-accessories[data-native-list-account-control="createAddress"]{position:absolute;top:18px;right:12px}
875
876
  .ok-native-list-account-row[data-native-list-selector="accountSelector"] .ok-native-list-accessories>[data-native-list-account-control="createAddress"]{flex-basis:36px;width:36px;height:36px;padding:6px;border-radius:8px}
876
- .ok-native-list-account-action-row{padding-left:12px;padding-right:12px}.ok-native-list-account-action-row .ok-native-list-action-title{font-size:16px;line-height:24px;font-weight:400}.ok-native-list-account-action-row .ok-native-list-action-title[data-tone="primary"]{color:var(--nl-primary)}
877
+ .ok-native-list-account-action-row{padding-left:12px;padding-right:12px}.ok-native-list-account-action-row .ok-native-list-action-title{font-size:16px;line-height:24px;font-weight:400;font-family:var(--nl-font-regular)}.ok-native-list-account-action-row .ok-native-list-action-title[data-tone="primary"]{color:var(--nl-primary)}
877
878
  /* OneKey patch: account selector wallets and accounts keep the default cursor instead of pointer or grab affordances.
878
879
  Only the row surface is matched: cursor inherits, so plain children follow the row, while icon buttons,
879
880
  checkboxes, and action buttons keep advertising themselves with their own pointer cursor. */
@@ -1612,7 +1613,7 @@ function createVisual(
1612
1613
  if (isWalletText) {
1613
1614
  corner.style.fontSize = '12px';
1614
1615
  corner.style.lineHeight = '16px';
1615
- corner.style.fontWeight = '400';
1616
+ applyTextWeight(corner, '400');
1616
1617
  }
1617
1618
  if (
1618
1619
  isWalletText ||
@@ -2049,7 +2050,8 @@ export class NativeListWebEngine {
2049
2050
  snapshot: NativeListSnapshot,
2050
2051
  callbacks: NativeListWebCallbacks,
2051
2052
  virtualizationEnabled = true,
2052
- sectionIndexContainer?: HTMLElement | null
2053
+ sectionIndexContainer?: HTMLElement | null,
2054
+ fontFamiliesJson = '{}'
2053
2055
  ) {
2054
2056
  this.document = host.ownerDocument;
2055
2057
  this.snapshot = validateSnapshot(snapshot);
@@ -2194,9 +2196,36 @@ export class NativeListWebEngine {
2194
2196
  );
2195
2197
  }
2196
2198
  this.observeSectionIndexTransforms();
2199
+ this.applyFontFamilies(fontFamiliesJson);
2197
2200
  this.applySnapshot(this.snapshot);
2198
2201
  }
2199
2202
 
2203
+ private fontFamiliesJson = '{}';
2204
+
2205
+ private applyFontFamilies(json: string) {
2206
+ const families = JSON.parse(json) as Record<string, string | undefined>;
2207
+ const fallback = '-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif';
2208
+ for (const face of ['regular', 'medium', 'semibold', 'bold']) {
2209
+ const name = families[face];
2210
+ const family =
2211
+ name === undefined ? fallback : `${JSON.stringify(name)},${fallback}`;
2212
+ for (const element of [this.root, this.indexRail, this.reorderPreview]) {
2213
+ element.style.setProperty(`--nl-font-${face}`, family);
2214
+ }
2215
+ }
2216
+ this.fontFamiliesJson = json;
2217
+ }
2218
+
2219
+ setFontFamiliesJson(json: string) {
2220
+ if (json === this.fontFamiliesJson || this.destroyed) return;
2221
+ this.invalidateActionAnchor('layout');
2222
+ this.cancelPointerReorder(true);
2223
+ this.cancelKeyboardReorder();
2224
+ this.applyFontFamilies(json);
2225
+ this.measuredRendererHeights.clear();
2226
+ this.recomputeLayout();
2227
+ }
2228
+
2200
2229
  updateCallbacks(callbacks: NativeListWebCallbacks) {
2201
2230
  this.callbacks = callbacks;
2202
2231
  }
@@ -1,3 +1,4 @@
1
+ import { applyTextWeight } from './RowText';
1
2
  import { applyTabularNumbers, hasExplicitRowHeight } from './RowElements';
2
3
  import type { ActionRow } from '../../models';
3
4
  import { RowVisualStyle, type RowPrimitives } from './RowVisual';
@@ -31,7 +32,7 @@ function bind(body: HTMLElement, row: ActionRow, primitives: RowPrimitives) {
31
32
  v.title.textContent = row.title;
32
33
  v.title.dataset.tone = row.tone ?? '';
33
34
  if (row.presentation === 'accountSelector' && row.icon)
34
- v.title.style.fontWeight = '500';
35
+ applyTextWeight(v.title, '500');
35
36
  if (style?.title) primitives.textStyle(v.title, style.title);
36
37
  const visualKey = JSON.stringify([row.key, row.icon]);
37
38
  if (v.visualKey !== visualKey) {
@@ -1,3 +1,4 @@
1
+ import { applyTextWeight } from './RowText';
1
2
  import { applyTabularNumbers, hasExplicitRowHeight } from './RowElements';
2
3
  import type {
3
4
  IdentityRow,
@@ -458,7 +459,7 @@ function bind(body: HTMLElement, row: IdentityRow, primitives: RowPrimitives) {
458
459
  if (fallback) {
459
460
  fallback.style.fontSize = '19px';
460
461
  fallback.style.lineHeight = '27px';
461
- fallback.style.fontWeight = '600';
462
+ applyTextWeight(fallback, '600');
462
463
  fallback.style.color = 'var(--nl-inverse-text)';
463
464
  }
464
465
  }
@@ -471,14 +472,14 @@ function bind(body: HTMLElement, row: IdentityRow, primitives: RowPrimitives) {
471
472
  if (title) {
472
473
  title.style.fontSize = '16px';
473
474
  title.style.lineHeight = '24px';
474
- title.style.fontWeight = '500';
475
+ applyTextWeight(title, '500');
475
476
  }
476
477
  body
477
478
  .querySelectorAll<HTMLElement>('.ok-native-list-accessory')
478
479
  .forEach((value) => {
479
480
  value.style.fontSize = '16px';
480
481
  value.style.lineHeight = '24px';
481
- value.style.fontWeight = '500';
482
+ applyTextWeight(value, '500');
482
483
  });
483
484
  }
484
485
  }