@shopify/flash-list 2.0.0 → 2.0.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -27
- package/RNFlashList.podspec +37 -0
- package/android/build.gradle +89 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt +105 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt +158 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutViewManager.kt +70 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/BlankAreaEvent.kt +29 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainer.java +16 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerImpl.kt +16 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerManager.kt +34 -0
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/FlashListPackage.kt +19 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerDelegate.java +47 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerInterface.java +21 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerDelegate.java +32 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerInterface.java +16 -0
- package/android/src/test/java/com/shopify/reactnative/flash_list/AutoLayoutShadowTest.kt +147 -0
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/Rect.kt +61 -0
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestCollection.kt +6 -0
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestDataModel.kt +8 -0
- package/android/src/test/resources/LayoutTestData.json +788 -0
- package/dist/AnimatedFlashList.js +2 -2
- package/dist/AnimatedFlashList.js.map +1 -1
- package/dist/FlashList.d.ts +167 -1
- package/dist/FlashList.d.ts.map +1 -1
- package/dist/FlashList.js +595 -3
- package/dist/FlashList.js.map +1 -1
- package/dist/FlashListProps.d.ts +63 -2
- package/dist/FlashListProps.d.ts.map +1 -1
- package/dist/FlashListProps.js.map +1 -1
- package/dist/GridLayoutProviderWithProps.d.ts +42 -0
- package/dist/GridLayoutProviderWithProps.d.ts.map +1 -0
- package/dist/GridLayoutProviderWithProps.js +114 -0
- package/dist/GridLayoutProviderWithProps.js.map +1 -0
- package/dist/MasonryFlashList.d.ts +51 -0
- package/dist/MasonryFlashList.d.ts.map +1 -0
- package/dist/MasonryFlashList.js +252 -0
- package/dist/MasonryFlashList.js.map +1 -0
- package/dist/PureComponentWrapper.d.ts +22 -0
- package/dist/PureComponentWrapper.d.ts.map +1 -0
- package/dist/PureComponentWrapper.js +37 -0
- package/dist/PureComponentWrapper.js.map +1 -0
- package/dist/__tests__/ContentContainerUtils.test.d.ts +2 -0
- package/dist/__tests__/ContentContainerUtils.test.d.ts.map +1 -0
- package/dist/__tests__/ContentContainerUtils.test.js +85 -0
- package/dist/__tests__/ContentContainerUtils.test.js.map +1 -0
- package/dist/__tests__/FlashList.test.d.ts +2 -0
- package/dist/__tests__/FlashList.test.d.ts.map +1 -0
- package/dist/__tests__/FlashList.test.js +902 -0
- package/dist/__tests__/FlashList.test.js.map +1 -0
- package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts +2 -0
- package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts.map +1 -0
- package/dist/__tests__/GridLayoutProviderWithProps.test.js +143 -0
- package/dist/__tests__/GridLayoutProviderWithProps.test.js.map +1 -0
- package/dist/__tests__/MasonryFlashList.test.d.ts +2 -0
- package/dist/__tests__/MasonryFlashList.test.d.ts.map +1 -0
- package/dist/__tests__/MasonryFlashList.test.js +254 -0
- package/dist/__tests__/MasonryFlashList.test.js.map +1 -0
- package/dist/__tests__/PlatformHelper.web.test.d.ts +2 -0
- package/dist/__tests__/PlatformHelper.web.test.d.ts.map +1 -0
- package/dist/__tests__/PlatformHelper.web.test.js +33 -0
- package/dist/__tests__/PlatformHelper.web.test.js.map +1 -0
- package/dist/__tests__/ViewabilityHelper.test.js +4 -3
- package/dist/__tests__/ViewabilityHelper.test.js.map +1 -1
- package/dist/__tests__/helpers/mountFlashList.d.ts +19 -0
- package/dist/__tests__/helpers/mountFlashList.d.ts.map +1 -0
- package/dist/__tests__/helpers/mountFlashList.js +44 -0
- package/dist/__tests__/helpers/mountFlashList.js.map +1 -0
- package/dist/__tests__/helpers/mountMasonryFlashList.d.ts +18 -0
- package/dist/__tests__/helpers/mountMasonryFlashList.d.ts.map +1 -0
- package/dist/__tests__/helpers/mountMasonryFlashList.js +49 -0
- package/dist/__tests__/helpers/mountMasonryFlashList.js.map +1 -0
- package/dist/__tests__/useBlankAreaTracker.test.d.ts +2 -0
- package/dist/__tests__/useBlankAreaTracker.test.d.ts.map +1 -0
- package/dist/__tests__/useBlankAreaTracker.test.js +179 -0
- package/dist/__tests__/useBlankAreaTracker.test.js.map +1 -0
- package/dist/benchmark/JSFPSMonitor.d.ts.map +1 -1
- package/dist/benchmark/JSFPSMonitor.js +1 -2
- package/dist/benchmark/JSFPSMonitor.js.map +1 -1
- package/dist/benchmark/useBenchmark.d.ts +4 -2
- package/dist/benchmark/useBenchmark.d.ts.map +1 -1
- package/dist/benchmark/useBenchmark.js +24 -12
- package/dist/benchmark/useBenchmark.js.map +1 -1
- package/dist/benchmark/useBlankAreaTracker.d.ts +34 -0
- package/dist/benchmark/useBlankAreaTracker.d.ts.map +1 -0
- package/dist/benchmark/useBlankAreaTracker.js +66 -0
- package/dist/benchmark/useBlankAreaTracker.js.map +1 -0
- package/dist/benchmark/useFlatListBenchmark.d.ts.map +1 -1
- package/dist/benchmark/useFlatListBenchmark.js +1 -2
- package/dist/benchmark/useFlatListBenchmark.js.map +1 -1
- package/dist/enableNewCore.d.ts +3 -0
- package/dist/enableNewCore.d.ts.map +1 -0
- package/dist/enableNewCore.js +25 -0
- package/dist/enableNewCore.js.map +1 -0
- package/dist/errors/CustomError.d.ts +8 -0
- package/dist/errors/CustomError.d.ts.map +1 -0
- package/dist/errors/CustomError.js +14 -0
- package/dist/errors/CustomError.js.map +1 -0
- package/dist/errors/ExceptionList.d.ts +24 -0
- package/dist/errors/ExceptionList.d.ts.map +1 -0
- package/dist/errors/ExceptionList.js +26 -0
- package/dist/errors/ExceptionList.js.map +1 -0
- package/dist/errors/Warnings.d.ts +9 -0
- package/dist/errors/Warnings.d.ts.map +1 -0
- package/dist/errors/Warnings.js +13 -0
- package/dist/errors/Warnings.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/native/auto-layout/AutoLayoutView.d.ts +22 -0
- package/dist/native/auto-layout/AutoLayoutView.d.ts.map +1 -0
- package/dist/native/auto-layout/AutoLayoutView.js +48 -0
- package/dist/native/auto-layout/AutoLayoutView.js.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts +4 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js +6 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts +5 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts +4 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js +6 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js +6 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts +16 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts.map +1 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js +3 -0
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js.map +1 -0
- package/dist/native/cell-container/CellContainer.android.d.ts +6 -0
- package/dist/native/cell-container/CellContainer.android.d.ts.map +1 -0
- package/dist/native/cell-container/CellContainer.android.js +9 -0
- package/dist/native/cell-container/CellContainer.android.js.map +1 -0
- package/dist/native/cell-container/CellContainer.d.ts +8 -0
- package/dist/native/cell-container/CellContainer.d.ts.map +1 -0
- package/dist/native/cell-container/CellContainer.ios.d.ts +6 -0
- package/dist/native/cell-container/CellContainer.ios.d.ts.map +1 -0
- package/dist/native/cell-container/CellContainer.ios.js +9 -0
- package/dist/native/cell-container/CellContainer.ios.js.map +1 -0
- package/dist/native/cell-container/CellContainer.js +11 -0
- package/dist/native/cell-container/CellContainer.js.map +1 -0
- package/dist/native/cell-container/CellContainer.web.d.ts +7 -0
- package/dist/native/cell-container/CellContainer.web.d.ts.map +1 -0
- package/dist/native/cell-container/CellContainer.web.js +13 -0
- package/dist/native/cell-container/CellContainer.web.js.map +1 -0
- package/dist/native/config/PlatformHelper.android.d.ts +22 -1
- package/dist/native/config/PlatformHelper.android.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.android.js +16 -1
- package/dist/native/config/PlatformHelper.android.js.map +1 -1
- package/dist/native/config/PlatformHelper.d.ts +22 -1
- package/dist/native/config/PlatformHelper.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.ios.d.ts +22 -1
- package/dist/native/config/PlatformHelper.ios.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.ios.js +15 -1
- package/dist/native/config/PlatformHelper.ios.js.map +1 -1
- package/dist/native/config/PlatformHelper.js +16 -1
- package/dist/native/config/PlatformHelper.js.map +1 -1
- package/dist/native/config/PlatformHelper.web.d.ts +23 -1
- package/dist/native/config/PlatformHelper.web.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.web.js +18 -1
- package/dist/native/config/PlatformHelper.web.js.map +1 -1
- package/dist/recyclerview/RecyclerView.d.ts.map +1 -1
- package/dist/recyclerview/RecyclerView.js +6 -6
- package/dist/recyclerview/RecyclerView.js.map +1 -1
- package/dist/recyclerview/RecyclerViewManager.d.ts.map +1 -1
- package/dist/recyclerview/RecyclerViewManager.js +8 -9
- package/dist/recyclerview/RecyclerViewManager.js.map +1 -1
- package/dist/recyclerview/RecyclerViewProps.d.ts +8 -1
- package/dist/recyclerview/RecyclerViewProps.d.ts.map +1 -1
- package/dist/recyclerview/helpers/RenderTimeTracker.d.ts +3 -0
- package/dist/recyclerview/helpers/RenderTimeTracker.d.ts.map +1 -1
- package/dist/recyclerview/helpers/RenderTimeTracker.js +7 -0
- package/dist/recyclerview/helpers/RenderTimeTracker.js.map +1 -1
- package/dist/recyclerview/hooks/useRecyclerViewController.d.ts.map +1 -1
- package/dist/recyclerview/hooks/useRecyclerViewController.js +0 -4
- package/dist/recyclerview/hooks/useRecyclerViewController.js.map +1 -1
- package/dist/recyclerview/layout-managers/LayoutManager.d.ts.map +1 -1
- package/dist/recyclerview/layout-managers/LayoutManager.js +1 -2
- package/dist/recyclerview/layout-managers/LayoutManager.js.map +1 -1
- package/dist/specs/AutoLayoutNativeComponent.d.ts +18 -0
- package/dist/specs/AutoLayoutNativeComponent.d.ts.map +1 -0
- package/dist/specs/AutoLayoutNativeComponent.js +6 -0
- package/dist/specs/AutoLayoutNativeComponent.js.map +1 -0
- package/dist/specs/CellContainerNativeComponent.d.ts +8 -0
- package/dist/specs/CellContainerNativeComponent.d.ts.map +1 -0
- package/dist/specs/CellContainerNativeComponent.js +6 -0
- package/dist/specs/CellContainerNativeComponent.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/ContentContainerUtils.d.ts +27 -0
- package/dist/utils/ContentContainerUtils.d.ts.map +1 -0
- package/dist/utils/ContentContainerUtils.js +48 -0
- package/dist/utils/ContentContainerUtils.js.map +1 -0
- package/dist/viewability/ViewToken.d.ts.map +1 -0
- package/dist/viewability/ViewToken.js.map +1 -0
- package/dist/{recyclerview/viewability → viewability}/ViewabilityHelper.d.ts +2 -2
- package/dist/viewability/ViewabilityHelper.d.ts.map +1 -0
- package/dist/{recyclerview/viewability → viewability}/ViewabilityHelper.js +4 -2
- package/dist/{recyclerview/viewability → viewability}/ViewabilityHelper.js.map +1 -1
- package/dist/{recyclerview/viewability → viewability}/ViewabilityManager.d.ts +3 -3
- package/dist/viewability/ViewabilityManager.d.ts.map +1 -0
- package/dist/{recyclerview/viewability → viewability}/ViewabilityManager.js +16 -16
- package/dist/viewability/ViewabilityManager.js.map +1 -0
- package/ios/RNFlashList.xcodeproj/project.pbxproj +3 -0
- package/ios/RNFlashList.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/Sources/AutoLayoutView.swift +294 -0
- package/ios/Sources/AutoLayoutViewComponentView.h +16 -0
- package/ios/Sources/AutoLayoutViewComponentView.mm +90 -0
- package/ios/Sources/AutoLayoutViewManager.mm +14 -0
- package/ios/Sources/AutoLayoutViewManager.swift +12 -0
- package/ios/Sources/CellContainerComponentView.h +18 -0
- package/ios/Sources/CellContainerComponentView.mm +62 -0
- package/ios/Sources/CellContainerManager.mm +8 -0
- package/ios/Sources/CellContainerManager.swift +12 -0
- package/ios/Sources/FlatListPro-Bridging-Header.h +11 -0
- package/ios/Tests/AutoLayoutViewTests.swift +113 -0
- package/package.json +14 -3
- package/src/AnimatedFlashList.ts +2 -2
- package/src/FlashList.tsx +953 -0
- package/src/FlashListProps.ts +79 -3
- package/src/GridLayoutProviderWithProps.ts +180 -0
- package/src/MasonryFlashList.tsx +476 -0
- package/src/PureComponentWrapper.tsx +42 -0
- package/src/__tests__/ContentContainerUtils.test.ts +130 -0
- package/src/__tests__/FlashList.test.tsx +1001 -0
- package/src/__tests__/GridLayoutProviderWithProps.test.ts +179 -0
- package/src/__tests__/MasonryFlashList.test.ts +292 -0
- package/src/__tests__/PlatformHelper.web.test.ts +45 -0
- package/src/__tests__/ViewabilityHelper.test.ts +14 -13
- package/src/__tests__/helpers/mountFlashList.tsx +62 -0
- package/src/__tests__/helpers/mountMasonryFlashList.tsx +70 -0
- package/src/__tests__/useBlankAreaTracker.test.tsx +206 -0
- package/src/benchmark/JSFPSMonitor.ts +3 -3
- package/src/benchmark/useBenchmark.ts +40 -12
- package/src/benchmark/useBlankAreaTracker.ts +117 -0
- package/src/benchmark/useFlatListBenchmark.ts +1 -3
- package/src/enableNewCore.ts +24 -0
- package/src/errors/CustomError.ts +10 -0
- package/src/errors/ExceptionList.ts +28 -0
- package/src/errors/Warnings.ts +15 -0
- package/src/index.ts +43 -7
- package/src/native/auto-layout/AutoLayoutView.tsx +73 -0
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.android.ts +7 -0
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.ios.ts +7 -0
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.ts +7 -0
- package/src/native/auto-layout/AutoLayoutViewNativeComponentProps.ts +17 -0
- package/src/native/cell-container/CellContainer.android.ts +7 -0
- package/src/native/cell-container/CellContainer.ios.ts +7 -0
- package/src/native/cell-container/CellContainer.tsx +14 -0
- package/src/native/cell-container/CellContainer.web.tsx +9 -0
- package/src/native/config/PlatformHelper.android.ts +25 -1
- package/src/native/config/PlatformHelper.ios.ts +24 -1
- package/src/native/config/PlatformHelper.ts +25 -1
- package/src/native/config/PlatformHelper.web.ts +30 -1
- package/src/recyclerview/RecyclerView.tsx +11 -6
- package/src/recyclerview/RecyclerViewManager.ts +18 -9
- package/src/recyclerview/RecyclerViewProps.ts +11 -1
- package/src/recyclerview/helpers/RenderTimeTracker.ts +8 -0
- package/src/recyclerview/hooks/useRecyclerViewController.tsx +0 -4
- package/src/recyclerview/layout-managers/LayoutManager.ts +1 -2
- package/src/specs/AutoLayoutNativeComponent.ts +24 -0
- package/src/specs/CellContainerNativeComponent.ts +9 -0
- package/src/utils/ContentContainerUtils.ts +92 -0
- package/src/{recyclerview/viewability → viewability}/ViewabilityHelper.ts +9 -8
- package/src/{recyclerview/viewability → viewability}/ViewabilityManager.ts +20 -18
- package/dist/errors/ErrorMessages.d.ts +0 -16
- package/dist/errors/ErrorMessages.d.ts.map +0 -1
- package/dist/errors/ErrorMessages.js +0 -19
- package/dist/errors/ErrorMessages.js.map +0 -1
- package/dist/errors/WarningMessages.d.ts +0 -4
- package/dist/errors/WarningMessages.d.ts.map +0 -1
- package/dist/errors/WarningMessages.js +0 -7
- package/dist/errors/WarningMessages.js.map +0 -1
- package/dist/isNewArch.d.ts +0 -2
- package/dist/isNewArch.d.ts.map +0 -1
- package/dist/isNewArch.js +0 -25
- package/dist/isNewArch.js.map +0 -1
- package/dist/recyclerview/viewability/ViewToken.d.ts.map +0 -1
- package/dist/recyclerview/viewability/ViewToken.js.map +0 -1
- package/dist/recyclerview/viewability/ViewabilityHelper.d.ts.map +0 -1
- package/dist/recyclerview/viewability/ViewabilityManager.d.ts.map +0 -1
- package/dist/recyclerview/viewability/ViewabilityManager.js.map +0 -1
- package/src/FlashList.ts +0 -1
- package/src/errors/ErrorMessages.ts +0 -26
- package/src/errors/WarningMessages.ts +0 -4
- package/src/isNewArch.ts +0 -25
- /package/dist/{recyclerview/viewability → viewability}/ViewToken.d.ts +0 -0
- /package/dist/{recyclerview/viewability → viewability}/ViewToken.js +0 -0
- /package/src/{recyclerview/viewability → viewability}/ViewToken.ts +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
2
|
+
import { Dimension } from "recyclerlistview";
|
|
3
|
+
|
|
4
|
+
import { ContentStyle } from "../FlashListProps";
|
|
5
|
+
|
|
6
|
+
export interface ContentStyleExplicit {
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
paddingBottom: number;
|
|
9
|
+
paddingLeft: number;
|
|
10
|
+
paddingRight: number;
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const updateContentStyle = (
|
|
15
|
+
contentStyle: ContentStyle,
|
|
16
|
+
contentContainerStyleSource: ContentStyle | undefined
|
|
17
|
+
): ContentStyleExplicit => {
|
|
18
|
+
const {
|
|
19
|
+
paddingTop,
|
|
20
|
+
paddingRight,
|
|
21
|
+
paddingBottom,
|
|
22
|
+
paddingLeft,
|
|
23
|
+
padding,
|
|
24
|
+
paddingVertical,
|
|
25
|
+
paddingHorizontal,
|
|
26
|
+
backgroundColor,
|
|
27
|
+
} = (contentContainerStyleSource ?? {}) as ViewStyle;
|
|
28
|
+
contentStyle.paddingLeft = Number(
|
|
29
|
+
paddingLeft || paddingHorizontal || padding || 0
|
|
30
|
+
);
|
|
31
|
+
contentStyle.paddingRight = Number(
|
|
32
|
+
paddingRight || paddingHorizontal || padding || 0
|
|
33
|
+
);
|
|
34
|
+
contentStyle.paddingTop = Number(
|
|
35
|
+
paddingTop || paddingVertical || padding || 0
|
|
36
|
+
);
|
|
37
|
+
contentStyle.paddingBottom = Number(
|
|
38
|
+
paddingBottom || paddingVertical || padding || 0
|
|
39
|
+
);
|
|
40
|
+
contentStyle.backgroundColor = backgroundColor;
|
|
41
|
+
return contentStyle as ContentStyleExplicit;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const hasUnsupportedKeysInContentContainerStyle = (
|
|
45
|
+
contentContainerStyleSource: ViewStyle | undefined
|
|
46
|
+
) => {
|
|
47
|
+
const {
|
|
48
|
+
paddingTop,
|
|
49
|
+
paddingRight,
|
|
50
|
+
paddingBottom,
|
|
51
|
+
paddingLeft,
|
|
52
|
+
padding,
|
|
53
|
+
paddingVertical,
|
|
54
|
+
paddingHorizontal,
|
|
55
|
+
backgroundColor,
|
|
56
|
+
...rest
|
|
57
|
+
} = (contentContainerStyleSource ?? {}) as ViewStyle;
|
|
58
|
+
return Object.keys(rest).length > 0;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** Applies padding corrections to given dimension. Mutates the dim object that was passed and returns it. */
|
|
62
|
+
export const applyContentContainerInsetForLayoutManager = (
|
|
63
|
+
dim: Dimension,
|
|
64
|
+
contentContainerStyle: ViewStyle | undefined,
|
|
65
|
+
horizontal: boolean | undefined | null
|
|
66
|
+
) => {
|
|
67
|
+
const contentStyle = updateContentStyle({}, contentContainerStyle);
|
|
68
|
+
if (horizontal) {
|
|
69
|
+
dim.height -= contentStyle.paddingTop + contentStyle.paddingBottom;
|
|
70
|
+
} else {
|
|
71
|
+
dim.width -= contentStyle.paddingLeft + contentStyle.paddingRight;
|
|
72
|
+
}
|
|
73
|
+
return dim;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** Returns padding to be applied on content container and will ignore paddings that have already been handled. */
|
|
77
|
+
export const getContentContainerPadding = (
|
|
78
|
+
contentStyle: ContentStyleExplicit,
|
|
79
|
+
horizontal: boolean | undefined | null
|
|
80
|
+
) => {
|
|
81
|
+
if (horizontal) {
|
|
82
|
+
return {
|
|
83
|
+
paddingTop: contentStyle.paddingTop,
|
|
84
|
+
paddingBottom: contentStyle.paddingBottom,
|
|
85
|
+
};
|
|
86
|
+
} else {
|
|
87
|
+
return {
|
|
88
|
+
paddingLeft: contentStyle.paddingLeft,
|
|
89
|
+
paddingRight: contentStyle.paddingRight,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ViewabilityConfig } from "react-native";
|
|
2
|
+
import { Dimension, Layout } from "recyclerlistview";
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
4
|
+
import CustomError from "../errors/CustomError";
|
|
5
|
+
import ExceptionList from "../errors/ExceptionList";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Helper class for computing viewable items based on the passed `viewabilityConfig`.
|
|
@@ -47,8 +48,8 @@ class ViewabilityHelper {
|
|
|
47
48
|
public updateViewableItems(
|
|
48
49
|
horizontal: boolean,
|
|
49
50
|
scrollOffset: number,
|
|
50
|
-
listSize:
|
|
51
|
-
getLayout: (index: number) =>
|
|
51
|
+
listSize: Dimension,
|
|
52
|
+
getLayout: (index: number) => Layout | undefined,
|
|
52
53
|
viewableIndices?: number[]
|
|
53
54
|
) {
|
|
54
55
|
if (viewableIndices !== undefined) {
|
|
@@ -60,8 +61,8 @@ class ViewabilityHelper {
|
|
|
60
61
|
this.viewabilityConfig?.viewAreaCoveragePercentThreshold !== null &&
|
|
61
62
|
this.viewabilityConfig?.viewAreaCoveragePercentThreshold !== undefined
|
|
62
63
|
) {
|
|
63
|
-
throw new
|
|
64
|
-
|
|
64
|
+
throw new CustomError(
|
|
65
|
+
ExceptionList.multipleViewabilityThresholdTypesNotSupported
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
if (
|
|
@@ -125,10 +126,10 @@ class ViewabilityHelper {
|
|
|
125
126
|
index: number,
|
|
126
127
|
horizontal: boolean,
|
|
127
128
|
scrollOffset: number,
|
|
128
|
-
listSize:
|
|
129
|
+
listSize: Dimension,
|
|
129
130
|
viewAreaCoveragePercentThreshold: number | null | undefined,
|
|
130
131
|
itemVisiblePercentThreshold: number | null | undefined,
|
|
131
|
-
getLayout: (index: number) =>
|
|
132
|
+
getLayout: (index: number) => Layout | undefined
|
|
132
133
|
) {
|
|
133
134
|
const itemLayout = getLayout(index);
|
|
134
135
|
if (itemLayout === undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ViewabilityConfig } from "react-native";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import FlashList from "../FlashList";
|
|
4
4
|
|
|
5
5
|
import ViewabilityHelper from "./ViewabilityHelper";
|
|
6
6
|
import ViewToken from "./ViewToken";
|
|
@@ -9,31 +9,31 @@ import ViewToken from "./ViewToken";
|
|
|
9
9
|
* Manager for viewability tracking. It holds multiple viewability callback pairs and keeps them updated.
|
|
10
10
|
*/
|
|
11
11
|
export default class ViewabilityManager<T> {
|
|
12
|
-
private
|
|
12
|
+
private flashListRef: FlashList<T>;
|
|
13
13
|
private viewabilityHelpers: ViewabilityHelper[] = [];
|
|
14
14
|
private hasInteracted = false;
|
|
15
15
|
|
|
16
|
-
constructor(
|
|
17
|
-
this.
|
|
16
|
+
constructor(flashListRef: FlashList<T>) {
|
|
17
|
+
this.flashListRef = flashListRef;
|
|
18
18
|
if (
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
flashListRef.props.onViewableItemsChanged !== null &&
|
|
20
|
+
flashListRef.props.onViewableItemsChanged !== undefined
|
|
21
21
|
) {
|
|
22
22
|
this.viewabilityHelpers.push(
|
|
23
23
|
this.createViewabilityHelper(
|
|
24
|
-
|
|
24
|
+
flashListRef.props.viewabilityConfig,
|
|
25
25
|
(info) => {
|
|
26
|
-
|
|
26
|
+
flashListRef.props.onViewableItemsChanged?.(info);
|
|
27
27
|
}
|
|
28
28
|
)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
(
|
|
31
|
+
(flashListRef.props.viewabilityConfigCallbackPairs ?? []).forEach(
|
|
32
32
|
(pair, index) => {
|
|
33
33
|
this.viewabilityHelpers.push(
|
|
34
34
|
this.createViewabilityHelper(pair.viewabilityConfig, (info) => {
|
|
35
35
|
const callback =
|
|
36
|
-
|
|
36
|
+
flashListRef.props.viewabilityConfigCallbackPairs?.[index]
|
|
37
37
|
?.onViewableItemsChanged;
|
|
38
38
|
callback?.(info);
|
|
39
39
|
})
|
|
@@ -71,19 +71,21 @@ export default class ViewabilityManager<T> {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
public updateViewableItems = (newViewableIndices?: number[]) => {
|
|
74
|
-
const listSize =
|
|
74
|
+
const listSize =
|
|
75
|
+
this.flashListRef.getWindowSize() ??
|
|
76
|
+
this.flashListRef.props.estimatedListSize;
|
|
75
77
|
if (listSize === undefined || !this.shouldListenToVisibleIndices) {
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
80
|
const scrollOffset =
|
|
79
|
-
(this.
|
|
80
|
-
this.
|
|
81
|
+
(this.flashListRef.getAbsoluteLastScrollOffset() ?? 0) -
|
|
82
|
+
this.flashListRef.firstItemOffset;
|
|
81
83
|
this.viewabilityHelpers.forEach((viewabilityHelper) => {
|
|
82
84
|
viewabilityHelper.updateViewableItems(
|
|
83
|
-
this.
|
|
85
|
+
this.flashListRef.props.horizontal ?? false,
|
|
84
86
|
scrollOffset,
|
|
85
87
|
listSize,
|
|
86
|
-
(index: number) => this.
|
|
88
|
+
(index: number) => this.flashListRef.getLayout(index),
|
|
87
89
|
newViewableIndices
|
|
88
90
|
);
|
|
89
91
|
});
|
|
@@ -115,11 +117,11 @@ export default class ViewabilityManager<T> {
|
|
|
115
117
|
index: number,
|
|
116
118
|
isViewable: boolean
|
|
117
119
|
) => {
|
|
118
|
-
const item = this.
|
|
120
|
+
const item = this.flashListRef.props.data![index];
|
|
119
121
|
const key =
|
|
120
|
-
item === undefined || this.
|
|
122
|
+
item === undefined || this.flashListRef.props.keyExtractor === undefined
|
|
121
123
|
? index.toString()
|
|
122
|
-
: this.
|
|
124
|
+
: this.flashListRef.props.keyExtractor(item, index);
|
|
123
125
|
return {
|
|
124
126
|
index,
|
|
125
127
|
isViewable,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const ErrorMessages: {
|
|
2
|
-
multipleViewabilityThresholdTypesNotSupported: string;
|
|
3
|
-
flashListV2OnlySupportsNewArchitecture: string;
|
|
4
|
-
layoutManagerNotInitializedLayoutInfo: string;
|
|
5
|
-
layoutManagerNotInitializedChildContainer: string;
|
|
6
|
-
layoutManagerNotInitializedWindowSize: string;
|
|
7
|
-
horizontalPropCannotBeToggled: string;
|
|
8
|
-
layoutManagerNotInitializedVisibleIndices: string;
|
|
9
|
-
masonryAndHorizontalIncompatible: string;
|
|
10
|
-
numColumnsAndHorizontalIncompatible: string;
|
|
11
|
-
indexOutOfBounds: string;
|
|
12
|
-
fpsMonitorAlreadyRunning: string;
|
|
13
|
-
dataEmptyCannotRunBenchmark: string;
|
|
14
|
-
stickyHeadersNotSupportedForHorizontal: string;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=ErrorMessages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessages.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorMessages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;CAyBzB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMessages = void 0;
|
|
4
|
-
exports.ErrorMessages = {
|
|
5
|
-
multipleViewabilityThresholdTypesNotSupported: "You can set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold. Specifying both is not supported.",
|
|
6
|
-
flashListV2OnlySupportsNewArchitecture: "FlashList v2 is only supported on new architecture",
|
|
7
|
-
layoutManagerNotInitializedLayoutInfo: "LayoutManager is not initialized, layout info is unavailable",
|
|
8
|
-
layoutManagerNotInitializedChildContainer: "LayoutManager is not initialized, child container layout is unavailable",
|
|
9
|
-
layoutManagerNotInitializedWindowSize: "LayoutManager is not initialized, window size is unavailable",
|
|
10
|
-
horizontalPropCannotBeToggled: "Horizontal prop cannot be toggled, you can use a key on FlashList to recreate it.",
|
|
11
|
-
layoutManagerNotInitializedVisibleIndices: "LayoutManager is not initialized, visible indices are not unavailable",
|
|
12
|
-
masonryAndHorizontalIncompatible: "Masonry and horizontal props are incompatible",
|
|
13
|
-
numColumnsAndHorizontalIncompatible: "numColumns and horizontal props are incompatible",
|
|
14
|
-
indexOutOfBounds: "index out of bounds, not enough layouts",
|
|
15
|
-
fpsMonitorAlreadyRunning: "This FPS Monitor has already been run, please create a new instance",
|
|
16
|
-
dataEmptyCannotRunBenchmark: "Data is empty, cannot run benchmark",
|
|
17
|
-
stickyHeadersNotSupportedForHorizontal: "Sticky headers are not supported when list is horizontal",
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=ErrorMessages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessages.js","sourceRoot":"","sources":["../../src/errors/ErrorMessages.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,6CAA6C,EAC3C,+HAA+H;IACjI,sCAAsC,EACpC,oDAAoD;IACtD,qCAAqC,EACnC,8DAA8D;IAChE,yCAAyC,EACvC,yEAAyE;IAC3E,qCAAqC,EACnC,8DAA8D;IAChE,6BAA6B,EAC3B,mFAAmF;IACrF,yCAAyC,EACvC,uEAAuE;IACzE,gCAAgC,EAC9B,+CAA+C;IACjD,mCAAmC,EACjC,kDAAkD;IACpD,gBAAgB,EAAE,yCAAyC;IAC3D,wBAAwB,EACtB,qEAAqE;IACvE,2BAA2B,EAAE,qCAAqC;IAClE,sCAAsC,EACpC,0DAA0D;CAC7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WarningMessages.d.ts","sourceRoot":"","sources":["../../src/errors/WarningMessages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;CAG3B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WarningMessages = void 0;
|
|
4
|
-
exports.WarningMessages = {
|
|
5
|
-
keyExtractorNotDefinedForAnimation: "keyExtractor is not defined. This might cause the animations to not work as expected.",
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=WarningMessages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WarningMessages.js","sourceRoot":"","sources":["../../src/errors/WarningMessages.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,kCAAkC,EAChC,uFAAuF;CAC1F,CAAC"}
|
package/dist/isNewArch.d.ts
DELETED
package/dist/isNewArch.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNewArch.d.ts","sourceRoot":"","sources":["../src/isNewArch.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,IAAI,OAAO,CAoBnC"}
|
package/dist/isNewArch.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNewArch = isNewArch;
|
|
4
|
-
var react_native_1 = require("react-native");
|
|
5
|
-
var _isNewArch;
|
|
6
|
-
function isNewArch() {
|
|
7
|
-
if (_isNewArch !== undefined) {
|
|
8
|
-
return _isNewArch;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
try {
|
|
12
|
-
// Check for Fabric UI Manager
|
|
13
|
-
var hasFabricUIManager = Boolean(global === null || global === void 0 ? void 0 : global.nativeFabricUIManager);
|
|
14
|
-
// Check for TurboModule system
|
|
15
|
-
var hasTurboModule = Boolean(global === null || global === void 0 ? void 0 : global.__turboModuleProxy);
|
|
16
|
-
_isNewArch =
|
|
17
|
-
hasFabricUIManager || hasTurboModule || react_native_1.Platform.OS === "web";
|
|
18
|
-
}
|
|
19
|
-
catch (_a) {
|
|
20
|
-
_isNewArch = true;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return _isNewArch;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=isNewArch.js.map
|
package/dist/isNewArch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNewArch.js","sourceRoot":"","sources":["../src/isNewArch.ts"],"names":[],"mappings":";;AAIA,8BAoBC;AAxBD,6CAAwC;AAExC,IAAI,UAA+B,CAAC;AAEpC,SAAgB,SAAS;IACvB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,8BAA8B;YAC9B,IAAM,kBAAkB,GAAG,OAAO,CAC/B,MAAc,aAAd,MAAM,uBAAN,MAAM,CAAU,qBAAqB,CACvC,CAAC;YAEF,+BAA+B;YAC/B,IAAM,cAAc,GAAG,OAAO,CAAE,MAAc,aAAd,MAAM,uBAAN,MAAM,CAAU,kBAAkB,CAAC,CAAC;YAEpE,UAAU;gBACR,kBAAkB,IAAI,cAAc,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC;QAClE,CAAC;QAAC,WAAM,CAAC;YACP,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewToken.d.ts","sourceRoot":"","sources":["../../../src/recyclerview/viewability/ViewToken.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewToken.js","sourceRoot":"","sources":["../../../src/recyclerview/viewability/ViewToken.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewabilityHelper.d.ts","sourceRoot":"","sources":["../../../src/recyclerview/viewability/ViewabilityHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;GAGG;AACH,cAAM,iBAAiB;IACrB;;OAEG;IACH,uBAAuB,EAAE,MAAM,EAAE,CAAM;IAEvC,aAAa,UAAS;IAEtB,OAAO,CAAC,eA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BAAsB,aAM3B;IAEF;;;OAGG;IACH,OAAO,CAAC,uBAAuB,CAyC7B;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewabilityManager.js","sourceRoot":"","sources":["../../../src/recyclerview/viewability/ViewabilityManager.ts"],"names":[],"mappings":";;;AAIA,kFAAoD;AAGpD;;GAEG;AACH;IAKE,4BAAY,SAAiC;QAA7C,iBA2BC;;QA9BO,uBAAkB,GAAwB,EAAE,CAAC;QAC7C,kBAAa,GAAG,KAAK,CAAC;QAsCvB,YAAO,GAAG;YACf,KAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAC,iBAAiB;gBAChD,OAAA,iBAAiB,CAAC,OAAO,EAAE;YAA3B,CAA2B,CAC5B,CAAC;QACJ,CAAC,CAAC;QAEK,4BAAuB,GAAG,UAAC,GAAa;YAC7C,KAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC;QAEK,sBAAiB,GAAG;YACzB,IAAI,KAAI,CAAC,aAAa,EAAE,CAAC;gBACvB,OAAO;YACT,CAAC;YACD,KAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAC1B,KAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAC,iBAAiB;gBAChD,iBAAiB,CAAC,aAAa,GAAG,IAAI,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,KAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC,CAAC;QAEK,wBAAmB,GAAG,UAAC,kBAA6B;;YACzD,IAAM,QAAQ,GAAG,KAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,KAAI,CAAC,4BAA4B,EAAE,CAAC;gBACjE,OAAO;YACT,CAAC;YACD,IAAM,YAAY,GAChB,CAAC,MAAA,KAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE,mCAAI,CAAC,CAAC;gBACnD,KAAI,CAAC,SA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AC,0CACnD,sBAAsB,CAAC;gBAC7B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,IAAI,CAAC,CAAC;YACnB,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAKD,sBAAW,4DAA4B;QAHvC;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5C,CAAC;;;OAAA;IAgGH,yBAAC;AAAD,CAAC,AAvID,IAuIC"}
|
package/src/FlashList.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RecyclerView as FlashList } from "./recyclerview/RecyclerView";
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const ErrorMessages = {
|
|
2
|
-
multipleViewabilityThresholdTypesNotSupported:
|
|
3
|
-
"You can set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold. Specifying both is not supported.",
|
|
4
|
-
flashListV2OnlySupportsNewArchitecture:
|
|
5
|
-
"FlashList v2 is only supported on new architecture",
|
|
6
|
-
layoutManagerNotInitializedLayoutInfo:
|
|
7
|
-
"LayoutManager is not initialized, layout info is unavailable",
|
|
8
|
-
layoutManagerNotInitializedChildContainer:
|
|
9
|
-
"LayoutManager is not initialized, child container layout is unavailable",
|
|
10
|
-
layoutManagerNotInitializedWindowSize:
|
|
11
|
-
"LayoutManager is not initialized, window size is unavailable",
|
|
12
|
-
horizontalPropCannotBeToggled:
|
|
13
|
-
"Horizontal prop cannot be toggled, you can use a key on FlashList to recreate it.",
|
|
14
|
-
layoutManagerNotInitializedVisibleIndices:
|
|
15
|
-
"LayoutManager is not initialized, visible indices are not unavailable",
|
|
16
|
-
masonryAndHorizontalIncompatible:
|
|
17
|
-
"Masonry and horizontal props are incompatible",
|
|
18
|
-
numColumnsAndHorizontalIncompatible:
|
|
19
|
-
"numColumns and horizontal props are incompatible",
|
|
20
|
-
indexOutOfBounds: "index out of bounds, not enough layouts",
|
|
21
|
-
fpsMonitorAlreadyRunning:
|
|
22
|
-
"This FPS Monitor has already been run, please create a new instance",
|
|
23
|
-
dataEmptyCannotRunBenchmark: "Data is empty, cannot run benchmark",
|
|
24
|
-
stickyHeadersNotSupportedForHorizontal:
|
|
25
|
-
"Sticky headers are not supported when list is horizontal",
|
|
26
|
-
};
|
package/src/isNewArch.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Platform } from "react-native";
|
|
2
|
-
|
|
3
|
-
let _isNewArch: boolean | undefined;
|
|
4
|
-
|
|
5
|
-
export function isNewArch(): boolean {
|
|
6
|
-
if (_isNewArch !== undefined) {
|
|
7
|
-
return _isNewArch;
|
|
8
|
-
} else {
|
|
9
|
-
try {
|
|
10
|
-
// Check for Fabric UI Manager
|
|
11
|
-
const hasFabricUIManager = Boolean(
|
|
12
|
-
(global as any)?.nativeFabricUIManager
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
// Check for TurboModule system
|
|
16
|
-
const hasTurboModule = Boolean((global as any)?.__turboModuleProxy);
|
|
17
|
-
|
|
18
|
-
_isNewArch =
|
|
19
|
-
hasFabricUIManager || hasTurboModule || Platform.OS === "web";
|
|
20
|
-
} catch {
|
|
21
|
-
_isNewArch = true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return _isNewArch;
|
|
25
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|