react-navigation-reanimated-top-tabs 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/lib/commonjs/components/ReanimatedTopTab/ReanimatedTabView.js +5 -3
- package/lib/commonjs/components/ReanimatedTopTab/ReanimatedTabView.js.map +1 -1
- package/lib/commonjs/components/elements/TabBarBaseComponent.js +6 -5
- package/lib/commonjs/components/elements/TabBarBaseComponent.js.map +1 -1
- package/lib/commonjs/components/elements/TabBarLabelBaseComponent.js +2 -4
- package/lib/commonjs/components/elements/TabBarLabelBaseComponent.js.map +1 -1
- package/lib/commonjs/components/wrappers/GestureWrapper.js +18 -26
- package/lib/commonjs/components/wrappers/GestureWrapper.js.map +1 -1
- package/lib/commonjs/components/wrappers/ScreenWrapper.js +4 -4
- package/lib/commonjs/components/wrappers/ScreenWrapper.js.map +1 -1
- package/lib/commonjs/components/wrappers/ScrollView.js +27 -16
- package/lib/commonjs/components/wrappers/ScrollView.js.map +1 -1
- package/lib/commonjs/context/Context.helpers.js +19 -0
- package/lib/commonjs/context/Context.helpers.js.map +1 -0
- package/lib/commonjs/context/Context.hooks.js +216 -0
- package/lib/commonjs/context/Context.hooks.js.map +1 -0
- package/lib/commonjs/context/Context.js +68 -0
- package/lib/commonjs/context/Context.js.map +1 -0
- package/lib/commonjs/hooks/useHeader.js +30 -0
- package/lib/commonjs/hooks/useHeader.js.map +1 -0
- package/lib/commonjs/hooks/useScreenGesture.js +21 -0
- package/lib/commonjs/hooks/useScreenGesture.js.map +1 -0
- package/lib/commonjs/hooks/useScreenProperties.js +21 -0
- package/lib/commonjs/hooks/useScreenProperties.js.map +1 -0
- package/lib/commonjs/hooks/{Tab.hooks.js → useScreenScrollable.js} +14 -83
- package/lib/commonjs/hooks/useScreenScrollable.js.map +1 -0
- package/lib/commonjs/hooks/useTabContext.js +11 -0
- package/lib/commonjs/hooks/useTabContext.js.map +1 -0
- package/lib/commonjs/hooks/useTabOffset.js +18 -0
- package/lib/commonjs/hooks/useTabOffset.js.map +1 -0
- package/lib/commonjs/index.js +25 -11
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigator/createReanimatedTopTabNavigator.js +14 -29
- package/lib/commonjs/navigator/createReanimatedTopTabNavigator.js.map +1 -1
- package/lib/commonjs/services/Warning.service.js +16 -0
- package/lib/commonjs/services/Warning.service.js.map +1 -0
- package/lib/module/components/ReanimatedTopTab/ReanimatedTabView.js +8 -6
- package/lib/module/components/ReanimatedTopTab/ReanimatedTabView.js.map +1 -1
- package/lib/module/components/elements/TabBarBaseComponent.js +5 -4
- package/lib/module/components/elements/TabBarBaseComponent.js.map +1 -1
- package/lib/module/components/elements/TabBarLabelBaseComponent.js +2 -4
- package/lib/module/components/elements/TabBarLabelBaseComponent.js.map +1 -1
- package/lib/module/components/wrappers/GestureWrapper.js +18 -27
- package/lib/module/components/wrappers/GestureWrapper.js.map +1 -1
- package/lib/module/components/wrappers/ScreenWrapper.js +3 -3
- package/lib/module/components/wrappers/ScreenWrapper.js.map +1 -1
- package/lib/module/components/wrappers/ScrollView.js +23 -12
- package/lib/module/components/wrappers/ScrollView.js.map +1 -1
- package/lib/module/context/Context.helpers.js +15 -0
- package/lib/module/context/Context.helpers.js.map +1 -0
- package/lib/module/context/Context.hooks.js +213 -0
- package/lib/module/context/Context.hooks.js.map +1 -0
- package/lib/module/context/Context.js +64 -0
- package/lib/module/context/Context.js.map +1 -0
- package/lib/module/hooks/useHeader.js +25 -0
- package/lib/module/hooks/useHeader.js.map +1 -0
- package/lib/module/hooks/useScreenGesture.js +16 -0
- package/lib/module/hooks/useScreenGesture.js.map +1 -0
- package/lib/module/hooks/useScreenProperties.js +16 -0
- package/lib/module/hooks/useScreenProperties.js.map +1 -0
- package/lib/module/hooks/useScreenScrollable.js +57 -0
- package/lib/module/hooks/useScreenScrollable.js.map +1 -0
- package/lib/module/hooks/useTabContext.js +6 -0
- package/lib/module/hooks/useTabContext.js.map +1 -0
- package/lib/module/hooks/useTabOffset.js +12 -0
- package/lib/module/hooks/useTabOffset.js.map +1 -0
- package/lib/module/index.js +21 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigator/createReanimatedTopTabNavigator.js +13 -27
- package/lib/module/navigator/createReanimatedTopTabNavigator.js.map +1 -1
- package/lib/module/services/Warning.service.js +12 -0
- package/lib/module/services/Warning.service.js.map +1 -0
- package/lib/typescript/src/components/ReanimatedTopTab/AnimationHelper.d.ts.map +1 -0
- package/lib/typescript/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts.map +1 -0
- package/lib/typescript/src/components/ReanimatedTopTab/types.d.ts.map +1 -0
- package/lib/typescript/src/components/elements/TabBarBaseComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/elements/TabBarLabelBaseComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/wrappers/GestureWrapper.d.ts +7 -0
- package/lib/typescript/src/components/wrappers/GestureWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/wrappers/ScreenWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/wrappers/ScrollView.d.ts +5 -0
- package/lib/typescript/src/components/wrappers/ScrollView.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src/context/TabContext.d.ts → src/context/Context.d.ts} +2 -2
- package/lib/typescript/src/context/Context.d.ts.map +1 -0
- package/lib/typescript/src/context/Context.helpers.d.ts +4 -0
- package/lib/typescript/src/context/Context.helpers.d.ts.map +1 -0
- package/lib/typescript/src/context/Context.hooks.d.ts +15 -0
- package/lib/typescript/src/context/Context.hooks.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useHeader.d.ts +10 -0
- package/lib/typescript/src/hooks/useHeader.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useScreenGesture.d.ts +2 -0
- package/lib/typescript/src/hooks/useScreenGesture.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useScreenProperties.d.ts +10 -0
- package/lib/typescript/src/hooks/useScreenProperties.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useScreenScrollable.d.ts +14 -0
- package/lib/typescript/src/hooks/useScreenScrollable.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useTabContext.d.ts +2 -0
- package/lib/typescript/src/hooks/useTabContext.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useTabOffset.d.ts +2 -0
- package/lib/typescript/src/hooks/useTabOffset.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/index.d.ts +11 -1
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/navigator/createReanimatedTopTabNavigator.d.ts.map +1 -0
- package/lib/typescript/src/services/Warning.service.d.ts +5 -0
- package/lib/typescript/src/services/Warning.service.d.ts.map +1 -0
- package/lib/typescript/{module/src → src}/types.d.ts +24 -17
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +24 -38
- package/src/components/ReanimatedTopTab/ReanimatedTabView.tsx +7 -6
- package/src/components/elements/TabBarBaseComponent.tsx +6 -2
- package/src/components/elements/TabBarLabelBaseComponent.tsx +3 -2
- package/src/components/wrappers/GestureWrapper.tsx +27 -29
- package/src/components/wrappers/ScreenWrapper.tsx +4 -3
- package/src/components/wrappers/ScrollView.tsx +33 -19
- package/src/context/Context.helpers.tsx +10 -0
- package/src/context/Context.hooks.ts +253 -0
- package/src/context/Context.tsx +69 -0
- package/src/hooks/useHeader.ts +30 -0
- package/src/hooks/useScreenGesture.ts +13 -0
- package/src/hooks/useScreenProperties.ts +11 -0
- package/src/hooks/useScreenScrollable.ts +69 -0
- package/src/hooks/useTabContext.ts +4 -0
- package/src/hooks/useTabOffset.ts +8 -0
- package/src/index.tsx +18 -8
- package/src/navigator/createReanimatedTopTabNavigator.tsx +8 -32
- package/src/services/Warning.service.ts +11 -0
- package/src/types.ts +23 -19
- package/lib/commonjs/context/TabContext.hooks.js +0 -48
- package/lib/commonjs/context/TabContext.hooks.js.map +0 -1
- package/lib/commonjs/context/TabContext.js +0 -86
- package/lib/commonjs/context/TabContext.js.map +0 -1
- package/lib/commonjs/hooks/Tab.hooks.js.map +0 -1
- package/lib/module/context/TabContext.hooks.js +0 -44
- package/lib/module/context/TabContext.hooks.js.map +0 -1
- package/lib/module/context/TabContext.js +0 -82
- package/lib/module/context/TabContext.js.map +0 -1
- package/lib/module/hooks/Tab.hooks.js +0 -121
- package/lib/module/hooks/Tab.hooks.js.map +0 -1
- package/lib/typescript/commonjs/src/components/ReanimatedTopTab/AnimationHelper.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/ReanimatedTopTab/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/elements/TabBarBaseComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/elements/TabBarLabelBaseComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/wrappers/GestureWrapper.d.ts +0 -2
- package/lib/typescript/commonjs/src/components/wrappers/GestureWrapper.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/wrappers/ScreenWrapper.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/components/wrappers/ScrollView.d.ts +0 -6
- package/lib/typescript/commonjs/src/components/wrappers/ScrollView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/context/TabContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/context/TabContext.hooks.d.ts +0 -5
- package/lib/typescript/commonjs/src/context/TabContext.hooks.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/Tab.hooks.d.ts +0 -33
- package/lib/typescript/commonjs/src/hooks/Tab.hooks.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/navigator/createReanimatedTopTabNavigator.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types.d.ts +0 -56
- package/lib/typescript/commonjs/src/types.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ReanimatedTopTab/AnimationHelper.d.ts +0 -11
- package/lib/typescript/module/src/components/ReanimatedTopTab/AnimationHelper.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts +0 -14
- package/lib/typescript/module/src/components/ReanimatedTopTab/ReanimatedTabView.d.ts.map +0 -1
- package/lib/typescript/module/src/components/ReanimatedTopTab/types.d.ts +0 -30
- package/lib/typescript/module/src/components/ReanimatedTopTab/types.d.ts.map +0 -1
- package/lib/typescript/module/src/components/elements/TabBarBaseComponent.d.ts +0 -23
- package/lib/typescript/module/src/components/elements/TabBarBaseComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/elements/TabBarLabelBaseComponent.d.ts +0 -7
- package/lib/typescript/module/src/components/elements/TabBarLabelBaseComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/components/wrappers/GestureWrapper.d.ts +0 -2
- package/lib/typescript/module/src/components/wrappers/GestureWrapper.d.ts.map +0 -1
- package/lib/typescript/module/src/components/wrappers/ScreenWrapper.d.ts +0 -6
- package/lib/typescript/module/src/components/wrappers/ScreenWrapper.d.ts.map +0 -1
- package/lib/typescript/module/src/components/wrappers/ScrollView.d.ts +0 -6
- package/lib/typescript/module/src/components/wrappers/ScrollView.d.ts.map +0 -1
- package/lib/typescript/module/src/context/TabContext.d.ts +0 -4
- package/lib/typescript/module/src/context/TabContext.d.ts.map +0 -1
- package/lib/typescript/module/src/context/TabContext.hooks.d.ts +0 -5
- package/lib/typescript/module/src/context/TabContext.hooks.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/Tab.hooks.d.ts +0 -33
- package/lib/typescript/module/src/hooks/Tab.hooks.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -35
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/navigator/createReanimatedTopTabNavigator.d.ts +0 -4
- package/lib/typescript/module/src/navigator/createReanimatedTopTabNavigator.d.ts.map +0 -1
- package/lib/typescript/module/src/types.d.ts.map +0 -1
- package/src/context/TabContext.hooks.ts +0 -55
- package/src/context/TabContext.tsx +0 -115
- package/src/hooks/Tab.hooks.ts +0 -127
- /package/lib/{typescript/commonjs → commonjs}/package.json +0 -0
- /package/lib/{typescript/module → module}/package.json +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ReanimatedTopTab/AnimationHelper.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ReanimatedTopTab/ReanimatedTabView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/ReanimatedTopTab/types.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/elements/TabBarBaseComponent.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/elements/TabBarLabelBaseComponent.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/components/wrappers/ScreenWrapper.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/navigator/createReanimatedTopTabNavigator.d.ts +0 -0
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { TabBarBaseComponent } from './components/elements/TabBarBaseComponent';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
import { type LayoutRectangle } from 'react-native';
|
|
5
|
-
import { type NativeGesture } from 'react-native-gesture-handler';
|
|
6
|
-
import { type SharedValue } from 'react-native-reanimated';
|
|
7
|
-
import { type StackNavigationOptions } from '@react-navigation/stack';
|
|
8
|
-
export declare namespace ReanimatedTopTabNavigation {
|
|
9
|
-
interface ContextType {
|
|
10
|
-
screenRefs: {
|
|
11
|
-
refs: {
|
|
12
|
-
current: Record<string, {
|
|
13
|
-
current: any;
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
setRef(key: string, ref: any): void;
|
|
17
|
-
};
|
|
18
|
-
closeOffset: SharedValue<number>;
|
|
19
|
-
config: string[];
|
|
20
|
-
currentScreenIndex: SharedValue<number>;
|
|
21
|
-
currentYPosition: SharedValue<number>;
|
|
22
|
-
gestureEnabled: SharedValue<boolean>;
|
|
23
|
-
headerHeight: SharedValue<number>;
|
|
24
|
-
navHeight: SharedValue<number>;
|
|
25
|
-
screenProperties: Record<string, {
|
|
26
|
-
innerLayout: SharedValue<LayoutRectangle>;
|
|
27
|
-
nativeGesture: NativeGesture;
|
|
28
|
-
outerLayout: SharedValue<LayoutRectangle>;
|
|
29
|
-
scrollY: SharedValue<number>;
|
|
30
|
-
}>;
|
|
31
|
-
topTabHeight: SharedValue<number>;
|
|
32
|
-
topTapNativeRef: NativeGesture;
|
|
33
|
-
transformationX: SharedValue<number>;
|
|
34
|
-
transformationY: SharedValue<number>;
|
|
35
|
-
}
|
|
36
|
-
interface TabViewNavigatorProps {
|
|
37
|
-
HeaderComponent?: React.ComponentType<Pick<ContextType, 'transformationY' | 'headerHeight'>>;
|
|
38
|
-
TabBarComponent?: typeof TabBarBaseComponent;
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
config?: string[];
|
|
41
|
-
initialRouteName?: string;
|
|
42
|
-
screenOptions?: StackNavigationOptions;
|
|
43
|
-
}
|
|
44
|
-
type TopTabContextProps = Pick<ContextType, 'screenProperties' | 'config'> & {
|
|
45
|
-
children: (props: ContextType) => React.ReactNode;
|
|
46
|
-
};
|
|
47
|
-
interface NavigationOptions {
|
|
48
|
-
tabBarLabel?: (props: {
|
|
49
|
-
focused: boolean;
|
|
50
|
-
index: number;
|
|
51
|
-
title: string;
|
|
52
|
-
}) => React.ReactNode;
|
|
53
|
-
title?: string;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,eAA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AED,UAAiB,qBAAqB;QACpC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CACnC,IAAI,CAAC,WAAW,EAAE,iBAAiB,GAAG,cAAc,CAAC,CACtD,CAAC;QACF,eAAe,CAAC,EAAE,OAAO,mBAAmB,CAAC;QAC7C,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,aAAa,CAAC,EAAE,sBAAsB,CAAC;KACxC;IAED,KAAY,kBAAkB,GAAG,IAAI,CACnC,WAAW,EACX,kBAAkB,GAAG,QAAQ,CAC9B,GAAG;QACF,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC;KACnD,CAAC;IAEF,UAAiB,iBAAiB;QAChC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;YACpB,OAAO,EAAE,OAAO,CAAC;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,KAAK,KAAK,CAAC,SAAS,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { GestureStateChangeEvent, GestureUpdateEvent, PanGestureChangeEventPayload, PanGestureHandlerEventPayload } from 'react-native-gesture-handler';
|
|
2
|
-
import type { ReanimatedTabViewTypes } from './types';
|
|
3
|
-
export declare const AnimationHelper: {
|
|
4
|
-
animation: (newValue: number, duration?: number) => number;
|
|
5
|
-
onChange: (event: GestureUpdateEvent<PanGestureHandlerEventPayload & PanGestureChangeEventPayload>, animationValue: number, width: number, navigationState: ReanimatedTabViewTypes.NavigationState) => number;
|
|
6
|
-
onEnd: (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>, minimumValueToChangeView: number, width: number, navigationState: ReanimatedTabViewTypes.NavigationState) => {
|
|
7
|
-
index: number;
|
|
8
|
-
value: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=AnimationHelper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationHelper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ReanimatedTopTab/AnimationHelper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAkFtD,eAAO,MAAM,eAAe;0BALC,MAAM;sBA1E1B,kBAAkB,CACvB,6BAA6B,GAAG,4BAA4B,CAC7D,kBACe,MAAM,SACf,MAAM,mBACI,sBAAsB,CAAC,eAAe;mBA6BhD,uBAAuB,CAAC,6BAA6B,CAAC,4BACnC,MAAM,SACzB,MAAM,mBACI,sBAAsB,CAAC,eAAe;;;;CA8CxD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ReanimatedTabViewTypes } from './types';
|
|
3
|
-
export interface ReanimatedTabViewProps {
|
|
4
|
-
LazyPlaceholder?: () => React.ReactNode;
|
|
5
|
-
lazy?: boolean;
|
|
6
|
-
navigationState: ReanimatedTabViewTypes.NavigationState;
|
|
7
|
-
onIndexChange: (index: number) => void;
|
|
8
|
-
percentageTrigger?: number;
|
|
9
|
-
positionInterpolation?: ReanimatedTabViewTypes.PositionInterpolation;
|
|
10
|
-
renderScene: (params: ReanimatedTabViewTypes.SceneProps) => React.ReactNode;
|
|
11
|
-
renderTabBar?: (params: ReanimatedTabViewTypes.RenderTabsParams) => React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export declare const ReanimatedTabView: React.NamedExoticComponent<ReanimatedTabViewProps>;
|
|
14
|
-
//# sourceMappingURL=ReanimatedTabView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReanimatedTabView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ReanimatedTopTab/ReanimatedTabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAiBvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,sBAAsB,CAAC,eAAe,CAAC;IACxD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;IACrE,WAAW,EAAE,CAAC,MAAM,EAAE,sBAAsB,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS,CAAC;IAC5E,YAAY,CAAC,EAAE,CACb,MAAM,EAAE,sBAAsB,CAAC,gBAAgB,KAC5C,KAAK,CAAC,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,iBAAiB,oDA6J7B,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SharedValue } from 'react-native-reanimated';
|
|
3
|
-
export declare namespace ReanimatedTabViewTypes {
|
|
4
|
-
interface Route {
|
|
5
|
-
key: string;
|
|
6
|
-
name: string;
|
|
7
|
-
tabBarLabel?: () => React.ReactNode;
|
|
8
|
-
title?: string;
|
|
9
|
-
}
|
|
10
|
-
type NavigationState = {
|
|
11
|
-
index: number;
|
|
12
|
-
routes: Route[];
|
|
13
|
-
};
|
|
14
|
-
interface RenderTabsParams {
|
|
15
|
-
navigationState: NavigationState;
|
|
16
|
-
position: SharedValue<number>;
|
|
17
|
-
}
|
|
18
|
-
interface SceneProps {
|
|
19
|
-
jumpTo?: (key: string) => void;
|
|
20
|
-
route: Route;
|
|
21
|
-
}
|
|
22
|
-
interface SceneMapRoutes {
|
|
23
|
-
[key: string]: React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
type PositionInterpolation = {
|
|
26
|
-
input: number[];
|
|
27
|
-
output: number[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ReanimatedTopTab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,KAAK;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;QACpC,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;IAED,KAAY,eAAe,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,CAAC;IAEjE,UAAiB,gBAAgB;QAC/B,eAAe,EAAE,eAAe,CAAC;QACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;KAC/B;IAED,UAAiB,UAAU;QACzB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAC/B,KAAK,EAAE,KAAK,CAAC;KACd;IAED,UAAiB,cAAc;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;KAChC;IAED,KAAY,qBAAqB,GAAG;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC3E"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type AnimatedStyle, type SharedValue } from 'react-native-reanimated';
|
|
3
|
-
export interface Route {
|
|
4
|
-
key: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
tabBarLabel?: () => React.ReactNode;
|
|
7
|
-
title?: string;
|
|
8
|
-
}
|
|
9
|
-
export type NavigationState = {
|
|
10
|
-
index: number;
|
|
11
|
-
routes: Route[];
|
|
12
|
-
};
|
|
13
|
-
export interface RenderTabsParams {
|
|
14
|
-
navigationState: NavigationState;
|
|
15
|
-
position: SharedValue<number>;
|
|
16
|
-
}
|
|
17
|
-
export interface TabBarProps extends RenderTabsParams {
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
navigate: (route: Route) => void;
|
|
20
|
-
style?: AnimatedStyle;
|
|
21
|
-
}
|
|
22
|
-
export declare const TabBarBaseComponent: ({ children, navigate, navigationState, position, style, }: TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
//# sourceMappingURL=TabBarBaseComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBaseComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/elements/TabBarBaseComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAmB,EACjB,KAAK,aAAa,EAElB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,8DAM7B,WAAW,4CA8Cb,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface TabBarLabelTypes {
|
|
2
|
-
focused: boolean;
|
|
3
|
-
index: number;
|
|
4
|
-
title: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const TabBarLabelBaseComponent: ({ index, ...props }: TabBarLabelTypes) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=TabBarLabelBaseComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarLabelBaseComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/components/elements/TabBarLabelBaseComponent.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,wBAAwB,wBAGlC,gBAAgB,4CAgClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GestureWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/wrappers/GestureWrapper.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,cAAc,iBAAkB,GAAG,4CAwH/C,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ViewProps } from 'react-native';
|
|
2
|
-
import { type AnimatedProps } from 'react-native-reanimated';
|
|
3
|
-
export interface ScreenWrapperProps extends AnimatedProps<Omit<ViewProps, 'onLayout'>> {
|
|
4
|
-
}
|
|
5
|
-
export declare const ScreenWrapper: ({ children, ...viewProps }: ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=ScreenWrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/wrappers/ScreenWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGzE,MAAM,WAAW,kBACf,SAAQ,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;CAAG;AAEvD,eAAO,MAAM,aAAa,+BAGvB,kBAAkB,4CAepB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ScrollViewProps } from 'react-native';
|
|
2
|
-
import { type AnimatedProps } from 'react-native-reanimated';
|
|
3
|
-
export interface ScreenWrapperProps extends AnimatedProps<Omit<ScrollViewProps, 'onScroll'>> {
|
|
4
|
-
}
|
|
5
|
-
export declare const ScrollView: ({ children, style, ...props }: ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=ScrollView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/wrappers/ScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAEtB,OAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUzE,MAAM,WAAW,kBACf,SAAQ,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;CAAG;AAE7D,eAAO,MAAM,UAAU,kCAIpB,kBAAkB,4CA6BpB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ReanimatedTopTabNavigation } from '../types';
|
|
2
|
-
export declare const Context: import("react").Context<ReanimatedTopTabNavigation.ContextType>;
|
|
3
|
-
export declare const Provider: import("react").MemoExoticComponent<({ children, config, screenProperties, }: ReanimatedTopTabNavigation.TopTabContextProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
-
//# sourceMappingURL=TabContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabContext.d.ts","sourceRoot":"","sources":["../../../../../src/context/TabContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAY3D,eAAO,MAAM,OAAO,iEAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ,gFAKhB,0BAA0B,CAAC,kBAAkB,6CA6FjD,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
2
|
-
export declare const TabContextHooks: {
|
|
3
|
-
useResetApproachingScreenScrollOffset: ({ screenRefs, transformationX, screenProperties, currentYPosition, }: Pick<ReanimatedTopTabNavigation.ContextType, "screenRefs" | "screenProperties" | "currentYPosition" | "transformationX">) => void;
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=TabContext.hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabContext.hooks.d.ts","sourceRoot":"","sources":["../../../../../src/context/TabContext.hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAmDvF,eAAO,MAAM,eAAe;kHA5CzB,IAAI,CACL,0BAA0B,CAAC,WAAW,EACtC,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,iBAAiB,CAC3E;CA2CA,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const useTabContext: () => import("..").ReanimatedTopTabNavigation.ContextType;
|
|
2
|
-
export declare const useScreenGesture: () => import("react-native-gesture-handler/lib/typescript/handlers/gestures/nativeGesture").NativeGesture;
|
|
3
|
-
export declare const useScreenScrollable: () => {
|
|
4
|
-
animatedProps: Partial<{
|
|
5
|
-
scrollEnabled: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
bounces: boolean;
|
|
8
|
-
contentContainerStyle: {
|
|
9
|
-
paddingBottom: number;
|
|
10
|
-
};
|
|
11
|
-
onScroll: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
12
|
-
style: {
|
|
13
|
-
minHeight: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare const useScreenProperties: () => {
|
|
17
|
-
innerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
18
|
-
nativeGesture: import("react-native-gesture-handler").NativeGesture;
|
|
19
|
-
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
20
|
-
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
21
|
-
};
|
|
22
|
-
export declare const useHeader: () => {
|
|
23
|
-
hideHeader: () => void;
|
|
24
|
-
};
|
|
25
|
-
export declare const useScreenRefs: (keys: string[]) => {
|
|
26
|
-
setRef: (key: string, ref: any) => void;
|
|
27
|
-
refs: {
|
|
28
|
-
current: Record<string, {
|
|
29
|
-
current: any;
|
|
30
|
-
}>;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=Tab.hooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.hooks.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/Tab.hooks.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,2DAazB,CAAC;AAEF,eAAO,MAAM,gBAAgB,2GAS5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CA+C/B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;CAO/B,CAAC;AAEF,eAAO,MAAM,SAAS;;CAQrB,CAAC;AAGF,eAAO,MAAM,aAAa,SAAU,MAAM,EAAE;kBAWrB,MAAM,OAAO,GAAG;;;qBAJD,GAAG;;;CASxC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export { type ReanimatedTopTabNavigation } from './types';
|
|
2
|
-
export { createReanimatedTopTabNavigator } from './navigator/createReanimatedTopTabNavigator';
|
|
3
|
-
export declare const TabHooks: {
|
|
4
|
-
useHeader: () => {
|
|
5
|
-
hideHeader: () => void;
|
|
6
|
-
};
|
|
7
|
-
useScreenProperties: () => {
|
|
8
|
-
innerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
9
|
-
nativeGesture: import("react-native-gesture-handler").NativeGesture;
|
|
10
|
-
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
11
|
-
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
12
|
-
};
|
|
13
|
-
useScreenScrollable: () => {
|
|
14
|
-
animatedProps: Partial<{
|
|
15
|
-
scrollEnabled: boolean;
|
|
16
|
-
}>;
|
|
17
|
-
bounces: boolean;
|
|
18
|
-
contentContainerStyle: {
|
|
19
|
-
paddingBottom: number;
|
|
20
|
-
};
|
|
21
|
-
onScroll: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
22
|
-
style: {
|
|
23
|
-
minHeight: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
useScreenGesture: () => import("react-native-gesture-handler/lib/typescript/handlers/gestures/nativeGesture").NativeGesture;
|
|
27
|
-
useTabContext: () => import("./types").ReanimatedTopTabNavigation.ContextType;
|
|
28
|
-
};
|
|
29
|
-
export declare const Tab: {
|
|
30
|
-
ScrollView: ({ children, style, ...props }: import("./components/wrappers/ScrollView").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
ScreenWrapper: ({ children, ...viewProps }: import("./components/wrappers/ScreenWrapper").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
TabBarBaseComponent: ({ children, navigate, navigationState, position, style, }: import("./components/elements/TabBarBaseComponent").TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
TabBarLabelBaseComponent: ({ index, ...props }: import("./components/elements/TabBarLabelBaseComponent").TabBarLabelTypes) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAE9F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;CAMpB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;CAKf,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ParamListBase, type TabNavigationState } from '@react-navigation/native';
|
|
2
|
-
import { type ReanimatedTopTabNavigation } from '../types';
|
|
3
|
-
export declare const createReanimatedTopTabNavigator: <Params extends ParamListBase>() => import("@react-navigation/core").TypedNavigator<ParamListBase, TabNavigationState<Params>, ReanimatedTopTabNavigation.NavigationOptions, {}, ({ HeaderComponent, TabBarComponent, children, config, initialRouteName, screenOptions, }: ReanimatedTopTabNavigation.TabViewNavigatorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
-
//# sourceMappingURL=createReanimatedTopTabNavigator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReanimatedTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../../src/navigator/createReanimatedTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa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@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { runOnJS, useAnimatedReaction } from 'react-native-reanimated';
|
|
2
|
-
import type { ReanimatedTopTabNavigation } from 'react-navigation-reanimated-top-tabs';
|
|
3
|
-
|
|
4
|
-
const useResetApproachingScreenScrollOffset = ({
|
|
5
|
-
screenRefs,
|
|
6
|
-
transformationX,
|
|
7
|
-
screenProperties,
|
|
8
|
-
currentYPosition,
|
|
9
|
-
}: Pick<
|
|
10
|
-
ReanimatedTopTabNavigation.ContextType,
|
|
11
|
-
'screenRefs' | 'screenProperties' | 'currentYPosition' | 'transformationX'
|
|
12
|
-
>) => {
|
|
13
|
-
const resetApproachingScreenOffset = (
|
|
14
|
-
index: number,
|
|
15
|
-
shouldReset: boolean
|
|
16
|
-
) => {
|
|
17
|
-
if (shouldReset) {
|
|
18
|
-
//NOTE: use reanimated scrollTo does not work
|
|
19
|
-
const { scrollTo } = Object.values(screenRefs.refs.current)[index]
|
|
20
|
-
?.current ?? { scrollTo: () => null };
|
|
21
|
-
|
|
22
|
-
scrollTo({ y: 0, animated: false });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
useAnimatedReaction(
|
|
27
|
-
() => transformationX.value,
|
|
28
|
-
(current, previous) => {
|
|
29
|
-
const approachingIndex = getTargetIndex(current, previous);
|
|
30
|
-
|
|
31
|
-
const approachingScreenOffset =
|
|
32
|
-
Object.values(screenProperties).map(({ scrollY }) => scrollY.value)[
|
|
33
|
-
approachingIndex
|
|
34
|
-
] ?? -1;
|
|
35
|
-
|
|
36
|
-
runOnJS(resetApproachingScreenOffset)(
|
|
37
|
-
approachingIndex,
|
|
38
|
-
approachingScreenOffset > 0 && currentYPosition.value === 0
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const getTargetIndex = (currentValue: number, previousValue: number | null) => {
|
|
45
|
-
'worklet';
|
|
46
|
-
if (currentValue > (previousValue ?? 0)) {
|
|
47
|
-
return Math.ceil(currentValue);
|
|
48
|
-
} else {
|
|
49
|
-
return Math.floor(currentValue);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const TabContextHooks = {
|
|
54
|
-
useResetApproachingScreenScrollOffset,
|
|
55
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { type ReanimatedTopTabNavigation } from '../types';
|
|
2
|
-
import { createContext, memo, useRef } from 'react';
|
|
3
|
-
import { Gesture } from 'react-native-gesture-handler';
|
|
4
|
-
import {
|
|
5
|
-
interpolate,
|
|
6
|
-
useAnimatedReaction,
|
|
7
|
-
useDerivedValue,
|
|
8
|
-
useSharedValue,
|
|
9
|
-
} from 'react-native-reanimated';
|
|
10
|
-
import { useScreenRefs } from '../hooks/Tab.hooks';
|
|
11
|
-
import { TabContextHooks } from './TabContext.hooks';
|
|
12
|
-
|
|
13
|
-
export const Context = createContext<ReanimatedTopTabNavigation.ContextType>(
|
|
14
|
-
{} as ReanimatedTopTabNavigation.ContextType
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export const Provider = memo(
|
|
18
|
-
({
|
|
19
|
-
children,
|
|
20
|
-
config,
|
|
21
|
-
screenProperties,
|
|
22
|
-
}: ReanimatedTopTabNavigation.TopTabContextProps) => {
|
|
23
|
-
const transformationY = useSharedValue(0);
|
|
24
|
-
const transformationX = useSharedValue(0);
|
|
25
|
-
const currentYPosition = useSharedValue(0);
|
|
26
|
-
|
|
27
|
-
const gestureEnabled = useSharedValue(true);
|
|
28
|
-
const currentScreenIndex = useSharedValue(0);
|
|
29
|
-
|
|
30
|
-
const navHeight = useSharedValue(0);
|
|
31
|
-
const headerHeight = useSharedValue(0);
|
|
32
|
-
const closeOffset = useSharedValue(0);
|
|
33
|
-
const topTabHeight = useSharedValue(0);
|
|
34
|
-
|
|
35
|
-
const topTapNativeRef = useRef(Gesture.Native()).current;
|
|
36
|
-
const screenRefs = useScreenRefs(Object.keys(screenProperties));
|
|
37
|
-
|
|
38
|
-
//Hide header base on config
|
|
39
|
-
const inputRange = useDerivedValue(
|
|
40
|
-
() => config.map((_, idx) => idx),
|
|
41
|
-
[config]
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const outputRange = useDerivedValue(
|
|
45
|
-
() =>
|
|
46
|
-
config.map((type) => {
|
|
47
|
-
switch (type) {
|
|
48
|
-
case 'normal':
|
|
49
|
-
return 0;
|
|
50
|
-
case 'minimalized':
|
|
51
|
-
return -headerHeight.value;
|
|
52
|
-
default:
|
|
53
|
-
return 0;
|
|
54
|
-
}
|
|
55
|
-
}),
|
|
56
|
-
[config]
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
useAnimatedReaction(
|
|
60
|
-
() => transformationX.value,
|
|
61
|
-
(value) => {
|
|
62
|
-
if (currentYPosition.value === -headerHeight.value) return;
|
|
63
|
-
transformationY.value = interpolate(
|
|
64
|
-
value,
|
|
65
|
-
inputRange.value,
|
|
66
|
-
outputRange.value,
|
|
67
|
-
'clamp'
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
TabContextHooks.useResetApproachingScreenScrollOffset({
|
|
73
|
-
screenRefs,
|
|
74
|
-
currentYPosition,
|
|
75
|
-
screenProperties,
|
|
76
|
-
transformationX,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<Context.Provider
|
|
81
|
-
value={{
|
|
82
|
-
closeOffset,
|
|
83
|
-
config,
|
|
84
|
-
currentScreenIndex,
|
|
85
|
-
currentYPosition,
|
|
86
|
-
gestureEnabled,
|
|
87
|
-
headerHeight,
|
|
88
|
-
navHeight,
|
|
89
|
-
screenProperties,
|
|
90
|
-
topTabHeight,
|
|
91
|
-
topTapNativeRef,
|
|
92
|
-
transformationX,
|
|
93
|
-
transformationY,
|
|
94
|
-
screenRefs,
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
{children({
|
|
98
|
-
screenRefs,
|
|
99
|
-
closeOffset,
|
|
100
|
-
config,
|
|
101
|
-
currentScreenIndex,
|
|
102
|
-
currentYPosition,
|
|
103
|
-
gestureEnabled,
|
|
104
|
-
headerHeight,
|
|
105
|
-
navHeight,
|
|
106
|
-
screenProperties,
|
|
107
|
-
topTabHeight,
|
|
108
|
-
topTapNativeRef,
|
|
109
|
-
transformationX,
|
|
110
|
-
transformationY,
|
|
111
|
-
})}
|
|
112
|
-
</Context.Provider>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
package/src/hooks/Tab.hooks.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { useRoute } from '@react-navigation/native';
|
|
2
|
-
import { Context } from '../context/TabContext';
|
|
3
|
-
import { useContext } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
useAnimatedProps,
|
|
6
|
-
useAnimatedScrollHandler,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
useDerivedValue,
|
|
9
|
-
withTiming,
|
|
10
|
-
} from 'react-native-reanimated';
|
|
11
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
|
-
import { useWindowDimensions } from 'react-native';
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { HeaderHeightContext } from '@react-navigation/elements';
|
|
15
|
-
|
|
16
|
-
export const useTabContext = () => {
|
|
17
|
-
if (__DEV__) {
|
|
18
|
-
const stack = new Error().stack;
|
|
19
|
-
const isOutsideLibrary =
|
|
20
|
-
stack && !stack.includes('react-navigation-reanimated-top-tabs');
|
|
21
|
-
|
|
22
|
-
if (isOutsideLibrary) {
|
|
23
|
-
console.warn(
|
|
24
|
-
'[react-navigation-reanimated-top-tabs]: You are directly using the tab context, which may lead to unexpected behavior. Please use the provided hooks or API for better stability.'
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return useContext(Context);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const useScreenGesture = () => {
|
|
32
|
-
const { key } = useRoute();
|
|
33
|
-
const { screenProperties } = useTabContext();
|
|
34
|
-
|
|
35
|
-
const nativeRef = screenProperties[key]?.nativeGesture;
|
|
36
|
-
|
|
37
|
-
if (!nativeRef) throw 'GestureRef does not exist for this route';
|
|
38
|
-
|
|
39
|
-
return nativeRef;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const useScreenScrollable = () => {
|
|
43
|
-
const { key } = useRoute();
|
|
44
|
-
const { height } = useWindowDimensions();
|
|
45
|
-
const { bottom, top } = useSafeAreaInsets();
|
|
46
|
-
const {
|
|
47
|
-
currentYPosition,
|
|
48
|
-
gestureEnabled,
|
|
49
|
-
headerHeight,
|
|
50
|
-
screenProperties,
|
|
51
|
-
topTabHeight,
|
|
52
|
-
transformationY,
|
|
53
|
-
} = useTabContext();
|
|
54
|
-
|
|
55
|
-
const navigationHeader = React.useContext(HeaderHeightContext) ?? 0;
|
|
56
|
-
|
|
57
|
-
const animatedProps = useAnimatedProps(() => ({
|
|
58
|
-
scrollEnabled:
|
|
59
|
-
!gestureEnabled.value || currentYPosition.value === -headerHeight.value,
|
|
60
|
-
}));
|
|
61
|
-
|
|
62
|
-
const onScroll = useAnimatedScrollHandler(({ contentOffset }) => {
|
|
63
|
-
const scrollPosition = screenProperties[key]?.scrollY;
|
|
64
|
-
if (!scrollPosition)
|
|
65
|
-
throw 'ScrollPosition property does not exist for this route';
|
|
66
|
-
scrollPosition.value = contentOffset.y;
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const oppositeHeaderState = useDerivedValue(() =>
|
|
70
|
-
transformationY.value >= 0 ? headerHeight.value : 0
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
const style = useAnimatedStyle(() => ({
|
|
74
|
-
minHeight:
|
|
75
|
-
height -
|
|
76
|
-
top -
|
|
77
|
-
topTabHeight.value -
|
|
78
|
-
oppositeHeaderState.value -
|
|
79
|
-
navigationHeader,
|
|
80
|
-
}));
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
animatedProps,
|
|
84
|
-
bounces: false,
|
|
85
|
-
contentContainerStyle: { paddingBottom: bottom },
|
|
86
|
-
onScroll,
|
|
87
|
-
style,
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const useScreenProperties = () => {
|
|
92
|
-
const { key } = useRoute();
|
|
93
|
-
const { screenProperties } = useTabContext();
|
|
94
|
-
const screen = screenProperties[key];
|
|
95
|
-
if (!screen) throw 'No screen properties registered for this route';
|
|
96
|
-
|
|
97
|
-
return screen;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const useHeader = () => {
|
|
101
|
-
const { headerHeight, transformationX } = useTabContext();
|
|
102
|
-
|
|
103
|
-
const hideHeader = () => {
|
|
104
|
-
transformationX.value = withTiming(-headerHeight.value);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
return { hideHeader };
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
//TODO: make it private
|
|
111
|
-
export const useScreenRefs = (keys: string[]) => {
|
|
112
|
-
const refs = {
|
|
113
|
-
current: keys.reduce(
|
|
114
|
-
(prev, key) => ({
|
|
115
|
-
...prev,
|
|
116
|
-
[key]: { current: null },
|
|
117
|
-
}),
|
|
118
|
-
{} as Record<string, { current: any }>
|
|
119
|
-
),
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const setRef = (key: string, ref: any) => {
|
|
123
|
-
refs.current = { ...refs.current, [key]: ref };
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
return { setRef, refs };
|
|
127
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/lib/typescript/{commonjs/src → src}/components/ReanimatedTopTab/AnimationHelper.d.ts
RENAMED
|
File without changes
|
/package/lib/typescript/{commonjs/src → src}/components/ReanimatedTopTab/ReanimatedTabView.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/typescript/{commonjs/src → src}/components/elements/TabBarLabelBaseComponent.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|