@onekeyfe/react-native-native-list 6.7.0-5 → 6.7.0-50

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 (214) hide show
  1. package/README.md +312 -375
  2. package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
  3. package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +250 -9
  4. package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
  5. package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
  6. package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
  7. package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
  8. package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
  9. package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
  10. package/android/src/main/java/com/onekey/nativelist/NativeListGeneratedIcons.kt +47 -0
  11. package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
  12. package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +152 -33
  13. package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
  14. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPlaceholderView.kt +244 -0
  15. package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
  16. package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +32 -11
  17. package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
  18. package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
  19. package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -287
  20. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
  21. package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +7 -0
  22. package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
  23. package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
  24. package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
  25. package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1978 -136
  26. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
  27. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
  28. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
  29. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
  30. package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
  31. package/docs/ROW_TEMPLATES.md +74 -13
  32. package/docs/SPEC.md +1232 -16
  33. package/docs/STYLE_SPEC.md +14 -0
  34. package/ios/HybridNativeList.swift +21 -2
  35. package/ios/NativeListAccessoryStack.swift +237 -51
  36. package/ios/NativeListActivityDetailsView.swift +30 -11
  37. package/ios/NativeListActivityRenderer.swift +8 -2
  38. package/ios/NativeListButtonGroupRenderer.swift +89 -0
  39. package/ios/NativeListDataRowRenderer.swift +167 -30
  40. package/ios/NativeListDesignAssets.swift +13 -75
  41. package/ios/NativeListGeneratedIcons.swift +55 -0
  42. package/ios/NativeListIconBinding.swift +171 -0
  43. package/ios/NativeListIdentityRenderer.swift +256 -39
  44. package/ios/NativeListLeadingVisual.swift +127 -28
  45. package/ios/NativeListMarketRenderer.swift +120 -31
  46. package/ios/NativeListMediaPlaceholderView.swift +189 -0
  47. package/ios/NativeListMediaPreviewSlot.swift +122 -61
  48. package/ios/NativeListMediaTileRenderer.swift +15 -11
  49. package/ios/NativeListMessageRenderer.swift +34 -1
  50. package/ios/NativeListMetricCardRenderer.swift +4 -2
  51. package/ios/NativeListModels.swift +42 -2
  52. package/ios/NativeListRendererRegistry.swift +1 -0
  53. package/ios/NativeListResolvedText.swift +2 -1
  54. package/ios/NativeListRowHost.swift +14 -0
  55. package/ios/NativeListSectionHeaderRenderer.swift +100 -4
  56. package/ios/RNCNativeListView.swift +1093 -59
  57. package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
  58. package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
  59. package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
  60. package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
  61. package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
  62. package/ios/tests/NativeListLifecycleTests.swift +2915 -4
  63. package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
  64. package/ios/tests/NativeListMediaVisibilityTests.swift +26 -1
  65. package/ios/tests/NativeListSharedIconTests.swift +236 -0
  66. package/lib/module/NativeList.js +236 -38
  67. package/lib/module/NativeList.web.js +167 -46
  68. package/lib/module/index.js +1 -1
  69. package/lib/module/models.js +3 -0
  70. package/lib/module/selection.js +1 -1
  71. package/lib/module/validation.js +1246 -48
  72. package/lib/module/web/NativeListGeneratedIcons.js +31 -0
  73. package/lib/module/web/NativeListWebEngine.js +513 -275
  74. package/lib/module/web/templates/ActivityRowRenderer.js +12 -31
  75. package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
  76. package/lib/module/web/templates/DataRowRenderer.js +40 -5
  77. package/lib/module/web/templates/IdentityRowRenderer.js +158 -6
  78. package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
  79. package/lib/module/web/templates/MediaTileRowRenderer.js +84 -25
  80. package/lib/module/web/templates/MessageRowRenderer.js +18 -2
  81. package/lib/module/web/templates/RowContainerStyle.js +1 -0
  82. package/lib/module/web/templates/RowRendererRegistry.js +3 -0
  83. package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
  84. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  85. package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  86. package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  87. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  88. package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  89. package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  90. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  91. package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  92. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  93. package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  94. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  95. package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  96. package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  97. package/lib/typescript/src/NativeList.d.ts +3 -3
  98. package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
  99. package/lib/typescript/src/NativeList.types.d.ts +20 -2
  100. package/lib/typescript/src/index.d.ts +2 -2
  101. package/lib/typescript/src/models.d.ts +126 -17
  102. package/lib/typescript/src/validation.d.ts +20 -0
  103. package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
  104. package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
  105. package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
  106. package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
  107. package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +9 -3
  108. package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
  109. package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
  110. package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
  111. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
  112. package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
  113. package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
  114. package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
  115. package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
  116. package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
  117. package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
  118. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
  119. package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
  120. package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
  121. package/package.json +16 -10
  122. package/react-native-native-list.podspec +2 -6
  123. package/scripts/generate-icons.mjs +150 -0
  124. package/scripts/generate-icons.test.mjs +288 -0
  125. package/scripts/native-list-icons.json +260 -0
  126. package/src/NativeList.nitro.ts +2 -0
  127. package/src/NativeList.tsx +439 -91
  128. package/src/NativeList.types.ts +24 -2
  129. package/src/NativeList.web.tsx +295 -89
  130. package/src/index.ts +2 -0
  131. package/src/models.ts +263 -144
  132. package/src/selection.ts +1 -0
  133. package/src/validation.ts +3013 -152
  134. package/src/web/NativeListGeneratedIcons.ts +28 -0
  135. package/src/web/NativeListWebEngine.ts +818 -343
  136. package/src/web/templates/ActivityRowRenderer.ts +29 -59
  137. package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
  138. package/src/web/templates/DataRowRenderer.ts +93 -20
  139. package/src/web/templates/IdentityRowRenderer.ts +231 -6
  140. package/src/web/templates/MarketTableRowRenderer.ts +53 -33
  141. package/src/web/templates/MediaTileRowRenderer.ts +90 -28
  142. package/src/web/templates/MessageRowRenderer.ts +23 -7
  143. package/src/web/templates/RowContainerStyle.ts +2 -0
  144. package/src/web/templates/RowRendererRegistry.ts +11 -1
  145. package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
  146. package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
  147. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
  148. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
  149. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
  150. package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
  151. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
  152. package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
  153. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
  154. package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
  155. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
  156. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
  157. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
  158. package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
  159. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
  160. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
  161. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
  162. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
  163. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
  164. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
  165. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
  166. package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
  167. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
  168. package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
  169. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
  170. package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
  171. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
  172. package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
  173. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
  174. package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
  175. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
  176. package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
  177. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
  178. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
  179. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
  180. package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
  181. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
  182. package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
  183. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
  184. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
  185. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
  186. package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
  187. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
  188. package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
  189. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
  190. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
  191. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
  192. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
  193. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
  194. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
  195. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
  196. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
  197. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
  198. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
  199. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
  200. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
  201. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
  202. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
  203. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
  204. package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
  205. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
  206. package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
  207. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
  208. package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
  209. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
  210. package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
  211. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
  212. package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
  213. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
  214. package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
