@onekeyfe/react-native-native-list 3.0.179-alpha.2026101502 → 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
@@ -66,6 +66,15 @@ namespace margelo::nitro::nativelist {
66
66
  static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* snapshotJson */)>("setSnapshotJson");
67
67
  method(_javaPart, jni::make_jstring(snapshotJson));
68
68
  }
69
+ std::string JHybridNativeListSpec::getFontFamiliesJson() {
70
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getFontFamiliesJson");
71
+ auto __result = method(_javaPart);
72
+ return __result->toStdString();
73
+ }
74
+ void JHybridNativeListSpec::setFontFamiliesJson(const std::string& fontFamiliesJson) {
75
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* fontFamiliesJson */)>("setFontFamiliesJson");
76
+ method(_javaPart, jni::make_jstring(fontFamiliesJson));
77
+ }
69
78
  std::string JHybridNativeListSpec::getContainerSlotHeightsJson() {
70
79
  static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getContainerSlotHeightsJson");
71
80
  auto __result = method(_javaPart);
@@ -75,24 +84,6 @@ namespace margelo::nitro::nativelist {
75
84
  static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* containerSlotHeightsJson */)>("setContainerSlotHeightsJson");
76
85
  method(_javaPart, jni::make_jstring(containerSlotHeightsJson));
77
86
  }
78
- bool JHybridNativeListSpec::getTopScrollEdgeHard() {
79
- static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("getTopScrollEdgeHard");
80
- auto __result = method(_javaPart);
81
- return static_cast<bool>(__result);
82
- }
83
- void JHybridNativeListSpec::setTopScrollEdgeHard(bool topScrollEdgeHard) {
84
- static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* topScrollEdgeHard */)>("setTopScrollEdgeHard");
85
- method(_javaPart, topScrollEdgeHard);
86
- }
87
- double JHybridNativeListSpec::getTopOverlayHeight() {
88
- static const auto method = _javaPart->javaClassStatic()->getMethod<double()>("getTopOverlayHeight");
89
- auto __result = method(_javaPart);
90
- return __result;
91
- }
92
- void JHybridNativeListSpec::setTopOverlayHeight(double topOverlayHeight) {
93
- static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* topOverlayHeight */)>("setTopOverlayHeight");
94
- method(_javaPart, topOverlayHeight);
95
- }
96
87
  std::string JHybridNativeListSpec::getScrollPositionThresholdsJson() {
97
88
  static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getScrollPositionThresholdsJson");
98
89
  auto __result = method(_javaPart);
@@ -52,12 +52,10 @@ namespace margelo::nitro::nativelist {
52
52
  // Properties
53
53
  std::string getSnapshotJson() override;
54
54
  void setSnapshotJson(const std::string& snapshotJson) override;
55
+ std::string getFontFamiliesJson() override;
56
+ void setFontFamiliesJson(const std::string& fontFamiliesJson) override;
55
57
  std::string getContainerSlotHeightsJson() override;
56
58
  void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) override;
57
- bool getTopScrollEdgeHard() override;
58
- void setTopScrollEdgeHard(bool topScrollEdgeHard) override;
59
- double getTopOverlayHeight() override;
60
- void setTopOverlayHeight(double topOverlayHeight) override;
61
59
  std::string getScrollPositionThresholdsJson() override;
62
60
  void setScrollPositionThresholdsJson(const std::string& scrollPositionThresholdsJson) override;
63
61
  std::optional<std::function<void(bool /* isBeyondThreshold */)>> getOnScrollPositionThresholdChange() override;
@@ -58,21 +58,16 @@ void JHybridNativeListStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
58
58
  : !newProps->snapshotJson.hasSameValue(oldProps->snapshotJson)) {
59
59
  hybridView->setSnapshotJson(newProps->snapshotJson.get());
60
60
  }
61
+ if (oldProps == nullptr
62
+ ? newProps->fontFamiliesJson.isProvided()
63
+ : !newProps->fontFamiliesJson.hasSameValue(oldProps->fontFamiliesJson)) {
64
+ hybridView->setFontFamiliesJson(newProps->fontFamiliesJson.get());
65
+ }
61
66
  if (oldProps == nullptr
62
67
  ? newProps->containerSlotHeightsJson.isProvided()
63
68
  : !newProps->containerSlotHeightsJson.hasSameValue(oldProps->containerSlotHeightsJson)) {
64
69
  hybridView->setContainerSlotHeightsJson(newProps->containerSlotHeightsJson.get());
65
70
  }
