react-native-nitro-list 0.1.1 → 0.1.3
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 +16 -44
- package/ios/HybridNitroList.swift +12 -14
- package/lib/commonjs/cell/CellKeyGenerator.js +21 -0
- package/lib/commonjs/cell/CellKeyGenerator.js.map +1 -0
- package/lib/commonjs/cell/CellRecycler.js +48 -40
- package/lib/commonjs/cell/CellRecycler.js.map +1 -1
- 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/getVisibleIndices.js.map +1 -1
- package/lib/commonjs/hooks/usePersistentCallback.js +36 -0
- package/lib/commonjs/hooks/usePersistentCallback.js.map +1 -0
- package/lib/commonjs/index.js +31 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/MutableLinearLayout.js +78 -39
- package/lib/commonjs/layout/MutableLinearLayout.js.map +1 -1
- 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 +0 -18
- package/lib/commonjs/layout/index.js.map +1 -1
- package/lib/commonjs/native/NitroListView.js +20 -0
- package/lib/commonjs/native/NitroListView.js.map +1 -0
- package/lib/commonjs/recycler/CellPool.js +33 -0
- package/lib/commonjs/recycler/CellPool.js.map +1 -0
- package/lib/commonjs/recycler/NitroList.js +223 -0
- package/lib/commonjs/recycler/NitroList.js.map +1 -0
- package/lib/commonjs/scroll/useScrollVelocity.js +20 -0
- package/lib/commonjs/scroll/useScrollVelocity.js.map +1 -0
- package/lib/commonjs/{native/NitroList.types.js → specs/NitroList.nitro.js} +1 -1
- package/lib/commonjs/{layout/LayoutProvider.js.map → specs/NitroList.nitro.js.map} +1 -1
- package/lib/commonjs/types/Axis.js +2 -0
- package/lib/{module/layout/LayoutProvider.js.map → commonjs/types/Axis.js.map} +1 -1
- package/lib/commonjs/types/CellKey.js +2 -0
- package/lib/commonjs/{layout/LayoutRectangle.js.map → types/CellKey.js.map} +1 -1
- package/lib/commonjs/types/CellType.js +27 -0
- package/lib/commonjs/types/CellType.js.map +1 -0
- package/lib/commonjs/types/VisibleRange.js +2 -0
- package/lib/commonjs/{native/NitroList.types.js.map → types/VisibleRange.js.map} +1 -1
- package/lib/commonjs/{RecyclerList.types.js → types/VisibleRangeInput.js} +1 -1
- 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/{specs/nitro-layout-engine.nitro.js → types/layout/LinearLayoutInput.js} +1 -1
- 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/CellPool.js +42 -0
- package/lib/commonjs/types/recycler/CellPool.js.map +1 -0
- package/lib/commonjs/{layout/LayoutProvider.js → types/recycler/NitroListProps.js} +1 -1
- package/lib/commonjs/types/recycler/NitroListProps.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerCell.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerCell.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/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/windowing/computeVisibleItemRange.js +61 -0
- package/lib/commonjs/windowing/computeVisibleItemRange.js.map +1 -0
- package/lib/commonjs/windowing/index.js +3 -3
- package/lib/commonjs/windowing/index.js.map +1 -1
- package/lib/module/cell/CellKeyGenerator.js +16 -0
- package/lib/module/cell/CellKeyGenerator.js.map +1 -0
- package/lib/module/cell/CellRecycler.js +48 -39
- package/lib/module/cell/CellRecycler.js.map +1 -1
- 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/getVisibleIndices.js.map +1 -1
- package/lib/module/hooks/usePersistentCallback.js +33 -0
- package/lib/module/hooks/usePersistentCallback.js.map +1 -0
- package/lib/module/index.js +5 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/MutableLinearLayout.js +78 -38
- package/lib/module/layout/MutableLinearLayout.js.map +1 -1
- 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 +0 -3
- package/lib/module/layout/index.js.map +1 -1
- package/lib/module/native/NitroListView.js +17 -0
- package/lib/module/native/NitroListView.js.map +1 -0
- package/lib/module/recycler/CellPool.js +28 -0
- package/lib/module/recycler/CellPool.js.map +1 -0
- package/lib/module/recycler/NitroList.js +220 -0
- package/lib/module/recycler/NitroList.js.map +1 -0
- package/lib/module/scroll/useScrollVelocity.js +16 -0
- package/lib/module/scroll/useScrollVelocity.js.map +1 -0
- package/lib/module/specs/NitroList.nitro.js +4 -0
- package/lib/module/specs/NitroList.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 +22 -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/CellPool.js +37 -0
- package/lib/module/types/recycler/CellPool.js.map +1 -0
- package/lib/module/types/recycler/NitroListProps.js +4 -0
- package/lib/module/types/recycler/NitroListProps.js.map +1 -0
- package/lib/module/types/recycler/RecyclerCell.js +4 -0
- package/lib/module/types/recycler/RecyclerCell.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/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/windowing/computeVisibleItemRange.js +57 -0
- package/lib/module/windowing/computeVisibleItemRange.js.map +1 -0
- package/lib/module/windowing/index.js +1 -1
- package/lib/module/windowing/index.js.map +1 -1
- package/lib/typescript/src/cell/Cell.d.ts +13 -4
- package/lib/typescript/src/cell/Cell.d.ts.map +1 -1
- 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 +19 -11
- package/lib/typescript/src/cell/CellRecycler.d.ts.map +1 -1
- 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/getVisibleIndices.d.ts +2 -2
- package/lib/typescript/src/getVisibleIndices.d.ts.map +1 -1
- 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 +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts +45 -13
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts.map +1 -1
- 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 +1 -4
- package/lib/typescript/src/layout/index.d.ts.map +1 -1
- package/lib/typescript/src/native/NitroListView.d.ts +20 -0
- package/lib/typescript/src/native/NitroListView.d.ts.map +1 -0
- package/lib/typescript/src/recycler/CellPool.d.ts +11 -0
- package/lib/typescript/src/recycler/CellPool.d.ts.map +1 -0
- package/lib/typescript/src/recycler/NitroList.d.ts +4 -0
- package/lib/typescript/src/recycler/NitroList.d.ts.map +1 -0
- package/lib/typescript/src/scroll/useScrollVelocity.d.ts +2 -0
- package/lib/typescript/src/scroll/useScrollVelocity.d.ts.map +1 -0
- package/lib/typescript/src/specs/NitroList.nitro.d.ts +26 -0
- package/lib/typescript/src/specs/NitroList.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 +2 -0
- package/lib/typescript/src/types/CellKey.d.ts.map +1 -0
- package/lib/typescript/src/types/CellType.d.ts +22 -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/CellPool.d.ts +16 -0
- package/lib/typescript/src/types/recycler/CellPool.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/NitroListProps.d.ts +66 -0
- package/lib/typescript/src/types/recycler/NitroListProps.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerCell.d.ts +12 -0
- package/lib/typescript/src/types/recycler/RecyclerCell.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts +12 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.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/windowing/computeVisibleItemRange.d.ts +19 -0
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts.map +1 -0
- package/lib/typescript/src/windowing/index.d.ts +1 -1
- package/lib/typescript/src/windowing/index.d.ts.map +1 -1
- package/nitro.json +5 -5
- package/nitrogen/generated/android/NitroList+autolinking.cmake +2 -2
- package/nitrogen/generated/android/NitroListOnLoad.cpp +2 -2
- package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.cpp → JHybridNitroListSpec.cpp} +15 -15
- package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.hpp → JHybridNitroListSpec.hpp} +11 -11
- package/nitrogen/generated/android/c++/{JLayoutRectangle.hpp → JItemLayout.hpp} +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{HybridNitroLayoutEngineSpec.kt → HybridNitroListSpec.kt} +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{LayoutRectangle.kt → ItemLayout.kt} +5 -5
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.cpp +9 -9
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +27 -27
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +8 -8
- package/nitrogen/generated/ios/c++/{HybridNitroLayoutEngineSpecSwift.cpp → HybridNitroListSpecSwift.cpp} +2 -2
- package/nitrogen/generated/ios/c++/{HybridNitroLayoutEngineSpecSwift.hpp → HybridNitroListSpecSwift.hpp} +16 -16
- package/nitrogen/generated/ios/swift/HybridNitroListSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/{HybridNitroLayoutEngineSpec_cxx.swift → HybridNitroListSpec_cxx.swift} +23 -23
- package/nitrogen/generated/ios/swift/{LayoutRectangle.swift → ItemLayout.swift} +5 -5
- package/nitrogen/generated/shared/c++/{HybridNitroLayoutEngineSpec.cpp → HybridNitroListSpec.cpp} +4 -4
- package/nitrogen/generated/shared/c++/{HybridNitroLayoutEngineSpec.hpp → HybridNitroListSpec.hpp} +13 -13
- package/nitrogen/generated/shared/c++/{LayoutRectangle.hpp → ItemLayout.hpp} +11 -11
- package/package.json +5 -5
- package/src/cell/Cell.ts +13 -4
- package/src/cell/CellKeyGenerator.ts +17 -0
- package/src/cell/CellRecycler.ts +53 -43
- package/src/cell/createCell.ts +15 -0
- package/src/cell/index.ts +5 -0
- package/src/getVisibleIndices.ts +4 -2
- package/src/hooks/usePersistentCallback.ts +37 -0
- package/src/index.ts +7 -2
- package/src/layout/MutableLinearLayout.ts +91 -58
- package/src/layout/constants/layoutDefaults.ts +12 -0
- package/src/layout/index.ts +1 -4
- package/src/native/NitroListView.ts +22 -0
- package/src/recycler/CellPool.ts +33 -0
- package/src/recycler/NitroList.tsx +317 -0
- package/src/scroll/useScrollVelocity.ts +16 -0
- package/src/specs/NitroList.nitro.ts +29 -0
- package/src/types/Axis.ts +10 -0
- package/src/types/CellKey.ts +2 -0
- package/src/types/CellType.ts +9 -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/CellPool.ts +45 -0
- package/src/types/recycler/NitroListProps.ts +74 -0
- package/src/types/recycler/RecyclerCell.ts +12 -0
- package/src/types/recycler/RecyclerItemRenderer.ts +12 -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/windowing/computeVisibleItemRange.ts +82 -0
- package/src/windowing/index.ts +1 -1
- package/lib/commonjs/NitroList.js +0 -9
- package/lib/commonjs/NitroList.js.map +0 -1
- package/lib/commonjs/RecyclerList.internal.js +0 -25
- package/lib/commonjs/RecyclerList.internal.js.map +0 -1
- package/lib/commonjs/RecyclerList.js +0 -171
- package/lib/commonjs/RecyclerList.js.map +0 -1
- package/lib/commonjs/RecyclerList.types.js.map +0 -1
- package/lib/commonjs/cell/StableKey.js +0 -10
- package/lib/commonjs/cell/StableKey.js.map +0 -1
- package/lib/commonjs/hooks/useCellRenderer.js +0 -62
- package/lib/commonjs/hooks/useCellRenderer.js.map +0 -1
- package/lib/commonjs/hooks/useStableCallback.js +0 -13
- package/lib/commonjs/hooks/useStableCallback.js.map +0 -1
- package/lib/commonjs/layout/EstimatedLayoutProvider.js +0 -30
- package/lib/commonjs/layout/EstimatedLayoutProvider.js.map +0 -1
- package/lib/commonjs/layout/LayoutEngine.js +0 -21
- package/lib/commonjs/layout/LayoutEngine.js.map +0 -1
- package/lib/commonjs/layout/LayoutRectangle.js +0 -2
- package/lib/commonjs/native/NitroLayoutEngine.js +0 -9
- package/lib/commonjs/native/NitroLayoutEngine.js.map +0 -1
- package/lib/commonjs/native/NitroRecyclerView.js +0 -9
- package/lib/commonjs/native/NitroRecyclerView.js.map +0 -1
- package/lib/commonjs/specs/nitro-layout-engine.nitro.js.map +0 -1
- package/lib/commonjs/viewability/ViewabilityHelper.js +0 -121
- package/lib/commonjs/viewability/ViewabilityHelper.js.map +0 -1
- package/lib/commonjs/windowing/findVisibleIndexRange.js +0 -48
- package/lib/commonjs/windowing/findVisibleIndexRange.js.map +0 -1
- package/lib/module/NitroList.js +0 -5
- package/lib/module/NitroList.js.map +0 -1
- package/lib/module/RecyclerList.internal.js +0 -22
- package/lib/module/RecyclerList.internal.js.map +0 -1
- package/lib/module/RecyclerList.js +0 -166
- package/lib/module/RecyclerList.js.map +0 -1
- package/lib/module/RecyclerList.types.js +0 -4
- package/lib/module/RecyclerList.types.js.map +0 -1
- package/lib/module/cell/StableKey.js +0 -6
- package/lib/module/cell/StableKey.js.map +0 -1
- package/lib/module/hooks/useCellRenderer.js +0 -58
- package/lib/module/hooks/useCellRenderer.js.map +0 -1
- package/lib/module/hooks/useStableCallback.js +0 -9
- package/lib/module/hooks/useStableCallback.js.map +0 -1
- package/lib/module/layout/EstimatedLayoutProvider.js +0 -25
- package/lib/module/layout/EstimatedLayoutProvider.js.map +0 -1
- package/lib/module/layout/LayoutEngine.js +0 -17
- package/lib/module/layout/LayoutEngine.js.map +0 -1
- package/lib/module/layout/LayoutProvider.js +0 -4
- package/lib/module/layout/LayoutRectangle.js +0 -2
- package/lib/module/layout/LayoutRectangle.js.map +0 -1
- package/lib/module/native/NitroLayoutEngine.js +0 -5
- package/lib/module/native/NitroLayoutEngine.js.map +0 -1
- package/lib/module/native/NitroList.types.js +0 -4
- package/lib/module/native/NitroList.types.js.map +0 -1
- package/lib/module/native/NitroRecyclerView.js +0 -5
- package/lib/module/native/NitroRecyclerView.js.map +0 -1
- package/lib/module/specs/nitro-layout-engine.nitro.js +0 -4
- package/lib/module/specs/nitro-layout-engine.nitro.js.map +0 -1
- package/lib/module/viewability/ViewabilityHelper.js +0 -116
- package/lib/module/viewability/ViewabilityHelper.js.map +0 -1
- package/lib/module/windowing/findVisibleIndexRange.js +0 -44
- package/lib/module/windowing/findVisibleIndexRange.js.map +0 -1
- package/lib/typescript/src/NitroList.d.ts +0 -5
- package/lib/typescript/src/NitroList.d.ts.map +0 -1
- package/lib/typescript/src/RecyclerList.d.ts +0 -26
- package/lib/typescript/src/RecyclerList.d.ts.map +0 -1
- package/lib/typescript/src/RecyclerList.internal.d.ts +0 -9
- package/lib/typescript/src/RecyclerList.internal.d.ts.map +0 -1
- package/lib/typescript/src/RecyclerList.types.d.ts +0 -18
- package/lib/typescript/src/RecyclerList.types.d.ts.map +0 -1
- package/lib/typescript/src/__tests__/windowing/findVisibleIndexRange.test.d.ts +0 -2
- package/lib/typescript/src/__tests__/windowing/findVisibleIndexRange.test.d.ts.map +0 -1
- package/lib/typescript/src/cell/StableKey.d.ts +0 -2
- package/lib/typescript/src/cell/StableKey.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCellRenderer.d.ts +0 -19
- package/lib/typescript/src/hooks/useCellRenderer.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useStableCallback.d.ts +0 -2
- package/lib/typescript/src/hooks/useStableCallback.d.ts.map +0 -1
- package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts +0 -15
- package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts.map +0 -1
- package/lib/typescript/src/layout/LayoutEngine.d.ts +0 -10
- package/lib/typescript/src/layout/LayoutEngine.d.ts.map +0 -1
- package/lib/typescript/src/layout/LayoutProvider.d.ts +0 -16
- package/lib/typescript/src/layout/LayoutProvider.d.ts.map +0 -1
- package/lib/typescript/src/layout/LayoutRectangle.d.ts +0 -11
- package/lib/typescript/src/layout/LayoutRectangle.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts +0 -3
- package/lib/typescript/src/native/NitroLayoutEngine.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroList.types.d.ts +0 -9
- package/lib/typescript/src/native/NitroList.types.d.ts.map +0 -1
- package/lib/typescript/src/native/NitroRecyclerView.d.ts +0 -5
- package/lib/typescript/src/native/NitroRecyclerView.d.ts.map +0 -1
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts +0 -14
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts.map +0 -1
- package/lib/typescript/src/viewability/ViewabilityHelper.d.ts +0 -50
- package/lib/typescript/src/viewability/ViewabilityHelper.d.ts.map +0 -1
- package/lib/typescript/src/windowing/findVisibleIndexRange.d.ts +0 -11
- package/lib/typescript/src/windowing/findVisibleIndexRange.d.ts.map +0 -1
- package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec.swift +0 -56
- package/src/NitroList.ts +0 -8
- package/src/RecyclerList.internal.ts +0 -38
- package/src/RecyclerList.tsx +0 -252
- package/src/RecyclerList.types.ts +0 -24
- package/src/__tests__/windowing/findVisibleIndexRange.test.ts +0 -55
- package/src/cell/StableKey.ts +0 -6
- package/src/hooks/useCellRenderer.ts +0 -86
- package/src/hooks/useStableCallback.ts +0 -13
- package/src/layout/EstimatedLayoutProvider.ts +0 -35
- package/src/layout/LayoutEngine.ts +0 -21
- package/src/layout/LayoutProvider.ts +0 -17
- package/src/layout/LayoutRectangle.ts +0 -10
- package/src/native/NitroLayoutEngine.ts +0 -7
- package/src/native/NitroList.types.ts +0 -12
- package/src/native/NitroRecyclerView.ts +0 -8
- package/src/specs/nitro-layout-engine.nitro.ts +0 -17
- package/src/viewability/ViewabilityHelper.ts +0 -130
- package/src/windowing/findVisibleIndexRange.ts +0 -60
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type { Cell } from './Cell';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* FlashList equivalent: CellRecycler
|
|
3
|
+
* Manages physical cell reuse.
|
|
4
|
+
* Imperative and stateful by design.
|
|
5
|
+
* This is NOT React code.
|
|
7
6
|
*/
|
|
8
7
|
export declare class CellRecycler {
|
|
9
|
-
private readonly activeCells;
|
|
10
|
-
private readonly reusableCellsByType;
|
|
11
|
-
private readonly orderedCells;
|
|
12
|
-
private nextCellId;
|
|
13
8
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Returns a stable ordered snapshot.
|
|
9
|
+
* Active cells mapped by logical index.
|
|
16
10
|
*/
|
|
17
|
-
|
|
11
|
+
private readonly indexToCell;
|
|
12
|
+
/**
|
|
13
|
+
* Pool of detached reusable cells.
|
|
14
|
+
*/
|
|
15
|
+
private readonly recycledCells;
|
|
16
|
+
/**
|
|
17
|
+
* Reconcile a contiguous visible index range
|
|
18
|
+
* into a stable list of physical cells.
|
|
19
|
+
*
|
|
20
|
+
* HOT PATH:
|
|
21
|
+
* - No index arrays
|
|
22
|
+
* - Minimal allocations
|
|
23
|
+
* - Deterministic
|
|
24
|
+
*/
|
|
25
|
+
reconcileRange(startIndex: number, endIndex: number, resolveCellType: (index: number) => string): readonly Cell[];
|
|
18
26
|
}
|
|
19
27
|
//# sourceMappingURL=CellRecycler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellRecycler.d.ts","sourceRoot":"","sources":["../../../../src/cell/CellRecycler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"CellRecycler.d.ts","sourceRoot":"","sources":["../../../../src/cell/CellRecycler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAGlC;;;;GAIG;AACH,qBAAa,YAAY;IACvB;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IAEtD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAa;IAE3C;;;;;;;;OAQG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACzC,SAAS,IAAI,EAAE;CA2CnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCell.d.ts","sourceRoot":"","sources":["../../../../src/cell/createCell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAIlC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAM7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cell/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LayoutRect } from './types/layout';
|
|
2
2
|
import type { ScrollMetrics } from './windowing/ScrollMetrics';
|
|
3
3
|
/**
|
|
4
4
|
* Binary-search based windowing.
|
|
5
5
|
* Returns indices intersecting viewport ± buffer.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getVisibleRange(layouts: readonly
|
|
7
|
+
export declare function getVisibleRange(layouts: readonly LayoutRect[], metrics: ScrollMetrics, bufferPx: number): readonly number[];
|
|
8
8
|
//# sourceMappingURL=getVisibleIndices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVisibleIndices.d.ts","sourceRoot":"","sources":["../../../src/getVisibleIndices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getVisibleIndices.d.ts","sourceRoot":"","sources":["../../../src/getVisibleIndices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,SAAS,MAAM,EAAE,CAyCnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a function whose identity is stable across renders,
|
|
3
|
+
* but always invokes the latest provided implementation.
|
|
4
|
+
*
|
|
5
|
+
* Invariants:
|
|
6
|
+
* - Function reference NEVER changes
|
|
7
|
+
* - Logic is ALWAYS up to date
|
|
8
|
+
*
|
|
9
|
+
* This is critical for long-lived systems such as:
|
|
10
|
+
* - Recyclers
|
|
11
|
+
* - Effects
|
|
12
|
+
* - Native bridges
|
|
13
|
+
* - Event pipelines
|
|
14
|
+
*/
|
|
15
|
+
export declare function usePersistentCallback<T extends (...args: never[]) => unknown>(fn: T): T;
|
|
16
|
+
//# sourceMappingURL=usePersistentCallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePersistentCallback.d.ts","sourceRoot":"","sources":["../../../../src/hooks/usePersistentCallback.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EACvC,EAAE,EAAE,CAAC,GAAG,CAAC,CAkBV"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './native/NitroListView';
|
|
2
|
+
export * from './specs/NitroList.nitro';
|
|
3
|
+
export { default as NitroList } from './recycler/NitroList';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAC;AAEvC,cAAc,yBAAyB,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,22 +1,54 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Axis } from '../types/Axis';
|
|
2
|
+
import type { LinearLayoutInput } from '../types/layout';
|
|
3
|
+
import type { LayoutRect } from '../types/layout/LayoutRect';
|
|
2
4
|
/**
|
|
3
|
-
* Mutable linear layout
|
|
4
|
-
*
|
|
5
|
+
* Mutable, deterministic linear layout engine.
|
|
6
|
+
*
|
|
7
|
+
* Responsibilities:
|
|
8
|
+
* - Compute absolute item geometry
|
|
9
|
+
* - Own layout truth (no React, no scroll state)
|
|
10
|
+
* - Guarantee monotonic ordering along the main axis
|
|
11
|
+
*
|
|
12
|
+
* Cross-platform equivalents:
|
|
13
|
+
* - Flutter: RenderSliver / SliverList
|
|
14
|
+
* - Android: LinearLayoutManager
|
|
15
|
+
* - iOS: UICollectionViewFlowLayout (linear)
|
|
5
16
|
*/
|
|
6
17
|
export declare class MutableLinearLayout {
|
|
7
|
-
private readonly
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
private readonly isVertical;
|
|
19
|
+
/** Absolute item layouts in index order */
|
|
20
|
+
private layouts;
|
|
21
|
+
/** Total scrollable size along main axis */
|
|
22
|
+
private contentSize;
|
|
23
|
+
constructor(axis: Axis);
|
|
10
24
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
25
|
+
* Computes layout synchronously from input.
|
|
26
|
+
*
|
|
27
|
+
* This method is intentionally parameter-object based
|
|
28
|
+
* to allow future extension without breaking API.
|
|
29
|
+
*
|
|
30
|
+
* Invariants:
|
|
31
|
+
* - Layouts are monotonic along main axis
|
|
32
|
+
* - No gaps except explicit spacing
|
|
33
|
+
* - Deterministic for identical inputs
|
|
13
34
|
*/
|
|
14
|
-
|
|
15
|
-
getContentHeight(): number;
|
|
35
|
+
compute(input: LinearLayoutInput): void;
|
|
16
36
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
37
|
+
* Returns computed item layouts.
|
|
38
|
+
*
|
|
39
|
+
* Order is guaranteed monotonic along the main axis,
|
|
40
|
+
* which is required for binary-search-based windowing.
|
|
19
41
|
*/
|
|
20
|
-
|
|
42
|
+
getLayouts(): readonly LayoutRect[];
|
|
43
|
+
/**
|
|
44
|
+
* Returns total scrollable size along the main axis,
|
|
45
|
+
* including padding and inter-item spacing.
|
|
46
|
+
*/
|
|
47
|
+
getContentSize(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Clears internal layout state.
|
|
50
|
+
* Call on severe invalidation or teardown.
|
|
51
|
+
*/
|
|
52
|
+
reset(): void;
|
|
21
53
|
}
|
|
22
54
|
//# sourceMappingURL=MutableLinearLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableLinearLayout.d.ts","sourceRoot":"","sources":["../../../../src/layout/MutableLinearLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"MutableLinearLayout.d.ts","sourceRoot":"","sources":["../../../../src/layout/MutableLinearLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAI5D;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC,2CAA2C;IAC3C,OAAO,CAAC,OAAO,CAAmB;IAElC,4CAA4C;IAC5C,OAAO,CAAC,WAAW,CAAI;gBAEX,IAAI,EAAE,IAAI;IAItB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IA0CvC;;;;;OAKG;IACH,UAAU,IAAI,SAAS,UAAU,EAAE;IAInC;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACH,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default spacing between items along the main axis.
|
|
3
|
+
*
|
|
4
|
+
* This value is used by layout engines when no explicit
|
|
5
|
+
* itemSpacing is provided.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors:
|
|
8
|
+
* - Android RecyclerView ItemDecoration (typical 8–16dp)
|
|
9
|
+
* - iOS UICollectionViewFlowLayout minimumLineSpacing
|
|
10
|
+
* - Flutter SliverList spacing conventions
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_ITEM_SPACING = 12;
|
|
13
|
+
//# sourceMappingURL=layoutDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutDefaults.d.ts","sourceRoot":"","sources":["../../../../../src/layout/constants/layoutDefaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAA"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { LayoutProvider } from './LayoutProvider';
|
|
3
|
-
export { EstimatedLayoutProvider } from './EstimatedLayoutProvider';
|
|
4
|
-
export { computeLayouts } from './LayoutEngine';
|
|
1
|
+
export type { MutableLinearLayout } from './MutableLinearLayout';
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the NitroListView.
|
|
4
|
+
* * We extend ViewProps so that developers can use standard styles
|
|
5
|
+
* like 'flex: 1' or 'backgroundColor' on the list.
|
|
6
|
+
*/
|
|
7
|
+
export type NitroListViewProps = ViewProps & {
|
|
8
|
+
/**
|
|
9
|
+
* The total number of items to be displayed in the list.
|
|
10
|
+
* This is passed to the native side (Swift/Kotlin) for layout math.
|
|
11
|
+
*/
|
|
12
|
+
itemCount: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The Native Component that maps to the physical view in Swift/Kotlin.
|
|
16
|
+
* * 'NitroListView' is the "Secret Handshake" name. It must match
|
|
17
|
+
* the name exported by your Native ViewManagers.
|
|
18
|
+
*/
|
|
19
|
+
export declare const NitroListView: import("react-native").HostComponent<NitroListViewProps>;
|
|
20
|
+
//# sourceMappingURL=NitroListView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroListView.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroListView.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAErE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,0DACmC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecyclerCell } from '../types/recycler/RecyclerCell';
|
|
2
|
+
import type { CellType } from '../types/CellType';
|
|
3
|
+
export declare class CellPool<T extends RecyclerCell<any>> {
|
|
4
|
+
private readonly pools;
|
|
5
|
+
private readonly maxPerType;
|
|
6
|
+
hasType(type: CellType): boolean;
|
|
7
|
+
registerType(type: CellType, maxCount: number): void;
|
|
8
|
+
acquire(type: CellType): T | null;
|
|
9
|
+
release(cell: T): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CellPool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellPool.d.ts","sourceRoot":"","sources":["../../../../src/recycler/CellPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD,qBAAa,QAAQ,CAAC,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IAEzD,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAIhC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMpD,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,GAAG,IAAI;IAMjC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;CASvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroList.d.ts","sourceRoot":"","sources":["../../../../src/recycler/NitroList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAW1D,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AA0BrE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,CAAC,EACjC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GACvB,KAAK,CAAC,YAAY,CA6QpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollVelocity.d.ts","sourceRoot":"","sources":["../../../../src/scroll/useScrollVelocity.ts"],"names":[],"mappings":"AAAA,wBAAgB,2BAA2B,KAIb,QAAQ,MAAM,KAAG,MAAM,CAWpD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the physical area an item occupies on the screen.
|
|
4
|
+
* Standard: 'Layout' suffix tells the user this is a data object, not a logic object.
|
|
5
|
+
*/
|
|
6
|
+
export interface ItemLayout {
|
|
7
|
+
readonly x: number;
|
|
8
|
+
readonly y: number;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The high-performance layout engine for NitroList.
|
|
14
|
+
* This interface will be used by Nitro to generate your Swift and Kotlin code.
|
|
15
|
+
*/
|
|
16
|
+
export interface NitroList extends HybridObject<{
|
|
17
|
+
ios: 'swift';
|
|
18
|
+
android: 'kotlin';
|
|
19
|
+
}> {
|
|
20
|
+
/**
|
|
21
|
+
* Calculates exactly where every item should sit on the screen.
|
|
22
|
+
* Standard: Use descriptive parameter names so developers know what to provide.
|
|
23
|
+
*/
|
|
24
|
+
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly ItemLayout[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=NitroList.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroList.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/NitroList.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,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;;;GAGG;AACH,MAAM,WAAW,SACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IAEzD;;;OAGG;IACH,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,UAAU,EAAE,CAAA;CACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axis along which scrolling and layout occur.
|
|
3
|
+
*
|
|
4
|
+
* Matches Flutter's Axis:
|
|
5
|
+
* - vertical → Y axis
|
|
6
|
+
* - horizontal → X axis
|
|
7
|
+
*
|
|
8
|
+
* This is NOT gesture direction.
|
|
9
|
+
*/
|
|
10
|
+
export type Axis = 'vertical' | 'horizontal';
|
|
11
|
+
//# sourceMappingURL=Axis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../../../src/types/Axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellKey.d.ts","sourceRoot":"","sources":["../../../../src/types/CellKey.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logical cell type.
|
|
3
|
+
*
|
|
4
|
+
* Used to group compatible cells for recycling.
|
|
5
|
+
*
|
|
6
|
+
* Cross-platform equivalent:
|
|
7
|
+
* - Android: viewType
|
|
8
|
+
* - iOS: reuseIdentifier
|
|
9
|
+
*
|
|
10
|
+
* NOTE:
|
|
11
|
+
* This is a branded type to prevent accidental mixing
|
|
12
|
+
* with keys, indexes, or other strings/numbers.
|
|
13
|
+
*/
|
|
14
|
+
export type CellType = string & {
|
|
15
|
+
readonly __cellTypeBrand: unique symbol;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Helper to create a CellType safely.
|
|
19
|
+
* Keeps ergonomics simple for users.
|
|
20
|
+
*/
|
|
21
|
+
export declare const createCellType: (value: string) => CellType;
|
|
22
|
+
//# sourceMappingURL=CellType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellType.d.ts","sourceRoot":"","sources":["../../../../src/types/CellType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,QAAQ,CAAC,eAAe,EAAE,OAAO,MAAM,CAAA;CACxC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,MAAM,KACZ,QAA6B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/types/VisibleRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LayoutRect } from './layout/LayoutRect';
|
|
2
|
+
/**
|
|
3
|
+
* Input required to compute the visible item range.
|
|
4
|
+
*
|
|
5
|
+
* Pure contract:
|
|
6
|
+
* - No logic
|
|
7
|
+
* - No platform assumptions
|
|
8
|
+
* - Safe to share with native / tests
|
|
9
|
+
*/
|
|
10
|
+
export interface VisibleRangeInput {
|
|
11
|
+
/**
|
|
12
|
+
* Ordered, monotonic layouts along the main axis.
|
|
13
|
+
* Required for binary search correctness.
|
|
14
|
+
*/
|
|
15
|
+
readonly layouts: readonly LayoutRect[];
|
|
16
|
+
/**
|
|
17
|
+
* Scroll offset along the main axis.
|
|
18
|
+
*/
|
|
19
|
+
readonly offset: number;
|
|
20
|
+
/**
|
|
21
|
+
* Viewport size along the main axis.
|
|
22
|
+
*/
|
|
23
|
+
readonly viewportSize: number;
|
|
24
|
+
/**
|
|
25
|
+
* Extra buffer before and after the viewport.
|
|
26
|
+
*/
|
|
27
|
+
readonly buffer: number;
|
|
28
|
+
/**
|
|
29
|
+
* Axis selector.
|
|
30
|
+
* true → vertical
|
|
31
|
+
* false → horizontal
|
|
32
|
+
*/
|
|
33
|
+
readonly isVertical: boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=VisibleRangeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibleRangeInput.d.ts","sourceRoot":"","sources":["../../../../src/types/VisibleRangeInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IAEvC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAC7B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Axis } from './Axis';
|
|
2
|
+
export type { MainAxisPadding, } from './layout/MainAxisPadding';
|
|
3
|
+
export { ZERO_MAIN_AXIS_PADDING, } from './layout/MainAxisPadding';
|
|
4
|
+
export type { LayoutRect } from './layout/LayoutRect';
|
|
5
|
+
export type { VisibleRange } from './VisibleRange';
|
|
6
|
+
export type { CellKey } from './CellKey';
|
|
7
|
+
export type { CellType } from './CellType';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAElC,YAAY,EACV,eAAe,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,sBAAsB,GACvB,MAAM,0BAA0B,CAAA;AAEjC,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Absolute layout rectangle.
|
|
3
|
+
*
|
|
4
|
+
* Cross-platform equivalent of:
|
|
5
|
+
* - Flutter: Rect
|
|
6
|
+
* - Android: Rect
|
|
7
|
+
* - iOS: CGRect
|
|
8
|
+
*/
|
|
9
|
+
export interface LayoutRect {
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
readonly width: number;
|
|
13
|
+
readonly height: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=LayoutRect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutRect.d.ts","sourceRoot":"","sources":["../../../../../src/types/layout/LayoutRect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,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,10 @@
|
|
|
1
|
+
import type { MainAxisPadding } from './MainAxisPadding';
|
|
2
|
+
export interface LinearLayoutInput {
|
|
3
|
+
readonly crossAxisSize: number;
|
|
4
|
+
readonly itemMainAxisSizes: readonly number[];
|
|
5
|
+
/** Padding before/after content (main axis) */
|
|
6
|
+
readonly padding: MainAxisPadding;
|
|
7
|
+
/** Space BETWEEN items (main axis) */
|
|
8
|
+
readonly itemSpacing?: number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=LinearLayoutInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearLayoutInput.d.ts","sourceRoot":"","sources":["../../../../../src/types/layout/LinearLayoutInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;IAE7C,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IAEjC,sCAAsC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Padding applied along the main scroll axis.
|
|
3
|
+
*
|
|
4
|
+
* This is a layout-level concept (not visual styling).
|
|
5
|
+
*
|
|
6
|
+
* - vertical → top / bottom
|
|
7
|
+
* - horizontal → left / right
|
|
8
|
+
*
|
|
9
|
+
* Uses start/end to remain RTL-safe and platform-neutral.
|
|
10
|
+
*/
|
|
11
|
+
export interface MainAxisPadding {
|
|
12
|
+
readonly start: number;
|
|
13
|
+
readonly end: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Shared zero-padding constant.
|
|
17
|
+
* Safe to reuse across layouts.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ZERO_MAIN_AXIS_PADDING: MainAxisPadding;
|
|
20
|
+
//# sourceMappingURL=MainAxisPadding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MainAxisPadding.d.ts","sourceRoot":"","sources":["../../../../../src/types/layout/MainAxisPadding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAGpC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CellType } from "../CellType";
|
|
2
|
+
import type { RecyclerCell } from "./RecyclerCell";
|
|
3
|
+
/**
|
|
4
|
+
* Owns recycled physical cells.
|
|
5
|
+
* Enforces hard caps.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CellPool<T extends RecyclerCell> {
|
|
8
|
+
private readonly pools;
|
|
9
|
+
private readonly maxPerType;
|
|
10
|
+
hasType(type: CellType): boolean;
|
|
11
|
+
registerType(type: CellType, maxCount: number): void;
|
|
12
|
+
acquire(type: CellType): T | null;
|
|
13
|
+
release(cell: T): void;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=CellPool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellPool.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/CellPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAGlD;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,YAAY;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IAEzD,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAIhC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMpD,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,GAAG,IAAI;IAMjC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAWtB,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Axis } from '../Axis';
|
|
2
|
+
import type { CellType } from '../CellType';
|
|
3
|
+
import type { MainAxisPadding } from '../layout';
|
|
4
|
+
import type { RecyclerItemRenderer } from './RecyclerItemRenderer';
|
|
5
|
+
/**
|
|
6
|
+
* Public props for NitroList.
|
|
7
|
+
*
|
|
8
|
+
* Generic, data-driven, layout-deterministic API.
|
|
9
|
+
* This surface is intentionally minimal and stable.
|
|
10
|
+
*/
|
|
11
|
+
export interface NitroListProps<T> {
|
|
12
|
+
/**
|
|
13
|
+
* Scroll direction.
|
|
14
|
+
* Defaults to 'vertical'.
|
|
15
|
+
*/
|
|
16
|
+
readonly scrollDirection?: Axis;
|
|
17
|
+
/**
|
|
18
|
+
* Cross-axis size.
|
|
19
|
+
* - vertical → width
|
|
20
|
+
* - horizontal → height
|
|
21
|
+
*
|
|
22
|
+
* Required for deterministic layout.
|
|
23
|
+
*/
|
|
24
|
+
readonly containerCrossAxisSize: number;
|
|
25
|
+
/**
|
|
26
|
+
* Data source.
|
|
27
|
+
* Length is the single source of truth for item count.
|
|
28
|
+
*/
|
|
29
|
+
readonly data: readonly T[];
|
|
30
|
+
/**
|
|
31
|
+
* Item sizes along the main axis.
|
|
32
|
+
* Must match data length.
|
|
33
|
+
*
|
|
34
|
+
* - vertical → heights
|
|
35
|
+
* - horizontal → widths
|
|
36
|
+
*/
|
|
37
|
+
readonly itemMainAxisSizes: readonly number[];
|
|
38
|
+
/**
|
|
39
|
+
* Padding before and after content along the main axis.
|
|
40
|
+
*
|
|
41
|
+
* Defaults are applied internally by the layout engine.
|
|
42
|
+
*/
|
|
43
|
+
readonly padding?: MainAxisPadding;
|
|
44
|
+
/**
|
|
45
|
+
* Space BETWEEN items along the main axis.
|
|
46
|
+
*
|
|
47
|
+
* Defaults are applied internally by the layout engine.
|
|
48
|
+
*/
|
|
49
|
+
readonly itemSpacing?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Extra render buffer as a ratio of viewport size.
|
|
52
|
+
* Used for overscan / pre-rendering.
|
|
53
|
+
*/
|
|
54
|
+
readonly bufferRatio?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Logical cell type resolver.
|
|
57
|
+
* Determines recycling compatibility.
|
|
58
|
+
*/
|
|
59
|
+
readonly getCellType: (item: T, index: number) => CellType;
|
|
60
|
+
/**
|
|
61
|
+
* Item renderer.
|
|
62
|
+
* Receives stable cell identity and data.
|
|
63
|
+
*/
|
|
64
|
+
readonly renderItem: RecyclerItemRenderer<T>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=NitroListProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroListProps.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/NitroListProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,CAAA;IAE/B;;;;;;OAMG;IACH,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAA;IAEvC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAA;IAE3B;;;;;;OAMG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAA;IAE7C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAA;IAElC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAE7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAE7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAA;IAE1D;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAC7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CellType } from '../CellType';
|
|
2
|
+
import type { CellKey } from '../CellKey';
|
|
3
|
+
/**
|
|
4
|
+
* Public contract for a physical recycler cell.
|
|
5
|
+
* Key type MUST be generic / opaque.
|
|
6
|
+
*/
|
|
7
|
+
export interface RecyclerCell<K = CellKey> {
|
|
8
|
+
readonly key: K;
|
|
9
|
+
readonly type: CellType;
|
|
10
|
+
index: number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=RecyclerCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecyclerCell.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/RecyclerCell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAA;IACf,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd"}
|