react-native-nitro-list 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/HybridNitroList.swift +10 -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 +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/recycler/CellPool.js +46 -0
- package/lib/commonjs/recycler/CellPool.js.map +1 -0
- package/lib/commonjs/recycler/RecyclerList.js +224 -0
- package/lib/commonjs/recycler/RecyclerList.js.map +1 -0
- package/lib/commonjs/types/Axis.js +2 -0
- package/lib/commonjs/{layout/LayoutProvider.js.map → types/Axis.js.map} +1 -1
- package/lib/commonjs/types/CellKey.js +2 -0
- package/lib/{module/layout/LayoutProvider.js.map → commonjs/types/CellKey.js.map} +1 -1
- package/lib/commonjs/types/CellType.js +2 -0
- package/lib/commonjs/{layout/LayoutRectangle.js.map → types/CellType.js.map} +1 -1
- package/lib/commonjs/types/VisibleRange.js +2 -0
- package/lib/{module/layout/LayoutRectangle.js.map → commonjs/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/types/layout/LinearLayoutInput.js +6 -0
- package/lib/commonjs/types/layout/LinearLayoutInput.js.map +1 -0
- package/lib/commonjs/types/layout/MainAxisPadding.js +26 -0
- package/lib/commonjs/types/layout/MainAxisPadding.js.map +1 -0
- package/lib/commonjs/types/layout/index.js +2 -0
- package/lib/commonjs/types/layout/index.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerCellInstance.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerCellInstance.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerItemRenderer.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerItemRenderer.js.map +1 -0
- package/lib/commonjs/types/recycler/RecyclerListProps.js +6 -0
- package/lib/commonjs/types/recycler/RecyclerListProps.js.map +1 -0
- package/lib/commonjs/types/recycler/index.js +2 -0
- package/lib/commonjs/types/recycler/index.js.map +1 -0
- package/lib/commonjs/{layout/LayoutProvider.js → types/scroll/ScrollMetrics.js} +1 -1
- 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 +71 -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 +1 -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/recycler/CellPool.js +41 -0
- package/lib/module/recycler/CellPool.js.map +1 -0
- package/lib/module/recycler/RecyclerList.js +221 -0
- package/lib/module/recycler/RecyclerList.js.map +1 -0
- package/lib/module/types/Axis.js +2 -0
- package/lib/module/types/Axis.js.map +1 -0
- package/lib/module/types/CellKey.js +2 -0
- package/lib/module/types/CellKey.js.map +1 -0
- package/lib/module/types/CellType.js +2 -0
- package/lib/module/types/CellType.js.map +1 -0
- package/lib/module/types/VisibleRange.js +2 -0
- package/lib/module/types/VisibleRange.js.map +1 -0
- package/lib/module/types/VisibleRangeInput.js +4 -0
- package/lib/module/types/VisibleRangeInput.js.map +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/layout/LayoutRect.js +2 -0
- package/lib/module/types/layout/LayoutRect.js.map +1 -0
- package/lib/module/types/layout/LinearLayoutInput.js +4 -0
- package/lib/module/types/layout/LinearLayoutInput.js.map +1 -0
- package/lib/module/types/layout/MainAxisPadding.js +22 -0
- package/lib/module/types/layout/MainAxisPadding.js.map +1 -0
- package/lib/module/types/layout/index.js +2 -0
- package/lib/module/types/layout/index.js.map +1 -0
- package/lib/module/types/recycler/RecyclerCellInstance.js +4 -0
- package/lib/module/types/recycler/RecyclerCellInstance.js.map +1 -0
- package/lib/module/types/recycler/RecyclerItemRenderer.js +4 -0
- package/lib/module/types/recycler/RecyclerItemRenderer.js.map +1 -0
- package/lib/module/types/recycler/RecyclerListProps.js +4 -0
- package/lib/module/types/recycler/RecyclerListProps.js.map +1 -0
- package/lib/module/types/recycler/index.js +2 -0
- package/lib/module/types/recycler/index.js.map +1 -0
- package/lib/module/types/scroll/ScrollMetrics.js +4 -0
- package/lib/module/types/scroll/ScrollMetrics.js.map +1 -0
- package/lib/module/types/scroll/index.js +2 -0
- package/lib/module/types/scroll/index.js.map +1 -0
- package/lib/module/windowing/computeVisibleItemRange.js +67 -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 +1 -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/NitroList.types.d.ts +2 -2
- package/lib/typescript/src/native/NitroList.types.d.ts.map +1 -1
- package/lib/typescript/src/recycler/CellPool.d.ts +14 -0
- package/lib/typescript/src/recycler/CellPool.d.ts.map +1 -0
- package/lib/typescript/src/recycler/RecyclerList.d.ts +4 -0
- package/lib/typescript/src/recycler/RecyclerList.d.ts.map +1 -0
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts +2 -2
- package/lib/typescript/src/specs/nitro-layout-engine.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types/Axis.d.ts +11 -0
- package/lib/typescript/src/types/Axis.d.ts.map +1 -0
- package/lib/typescript/src/types/CellKey.d.ts +10 -0
- package/lib/typescript/src/types/CellKey.d.ts.map +1 -0
- package/lib/typescript/src/types/CellType.d.ts +11 -0
- package/lib/typescript/src/types/CellType.d.ts.map +1 -0
- package/lib/typescript/src/types/VisibleRange.d.ts +10 -0
- package/lib/typescript/src/types/VisibleRange.d.ts.map +1 -0
- package/lib/typescript/src/types/VisibleRangeInput.d.ts +35 -0
- package/lib/typescript/src/types/VisibleRangeInput.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +8 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/LayoutRect.d.ts +15 -0
- package/lib/typescript/src/types/layout/LayoutRect.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/LinearLayoutInput.d.ts +10 -0
- package/lib/typescript/src/types/layout/LinearLayoutInput.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/MainAxisPadding.d.ts +20 -0
- package/lib/typescript/src/types/layout/MainAxisPadding.d.ts.map +1 -0
- package/lib/typescript/src/types/layout/index.d.ts +4 -0
- package/lib/typescript/src/types/layout/index.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts +37 -0
- package/lib/typescript/src/types/recycler/RecyclerCellInstance.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts +8 -0
- package/lib/typescript/src/types/recycler/RecyclerItemRenderer.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/RecyclerListProps.d.ts +66 -0
- package/lib/typescript/src/types/recycler/RecyclerListProps.d.ts.map +1 -0
- package/lib/typescript/src/types/recycler/index.d.ts +4 -0
- package/lib/typescript/src/types/recycler/index.d.ts.map +1 -0
- package/lib/typescript/src/types/scroll/ScrollMetrics.d.ts +15 -0
- package/lib/typescript/src/types/scroll/ScrollMetrics.d.ts.map +1 -0
- package/lib/typescript/src/types/scroll/index.d.ts +2 -0
- package/lib/typescript/src/types/scroll/index.d.ts.map +1 -0
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts +15 -0
- package/lib/typescript/src/windowing/computeVisibleItemRange.d.ts.map +1 -0
- package/lib/typescript/src/windowing/index.d.ts +1 -1
- package/lib/typescript/src/windowing/index.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.cpp +7 -7
- package/nitrogen/generated/android/c++/JHybridNitroLayoutEngineSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/{JLayoutRectangle.hpp → JLayoutRect.hpp} +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/HybridNitroLayoutEngineSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolist/{LayoutRectangle.kt → LayoutRect.kt} +5 -5
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Bridge.hpp +14 -14
- package/nitrogen/generated/ios/NitroList-Swift-Cxx-Umbrella.hpp +3 -3
- package/nitrogen/generated/ios/c++/HybridNitroLayoutEngineSpecSwift.hpp +4 -4
- package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridNitroLayoutEngineSpec_cxx.swift +5 -5
- package/nitrogen/generated/ios/swift/{LayoutRectangle.swift → LayoutRect.swift} +5 -5
- package/nitrogen/generated/shared/c++/HybridNitroLayoutEngineSpec.hpp +4 -4
- package/nitrogen/generated/shared/c++/{LayoutRectangle.hpp → LayoutRect.hpp} +11 -11
- package/package.json +1 -1
- 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 +1 -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/NitroList.types.ts +3 -2
- package/src/recycler/CellPool.ts +47 -0
- package/src/recycler/RecyclerList.tsx +304 -0
- package/src/specs/nitro-layout-engine.nitro.ts +2 -2
- package/src/types/Axis.ts +10 -0
- package/src/types/CellKey.ts +9 -0
- package/src/types/CellType.ts +10 -0
- package/src/types/VisibleRange.ts +9 -0
- package/src/types/VisibleRangeInput.ts +39 -0
- package/src/types/index.ts +15 -0
- package/src/types/layout/LayoutRect.ts +14 -0
- package/src/types/layout/LinearLayoutInput.ts +12 -0
- package/src/types/layout/MainAxisPadding.ts +23 -0
- package/src/types/layout/index.ts +3 -0
- package/src/types/recycler/RecyclerCellInstance.ts +40 -0
- package/src/types/recycler/RecyclerItemRenderer.ts +8 -0
- package/src/types/recycler/RecyclerListProps.ts +74 -0
- package/src/types/recycler/index.ts +3 -0
- package/src/types/scroll/ScrollMetrics.ts +18 -0
- package/src/types/scroll/index.ts +1 -0
- package/src/windowing/computeVisibleItemRange.ts +78 -0
- package/src/windowing/index.ts +1 -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/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/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/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/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/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/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/viewability/ViewabilityHelper.ts +0 -130
- package/src/windowing/findVisibleIndexRange.ts +0 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LayoutRect } from "../types/layout";
|
|
2
2
|
/**
|
|
3
3
|
* JS runtime interface backed by Nitro (JSI).
|
|
4
4
|
* Must match native HybridNitroList exactly.
|
|
5
5
|
*/
|
|
6
6
|
export interface NitroList {
|
|
7
|
-
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly
|
|
7
|
+
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRect[];
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=NitroList.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NitroList.types.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NitroList.types.d.ts","sourceRoot":"","sources":["../../../../src/native/NitroList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,SAAS,UAAU,EAAE,CAAA;CACzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CellType } from '../types/CellType';
|
|
2
|
+
import type { RecyclerCellInstance } from '../types/recycler';
|
|
3
|
+
export declare class CellPool {
|
|
4
|
+
private readonly pools;
|
|
5
|
+
private readonly maxPerType;
|
|
6
|
+
/** ✅ NEW: check if a type is registered */
|
|
7
|
+
hasType(type: CellType): boolean;
|
|
8
|
+
registerType(type: CellType, maxCount: number): void;
|
|
9
|
+
acquire(type: CellType): RecyclerCellInstance | null;
|
|
10
|
+
release(cell: RecyclerCellInstance): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
getPoolSize(type: CellType): number;
|
|
13
|
+
}
|
|
14
|
+
//# 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,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8C;IACpE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IAEzD,2CAA2C;IAC3C,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,oBAAoB,GAAG,IAAI;IAMpD,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI;IAazC,KAAK,IAAI,IAAI;IAMb,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM;CAGpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecyclerList.d.ts","sourceRoot":"","sources":["../../../../src/recycler/RecyclerList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAU1D,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,mBAAmB,CAAA;AAmB1B,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC1B,KAAK,CAAC,YAAY,CAmQpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
-
export interface
|
|
2
|
+
export interface LayoutRect {
|
|
3
3
|
readonly x: number;
|
|
4
4
|
readonly y: number;
|
|
5
5
|
readonly width: number;
|
|
@@ -9,6 +9,6 @@ export interface NitroLayoutEngine extends HybridObject<{
|
|
|
9
9
|
ios: 'swift';
|
|
10
10
|
android: 'kotlin';
|
|
11
11
|
}> {
|
|
12
|
-
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly
|
|
12
|
+
computeLayout(containerWidth: number, itemHeights: readonly number[]): readonly LayoutRect[];
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=nitro-layout-engine.nitro.d.ts.map
|
|
@@ -1 +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,
|
|
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,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,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,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":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellType.d.ts","sourceRoot":"","sources":["../../../../src/types/CellType.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,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,37 @@
|
|
|
1
|
+
import type { CellKey } from "../CellKey";
|
|
2
|
+
import type { CellType } from "../CellType";
|
|
3
|
+
/**
|
|
4
|
+
* Physical reusable cell instance.
|
|
5
|
+
*
|
|
6
|
+
* Represents a single mounted view that can be rebound
|
|
7
|
+
* to different data items as scrolling occurs.
|
|
8
|
+
*
|
|
9
|
+
* Cross-platform equivalent:
|
|
10
|
+
* - Flutter: Element / RenderObject
|
|
11
|
+
* - Android: ViewHolder
|
|
12
|
+
* - iOS: UICollectionViewCell
|
|
13
|
+
*/
|
|
14
|
+
export interface RecyclerCellInstance {
|
|
15
|
+
/**
|
|
16
|
+
* Stable physical identity.
|
|
17
|
+
*
|
|
18
|
+
* Used as React key.
|
|
19
|
+
* MUST remain constant for the lifetime of the instance.
|
|
20
|
+
*/
|
|
21
|
+
readonly key: CellKey;
|
|
22
|
+
/**
|
|
23
|
+
* Logical data index currently bound to this instance.
|
|
24
|
+
*
|
|
25
|
+
* This value changes as the cell is recycled.
|
|
26
|
+
* - -1 may be used to indicate "unbound".
|
|
27
|
+
*/
|
|
28
|
+
index: number;
|
|
29
|
+
/**
|
|
30
|
+
* Logical compatibility type.
|
|
31
|
+
*
|
|
32
|
+
* Determines which instances can be reused together.
|
|
33
|
+
* Instances with different types MUST NOT be reused.
|
|
34
|
+
*/
|
|
35
|
+
readonly type: CellType;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=RecyclerCellInstance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecyclerCellInstance.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/RecyclerCellInstance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IAErB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CACxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RecyclerCellInstance } from './RecyclerCellInstance';
|
|
3
|
+
export type RecyclerItemRenderer<T> = (params: {
|
|
4
|
+
item: T;
|
|
5
|
+
index: number;
|
|
6
|
+
cell: RecyclerCellInstance;
|
|
7
|
+
}) => ReactNode;
|
|
8
|
+
//# sourceMappingURL=RecyclerItemRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecyclerItemRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/RecyclerItemRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;IAC7C,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,oBAAoB,CAAA;CAC3B,KAAK,SAAS,CAAA"}
|
|
@@ -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 RecyclerList.
|
|
7
|
+
*
|
|
8
|
+
* Generic, data-driven, layout-deterministic API.
|
|
9
|
+
* This surface is intentionally minimal and stable.
|
|
10
|
+
*/
|
|
11
|
+
export interface RecyclerListProps<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=RecyclerListProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecyclerListProps.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/RecyclerListProps.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,iBAAiB,CAAC,CAAC;IAClC;;;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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Axis } from "../Axis";
|
|
2
|
+
/**
|
|
3
|
+
* Scroll state snapshot.
|
|
4
|
+
*
|
|
5
|
+
* Pure data — no platform or React coupling.
|
|
6
|
+
*/
|
|
7
|
+
export interface ScrollMetrics {
|
|
8
|
+
/** Scroll axis */
|
|
9
|
+
readonly axis: Axis;
|
|
10
|
+
/** Offset along the main axis */
|
|
11
|
+
readonly offset: number;
|
|
12
|
+
/** Viewport size along the main axis */
|
|
13
|
+
readonly viewportSize: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ScrollMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollMetrics.d.ts","sourceRoot":"","sources":["../../../../../src/types/scroll/ScrollMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAGnC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,kBAAkB;IAClB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IAEnB,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEvB,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/scroll/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { VisibleRange } from '../types/VisibleRange';
|
|
2
|
+
import type { VisibleRangeInput } from '../types/VisibleRangeInput';
|
|
3
|
+
/**
|
|
4
|
+
* Computes the visible item index range using binary search.
|
|
5
|
+
*
|
|
6
|
+
* Responsibilities:
|
|
7
|
+
* - Determine which items intersect the visible window
|
|
8
|
+
* - Stay independent of rendering and recycling
|
|
9
|
+
*
|
|
10
|
+
* Performance:
|
|
11
|
+
* - O(log n) to locate the first visible item
|
|
12
|
+
* - O(k) to expand to the last visible item (k = visible count)
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeVisibleItemRange(input: VisibleRangeInput): VisibleRange | null;
|
|
15
|
+
//# sourceMappingURL=computeVisibleItemRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeVisibleItemRange.d.ts","sourceRoot":"","sources":["../../../../src/windowing/computeVisibleItemRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,GACvB,YAAY,GAAG,IAAI,CA6DrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { ScrollMetrics } from './ScrollMetrics';
|
|
2
|
-
export { findVisibleIndexRange } from './findVisibleIndexRange';
|
|
3
2
|
export { useScrollMetrics } from './useScrollMetrics';
|
|
3
|
+
export { computeVisibleItemRange } from './computeVisibleItemRange';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,
|
|
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,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
#include "JHybridNitroLayoutEngineSpec.hpp"
|
|
9
9
|
|
|
10
|
-
// Forward declaration of `
|
|
11
|
-
namespace margelo::nitro::nitrolist { struct
|
|
10
|
+
// Forward declaration of `LayoutRect` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::nitrolist { struct LayoutRect; }
|
|
12
12
|
|
|
13
|
-
#include "
|
|
13
|
+
#include "LayoutRect.hpp"
|
|
14
14
|
#include <vector>
|
|
15
|
-
#include "
|
|
15
|
+
#include "JLayoutRect.hpp"
|
|
16
16
|
|
|
17
17
|
namespace margelo::nitro::nitrolist {
|
|
18
18
|
|
|
@@ -46,8 +46,8 @@ namespace margelo::nitro::nitrolist {
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
// Methods
|
|
49
|
-
std::vector<
|
|
50
|
-
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<
|
|
49
|
+
std::vector<LayoutRect> JHybridNitroLayoutEngineSpec::computeLayout(double containerWidth, const std::vector<double>& itemHeights) {
|
|
50
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JLayoutRect>>(double /* containerWidth */, jni::alias_ref<jni::JArrayDouble> /* itemHeights */)>("computeLayout");
|
|
51
51
|
auto __result = method(_javaPart, containerWidth, [&]() {
|
|
52
52
|
size_t __size = itemHeights.size();
|
|
53
53
|
jni::local_ref<jni::JArrayDouble> __array = jni::JArrayDouble::newArray(__size);
|
|
@@ -56,7 +56,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
56
56
|
}());
|
|
57
57
|
return [&]() {
|
|
58
58
|
size_t __size = __result->size();
|
|
59
|
-
std::vector<
|
|
59
|
+
std::vector<LayoutRect> __vector;
|
|
60
60
|
__vector.reserve(__size);
|
|
61
61
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
62
62
|
auto __element = __result->getElement(__i);
|
|
@@ -54,7 +54,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
54
54
|
|
|
55
55
|
public:
|
|
56
56
|
// Methods
|
|
57
|
-
std::vector<
|
|
57
|
+
std::vector<LayoutRect> computeLayout(double containerWidth, const std::vector<double>& itemHeights) override;
|
|
58
58
|
|
|
59
59
|
private:
|
|
60
60
|
friend HybridBase;
|