react-native-nitro-list 0.0.1 → 0.1.1

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 (336) hide show
  1. package/README.md +250 -16
  2. package/android/build.gradle +5 -4
  3. package/android/src/main/java/com/nitrolist/HybridNitroRecyclerView.kt +26 -0
  4. package/android/src/main/java/com/nitrolist/HybridNitroRecyclerViewManager.kt +29 -0
  5. package/android/src/main/java/com/nitrolist/NitroListPackage.kt +13 -24
  6. package/android/src/main/java/com/nitrolist/NitroRecyclerAdapter.kt +32 -0
  7. package/android/src/main/java/com/nitrolist/NitroRecyclerViewHolder.kt +8 -0
  8. package/ios/HybridNitroList.swift +32 -15
  9. package/lib/commonjs/NitroList.js +9 -0
  10. package/lib/commonjs/NitroList.js.map +1 -0
  11. package/lib/commonjs/RecyclerList.internal.js +25 -0
  12. package/lib/commonjs/RecyclerList.internal.js.map +1 -0
  13. package/lib/commonjs/RecyclerList.js +171 -0
  14. package/lib/commonjs/RecyclerList.js.map +1 -0
  15. package/lib/commonjs/RecyclerList.types.js +6 -0
  16. package/lib/commonjs/RecyclerList.types.js.map +1 -0
  17. package/lib/commonjs/ReusableView.js +2 -0
  18. package/lib/commonjs/ReusableView.js.map +1 -0
  19. package/lib/commonjs/cell/Cell.js +2 -0
  20. package/lib/{module/specs/nitro-list.nitro.js.map → commonjs/cell/Cell.js.map} +1 -1
  21. package/lib/commonjs/cell/CellRecycler.js +62 -0
  22. package/lib/commonjs/cell/CellRecycler.js.map +1 -0
  23. package/lib/commonjs/cell/StableKey.js +10 -0
  24. package/lib/commonjs/cell/StableKey.js.map +1 -0
  25. package/lib/commonjs/debug/useDebugOverlay.js +15 -0
  26. package/lib/commonjs/debug/useDebugOverlay.js.map +1 -0
  27. package/lib/commonjs/getVisibleIndices.js +38 -0
  28. package/lib/commonjs/getVisibleIndices.js.map +1 -0
  29. package/lib/commonjs/hooks/useCellRenderer.js +62 -0
  30. package/lib/commonjs/hooks/useCellRenderer.js.map +1 -0
  31. package/lib/commonjs/hooks/useStableCallback.js +13 -0
  32. package/lib/commonjs/hooks/useStableCallback.js.map +1 -0
  33. package/lib/commonjs/index.js +7 -5
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/commonjs/layout/EstimatedLayoutProvider.js +30 -0
  36. package/lib/commonjs/layout/EstimatedLayoutProvider.js.map +1 -0
  37. package/lib/commonjs/layout/LayoutEngine.js +21 -0
  38. package/lib/commonjs/layout/LayoutEngine.js.map +1 -0
  39. package/lib/commonjs/{specs/nitro-list.nitro.js → layout/LayoutProvider.js} +1 -1
  40. package/lib/commonjs/{specs/nitro-list.nitro.js.map → layout/LayoutProvider.js.map} +1 -1
  41. package/lib/commonjs/layout/LayoutRectangle.js +2 -0
  42. package/lib/commonjs/layout/LayoutRectangle.js.map +1 -0
  43. package/lib/commonjs/layout/MutableLinearLayout.js +65 -0
  44. package/lib/commonjs/layout/MutableLinearLayout.js.map +1 -0
  45. package/lib/commonjs/layout/index.js +20 -0
  46. package/lib/commonjs/layout/index.js.map +1 -0
  47. package/lib/commonjs/measurement/MeasureLayout.js +20 -0
  48. package/lib/commonjs/measurement/MeasureLayout.js.map +1 -0
  49. package/lib/commonjs/measurement/useItemMeasurement.js +28 -0
  50. package/lib/commonjs/measurement/useItemMeasurement.js.map +1 -0
  51. package/lib/commonjs/native/NitroLayoutEngine.js +9 -0
  52. package/lib/commonjs/native/NitroLayoutEngine.js.map +1 -0
  53. package/lib/commonjs/native/NitroList.types.js +6 -0
  54. package/lib/commonjs/native/NitroList.types.js.map +1 -0
  55. package/lib/commonjs/native/NitroRecyclerView.js +9 -0
  56. package/lib/commonjs/native/NitroRecyclerView.js.map +1 -0
  57. package/lib/commonjs/prefetch/PrefetchHelper.js +39 -0
  58. package/lib/commonjs/prefetch/PrefetchHelper.js.map +1 -0
  59. package/lib/commonjs/specs/nitro-layout-engine.nitro.js +6 -0
  60. package/lib/commonjs/specs/nitro-layout-engine.nitro.js.map +1 -0
  61. package/lib/commonjs/utils/arrayEqual.js +15 -0
  62. package/lib/commonjs/utils/arrayEqual.js.map +1 -0
  63. package/lib/commonjs/utils/assertNever.js +10 -0
  64. package/lib/commonjs/utils/assertNever.js.map +1 -0
  65. package/lib/commonjs/utils/clamp.js +10 -0
  66. package/lib/commonjs/utils/clamp.js.map +1 -0
  67. package/lib/commonjs/utils/devAssert.js +12 -0
  68. package/lib/commonjs/utils/devAssert.js.map +1 -0
  69. package/lib/commonjs/utils/invariant.js +12 -0
  70. package/lib/commonjs/utils/invariant.js.map +1 -0
  71. package/lib/commonjs/utils/isDefined.js +10 -0
  72. package/lib/commonjs/utils/isDefined.js.map +1 -0
  73. package/lib/commonjs/utils/isNumber.js +10 -0
  74. package/lib/commonjs/utils/isNumber.js.map +1 -0
  75. package/lib/commonjs/utils/noop.js +10 -0
  76. package/lib/commonjs/utils/noop.js.map +1 -0
  77. package/lib/commonjs/utils/shallowEqual.js +22 -0
  78. package/lib/commonjs/utils/shallowEqual.js.map +1 -0
  79. package/lib/commonjs/utils/throttle.js +17 -0
  80. package/lib/commonjs/utils/throttle.js.map +1 -0
  81. package/lib/commonjs/viewability/ViewabilityHelper.js +121 -0
  82. package/lib/commonjs/viewability/ViewabilityHelper.js.map +1 -0
  83. package/lib/commonjs/windowing/ScrollMetrics.js +2 -0
  84. package/lib/commonjs/windowing/ScrollMetrics.js.map +1 -0
  85. package/lib/commonjs/windowing/findVisibleIndexRange.js +48 -0
  86. package/lib/commonjs/windowing/findVisibleIndexRange.js.map +1 -0
  87. package/lib/commonjs/windowing/index.js +20 -0
  88. package/lib/commonjs/windowing/index.js.map +1 -0
  89. package/lib/commonjs/windowing/useScrollMetrics.js +39 -0
  90. package/lib/commonjs/windowing/useScrollMetrics.js.map +1 -0
  91. package/lib/module/NitroList.js +5 -0
  92. package/lib/module/NitroList.js.map +1 -0
  93. package/lib/module/RecyclerList.internal.js +22 -0
  94. package/lib/module/RecyclerList.internal.js.map +1 -0
  95. package/lib/module/RecyclerList.js +166 -0
  96. package/lib/module/RecyclerList.js.map +1 -0
  97. package/lib/module/RecyclerList.types.js +4 -0
  98. package/lib/module/RecyclerList.types.js.map +1 -0
  99. package/lib/module/ReusableView.js +2 -0
  100. package/lib/module/ReusableView.js.map +1 -0
  101. package/lib/module/cell/Cell.js +2 -0
  102. package/lib/module/cell/Cell.js.map +1 -0
  103. package/lib/module/cell/CellRecycler.js +57 -0
  104. package/lib/module/cell/CellRecycler.js.map +1 -0
  105. package/lib/module/cell/StableKey.js +6 -0
  106. package/lib/module/cell/StableKey.js.map +1 -0
  107. package/lib/module/debug/useDebugOverlay.js +11 -0
  108. package/lib/module/debug/useDebugOverlay.js.map +1 -0
  109. package/lib/module/getVisibleIndices.js +34 -0
  110. package/lib/module/getVisibleIndices.js.map +1 -0
  111. package/lib/module/hooks/useCellRenderer.js +58 -0
  112. package/lib/module/hooks/useCellRenderer.js.map +1 -0
  113. package/lib/module/hooks/useStableCallback.js +9 -0
  114. package/lib/module/hooks/useStableCallback.js.map +1 -0
  115. package/lib/module/index.js +1 -3
  116. package/lib/module/index.js.map +1 -1
  117. package/lib/module/layout/EstimatedLayoutProvider.js +25 -0
  118. package/lib/module/layout/EstimatedLayoutProvider.js.map +1 -0
  119. package/lib/module/layout/LayoutEngine.js +17 -0
  120. package/lib/module/layout/LayoutEngine.js.map +1 -0
  121. package/lib/module/layout/LayoutProvider.js +4 -0
  122. package/lib/module/layout/LayoutProvider.js.map +1 -0
  123. package/lib/module/layout/LayoutRectangle.js +2 -0
  124. package/lib/module/layout/LayoutRectangle.js.map +1 -0
  125. package/lib/module/layout/MutableLinearLayout.js +60 -0
  126. package/lib/module/layout/MutableLinearLayout.js.map +1 -0
  127. package/lib/module/layout/index.js +5 -0
  128. package/lib/module/layout/index.js.map +1 -0
  129. package/lib/module/measurement/MeasureLayout.js +16 -0
  130. package/lib/module/measurement/MeasureLayout.js.map +1 -0
  131. package/lib/module/measurement/useItemMeasurement.js +24 -0
  132. package/lib/module/measurement/useItemMeasurement.js.map +1 -0
  133. package/lib/module/native/NitroLayoutEngine.js +5 -0
  134. package/lib/module/native/NitroLayoutEngine.js.map +1 -0
  135. package/lib/module/native/NitroList.types.js +4 -0
  136. package/lib/module/native/NitroList.types.js.map +1 -0
  137. package/lib/module/native/NitroRecyclerView.js +5 -0
  138. package/lib/module/native/NitroRecyclerView.js.map +1 -0
  139. package/lib/module/prefetch/PrefetchHelper.js +34 -0
  140. package/lib/module/prefetch/PrefetchHelper.js.map +1 -0
  141. package/lib/module/specs/nitro-layout-engine.nitro.js +4 -0
  142. package/lib/module/specs/nitro-layout-engine.nitro.js.map +1 -0
  143. package/lib/module/utils/arrayEqual.js +11 -0
  144. package/lib/module/utils/arrayEqual.js.map +1 -0
  145. package/lib/module/utils/assertNever.js +6 -0
  146. package/lib/module/utils/assertNever.js.map +1 -0
  147. package/lib/module/utils/clamp.js +6 -0
  148. package/lib/module/utils/clamp.js.map +1 -0
  149. package/lib/module/utils/devAssert.js +8 -0
  150. package/lib/module/utils/devAssert.js.map +1 -0
  151. package/lib/module/utils/invariant.js +8 -0
  152. package/lib/module/utils/invariant.js.map +1 -0
  153. package/lib/module/utils/isDefined.js +6 -0
  154. package/lib/module/utils/isDefined.js.map +1 -0
  155. package/lib/module/utils/isNumber.js +6 -0
  156. package/lib/module/utils/isNumber.js.map +1 -0
  157. package/lib/module/utils/noop.js +6 -0
  158. package/lib/module/utils/noop.js.map +1 -0
  159. package/lib/module/utils/shallowEqual.js +18 -0
  160. package/lib/module/utils/shallowEqual.js.map +1 -0
  161. package/lib/module/utils/throttle.js +13 -0
  162. package/lib/module/utils/throttle.js.map +1 -0
  163. package/lib/module/viewability/ViewabilityHelper.js +116 -0
  164. package/lib/module/viewability/ViewabilityHelper.js.map +1 -0
  165. package/lib/module/windowing/ScrollMetrics.js +2 -0
  166. package/lib/module/windowing/ScrollMetrics.js.map +1 -0
  167. package/lib/module/windowing/findVisibleIndexRange.js +44 -0
  168. package/lib/module/windowing/findVisibleIndexRange.js.map +1 -0
  169. package/lib/module/windowing/index.js +5 -0
  170. package/lib/module/windowing/index.js.map +1 -0
  171. package/lib/module/windowing/useScrollMetrics.js +35 -0
  172. package/lib/module/windowing/useScrollMetrics.js.map +1 -0
  173. package/lib/typescript/src/NitroList.d.ts +5 -0
  174. package/lib/typescript/src/NitroList.d.ts.map +1 -0
  175. package/lib/typescript/src/RecyclerList.d.ts +26 -0
  176. package/lib/typescript/src/RecyclerList.d.ts.map +1 -0
  177. package/lib/typescript/src/RecyclerList.internal.d.ts +9 -0
  178. package/lib/typescript/src/RecyclerList.internal.d.ts.map +1 -0
  179. package/lib/typescript/src/RecyclerList.types.d.ts +18 -0
  180. package/lib/typescript/src/RecyclerList.types.d.ts.map +1 -0
  181. package/lib/typescript/src/ReusableView.d.ts +9 -0
  182. package/lib/typescript/src/ReusableView.d.ts.map +1 -0
  183. package/lib/typescript/src/__tests__/windowing/findVisibleIndexRange.test.d.ts +2 -0
  184. package/lib/typescript/src/__tests__/windowing/findVisibleIndexRange.test.d.ts.map +1 -0
  185. package/lib/typescript/src/cell/Cell.d.ts +13 -0
  186. package/lib/typescript/src/cell/Cell.d.ts.map +1 -0
  187. package/lib/typescript/src/cell/CellRecycler.d.ts +19 -0
  188. package/lib/typescript/src/cell/CellRecycler.d.ts.map +1 -0
  189. package/lib/typescript/src/cell/StableKey.d.ts +2 -0
  190. package/lib/typescript/src/cell/StableKey.d.ts.map +1 -0
  191. package/lib/typescript/src/debug/useDebugOverlay.d.ts +2 -0
  192. package/lib/typescript/src/debug/useDebugOverlay.d.ts.map +1 -0
  193. package/lib/typescript/src/getVisibleIndices.d.ts +8 -0
  194. package/lib/typescript/src/getVisibleIndices.d.ts.map +1 -0
  195. package/lib/typescript/src/hooks/useCellRenderer.d.ts +19 -0
  196. package/lib/typescript/src/hooks/useCellRenderer.d.ts.map +1 -0
  197. package/lib/typescript/src/hooks/useStableCallback.d.ts +2 -0
  198. package/lib/typescript/src/hooks/useStableCallback.d.ts.map +1 -0
  199. package/lib/typescript/src/index.d.ts +2 -4
  200. package/lib/typescript/src/index.d.ts.map +1 -1
  201. package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts +15 -0
  202. package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts.map +1 -0
  203. package/lib/typescript/src/layout/LayoutEngine.d.ts +10 -0
  204. package/lib/typescript/src/layout/LayoutEngine.d.ts.map +1 -0
  205. package/lib/typescript/src/layout/LayoutProvider.d.ts +16 -0
  206. package/lib/typescript/src/layout/LayoutProvider.d.ts.map +1 -0
  207. package/lib/typescript/src/layout/LayoutRectangle.d.ts +11 -0
  208. package/lib/typescript/src/layout/LayoutRectangle.d.ts.map +1 -0
  209. package/lib/typescript/src/layout/MutableLinearLayout.d.ts +22 -0
  210. package/lib/typescript/src/layout/MutableLinearLayout.d.ts.map +1 -0
  211. package/lib/typescript/src/layout/index.d.ts +5 -0
  212. package/lib/typescript/src/layout/index.d.ts.map +1 -0
  213. package/lib/typescript/src/measurement/MeasureLayout.d.ts +10 -0
  214. package/lib/typescript/src/measurement/MeasureLayout.d.ts.map +1 -0
  215. package/lib/typescript/src/measurement/useItemMeasurement.d.ts +11 -0
  216. package/lib/typescript/src/measurement/useItemMeasurement.d.ts.map +1 -0
  217. package/lib/typescript/src/native/NitroLayoutEngine.d.ts +3 -0
  218. package/lib/typescript/src/native/NitroLayoutEngine.d.ts.map +1 -0
  219. package/lib/typescript/src/native/NitroList.types.d.ts +9 -0
  220. package/lib/typescript/src/native/NitroList.types.d.ts.map +1 -0
  221. package/lib/typescript/src/native/NitroRecyclerView.d.ts +5 -0
  222. package/lib/typescript/src/native/NitroRecyclerView.d.ts.map +1 -0
  223. package/lib/typescript/src/prefetch/PrefetchHelper.d.ts +17 -0
  224. package/lib/typescript/src/prefetch/PrefetchHelper.d.ts.map +1 -0
  225. package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts +14 -0
  226. package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts.map +1 -0
  227. package/lib/typescript/src/utils/arrayEqual.d.ts +2 -0
  228. package/lib/typescript/src/utils/arrayEqual.d.ts.map +1 -0
  229. package/lib/typescript/src/utils/assertNever.d.ts +2 -0
  230. package/lib/typescript/src/utils/assertNever.d.ts.map +1 -0
  231. package/lib/typescript/src/utils/clamp.d.ts +2 -0
  232. package/lib/typescript/src/utils/clamp.d.ts.map +1 -0
  233. package/lib/typescript/src/utils/devAssert.d.ts +2 -0
  234. package/lib/typescript/src/utils/devAssert.d.ts.map +1 -0
  235. package/lib/typescript/src/utils/invariant.d.ts +2 -0
  236. package/lib/typescript/src/utils/invariant.d.ts.map +1 -0
  237. package/lib/typescript/src/utils/isDefined.d.ts +2 -0
  238. package/lib/typescript/src/utils/isDefined.d.ts.map +1 -0
  239. package/lib/typescript/src/utils/isNumber.d.ts +2 -0
  240. package/lib/typescript/src/utils/isNumber.d.ts.map +1 -0
  241. package/lib/typescript/src/utils/noop.d.ts +2 -0
  242. package/lib/typescript/src/utils/noop.d.ts.map +1 -0
  243. package/lib/typescript/src/utils/shallowEqual.d.ts +2 -0
  244. package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
  245. package/lib/typescript/src/utils/throttle.d.ts +2 -0
  246. package/lib/typescript/src/utils/throttle.d.ts.map +1 -0
  247. package/lib/typescript/src/viewability/ViewabilityHelper.d.ts +50 -0
  248. package/lib/typescript/src/viewability/ViewabilityHelper.d.ts.map +1 -0
  249. package/lib/typescript/src/windowing/ScrollMetrics.d.ts +11 -0
  250. package/lib/typescript/src/windowing/ScrollMetrics.d.ts.map +1 -0
  251. package/lib/typescript/src/windowing/findVisibleIndexRange.d.ts +11 -0
  252. package/lib/typescript/src/windowing/findVisibleIndexRange.d.ts.map +1 -0
  253. package/lib/typescript/src/windowing/index.d.ts +4 -0
  254. package/lib/typescript/src/windowing/index.d.ts.map +1 -0
  255. package/lib/typescript/src/windowing/useScrollMetrics.d.ts +14 -0
  256. package/lib/typescript/src/windowing/useScrollMetrics.d.ts.map +1 -0
  257. package/nitro.json +20 -13
  258. package/nitrogen/generated/android/NitroList+autolinking.cmake +2 -4
  259. package/nitrogen/generated/android/NitroListOnLoad.cpp +3 -13
  260. package/nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.cpp +69 -0
  261. package/nitrogen/generated/android/c++/{JHybridNitroListSpec.hpp → JHybridNitroLayoutEngineSpec.hpp} +12 -13
  262. package/nitrogen/generated/android/c++/JLayoutRectangle.hpp +69 -0
  263. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{HybridNitroListSpec.kt → HybridNitroLayoutEngineSpec.kt} +11 -13
  264. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/LayoutRectangle.kt +47 -0
  265. package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.cpp +9 -9
  266. package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +50 -13
  267. package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +11 -5
  268. package/nitrogen/generated/ios/c++/{HybridNitroListSpecSwift.cpp → HybridNitroLayoutEngineSpecSwift.cpp} +2 -2
  269. package/nitrogen/generated/ios/c++/HybridNitroLayoutEngineSpecSwift.hpp +78 -0
  270. package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec.swift +56 -0
  271. package/nitrogen/generated/ios/swift/{HybridNitroListSpec_cxx.swift → HybridNitroLayoutEngineSpec_cxx.swift} +35 -38
  272. package/nitrogen/generated/ios/swift/LayoutRectangle.swift +45 -0
  273. package/nitrogen/generated/shared/c++/{HybridNitroListSpec.cpp → HybridNitroLayoutEngineSpec.cpp} +4 -5
  274. package/nitrogen/generated/shared/c++/{HybridNitroListSpec.hpp → HybridNitroLayoutEngineSpec.hpp} +15 -14
  275. package/nitrogen/generated/shared/c++/LayoutRectangle.hpp +95 -0
  276. package/package.json +12 -4
  277. package/src/NitroList.ts +8 -0
  278. package/src/RecyclerList.internal.ts +38 -0
  279. package/src/RecyclerList.tsx +252 -0
  280. package/src/RecyclerList.types.ts +24 -0
  281. package/src/ReusableView.ts +12 -0
  282. package/src/__tests__/windowing/findVisibleIndexRange.test.ts +55 -0
  283. package/src/cell/Cell.ts +14 -0
  284. package/src/cell/CellRecycler.ts +66 -0
  285. package/src/cell/StableKey.ts +6 -0
  286. package/src/debug/useDebugOverlay.ts +14 -0
  287. package/src/getVisibleIndices.ts +53 -0
  288. package/src/hooks/useCellRenderer.ts +86 -0
  289. package/src/hooks/useStableCallback.ts +13 -0
  290. package/src/index.ts +2 -14
  291. package/src/layout/EstimatedLayoutProvider.ts +35 -0
  292. package/src/layout/LayoutEngine.ts +21 -0
  293. package/src/layout/LayoutProvider.ts +17 -0
  294. package/src/layout/LayoutRectangle.ts +10 -0
  295. package/src/layout/MutableLinearLayout.ts +79 -0
  296. package/src/layout/index.ts +4 -0
  297. package/src/measurement/MeasureLayout.ts +20 -0
  298. package/src/measurement/useItemMeasurement.ts +32 -0
  299. package/src/native/NitroLayoutEngine.ts +7 -0
  300. package/src/native/NitroList.types.ts +12 -0
  301. package/src/native/NitroRecyclerView.ts +8 -0
  302. package/src/prefetch/PrefetchHelper.ts +47 -0
  303. package/src/specs/nitro-layout-engine.nitro.ts +17 -0
  304. package/src/utils/arrayEqual.ts +13 -0
  305. package/src/utils/assertNever.ts +3 -0
  306. package/src/utils/clamp.ts +7 -0
  307. package/src/utils/devAssert.ts +8 -0
  308. package/src/utils/invariant.ts +8 -0
  309. package/src/utils/isDefined.ts +5 -0
  310. package/src/utils/isNumber.ts +3 -0
  311. package/src/utils/noop.ts +3 -0
  312. package/src/utils/shallowEqual.ts +34 -0
  313. package/src/utils/throttle.ts +13 -0
  314. package/src/viewability/ViewabilityHelper.ts +130 -0
  315. package/src/windowing/ScrollMetrics.ts +11 -0
  316. package/src/windowing/findVisibleIndexRange.ts +60 -0
  317. package/src/windowing/index.ts +3 -0
  318. package/src/windowing/useScrollMetrics.ts +56 -0
  319. package/android/src/main/java/com/nitrolist/HybridNitroList.kt +0 -27
  320. package/lib/module/specs/nitro-list.nitro.js +0 -4
  321. package/lib/typescript/src/specs/nitro-list.nitro.d.ts +0 -11
  322. package/lib/typescript/src/specs/nitro-list.nitro.d.ts.map +0 -1
  323. package/nitrogen/generated/android/c++/JHybridNitroListSpec.cpp +0 -56
  324. package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.cpp +0 -56
  325. package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.hpp +0 -49
  326. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListManager.kt +0 -50
  327. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListStateUpdater.kt +0 -23
  328. package/nitrogen/generated/ios/NitroListAutolinking.mm +0 -33
  329. package/nitrogen/generated/ios/NitroListAutolinking.swift +0 -25
  330. package/nitrogen/generated/ios/c++/HybridNitroListSpecSwift.hpp +0 -74
  331. package/nitrogen/generated/ios/c++/views/HybridNitroListComponent.mm +0 -96
  332. package/nitrogen/generated/ios/swift/HybridNitroListSpec.swift +0 -56
  333. package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.cpp +0 -88
  334. package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.hpp +0 -107
  335. package/nitrogen/generated/shared/json/NitroListConfig.json +0 -10
  336. package/src/specs/nitro-list.nitro.ts +0 -13
