@rific/scroll-view 0.3.0 → 0.4.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 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
- declare const scrollViewActions: _reduxjs_toolkit.CaseReducerActions<{
91
- initialize: (_state: {
92
- backActionFixed: boolean;
93
- footerFixed: boolean;
94
- headerFixed: boolean;
95
- snapBack: boolean;
96
- snapBackFooter?: boolean | undefined;
97
- snapBackHeader?: boolean | undefined;
98
- }, action: PayloadAction<ScrollViewSettings>) => ScrollViewSettings;
99
- }, "scrollView">;
100
- declare const scrollViewReducer: redux.Reducer<ScrollViewSettings>;
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
- declare const scrollViewActions: _reduxjs_toolkit.CaseReducerActions<{
91
- initialize: (_state: {
92
- backActionFixed: boolean;
93
- footerFixed: boolean;
94
- headerFixed: boolean;
95
- snapBack: boolean;
96
- snapBackFooter?: boolean | undefined;
97
- snapBackHeader?: boolean | undefined;
98
- }, action: PayloadAction<ScrollViewSettings>) => ScrollViewSettings;
99
- }, "scrollView">;
100
- declare const scrollViewReducer: redux.Reducer<ScrollViewSettings>;
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;