@rific/scroll-view 0.3.0 → 0.4.0
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 +2 -0
- package/dist/index.d.mts +16 -14
- package/dist/index.d.ts +16 -14
- package/dist/index.js +14 -1575
- package/dist/index.mjs +14 -1577
- package/package.json +10 -10
- package/src/redux/scrollViewSlice.ts +19 -11
- package/src/__mocks__/auto-paper.ts +0 -9
- package/src/__mocks__/flash-list.ts +0 -20
- package/src/__mocks__/react-native-gesture-handler.ts +0 -13
- package/src/__mocks__/react-native-keyboard-controller.ts +0 -11
- package/src/__mocks__/react-native-paper.ts +0 -22
- package/src/__mocks__/react-native-reanimated.ts +0 -61
- package/src/__mocks__/react-native-safe-area-context.ts +0 -2
- package/src/__mocks__/react-native.ts +0 -30
- package/src/__tests__/CustomList.test.tsx +0 -61
- package/src/__tests__/FlatList.test.tsx +0 -135
- package/src/__tests__/PullSearch.test.tsx +0 -38
- package/src/__tests__/ScrollView.test.tsx +0 -23
- package/src/__tests__/ScrollViewHeader.test.tsx +0 -28
- package/src/__tests__/ScrollViewProvider.test.tsx +0 -65
- package/src/__tests__/SectionList.test.tsx +0 -88
- package/src/__tests__/useScrollHandlerJS.test.ts +0 -119
- package/src/__tests__/useScrollInit.test.ts +0 -251
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ npm install @rific/scroll-view
|
|
|
14
14
|
npm install @rific/auto-paper react-native-reanimated react-native-gesture-handler react-native-safe-area-context react-native-paper react-native-keyboard-controller
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
The exported Redux slice has no dependency on `@reduxjs/toolkit` — it works with RTK stores, vanilla Redux, or no Redux at all.
|
|
18
|
+
|
|
17
19
|
## Quick start
|
|
18
20
|
|
|
19
21
|
Wrap your screen in `ScrollViewProvider`, add a `ScrollViewHeader`, then drop in one of the scroll components.
|
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,6 @@ import { ReactNode, ComponentType, RefObject } from 'react';
|
|
|
3
3
|
import { NativeSyntheticEvent, NativeScrollEvent, StyleProp, ViewStyle, FlatListProps as FlatListProps$1, FlatList as FlatList$1, ScrollViewProps as ScrollViewProps$1, ScrollView as ScrollView$1, SectionListProps as SectionListProps$1, SectionList as SectionList$1 } from 'react-native';
|
|
4
4
|
import { GestureType } from 'react-native-gesture-handler';
|
|
5
5
|
import { ChipProps as ChipProps$1 } from '@rific/auto-paper';
|
|
6
|
-
import * as redux from 'redux';
|
|
7
|
-
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
8
|
-
import { PayloadAction } from '@reduxjs/toolkit';
|
|
9
6
|
import * as react_native_reanimated from 'react-native-reanimated';
|
|
10
7
|
import { SharedValue } from 'react-native-reanimated';
|
|
11
8
|
|
|
@@ -87,17 +84,22 @@ type ScrollViewSettingsContextType = {
|
|
|
87
84
|
};
|
|
88
85
|
declare const ScrollViewSettingsContext: react.Context<ScrollViewSettingsContextType>;
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
type PayloadAction<P> = {
|
|
88
|
+
payload: P;
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
declare const scrollViewActions: {
|
|
92
|
+
initialize: {
|
|
93
|
+
(payload: ScrollViewSettings): PayloadAction<ScrollViewSettings>;
|
|
94
|
+
type: string;
|
|
95
|
+
match(action: {
|
|
96
|
+
type: string;
|
|
97
|
+
}): action is PayloadAction<ScrollViewSettings>;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare const scrollViewReducer: (state: ScrollViewSettings | undefined, action: {
|
|
101
|
+
type: string;
|
|
102
|
+
}) => ScrollViewSettings;
|
|
101
103
|
|
|
102
104
|
type ScrollViewProps = ScrollViewProps$1 & {
|
|
103
105
|
chipProps?: ChipProps;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,6 @@ import { ReactNode, ComponentType, RefObject } from 'react';
|
|
|
3
3
|
import { NativeSyntheticEvent, NativeScrollEvent, StyleProp, ViewStyle, FlatListProps as FlatListProps$1, FlatList as FlatList$1, ScrollViewProps as ScrollViewProps$1, ScrollView as ScrollView$1, SectionListProps as SectionListProps$1, SectionList as SectionList$1 } from 'react-native';
|
|
4
4
|
import { GestureType } from 'react-native-gesture-handler';
|
|
5
5
|
import { ChipProps as ChipProps$1 } from '@rific/auto-paper';
|
|
6
|
-
import * as redux from 'redux';
|
|
7
|
-
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
8
|
-
import { PayloadAction } from '@reduxjs/toolkit';
|
|
9
6
|
import * as react_native_reanimated from 'react-native-reanimated';
|
|
10
7
|
import { SharedValue } from 'react-native-reanimated';
|
|
11
8
|
|
|
@@ -87,17 +84,22 @@ type ScrollViewSettingsContextType = {
|
|
|
87
84
|
};
|
|
88
85
|
declare const ScrollViewSettingsContext: react.Context<ScrollViewSettingsContextType>;
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
type PayloadAction<P> = {
|
|
88
|
+
payload: P;
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
declare const scrollViewActions: {
|
|
92
|
+
initialize: {
|
|
93
|
+
(payload: ScrollViewSettings): PayloadAction<ScrollViewSettings>;
|
|
94
|
+
type: string;
|
|
95
|
+
match(action: {
|
|
96
|
+
type: string;
|
|
97
|
+
}): action is PayloadAction<ScrollViewSettings>;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare const scrollViewReducer: (state: ScrollViewSettings | undefined, action: {
|
|
101
|
+
type: string;
|
|
102
|
+
}) => ScrollViewSettings;
|
|
101
103
|
|
|
102
104
|
type ScrollViewProps = ScrollViewProps$1 & {
|
|
103
105
|
chipProps?: ChipProps;
|