@onekeyfe/react-native-native-list 6.7.0-1 → 6.7.0-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/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +1 -1
- package/docs/SPEC.md +15 -2
- package/ios/HybridNativeList.swift +11 -3
- package/ios/RNCNativeListView.swift +10 -6
- package/ios/tests/NativeListLifecycleTests.swift +28 -0
- package/lib/module/NativeList.js +2 -2
- package/lib/module/ScrollEdgeEffect.js +8 -0
- package/lib/module/index.js +1 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +10 -6
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +2 -2
- package/lib/nitrogen/generated/android/c++/JNativeListScrollEdgeEffect.hpp +61 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +3 -3
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +1 -1
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollEdgeEffect.kt +24 -0
- package/lib/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +3 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +8 -4
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +4 -4
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +1 -1
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +3 -3
- package/lib/nitrogen/generated/ios/swift/NativeListScrollEdgeEffect.swift +44 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +2 -2
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +5 -2
- package/lib/nitrogen/generated/shared/c++/NativeListScrollEdgeEffect.hpp +80 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +2 -2
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +4 -3
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +1 -1
- package/lib/typescript/src/NativeList.nitro.d.ts +2 -1
- package/lib/typescript/src/NativeList.types.d.ts +3 -2
- package/lib/typescript/src/ScrollEdgeEffect.d.ts +5 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +10 -6
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +2 -2
- package/nitrogen/generated/android/c++/JNativeListScrollEdgeEffect.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/NativeListScrollEdgeEffect.kt +24 -0
- package/nitrogen/generated/ios/NativeListModule-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +8 -4
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +4 -4
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +3 -3
- package/nitrogen/generated/ios/swift/NativeListScrollEdgeEffect.swift +44 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +2 -2
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +5 -2
- package/nitrogen/generated/shared/c++/NativeListScrollEdgeEffect.hpp +80 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +2 -2
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +4 -3
- package/nitrogen/generated/shared/json/NativeListConfig.json +1 -1
- package/package.json +3 -3
- package/react-native-native-list.podspec +4 -1
- package/src/NativeList.nitro.ts +3 -1
- package/src/NativeList.tsx +4 -2
- package/src/NativeList.types.ts +3 -2
- package/src/ScrollEdgeEffect.ts +4 -0
- package/src/index.ts +2 -0
package/src/NativeList.nitro.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface NativeListNativeProps extends HybridViewProps {
|
|
|
13
13
|
snapshotJson: string;
|
|
14
14
|
fontFamiliesJson: string;
|
|
15
15
|
containerSlotHeightsJson: string;
|
|
16
|
-
|
|
16
|
+
topScrollEdgeEffect: NativeListScrollEdgeEffect;
|
|
17
17
|
topOverlayHeight: number;
|
|
18
18
|
scrollPositionThresholdsJson: string;
|
|
19
19
|
onScrollPositionThresholdChange?: (isBeyondThreshold: boolean) => void;
|
|
@@ -61,3 +61,5 @@ export interface NativeListMethods extends HybridViewMethods {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export type NativeList = HybridView<NativeListNativeProps, NativeListMethods>;
|
|
64
|
+
|
|
65
|
+
export type NativeListScrollEdgeEffect = 'none' | 'hard' | 'soft';
|
package/src/NativeList.tsx
CHANGED
|
@@ -132,7 +132,7 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
|
|
|
132
132
|
const hasTopOverlay =
|
|
133
133
|
Platform?.OS === 'ios' &&
|
|
134
134
|
parseInt(String(Platform.Version), 10) >= 26 &&
|
|
135
|
-
topScrollEdgeEffect === 'hard' &&
|
|
135
|
+
(topScrollEdgeEffect === 'hard' || topScrollEdgeEffect === 'soft') &&
|
|
136
136
|
topOverlay != null;
|
|
137
137
|
const containerSlotHeightsJson = JSON.stringify(slotHeights);
|
|
138
138
|
const slotInset =
|
|
@@ -517,7 +517,9 @@ export const NativeList = forwardRef<NativeListRef, NativeListProps>(
|
|
|
517
517
|
fontFamiliesJson={fontFamiliesJson}
|
|
518
518
|
snapshotJson={snapshotJson}
|
|
519
519
|
containerSlotHeightsJson={containerSlotHeightsJson}
|
|
520
|
-
|
|
520
|
+
topScrollEdgeEffect={
|
|
521
|
+
hasTopOverlay ? topScrollEdgeEffect ?? 'none' : 'none'
|
|
522
|
+
}
|
|
521
523
|
topOverlayHeight={hasTopOverlay ? topOverlayHeight : 0}
|
|
522
524
|
scrollPositionThresholdsJson={scrollPositionThresholdsJson}
|
|
523
525
|
keyboardDismissMode={keyboardDismissMode}
|
package/src/NativeList.types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScrollEdgeEffect } from './ScrollEdgeEffect';
|
|
1
2
|
import type { ReactNode, RefObject } from 'react';
|
|
2
3
|
import type { View, ViewProps } from 'react-native';
|
|
3
4
|
import type {
|
|
@@ -125,8 +126,8 @@ export type NativeListProps = Omit<ViewProps, 'children'> &
|
|
|
125
126
|
listEmpty?: ReactNode;
|
|
126
127
|
/** Fixed overlay above scrolling rows on iOS 26 and newer. */
|
|
127
128
|
topOverlay?: ReactNode;
|
|
128
|
-
/**
|
|
129
|
-
topScrollEdgeEffect?:
|
|
129
|
+
/** Selects UIKit's top scroll-edge effect on iOS 26 and newer. */
|
|
130
|
+
topScrollEdgeEffect?: `${ScrollEdgeEffect}`;
|
|
130
131
|
/** Web only. Defaults to true and is ignored by the native host. */
|
|
131
132
|
webVirtualizationEnabled?: boolean;
|
|
132
133
|
/** Web only. Hosts the section index inside this container. */
|