react-native-nitro-list 0.0.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -16
- package/android/build.gradle +5 -4
- package/android/src/main/java/com/nitrolist/HybridNitroRecyclerView.kt +26 -0
- package/android/src/main/java/com/nitrolist/HybridNitroRecyclerViewManager.kt +29 -0
- package/android/src/main/java/com/nitrolist/NitroListPackage.kt +13 -24
- package/android/src/main/java/com/nitrolist/NitroRecyclerAdapter.kt +32 -0
- package/android/src/main/java/com/nitrolist/NitroRecyclerViewHolder.kt +8 -0
- package/ios/HybridNitroList.swift +28 -15
- package/lib/commonjs/NitroList.js +9 -0
- package/lib/commonjs/NitroList.js.map +1 -0
- package/lib/commonjs/ReusableView.js +2 -0
- package/lib/commonjs/ReusableView.js.map +1 -0
- package/lib/commonjs/cell/Cell.js +2 -0
- package/lib/{module/specs/nitro-list.nitro.js.map → commonjs/cell/Cell.js.map} +1 -1
- package/lib/commonjs/cell/CellKeyGenerator.js +21 -0
- package/lib/commonjs/cell/CellKeyGenerator.js.map +1 -0
- package/lib/commonjs/cell/CellRecycler.js +70 -0
- package/lib/commonjs/cell/CellRecycler.js.map +1 -0
- package/lib/commonjs/cell/createCell.js +21 -0
- package/lib/commonjs/cell/createCell.js.map +1 -0
- package/lib/commonjs/cell/index.js +20 -0
- package/lib/commonjs/cell/index.js.map +1 -0
- package/lib/commonjs/debug/useDebugOverlay.js +15 -0
- package/lib/commonjs/debug/useDebugOverlay.js.map +1 -0
- package/lib/commonjs/getVisibleIndices.js +38 -0
- package/lib/commonjs/getVisibleIndices.js.map +1 -0
- package/lib/commonjs/hooks/usePersistentCallback.js +36 -0
- package/lib/commonjs/hooks/usePersistentCallback.js.map +1 -0
- package/lib/commonjs/index.js +7 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/MutableLinearLayout.js +104 -0
- package/lib/commonjs/layout/MutableLinearLayout.js.map +1 -0
- package/lib/commonjs/layout/constants/layoutDefaults.js +19 -0
- package/lib/commonjs/layout/constants/layoutDefaults.js.map +1 -0
- package/lib/commonjs/layout/index.js +2 -0
- package/lib/commonjs/{specs/nitro-list.nitro.js.map → layout/index.js.map} +1 -1
- package/lib/commonjs/measurement/MeasureLayout.js +20 -0
- package/lib/commonjs/measurement/MeasureLayout.js.map +1 -0
- package/lib/commonjs/measurement/useItemMeasurement.js +28 -0
- package/lib/commonjs/measurement/useItemMeasurement.js.map +1 -0
- package/lib/commonjs/native/NitroLayoutEngine.js +9 -0
- package/lib/commonjs/native/NitroLayoutEngine.js.map +1 -0
- package/lib/commonjs/{specs/nitro-list.nitro.js → native/NitroList.types.js} +1 -1
- package/lib/commonjs/native/NitroList.types.js.map +1 -0
- package/lib/commonjs/native/NitroRecyclerView.js +9 -0
- package/lib/commonjs/native/NitroRecyclerView.js.map +1 -0
- package/lib/commonjs/prefetch/PrefetchHelper.js +39 -0
- package/lib/commonjs/prefetch/PrefetchHelper.js.map +1 -0
- package/lib/commonjs/recycler/CellPool.js +46 -0
- package/lib/commonjs/recycler/CellPool.js.map +1 -0
- package/lib/commonjs/recycler/RecyclerList.js +224 -0
- package/lib/commonjs/recycler/RecyclerList.js.map +1 -0
- package/lib/commonjs/specs/nitro-layout-engine.nitro.js +6 -0
- package/lib/commonjs/specs/nitro-layout-engine.nitro.js.map +1 -0
- package/lib/commonjs/types/Axis.js +2 -0
- package/lib/commonjs/types/Axis.js.map +1 -0
- package/lib/commonjs/types/CellKey.js +2 -0
- package/lib/commonjs/types/CellKey.js.map +1 -0
- package/lib/commonjs/types/CellType.js +2 -0
- package/lib/commonjs/types/CellType.js.map +1 -0
- package/lib/commonjs/types/VisibleRange.js +2 -0
- package/lib/commonjs/types/VisibleRange.js.map +1 -0
- package/lib/commonjs/types/VisibleRangeInput.js +6 -0
- package/lib/commonjs/types/VisibleRangeInput.js.map +1 -0
- package/lib/commonjs/types/index.js +13 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/layout/LayoutRect.js +2 -0
- package/lib/commonjs/types/layout/LayoutRect.js.map +1 -0
- package/lib/commonjs/types/layout/LinearLayoutInput.js +6 -0
- package/lib/commonjs/types/layout/LinearLayoutInput.js.map +1 -0
- package/lib/commonjs/types/layout/MainAxisPadding.js +26 -0
- package/lib/commonjs/types/layout/MainAxisPadding.js.map +1 -0
- package/lib/commonjs/types/layout/index.js +2 -0
- package/lib/commonjs/types/layout/index.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerCellInstance.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerCellInstance.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerItemRenderer.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerItemRenderer.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerListProps.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerListProps.js.map +1 -0
- package/lib/commonjs/types/recycler/index.js +2 -0
- package/lib/commonjs/types/recycler/index.js.map +1 -0
- package/lib/commonjs/types/scroll/ScrollMetrics.js +6 -0
- package/lib/commonjs/types/scroll/ScrollMetrics.js.map +1 -0
- package/lib/commonjs/types/scroll/index.js +2 -0
- package/lib/commonjs/types/scroll/index.js.map +1 -0
- package/lib/commonjs/utils/arrayEqual.js +15 -0
- package/lib/commonjs/utils/arrayEqual.js.map +1 -0
- package/lib/commonjs/utils/assertNever.js +10 -0
- package/lib/commonjs/utils/assertNever.js.map +1 -0
- package/lib/commonjs/utils/clamp.js +10 -0
- package/lib/commonjs/utils/clamp.js.map +1 -0
- package/lib/commonjs/utils/devAssert.js +12 -0
- package/lib/commonjs/utils/devAssert.js.map +1 -0
- package/lib/commonjs/utils/invariant.js +12 -0
- package/lib/commonjs/utils/invariant.js.map +1 -0
- package/lib/commonjs/utils/isDefined.js +10 -0
- package/lib/commonjs/utils/isDefined.js.map +1 -0
- package/lib/commonjs/utils/isNumber.js +10 -0
- package/lib/commonjs/utils/isNumber.js.map +1 -0
- package/lib/commonjs/utils/noop.js +10 -0
- package/lib/commonjs/utils/noop.js.map +1 -0
- package/lib/commonjs/utils/shallowEqual.js +22 -0
- package/lib/commonjs/utils/shallowEqual.js.map +1 -0
- package/lib/commonjs/utils/throttle.js +17 -0
- package/lib/commonjs/utils/throttle.js.map +1 -0
- package/lib/commonjs/windowing/ScrollMetrics.js +2 -0
- package/lib/commonjs/windowing/ScrollMetrics.js.map +1 -0
- package/lib/commonjs/windowing/computeVisibleItemRange.js +71 -0
- package/lib/commonjs/windowing/computeVisibleItemRange.js.map +1 -0
- package/lib/commonjs/windowing/index.js +20 -0
- package/lib/commonjs/windowing/index.js.map +1 -0
- package/lib/commonjs/windowing/useScrollMetrics.js +39 -0
- package/lib/commonjs/windowing/useScrollMetrics.js.map +1 -0
- package/lib/module/NitroList.js +5 -0
- package/lib/module/NitroList.js.map +1 -0
- package/lib/module/ReusableView.js +2 -0
- package/lib/module/ReusableView.js.map +1 -0
- package/lib/module/cell/Cell.js +2 -0
- package/lib/module/cell/Cell.js.map +1 -0
- package/lib/module/cell/CellKeyGenerator.js +16 -0
- package/lib/module/cell/CellKeyGenerator.js.map +1 -0
- package/lib/module/cell/CellRecycler.js +66 -0
- package/lib/module/cell/CellRecycler.js.map +1 -0
- package/lib/module/cell/createCell.js +17 -0
- package/lib/module/cell/createCell.js.map +1 -0
- package/lib/module/cell/index.js +7 -0
- package/lib/module/cell/index.js.map +1 -0
- package/lib/module/debug/useDebugOverlay.js +11 -0
- package/lib/module/debug/useDebugOverlay.js.map +1 -0
- package/lib/module/getVisibleIndices.js +34 -0
- package/lib/module/getVisibleIndices.js.map +1 -0
- package/lib/module/hooks/usePersistentCallback.js +33 -0
- package/lib/module/hooks/usePersistentCallback.js.map +1 -0
- package/lib/module/index.js +1 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/MutableLinearLayout.js +100 -0
- package/lib/module/layout/MutableLinearLayout.js.map +1 -0
- package/lib/module/layout/constants/layoutDefaults.js +15 -0
- package/lib/module/layout/constants/layoutDefaults.js.map +1 -0
- package/lib/module/layout/index.js +2 -0
- package/lib/module/layout/index.js.map +1 -0
- package/lib/module/measurement/MeasureLayout.js +16 -0
- package/lib/module/measurement/MeasureLayout.js.map +1 -0
- package/lib/module/measurement/useItemMeasurement.js +24 -0
- package/lib/module/measurement/useItemMeasurement.js.map +1 -0
- package/lib/module/native/NitroLayoutEngine.js +5 -0
- package/lib/module/native/NitroLayoutEngine.js.map +1 -0
- package/lib/module/native/NitroList.types.js +4 -0
- package/lib/module/native/NitroList.types.js.map +1 -0
- package/lib/module/native/NitroRecyclerView.js +5 -0
- package/lib/module/native/NitroRecyclerView.js.map +1 -0
- package/lib/module/prefetch/PrefetchHelper.js +34 -0
- package/lib/module/prefetch/PrefetchHelper.js.map +1 -0
- package/lib/module/recycler/CellPool.js +41 -0
- package/lib/module/recycler/CellPool.js.map +1 -0
- package/lib/module/recycler/RecyclerList.js +221 -0
- package/lib/module/recycler/RecyclerList.js.map +1 -0
- package/lib/module/specs/nitro-layout-engine.nitro.js +4 -0
- package/lib/module/specs/nitro-layout-engine.nitro.js.map +1 -0
- package/lib/module/types/Axis.js +2 -0
- package/lib/module/types/Axis.js.map +1 -0
- package/lib/module/types/CellKey.js +2 -0
- package/lib/module/types/CellKey.js.map +1 -0
- package/lib/module/types/CellType.js +2 -0
- package/lib/module/types/CellType.js.map +1 -0
- package/lib/module/types/VisibleRange.js +2 -0
- package/lib/module/types/VisibleRange.js.map +1 -0
- package/lib/module/types/VisibleRangeInput.js +4 -0
- package/lib/module/types/VisibleRangeInput.js.map +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/layout/LayoutRect.js +2 -0
- package/lib/module/types/layout/LayoutRect.js.map +1 -0
- package/lib/module/types/layout/LinearLayoutInput.js +4 -0
- package/lib/module/types/layout/LinearLayoutInput.js.map +1 -0
- package/lib/module/types/layout/MainAxisPadding.js +22 -0
- package/lib/module/types/layout/MainAxisPadding.js.map +1 -0
- package/lib/module/types/layout/index.js +2 -0
- package/lib/module/types/layout/index.js.map +1 -0
- package/lib/module/types/recycler/RecyclerCellInstance.js +4 -0
- package/lib/module/types/recycler/RecyclerCellInstance.js.map +1 -0
- package/lib/module/types/recycler/RecyclerItemRenderer.js +4 -0
- package/lib/module/types/recycler/RecyclerItemRenderer.js.map +1 -0
- package/lib/module/types/recycler/RecyclerListProps.js +4 -0
- package/lib/module/types/recycler/RecyclerListProps.js.map +1 -0
- package/lib/module/types/recycler/index.js +2 -0
- package/lib/module/types/recycler/index.js.map +1 -0
- package/lib/module/types/scroll/ScrollMetrics.js +4 -0
- package/lib/module/types/scroll/ScrollMetrics.js.map +1 -0
- package/lib/module/types/scroll/index.js +2 -0
- package/lib/module/types/scroll/index.js.map +1 -0
- package/lib/module/utils/arrayEqual.js +11 -0
- package/lib/module/utils/arrayEqual.js.map +1 -0
- package/lib/module/utils/assertNever.js +6 -0
- package/lib/module/utils/assertNever.js.map +1 -0
- package/lib/module/utils/clamp.js +6 -0
- package/lib/module/utils/clamp.js.map +1 -0
- package/lib/module/utils/devAssert.js +8 -0
- package/lib/module/utils/devAssert.js.map +1 -0
- package/lib/module/utils/invariant.js +8 -0
- package/lib/module/utils/invariant.js.map +1 -0
- package/lib/module/utils/isDefined.js +6 -0
- package/lib/module/utils/isDefined.js.map +1 -0
- package/lib/module/utils/isNumber.js +6 -0
- package/lib/module/utils/isNumber.js.map +1 -0
- package/lib/module/utils/noop.js +6 -0
- package/lib/module/utils/noop.js.map +1 -0
- package/lib/module/utils/shallowEqual.js +18 -0
- package/lib/module/utils/shallowEqual.js.map +1 -0
- package/lib/module/utils/throttle.js +13 -0
- package/lib/module/utils/throttle.js.map +1 -0
- package/lib/module/windowing/ScrollMetrics.js +2 -0
- package/lib/module/windowing/ScrollMetrics.js.map +1 -0
- package/lib/module/windowing/computeVisibleItemRange.js +67 -0
- package/lib/module/windowing/computeVisibleItemRange.js.map +1 -0
- package/lib/module/windowing/index.js +5 -0
- package/lib/module/windowing/index.js.map +1 -0
- package/lib/module/windowing/useScrollMetrics.js +35 -0
- package/lib/module/windowing/useScrollMetrics.js.map +1 -0
- package/lib/typescript/src/NitroList.d.ts +5 -0
- package/lib/typescript/src/NitroList.d.ts.map +1 -0
- package/lib/typescript/src/ReusableView.d.ts +9 -0
- package/lib/typescript/src/ReusableView.d.ts.map +1 -0
- package/lib/typescript/src/cell/Cell.d.ts +22 -0
- package/lib/typescript/src/cell/Cell.d.ts.map +1 -0
- package/lib/typescript/src/cell/CellKeyGenerator.d.ts +11 -0
- package/lib/typescript/src/cell/CellKeyGenerator.d.ts.map +1 -0
- package/lib/typescript/src/cell/CellRecycler.d.ts +27 -0
- package/lib/typescript/src/cell/CellRecycler.d.ts.map +1 -0
- package/lib/typescript/src/cell/createCell.d.ts +7 -0
- package/lib/typescript/src/cell/createCell.d.ts.map +1 -0
- package/lib/typescript/src/cell/index.d.ts +4 -0
- package/lib/typescript/src/cell/index.d.ts.map +1 -0
- package/lib/typescript/src/debug/useDebugOverlay.d.ts +2 -0
- package/lib/typescript/src/debug/useDebugOverlay.d.ts.map +1 -0
- package/lib/typescript/src/getVisibleIndices.d.ts +8 -0
- package/lib/typescript/src/getVisibleIndices.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePersistentCallback.d.ts +16 -0
- package/lib/typescript/src/hooks/usePersistentCallback.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts +54 -0
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts.map +1 -0
- package/lib/typescript/src/layout/constants/layoutDefaults.d.ts +13 -0
- package/lib/typescript/src/layout/constants/layoutDefaults.d.ts.map +1 -0
- package/lib/typescript/src/layout/index.d.ts +2 -0
- package/lib/typescript/src/layout/index.d.ts.map +1 -0
- package/lib/typescript/src/measurement/MeasureLayout.d.ts +10 -0
- package/lib/typescript/src/measurement/MeasureLayout.d.ts.map +1 -0
- package/lib/typescript/src/measurement/useItemMeasurement.d.ts +11 -0
- package/lib/typescript/src/measurement/useItemMeasurement.d.ts.map +1 -0
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts +3 -0
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts.map +1 -0
- package/lib/typescript/src/native/NitroList.types.d.ts +9 -0
- package/lib/typescript/src/native/NitroList.types.d.ts.map +1 -0
- package/lib/typescript/src/native/NitroRecyclerView.d.ts +5 -0
- package/lib/typescript/src/native/NitroRecyclerView.d.ts.map +1 -0
- package/lib/typescript/src/prefetch/PrefetchHelper.d.ts +17 -0
- package/lib/typescript/src/prefetch/PrefetchHelper.d.ts.map +1 -0
- package/lib/typescript/src/recycler/CellPool.d.ts +14 -0
- package/lib/typescript/src/recycler/CellPool.d.ts.map +1 -0
- package/lib/typescript/src/recycler/RecyclerList.d.ts +4 -0
- package/lib/typescript/src/recycler/RecyclerList.d.ts.map +1 -0
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts +14 -0
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types/Axis.d.ts +11 -0
- package/lib/typescript/src/types/Axis.d.ts.map +1 -0
- package/lib/typescript/src/types/CellKey.d.ts +10 -0
- package/lib/typescript/src/types/CellKey.d.ts.map +1 -0
- package/lib/typescript/src/types/CellType.d.ts +11 -0
- package/lib/typescript/src/types/CellType.d.ts.map +1 -0
- package/lib/typescript/src/types/VisibleRange.d.ts +10 -0
- package/lib/typescript/src/types/VisibleRange.d.ts.map +1 -0
- package/lib/typescript/src/types/VisibleRangeInput.d.ts +35 -0
- package/lib/typescript/src/types/VisibleRangeInput.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +8 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/LayoutRect.d.ts +15 -0
- package/lib/typescript/src/types/layout/LayoutRect.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/LinearLayoutInput.d.ts +10 -0
- package/lib/typescript/src/types/layout/LinearLayoutInput.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/MainAxisPadding.d.ts +20 -0
- package/lib/typescript/src/types/layout/MainAxisPadding.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/index.d.ts +4 -0
- package/lib/typescript/src/types/layout/index.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts +37 -0
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts +8 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerListProps.d.ts +66 -0
- package/lib/typescript/src/types/recycler/RecyclerListProps.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/index.d.ts +4 -0
- package/lib/typescript/src/types/recycler/index.d.ts.map +1 -0
- package/lib/typescript/src/types/scroll/ScrollMetrics.d.ts +15 -0
- package/lib/typescript/src/types/scroll/ScrollMetrics.d.ts.map +1 -0
- package/lib/typescript/src/types/scroll/index.d.ts +2 -0
- package/lib/typescript/src/types/scroll/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/arrayEqual.d.ts +2 -0
- package/lib/typescript/src/utils/arrayEqual.d.ts.map +1 -0
- package/lib/typescript/src/utils/assertNever.d.ts +2 -0
- package/lib/typescript/src/utils/assertNever.d.ts.map +1 -0
- package/lib/typescript/src/utils/clamp.d.ts +2 -0
- package/lib/typescript/src/utils/clamp.d.ts.map +1 -0
- package/lib/typescript/src/utils/devAssert.d.ts +2 -0
- package/lib/typescript/src/utils/devAssert.d.ts.map +1 -0
- package/lib/typescript/src/utils/invariant.d.ts +2 -0
- package/lib/typescript/src/utils/invariant.d.ts.map +1 -0
- package/lib/typescript/src/utils/isDefined.d.ts +2 -0
- package/lib/typescript/src/utils/isDefined.d.ts.map +1 -0
- package/lib/typescript/src/utils/isNumber.d.ts +2 -0
- package/lib/typescript/src/utils/isNumber.d.ts.map +1 -0
- package/lib/typescript/src/utils/noop.d.ts +2 -0
- package/lib/typescript/src/utils/noop.d.ts.map +1 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts +2 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
- package/lib/typescript/src/utils/throttle.d.ts +2 -0
- package/lib/typescript/src/utils/throttle.d.ts.map +1 -0
- package/lib/typescript/src/windowing/ScrollMetrics.d.ts +11 -0
- package/lib/typescript/src/windowing/ScrollMetrics.d.ts.map +1 -0
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts +15 -0
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts.map +1 -0
- package/lib/typescript/src/windowing/index.d.ts +4 -0
- package/lib/typescript/src/windowing/index.d.ts.map +1 -0
- package/lib/typescript/src/windowing/useScrollMetrics.d.ts +14 -0
- package/lib/typescript/src/windowing/useScrollMetrics.d.ts.map +1 -0
- package/nitro.json +20 -13
- package/nitrogen/generated/android/NitroList+autolinking.cmake +2 -4
- package/nitrogen/generated/android/NitroListOnLoad.cpp +3 -13
- package/nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.cpp +69 -0
- package/nitrogen/generated/android/c++/{JHybridNitroListSpec.hpp → JHybridNitroLayoutEngineSpec.hpp} +12 -13
- package/nitrogen/generated/android/c++/JLayoutRect.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{HybridNitroListSpec.kt → HybridNitroLayoutEngineSpec.kt} +11 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/LayoutRect.kt +47 -0
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.cpp +9 -9
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +50 -13
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +11 -5
- package/nitrogen/generated/ios/c++/{HybridNitroListSpecSwift.cpp → HybridNitroLayoutEngineSpecSwift.cpp} +2 -2
- package/nitrogen/generated/ios/c++/HybridNitroLayoutEngineSpecSwift.hpp +78 -0
- package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/{HybridNitroListSpec_cxx.swift → HybridNitroLayoutEngineSpec_cxx.swift} +35 -38
- package/nitrogen/generated/ios/swift/LayoutRect.swift +45 -0
- package/nitrogen/generated/shared/c++/{HybridNitroListSpec.cpp → HybridNitroLayoutEngineSpec.cpp} +4 -5
- package/nitrogen/generated/shared/c++/{HybridNitroListSpec.hpp → HybridNitroLayoutEngineSpec.hpp} +15 -14
- package/nitrogen/generated/shared/c++/LayoutRect.hpp +95 -0
- package/package.json +12 -4
- package/src/NitroList.ts +8 -0
- package/src/ReusableView.ts +12 -0
- package/src/cell/Cell.ts +23 -0
- package/src/cell/CellKeyGenerator.ts +17 -0
- package/src/cell/CellRecycler.ts +76 -0
- package/src/cell/createCell.ts +15 -0
- package/src/cell/index.ts +5 -0
- package/src/debug/useDebugOverlay.ts +14 -0
- package/src/getVisibleIndices.ts +55 -0
- package/src/hooks/usePersistentCallback.ts +37 -0
- package/src/index.ts +1 -14
- package/src/layout/MutableLinearLayout.ts +112 -0
- package/src/layout/constants/layoutDefaults.ts +12 -0
- package/src/layout/index.ts +1 -0
- package/src/measurement/MeasureLayout.ts +20 -0
- package/src/measurement/useItemMeasurement.ts +32 -0
- package/src/native/NitroLayoutEngine.ts +7 -0
- package/src/native/NitroList.types.ts +13 -0
- package/src/native/NitroRecyclerView.ts +8 -0
- package/src/prefetch/PrefetchHelper.ts +47 -0
- package/src/recycler/CellPool.ts +47 -0
- package/src/recycler/RecyclerList.tsx +304 -0
- package/src/specs/nitro-layout-engine.nitro.ts +17 -0
- package/src/types/Axis.ts +10 -0
- package/src/types/CellKey.ts +9 -0
- package/src/types/CellType.ts +10 -0
- package/src/types/VisibleRange.ts +9 -0
- package/src/types/VisibleRangeInput.ts +39 -0
- package/src/types/index.ts +15 -0
- package/src/types/layout/LayoutRect.ts +14 -0
- package/src/types/layout/LinearLayoutInput.ts +12 -0
- package/src/types/layout/MainAxisPadding.ts +23 -0
- package/src/types/layout/index.ts +3 -0
- package/src/types/recycler/RecyclerCellInstance.ts +40 -0
- package/src/types/recycler/RecyclerItemRenderer.ts +8 -0
- package/src/types/recycler/RecyclerListProps.ts +74 -0
- package/src/types/recycler/index.ts +3 -0
- package/src/types/scroll/ScrollMetrics.ts +18 -0
- package/src/types/scroll/index.ts +1 -0
- package/src/utils/arrayEqual.ts +13 -0
- package/src/utils/assertNever.ts +3 -0
- package/src/utils/clamp.ts +7 -0
- package/src/utils/devAssert.ts +8 -0
- package/src/utils/invariant.ts +8 -0
- package/src/utils/isDefined.ts +5 -0
- package/src/utils/isNumber.ts +3 -0
- package/src/utils/noop.ts +3 -0
- package/src/utils/shallowEqual.ts +34 -0
- package/src/utils/throttle.ts +13 -0
- package/src/windowing/ScrollMetrics.ts +11 -0
- package/src/windowing/computeVisibleItemRange.ts +78 -0
- package/src/windowing/index.ts +3 -0
- package/src/windowing/useScrollMetrics.ts +56 -0
- package/android/src/main/java/com/nitrolist/HybridNitroList.kt +0 -27
- package/lib/module/specs/nitro-list.nitro.js +0 -4
- package/lib/typescript/src/specs/nitro-list.nitro.d.ts +0 -11
- package/lib/typescript/src/specs/nitro-list.nitro.d.ts.map +0 -1
- package/nitrogen/generated/android/c++/JHybridNitroListSpec.cpp +0 -56
- package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.cpp +0 -56
- package/nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.hpp +0 -49
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListManager.kt +0 -50
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/views/HybridNitroListStateUpdater.kt +0 -23
- package/nitrogen/generated/ios/NitroListAutolinking.mm +0 -33
- package/nitrogen/generated/ios/NitroListAutolinking.swift +0 -25
- package/nitrogen/generated/ios/c++/HybridNitroListSpecSwift.hpp +0 -74
- package/nitrogen/generated/ios/c++/views/HybridNitroListComponent.mm +0 -96
- package/nitrogen/generated/ios/swift/HybridNitroListSpec.swift +0 -56
- package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.cpp +0 -88
- package/nitrogen/generated/shared/c++/views/HybridNitroListComponent.hpp +0 -107
- package/nitrogen/generated/shared/json/NitroListConfig.json +0 -10
- package/src/specs/nitro-list.nitro.ts +0 -13
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDebugOverlay = useDebugOverlay;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useDebugOverlay(enabled, visibleCount) {
|
|
9
|
+
(0, _react.useEffect)(() => {
|
|
10
|
+
if (__DEV__ && enabled) {
|
|
11
|
+
console.log(`[RecyclerList] visible items: ${visibleCount}`);
|
|
12
|
+
}
|
|
13
|
+
}, [enabled, visibleCount]);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=useDebugOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useDebugOverlay","enabled","visibleCount","useEffect","__DEV__","console","log"],"sourceRoot":"../../../src","sources":["debug/useDebugOverlay.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,eAAeA,CAC7BC,OAAgB,EAChBC,YAAoB,EACd;EACN,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIC,OAAO,IAAIH,OAAO,EAAE;MACtBI,OAAO,CAACC,GAAG,CACT,iCAAiCJ,YAAY,EAC/C,CAAC;IACH;EACF,CAAC,EAAE,CAACD,OAAO,EAAEC,YAAY,CAAC,CAAC;AAC7B","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVisibleRange = getVisibleRange;
|
|
7
|
+
/**
|
|
8
|
+
* Binary-search based windowing.
|
|
9
|
+
* Returns indices intersecting viewport ± buffer.
|
|
10
|
+
*/
|
|
11
|
+
function getVisibleRange(layouts, metrics, bufferPx) {
|
|
12
|
+
if (layouts.length === 0 || metrics.height <= 0) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
const startY = Math.max(0, metrics.offsetY - bufferPx);
|
|
16
|
+
const endY = metrics.offsetY + metrics.height + bufferPx;
|
|
17
|
+
let low = 0;
|
|
18
|
+
let high = layouts.length - 1;
|
|
19
|
+
let first = layouts.length;
|
|
20
|
+
while (low <= high) {
|
|
21
|
+
const mid = low + high >> 1;
|
|
22
|
+
const rect = layouts[mid];
|
|
23
|
+
if (rect.y + rect.height >= startY) {
|
|
24
|
+
first = mid;
|
|
25
|
+
high = mid - 1;
|
|
26
|
+
} else {
|
|
27
|
+
low = mid + 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const visible = [];
|
|
31
|
+
for (let i = first; i < layouts.length; i++) {
|
|
32
|
+
const rect = layouts[i];
|
|
33
|
+
if (rect.y > endY) break;
|
|
34
|
+
visible.push(i);
|
|
35
|
+
}
|
|
36
|
+
return visible;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=getVisibleIndices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getVisibleRange","layouts","metrics","bufferPx","length","height","startY","Math","max","offsetY","endY","low","high","first","mid","rect","y","visible","i","push"],"sourceRoot":"../../src","sources":["getVisibleIndices.ts"],"mappings":";;;;;;AAKA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAC7BC,OAA8B,EAC9BC,OAAsB,EACtBC,QAAgB,EACG;EACnB,IACEF,OAAO,CAACG,MAAM,KAAK,CAAC,IACpBF,OAAO,CAACG,MAAM,IAAI,CAAC,EACnB;IACA,OAAO,EAAE;EACX;EAEA,MAAMC,MAAM,GAAGC,IAAI,CAACC,GAAG,CACrB,CAAC,EACDN,OAAO,CAACO,OAAO,GAAGN,QACpB,CAAC;EAED,MAAMO,IAAI,GACRR,OAAO,CAACO,OAAO,GAAGP,OAAO,CAACG,MAAM,GAAGF,QAAQ;EAE7C,IAAIQ,GAAG,GAAG,CAAC;EACX,IAAIC,IAAI,GAAGX,OAAO,CAACG,MAAM,GAAG,CAAC;EAC7B,IAAIS,KAAK,GAAGZ,OAAO,CAACG,MAAM;EAE1B,OAAOO,GAAG,IAAIC,IAAI,EAAE;IAClB,MAAME,GAAG,GAAIH,GAAG,GAAGC,IAAI,IAAK,CAAC;IAC7B,MAAMG,IAAI,GAAGd,OAAO,CAACa,GAAG,CAAE;IAE1B,IAAIC,IAAI,CAACC,CAAC,GAAGD,IAAI,CAACV,MAAM,IAAIC,MAAM,EAAE;MAClCO,KAAK,GAAGC,GAAG;MACXF,IAAI,GAAGE,GAAG,GAAG,CAAC;IAChB,CAAC,MAAM;MACLH,GAAG,GAAGG,GAAG,GAAG,CAAC;IACf;EACF;EAEA,MAAMG,OAAiB,GAAG,EAAE;EAE5B,KAAK,IAAIC,CAAC,GAAGL,KAAK,EAAEK,CAAC,GAAGjB,OAAO,CAACG,MAAM,EAAEc,CAAC,EAAE,EAAE;IAC3C,MAAMH,IAAI,GAAGd,OAAO,CAACiB,CAAC,CAAE;IACxB,IAAIH,IAAI,CAACC,CAAC,GAAGN,IAAI,EAAE;IACnBO,OAAO,CAACE,IAAI,CAACD,CAAC,CAAC;EACjB;EAEA,OAAOD,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePersistentCallback = usePersistentCallback;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Returns a function whose identity is stable across renders,
|
|
10
|
+
* but always invokes the latest provided implementation.
|
|
11
|
+
*
|
|
12
|
+
* Invariants:
|
|
13
|
+
* - Function reference NEVER changes
|
|
14
|
+
* - Logic is ALWAYS up to date
|
|
15
|
+
*
|
|
16
|
+
* This is critical for long-lived systems such as:
|
|
17
|
+
* - Recyclers
|
|
18
|
+
* - Effects
|
|
19
|
+
* - Native bridges
|
|
20
|
+
* - Event pipelines
|
|
21
|
+
*/
|
|
22
|
+
function usePersistentCallback(fn) {
|
|
23
|
+
/**
|
|
24
|
+
* Holds the latest implementation.
|
|
25
|
+
* Updating this does NOT trigger re-renders.
|
|
26
|
+
*/
|
|
27
|
+
const fnRef = (0, _react.useRef)(fn);
|
|
28
|
+
fnRef.current = fn;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Stable wrapper that forwards calls
|
|
32
|
+
* to the latest implementation.
|
|
33
|
+
*/
|
|
34
|
+
return (0, _react.useCallback)((...args) => fnRef.current(...args), []);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=usePersistentCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","usePersistentCallback","fn","fnRef","useRef","current","useCallback","args"],"sourceRoot":"../../../src","sources":["hooks/usePersistentCallback.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAEnCC,EAAK,EAAK;EAEV;AACF;AACA;AACA;EACE,MAAMC,KAAK,GAAG,IAAAC,aAAM,EAACF,EAAE,CAAC;EACxBC,KAAK,CAACE,OAAO,GAAGH,EAAE;;EAElB;AACF;AACA;AACA;EACE,OAAO,IAAAI,kBAAW,EACf,CAAC,GAAGC,IAAa,KAChBJ,KAAK,CAACE,OAAO,CAAC,GAAGE,IAAI,CAAC,EACxB,EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
Object.defineProperty(exports, "RecyclerList", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _RecyclerList.RecyclerList;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _RecyclerList = require("./recycler/RecyclerList");
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_RecyclerList","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MutableLinearLayout = void 0;
|
|
7
|
+
var _layoutDefaults = require("./constants/layoutDefaults");
|
|
8
|
+
/**
|
|
9
|
+
* Mutable, deterministic linear layout engine.
|
|
10
|
+
*
|
|
11
|
+
* Responsibilities:
|
|
12
|
+
* - Compute absolute item geometry
|
|
13
|
+
* - Own layout truth (no React, no scroll state)
|
|
14
|
+
* - Guarantee monotonic ordering along the main axis
|
|
15
|
+
*
|
|
16
|
+
* Cross-platform equivalents:
|
|
17
|
+
* - Flutter: RenderSliver / SliverList
|
|
18
|
+
* - Android: LinearLayoutManager
|
|
19
|
+
* - iOS: UICollectionViewFlowLayout (linear)
|
|
20
|
+
*/
|
|
21
|
+
class MutableLinearLayout {
|
|
22
|
+
/** Absolute item layouts in index order */
|
|
23
|
+
layouts = [];
|
|
24
|
+
|
|
25
|
+
/** Total scrollable size along main axis */
|
|
26
|
+
contentSize = 0;
|
|
27
|
+
constructor(axis) {
|
|
28
|
+
this.isVertical = axis === 'vertical';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Computes layout synchronously from input.
|
|
33
|
+
*
|
|
34
|
+
* This method is intentionally parameter-object based
|
|
35
|
+
* to allow future extension without breaking API.
|
|
36
|
+
*
|
|
37
|
+
* Invariants:
|
|
38
|
+
* - Layouts are monotonic along main axis
|
|
39
|
+
* - No gaps except explicit spacing
|
|
40
|
+
* - Deterministic for identical inputs
|
|
41
|
+
*/
|
|
42
|
+
compute(input) {
|
|
43
|
+
const {
|
|
44
|
+
crossAxisSize,
|
|
45
|
+
itemMainAxisSizes,
|
|
46
|
+
padding,
|
|
47
|
+
itemSpacing = _layoutDefaults.DEFAULT_ITEM_SPACING
|
|
48
|
+
} = input;
|
|
49
|
+
const itemCount = itemMainAxisSizes.length;
|
|
50
|
+
const layouts = new Array(itemCount);
|
|
51
|
+
let cursor = padding.start;
|
|
52
|
+
for (let i = 0; i < itemCount; i++) {
|
|
53
|
+
const mainAxisSize = itemMainAxisSizes[i];
|
|
54
|
+
layouts[i] = this.isVertical ? {
|
|
55
|
+
x: 0,
|
|
56
|
+
y: cursor,
|
|
57
|
+
width: crossAxisSize,
|
|
58
|
+
height: mainAxisSize
|
|
59
|
+
} : {
|
|
60
|
+
x: cursor,
|
|
61
|
+
y: 0,
|
|
62
|
+
width: mainAxisSize,
|
|
63
|
+
height: crossAxisSize
|
|
64
|
+
};
|
|
65
|
+
cursor += mainAxisSize;
|
|
66
|
+
|
|
67
|
+
// Space BETWEEN items, not after the last
|
|
68
|
+
if (i < itemCount - 1) {
|
|
69
|
+
cursor += itemSpacing;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this.layouts = layouts;
|
|
73
|
+
this.contentSize = cursor + padding.end;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Returns computed item layouts.
|
|
78
|
+
*
|
|
79
|
+
* Order is guaranteed monotonic along the main axis,
|
|
80
|
+
* which is required for binary-search-based windowing.
|
|
81
|
+
*/
|
|
82
|
+
getLayouts() {
|
|
83
|
+
return this.layouts;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns total scrollable size along the main axis,
|
|
88
|
+
* including padding and inter-item spacing.
|
|
89
|
+
*/
|
|
90
|
+
getContentSize() {
|
|
91
|
+
return this.contentSize;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Clears internal layout state.
|
|
96
|
+
* Call on severe invalidation or teardown.
|
|
97
|
+
*/
|
|
98
|
+
reset() {
|
|
99
|
+
this.layouts = [];
|
|
100
|
+
this.contentSize = 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.MutableLinearLayout = MutableLinearLayout;
|
|
104
|
+
//# sourceMappingURL=MutableLinearLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_layoutDefaults","require","MutableLinearLayout","layouts","contentSize","constructor","axis","isVertical","compute","input","crossAxisSize","itemMainAxisSizes","padding","itemSpacing","DEFAULT_ITEM_SPACING","itemCount","length","Array","cursor","start","i","mainAxisSize","x","y","width","height","end","getLayouts","getContentSize","reset","exports"],"sourceRoot":"../../../src","sources":["layout/MutableLinearLayout.ts"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mBAAmB,CAAC;EAG/B;EACQC,OAAO,GAAiB,EAAE;;EAElC;EACQC,WAAW,GAAG,CAAC;EAEvBC,WAAWA,CAACC,IAAU,EAAE;IACtB,IAAI,CAACC,UAAU,GAAGD,IAAI,KAAK,UAAU;EACvC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,OAAOA,CAACC,KAAwB,EAAQ;IACtC,MAAM;MACJC,aAAa;MACbC,iBAAiB;MACjBC,OAAO;MACPC,WAAW,GAAGC;IAChB,CAAC,GAAGL,KAAK;IAET,MAAMM,SAAS,GAAGJ,iBAAiB,CAACK,MAAM;IAC1C,MAAMb,OAAqB,GAAG,IAAIc,KAAK,CAACF,SAAS,CAAC;IAElD,IAAIG,MAAM,GAAGN,OAAO,CAACO,KAAK;IAE1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,SAAS,EAAEK,CAAC,EAAE,EAAE;MAClC,MAAMC,YAAY,GAAGV,iBAAiB,CAACS,CAAC,CAAE;MAE1CjB,OAAO,CAACiB,CAAC,CAAC,GAAG,IAAI,CAACb,UAAU,GACxB;QACEe,CAAC,EAAE,CAAC;QACJC,CAAC,EAAEL,MAAM;QACTM,KAAK,EAAEd,aAAa;QACpBe,MAAM,EAAEJ;MACV,CAAC,GACD;QACEC,CAAC,EAAEJ,MAAM;QACTK,CAAC,EAAE,CAAC;QACJC,KAAK,EAAEH,YAAY;QACnBI,MAAM,EAAEf;MACV,CAAC;MAELQ,MAAM,IAAIG,YAAY;;MAEtB;MACA,IAAID,CAAC,GAAGL,SAAS,GAAG,CAAC,EAAE;QACrBG,MAAM,IAAIL,WAAW;MACvB;IACF;IAEA,IAAI,CAACV,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,WAAW,GAAGc,MAAM,GAAGN,OAAO,CAACc,GAAG;EACzC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,UAAUA,CAAA,EAA0B;IAClC,OAAO,IAAI,CAACxB,OAAO;EACrB;;EAEA;AACF;AACA;AACA;EACEyB,cAAcA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACxB,WAAW;EACzB;;EAEA;AACF;AACA;AACA;EACEyB,KAAKA,CAAA,EAAS;IACZ,IAAI,CAAC1B,OAAO,GAAG,EAAE;IACjB,IAAI,CAACC,WAAW,GAAG,CAAC;EACtB;AACF;AAAC0B,OAAA,CAAA5B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_ITEM_SPACING = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Default spacing between items along the main axis.
|
|
9
|
+
*
|
|
10
|
+
* This value is used by layout engines when no explicit
|
|
11
|
+
* itemSpacing is provided.
|
|
12
|
+
*
|
|
13
|
+
* Mirrors:
|
|
14
|
+
* - Android RecyclerView ItemDecoration (typical 8–16dp)
|
|
15
|
+
* - iOS UICollectionViewFlowLayout minimumLineSpacing
|
|
16
|
+
* - Flutter SliverList spacing conventions
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_ITEM_SPACING = exports.DEFAULT_ITEM_SPACING = 12;
|
|
19
|
+
//# sourceMappingURL=layoutDefaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_ITEM_SPACING","exports"],"sourceRoot":"../../../../src","sources":["layout/constants/layoutDefaults.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,EAAE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["layout/index.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.measureLayout = measureLayout;
|
|
7
|
+
/**
|
|
8
|
+
* Extracts stable layout measurements from RN onLayout event.
|
|
9
|
+
*/
|
|
10
|
+
function measureLayout(event) {
|
|
11
|
+
const {
|
|
12
|
+
width,
|
|
13
|
+
height
|
|
14
|
+
} = event.nativeEvent.layout;
|
|
15
|
+
return {
|
|
16
|
+
width,
|
|
17
|
+
height
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=MeasureLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["measureLayout","event","width","height","nativeEvent","layout"],"sourceRoot":"../../../src","sources":["measurement/MeasureLayout.ts"],"mappings":";;;;;;AAOA;AACA;AACA;AACO,SAASA,aAAaA,CAC3BC,KAAwB,EACR;EAChB,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,KAAK,CAACG,WAAW,CAACC,MAAM;EAElD,OAAO;IACLH,KAAK;IACLC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useItemMeasurement = useItemMeasurement;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Hook to measure a rendered item safely.
|
|
10
|
+
*
|
|
11
|
+
* Guarantees:
|
|
12
|
+
* - No duplicate height reports
|
|
13
|
+
* - No render loops
|
|
14
|
+
* - Stable callback identity
|
|
15
|
+
*/
|
|
16
|
+
function useItemMeasurement(index, onMeasured) {
|
|
17
|
+
const lastHeightRef = (0, _react.useRef)(null);
|
|
18
|
+
const onLayout = (0, _react.useCallback)(e => {
|
|
19
|
+
const height = e.nativeEvent.layout.height;
|
|
20
|
+
|
|
21
|
+
// Ignore identical measurements
|
|
22
|
+
if (lastHeightRef.current === height) return;
|
|
23
|
+
lastHeightRef.current = height;
|
|
24
|
+
onMeasured(index, height);
|
|
25
|
+
}, [index, onMeasured]);
|
|
26
|
+
return onLayout;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=useItemMeasurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useItemMeasurement","index","onMeasured","lastHeightRef","useRef","onLayout","useCallback","e","height","nativeEvent","layout","current"],"sourceRoot":"../../../src","sources":["measurement/useItemMeasurement.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,KAAa,EACbC,UAAmD,EACnD;EACA,MAAMC,aAAa,GAAG,IAAAC,aAAM,EAAgB,IAAI,CAAC;EAEjD,MAAMC,QAAQ,GAAG,IAAAC,kBAAW,EACzBC,CAAoB,IAAK;IACxB,MAAMC,MAAM,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM,CAACF,MAAM;;IAE1C;IACA,IAAIL,aAAa,CAACQ,OAAO,KAAKH,MAAM,EAAE;IAEtCL,aAAa,CAACQ,OAAO,GAAGH,MAAM;IAC9BN,UAAU,CAACD,KAAK,EAAEO,MAAM,CAAC;EAC3B,CAAC,EACD,CAACP,KAAK,EAAEC,UAAU,CACpB,CAAC;EAED,OAAOG,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NitroLayoutEngine = void 0;
|
|
7
|
+
var _reactNativeNitroModules = require("react-native-nitro-modules");
|
|
8
|
+
const NitroLayoutEngine = exports.NitroLayoutEngine = _reactNativeNitroModules.NitroModules.createHybridObject('NitroLayoutEngine');
|
|
9
|
+
//# sourceMappingURL=NitroLayoutEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","NitroLayoutEngine","exports","NitroModules","createHybridObject"],"sourceRoot":"../../../src","sources":["native/NitroLayoutEngine.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAGO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5BE,qCAAY,CAACC,kBAAkB,CAC7B,mBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["native/NitroList.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NitroRecyclerView = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const NitroRecyclerView = exports.NitroRecyclerView = (0, _reactNative.requireNativeComponent)('NitroRecyclerView');
|
|
9
|
+
//# sourceMappingURL=NitroRecyclerView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NitroRecyclerView","exports","requireNativeComponent"],"sourceRoot":"../../../src","sources":["native/NitroRecyclerView.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMO,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAC5B,IAAAE,mCAAsB,EAAyB,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PrefetchHelper = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Callback invoked when new items should be prefetched.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* PrefetchHelper
|
|
13
|
+
*
|
|
14
|
+
* Stateless with respect to layout.
|
|
15
|
+
* Only tracks what has already been prefetched to avoid duplication.
|
|
16
|
+
*
|
|
17
|
+
* Designed to be driven by *visible window*, not scroll events.
|
|
18
|
+
*/
|
|
19
|
+
class PrefetchHelper {
|
|
20
|
+
lastPrefetched = new Set();
|
|
21
|
+
runPrefetch(visibleIndices, itemCount, aheadCount, onPrefetch) {
|
|
22
|
+
if (visibleIndices.length === 0) return;
|
|
23
|
+
const lastVisible = visibleIndices[visibleIndices.length - 1];
|
|
24
|
+
const start = lastVisible + 1;
|
|
25
|
+
const end = Math.min(itemCount - 1, start + aheadCount);
|
|
26
|
+
const toPrefetch = [];
|
|
27
|
+
for (let i = start; i <= end; i++) {
|
|
28
|
+
if (!this.lastPrefetched.has(i)) {
|
|
29
|
+
this.lastPrefetched.add(i);
|
|
30
|
+
toPrefetch.push(i);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (toPrefetch.length > 0) {
|
|
34
|
+
onPrefetch(toPrefetch);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.PrefetchHelper = PrefetchHelper;
|
|
39
|
+
//# sourceMappingURL=PrefetchHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PrefetchHelper","lastPrefetched","Set","runPrefetch","visibleIndices","itemCount","aheadCount","onPrefetch","length","lastVisible","start","end","Math","min","toPrefetch","i","has","add","push","exports"],"sourceRoot":"../../../src","sources":["prefetch/PrefetchHelper.ts"],"mappings":";;;;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,CAAC;EAClBC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAE1CC,WAAWA,CACTC,cAAiC,EACjCC,SAAiB,EACjBC,UAAkB,EAClBC,UAA4B,EAC5B;IACA,IAAIH,cAAc,CAACI,MAAM,KAAK,CAAC,EAAE;IAEjC,MAAMC,WAAW,GACfL,cAAc,CAACA,cAAc,CAACI,MAAM,GAAG,CAAC,CAAE;IAE5C,MAAME,KAAK,GAAGD,WAAW,GAAG,CAAC;IAC7B,MAAME,GAAG,GAAGC,IAAI,CAACC,GAAG,CAClBR,SAAS,GAAG,CAAC,EACbK,KAAK,GAAGJ,UACV,CAAC;IAED,MAAMQ,UAAoB,GAAG,EAAE;IAE/B,KAAK,IAAIC,CAAC,GAAGL,KAAK,EAAEK,CAAC,IAAIJ,GAAG,EAAEI,CAAC,EAAE,EAAE;MACjC,IAAI,CAAC,IAAI,CAACd,cAAc,CAACe,GAAG,CAACD,CAAC,CAAC,EAAE;QAC/B,IAAI,CAACd,cAAc,CAACgB,GAAG,CAACF,CAAC,CAAC;QAC1BD,UAAU,CAACI,IAAI,CAACH,CAAC,CAAC;MACpB;IACF;IAEA,IAAID,UAAU,CAACN,MAAM,GAAG,CAAC,EAAE;MACzBD,UAAU,CAACO,UAAU,CAAC;IACxB;EACF;AACF;AAACK,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CellPool = void 0;
|
|
7
|
+
class CellPool {
|
|
8
|
+
pools = new Map();
|
|
9
|
+
maxPerType = new Map();
|
|
10
|
+
|
|
11
|
+
/** ✅ NEW: check if a type is registered */
|
|
12
|
+
hasType(type) {
|
|
13
|
+
return this.pools.has(type);
|
|
14
|
+
}
|
|
15
|
+
registerType(type, maxCount) {
|
|
16
|
+
if (this.maxPerType.has(type)) return;
|
|
17
|
+
this.maxPerType.set(type, maxCount);
|
|
18
|
+
this.pools.set(type, []);
|
|
19
|
+
}
|
|
20
|
+
acquire(type) {
|
|
21
|
+
const bucket = this.pools.get(type);
|
|
22
|
+
if (!bucket || bucket.length === 0) return null;
|
|
23
|
+
return bucket.pop();
|
|
24
|
+
}
|
|
25
|
+
release(cell) {
|
|
26
|
+
const {
|
|
27
|
+
type
|
|
28
|
+
} = cell;
|
|
29
|
+
const bucket = this.pools.get(type);
|
|
30
|
+
const max = this.maxPerType.get(type);
|
|
31
|
+
if (!bucket || max === undefined) return;
|
|
32
|
+
cell.index = -1;
|
|
33
|
+
if (bucket.length >= max) return;
|
|
34
|
+
bucket.push(cell);
|
|
35
|
+
}
|
|
36
|
+
clear() {
|
|
37
|
+
for (const bucket of this.pools.values()) {
|
|
38
|
+
bucket.length = 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
getPoolSize(type) {
|
|
42
|
+
return this.pools.get(type)?.length ?? 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.CellPool = CellPool;
|
|
46
|
+
//# sourceMappingURL=CellPool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CellPool","pools","Map","maxPerType","hasType","type","has","registerType","maxCount","set","acquire","bucket","get","length","pop","release","cell","max","undefined","index","push","clear","values","getPoolSize","exports"],"sourceRoot":"../../../src","sources":["recycler/CellPool.ts"],"mappings":";;;;;;AAGO,MAAMA,QAAQ,CAAC;EACHC,KAAK,GAAG,IAAIC,GAAG,CAAmC,CAAC;EACnDC,UAAU,GAAG,IAAID,GAAG,CAAmB,CAAC;;EAEzD;EACAE,OAAOA,CAACC,IAAc,EAAW;IAC/B,OAAO,IAAI,CAACJ,KAAK,CAACK,GAAG,CAACD,IAAI,CAAC;EAC7B;EAEAE,YAAYA,CAACF,IAAc,EAAEG,QAAgB,EAAQ;IACnD,IAAI,IAAI,CAACL,UAAU,CAACG,GAAG,CAACD,IAAI,CAAC,EAAE;IAC/B,IAAI,CAACF,UAAU,CAACM,GAAG,CAACJ,IAAI,EAAEG,QAAQ,CAAC;IACnC,IAAI,CAACP,KAAK,CAACQ,GAAG,CAACJ,IAAI,EAAE,EAAE,CAAC;EAC1B;EAEAK,OAAOA,CAACL,IAAc,EAA+B;IACnD,MAAMM,MAAM,GAAG,IAAI,CAACV,KAAK,CAACW,GAAG,CAACP,IAAI,CAAC;IACnC,IAAI,CAACM,MAAM,IAAIA,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;IAC/C,OAAOF,MAAM,CAACG,GAAG,CAAC,CAAC;EACrB;EAEAC,OAAOA,CAACC,IAA0B,EAAQ;IACxC,MAAM;MAAEX;IAAK,CAAC,GAAGW,IAAI;IACrB,MAAML,MAAM,GAAG,IAAI,CAACV,KAAK,CAACW,GAAG,CAACP,IAAI,CAAC;IACnC,MAAMY,GAAG,GAAG,IAAI,CAACd,UAAU,CAACS,GAAG,CAACP,IAAI,CAAC;IAErC,IAAI,CAACM,MAAM,IAAIM,GAAG,KAAKC,SAAS,EAAE;IAElCF,IAAI,CAACG,KAAK,GAAG,CAAC,CAAC;IAEf,IAAIR,MAAM,CAACE,MAAM,IAAII,GAAG,EAAE;IAC1BN,MAAM,CAACS,IAAI,CAACJ,IAAI,CAAC;EACnB;EAEAK,KAAKA,CAAA,EAAS;IACZ,KAAK,MAAMV,MAAM,IAAI,IAAI,CAACV,KAAK,CAACqB,MAAM,CAAC,CAAC,EAAE;MACxCX,MAAM,CAACE,MAAM,GAAG,CAAC;IACnB;EACF;EAEAU,WAAWA,CAAClB,IAAc,EAAU;IAClC,OAAO,IAAI,CAACJ,KAAK,CAACW,GAAG,CAACP,IAAI,CAAC,EAAEQ,MAAM,IAAI,CAAC;EAC1C;AACF;AAACW,OAAA,CAAAxB,QAAA,GAAAA,QAAA","ignoreList":[]}
|