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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RecyclerCell } from './RecyclerCell';
|
|
3
|
+
/**
|
|
4
|
+
* Public renderItem signature for RecyclerList.
|
|
5
|
+
* Renderers receive a stable physical cell contract.
|
|
6
|
+
*/
|
|
7
|
+
export type RecyclerItemRenderer<T> = (params: {
|
|
8
|
+
item: T;
|
|
9
|
+
index: number;
|
|
10
|
+
cell: RecyclerCell;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
//# 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,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE;IAC7C,IAAI,EAAE,CAAC,CAAA;IACP,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,YAAY,CAAA;CACnB,KAAK,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/recycler/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,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,19 @@
|
|
|
1
|
+
import type { LayoutRect } from "../types/layout";
|
|
2
|
+
export type VisibleRange = {
|
|
3
|
+
startIndex: number;
|
|
4
|
+
endIndex: number;
|
|
5
|
+
};
|
|
6
|
+
type Input = {
|
|
7
|
+
layouts: readonly LayoutRect[];
|
|
8
|
+
offset: number;
|
|
9
|
+
viewportSize: number;
|
|
10
|
+
buffer: number;
|
|
11
|
+
isVertical: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Computes visible item range using binary search + forward scan.
|
|
15
|
+
* Type-safe and defensive against invalid indices.
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeVisibleItemRange(input: Input): VisibleRange | null;
|
|
18
|
+
export {};
|
|
19
|
+
//# 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,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,KAAK,GACX,YAAY,GAAG,IAAI,CA2DrB"}
|
|
@@ -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"}
|
package/nitro.json
CHANGED
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
|
|
15
15
|
"autolinking": {
|
|
16
16
|
"views": {
|
|
17
|
-
"
|
|
17
|
+
"NitroList": {
|
|
18
18
|
"swift": "HybridNitroList",
|
|
19
19
|
"kotlin": "HybridNitroList"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"objects": {
|
|
23
|
-
"
|
|
24
|
-
"swift": "
|
|
25
|
-
"kotlin": "
|
|
23
|
+
"LayoutEngine": {
|
|
24
|
+
"swift": "HybridLayoutEngine",
|
|
25
|
+
"kotlin": "HybridLayoutEngine"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
"ignorePaths": ["**/node_modules"]
|
|
31
|
-
}
|
|
31
|
+
}
|
|
@@ -33,9 +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++/
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridNitroListSpec.cpp
|
|
37
37
|
# Android-specific Nitrogen C++ sources
|
|
38
|
-
../nitrogen/generated/android/c++/
|
|
38
|
+
../nitrogen/generated/android/c++/JHybridNitroListSpec.cpp
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
#include <fbjni/fbjni.h>
|
|
16
16
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
17
|
|
|
18
|
-
#include "
|
|
18
|
+
#include "JHybridNitroListSpec.hpp"
|
|
19
19
|
|
|
20
20
|
namespace margelo::nitro::nitrolist {
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ int initialize(JavaVM* vm) {
|
|
|
26
26
|
|
|
27
27
|
return facebook::jni::initialize(vm, [] {
|
|
28
28
|
// Register native JNI methods
|
|
29
|
-
margelo::nitro::nitrolist::
|
|
29
|
+
margelo::nitro::nitrolist::JHybridNitroListSpec::registerNatives();
|
|
30
30
|
|
|
31
31
|
// Register Nitro Hybrid Objects
|
|
32
32
|
|
package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.cpp → JHybridNitroListSpec.cpp}
RENAMED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JHybridNitroListSpec.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "JHybridNitroListSpec.hpp"
|
|
9
9
|
|
|
10
|
-
// Forward declaration of `
|
|
11
|
-
namespace margelo::nitro::nitrolist { struct
|
|
10
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
11
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
12
12
|
|
|
13
|
-
#include "
|
|
13
|
+
#include "ItemLayout.hpp"
|
|
14
14
|
#include <vector>
|
|
15
|
-
#include "
|
|
15
|
+
#include "JItemLayout.hpp"
|
|
16
16
|
|
|
17
17
|
namespace margelo::nitro::nitrolist {
|
|
18
18
|
|
|
19
|
-
jni::local_ref<
|
|
19
|
+
jni::local_ref<JHybridNitroListSpec::jhybriddata> JHybridNitroListSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
|
|
20
20
|
return makeCxxInstance(jThis);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
void
|
|
23
|
+
void JHybridNitroListSpec::registerNatives() {
|
|
24
24
|
registerHybrid({
|
|
25
|
-
makeNativeMethod("initHybrid",
|
|
25
|
+
makeNativeMethod("initHybrid", JHybridNitroListSpec::initHybrid),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
size_t
|
|
29
|
+
size_t JHybridNitroListSpec::getExternalMemorySize() noexcept {
|
|
30
30
|
static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
|
|
31
31
|
return method(_javaPart);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
void
|
|
34
|
+
void JHybridNitroListSpec::dispose() noexcept {
|
|
35
35
|
static const auto method = javaClassStatic()->getMethod<void()>("dispose");
|
|
36
36
|
method(_javaPart);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
std::string
|
|
39
|
+
std::string JHybridNitroListSpec::toString() {
|
|
40
40
|
static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
|
|
41
41
|
auto javaString = method(_javaPart);
|
|
42
42
|
return javaString->toStdString();
|
|
@@ -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<ItemLayout> JHybridNitroListSpec::computeLayout(double containerWidth, const std::vector<double>& itemHeights) {
|
|
50
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JArrayClass<JItemLayout>>(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<ItemLayout> __vector;
|
|
60
60
|
__vector.reserve(__size);
|
|
61
61
|
for (size_t __i = 0; __i < __size; __i++) {
|
|
62
62
|
auto __element = __result->getElement(__i);
|
package/nitrogen/generated/android/c++/{JHybridNitroLayoutEngineSpec.hpp → JHybridNitroListSpec.hpp}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpec.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
#include <NitroModules/JHybridObject.hpp>
|
|
11
11
|
#include <fbjni/fbjni.h>
|
|
12
|
-
#include "
|
|
12
|
+
#include "HybridNitroListSpec.hpp"
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -18,22 +18,22 @@ namespace margelo::nitro::nitrolist {
|
|
|
18
18
|
|
|
19
19
|
using namespace facebook;
|
|
20
20
|
|
|
21
|
-
class
|
|
22
|
-
|
|
21
|
+
class JHybridNitroListSpec: public jni::HybridClass<JHybridNitroListSpec, JHybridObject>,
|
|
22
|
+
public virtual HybridNitroListSpec {
|
|
23
23
|
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/HybridNitroListSpec;";
|
|
25
25
|
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
|
|
26
26
|
static void registerNatives();
|
|
27
27
|
|
|
28
28
|
protected:
|
|
29
29
|
// C++ constructor (called from Java via `initHybrid()`)
|
|
30
|
-
explicit
|
|
31
|
-
HybridObject(
|
|
30
|
+
explicit JHybridNitroListSpec(jni::alias_ref<jhybridobject> jThis) :
|
|
31
|
+
HybridObject(HybridNitroListSpec::TAG),
|
|
32
32
|
HybridBase(jThis),
|
|
33
33
|
_javaPart(jni::make_global(jThis)) {}
|
|
34
34
|
|
|
35
35
|
public:
|
|
36
|
-
~
|
|
36
|
+
~JHybridNitroListSpec() override {
|
|
37
37
|
// Hermes GC can destroy JS objects on a non-JNI Thread.
|
|
38
38
|
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
|
|
39
39
|
}
|
|
@@ -44,7 +44,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
44
44
|
std::string toString() override;
|
|
45
45
|
|
|
46
46
|
public:
|
|
47
|
-
inline const jni::global_ref<
|
|
47
|
+
inline const jni::global_ref<JHybridNitroListSpec::javaobject>& getJavaPart() const noexcept {
|
|
48
48
|
return _javaPart;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -54,12 +54,12 @@ namespace margelo::nitro::nitrolist {
|
|
|
54
54
|
|
|
55
55
|
public:
|
|
56
56
|
// Methods
|
|
57
|
-
std::vector<
|
|
57
|
+
std::vector<ItemLayout> computeLayout(double containerWidth, const std::vector<double>& itemHeights) override;
|
|
58
58
|
|
|
59
59
|
private:
|
|
60
60
|
friend HybridBase;
|
|
61
61
|
using HybridBase::HybridBase;
|
|
62
|
-
jni::global_ref<
|
|
62
|
+
jni::global_ref<JHybridNitroListSpec::javaobject> _javaPart;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
} // namespace margelo::nitro::nitrolist
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JItemLayout.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "ItemLayout.hpp"
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -17,19 +17,19 @@ namespace margelo::nitro::nitrolist {
|
|
|
17
17
|
using namespace facebook;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "ItemLayout" and the the Kotlin data class "ItemLayout".
|
|
21
21
|
*/
|
|
22
|
-
struct
|
|
22
|
+
struct JItemLayout final: public jni::JavaClass<JItemLayout> {
|
|
23
23
|
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolist/ItemLayout;";
|
|
25
25
|
|
|
26
26
|
public:
|
|
27
27
|
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ItemLayout by copying all values to C++.
|
|
29
29
|
*/
|
|
30
30
|
[[maybe_unused]]
|
|
31
31
|
[[nodiscard]]
|
|
32
|
-
|
|
32
|
+
ItemLayout toCpp() const {
|
|
33
33
|
static const auto clazz = javaClassStatic();
|
|
34
34
|
static const auto fieldX = clazz->getField<double>("x");
|
|
35
35
|
double x = this->getFieldValue(fieldX);
|
|
@@ -39,7 +39,7 @@ namespace margelo::nitro::nitrolist {
|
|
|
39
39
|
double width = this->getFieldValue(fieldWidth);
|
|
40
40
|
static const auto fieldHeight = clazz->getField<double>("height");
|
|
41
41
|
double height = this->getFieldValue(fieldHeight);
|
|
42
|
-
return
|
|
42
|
+
return ItemLayout(
|
|
43
43
|
x,
|
|
44
44
|
y,
|
|
45
45
|
width,
|
|
@@ -52,8 +52,8 @@ namespace margelo::nitro::nitrolist {
|
|
|
52
52
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
53
|
*/
|
|
54
54
|
[[maybe_unused]]
|
|
55
|
-
static jni::local_ref<
|
|
56
|
-
using JSignature =
|
|
55
|
+
static jni::local_ref<JItemLayout::javaobject> fromCpp(const ItemLayout& value) {
|
|
56
|
+
using JSignature = JItemLayout(double, double, double, double);
|
|
57
57
|
static const auto clazz = javaClassStatic();
|
|
58
58
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
59
59
|
return create(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpec.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -13,8 +13,8 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
13
13
|
import com.margelo.nitro.core.HybridObject
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* A Kotlin class representing the
|
|
17
|
-
* Implement this abstract class to create Kotlin-based instances of
|
|
16
|
+
* A Kotlin class representing the NitroList HybridObject.
|
|
17
|
+
* Implement this abstract class to create Kotlin-based instances of NitroList.
|
|
18
18
|
*/
|
|
19
19
|
@DoNotStrip
|
|
20
20
|
@Keep
|
|
@@ -23,7 +23,7 @@ import com.margelo.nitro.core.HybridObject
|
|
|
23
23
|
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
24
24
|
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
25
25
|
)
|
|
26
|
-
abstract class
|
|
26
|
+
abstract class HybridNitroListSpec: HybridObject() {
|
|
27
27
|
@DoNotStrip
|
|
28
28
|
private var mHybridData: HybridData = initHybrid()
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ abstract class HybridNitroLayoutEngineSpec: HybridObject() {
|
|
|
38
38
|
|
|
39
39
|
// Default implementation of `HybridObject.toString()`
|
|
40
40
|
override fun toString(): String {
|
|
41
|
-
return "[HybridObject
|
|
41
|
+
return "[HybridObject NitroList]"
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Properties
|
|
@@ -47,11 +47,11 @@ abstract class HybridNitroLayoutEngineSpec: HybridObject() {
|
|
|
47
47
|
// Methods
|
|
48
48
|
@DoNotStrip
|
|
49
49
|
@Keep
|
|
50
|
-
abstract fun computeLayout(containerWidth: Double, itemHeights: DoubleArray): Array<
|
|
50
|
+
abstract fun computeLayout(containerWidth: Double, itemHeights: DoubleArray): Array<ItemLayout>
|
|
51
51
|
|
|
52
52
|
private external fun initHybrid(): HybridData
|
|
53
53
|
|
|
54
54
|
companion object {
|
|
55
|
-
protected const val TAG = "
|
|
55
|
+
protected const val TAG = "HybridNitroListSpec"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// ItemLayout.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
@@ -12,11 +12,11 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Represents the JavaScript object/struct "
|
|
15
|
+
* Represents the JavaScript object/struct "ItemLayout".
|
|
16
16
|
*/
|
|
17
17
|
@DoNotStrip
|
|
18
18
|
@Keep
|
|
19
|
-
data class
|
|
19
|
+
data class ItemLayout(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
22
|
val x: Double,
|
|
@@ -40,8 +40,8 @@ data class LayoutRectangle(
|
|
|
40
40
|
@Keep
|
|
41
41
|
@Suppress("unused")
|
|
42
42
|
@JvmStatic
|
|
43
|
-
private fun fromCpp(x: Double, y: Double, width: Double, height: Double):
|
|
44
|
-
return
|
|
43
|
+
private fun fromCpp(x: Double, y: Double, width: Double, height: Double): ItemLayout {
|
|
44
|
+
return ItemLayout(x, y, width, height)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
#include "NitroList-Swift-Cxx-Bridge.hpp"
|
|
9
9
|
|
|
10
10
|
// Include C++ implementation defined types
|
|
11
|
-
#include "
|
|
11
|
+
#include "HybridNitroListSpecSwift.hpp"
|
|
12
12
|
#include "NitroList-Swift-Cxx-Umbrella.hpp"
|
|
13
13
|
#include <NitroModules/NitroDefines.hpp>
|
|
14
14
|
|
|
15
15
|
namespace margelo::nitro::nitrolist::bridge::swift {
|
|
16
16
|
|
|
17
|
-
// pragma MARK: std::shared_ptr<
|
|
18
|
-
std::shared_ptr<
|
|
19
|
-
NitroList::
|
|
20
|
-
return std::make_shared<margelo::nitro::nitrolist::
|
|
17
|
+
// pragma MARK: std::shared_ptr<HybridNitroListSpec>
|
|
18
|
+
std::shared_ptr<HybridNitroListSpec> create_std__shared_ptr_HybridNitroListSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
19
|
+
NitroList::HybridNitroListSpec_cxx swiftPart = NitroList::HybridNitroListSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
20
|
+
return std::make_shared<margelo::nitro::nitrolist::HybridNitroListSpecSwift>(swiftPart);
|
|
21
21
|
}
|
|
22
|
-
void* NON_NULL
|
|
23
|
-
std::shared_ptr<margelo::nitro::nitrolist::
|
|
22
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroListSpec_(std__shared_ptr_HybridNitroListSpec_ cppType) {
|
|
23
|
+
std::shared_ptr<margelo::nitro::nitrolist::HybridNitroListSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::nitrolist::HybridNitroListSpecSwift>(cppType);
|
|
24
24
|
#ifdef NITRO_DEBUG
|
|
25
25
|
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
26
|
-
throw std::runtime_error("Class \"
|
|
26
|
+
throw std::runtime_error("Class \"HybridNitroListSpec\" is not implemented in Swift!");
|
|
27
27
|
}
|
|
28
28
|
#endif
|
|
29
|
-
NitroList::
|
|
29
|
+
NitroList::HybridNitroListSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
30
30
|
return swiftPart.toUnsafe();
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `
|
|
12
|
-
namespace margelo::nitro::nitrolist { class
|
|
13
|
-
// Forward declaration of `
|
|
14
|
-
namespace margelo::nitro::nitrolist { struct
|
|
11
|
+
// Forward declaration of `HybridNitroListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitrolist { class HybridNitroListSpec; }
|
|
13
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
15
15
|
|
|
16
16
|
// Forward declarations of Swift defined types
|
|
17
|
-
// Forward declaration of `
|
|
18
|
-
namespace NitroList { class
|
|
17
|
+
// Forward declaration of `HybridNitroListSpec_cxx` to properly resolve imports.
|
|
18
|
+
namespace NitroList { class HybridNitroListSpec_cxx; }
|
|
19
19
|
|
|
20
20
|
// Include C++ defined types
|
|
21
|
-
#include "
|
|
22
|
-
#include "
|
|
21
|
+
#include "HybridNitroListSpec.hpp"
|
|
22
|
+
#include "ItemLayout.hpp"
|
|
23
23
|
#include <NitroModules/Result.hpp>
|
|
24
24
|
#include <exception>
|
|
25
25
|
#include <memory>
|
|
@@ -31,13 +31,13 @@ namespace NitroList { class HybridNitroLayoutEngineSpec_cxx; }
|
|
|
31
31
|
*/
|
|
32
32
|
namespace margelo::nitro::nitrolist::bridge::swift {
|
|
33
33
|
|
|
34
|
-
// pragma MARK: std::vector<
|
|
34
|
+
// pragma MARK: std::vector<ItemLayout>
|
|
35
35
|
/**
|
|
36
|
-
* Specialized version of `std::vector<
|
|
36
|
+
* Specialized version of `std::vector<ItemLayout>`.
|
|
37
37
|
*/
|
|
38
|
-
using
|
|
39
|
-
inline std::vector<
|
|
40
|
-
std::vector<
|
|
38
|
+
using std__vector_ItemLayout_ = std::vector<ItemLayout>;
|
|
39
|
+
inline std::vector<ItemLayout> create_std__vector_ItemLayout_(size_t size) noexcept {
|
|
40
|
+
std::vector<ItemLayout> vector;
|
|
41
41
|
vector.reserve(size);
|
|
42
42
|
return vector;
|
|
43
43
|
}
|
|
@@ -53,25 +53,25 @@ namespace margelo::nitro::nitrolist::bridge::swift {
|
|
|
53
53
|
return vector;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// pragma MARK: std::shared_ptr<
|
|
56
|
+
// pragma MARK: std::shared_ptr<HybridNitroListSpec>
|
|
57
57
|
/**
|
|
58
|
-
* Specialized version of `std::shared_ptr<
|
|
58
|
+
* Specialized version of `std::shared_ptr<HybridNitroListSpec>`.
|
|
59
59
|
*/
|
|
60
|
-
using
|
|
61
|
-
std::shared_ptr<
|
|
62
|
-
void* NON_NULL
|
|
60
|
+
using std__shared_ptr_HybridNitroListSpec_ = std::shared_ptr<HybridNitroListSpec>;
|
|
61
|
+
std::shared_ptr<HybridNitroListSpec> create_std__shared_ptr_HybridNitroListSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
62
|
+
void* NON_NULL get_std__shared_ptr_HybridNitroListSpec_(std__shared_ptr_HybridNitroListSpec_ cppType);
|
|
63
63
|
|
|
64
|
-
// pragma MARK: std::weak_ptr<
|
|
65
|
-
using
|
|
66
|
-
inline
|
|
64
|
+
// pragma MARK: std::weak_ptr<HybridNitroListSpec>
|
|
65
|
+
using std__weak_ptr_HybridNitroListSpec_ = std::weak_ptr<HybridNitroListSpec>;
|
|
66
|
+
inline std__weak_ptr_HybridNitroListSpec_ weakify_std__shared_ptr_HybridNitroListSpec_(const std::shared_ptr<HybridNitroListSpec>& strong) noexcept { return strong; }
|
|
67
67
|
|
|
68
|
-
// pragma MARK: Result<std::vector<
|
|
69
|
-
using
|
|
70
|
-
inline
|
|
71
|
-
return Result<std::vector<
|
|
68
|
+
// pragma MARK: Result<std::vector<ItemLayout>>
|
|
69
|
+
using Result_std__vector_ItemLayout__ = Result<std::vector<ItemLayout>>;
|
|
70
|
+
inline Result_std__vector_ItemLayout__ create_Result_std__vector_ItemLayout__(const std::vector<ItemLayout>& value) noexcept {
|
|
71
|
+
return Result<std::vector<ItemLayout>>::withValue(value);
|
|
72
72
|
}
|
|
73
|
-
inline
|
|
74
|
-
return Result<std::vector<
|
|
73
|
+
inline Result_std__vector_ItemLayout__ create_Result_std__vector_ItemLayout__(const std::exception_ptr& error) noexcept {
|
|
74
|
+
return Result<std::vector<ItemLayout>>::withError(error);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
} // namespace margelo::nitro::nitrolist::bridge::swift
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
-
// Forward declaration of `
|
|
12
|
-
namespace margelo::nitro::nitrolist { class
|
|
13
|
-
// Forward declaration of `
|
|
14
|
-
namespace margelo::nitro::nitrolist { struct
|
|
11
|
+
// Forward declaration of `HybridNitroListSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::nitrolist { class HybridNitroListSpec; }
|
|
13
|
+
// Forward declaration of `ItemLayout` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::nitrolist { struct ItemLayout; }
|
|
15
15
|
|
|
16
16
|
// Include C++ defined types
|
|
17
|
-
#include "
|
|
18
|
-
#include "
|
|
17
|
+
#include "HybridNitroListSpec.hpp"
|
|
18
|
+
#include "ItemLayout.hpp"
|
|
19
19
|
#include <NitroModules/Result.hpp>
|
|
20
20
|
#include <exception>
|
|
21
21
|
#include <memory>
|
|
@@ -31,8 +31,8 @@ namespace margelo::nitro::nitrolist { struct LayoutRectangle; }
|
|
|
31
31
|
#include <NitroModules/DateToChronoDate.hpp>
|
|
32
32
|
|
|
33
33
|
// Forward declarations of Swift defined types
|
|
34
|
-
// Forward declaration of `
|
|
35
|
-
namespace NitroList { class
|
|
34
|
+
// Forward declaration of `HybridNitroListSpec_cxx` to properly resolve imports.
|
|
35
|
+
namespace NitroList { class HybridNitroListSpec_cxx; }
|
|
36
36
|
|
|
37
37
|
// Include Swift defined types
|
|
38
38
|
#if __has_include("NitroList-Swift.h")
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroListSpecSwift.cpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "HybridNitroListSpecSwift.hpp"
|
|
9
9
|
|
|
10
10
|
namespace margelo::nitro::nitrolist {
|
|
11
11
|
} // namespace margelo::nitro::nitrolist
|