66
- if (oldProps == nullptr
67
- ? newProps->topScrollEdgeHard.isProvided()
68
- : !newProps->topScrollEdgeHard.hasSameValue(oldProps->topScrollEdgeHard)) {
69
- hybridView->setTopScrollEdgeHard(newProps->topScrollEdgeHard.get());
70
- }
71
- if (oldProps == nullptr
72
- ? newProps->topOverlayHeight.isProvided()
73
- : !newProps->topOverlayHeight.hasSameValue(oldProps->topOverlayHeight)) {
74
- hybridView->setTopOverlayHeight(newProps->topOverlayHeight.get());
75
- }
76
71
  if (oldProps == nullptr
77
72
  ? newProps->scrollPositionThresholdsJson.isProvided()
78
73
  : !newProps->scrollPositionThresholdsJson.hasSameValue(oldProps->scrollPositionThresholdsJson)) {
@@ -37,19 +37,13 @@ abstract class HybridNativeListSpec: HybridView() {
37
37
  @get:Keep
38
38
  @set:DoNotStrip
39
39
  @set:Keep
40
- abstract var containerSlotHeightsJson: String
40
+ abstract var fontFamiliesJson: String
41
41
 
42
42
  @get:DoNotStrip
43
43
  @get:Keep
44
44
  @set:DoNotStrip
45
45
  @set:Keep
46
- abstract var topScrollEdgeHard: Boolean
47
-
48
- @get:DoNotStrip
49
- @get:Keep
50
- @set:DoNotStrip
51
- @set:Keep
52
- abstract var topOverlayHeight: Double
46
+ abstract var containerSlotHeightsJson: String
53
47
 
54
48
  @get:DoNotStrip
55
49
  @get:Keep
@@ -79,6 +79,13 @@ namespace margelo::nitro::nativelist {
79
79
  inline void setSnapshotJson(const std::string& snapshotJson) noexcept override {
80
80
  _swiftPart.setSnapshotJson(snapshotJson);
81
81
  }
82
+ inline std::string getFontFamiliesJson() noexcept override {
83
+ auto __result = _swiftPart.getFontFamiliesJson();
84
+ return __result;
85
+ }
86
+ inline void setFontFamiliesJson(const std::string& fontFamiliesJson) noexcept override {
87
+ _swiftPart.setFontFamiliesJson(fontFamiliesJson);
88
+ }
82
89
  inline std::string getContainerSlotHeightsJson() noexcept override {
83
90
  auto __result = _swiftPart.getContainerSlotHeightsJson();
84
91
  return __result;
@@ -86,18 +93,6 @@ namespace margelo::nitro::nativelist {
86
93
  inline void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) noexcept override {
87
94
  _swiftPart.setContainerSlotHeightsJson(containerSlotHeightsJson);
88
95
  }
89
- inline bool getTopScrollEdgeHard() noexcept override {
90
- return _swiftPart.getTopScrollEdgeHard();
91
- }
92
- inline void setTopScrollEdgeHard(bool topScrollEdgeHard) noexcept override {
93
- _swiftPart.setTopScrollEdgeHard(std::forward<decltype(topScrollEdgeHard)>(topScrollEdgeHard));
94
- }
95
- inline double getTopOverlayHeight() noexcept override {
96
- return _swiftPart.getTopOverlayHeight();
97
- }
98
- inline void setTopOverlayHeight(double topOverlayHeight) noexcept override {
99
- _swiftPart.setTopOverlayHeight(std::forward<decltype(topOverlayHeight)>(topOverlayHeight));
100
- }
101
96
  inline std::string getScrollPositionThresholdsJson() noexcept override {
102
97
  auto __result = _swiftPart.getScrollPositionThresholdsJson();
103
98
  return __result;
@@ -118,24 +118,18 @@ using namespace margelo::nitro::nativelist::views;
118
118
  : !newViewProps.snapshotJson.hasSameValue(oldViewProps->snapshotJson)) {
119
119
  swiftPart.setSnapshotJson(newViewProps.snapshotJson.get());
120
120
  }
121
+ // fontFamiliesJson: string
122
+ if (oldViewProps == nullptr
123
+ ? newViewProps.fontFamiliesJson.isProvided()
124
+ : !newViewProps.fontFamiliesJson.hasSameValue(oldViewProps->fontFamiliesJson)) {
125
+ swiftPart.setFontFamiliesJson(newViewProps.fontFamiliesJson.get());
126
+ }
121
127
  // containerSlotHeightsJson: string
122
128
  if (oldViewProps == nullptr
123
129
  ? newViewProps.containerSlotHeightsJson.isProvided()
124
130
  : !newViewProps.containerSlotHeightsJson.hasSameValue(oldViewProps->containerSlotHeightsJson)) {
125
131
  swiftPart.setContainerSlotHeightsJson(newViewProps.containerSlotHeightsJson.get());
126
132
  }
127
- // topScrollEdgeHard: boolean
128
- if (oldViewProps == nullptr
129
- ? newViewProps.topScrollEdgeHard.isProvided()
130
- : !newViewProps.topScrollEdgeHard.hasSameValue(oldViewProps->topScrollEdgeHard)) {
131
- swiftPart.setTopScrollEdgeHard(newViewProps.topScrollEdgeHard.get());
132
- }
133
- // topOverlayHeight: number
134
- if (oldViewProps == nullptr
135
- ? newViewProps.topOverlayHeight.isProvided()
136
- : !newViewProps.topOverlayHeight.hasSameValue(oldViewProps->topOverlayHeight)) {
137
- swiftPart.setTopOverlayHeight(newViewProps.topOverlayHeight.get());
138
- }
139
133
  // scrollPositionThresholdsJson: string
140
134
  if (oldViewProps == nullptr
141
135
  ? newViewProps.scrollPositionThresholdsJson.isProvided()
@@ -11,9 +11,8 @@ import NitroModules
11
11
  public protocol HybridNativeListSpec_protocol: HybridObject, HybridView {
12
12
  // Properties
13
13
  var snapshotJson: String { get set }
14
+ var fontFamiliesJson: String { get set }
14
15
  var containerSlotHeightsJson: String { get set }
15
- var topScrollEdgeHard: Bool { get set }
16
- var topOverlayHeight: Double { get set }
17
16
  var scrollPositionThresholdsJson: String { get set }
18
17
  var onScrollPositionThresholdChange: ((_ isBeyondThreshold: Bool) -> Void)? { get set }
19
18
  var keyboardDismissMode: NativeListKeyboardDismissMode { get set }
@@ -132,36 +132,25 @@ open class HybridNativeListSpec_cxx {
132
132
  }
133
133
  }
134
134
 
135
- public final var containerSlotHeightsJson: std.string {
136
- @inline(__always)
137
- get {
138
- return std.string(self.__implementation.containerSlotHeightsJson)
139
- }
140
- @inline(__always)
141
- set {
142
- self.__implementation.containerSlotHeightsJson = String(newValue)
143
- }
144
- }
145
-
146
- public final var topScrollEdgeHard: Bool {
135
+ public final var fontFamiliesJson: std.string {
147
136
  @inline(__always)
148
137
  get {
149
- return self.__implementation.topScrollEdgeHard
138
+ return std.string(self.__implementation.fontFamiliesJson)
150
139
  }
151
140
  @inline(__always)
152
141
  set {
153
- self.__implementation.topScrollEdgeHard = newValue
142
+ self.__implementation.fontFamiliesJson = String(newValue)
154
143
  }
155
144
  }
156
145
 
157
- public final var topOverlayHeight: Double {
146
+ public final var containerSlotHeightsJson: std.string {
158
147
  @inline(__always)
159
148
  get {
160
- return self.__implementation.topOverlayHeight
149
+ return std.string(self.__implementation.containerSlotHeightsJson)
161
150
  }
162
151
  @inline(__always)
163
152
  set {
164
- self.__implementation.topOverlayHeight = newValue
153
+ self.__implementation.containerSlotHeightsJson = String(newValue)
165
154
  }
166
155
  }
167
156
 
@@ -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,
@@ -6,9 +6,8 @@ import type { HybridView, HybridViewMethods, HybridViewProps } from 'react-nativ
6
6
  */
7
7
  export interface NativeListNativeProps extends HybridViewProps {
8
8
  snapshotJson: string;
9
+ fontFamiliesJson: string;
9
10
  containerSlotHeightsJson: string;
10
- topScrollEdgeHard: boolean;
11
- topOverlayHeight: number;
12
11
  scrollPositionThresholdsJson: string;
13
12
  onScrollPositionThresholdChange?: (isBeyondThreshold: boolean) => void;
14
13
  keyboardDismissMode: NativeListKeyboardDismissMode;
@@ -79,10 +79,6 @@ export type NativeListProps = Omit<ViewProps, 'children'> & Readonly<{
79
79
  listHeader?: ReactNode;
80
80
  listFooter?: ReactNode;
81
81
  listEmpty?: ReactNode;
82
- /** Fixed overlay above scrolling rows on iOS 26 and newer. */
83
- topOverlay?: ReactNode;
84
- /** Enables UIKit's hard top scroll-edge effect on iOS 26 and newer. */
85
- topScrollEdgeEffect?: 'hard';
86
82
  /** Web only. Defaults to true and is ignored by the native host. */
87
83
  webVirtualizationEnabled?: boolean;
88
84
  /** Web only. Hosts the section index inside this container. */
@@ -0,0 +1,10 @@
1
+ export type NativeListFontFamilies = Readonly<{
2
+ regular?: string;
3
+ medium?: string;
4
+ semibold?: string;
5
+ bold?: string;
6
+ }>;
7
+ /** Configure names already provided by the host in this JavaScript runtime. */
8
+ export declare function configureNativeListFonts(families: NativeListFontFamilies): void;
9
+ export declare function useNativeListFontFamiliesJson(): string;
10
+ //# sourceMappingURL=fonts.d.ts.map
@@ -4,4 +4,6 @@ export type * from './models';
4
4
  export { applyRowPatches, serializePatches, serializeSnapshot, validatePatches, validateSnapshot, } from './validation';
5
5
  export { checkboxStateForKeys, checkboxStateForSection, isSelectableRow, reduceSelection, selectionStateFromSnapshot, } from './selection';
6
6
  export type { SelectionAction, SelectionResult, SelectionState, } from './selection';
7
+ export { configureNativeListFonts } from './fonts';
8
+ export type { NativeListFontFamilies } from './fonts';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -144,7 +144,10 @@ export declare class NativeListWebEngine {
144
144
  private measuredRendererHeights;
145
145
  private notifyScrollCommandAccepted;
146
146
  private readonly handlePagerScrollCommandCancel;
147
- constructor(host: HTMLElement, snapshot: NativeListSnapshot, callbacks: NativeListWebCallbacks, virtualizationEnabled?: boolean, sectionIndexContainer?: HTMLElement | null);
147
+ constructor(host: HTMLElement, snapshot: NativeListSnapshot, callbacks: NativeListWebCallbacks, virtualizationEnabled?: boolean, sectionIndexContainer?: HTMLElement | null, fontFamiliesJson?: string);
148
+ private fontFamiliesJson;
149
+ private applyFontFamilies;
150
+ setFontFamiliesJson(json: string): void;
148
151
  updateCallbacks(callbacks: NativeListWebCallbacks): void;
149
152
  setVirtualizationEnabled(enabled: boolean): void;
150
153
  applySnapshot(snapshot: NativeListSnapshot): void;
@@ -6,4 +6,5 @@ export declare function applyValueSegments(element: HTMLElement, segments: reado
6
6
  export declare function applyTextLayout(element: HTMLElement, style: NativeListTextStyle, defaultLines?: number): void;
7
7
  export declare function applyTextStyleToSlot(element: HTMLElement, style: NativeListTextStyle, defaultLines?: number): void;
8
8
  export declare function fontWeight(value: NativeListTextStyle['fontWeight'] | undefined, fallback: number): number;
9
+ export declare function applyTextWeight(element: HTMLElement, weight: string | number): void;
9
10
  //# sourceMappingURL=RowText.d.ts.map
@@ -66,6 +66,15 @@ namespace margelo::nitro::nativelist {
66
66
  static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* snapshotJson */)>("setSnapshotJson");
67
67
  method(_javaPart, jni::make_jstring(snapshotJson));
68
68
  }
69
+ std::string JHybridNativeListSpec::getFontFamiliesJson() {
70
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getFontFamiliesJson");
71
+ auto __result = method(_javaPart);
72
+ return __result->toStdString();
73
+ }
74
+ void JHybridNativeListSpec::setFontFamiliesJson(const std::string& fontFamiliesJson) {
75
+ static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* fontFamiliesJson */)>("setFontFamiliesJson");
76
+ method(_javaPart, jni::make_jstring(fontFamiliesJson));
77
+ }
69
78
  std::string JHybridNativeListSpec::getContainerSlotHeightsJson() {
70
79
  static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getContainerSlotHeightsJson");
71
80
  auto __result = method(_javaPart);
@@ -75,24 +84,6 @@ namespace margelo::nitro::nativelist {
75
84
  static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* containerSlotHeightsJson */)>("setContainerSlotHeightsJson");
76
85
  method(_javaPart, jni::make_jstring(containerSlotHeightsJson));
77
86
  }
78
- bool JHybridNativeListSpec::getTopScrollEdgeHard() {
79
- static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("getTopScrollEdgeHard");
80
- auto __result = method(_javaPart);
81
- return static_cast<bool>(__result);
82
- }
83
- void JHybridNativeListSpec::setTopScrollEdgeHard(bool topScrollEdgeHard) {
84
- static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* topScrollEdgeHard */)>("setTopScrollEdgeHard");
85
- method(_javaPart, topScrollEdgeHard);
86
- }
87
- double JHybridNativeListSpec::getTopOverlayHeight() {
88
- static const auto method = _javaPart->javaClassStatic()->getMethod<double()>("getTopOverlayHeight");
89
- auto __result = method(_javaPart);
90
- return __result;
91
- }
92
- void JHybridNativeListSpec::setTopOverlayHeight(double topOverlayHeight) {
93
- static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* topOverlayHeight */)>("setTopOverlayHeight");
94
- method(_javaPart, topOverlayHeight);
95
- }
96
87
  std::string JHybridNativeListSpec::getScrollPositionThresholdsJson() {
97
88
  static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getScrollPositionThresholdsJson");
98
89
  auto __result = method(_javaPart);
@@ -52,12 +52,10 @@ namespace margelo::nitro::nativelist {
52
52
  // Properties
53
53
  std::string getSnapshotJson() override;
54
54
  void setSnapshotJson(const std::string& snapshotJson) override;
55
+ std::string getFontFamiliesJson() override;
56
+ void setFontFamiliesJson(const std::string& fontFamiliesJson) override;
55
57
  std::string getContainerSlotHeightsJson() override;
56
58
  void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) override;
57
- bool getTopScrollEdgeHard() override;
58
- void setTopScrollEdgeHard(bool topScrollEdgeHard) override;
59
- double getTopOverlayHeight() override;
60
- void setTopOverlayHeight(double topOverlayHeight) override;
61
59
  std::string getScrollPositionThresholdsJson() override;
62
60
  void setScrollPositionThresholdsJson(const std::string& scrollPositionThresholdsJson) override;
63
61
  std::optional<std::function<void(bool /* isBeyondThreshold */)>> getOnScrollPositionThresholdChange() override;
@@ -58,21 +58,16 @@ void JHybridNativeListStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
58
58
  : !newProps->snapshotJson.hasSameValue(oldProps->snapshotJson)) {
59
59
  hybridView->setSnapshotJson(newProps->snapshotJson.get());
60
60
  }
61
+ if (oldProps == nullptr
62
+ ? newProps->fontFamiliesJson.isProvided()
63
+ : !newProps->fontFamiliesJson.hasSameValue(oldProps->fontFamiliesJson)) {
64
+ hybridView->setFontFamiliesJson(newProps->fontFamiliesJson.get());
65
+ }
61
66
  if (oldProps == nullptr
62
67
  ? newProps->containerSlotHeightsJson.isProvided()
63
68
  : !newProps->containerSlotHeightsJson.hasSameValue(oldProps->containerSlotHeightsJson)) {
64
69
  hybridView->setContainerSlotHeightsJson(newProps->containerSlotHeightsJson.get());
65
70
  }
66
- if (oldProps == nullptr
67
- ? newProps->topScrollEdgeHard.isProvided()
68
- : !newProps->topScrollEdgeHard.hasSameValue(oldProps->topScrollEdgeHard)) {
69
- hybridView->setTopScrollEdgeHard(newProps->topScrollEdgeHard.get());
70
- }
71
- if (oldProps == nullptr
72
- ? newProps->topOverlayHeight.isProvided()
73
- : !newProps->topOverlayHeight.hasSameValue(oldProps->topOverlayHeight)) {
74
- hybridView->setTopOverlayHeight(newProps->topOverlayHeight.get());
75
- }
76
71
  if (oldProps == nullptr
77
72
  ? newProps->scrollPositionThresholdsJson.isProvided()
78
73
  : !newProps->scrollPositionThresholdsJson.hasSameValue(oldProps->scrollPositionThresholdsJson)) {
@@ -37,19 +37,13 @@ abstract class HybridNativeListSpec: HybridView() {
37
37
  @get:Keep
38
38
  @set:DoNotStrip
39
39
  @set:Keep
40
- abstract var containerSlotHeightsJson: String
40
+ abstract var fontFamiliesJson: String
41
41
 
42
42
  @get:DoNotStrip
43
43
  @get:Keep
44
44
  @set:DoNotStrip
45
45
  @set:Keep
46
- abstract var topScrollEdgeHard: Boolean
47
-
48
- @get:DoNotStrip
49
- @get:Keep
50
- @set:DoNotStrip
51
- @set:Keep
52
- abstract var topOverlayHeight: Double
46
+ abstract var containerSlotHeightsJson: String
53
47
 
54
48
  @get:DoNotStrip
55
49
  @get:Keep
@@ -79,6 +79,13 @@ namespace margelo::nitro::nativelist {
79
79
  inline void setSnapshotJson(const std::string& snapshotJson) noexcept override {
80
80
  _swiftPart.setSnapshotJson(snapshotJson);
81
81
  }
82
+ inline std::string getFontFamiliesJson() noexcept override {
83
+ auto __result = _swiftPart.getFontFamiliesJson();
84
+ return __result;
85
+ }
86
+ inline void setFontFamiliesJson(const std::string& fontFamiliesJson) noexcept override {
87
+ _swiftPart.setFontFamiliesJson(fontFamiliesJson);
88
+ }
82
89
  inline std::string getContainerSlotHeightsJson() noexcept override {
83
90
  auto __result = _swiftPart.getContainerSlotHeightsJson();
84
91
  return __result;
@@ -86,18 +93,6 @@ namespace margelo::nitro::nativelist {
86
93
  inline void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) noexcept override {
87
94
  _swiftPart.setContainerSlotHeightsJson(containerSlotHeightsJson);
88
95
  }
89
- inline bool getTopScrollEdgeHard() noexcept override {
90
- return _swiftPart.getTopScrollEdgeHard();
91
- }
92
- inline void setTopScrollEdgeHard(bool topScrollEdgeHard) noexcept override {
93
- _swiftPart.setTopScrollEdgeHard(std::forward<decltype(topScrollEdgeHard)>(topScrollEdgeHard));
94
- }
95
- inline double getTopOverlayHeight() noexcept override {
96
- return _swiftPart.getTopOverlayHeight();
97
- }
98
- inline void setTopOverlayHeight(double topOverlayHeight) noexcept override {
99
- _swiftPart.setTopOverlayHeight(std::forward<decltype(topOverlayHeight)>(topOverlayHeight));
100
- }
101
96
  inline std::string getScrollPositionThresholdsJson() noexcept override {
102
97
  auto __result = _swiftPart.getScrollPositionThresholdsJson();
103
98
  return __result;
@@ -118,24 +118,18 @@ using namespace margelo::nitro::nativelist::views;
118
118
  : !newViewProps.snapshotJson.hasSameValue(oldViewProps->snapshotJson)) {
119
119
  swiftPart.setSnapshotJson(newViewProps.snapshotJson.get());
120
120
  }
121
+ // fontFamiliesJson: string
122
+ if (oldViewProps == nullptr
123
+ ? newViewProps.fontFamiliesJson.isProvided()
124
+ : !newViewProps.fontFamiliesJson.hasSameValue(oldViewProps->fontFamiliesJson)) {
125
+ swiftPart.setFontFamiliesJson(newViewProps.fontFamiliesJson.get());
126
+ }
121
127
  // containerSlotHeightsJson: string
122
128
  if (oldViewProps == nullptr
123
129
  ? newViewProps.containerSlotHeightsJson.isProvided()
124
130
  : !newViewProps.containerSlotHeightsJson.hasSameValue(oldViewProps->containerSlotHeightsJson)) {
125
131
  swiftPart.setContainerSlotHeightsJson(newViewProps.containerSlotHeightsJson.get());
126
132
  }
127
- // topScrollEdgeHard: boolean
128
- if (oldViewProps == nullptr
129
- ? newViewProps.topScrollEdgeHard.isProvided()
130
- : !newViewProps.topScrollEdgeHard.hasSameValue(oldViewProps->topScrollEdgeHard)) {
131
- swiftPart.setTopScrollEdgeHard(newViewProps.topScrollEdgeHard.get());
132
- }
133
- // topOverlayHeight: number
134
- if (oldViewProps == nullptr
135
- ? newViewProps.topOverlayHeight.isProvided()
136
- : !newViewProps.topOverlayHeight.hasSameValue(oldViewProps->topOverlayHeight)) {
137
- swiftPart.setTopOverlayHeight(newViewProps.topOverlayHeight.get());
138
- }
139
133
  // scrollPositionThresholdsJson: string
140
134
  if (oldViewProps == nullptr
141
135
  ? newViewProps.scrollPositionThresholdsJson.isProvided()
@@ -11,9 +11,8 @@ import NitroModules
11
11
  public protocol HybridNativeListSpec_protocol: HybridObject, HybridView {
12
12
  // Properties
13
13
  var snapshotJson: String { get set }
14
+ var fontFamiliesJson: String { get set }
14
15
  var containerSlotHeightsJson: String { get set }
15
- var topScrollEdgeHard: Bool { get set }
16
- var topOverlayHeight: Double { get set }
17
16
  var scrollPositionThresholdsJson: String { get set }
18
17
  var onScrollPositionThresholdChange: ((_ isBeyondThreshold: Bool) -> Void)? { get set }
19
18
  var keyboardDismissMode: NativeListKeyboardDismissMode { get set }
@@ -132,36 +132,25 @@ open class HybridNativeListSpec_cxx {
132
132
  }
133
133
  }
134
134
 
135
- public final var containerSlotHeightsJson: std.string {
136
- @inline(__always)
137
- get {
138
- return std.string(self.__implementation.containerSlotHeightsJson)
139
- }
140
- @inline(__always)
141
- set {
142
- self.__implementation.containerSlotHeightsJson = String(newValue)
143
- }
144
- }
145
-
146
- public final var topScrollEdgeHard: Bool {
135
+ public final var fontFamiliesJson: std.string {
147
136
  @inline(__always)
148
137
  get {
149
- return self.__implementation.topScrollEdgeHard
138
+ return std.string(self.__implementation.fontFamiliesJson)
150
139
  }
151
140
  @inline(__always)
152
141
  set {
153
- self.__implementation.topScrollEdgeHard = newValue
142
+ self.__implementation.fontFamiliesJson = String(newValue)
154
143
  }
155
144
  }
156
145
 
157
- public final var topOverlayHeight: Double {
146
+ public final var containerSlotHeightsJson: std.string {
158
147
  @inline(__always)
159
148
  get {
160
- return self.__implementation.topOverlayHeight
149
+ return std.string(self.__implementation.containerSlotHeightsJson)
161
150
  }
162
151
  @inline(__always)
163
152
  set {
164
- self.__implementation.topOverlayHeight = newValue
153
+ self.__implementation.containerSlotHeightsJson = String(newValue)
165
154
  }
166
155
  }
167
156