react-native-nitro-list 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +32 -15
- package/lib/commonjs/NitroList.js +9 -0
- package/lib/commonjs/NitroList.js.map +1 -0
- package/lib/commonjs/RecyclerList.internal.js +25 -0
- package/lib/commonjs/RecyclerList.internal.js.map +1 -0
- package/lib/commonjs/RecyclerList.js +171 -0
- package/lib/commonjs/RecyclerList.js.map +1 -0
- package/lib/commonjs/RecyclerList.types.js +6 -0
- package/lib/commonjs/RecyclerList.types.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/CellRecycler.js +62 -0
- package/lib/commonjs/cell/CellRecycler.js.map +1 -0
- package/lib/commonjs/cell/StableKey.js +10 -0
- package/lib/commonjs/cell/StableKey.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/useCellRenderer.js +62 -0
- package/lib/commonjs/hooks/useCellRenderer.js.map +1 -0
- package/lib/commonjs/hooks/useStableCallback.js +13 -0
- package/lib/commonjs/hooks/useStableCallback.js.map +1 -0
- package/lib/commonjs/index.js +7 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/EstimatedLayoutProvider.js +30 -0
- package/lib/commonjs/layout/EstimatedLayoutProvider.js.map +1 -0
- package/lib/commonjs/layout/LayoutEngine.js +21 -0
- package/lib/commonjs/layout/LayoutEngine.js.map +1 -0
- package/lib/commonjs/{specs/nitro-list.nitro.js → layout/LayoutProvider.js} +1 -1
- package/lib/commonjs/{specs/nitro-list.nitro.js.map → layout/LayoutProvider.js.map} +1 -1
- package/lib/commonjs/layout/LayoutRectangle.js +2 -0
- package/lib/commonjs/layout/LayoutRectangle.js.map +1 -0
- package/lib/commonjs/layout/MutableLinearLayout.js +65 -0
- package/lib/commonjs/layout/MutableLinearLayout.js.map +1 -0
- package/lib/commonjs/layout/index.js +20 -0
- package/lib/commonjs/layout/index.js.map +1 -0
- 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/native/NitroList.types.js +6 -0
- 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/specs/nitro-layout-engine.nitro.js +6 -0
- package/lib/commonjs/specs/nitro-layout-engine.nitro.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/viewability/ViewabilityHelper.js +121 -0
- package/lib/commonjs/viewability/ViewabilityHelper.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/findVisibleIndexRange.js +48 -0
- package/lib/commonjs/windowing/findVisibleIndexRange.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/RecyclerList.internal.js +22 -0
- package/lib/module/RecyclerList.internal.js.map +1 -0
- package/lib/module/RecyclerList.js +166 -0
- package/lib/module/RecyclerList.js.map +1 -0
- package/lib/module/RecyclerList.types.js +4 -0
- package/lib/module/RecyclerList.types.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/CellRecycler.js +57 -0
- package/lib/module/cell/CellRecycler.js.map +1 -0
- package/lib/module/cell/StableKey.js +6 -0
- package/lib/module/cell/StableKey.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/useCellRenderer.js +58 -0
- package/lib/module/hooks/useCellRenderer.js.map +1 -0
- package/lib/module/hooks/useStableCallback.js +9 -0
- package/lib/module/hooks/useStableCallback.js.map +1 -0
- package/lib/module/index.js +1 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/EstimatedLayoutProvider.js +25 -0
- package/lib/module/layout/EstimatedLayoutProvider.js.map +1 -0
- package/lib/module/layout/LayoutEngine.js +17 -0
- package/lib/module/layout/LayoutEngine.js.map +1 -0
- package/lib/module/layout/LayoutProvider.js +4 -0
- package/lib/module/layout/LayoutProvider.js.map +1 -0
- package/lib/module/layout/LayoutRectangle.js +2 -0
- package/lib/module/layout/LayoutRectangle.js.map +1 -0
- package/lib/module/layout/MutableLinearLayout.js +60 -0
- package/lib/module/layout/MutableLinearLayout.js.map +1 -0
- package/lib/module/layout/index.js +5 -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/specs/nitro-layout-engine.nitro.js +4 -0
- package/lib/module/specs/nitro-layout-engine.nitro.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/viewability/ViewabilityHelper.js +116 -0
- package/lib/module/viewability/ViewabilityHelper.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/findVisibleIndexRange.js +44 -0
- package/lib/module/windowing/findVisibleIndexRange.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/RecyclerList.d.ts +26 -0
- package/lib/typescript/src/RecyclerList.d.ts.map +1 -0
- package/lib/typescript/src/RecyclerList.internal.d.ts +9 -0
- package/lib/typescript/src/RecyclerList.internal.d.ts.map +1 -0
- package/lib/typescript/src/RecyclerList.types.d.ts +18 -0
- package/lib/typescript/src/RecyclerList.types.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/__tests__/windowing/findVisibleIndexRange.test.d.ts +2 -0
- package/lib/typescript/src/__tests__/windowing/findVisibleIndexRange.test.d.ts.map +1 -0
- package/lib/typescript/src/cell/Cell.d.ts +13 -0
- package/lib/typescript/src/cell/Cell.d.ts.map +1 -0
- package/lib/typescript/src/cell/CellRecycler.d.ts +19 -0
- package/lib/typescript/src/cell/CellRecycler.d.ts.map +1 -0
- package/lib/typescript/src/cell/StableKey.d.ts +2 -0
- package/lib/typescript/src/cell/StableKey.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/useCellRenderer.d.ts +19 -0
- package/lib/typescript/src/hooks/useCellRenderer.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useStableCallback.d.ts +2 -0
- package/lib/typescript/src/hooks/useStableCallback.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts +15 -0
- package/lib/typescript/src/layout/EstimatedLayoutProvider.d.ts.map +1 -0
- package/lib/typescript/src/layout/LayoutEngine.d.ts +10 -0
- package/lib/typescript/src/layout/LayoutEngine.d.ts.map +1 -0
- package/lib/typescript/src/layout/LayoutProvider.d.ts +16 -0
- package/lib/typescript/src/layout/LayoutProvider.d.ts.map +1 -0
- package/lib/typescript/src/layout/LayoutRectangle.d.ts +11 -0
- package/lib/typescript/src/layout/LayoutRectangle.d.ts.map +1 -0
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts +22 -0
- package/lib/typescript/src/layout/MutableLinearLayout.d.ts.map +1 -0
- package/lib/typescript/src/layout/index.d.ts +5 -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/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/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/viewability/ViewabilityHelper.d.ts +50 -0
- package/lib/typescript/src/viewability/ViewabilityHelper.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/findVisibleIndexRange.d.ts +11 -0
- package/lib/typescript/src/windowing/findVisibleIndexRange.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++/JLayoutRectangle.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/LayoutRectangle.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/LayoutRectangle.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++/LayoutRectangle.hpp +95 -0
- package/package.json +12 -4
- package/src/NitroList.ts +8 -0
- package/src/RecyclerList.internal.ts +38 -0
- package/src/RecyclerList.tsx +252 -0
- package/src/RecyclerList.types.ts +24 -0
- package/src/ReusableView.ts +12 -0
- package/src/__tests__/windowing/findVisibleIndexRange.test.ts +55 -0
- package/src/cell/Cell.ts +14 -0
- package/src/cell/CellRecycler.ts +66 -0
- package/src/cell/StableKey.ts +6 -0
- package/src/debug/useDebugOverlay.ts +14 -0
- package/src/getVisibleIndices.ts +53 -0
- package/src/hooks/useCellRenderer.ts +86 -0
- package/src/hooks/useStableCallback.ts +13 -0
- package/src/index.ts +2 -14
- package/src/layout/EstimatedLayoutProvider.ts +35 -0
- package/src/layout/LayoutEngine.ts +21 -0
- package/src/layout/LayoutProvider.ts +17 -0
- package/src/layout/LayoutRectangle.ts +10 -0
- package/src/layout/MutableLinearLayout.ts +79 -0
- package/src/layout/index.ts +4 -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 +12 -0
- package/src/native/NitroRecyclerView.ts +8 -0
- package/src/prefetch/PrefetchHelper.ts +47 -0
- package/src/specs/nitro-layout-engine.nitro.ts +17 -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/viewability/ViewabilityHelper.ts +130 -0
- package/src/windowing/ScrollMetrics.ts +11 -0
- package/src/windowing/findVisibleIndexRange.ts +60 -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,19 @@
|
|
|
1
|
+
import type { Cell } from '../cell/Cell';
|
|
2
|
+
import type { LayoutRectangle } from '../layout/LayoutRectangle';
|
|
3
|
+
import type { ScrollMetrics } from '../windowing/ScrollMetrics';
|
|
4
|
+
/**
|
|
5
|
+
* React bridge for CellRecycler.
|
|
6
|
+
* FlashList equivalent: useCellRenderer
|
|
7
|
+
*
|
|
8
|
+
* Responsibilities:
|
|
9
|
+
* - Translate scroll state → visible indices
|
|
10
|
+
* - Ask recycler for physical cells
|
|
11
|
+
* - Commit results with referential stability
|
|
12
|
+
*
|
|
13
|
+
* Responsibilities it does NOT have:
|
|
14
|
+
* ❌ Layout mutation
|
|
15
|
+
* ❌ Measurement
|
|
16
|
+
* ❌ Rendering
|
|
17
|
+
*/
|
|
18
|
+
export declare function useCellRenderer(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics, bufferPx: number, getCellType: (index: number) => string): readonly Cell[];
|
|
19
|
+
//# sourceMappingURL=useCellRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCellRenderer.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCellRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAQ/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GACrC,SAAS,IAAI,EAAE,CAqDjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStableCallback.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useStableCallback.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EACvE,EAAE,EAAE,CAAC,GACJ,CAAC,CAQH"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const NitroList: import("react-native-nitro-modules").ReactNativeView<NitroListProps, NitroListMethods>;
|
|
4
|
-
export type NitroListRef = HybridRef<NitroListProps, NitroListMethods>;
|
|
1
|
+
export { RecyclerList } from './RecyclerList';
|
|
2
|
+
export type { RecyclerListProps } from './RecyclerList.types';
|
|
5
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LayoutProvider } from './LayoutProvider';
|
|
2
|
+
import type { LayoutRectangle } from './LayoutRectangle';
|
|
3
|
+
/**
|
|
4
|
+
* Layout provider using estimated item heights.
|
|
5
|
+
* Used before real measurements are available.
|
|
6
|
+
*/
|
|
7
|
+
export declare class EstimatedLayoutProvider implements LayoutProvider {
|
|
8
|
+
private readonly itemCount;
|
|
9
|
+
private readonly itemHeight;
|
|
10
|
+
private readonly width;
|
|
11
|
+
constructor(itemCount: number, itemHeight: number, width: number);
|
|
12
|
+
getItemCount(): number;
|
|
13
|
+
getLayout(index: number): LayoutRectangle;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=EstimatedLayoutProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EstimatedLayoutProvider.d.ts","sourceRoot":"","sources":["../../../../src/layout/EstimatedLayoutProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAG5B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM;IAOf,YAAY,IAAI,MAAM;IAItB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe;CAQ1C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LayoutProvider } from './LayoutProvider';
|
|
2
|
+
import type { LayoutRectangle } from './LayoutRectangle';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves layouts eagerly into a contiguous array.
|
|
5
|
+
* Pure, deterministic, and reusable.
|
|
6
|
+
*
|
|
7
|
+
* FlashList equivalent: internal layout resolver.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeLayouts(provider: LayoutProvider): readonly LayoutRectangle[];
|
|
10
|
+
//# sourceMappingURL=LayoutEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutEngine.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,GACvB,SAAS,eAAe,EAAE,CAS5B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LayoutRectangle } from './LayoutRectangle';
|
|
2
|
+
/**
|
|
3
|
+
* Provides layout information for items.
|
|
4
|
+
* FlashList equivalent: LayoutProvider
|
|
5
|
+
*/
|
|
6
|
+
export interface LayoutProvider {
|
|
7
|
+
/**
|
|
8
|
+
* Total number of items
|
|
9
|
+
*/
|
|
10
|
+
getItemCount(): number;
|
|
11
|
+
/**
|
|
12
|
+
* Layout rectangle for a given index
|
|
13
|
+
*/
|
|
14
|
+
getLayout(index: number): LayoutRectangle;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=LayoutProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutProvider.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,YAAY,IAAI,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAA;CAC1C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable layout rectangle for a single item.
|
|
3
|
+
* Equivalent to FlashList's Layout.
|
|
4
|
+
*/
|
|
5
|
+
export interface LayoutRectangle {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly y: number;
|
|
8
|
+
readonly width: number;
|
|
9
|
+
readonly height: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=LayoutRectangle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutRectangle.d.ts","sourceRoot":"","sources":["../../../../src/layout/LayoutRectangle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { LayoutRectangle } from './LayoutRectangle';
|
|
2
|
+
/**
|
|
3
|
+
* Mutable linear layout store.
|
|
4
|
+
* FlashList-style incremental relayout.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MutableLinearLayout {
|
|
7
|
+
private readonly layouts;
|
|
8
|
+
private totalHeight;
|
|
9
|
+
constructor(initialHeights: readonly number[], width: number);
|
|
10
|
+
/**
|
|
11
|
+
* Read-only snapshot for consumers.
|
|
12
|
+
* Returned type is immutable.
|
|
13
|
+
*/
|
|
14
|
+
getLayouts(): readonly LayoutRectangle[];
|
|
15
|
+
getContentHeight(): number;
|
|
16
|
+
/**
|
|
17
|
+
* Update height of one item and shift following items.
|
|
18
|
+
* Returns true if layout changed.
|
|
19
|
+
*/
|
|
20
|
+
updateItemHeight(index: number, newHeight: number): boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=MutableLinearLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MutableLinearLayout.d.ts","sourceRoot":"","sources":["../../../../src/layout/MutableLinearLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAaxD;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,WAAW,CAAQ;gBAGzB,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,KAAK,EAAE,MAAM;IAkBf;;;OAGG;IACH,UAAU,IAAI,SAAS,eAAe,EAAE;IAIxC,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,gBAAgB,CACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,OAAO;CAkBX"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { LayoutRectangle } from './LayoutRectangle';
|
|
2
|
+
export type { LayoutProvider } from './LayoutProvider';
|
|
3
|
+
export { EstimatedLayoutProvider } from './EstimatedLayoutProvider';
|
|
4
|
+
export { computeLayouts } from './LayoutEngine';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
2
|
+
export interface MeasuredLayout {
|
|
3
|
+
readonly width: number;
|
|
4
|
+
readonly height: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Extracts stable layout measurements from RN onLayout event.
|
|
8
|
+
*/
|
|
9
|
+
export declare function measureLayout(event: LayoutChangeEvent): MeasuredLayout;
|
|
10
|
+
//# sourceMappingURL=MeasureLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeasureLayout.d.ts","sourceRoot":"","sources":["../../../../src/measurement/MeasureLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAOhB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to measure a rendered item safely.
|
|
4
|
+
*
|
|
5
|
+
* Guarantees:
|
|
6
|
+
* - No duplicate height reports
|
|
7
|
+
* - No render loops
|
|
8
|
+
* - Stable callback identity
|
|
9
|
+
*/
|
|
10
|
+
export declare function useItemMeasurement(index: number, onMeasured: (index: number, height: number) => void): (e: LayoutChangeEvent) => void;
|
|
11
|
+
//# sourceMappingURL=useItemMeasurement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useItemMeasurement.d.ts","sourceRoot":"","sources":["../../../../src/measurement/useItemMeasurement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,OAK7C,iBAAiB,UAaxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroLayoutEngine.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroLayoutEngine.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAEpG,eAAO,MAAM,iBAAiB,uBAG3B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LayoutRectangle } from '../layout/LayoutRectangle';
|
|
2
|
+
/**
|
|
3
|
+
* JS runtime interface backed by Nitro (JSI).
|
|
4
|
+
* Must match native HybridNitroList exactly.
|
|
5
|
+
*/
|
|
6
|
+
export interface NitroList {
|
|
7
|
+
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRectangle[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=NitroList.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroList.types.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,eAAe,EAAE,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NitroRecyclerView.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroRecyclerView.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iBAAiB,8DACuC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callback invoked when new items should be prefetched.
|
|
3
|
+
*/
|
|
4
|
+
export type PrefetchCallback = (indices: number[]) => void;
|
|
5
|
+
/**
|
|
6
|
+
* PrefetchHelper
|
|
7
|
+
*
|
|
8
|
+
* Stateless with respect to layout.
|
|
9
|
+
* Only tracks what has already been prefetched to avoid duplication.
|
|
10
|
+
*
|
|
11
|
+
* Designed to be driven by *visible window*, not scroll events.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PrefetchHelper {
|
|
14
|
+
private lastPrefetched;
|
|
15
|
+
runPrefetch(visibleIndices: readonly number[], itemCount: number, aheadCount: number, onPrefetch: PrefetchCallback): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=PrefetchHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefetchHelper.d.ts","sourceRoot":"","sources":["../../../../src/prefetch/PrefetchHelper.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;AAE1D;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,cAAc,CAAoB;IAE1C,WAAW,CACT,cAAc,EAAE,SAAS,MAAM,EAAE,EACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,gBAAgB;CA0B/B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
export interface LayoutRectangle {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
readonly width: number;
|
|
6
|
+
readonly height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface NitroLayoutEngine extends HybridObject<{
|
|
9
|
+
ios: 'swift';
|
|
10
|
+
android: 'kotlin';
|
|
11
|
+
}> {
|
|
12
|
+
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRectangle[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=nitro-layout-engine.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nitro-layout-engine.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/nitro-layout-engine.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBACf,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IAEzD,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,eAAe,EAAE,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayEqual.d.ts","sourceRoot":"","sources":["../../../../src/utils/arrayEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAC1B,CAAC,EAAE,SAAS,CAAC,EAAE,EACf,CAAC,EAAE,SAAS,CAAC,EAAE,GACd,OAAO,CAST"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertNever.d.ts","sourceRoot":"","sources":["../../../../src/utils/assertNever.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAE3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clamp.d.ts","sourceRoot":"","sources":["../../../../src/utils/clamp.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,CAER"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devAssert.d.ts","sourceRoot":"","sources":["../../../../src/utils/devAssert.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACvB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../../../src/utils/invariant.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACvB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAInB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDefined.d.ts","sourceRoot":"","sources":["../../../../src/utils/isDefined.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAC1B,KAAK,IAAI,CAAC,CAEZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNumber.d.ts","sourceRoot":"","sources":["../../../../src/utils/isNumber.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../../src/utils/noop.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,IAAI,IAAI,CAE3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shallowEqual.d.ts","sourceRoot":"","sources":["../../../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,GACT,OAAO,CA8BT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../../src/utils/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,EAC3D,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,GACT,CAAC,CASH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { LayoutRectangle } from '../layout/LayoutRectangle';
|
|
2
|
+
import type { ScrollMetrics } from '../windowing/ScrollMetrics';
|
|
3
|
+
/**
|
|
4
|
+
* Public token describing viewability state of an item.
|
|
5
|
+
* Mirrors FlashList's ViewToken concept.
|
|
6
|
+
*/
|
|
7
|
+
export type ViewToken = {
|
|
8
|
+
index: number;
|
|
9
|
+
isViewable: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for viewability calculations.
|
|
13
|
+
*/
|
|
14
|
+
export type ViewabilityConfig = {
|
|
15
|
+
/**
|
|
16
|
+
* Percentage (0–100) of item height that must be visible
|
|
17
|
+
* for the item to be considered "viewable".
|
|
18
|
+
*/
|
|
19
|
+
itemVisiblePercentThreshold?: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* ViewabilityHelper
|
|
23
|
+
*
|
|
24
|
+
* Pure observer:
|
|
25
|
+
* - Does NOT affect layout
|
|
26
|
+
* - Does NOT affect recycling
|
|
27
|
+
* - Computes visibility based on layout + scroll metrics
|
|
28
|
+
*
|
|
29
|
+
* This class is intentionally stateful (lastVisible)
|
|
30
|
+
* to compute "changed" items efficiently.
|
|
31
|
+
*/
|
|
32
|
+
export declare class ViewabilityHelper {
|
|
33
|
+
private readonly config;
|
|
34
|
+
/** Previously visible indices */
|
|
35
|
+
private lastVisible;
|
|
36
|
+
constructor(config?: ViewabilityConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Computes which items are viewable and which changed
|
|
39
|
+
* since the last invocation.
|
|
40
|
+
*
|
|
41
|
+
* IMPORTANT:
|
|
42
|
+
* - This method should be called AFTER windowing,
|
|
43
|
+
* not on the full dataset.
|
|
44
|
+
*/
|
|
45
|
+
computeViewableItems(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics): {
|
|
46
|
+
viewableItems: ViewToken[];
|
|
47
|
+
changed: ViewToken[];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=ViewabilityHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewabilityHelper.d.ts","sourceRoot":"","sources":["../../../../src/viewability/ViewabilityHelper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAA;CACrC,CAAA;AAED;;;;;;;;;;GAUG;AACH,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,iCAAiC;IACjC,OAAO,CAAC,WAAW,CAAoB;gBAGpB,MAAM,GAAE,iBAAsB;IAGjD;;;;;;;OAOG;IACH,oBAAoB,CAClB,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,GACrB;QACD,aAAa,EAAE,SAAS,EAAE,CAAA;QAC1B,OAAO,EAAE,SAAS,EAAE,CAAA;KACrB;CAyEF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollMetrics.d.ts","sourceRoot":"","sources":["../../../../src/windowing/ScrollMetrics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IAEf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LayoutRectangle } from '../layout/LayoutRectangle';
|
|
2
|
+
import type { ScrollMetrics } from './ScrollMetrics';
|
|
3
|
+
/**
|
|
4
|
+
* Computes the contiguous range of item indices
|
|
5
|
+
* intersecting the viewport expanded by bufferPx.
|
|
6
|
+
*
|
|
7
|
+
* PURE function. No allocations besides output.
|
|
8
|
+
* FlashList-style windowing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function findVisibleIndexRange(layouts: readonly LayoutRectangle[], metrics: ScrollMetrics, bufferPx: number): readonly number[];
|
|
11
|
+
//# sourceMappingURL=findVisibleIndexRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findVisibleIndexRange.d.ts","sourceRoot":"","sources":["../../../../src/windowing/findVisibleIndexRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,SAAS,MAAM,EAAE,CA6CnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/windowing/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
import type { ScrollMetrics } from './ScrollMetrics';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll metrics hook.
|
|
5
|
+
* Provides stable scroll snapshot + handlers.
|
|
6
|
+
*
|
|
7
|
+
* FlashList equivalent: useScrollMetrics
|
|
8
|
+
*/
|
|
9
|
+
export declare function useScrollMetrics(): {
|
|
10
|
+
metrics: ScrollMetrics;
|
|
11
|
+
onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
12
|
+
onLayout: (e: LayoutChangeEvent) => void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useScrollMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollMetrics.d.ts","sourceRoot":"","sources":["../../../../src/windowing/useScrollMetrics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,QAAQ,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC9D,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACzC,CAqCA"}
|
package/nitro.json
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://nitro.margelo.com/nitro.schema.json",
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
"cxxNamespace": ["nitrolist"],
|
|
5
|
+
|
|
6
6
|
"ios": {
|
|
7
7
|
"iosModuleName": "NitroList"
|
|
8
8
|
},
|
|
9
|
+
|
|
9
10
|
"android": {
|
|
10
|
-
"androidNamespace": [
|
|
11
|
-
"nitrolist"
|
|
12
|
-
],
|
|
11
|
+
"androidNamespace": ["nitrolist"],
|
|
13
12
|
"androidCxxLibName": "NitroList"
|
|
14
13
|
},
|
|
14
|
+
|
|
15
15
|
"autolinking": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
16
|
+
"views": {
|
|
17
|
+
"NitroListView": {
|
|
18
|
+
"swift": "HybridNitroList",
|
|
19
|
+
"kotlin": "HybridNitroList"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"objects": {
|
|
23
|
+
"NitroLayoutEngine": {
|
|
24
|
+
"swift": "HybridNitroLayoutEngine",
|
|
25
|
+
"kotlin": "HybridNitroLayoutEngine"
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
29
|
+
|
|
30
|
+
"ignorePaths": ["**/node_modules"]
|
|
31
|
+
}
|
|
@@ -33,11 +33,9 @@ target_sources(
|
|
|
33
33
|
# Autolinking Setup
|
|
34
34
|
../nitrogen/generated/android/NitroListOnLoad.cpp
|
|
35
35
|
# Shared Nitrogen C++ sources
|
|
36
|
-
../nitrogen/generated/shared/c++/
|
|
37
|
-
../nitrogen/generated/shared/c++/views/HybridNitroListComponent.cpp
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridNitroLayoutEngineSpec.cpp
|
|
38
37
|
# Android-specific Nitrogen C++ sources
|
|
39
|
-
../nitrogen/generated/android/c++/
|
|
40
|
-
../nitrogen/generated/android/c++/views/JHybridNitroListStateUpdater.cpp
|
|
38
|
+
../nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.cpp
|
|
41
39
|
)
|
|
42
40
|
|
|
43
41
|
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
16
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
17
|
|
|
18
|
-
#include "
|
|
19
|
-
#include "views/JHybridNitroListStateUpdater.hpp"
|
|
20
|
-
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
18
|
+
#include "JHybridNitroLayoutEngineSpec.hpp"
|
|
21
19
|
|
|
22
20
|
namespace margelo::nitro::nitrolist {
|
|
23
21
|
|
|
@@ -28,18 +26,10 @@ int initialize(JavaVM* vm) {
|
|
|
28
26
|
|
|
29
27
|
return facebook::jni::initialize(vm, [] {
|
|
30
28
|
// Register native JNI methods
|
|
31
|
-
margelo::nitro::nitrolist::
|
|
32
|
-
margelo::nitro::nitrolist::views::JHybridNitroListStateUpdater::registerNatives();
|
|
29
|
+
margelo::nitro::nitrolist::JHybridNitroLayoutEngineSpec::registerNatives();
|
|
33
30
|
|
|
34
31
|
// Register Nitro Hybrid Objects
|
|
35
|
-
|
|
36
|
-
"NitroList",
|
|
37
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
38
|
-
static DefaultConstructableObject<JHybridNitroListSpec::javaobject> object("com/nitrolist/HybridNitroList");
|
|
39
|
-
auto instance = object.create();
|
|
40
|
-
return instance->cthis()->shared();
|
|
41
|
-
}
|
|
42
|
-
);
|
|
32
|
+
|
|
43
33
|
});
|
|
44
34
|
}
|
|
45
35
|
|