@shopify/flash-list 2.0.0-alpha.21 → 2.0.0-alpha.22
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/dist/AnimatedFlashList.js +2 -2
- package/dist/AnimatedFlashList.js.map +1 -1
- package/dist/FlashList.d.ts +1 -167
- package/dist/FlashList.d.ts.map +1 -1
- package/dist/FlashList.js +3 -595
- package/dist/FlashList.js.map +1 -1
- package/dist/FlashListProps.d.ts +2 -63
- package/dist/FlashListProps.d.ts.map +1 -1
- package/dist/FlashListProps.js.map +1 -1
- package/dist/__tests__/ViewabilityHelper.test.js +3 -4
- package/dist/__tests__/ViewabilityHelper.test.js.map +1 -1
- package/dist/benchmark/JSFPSMonitor.d.ts.map +1 -1
- package/dist/benchmark/JSFPSMonitor.js +2 -1
- package/dist/benchmark/JSFPSMonitor.js.map +1 -1
- package/dist/benchmark/useBenchmark.d.ts +2 -4
- package/dist/benchmark/useBenchmark.d.ts.map +1 -1
- package/dist/benchmark/useBenchmark.js +12 -24
- package/dist/benchmark/useBenchmark.js.map +1 -1
- package/dist/benchmark/useFlatListBenchmark.d.ts.map +1 -1
- package/dist/benchmark/useFlatListBenchmark.js +2 -1
- package/dist/benchmark/useFlatListBenchmark.js.map +1 -1
- package/dist/errors/ErrorMessages.d.ts +16 -0
- package/dist/errors/ErrorMessages.d.ts.map +1 -0
- package/dist/errors/ErrorMessages.js +19 -0
- package/dist/errors/ErrorMessages.js.map +1 -0
- package/dist/errors/WarningMessages.d.ts +4 -0
- package/dist/errors/WarningMessages.d.ts.map +1 -0
- package/dist/errors/WarningMessages.js +7 -0
- package/dist/errors/WarningMessages.js.map +1 -0
- package/dist/index.d.ts +3 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -29
- package/dist/index.js.map +1 -1
- package/dist/isNewArch.d.ts +2 -0
- package/dist/isNewArch.d.ts.map +1 -0
- package/dist/isNewArch.js +25 -0
- package/dist/isNewArch.js.map +1 -0
- package/dist/native/config/PlatformHelper.android.d.ts +1 -22
- package/dist/native/config/PlatformHelper.android.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.android.js +1 -16
- package/dist/native/config/PlatformHelper.android.js.map +1 -1
- package/dist/native/config/PlatformHelper.d.ts +1 -22
- package/dist/native/config/PlatformHelper.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.ios.d.ts +1 -22
- package/dist/native/config/PlatformHelper.ios.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.ios.js +1 -15
- package/dist/native/config/PlatformHelper.ios.js.map +1 -1
- package/dist/native/config/PlatformHelper.js +1 -16
- package/dist/native/config/PlatformHelper.js.map +1 -1
- package/dist/native/config/PlatformHelper.web.d.ts +1 -23
- package/dist/native/config/PlatformHelper.web.d.ts.map +1 -1
- package/dist/native/config/PlatformHelper.web.js +1 -18
- package/dist/native/config/PlatformHelper.web.js.map +1 -1
- package/dist/recyclerview/RecyclerView.d.ts.map +1 -1
- package/dist/recyclerview/RecyclerView.js +5 -0
- package/dist/recyclerview/RecyclerView.js.map +1 -1
- package/dist/recyclerview/RecyclerViewManager.d.ts.map +1 -1
- package/dist/recyclerview/RecyclerViewManager.js +9 -8
- package/dist/recyclerview/RecyclerViewManager.js.map +1 -1
- package/dist/recyclerview/RecyclerViewProps.d.ts +1 -8
- package/dist/recyclerview/RecyclerViewProps.d.ts.map +1 -1
- package/dist/recyclerview/hooks/useRecyclerViewController.d.ts.map +1 -1
- package/dist/recyclerview/hooks/useRecyclerViewController.js +4 -0
- 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 +2 -1
- package/dist/recyclerview/layout-managers/LayoutManager.js.map +1 -1
- package/dist/recyclerview/viewability/ViewToken.d.ts.map +1 -0
- package/dist/recyclerview/viewability/ViewToken.js.map +1 -0
- package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.d.ts +2 -2
- package/dist/recyclerview/viewability/ViewabilityHelper.d.ts.map +1 -0
- package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.js +2 -4
- package/dist/{viewability → recyclerview/viewability}/ViewabilityHelper.js.map +1 -1
- package/dist/{viewability → recyclerview/viewability}/ViewabilityManager.d.ts +3 -3
- package/dist/recyclerview/viewability/ViewabilityManager.d.ts.map +1 -0
- package/dist/{viewability → recyclerview/viewability}/ViewabilityManager.js +16 -16
- package/dist/recyclerview/viewability/ViewabilityManager.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -14
- package/src/AnimatedFlashList.ts +2 -2
- package/src/FlashList.ts +1 -0
- package/src/FlashListProps.ts +3 -79
- package/src/__tests__/ViewabilityHelper.test.ts +13 -14
- package/src/benchmark/JSFPSMonitor.ts +3 -3
- package/src/benchmark/useBenchmark.ts +12 -40
- package/src/benchmark/useFlatListBenchmark.ts +3 -1
- package/src/errors/ErrorMessages.ts +26 -0
- package/src/errors/WarningMessages.ts +4 -0
- package/src/index.ts +7 -43
- package/src/isNewArch.ts +25 -0
- package/src/native/config/PlatformHelper.android.ts +1 -25
- package/src/native/config/PlatformHelper.ios.ts +1 -24
- package/src/native/config/PlatformHelper.ts +1 -25
- package/src/native/config/PlatformHelper.web.ts +1 -30
- package/src/recyclerview/RecyclerView.tsx +5 -0
- package/src/recyclerview/RecyclerViewManager.ts +9 -18
- package/src/recyclerview/RecyclerViewProps.ts +1 -11
- package/src/recyclerview/hooks/useRecyclerViewController.tsx +4 -0
- package/src/recyclerview/layout-managers/LayoutManager.ts +2 -1
- package/src/{viewability → recyclerview/viewability}/ViewabilityHelper.ts +8 -9
- package/src/{viewability → recyclerview/viewability}/ViewabilityManager.ts +18 -20
- package/RNFlashList.podspec +0 -37
- package/android/build.gradle +0 -89
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutShadow.kt +0 -105
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt +0 -158
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutViewManager.kt +0 -70
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/BlankAreaEvent.kt +0 -29
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainer.java +0 -16
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerImpl.kt +0 -16
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/CellContainerManager.kt +0 -34
- package/android/src/main/kotlin/com/shopify/reactnative/flash_list/FlashListPackage.kt +0 -19
- package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerDelegate.java +0 -47
- package/android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerInterface.java +0 -21
- package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerDelegate.java +0 -32
- package/android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerInterface.java +0 -16
- package/android/src/test/java/com/shopify/reactnative/flash_list/AutoLayoutShadowTest.kt +0 -147
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/Rect.kt +0 -61
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestCollection.kt +0 -6
- package/android/src/test/java/com/shopify/reactnative/flash_list/models/TestDataModel.kt +0 -8
- package/android/src/test/resources/LayoutTestData.json +0 -788
- package/dist/GridLayoutProviderWithProps.d.ts +0 -42
- package/dist/GridLayoutProviderWithProps.d.ts.map +0 -1
- package/dist/GridLayoutProviderWithProps.js +0 -114
- package/dist/GridLayoutProviderWithProps.js.map +0 -1
- package/dist/MasonryFlashList.d.ts +0 -51
- package/dist/MasonryFlashList.d.ts.map +0 -1
- package/dist/MasonryFlashList.js +0 -252
- package/dist/MasonryFlashList.js.map +0 -1
- package/dist/PureComponentWrapper.d.ts +0 -22
- package/dist/PureComponentWrapper.d.ts.map +0 -1
- package/dist/PureComponentWrapper.js +0 -37
- package/dist/PureComponentWrapper.js.map +0 -1
- package/dist/__tests__/ContentContainerUtils.test.d.ts +0 -2
- package/dist/__tests__/ContentContainerUtils.test.d.ts.map +0 -1
- package/dist/__tests__/ContentContainerUtils.test.js +0 -85
- package/dist/__tests__/ContentContainerUtils.test.js.map +0 -1
- package/dist/__tests__/FlashList.test.d.ts +0 -2
- package/dist/__tests__/FlashList.test.d.ts.map +0 -1
- package/dist/__tests__/FlashList.test.js +0 -902
- package/dist/__tests__/FlashList.test.js.map +0 -1
- package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts +0 -2
- package/dist/__tests__/GridLayoutProviderWithProps.test.d.ts.map +0 -1
- package/dist/__tests__/GridLayoutProviderWithProps.test.js +0 -143
- package/dist/__tests__/GridLayoutProviderWithProps.test.js.map +0 -1
- package/dist/__tests__/MasonryFlashList.test.d.ts +0 -2
- package/dist/__tests__/MasonryFlashList.test.d.ts.map +0 -1
- package/dist/__tests__/MasonryFlashList.test.js +0 -254
- package/dist/__tests__/MasonryFlashList.test.js.map +0 -1
- package/dist/__tests__/PlatformHelper.web.test.d.ts +0 -2
- package/dist/__tests__/PlatformHelper.web.test.d.ts.map +0 -1
- package/dist/__tests__/PlatformHelper.web.test.js +0 -33
- package/dist/__tests__/PlatformHelper.web.test.js.map +0 -1
- package/dist/__tests__/helpers/mountFlashList.d.ts +0 -19
- package/dist/__tests__/helpers/mountFlashList.d.ts.map +0 -1
- package/dist/__tests__/helpers/mountFlashList.js +0 -44
- package/dist/__tests__/helpers/mountFlashList.js.map +0 -1
- package/dist/__tests__/helpers/mountMasonryFlashList.d.ts +0 -18
- package/dist/__tests__/helpers/mountMasonryFlashList.d.ts.map +0 -1
- package/dist/__tests__/helpers/mountMasonryFlashList.js +0 -49
- package/dist/__tests__/helpers/mountMasonryFlashList.js.map +0 -1
- package/dist/__tests__/useBlankAreaTracker.test.d.ts +0 -2
- package/dist/__tests__/useBlankAreaTracker.test.d.ts.map +0 -1
- package/dist/__tests__/useBlankAreaTracker.test.js +0 -179
- package/dist/__tests__/useBlankAreaTracker.test.js.map +0 -1
- package/dist/benchmark/useBlankAreaTracker.d.ts +0 -34
- package/dist/benchmark/useBlankAreaTracker.d.ts.map +0 -1
- package/dist/benchmark/useBlankAreaTracker.js +0 -66
- package/dist/benchmark/useBlankAreaTracker.js.map +0 -1
- package/dist/enableNewCore.d.ts +0 -3
- package/dist/enableNewCore.d.ts.map +0 -1
- package/dist/enableNewCore.js +0 -25
- package/dist/enableNewCore.js.map +0 -1
- package/dist/errors/CustomError.d.ts +0 -8
- package/dist/errors/CustomError.d.ts.map +0 -1
- package/dist/errors/CustomError.js +0 -14
- package/dist/errors/CustomError.js.map +0 -1
- package/dist/errors/ExceptionList.d.ts +0 -24
- package/dist/errors/ExceptionList.d.ts.map +0 -1
- package/dist/errors/ExceptionList.js +0 -26
- package/dist/errors/ExceptionList.js.map +0 -1
- package/dist/errors/Warnings.d.ts +0 -9
- package/dist/errors/Warnings.d.ts.map +0 -1
- package/dist/errors/Warnings.js +0 -13
- package/dist/errors/Warnings.js.map +0 -1
- package/dist/native/auto-layout/AutoLayoutView.d.ts +0 -22
- package/dist/native/auto-layout/AutoLayoutView.d.ts.map +0 -1
- package/dist/native/auto-layout/AutoLayoutView.js +0 -48
- package/dist/native/auto-layout/AutoLayoutView.js.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts +0 -4
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.d.ts.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js +0 -6
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.android.js.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts +0 -5
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.d.ts.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts +0 -4
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.d.ts.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js +0 -6
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.ios.js.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js +0 -6
- package/dist/native/auto-layout/AutoLayoutViewNativeComponent.js.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts +0 -16
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.d.ts.map +0 -1
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js +0 -3
- package/dist/native/auto-layout/AutoLayoutViewNativeComponentProps.js.map +0 -1
- package/dist/native/cell-container/CellContainer.android.d.ts +0 -6
- package/dist/native/cell-container/CellContainer.android.d.ts.map +0 -1
- package/dist/native/cell-container/CellContainer.android.js +0 -9
- package/dist/native/cell-container/CellContainer.android.js.map +0 -1
- package/dist/native/cell-container/CellContainer.d.ts +0 -8
- package/dist/native/cell-container/CellContainer.d.ts.map +0 -1
- package/dist/native/cell-container/CellContainer.ios.d.ts +0 -6
- package/dist/native/cell-container/CellContainer.ios.d.ts.map +0 -1
- package/dist/native/cell-container/CellContainer.ios.js +0 -9
- package/dist/native/cell-container/CellContainer.ios.js.map +0 -1
- package/dist/native/cell-container/CellContainer.js +0 -11
- package/dist/native/cell-container/CellContainer.js.map +0 -1
- package/dist/native/cell-container/CellContainer.web.d.ts +0 -7
- package/dist/native/cell-container/CellContainer.web.d.ts.map +0 -1
- package/dist/native/cell-container/CellContainer.web.js +0 -13
- package/dist/native/cell-container/CellContainer.web.js.map +0 -1
- package/dist/specs/AutoLayoutNativeComponent.d.ts +0 -18
- package/dist/specs/AutoLayoutNativeComponent.d.ts.map +0 -1
- package/dist/specs/AutoLayoutNativeComponent.js +0 -6
- package/dist/specs/AutoLayoutNativeComponent.js.map +0 -1
- package/dist/specs/CellContainerNativeComponent.d.ts +0 -8
- package/dist/specs/CellContainerNativeComponent.d.ts.map +0 -1
- package/dist/specs/CellContainerNativeComponent.js +0 -6
- package/dist/specs/CellContainerNativeComponent.js.map +0 -1
- package/dist/utils/ContentContainerUtils.d.ts +0 -27
- package/dist/utils/ContentContainerUtils.d.ts.map +0 -1
- package/dist/utils/ContentContainerUtils.js +0 -48
- package/dist/utils/ContentContainerUtils.js.map +0 -1
- package/dist/viewability/ViewToken.d.ts.map +0 -1
- package/dist/viewability/ViewToken.js.map +0 -1
- package/dist/viewability/ViewabilityHelper.d.ts.map +0 -1
- package/dist/viewability/ViewabilityManager.d.ts.map +0 -1
- package/dist/viewability/ViewabilityManager.js.map +0 -1
- package/ios/RNFlashList.xcodeproj/project.pbxproj +0 -3
- package/ios/RNFlashList.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/Sources/AutoLayoutView.swift +0 -294
- package/ios/Sources/AutoLayoutViewComponentView.h +0 -16
- package/ios/Sources/AutoLayoutViewComponentView.mm +0 -90
- package/ios/Sources/AutoLayoutViewManager.mm +0 -14
- package/ios/Sources/AutoLayoutViewManager.swift +0 -12
- package/ios/Sources/CellContainerComponentView.h +0 -18
- package/ios/Sources/CellContainerComponentView.mm +0 -62
- package/ios/Sources/CellContainerManager.mm +0 -8
- package/ios/Sources/CellContainerManager.swift +0 -12
- package/ios/Sources/FlatListPro-Bridging-Header.h +0 -11
- package/ios/Tests/AutoLayoutViewTests.swift +0 -113
- package/src/FlashList.tsx +0 -953
- package/src/GridLayoutProviderWithProps.ts +0 -180
- package/src/MasonryFlashList.tsx +0 -476
- package/src/PureComponentWrapper.tsx +0 -42
- package/src/__tests__/ContentContainerUtils.test.ts +0 -130
- package/src/__tests__/FlashList.test.tsx +0 -1001
- package/src/__tests__/GridLayoutProviderWithProps.test.ts +0 -179
- package/src/__tests__/MasonryFlashList.test.ts +0 -292
- package/src/__tests__/PlatformHelper.web.test.ts +0 -45
- package/src/__tests__/helpers/mountFlashList.tsx +0 -62
- package/src/__tests__/helpers/mountMasonryFlashList.tsx +0 -70
- package/src/__tests__/useBlankAreaTracker.test.tsx +0 -206
- package/src/benchmark/useBlankAreaTracker.ts +0 -117
- package/src/enableNewCore.ts +0 -24
- package/src/errors/CustomError.ts +0 -10
- package/src/errors/ExceptionList.ts +0 -28
- package/src/errors/Warnings.ts +0 -15
- package/src/native/auto-layout/AutoLayoutView.tsx +0 -73
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.android.ts +0 -7
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.ios.ts +0 -7
- package/src/native/auto-layout/AutoLayoutViewNativeComponent.ts +0 -7
- package/src/native/auto-layout/AutoLayoutViewNativeComponentProps.ts +0 -17
- package/src/native/cell-container/CellContainer.android.ts +0 -7
- package/src/native/cell-container/CellContainer.ios.ts +0 -7
- package/src/native/cell-container/CellContainer.tsx +0 -14
- package/src/native/cell-container/CellContainer.web.tsx +0 -9
- package/src/specs/AutoLayoutNativeComponent.ts +0 -24
- package/src/specs/CellContainerNativeComponent.ts +0 -9
- package/src/utils/ContentContainerUtils.ts +0 -92
- /package/dist/{viewability → recyclerview/viewability}/ViewToken.d.ts +0 -0
- /package/dist/{viewability → recyclerview/viewability}/ViewToken.js +0 -0
- /package/src/{viewability → recyclerview/viewability}/ViewToken.ts +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import { render } from "@quilted/react-testing";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
BlankAreaTrackerConfig,
|
|
6
|
-
BlankAreaTrackerResult,
|
|
7
|
-
useBlankAreaTracker,
|
|
8
|
-
} from "../benchmark/useBlankAreaTracker";
|
|
9
|
-
import FlashList from "../FlashList";
|
|
10
|
-
|
|
11
|
-
import { MockFlashListProps, renderFlashList } from "./helpers/mountFlashList";
|
|
12
|
-
|
|
13
|
-
type BlankTrackingFlashListProps = MockFlashListProps & {
|
|
14
|
-
onCumulativeBlankAreaResult?: (result: BlankAreaTrackerResult) => void;
|
|
15
|
-
onCumulativeBlankAreaChange?: (updatedResult: BlankAreaTrackerResult) => void;
|
|
16
|
-
blankAreaTrackerConfig?: BlankAreaTrackerConfig;
|
|
17
|
-
instance?: React.RefObject<FlashList<any>>;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const BlankTrackingFlashList = (props?: BlankTrackingFlashListProps) => {
|
|
21
|
-
const ref = props?.instance!;
|
|
22
|
-
const [blankAreaTrackerResult, onBlankArea] = useBlankAreaTracker(
|
|
23
|
-
ref,
|
|
24
|
-
props?.onCumulativeBlankAreaChange,
|
|
25
|
-
{
|
|
26
|
-
startDelayInMs: props?.blankAreaTrackerConfig?.startDelayInMs ?? 500,
|
|
27
|
-
sumNegativeValues:
|
|
28
|
-
props?.blankAreaTrackerConfig?.sumNegativeValues ?? false,
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
props?.onCumulativeBlankAreaResult?.(blankAreaTrackerResult);
|
|
34
|
-
};
|
|
35
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
-
}, []);
|
|
37
|
-
return renderFlashList(
|
|
38
|
-
{ ...props, onBlankArea, estimatedItemSize: 400 },
|
|
39
|
-
ref
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const mountBlankTrackingFlashList = (props?: BlankTrackingFlashListProps) => {
|
|
44
|
-
const flashListRef: React.RefObject<FlashList<any>> = {
|
|
45
|
-
current: null,
|
|
46
|
-
};
|
|
47
|
-
const blankTrackingFlashList = render(
|
|
48
|
-
<BlankTrackingFlashList {...props} instance={flashListRef} />
|
|
49
|
-
);
|
|
50
|
-
return {
|
|
51
|
-
root: blankTrackingFlashList,
|
|
52
|
-
instance: flashListRef.current!,
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
describe("useBlankAreaTracker Hook", () => {
|
|
57
|
-
beforeEach(() => {
|
|
58
|
-
jest.clearAllMocks();
|
|
59
|
-
jest.useFakeTimers();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("ignores blank events for 500ms on mount and if content is not enough to fill the list", () => {
|
|
63
|
-
const onCumulativeBlankAreaChange = jest.fn();
|
|
64
|
-
const flashList = mountBlankTrackingFlashList({
|
|
65
|
-
onCumulativeBlankAreaChange,
|
|
66
|
-
});
|
|
67
|
-
flashList.instance.props.onBlankArea!({
|
|
68
|
-
blankArea: 100,
|
|
69
|
-
offsetEnd: 100,
|
|
70
|
-
offsetStart: 0,
|
|
71
|
-
});
|
|
72
|
-
flashList.instance.props.onBlankArea!({
|
|
73
|
-
blankArea: 100,
|
|
74
|
-
offsetEnd: 100,
|
|
75
|
-
offsetStart: 0,
|
|
76
|
-
});
|
|
77
|
-
jest.advanceTimersByTime(400);
|
|
78
|
-
flashList.instance.props.onBlankArea!({
|
|
79
|
-
blankArea: 100,
|
|
80
|
-
offsetEnd: 100,
|
|
81
|
-
offsetStart: 0,
|
|
82
|
-
});
|
|
83
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(0);
|
|
84
|
-
jest.advanceTimersByTime(100);
|
|
85
|
-
flashList.instance.props.onBlankArea!({
|
|
86
|
-
blankArea: 100,
|
|
87
|
-
offsetEnd: 100,
|
|
88
|
-
offsetStart: 0,
|
|
89
|
-
});
|
|
90
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(1);
|
|
91
|
-
onCumulativeBlankAreaChange.mockClear();
|
|
92
|
-
|
|
93
|
-
flashList.root.setProps({ data: ["1"] });
|
|
94
|
-
flashList.instance.props.onBlankArea!({
|
|
95
|
-
blankArea: 100,
|
|
96
|
-
offsetEnd: 100,
|
|
97
|
-
offsetStart: 0,
|
|
98
|
-
});
|
|
99
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(0);
|
|
100
|
-
flashList.root.unmount();
|
|
101
|
-
});
|
|
102
|
-
it("keeps result object updated with correct values on unmount", () => {
|
|
103
|
-
let resultObjectCopy: BlankAreaTrackerResult | undefined;
|
|
104
|
-
const onCumulativeBlankAreaChange = jest.fn(
|
|
105
|
-
(result: BlankAreaTrackerResult) => {
|
|
106
|
-
if (!resultObjectCopy) {
|
|
107
|
-
resultObjectCopy = result;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
);
|
|
111
|
-
const onCumulativeBlankAreaResult = jest.fn();
|
|
112
|
-
const flashList = mountBlankTrackingFlashList({
|
|
113
|
-
onCumulativeBlankAreaResult,
|
|
114
|
-
onCumulativeBlankAreaChange,
|
|
115
|
-
blankAreaTrackerConfig: { startDelayInMs: 300 },
|
|
116
|
-
});
|
|
117
|
-
flashList.instance.props.onBlankArea!({
|
|
118
|
-
blankArea: 100,
|
|
119
|
-
offsetEnd: 100,
|
|
120
|
-
offsetStart: 0,
|
|
121
|
-
});
|
|
122
|
-
jest.advanceTimersByTime(300);
|
|
123
|
-
flashList.instance.props.onBlankArea!({
|
|
124
|
-
blankArea: 100,
|
|
125
|
-
offsetEnd: 100,
|
|
126
|
-
offsetStart: 0,
|
|
127
|
-
});
|
|
128
|
-
expect(resultObjectCopy!.cumulativeBlankArea).toBe(100);
|
|
129
|
-
expect(resultObjectCopy!.maxBlankArea).toBe(100);
|
|
130
|
-
|
|
131
|
-
flashList.instance.props.onBlankArea!({
|
|
132
|
-
blankArea: 200,
|
|
133
|
-
offsetEnd: 200,
|
|
134
|
-
offsetStart: 0,
|
|
135
|
-
});
|
|
136
|
-
flashList.instance.props.onBlankArea!({
|
|
137
|
-
blankArea: -200,
|
|
138
|
-
offsetEnd: -200,
|
|
139
|
-
offsetStart: 0,
|
|
140
|
-
});
|
|
141
|
-
expect(resultObjectCopy!.cumulativeBlankArea).toBe(300);
|
|
142
|
-
expect(resultObjectCopy!.maxBlankArea).toBe(200);
|
|
143
|
-
|
|
144
|
-
flashList.root.unmount();
|
|
145
|
-
expect(onCumulativeBlankAreaResult).toHaveBeenCalledWith(resultObjectCopy!);
|
|
146
|
-
});
|
|
147
|
-
it("can track negative values on demand", () => {
|
|
148
|
-
const onCumulativeBlankAreaResult = jest.fn();
|
|
149
|
-
const flashList = mountBlankTrackingFlashList({
|
|
150
|
-
onCumulativeBlankAreaResult,
|
|
151
|
-
blankAreaTrackerConfig: { sumNegativeValues: true },
|
|
152
|
-
});
|
|
153
|
-
flashList.instance.props.onBlankArea!({
|
|
154
|
-
blankArea: -200,
|
|
155
|
-
offsetEnd: -200,
|
|
156
|
-
offsetStart: 0,
|
|
157
|
-
});
|
|
158
|
-
jest.advanceTimersByTime(500);
|
|
159
|
-
flashList.instance.props.onBlankArea!({
|
|
160
|
-
blankArea: -200,
|
|
161
|
-
offsetEnd: -200,
|
|
162
|
-
offsetStart: 0,
|
|
163
|
-
});
|
|
164
|
-
flashList.instance.props.onBlankArea!({
|
|
165
|
-
blankArea: -200,
|
|
166
|
-
offsetEnd: -200,
|
|
167
|
-
offsetStart: 0,
|
|
168
|
-
});
|
|
169
|
-
flashList.root.unmount();
|
|
170
|
-
expect(onCumulativeBlankAreaResult).toHaveBeenCalledWith({
|
|
171
|
-
cumulativeBlankArea: -400,
|
|
172
|
-
maxBlankArea: 0,
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
it("only calls onCumulativeBlankAreaChange when values have a change", () => {
|
|
176
|
-
const onCumulativeBlankAreaChange = jest.fn();
|
|
177
|
-
const flashList = mountBlankTrackingFlashList({
|
|
178
|
-
onCumulativeBlankAreaChange,
|
|
179
|
-
});
|
|
180
|
-
flashList.instance.props.onBlankArea!({
|
|
181
|
-
blankArea: -200,
|
|
182
|
-
offsetEnd: -200,
|
|
183
|
-
offsetStart: 0,
|
|
184
|
-
});
|
|
185
|
-
jest.advanceTimersByTime(500);
|
|
186
|
-
flashList.instance.props.onBlankArea!({
|
|
187
|
-
blankArea: -200,
|
|
188
|
-
offsetEnd: -200,
|
|
189
|
-
offsetStart: 0,
|
|
190
|
-
});
|
|
191
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(0);
|
|
192
|
-
flashList.instance.props.onBlankArea!({
|
|
193
|
-
blankArea: -100,
|
|
194
|
-
offsetEnd: -100,
|
|
195
|
-
offsetStart: 0,
|
|
196
|
-
});
|
|
197
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(0);
|
|
198
|
-
flashList.instance.props.onBlankArea!({
|
|
199
|
-
blankArea: 100,
|
|
200
|
-
offsetEnd: 100,
|
|
201
|
-
offsetStart: 0,
|
|
202
|
-
});
|
|
203
|
-
expect(onCumulativeBlankAreaChange).toHaveBeenCalledTimes(1);
|
|
204
|
-
flashList.root.unmount();
|
|
205
|
-
});
|
|
206
|
-
});
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useRef } from "react";
|
|
2
|
-
import { RecyclerListView, RecyclerListViewProps } from "recyclerlistview";
|
|
3
|
-
|
|
4
|
-
import { BlankAreaEvent } from "../native/auto-layout/AutoLayoutView";
|
|
5
|
-
import FlashList from "../FlashList";
|
|
6
|
-
|
|
7
|
-
export interface BlankAreaTrackerResult {
|
|
8
|
-
/**
|
|
9
|
-
* Max blank area displayed
|
|
10
|
-
*/
|
|
11
|
-
maxBlankArea: number;
|
|
12
|
-
/**
|
|
13
|
-
* Sum of all blank area values across all frames
|
|
14
|
-
*/
|
|
15
|
-
cumulativeBlankArea: number;
|
|
16
|
-
}
|
|
17
|
-
export interface BlankAreaTrackerConfig {
|
|
18
|
-
/**
|
|
19
|
-
* When set to true the hook will also sum all negative blank area values.
|
|
20
|
-
* Blank area is negative when list is able to draw faster than the scroll speed.
|
|
21
|
-
*/
|
|
22
|
-
sumNegativeValues?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* By default, the hook ignores blank events for 1s after the list load. This value can be changed using this parameter.
|
|
25
|
-
* Please note that this duration kicks in after the list has loaded and not after the first scroll.
|
|
26
|
-
*/
|
|
27
|
-
startDelayInMs?: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Can be used to track visible blank area in production
|
|
32
|
-
* @param flashListRef Ref to the FlashList component
|
|
33
|
-
* @param onBlankAreaChange This event handler will be called when the blank area changes
|
|
34
|
-
* @param config additional configuration for the blank area tracker
|
|
35
|
-
* @returns blankAreaTrackerResult - maxBlankArea, cumulativeBlankArea this object is mutated and kept up to date. Also returns a callback that needs to be forwarded to FlashList.
|
|
36
|
-
*/
|
|
37
|
-
export function useBlankAreaTracker(
|
|
38
|
-
flashListRef: React.RefObject<FlashList<any>>,
|
|
39
|
-
onBlankAreaChange?: (value: BlankAreaTrackerResult) => void,
|
|
40
|
-
config?: BlankAreaTrackerConfig
|
|
41
|
-
): [BlankAreaTrackerResult, (event: BlankAreaEvent) => void] {
|
|
42
|
-
const startDelay = config?.startDelayInMs ?? 1000;
|
|
43
|
-
const blankAreaResult = useRef({
|
|
44
|
-
maxBlankArea: 0,
|
|
45
|
-
cumulativeBlankArea: 0,
|
|
46
|
-
}).current;
|
|
47
|
-
const waitOperations = useRef({ inProgress: false, complete: false }).current;
|
|
48
|
-
const onBlankAreaChangeRef = useRef(onBlankAreaChange);
|
|
49
|
-
onBlankAreaChangeRef.current = onBlankAreaChange;
|
|
50
|
-
|
|
51
|
-
const blankAreaTracker = useCallback(
|
|
52
|
-
(event: BlankAreaEvent) => {
|
|
53
|
-
// we're ignoring some of the events that will be fired on list load
|
|
54
|
-
// initial events are fired on mount and thus, this won't lead to missing events during scroll
|
|
55
|
-
if (!waitOperations.complete && startDelay > 0) {
|
|
56
|
-
if (!waitOperations.inProgress) {
|
|
57
|
-
waitOperations.inProgress = true;
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
waitOperations.complete = true;
|
|
60
|
-
}, startDelay);
|
|
61
|
-
}
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const rlv = flashListRef.current?.recyclerlistview_unsafe;
|
|
65
|
-
const horizontal = Boolean(flashListRef.current?.props.horizontal);
|
|
66
|
-
if (rlv) {
|
|
67
|
-
processBlankAreaChange(
|
|
68
|
-
rlv,
|
|
69
|
-
horizontal,
|
|
70
|
-
blankAreaResult,
|
|
71
|
-
event,
|
|
72
|
-
onBlankAreaChangeRef.current,
|
|
73
|
-
config
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
|
-
[flashListRef]
|
|
79
|
-
);
|
|
80
|
-
return [blankAreaResult, blankAreaTracker];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function processBlankAreaChange(
|
|
84
|
-
rlv: RecyclerListView<RecyclerListViewProps, any>,
|
|
85
|
-
horizontal: boolean,
|
|
86
|
-
blankAreaResult: BlankAreaTrackerResult,
|
|
87
|
-
event: BlankAreaEvent,
|
|
88
|
-
onBlankAreaChange?: (value: BlankAreaTrackerResult) => void,
|
|
89
|
-
config?: BlankAreaTrackerConfig
|
|
90
|
-
) {
|
|
91
|
-
const listSize = horizontal
|
|
92
|
-
? rlv.getRenderedSize().width
|
|
93
|
-
: rlv.getRenderedSize().height;
|
|
94
|
-
const contentSize = horizontal
|
|
95
|
-
? rlv.getContentDimension().width
|
|
96
|
-
: rlv.getContentDimension().height;
|
|
97
|
-
|
|
98
|
-
// ignores blank events when there isn't enough content to fill the list
|
|
99
|
-
if (contentSize > listSize) {
|
|
100
|
-
const lastMaxBlankArea = blankAreaResult.maxBlankArea;
|
|
101
|
-
const lastCumulativeBlankArea = blankAreaResult.cumulativeBlankArea;
|
|
102
|
-
blankAreaResult.maxBlankArea = Math.max(
|
|
103
|
-
blankAreaResult.maxBlankArea,
|
|
104
|
-
event.blankArea,
|
|
105
|
-
0
|
|
106
|
-
);
|
|
107
|
-
blankAreaResult.cumulativeBlankArea += config?.sumNegativeValues
|
|
108
|
-
? event.blankArea
|
|
109
|
-
: Math.max(event.blankArea, 0);
|
|
110
|
-
if (
|
|
111
|
-
lastCumulativeBlankArea !== blankAreaResult.cumulativeBlankArea ||
|
|
112
|
-
lastMaxBlankArea !== blankAreaResult.maxBlankArea
|
|
113
|
-
) {
|
|
114
|
-
onBlankAreaChange?.(blankAreaResult);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
package/src/enableNewCore.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Platform } from "react-native";
|
|
2
|
-
|
|
3
|
-
let useNewCore: boolean | undefined;
|
|
4
|
-
export function enableNewCore(enable: boolean) {
|
|
5
|
-
useNewCore = enable;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function isNewCoreEnabled() {
|
|
9
|
-
return useNewCore ?? isReactNativeNewArchitecture();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function isReactNativeNewArchitecture(): boolean {
|
|
13
|
-
try {
|
|
14
|
-
// Check for Fabric UI Manager
|
|
15
|
-
const hasFabricUIManager = Boolean((global as any)?.nativeFabricUIManager);
|
|
16
|
-
|
|
17
|
-
// Check for TurboModule system
|
|
18
|
-
const hasTurboModule = Boolean((global as any)?.__turboModuleProxy);
|
|
19
|
-
|
|
20
|
-
return hasFabricUIManager || hasTurboModule || Platform.OS === "web";
|
|
21
|
-
} catch {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const ExceptionList = {
|
|
2
|
-
refreshBooleanMissing: {
|
|
3
|
-
message:
|
|
4
|
-
"`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `undefined`.",
|
|
5
|
-
type: "InvariantViolation",
|
|
6
|
-
},
|
|
7
|
-
stickyWhileHorizontalNotSupported: {
|
|
8
|
-
message:
|
|
9
|
-
"sticky headers are not supported when list is in horizontal mode. Remove `stickyHeaderIndices` prop.",
|
|
10
|
-
type: "NotSupportedException",
|
|
11
|
-
},
|
|
12
|
-
columnsWhileHorizontalNotSupported: {
|
|
13
|
-
message:
|
|
14
|
-
"numColumns is not supported when list is in horizontal mode. Please remove or set numColumns to 1.",
|
|
15
|
-
type: "NotSupportedException",
|
|
16
|
-
},
|
|
17
|
-
multipleViewabilityThresholdTypesNotSupported: {
|
|
18
|
-
message:
|
|
19
|
-
"You can set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold. Specifying both is not supported.",
|
|
20
|
-
type: "MultipleViewabilityThresholdTypesException",
|
|
21
|
-
},
|
|
22
|
-
overrideItemLayoutRequiredForMasonryOptimization: {
|
|
23
|
-
message:
|
|
24
|
-
"optimizeItemArrangement has been enabled on `MasonryFlashList` but overrideItemLayout is not set.",
|
|
25
|
-
type: "InvariantViolation",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
export default ExceptionList;
|
package/src/errors/Warnings.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const WarningList = {
|
|
2
|
-
styleUnsupported:
|
|
3
|
-
"You have passed a style to FlashList. This list doesn't support styling, use contentContainerStyle or wrap the list in a parent and apply style to it instead.",
|
|
4
|
-
styleContentContainerUnsupported:
|
|
5
|
-
"FlashList only supports padding related props and backgroundColor in contentContainerStyle. Please remove other values as they're not used.",
|
|
6
|
-
unusableRenderedSize:
|
|
7
|
-
"FlashList's rendered size is not usable. Either the height or width is too small (<2px). " +
|
|
8
|
-
"Please make sure that the parent view of the list has a valid size. FlashList will match the size of the parent.",
|
|
9
|
-
missingKeyExtractor:
|
|
10
|
-
"FlashList requires a keyExtractor prop to be defined when animating elements. Without it, the animations will not run as expected.",
|
|
11
|
-
estimatedItemSizeMissingWarning:
|
|
12
|
-
"estimatedItemSize FlashList prop is not defined - based on current configuration you can set it to @size to optimize list performance. " +
|
|
13
|
-
"Refer to FlashList documentation for more details.",
|
|
14
|
-
};
|
|
15
|
-
export default WarningList;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, ReactNode } from "react";
|
|
2
|
-
import { LayoutChangeEvent } from "react-native";
|
|
3
|
-
|
|
4
|
-
import AutoLayoutViewNativeComponent from "./AutoLayoutViewNativeComponent";
|
|
5
|
-
import { OnBlankAreaEvent } from "./AutoLayoutViewNativeComponentProps";
|
|
6
|
-
|
|
7
|
-
export type BlankAreaEventHandler = (blankAreaEvent: BlankAreaEvent) => void;
|
|
8
|
-
const listeners: BlankAreaEventHandler[] = [];
|
|
9
|
-
|
|
10
|
-
export const useOnNativeBlankAreaEvents = (
|
|
11
|
-
onBlankAreaEvent: (blankAreaEvent: BlankAreaEvent) => void
|
|
12
|
-
) => {
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
listeners.push(onBlankAreaEvent);
|
|
15
|
-
return () => {
|
|
16
|
-
listeners.filter((callback) => callback !== onBlankAreaEvent);
|
|
17
|
-
};
|
|
18
|
-
}, [onBlankAreaEvent]);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export interface BlankAreaEvent {
|
|
22
|
-
offsetStart: number;
|
|
23
|
-
offsetEnd: number;
|
|
24
|
-
blankArea: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface AutoLayoutViewProps {
|
|
28
|
-
children?: ReactNode;
|
|
29
|
-
onBlankAreaEvent?: BlankAreaEventHandler;
|
|
30
|
-
onLayout?: (event: LayoutChangeEvent) => void;
|
|
31
|
-
disableAutoLayout?: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
class AutoLayoutView extends React.Component<AutoLayoutViewProps> {
|
|
35
|
-
private onBlankAreaEventCallback = ({
|
|
36
|
-
nativeEvent,
|
|
37
|
-
}: OnBlankAreaEvent): void => {
|
|
38
|
-
const blankArea = Math.max(nativeEvent.offsetStart, nativeEvent.offsetEnd);
|
|
39
|
-
const blankEventValue = {
|
|
40
|
-
blankArea,
|
|
41
|
-
offsetStart: nativeEvent.offsetStart,
|
|
42
|
-
offsetEnd: nativeEvent.offsetEnd,
|
|
43
|
-
};
|
|
44
|
-
this.broadcastBlankEvent(blankEventValue);
|
|
45
|
-
if (this.props.onBlankAreaEvent) {
|
|
46
|
-
this.props.onBlankAreaEvent(blankEventValue);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
private broadcastBlankEvent(value: BlankAreaEvent) {
|
|
51
|
-
const len = listeners.length;
|
|
52
|
-
for (let i = 0; i < len; i++) {
|
|
53
|
-
listeners[i](value);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
render() {
|
|
58
|
-
return (
|
|
59
|
-
<AutoLayoutViewNativeComponent
|
|
60
|
-
{...this.props}
|
|
61
|
-
onBlankAreaEvent={this.onBlankAreaEventCallback}
|
|
62
|
-
enableInstrumentation={
|
|
63
|
-
listeners.length !== 0 || Boolean(this.props.onBlankAreaEvent)
|
|
64
|
-
}
|
|
65
|
-
disableAutoLayout={this.props.disableAutoLayout}
|
|
66
|
-
>
|
|
67
|
-
{this.props.children}
|
|
68
|
-
</AutoLayoutViewNativeComponent>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export default AutoLayoutView;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { requireNativeComponent } from "react-native";
|
|
2
|
-
|
|
3
|
-
import { AutoLayoutViewNativeComponentProps } from "./AutoLayoutViewNativeComponentProps";
|
|
4
|
-
|
|
5
|
-
const AutoLayoutViewNativeComponent =
|
|
6
|
-
requireNativeComponent<AutoLayoutViewNativeComponentProps>("AutoLayoutView");
|
|
7
|
-
export default AutoLayoutViewNativeComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { requireNativeComponent } from "react-native";
|
|
2
|
-
|
|
3
|
-
import { AutoLayoutViewNativeComponentProps } from "./AutoLayoutViewNativeComponentProps";
|
|
4
|
-
|
|
5
|
-
const AutoLayoutViewNativeComponent =
|
|
6
|
-
requireNativeComponent<AutoLayoutViewNativeComponentProps>("AutoLayoutView");
|
|
7
|
-
export default AutoLayoutViewNativeComponent;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HostComponent, View } from "react-native";
|
|
2
|
-
|
|
3
|
-
import { AutoLayoutViewNativeComponentProps } from "./AutoLayoutViewNativeComponentProps";
|
|
4
|
-
|
|
5
|
-
const AutoLayoutViewNativeComponent =
|
|
6
|
-
View as any as HostComponent<AutoLayoutViewNativeComponentProps>;
|
|
7
|
-
export default AutoLayoutViewNativeComponent;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export interface OnBlankAreaEvent {
|
|
4
|
-
nativeEvent: {
|
|
5
|
-
offsetStart: number;
|
|
6
|
-
offsetEnd: number;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
type OnBlankAreaEventHandler = (event: OnBlankAreaEvent) => void;
|
|
11
|
-
|
|
12
|
-
export interface AutoLayoutViewNativeComponentProps {
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
onBlankAreaEvent: OnBlankAreaEventHandler;
|
|
15
|
-
enableInstrumentation: boolean;
|
|
16
|
-
disableAutoLayout?: boolean;
|
|
17
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { View, ViewProps } from "react-native";
|
|
3
|
-
|
|
4
|
-
export interface CellContainerProps extends ViewProps {
|
|
5
|
-
index: number;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const CellContainer = React.forwardRef(
|
|
9
|
-
(props: CellContainerProps, ref: any) => {
|
|
10
|
-
return <View ref={ref} {...props} />;
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
CellContainer.displayName = "CellContainer";
|
|
14
|
-
export default CellContainer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* On web we use a view instead of cell container till we build native web implementations
|
|
4
|
-
*/
|
|
5
|
-
const CellContainer = React.forwardRef((props: any, ref) => {
|
|
6
|
-
return <div ref={ref} {...props} />;
|
|
7
|
-
});
|
|
8
|
-
CellContainer.displayName = "CellContainer";
|
|
9
|
-
export default CellContainer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
2
|
-
import type { ViewProps } from "react-native";
|
|
3
|
-
import type {
|
|
4
|
-
Int32,
|
|
5
|
-
Double,
|
|
6
|
-
DirectEventHandler,
|
|
7
|
-
} from "react-native/Libraries/Types/CodegenTypes";
|
|
8
|
-
|
|
9
|
-
type BlankAreaEvent = Readonly<{
|
|
10
|
-
offsetStart: Int32;
|
|
11
|
-
offsetEnd: Int32;
|
|
12
|
-
}>;
|
|
13
|
-
|
|
14
|
-
interface NativeProps extends ViewProps {
|
|
15
|
-
horizontal?: boolean;
|
|
16
|
-
scrollOffset?: Double;
|
|
17
|
-
windowSize?: Double;
|
|
18
|
-
renderAheadOffset?: Double;
|
|
19
|
-
enableInstrumentation?: boolean;
|
|
20
|
-
disableAutoLayout?: boolean;
|
|
21
|
-
onBlankAreaEvent?: DirectEventHandler<BlankAreaEvent>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default codegenNativeComponent<NativeProps>("AutoLayoutView");
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
|
2
|
-
import type { Int32 } from "react-native/Libraries/Types/CodegenTypes";
|
|
3
|
-
import type { ViewProps } from "react-native";
|
|
4
|
-
|
|
5
|
-
interface NativeProps extends ViewProps {
|
|
6
|
-
index?: Int32;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default codegenNativeComponent<NativeProps>("CellContainer");
|