@@ -0,0 +1,19 @@
1
+ import type { Cell } from '../cell/Cell';
2
+ import type { LayoutRectangle } from '../layout/LayoutRectangle';
3
+ import type { ScrollMetrics } from '../windowing/ScrollMetrics';
4
+ /**
5
+ * React bridge for CellRecycler.
6
+ * FlashList equivalent: useCellRenderer
7
+ *
8
+ * Responsibilities:
9
+ * - Translate scroll state → visible indices
10
+ * - Ask recycler for physical cells
11
+ * - Commit results with referential stability
12
+ *
13
+ * Responsibilities it does NOT have:
14
+ * ❌ Layout mutation
15
+ * ❌ Measurement
16
+ * ❌ Rendering
17
+ */
18
+ export declare function useCellRenderer(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics, bufferPx: number, getCellType: (index: number) => string): readonly Cell[];
19
+ //# sourceMappingURL=useCellRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCellRenderer.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCellRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAQ/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACrC,SAAS,IAAI,EAAE,CAqDjB"}
@@ -0,0 +1,2 @@
1
+ export declare function useStableCallback<T extends (...args: never[]) => unknown>(fn: T): T;
2
+ //# sourceMappingURL=useStableCallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStableCallback.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useStableCallback.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EACvE,EAAE,EAAE,CAAC,GACJ,CAAC,CAQH"}
@@ -1,5 +1,3 @@
1
- import { type HybridRef } from 'react-native-nitro-modules';
2
- import type { NitroListProps, NitroListMethods } from './specs/nitro-list.nitro';
3
- export declare const NitroList: import("react-native-nitro-modules").ReactNativeView<NitroListProps, NitroListMethods>;
4
- export type NitroListRef = HybridRef<NitroListProps, NitroListMethods>;
1
+ export { RecyclerList } from './RecyclerList';
2
+ export type { RecyclerListProps } from './RecyclerList.types';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EACjB,MAAM,0BAA0B,CAAA;AAGjC,eAAO,MAAM,SAAS,wFAGrB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { LayoutProvider } from './LayoutProvider';
2
+ import type { LayoutRectangle } from './LayoutRectangle';
3
+ /**
4
+ * Layout provider using estimated item heights.
5
+ * Used before real measurements are available.
6
+ */
7
+ export declare class EstimatedLayoutProvider implements LayoutProvider {
8
+ private readonly itemCount;
9
+ private readonly itemHeight;
10
+ private readonly width;
11
+ constructor(itemCount: number, itemHeight: number, width: number);
12
+ getItemCount(): number;
13
+ getLayout(index: number): LayoutRectangle;
14
+ }
15
+ //# sourceMappingURL=EstimatedLayoutProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EstimatedLayoutProvider.d.ts","sourceRoot":"","sources":["../../../../src/layout/EstimatedLayoutProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAG5B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM;IAOf,YAAY,IAAI,MAAM;IAItB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe;CAQ1C"}
@@ -0,0 +1,10 @@
1
+ import type { LayoutProvider } from './LayoutProvider';
2
+ import type { LayoutRectangle } from './LayoutRectangle';
3
+ /**
4
+ * Resolves layouts eagerly into a contiguous array.
5
+ * Pure, deterministic, and reusable.
6
+ *
7
+ * FlashList equivalent: internal layout resolver.
8
+ */
9
+ export declare function computeLayouts(provider: LayoutProvider): readonly LayoutRectangle[];
10
+ //# sourceMappingURL=LayoutEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutEngine.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,GACvB,SAAS,eAAe,EAAE,CAS5B"}
@@ -0,0 +1,16 @@
1
+ import type { LayoutRectangle } from './LayoutRectangle';
2
+ /**
3
+ * Provides layout information for items.
4
+ * FlashList equivalent: LayoutProvider
5
+ */
6
+ export interface LayoutProvider {
7
+ /**
8
+ * Total number of items
9
+ */
10
+ getItemCount(): number;
11
+ /**
12
+ * Layout rectangle for a given index
13
+ */
14
+ getLayout(index: number): LayoutRectangle;
15
+ }
16
+ //# sourceMappingURL=LayoutProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,YAAY,IAAI,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAA;CAC1C"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Immutable layout rectangle for a single item.
3
+ * Equivalent to FlashList's Layout.
4
+ */
5
+ export interface LayoutRectangle {
6
+ readonly x: number;
7
+ readonly y: number;
8
+ readonly width: number;
9
+ readonly height: number;
10
+ }
11
+ //# sourceMappingURL=LayoutRectangle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutRectangle.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutRectangle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB"}
@@ -0,0 +1,22 @@
1
+ import type { LayoutRectangle } from './LayoutRectangle';
2
+ /**
3
+ * Mutable linear layout store.
4
+ * FlashList-style incremental relayout.
5
+ */
6
+ export declare class MutableLinearLayout {
7
+ private readonly layouts;
8
+ private totalHeight;
9
+ constructor(initialHeights: readonly number[], width: number);
10
+ /**
11
+ * Read-only snapshot for consumers.
12
+ * Returned type is immutable.
13
+ */
14
+ getLayouts(): readonly LayoutRectangle[];
15
+ getContentHeight(): number;
16
+ /**
17
+ * Update height of one item and shift following items.
18
+ * Returns true if layout changed.
19
+ */
20
+ updateItemHeight(index: number, newHeight: number): boolean;
21
+ }
22
+ //# sourceMappingURL=MutableLinearLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MutableLinearLayout.d.ts","sourceRoot":"","sources":["../../../../src/layout/MutableLinearLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAaxD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,WAAW,CAAQ;gBAGzB,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,KAAK,EAAE,MAAM;IAkBf;;;OAGG;IACH,UAAU,IAAI,SAAS,eAAe,EAAE;IAIxC,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,gBAAgB,CACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,OAAO;CAkBX"}
@@ -0,0 +1,5 @@
1
+ export type { LayoutRectangle } from './LayoutRectangle';
2
+ export type { LayoutProvider } from './LayoutProvider';
3
+ export { EstimatedLayoutProvider } from './EstimatedLayoutProvider';
4
+ export { computeLayouts } from './LayoutEngine';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { LayoutChangeEvent } from 'react-native';
2
+ export interface MeasuredLayout {
3
+ readonly width: number;
4
+ readonly height: number;
5
+ }
6
+ /**
7
+ * Extracts stable layout measurements from RN onLayout event.
8
+ */
9
+ export declare function measureLayout(event: LayoutChangeEvent): MeasuredLayout;
10
+ //# sourceMappingURL=MeasureLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeasureLayout.d.ts","sourceRoot":"","sources":["../../../../src/measurement/MeasureLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAOhB"}
@@ -0,0 +1,11 @@
1
+ import type { LayoutChangeEvent } from 'react-native';
2
+ /**
3
+ * Hook to measure a rendered item safely.
4
+ *
5
+ * Guarantees:
6
+ * - No duplicate height reports
7
+ * - No render loops
8
+ * - Stable callback identity
9
+ */
10
+ export declare function useItemMeasurement(index: number, onMeasured: (index: number, height: number) => void): (e: LayoutChangeEvent) => void;
11
+ //# sourceMappingURL=useItemMeasurement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useItemMeasurement.d.ts","sourceRoot":"","sources":["../../../../src/measurement/useItemMeasurement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,OAK7C,iBAAiB,UAaxB"}
@@ -0,0 +1,3 @@
1
+ import type { NitroLayoutEngine as NitroLayoutEngineSpec } from '../specs/nitro-layout-engine.nitro';
2
+ export declare const NitroLayoutEngine: NitroLayoutEngineSpec;
3
+ //# sourceMappingURL=NitroLayoutEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroLayoutEngine.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroLayoutEngine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAEpG,eAAO,MAAM,iBAAiB,uBAG3B,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { LayoutRectangle } from '../layout/LayoutRectangle';
2
+ /**
3
+ * JS runtime interface backed by Nitro (JSI).
4
+ * Must match native HybridNitroList exactly.
5
+ */
6
+ export interface NitroList {
7
+ computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRectangle[];
8
+ }
9
+ //# sourceMappingURL=NitroList.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroList.types.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,eAAe,EAAE,CAAA;CAC9B"}
@@ -0,0 +1,5 @@
1
+ export type NitroRecyclerViewProps = {
2
+ itemCount: number;
3
+ };
4
+ export declare const NitroRecyclerView: import("react-native").HostComponent<NitroRecyclerViewProps>;
5
+ //# sourceMappingURL=NitroRecyclerView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NitroRecyclerView.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroRecyclerView.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,8DACuC,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Callback invoked when new items should be prefetched.
3
+ */
4
+ export type PrefetchCallback = (indices: number[]) => void;
5
+ /**
6
+ * PrefetchHelper
7
+ *
8
+ * Stateless with respect to layout.
9
+ * Only tracks what has already been prefetched to avoid duplication.
10
+ *
11
+ * Designed to be driven by *visible window*, not scroll events.
12
+ */
13
+ export declare class PrefetchHelper {
14
+ private lastPrefetched;
15
+ runPrefetch(visibleIndices: readonly number[], itemCount: number, aheadCount: number, onPrefetch: PrefetchCallback): void;
16
+ }
17
+ //# sourceMappingURL=PrefetchHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrefetchHelper.d.ts","sourceRoot":"","sources":["../../../../src/prefetch/PrefetchHelper.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;AAE1D;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,cAAc,CAAoB;IAE1C,WAAW,CACT,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,gBAAgB;CA0B/B"}
@@ -0,0 +1,14 @@
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+ export interface LayoutRectangle {
3
+ readonly x: number;
4
+ readonly y: number;
5
+ readonly width: number;
6
+ readonly height: number;
7
+ }
8
+ export interface NitroLayoutEngine extends HybridObject<{
9
+ ios: 'swift';
10
+ android: 'kotlin';
11
+ }> {
12
+ computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRectangle[];
13
+ }
14
+ //# sourceMappingURL=nitro-layout-engine.nitro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nitro-layout-engine.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/nitro-layout-engine.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IAEzD,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,eAAe,EAAE,CAAA;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export declare function arrayEqual<T>(a: readonly T[], b: readonly T[]): boolean;
2
+ //# sourceMappingURL=arrayEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayEqual.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrayEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAC1B,CAAC,EAAE,SAAS,CAAC,EAAE,EACf,CAAC,EAAE,SAAS,CAAC,EAAE,GACd,OAAO,CAST"}
@@ -0,0 +1,2 @@
1
+ export declare function assertNever(x: never): never;
2
+ //# sourceMappingURL=assertNever.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertNever.d.ts","sourceRoot":"","sources":["../../../../src/utils/assertNever.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAE3C"}
@@ -0,0 +1,2 @@
1
+ export declare function clamp(value: number, min: number, max: number): number;
2
+ //# sourceMappingURL=clamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../../../src/utils/clamp.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,CAER"}
@@ -0,0 +1,2 @@
1
+ export declare function devAssert(condition: boolean, message: string): void;
2
+ //# sourceMappingURL=devAssert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devAssert.d.ts","sourceRoot":"","sources":["../../../../src/utils/devAssert.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACvB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
@@ -0,0 +1,2 @@
1
+ export declare function invariant(condition: unknown, message: string): asserts condition;
2
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../../../src/utils/invariant.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACvB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAInB"}
@@ -0,0 +1,2 @@
1
+ export declare function isDefined<T>(value: T | undefined | null): value is T;
2
+ //# sourceMappingURL=isDefined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDefined.d.ts","sourceRoot":"","sources":["../../../../src/utils/isDefined.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAC1B,KAAK,IAAI,CAAC,CAEZ"}
@@ -0,0 +1,2 @@
1
+ export declare function isNumber(value: unknown): value is number;
2
+ //# sourceMappingURL=isNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isNumber.d.ts","sourceRoot":"","sources":["../../../../src/utils/isNumber.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
@@ -0,0 +1,2 @@
1
+ export declare function noop(): void;
2
+ //# sourceMappingURL=noop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../../src/utils/noop.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,IAAI,IAAI,CAE3B"}
@@ -0,0 +1,2 @@
1
+ export declare function shallowEqual(a: unknown, b: unknown): boolean;
2
+ //# sourceMappingURL=shallowEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shallowEqual.d.ts","sourceRoot":"","sources":["../../../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,GACT,OAAO,CA8BT"}
@@ -0,0 +1,2 @@
1
+ export declare function throttle<T extends (...args: never[]) => void>(fn: T, ms: number): T;
2
+ //# sourceMappingURL=throttle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../../src/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,EAC3D,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACT,CAAC,CASH"}
@@ -0,0 +1,50 @@
1
+ import type { LayoutRectangle } from '../layout/LayoutRectangle';
2
+ import type { ScrollMetrics } from '../windowing/ScrollMetrics';
3
+ /**
4
+ * Public token describing viewability state of an item.
5
+ * Mirrors FlashList's ViewToken concept.
6
+ */
7
+ export type ViewToken = {
8
+ index: number;
9
+ isViewable: boolean;
10
+ };
11
+ /**
12
+ * Configuration for viewability calculations.
13
+ */
14
+ export type ViewabilityConfig = {
15
+ /**
16
+ * Percentage (0–100) of item height that must be visible
17
+ * for the item to be considered "viewable".
18
+ */
19
+ itemVisiblePercentThreshold?: number;
20
+ };
21
+ /**
22
+ * ViewabilityHelper
23
+ *
24
+ * Pure observer:
25
+ * - Does NOT affect layout
26
+ * - Does NOT affect recycling
27
+ * - Computes visibility based on layout + scroll metrics
28
+ *
29
+ * This class is intentionally stateful (lastVisible)
30
+ * to compute "changed" items efficiently.
31
+ */
32
+ export declare class ViewabilityHelper {
33
+ private readonly config;
34
+ /** Previously visible indices */
35
+ private lastVisible;
36
+ constructor(config?: ViewabilityConfig);
37
+ /**
38
+ * Computes which items are viewable and which changed
39
+ * since the last invocation.
40
+ *
41
+ * IMPORTANT:
42
+ * - This method should be called AFTER windowing,
43
+ * not on the full dataset.
44
+ */
45
+ computeViewableItems(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics): {
46
+ viewableItems: ViewToken[];
47
+ changed: ViewToken[];
48
+ };
49
+ }
50
+ //# sourceMappingURL=ViewabilityHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewabilityHelper.d.ts","sourceRoot":"","sources":["../../../../src/viewability/ViewabilityHelper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAA;CACrC,CAAA;AAED;;;;;;;;;;GAUG;AACH,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,iCAAiC;IACjC,OAAO,CAAC,WAAW,CAAoB;gBAGpB,MAAM,GAAE,iBAAsB;IAGjD;;;;;;;OAOG;IACH,oBAAoB,CAClB,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,GACrB;QACD,aAAa,EAAE,SAAS,EAAE,CAAA;QAC1B,OAAO,EAAE,SAAS,EAAE,CAAA;KACrB;CAyEF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Immutable snapshot of scroll state.
3
+ * FlashList terminology.
4
+ */
5
+ export interface ScrollMetrics {
6
+ /** Vertical scroll offset */
7
+ offsetY: number;
8
+ /** Viewport height */
9
+ height: number;
10
+ }
11
+ //# sourceMappingURL=ScrollMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollMetrics.d.ts","sourceRoot":"","sources":["../../../../src/windowing/ScrollMetrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IAEf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;CACf"}
@@ -0,0 +1,11 @@
1
+ import type { LayoutRectangle } from '../layout/LayoutRectangle';
2
+ import type { ScrollMetrics } from './ScrollMetrics';
3
+ /**
4
+ * Computes the contiguous range of item indices
5
+ * intersecting the viewport expanded by bufferPx.
6
+ *
7
+ * PURE function. No allocations besides output.
8
+ * FlashList-style windowing.
9
+ */
10
+ export declare function findVisibleIndexRange(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics, bufferPx: number): readonly number[];
11
+ //# sourceMappingURL=findVisibleIndexRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findVisibleIndexRange.d.ts","sourceRoot":"","sources":["../../../../src/windowing/findVisibleIndexRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,SAAS,MAAM,EAAE,CA6CnB"}
@@ -0,0 +1,4 @@
1
+ export type { ScrollMetrics } from './ScrollMetrics';
2
+ export { findVisibleIndexRange } from './findVisibleIndexRange';
3
+ export { useScrollMetrics } from './useScrollMetrics';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/windowing/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
2
+ import type { ScrollMetrics } from './ScrollMetrics';
3
+ /**
4
+ * Scroll metrics hook.
5
+ * Provides stable scroll snapshot + handlers.
6
+ *
7
+ * FlashList equivalent: useScrollMetrics
8
+ */
9
+ export declare function useScrollMetrics(): {
10
+ metrics: ScrollMetrics;
11
+ onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => void;
12
+ onLayout: (e: LayoutChangeEvent) => void;
13
+ };
14
+ //# sourceMappingURL=useScrollMetrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollMetrics.d.ts","sourceRoot":"","sources":["../../../../src/windowing/useScrollMetrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC9D,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACzC,CAqCA"}
package/nitro.json CHANGED
@@ -1,24 +1,31 @@
1
1
  {
2
2
  "$schema": "https://nitro.margelo.com/nitro.schema.json",
3
- "cxxNamespace": [
4
- "nitrolist"
5
- ],
3
+
4
+ "cxxNamespace": ["nitrolist"],
5
+
6
6
  "ios": {
7
7
  "iosModuleName": "NitroList"
8
8
  },
9
+
9
10
  "android": {
10
- "androidNamespace": [
11
- "nitrolist"
12
- ],
11
+ "androidNamespace": ["nitrolist"],
13
12
  "androidCxxLibName": "NitroList"
14
13
  },
14
+
15
15
  "autolinking": {
16
- "NitroList": {
17
- "swift": "HybridNitroList",
18
- "kotlin": "HybridNitroList"
16
+ "views": {
17
+ "NitroListView": {
18
+ "swift": "HybridNitroList",
19
+ "kotlin": "HybridNitroList"
20
+ }
21
+ },
22
+ "objects": {
23
+ "NitroLayoutEngine": {
24
+ "swift": "HybridNitroLayoutEngine",
25
+ "kotlin": "HybridNitroLayoutEngine"
26
+ }
19
27
  }
20
28
  },
21
- "ignorePaths": [
22
- "**/node_modules"
23
- ]
24
- }
29
+
30
+ "ignorePaths": ["**/node_modules"]
31
+ }
@@ -33,11 +33,9 @@ target_sources(
33
33
  # Autolinking Setup
34
34
  ../nitrogen/generated/android/NitroListOnLoad.cpp
35
35
  # Shared Nitrogen C++ sources
36
- ../nitrogen/generated/shared/c++/HybridNitroListSpec.cpp
37
- ../nitrogen/generated/shared/c++/views/HybridNitroListComponent.cpp
36
+ ../nitrogen/generated/shared/c++/HybridNitroLayoutEngineSpec.cpp
38
37
  # Android-specific Nitrogen C++ sources
39
- ../nitrogen/generated/android/c++/JHybridNitroListSpec.cpp
40
- ../nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.cpp
38
+ ../nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.cpp
41
39
  )