@@ -1,6 +1,7 @@
1
1
  import { useNativeListFontFamiliesJson } from './fonts';
2
2
  import React, {
3
3
  forwardRef,
4
+ useCallback,
4
5
  useEffect,
5
6
  useImperativeHandle,
6
7
  useMemo,
@@ -24,13 +25,18 @@ import type {
24
25
  import type {
25
26
  ActionAnchorInvalidatedEvent,
26
27
  ImageSource,
28
+ NativeListSnapshot,
27
29
  RowActionEvent,
28
30
  SelectionDeltaEvent,
29
31
  ReorderEvent,
30
32
  EndReachedEvent,
31
33
  VisibleRangeChangedEvent,
32
34
  } from './models';
33
- import type { NativeListProps, NativeListRef } from './NativeList.types';
35
+ import type {
36
+ NativeListProps,
37
+ NativeListRef,
38
+ StructuralTransitionSettledEvent,
39
+ } from './NativeList.types';
34
40
  import { isSelectableRow } from './selection';
35
41
  import {
36
42
  normalizeIndexScroll,
@@ -42,12 +48,19 @@ import {
42
48
  type NormalizedPositionScroll,
43
49
  } from './scrolling';
44
50
  import {
45
- applyRowPatches,
46
- serializePatches,
47
- serializeSnapshot,
51
+ applyOwnedNativePatches,
52
+ captureNativeListInput,
53
+ containNativeListInput,
54
+ emptyNativeListSnapshot,
55
+ ownValidatedNativeSnapshot,
56
+ validateSnapshot,
48
57
  } from './validation';
49
58
 
50
- export type { NativeListProps, NativeListRef } from './NativeList.types';
59
+ export type {
60
+ NativeListProps,
61
+ NativeListRef,
62
+ StructuralTransitionSettledEvent,
63
+ } from './NativeList.types';
51
64
  export type {
52
65
  ActionAnchorState,
53
66
  NativeListKeyboardDismissMode,
@@ -69,6 +82,8 @@ const NativeListHost = getHostComponent<
69
82
  NativeListNativeProps,
70
83
  NativeListMethods
71
84
  >('NativeList', () => NativeListConfig);
85
+ const clearedStructuralTransitionSettled = { f: undefined } as const;
86
+ const disclosureSlotMeasurementStyle = { alignSelf: 'stretch' } as const;
72
87
 
73
88
  export function preloadNativeListAvatarImages(
74
89
  sources: readonly ImageSource[]
@@ -98,10 +113,14 @@ function parsePayload<T>(payloadJson: string): T {
98
113
  export const NativeList = forwardRef<NativeListRef, NativeListProps>(
99
114
  function NativeList(
100
115
  {
101
- snapshot,
116
+ snapshot: inputSnapshot,
102
117
  listHeader,
103
118
  listFooter,
104
119
  listEmpty,
120
+ listSidecar,
121
+ listExpandedContent,
122
+ listStructureToggle,
123
+ sidecarLayout,
105
124
  topOverlay,
106
125
  topScrollEdgeEffect,
107
126
  scrollPositionThresholds,
@@ -117,6 +136,7 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
117
136
  onReorder,
118
137
  onEndReached,
119
138
  onVisibleRangeChanged,
139
+ onStructuralTransitionSettled,
120
140
  onScrollPositionThresholdChange,
121
141
  onRefresh,
122
142
  onScrollToIndexFailed,
@@ -128,28 +148,242 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
128
148
  },
129
149
  forwardedRef
130
150
  ) {
151
+ const snapshotRef = useRef<NativeListSnapshot>(emptyNativeListSnapshot());
152
+ const needsNativeSnapshotRef = useRef(false);
153
+ const renderedSnapshotRef = useRef<NativeListSnapshot | undefined>(
154
+ undefined
155
+ );
156
+ const initializedSnapshot = useRef(false);
157
+ const pendingDisclosureSnapshotRef = useRef<
158
+ | {
159
+ source: 'prop' | 'imperative';
160
+ input: NativeListSnapshot;
161
+ owned: NativeListSnapshot;
162
+ expandedEpoch: number;
163
+ toggleEpoch: number;
164
+ }
165
+ | undefined
166
+ >(undefined);
167
+ const previousPropInputRef = useRef(inputSnapshot);
168
+ const [pendingDisclosureRevision, setPendingDisclosureRevision] =
169
+ useState(0);
170
+ const disclosureSlotMounts = useRef({
171
+ expandedPresent: false,
172
+ togglePresent: false,
173
+ expandedEpoch: 0,
174
+ toggleEpoch: 0,
175
+ });
176
+ const expandedPresent = listExpandedContent != null;
177
+ const togglePresent = listStructureToggle != null;
178
+ if (disclosureSlotMounts.current.expandedPresent !== expandedPresent) {
179
+ disclosureSlotMounts.current.expandedPresent = expandedPresent;
180
+ disclosureSlotMounts.current.expandedEpoch += 1;
181
+ }
182
+ if (disclosureSlotMounts.current.togglePresent !== togglePresent) {
183
+ disclosureSlotMounts.current.togglePresent = togglePresent;
184
+ disclosureSlotMounts.current.toggleEpoch += 1;
185
+ }
186
+ const expandedEpoch = disclosureSlotMounts.current.expandedEpoch;
187
+ const toggleEpoch = disclosureSlotMounts.current.toggleEpoch;
188
+ const iosHeaderPresent = Platform.OS === 'ios' && listHeader != null;
189
+ const [slotMeasurements, setSlotMeasurements] = useState({
190
+ heights: [0, 0, 0, 0, 0, 0],
191
+ readyEpochs: [-1, -1, -1, -1, -1, -1],
192
+ iosHeaderPresent,
193
+ headerEpoch: 0,
194
+ });
195
+ if (slotMeasurements.iosHeaderPresent !== iosHeaderPresent) {
196
+ setSlotMeasurements({
197
+ ...slotMeasurements,
198
+ iosHeaderPresent,
199
+ headerEpoch: slotMeasurements.headerEpoch + 1,
200
+ });
201
+ }
202
+ const headerEpoch = slotMeasurements.headerEpoch;
203
+ const hasSidecar = listSidecar !== undefined;
204
+ const sidecarWidth = sidecarLayout?.width;
205
+ const sidecarGap = sidecarLayout?.gap;
206
+ const sidecarMaxContentWidth = sidecarLayout?.maxContentWidth;
207
+ const hasContainerSlots = Boolean(
208
+ listHeader ||
209
+ listEmpty ||
210
+ listFooter ||
211
+ listSidecar ||
212
+ listExpandedContent ||
213
+ listStructureToggle
214
+ );
215
+ const validateContainerConfiguration = useCallback(
216
+ (accepted: NativeListSnapshot) => {
217
+ if (hasContainerSlots && accepted.layout.orientation === 'horizontal')
218
+ throw new Error(
219
+ 'NativeList container slots require vertical orientation'
220
+ );
221
+ if (hasSidecar !== (sidecarWidth !== undefined))
222
+ throw new Error(
223
+ 'listSidecar and sidecarLayout must be supplied together'
224
+ );
225
+ if (sidecarWidth !== undefined) {
226
+ const width = sidecarWidth;
227
+ const gap = sidecarGap ?? NaN;
228
+ const maxContentWidth = sidecarMaxContentWidth ?? NaN;
229
+ if (
230
+ accepted.layout.kind !== 'linear' ||
231
+ !Number.isFinite(width) ||
232
+ width <= 0 ||
233
+ !Number.isFinite(gap) ||
234
+ gap < 0 ||
235
+ !Number.isFinite(maxContentWidth) ||
236
+ maxContentWidth <= width + gap
237
+ )
238
+ throw new Error('Invalid NativeList sidecar layout');
239
+ }
240
+ },
241
+ [
242
+ hasContainerSlots,
243
+ hasSidecar,
244
+ sidecarWidth,
245
+ sidecarGap,
246
+ sidecarMaxContentWidth,
247
+ ]
248
+ );
249
+ const prepareSnapshot = useCallback(
250
+ (next: NativeListSnapshot) => {
251
+ const accepted = validateSnapshot(captureNativeListInput(next));
252
+ validateContainerConfiguration(accepted);
253
+ return ownValidatedNativeSnapshot(accepted);
254
+ },
255
+ [validateContainerConfiguration]
256
+ );
257
+ const expandedReadyEpoch = slotMeasurements.readyEpochs[4];
258
+ const toggleReadyEpoch = slotMeasurements.readyEpochs[5];
259
+ const snapshot = useMemo(() => {
260
+ // Imperative pending snapshots use this revision to retry the readiness gate.
261
+ // eslint-disable-next-line no-void -- Reading this revision invalidates the readiness memo.
262
+ void pendingDisclosureRevision;
263
+ const propReplaced = previousPropInputRef.current !== inputSnapshot;
264
+ previousPropInputRef.current = inputSnapshot;
265
+ const pending = pendingDisclosureSnapshotRef.current;
266
+ const retained =
267
+ pending &&
268
+ !propReplaced &&
269
+ (pending.source === 'imperative' || pending.input === inputSnapshot) &&
270
+ pending.expandedEpoch === expandedEpoch &&
271
+ pending.toggleEpoch === toggleEpoch
272
+ ? pending
273
+ : undefined;
274
+ const candidate =
275
+ retained?.owned ??
276
+ (!propReplaced && initializedSnapshot.current
277
+ ? renderedSnapshotRef.current ?? snapshotRef.current
278
+ : containNativeListInput(() => prepareSnapshot(inputSnapshot)) ??
279
+ snapshotRef.current);
280
+ const acceptedCandidate =
281
+ !propReplaced && initializedSnapshot.current
282
+ ? containNativeListInput(() => {
283
+ validateContainerConfiguration(candidate);
284
+ return candidate;
285
+ })
286
+ : candidate;
287
+ if (!acceptedCandidate) {
288
+ pendingDisclosureSnapshotRef.current = undefined;
289
+ return renderedSnapshotRef.current ?? snapshotRef.current;
290
+ }
291
+ const transitionId = acceptedCandidate.structuralTransition?.id;
292
+ const newDisclosureCommand =
293
+ initializedSnapshot.current &&
294
+ acceptedCandidate.disclosure !== undefined &&
295
+ transitionId !== undefined &&
296
+ transitionId !== snapshotRef.current.structuralTransition?.id;
297
+ if (
298
+ newDisclosureCommand &&
299
+ ((expandedPresent && expandedReadyEpoch !== expandedEpoch) ||
300
+ (togglePresent && toggleReadyEpoch !== toggleEpoch))
301
+ ) {
302
+ pendingDisclosureSnapshotRef.current = retained ?? {
303
+ source: 'prop',
304
+ input: inputSnapshot,
305
+ owned: acceptedCandidate,
306
+ expandedEpoch,
307
+ toggleEpoch,
308
+ };
309
+ return snapshotRef.current;
310
+ }
311
+ pendingDisclosureSnapshotRef.current = undefined;
312
+ return acceptedCandidate;
313
+ }, [
314
+ inputSnapshot,
315
+ prepareSnapshot,
316
+ validateContainerConfiguration,
317
+ expandedPresent,
318
+ togglePresent,
319
+ expandedEpoch,
320
+ toggleEpoch,
321
+ expandedReadyEpoch,
322
+ toggleReadyEpoch,
323
+ pendingDisclosureRevision,
324
+ ]);
325
+ renderedSnapshotRef.current = snapshot;
131
326
  const fontFamiliesJson = useNativeListFontFamiliesJson();
132
- const [slotHeights, setSlotHeights] = useState([0, 0, 0]);
327
+ const slotHeights = slotMeasurements.heights;
328
+ const [viewportWidth, setViewportWidth] = useState(0);
133
329
  const [topOverlayHeight, setTopOverlayHeight] = useState(0);
134
330
  const hasTopOverlay =
135
331
  Platform?.OS === 'ios' &&
136
332
  parseInt(String(Platform.Version), 10) >= 26 &&
137
333
  (topScrollEdgeEffect === 'hard' || topScrollEdgeEffect === 'soft') &&
138
334
  topOverlay != null;
139
- const containerSlotHeightsJson = JSON.stringify(slotHeights);
140
- const slotInset =
335
+ const containerSlotHeightsJson = JSON.stringify(
336
+ Platform.OS === 'ios' &&
337
+ (!iosHeaderPresent || slotMeasurements.readyEpochs[0] !== headerEpoch)
338
+ ? [iosHeaderPresent ? null : 0, ...slotHeights.slice(1)]
339
+ : slotHeights
340
+ );
341
+ const defaultSlotInset =
141
342
  snapshot.layout.contentPaddingHorizontal ??
142
343
  snapshot.layout.contentPadding ??
143
344
  0;
144
- if (
145
- snapshot.layout.orientation === 'horizontal' &&
146
- (listHeader || listEmpty || listFooter)
147
- ) {
148
- throw new Error(
149
- 'NativeList container slots require vertical orientation'
150
- );
151
- }
152
- const slotContents = [listHeader, listEmpty, listFooter];
345
+ const bandWidth = sidecarLayout
346
+ ? Math.min(viewportWidth, sidecarLayout.maxContentWidth)
347
+ : 0;
348
+ const slotInset = sidecarLayout
349
+ ? Math.max(0, (viewportWidth - bandWidth) / 2) + defaultSlotInset
350
+ : defaultSlotInset;
351
+ const sidecarSpace = sidecarLayout
352
+ ? sidecarLayout.width + sidecarLayout.gap
353
+ : 0;
354
+ const slotContents = [
355
+ listHeader,
356
+ listEmpty,
357
+ listFooter,
358
+ listSidecar,
359
+ listExpandedContent,
360
+ listStructureToggle,
361
+ ];
362
+ const recordSlotLayout = (index: number, height: number, epoch: number) => {
363
+ if (
364
+ (index === 4 && epoch !== disclosureSlotMounts.current.expandedEpoch) ||
365
+ (index === 5 && epoch !== disclosureSlotMounts.current.toggleEpoch)
366
+ ) {
367
+ return;
368
+ }
369
+ setSlotMeasurements((previous) => {
370
+ if (index === 0 && epoch !== previous.headerEpoch) return previous;
371
+ if (
372
+ previous.heights[index] === height &&
373
+ previous.readyEpochs[index] === epoch
374
+ ) {
375
+ return previous;
376
+ }
377
+ const heights = [...previous.heights];
378
+ const readyEpochs = [...previous.readyEpochs];
379
+ heights[index] = height;
380
+ readyEpochs[index] = epoch;
381
+ return { ...previous, heights, readyEpochs };
382
+ });
383
+ };
384
+ const sidecarLayoutJson = sidecarLayout
385
+ ? JSON.stringify(sidecarLayout)
386
+ : '';
153
387
  const normalizedKeyboardShouldPersistTaps =
154
388
  keyboardShouldPersistTaps === true
155
389
  ? 'always'
@@ -164,6 +398,7 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
164
398
  onReorder,
165
399
  onEndReached,
166
400
  onVisibleRangeChanged,
401
+ onStructuralTransitionSettled,
167
402
  onScrollPositionThresholdChange,
168
403
  onRefresh,
169
404
  onScrollToIndexFailed,
@@ -175,37 +410,45 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
175
410
  onReorder,
176
411
  onEndReached,
177
412
  onVisibleRangeChanged,
413
+ onStructuralTransitionSettled,
178
414
  onScrollPositionThresholdChange,
179
415
  onRefresh,
180
416
  onScrollToIndexFailed,
181
417
  };
182
- const scrollPositionThresholdsJson = useMemo(() => {
183
- if (
184
- !scrollPositionThresholds ||
185
- scrollPositionThresholds.enabled === false
186
- )
187
- return '';
188
- const { start, end } = scrollPositionThresholds;
189
- if (
190
- !Number.isFinite(start) ||
191
- !Number.isFinite(end) ||
192
- start < 0 ||
193
- end <= start
194
- ) {
195
- throw new Error(
196
- 'scrollPositionThresholds requires 0 <= start < end and finite values'
197
- );
198
- }
199
- return JSON.stringify({ start, end });
200
- }, [scrollPositionThresholds]);
201
- const snapshotJson = useMemo(() => serializeSnapshot(snapshot), [snapshot]);
202
- const snapshotRef = useRef(snapshot);
418
+ const scrollPositionThresholdsJson = useMemo(
419
+ () =>
420
+ containNativeListInput(() => {
421
+ if (
422
+ !scrollPositionThresholds ||
423
+ scrollPositionThresholds.enabled === false
424
+ )
425
+ return '';
426
+ const { start, end } = scrollPositionThresholds;
427
+ if (
428
+ !Number.isFinite(start) ||
429
+ !Number.isFinite(end) ||
430
+ start < 0 ||
431
+ end <= start
432
+ ) {
433
+ throw new Error(
434
+ 'scrollPositionThresholds requires 0 <= start < end and finite values'
435
+ );
436
+ }
437
+ return JSON.stringify({ start, end });
438
+ }) ?? '',
439
+ [scrollPositionThresholds]
440
+ );
441
+ const snapshotJson = useMemo(() => JSON.stringify(snapshot), [snapshot]);
203
442
  const previousSnapshotJsonRef = useRef(snapshotJson);
204
443
  const snapshotChanged = previousSnapshotJsonRef.current !== snapshotJson;
205
444
  if (snapshotChanged) {
206
445
  snapshotRef.current = snapshot;
207
446
  previousSnapshotJsonRef.current = snapshotJson;
208
447
  }
448
+ if (!initializedSnapshot.current) {
449
+ snapshotRef.current = snapshot;
450
+ initializedSnapshot.current = true;
451
+ }
209
452
  // OneKey patch: range events already cross the bridge only when row indices
210
453
  // change. Prefetch is optional work; scrolling and visible loads stay native.
211
454
  const avatarQueueRef = useRef<NativeAvatarPrefetchQueue | null>(null);
@@ -260,26 +503,28 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
260
503
  }>
261
504
  | undefined
262
505
  >(
263
- initialScrollIndex === undefined && initialScrollKey === undefined
264
- ? undefined
265
- : initialScrollIndex !== undefined
266
- ? normalizeIndexScroll({
267
- index: initialScrollIndex,
268
- animated: false,
269
- viewPosition: initialScrollViewPosition,
270
- viewOffset: initialScrollViewOffset,
271
- })
272
- : {
273
- key: initialScrollKey,
274
- scroll: normalizePositionScroll(
275
- {
276
- animated: false,
277
- viewPosition: initialScrollViewPosition,
278
- viewOffset: initialScrollViewOffset,
279
- },
280
- 'start'
281
- ),
282
- }
506
+ containNativeListInput(() =>
507
+ initialScrollIndex === undefined && initialScrollKey === undefined
508
+ ? undefined
509
+ : initialScrollIndex !== undefined
510
+ ? normalizeIndexScroll({
511
+ index: initialScrollIndex,
512
+ animated: false,
513
+ viewPosition: initialScrollViewPosition,
514
+ viewOffset: initialScrollViewOffset,
515
+ })
516
+ : {
517
+ key: initialScrollKey,
518
+ scroll: normalizePositionScroll(
519
+ {
520
+ animated: false,
521
+ viewPosition: initialScrollViewPosition,
522
+ viewOffset: initialScrollViewOffset,
523
+ },
524
+ 'start'
525
+ ),
526
+ }
527
+ )
283
528
  );
284
529
  const didApplyInitialScroll = useRef(false);
285
530
 
@@ -337,45 +582,96 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
337
582
 
338
583
  useImperativeHandle(forwardedRef, () => ({
339
584
  applySnapshot(nextSnapshot) {
340
- const nextSnapshotJson = serializeSnapshot(nextSnapshot);
341
- nativeRef.current?.applySnapshot(nextSnapshotJson);
342
- snapshotRef.current = nextSnapshot;
343
- if (nativeRef.current && avatarLifecycle.current !== 'unmounted') {
344
- avatarModelRef.current?.replaceSnapshot(nextSnapshot.rows);
585
+ const accepted = containNativeListInput(() =>
586
+ prepareSnapshot(nextSnapshot)
587
+ );
588
+ if (!accepted) return;
589
+ const transitionId = accepted.structuralTransition?.id;
590
+ const waitsForSlots =
591
+ accepted.disclosure !== undefined &&
592
+ transitionId !== undefined &&
593
+ transitionId !== snapshotRef.current.structuralTransition?.id &&
594
+ ((expandedPresent &&
595
+ slotMeasurements.readyEpochs[4] !== expandedEpoch) ||
596
+ (togglePresent && slotMeasurements.readyEpochs[5] !== toggleEpoch));
597
+ if (waitsForSlots) {
598
+ pendingDisclosureSnapshotRef.current = {
599
+ source: 'imperative',
600
+ input: nextSnapshot,
601
+ owned: accepted,
602
+ expandedEpoch,
603
+ toggleEpoch,
604
+ };
605
+ setPendingDisclosureRevision((value) => value + 1);
606
+ return;
607
+ }
608
+ pendingDisclosureSnapshotRef.current = undefined;
609
+ const native = nativeRef.current;
610
+ if (native) native.applySnapshot(JSON.stringify(accepted));
611
+ snapshotRef.current = accepted;
612
+ needsNativeSnapshotRef.current = !native;
613
+ if (native && avatarLifecycle.current !== 'unmounted') {
614
+ avatarModelRef.current?.replaceSnapshot(accepted.rows);
345
615
  updateAvatarPrefetchRef.current();
346
616
  }
347
617
  },
348
618
  applyPatches(patches) {
349
- if (patches.length === 0) return;
350
- const nextSnapshot = applyRowPatches(snapshotRef.current, patches);
619
+ const pending = pendingDisclosureSnapshotRef.current;
620
+ const accepted = containNativeListInput(() =>
621
+ applyOwnedNativePatches(
622
+ pending?.owned ?? snapshotRef.current,
623
+ patches
624
+ )
625
+ );
626
+ if (!accepted || accepted.patches.length === 0) return;
627
+ const nextSnapshot = accepted.snapshot;
628
+ if (pending) {
629
+ pendingDisclosureSnapshotRef.current = {
630
+ ...pending,
631
+ owned: nextSnapshot,
632
+ };
633
+ return;
634
+ }
351
635
  const native = nativeRef.current;
352
- const dispatch = native
353
- ? () => {
354
- native.applyPatches(serializePatches(patches));
355
- snapshotRef.current = nextSnapshot;
356
- }
357
- : undefined;
636
+ if (!native) {
637
+ snapshotRef.current = nextSnapshot;
638
+ needsNativeSnapshotRef.current = true;
639
+ return;
640
+ }
641
+ const dispatch = () => {
642
+ native.applyPatches(accepted.json);
643
+ snapshotRef.current = nextSnapshot;
644
+ };
358
645
  if (avatarLifecycle.current === 'unmounted') {
359
646
  dispatch?.();
360
647
  return;
361
648
  }
362
- if (avatarModelRef.current?.applyPatches(patches, dispatch))
649
+ if (avatarModelRef.current?.applyPatches(accepted.patches, dispatch))
363
650
  updateAvatarPrefetchRef.current();
364
651
  },
365
652
  reconcileSelection(selectedKeys) {
366
- nativeRef.current?.reconcileSelection(JSON.stringify(selectedKeys));
367
- const current = snapshotRef.current;
653
+ const capturedKeys = captureNativeListInput(selectedKeys);
654
+ const pending = pendingDisclosureSnapshotRef.current;
655
+ if (!pending)
656
+ nativeRef.current?.reconcileSelection(JSON.stringify(capturedKeys));
657
+ const current = pending?.owned ?? snapshotRef.current;
368
658
  if (
369
659
  current.selection &&
370
- (current.selection.mode !== 'single' || selectedKeys.length <= 1) &&
371
- selectedKeys.every((key) =>
660
+ (current.selection.mode !== 'single' || capturedKeys.length <= 1) &&
661
+ capturedKeys.every((key) =>
372
662
  current.rows.some((row) => row.key === key && isSelectableRow(row))
373
663
  )
374
664
  ) {
375
- snapshotRef.current = {
665
+ const next = {
376
666
  ...current,
377
- selection: { ...current.selection, selectedKeys },
667
+ selection: { ...current.selection, selectedKeys: capturedKeys },
378
668
  };
669
+ if (pending)
670
+ pendingDisclosureSnapshotRef.current = { ...pending, owned: next };
671
+ else {
672
+ snapshotRef.current = next;
673
+ if (!nativeRef.current) needsNativeSnapshotRef.current = true;
674
+ }
379
675
  }
380
676
  },
381
677
  scrollToKey(paramsOrKey, animated, alignment) {
@@ -441,7 +737,19 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
441
737
  const nativeCallbacks = useMemo(
442
738
  () => ({
443
739
  hybridRef: callback((ref: NativeListMethods) => {
740
+ const previous = nativeRef.current;
444
741
  nativeRef.current = ref;
742
+ if (
743
+ needsNativeSnapshotRef.current ||
744
+ (previous && previous !== ref)
745
+ ) {
746
+ // The parent can publish values before Fabric delivers the host.
747
+ const latest = snapshotRef.current;
748
+ ref.applySnapshot(JSON.stringify(latest));
749
+ needsNativeSnapshotRef.current = false;
750
+ avatarModelRef.current?.replaceSnapshot(latest.rows);
751
+ updateAvatarPrefetchRef.current();
752
+ }
445
753
  applyInitialScrollCallbackRef.current();
446
754
  }),
447
755
  onRowAction: callback((payloadJson: string) => {
@@ -508,6 +816,11 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
508
816
  updateAvatarPrefetchRef.current();
509
817
  callbacksRef.current.onVisibleRangeChanged?.(payload);
510
818
  }),
819
+ onStructuralTransitionSettled: callback((payloadJson: string) => {
820
+ callbacksRef.current.onStructuralTransitionSettled?.(
821
+ parsePayload<StructuralTransitionSettledEvent>(payloadJson)
822
+ );
823
+ }),
511
824
  }),
512
825
  []
513
826
  );
@@ -515,10 +828,20 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
515
828
  return (
516
829
  <NativeListHost
517
830
  {...viewProps}
831
+ onLayout={(event) => {
832
+ setViewportWidth(event.nativeEvent.layout.width);
833
+ viewProps.onLayout?.(event);
834
+ }}
518
835
  {...nativeCallbacks}
836
+ onStructuralTransitionSettled={
837
+ onStructuralTransitionSettled
838
+ ? nativeCallbacks.onStructuralTransitionSettled
839
+ : clearedStructuralTransitionSettled
840
+ }
519
841
  fontFamiliesJson={fontFamiliesJson}
520
842
  snapshotJson={snapshotJson}
521
843
  containerSlotHeightsJson={containerSlotHeightsJson}
844
+ sidecarLayoutJson={sidecarLayoutJson}
522
845
  topScrollEdgeEffect={
523
846
  hasTopOverlay ? topScrollEdgeEffect ?? 'none' : 'none'
524
847
  }
@@ -529,26 +852,51 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
529
852
  >
530
853
  {slotContents.map((content, index) => (
531
854
  <View
532
- key={index}
855
+ key={
856
+ index === 0 && Platform.OS === 'ios'
857
+ ? `header-${headerEpoch}`
858
+ : index
859
+ }
533
860
  collapsable={false}
534
861
  style={{
535
862
  position: 'absolute',
536
- left: slotInset,
537
- right: slotInset,
863
+ start: index === 3 ? 0 : slotInset,
864
+ end: index === 3 ? undefined : slotInset + sidecarSpace,
865
+ width: index === 3 ? sidecarLayout?.width : undefined,
538
866
  top: 0,
539
867
  }}
540
868
  onLayout={(event) => {
541
- const height = Math.ceil(event.nativeEvent.layout.height);
542
- setSlotHeights((previous) =>
543
- previous[index] === height
544
- ? previous
545
- : previous.map((value, slot) =>
546
- slot === index ? height : value
547
- )
548
- );
869
+ if (index < 4) {
870
+ recordSlotLayout(
871
+ index,
872
+ Math.ceil(event.nativeEvent.layout.height),
873
+ index === 0 ? headerEpoch : 0
874
+ );
875
+ }
549
876
  }}
550
877
  >
551
- {content}
878
+ {index >= 4 ? (
879
+ <View
880
+ key={
881
+ index === 4
882
+ ? `expanded-${expandedEpoch}`
883
+ : `toggle-${toggleEpoch}`
884
+ }
885
+ collapsable={false}
886
+ style={disclosureSlotMeasurementStyle}
887
+ onLayout={(event) =>
888
+ recordSlotLayout(
889
+ index,
890
+ Math.ceil(event.nativeEvent.layout.height),
891
+ index === 4 ? expandedEpoch : toggleEpoch
892
+ )
893
+ }
894
+ >
895
+ {content}
896
+ </View>
897
+ ) : (
898
+ content
899
+ )}
552
900
  </View>
553
901
  ))}
554
902
  {hasTopOverlay ? (