42
40
 
43
41
  # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
@@ -15,9 +15,7 @@
15
15
  #include <fbjni/fbjni.h>
16
16
  #include <NitroModules/HybridObjectRegistry.hpp>
17
17
 
18
- #include "JHybridNitroListSpec.hpp"
19
- #include "views/JHybridNitroListStateUpdater.hpp"
20
- #include <NitroModules/DefaultConstructableObject.hpp>
18
+ #include "JHybridNitroLayoutEngineSpec.hpp"
21
19
 
22
20
  namespace margelo::nitro::nitrolist {
23
21
 
@@ -28,18 +26,10 @@ int initialize(JavaVM* vm) {
28
26
 
29
27
  return facebook::jni::initialize(vm, [] {
30
28
  // Register native JNI methods
31
- margelo::nitro::nitrolist::JHybridNitroListSpec::registerNatives();
32
- margelo::nitro::nitrolist::views::JHybridNitroListStateUpdater::registerNatives();
29
+ margelo::nitro::nitrolist::JHybridNitroLayoutEngineSpec::registerNatives();
33
30
 
34
31
  // Register Nitro Hybrid Objects
35
- HybridObjectRegistry::registerHybridObjectConstructor(
36
- "NitroList",
37
- []() -> std::shared_ptr<HybridObject> {
38
- static DefaultConstructableObject<JHybridNitroListSpec::javaobject> object("com/nitrolist/HybridNitroList");
39
- auto instance = object.create();
40
- return instance->cthis()->shared();
41
- }
42
- );
32
+
43
33
  });
44
34
  }
45
35