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
package/src/types.ts
CHANGED
|
@@ -3,15 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
4
|
import { type LayoutRectangle } from 'react-native';
|
|
5
5
|
import { type NativeGesture } from 'react-native-gesture-handler';
|
|
6
|
-
import { type SharedValue } from 'react-native-reanimated';
|
|
6
|
+
import Reanimated, { type SharedValue } from 'react-native-reanimated';
|
|
7
7
|
import { type StackNavigationOptions } from '@react-navigation/stack';
|
|
8
8
|
|
|
9
9
|
export namespace ReanimatedTopTabNavigation {
|
|
10
10
|
export interface ContextType {
|
|
11
|
-
screenRefs: {
|
|
12
|
-
refs: { current: Record<string, { current: any }> };
|
|
13
|
-
setRef(key: string, ref: any): void;
|
|
14
|
-
};
|
|
15
11
|
closeOffset: SharedValue<number>;
|
|
16
12
|
config: string[];
|
|
17
13
|
currentScreenIndex: SharedValue<number>;
|
|
@@ -19,19 +15,30 @@ export namespace ReanimatedTopTabNavigation {
|
|
|
19
15
|
gestureEnabled: SharedValue<boolean>;
|
|
20
16
|
headerHeight: SharedValue<number>;
|
|
21
17
|
navHeight: SharedValue<number>;
|
|
22
|
-
screenProperties: Record<
|
|
23
|
-
string,
|
|
24
|
-
{
|
|
25
|
-
innerLayout: SharedValue<LayoutRectangle>;
|
|
26
|
-
nativeGesture: NativeGesture;
|
|
27
|
-
outerLayout: SharedValue<LayoutRectangle>;
|
|
28
|
-
scrollY: SharedValue<number>;
|
|
29
|
-
}
|
|
30
|
-
>;
|
|
31
18
|
topTabHeight: SharedValue<number>;
|
|
32
|
-
|
|
19
|
+
topTabNativeGesture: NativeGesture;
|
|
33
20
|
transformationX: SharedValue<number>;
|
|
34
21
|
transformationY: SharedValue<number>;
|
|
22
|
+
context: {
|
|
23
|
+
screen: {
|
|
24
|
+
properties: Record<
|
|
25
|
+
string,
|
|
26
|
+
{
|
|
27
|
+
innerLayout: SharedValue<LayoutRectangle>;
|
|
28
|
+
nativeGesture: NativeGesture;
|
|
29
|
+
outerLayout: SharedValue<LayoutRectangle>;
|
|
30
|
+
scrollY: SharedValue<number>;
|
|
31
|
+
scrollRef: { current: Reanimated.ScrollView | null };
|
|
32
|
+
}
|
|
33
|
+
>;
|
|
34
|
+
setRef(key: string, ref: Reanimated.ScrollView | null): void;
|
|
35
|
+
getRef(key: string): { current: Reanimated.ScrollView | null };
|
|
36
|
+
};
|
|
37
|
+
route: {
|
|
38
|
+
map: Record<number, string>;
|
|
39
|
+
getKeyForIndex(index: number): string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
export interface TabViewNavigatorProps {
|
|
@@ -45,10 +52,7 @@ export namespace ReanimatedTopTabNavigation {
|
|
|
45
52
|
screenOptions?: StackNavigationOptions;
|
|
46
53
|
}
|
|
47
54
|
|
|
48
|
-
export type TopTabContextProps = Pick<
|
|
49
|
-
ContextType,
|
|
50
|
-
'screenProperties' | 'config'
|
|
51
|
-
> & {
|
|
55
|
+
export type TopTabContextProps = Pick<ContextType, 'config' | 'context'> & {
|
|
52
56
|
children: (props: ContextType) => React.ReactNode;
|
|
53
57
|
};
|
|
54
58
|
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TabContextHooks = void 0;
|
|
7
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
-
const useResetApproachingScreenScrollOffset = ({
|
|
9
|
-
screenRefs,
|
|
10
|
-
transformationX,
|
|
11
|
-
screenProperties,
|
|
12
|
-
currentYPosition
|
|
13
|
-
}) => {
|
|
14
|
-
const resetApproachingScreenOffset = (index, shouldReset) => {
|
|
15
|
-
if (shouldReset) {
|
|
16
|
-
//NOTE: use reanimated scrollTo does not work
|
|
17
|
-
const {
|
|
18
|
-
scrollTo
|
|
19
|
-
} = Object.values(screenRefs.refs.current)[index]?.current ?? {
|
|
20
|
-
scrollTo: () => null
|
|
21
|
-
};
|
|
22
|
-
scrollTo({
|
|
23
|
-
y: 0,
|
|
24
|
-
animated: false
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
(0, _reactNativeReanimated.useAnimatedReaction)(() => transformationX.value, (current, previous) => {
|
|
29
|
-
const approachingIndex = getTargetIndex(current, previous);
|
|
30
|
-
const approachingScreenOffset = Object.values(screenProperties).map(({
|
|
31
|
-
scrollY
|
|
32
|
-
}) => scrollY.value)[approachingIndex] ?? -1;
|
|
33
|
-
(0, _reactNativeReanimated.runOnJS)(resetApproachingScreenOffset)(approachingIndex, approachingScreenOffset > 0 && currentYPosition.value === 0);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const getTargetIndex = (currentValue, previousValue) => {
|
|
37
|
-
'worklet';
|
|
38
|
-
|
|
39
|
-
if (currentValue > (previousValue ?? 0)) {
|
|
40
|
-
return Math.ceil(currentValue);
|
|
41
|
-
} else {
|
|
42
|
-
return Math.floor(currentValue);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const TabContextHooks = exports.TabContextHooks = {
|
|
46
|
-
useResetApproachingScreenScrollOffset
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=TabContext.hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeReanimated","require","useResetApproachingScreenScrollOffset","screenRefs","transformationX","screenProperties","currentYPosition","resetApproachingScreenOffset","index","shouldReset","scrollTo","Object","values","refs","current","y","animated","useAnimatedReaction","value","previous","approachingIndex","getTargetIndex","approachingScreenOffset","map","scrollY","runOnJS","currentValue","previousValue","Math","ceil","floor","TabContextHooks","exports"],"sourceRoot":"../../../src","sources":["context/TabContext.hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAGA,MAAMC,qCAAqC,GAAGA,CAAC;EAC7CC,UAAU;EACVC,eAAe;EACfC,gBAAgB;EAChBC;AAIF,CAAC,KAAK;EACJ,MAAMC,4BAA4B,GAAGA,CACnCC,KAAa,EACbC,WAAoB,KACjB;IACH,IAAIA,WAAW,EAAE;MACf;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGC,MAAM,CAACC,MAAM,CAACT,UAAU,CAACU,IAAI,CAACC,OAAO,CAAC,CAACN,KAAK,CAAC,EAC9DM,OAAO,IAAI;QAAEJ,QAAQ,EAAEA,CAAA,KAAM;MAAK,CAAC;MAEvCA,QAAQ,CAAC;QAAEK,CAAC,EAAE,CAAC;QAAEC,QAAQ,EAAE;MAAM,CAAC,CAAC;IACrC;EACF,CAAC;EAED,IAAAC,0CAAmB,EACjB,MAAMb,eAAe,CAACc,KAAK,EAC3B,CAACJ,OAAO,EAAEK,QAAQ,KAAK;IACrB,MAAMC,gBAAgB,GAAGC,cAAc,CAACP,OAAO,EAAEK,QAAQ,CAAC;IAE1D,MAAMG,uBAAuB,GAC3BX,MAAM,CAACC,MAAM,CAACP,gBAAgB,CAAC,CAACkB,GAAG,CAAC,CAAC;MAAEC;IAAQ,CAAC,KAAKA,OAAO,CAACN,KAAK,CAAC,CACjEE,gBAAgB,CACjB,IAAI,CAAC,CAAC;IAET,IAAAK,8BAAO,EAAClB,4BAA4B,CAAC,CACnCa,gBAAgB,EAChBE,uBAAuB,GAAG,CAAC,IAAIhB,gBAAgB,CAACY,KAAK,KAAK,CAC5D,CAAC;EACH,CACF,CAAC;AACH,CAAC;AAED,MAAMG,cAAc,GAAGA,CAACK,YAAoB,EAAEC,aAA4B,KAAK;EAC7E,SAAS;;EACT,IAAID,YAAY,IAAIC,aAAa,IAAI,CAAC,CAAC,EAAE;IACvC,OAAOC,IAAI,CAACC,IAAI,CAACH,YAAY,CAAC;EAChC,CAAC,MAAM;IACL,OAAOE,IAAI,CAACE,KAAK,CAACJ,YAAY,CAAC;EACjC;AACF,CAAC;AAEM,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC7B7B;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Provider = exports.Context = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
9
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
10
|
-
var _TabHooks = require("../hooks/Tab.hooks.js");
|
|
11
|
-
var _TabContextHooks = require("./TabContext.hooks.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
const Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({});
|
|
14
|
-
const Provider = exports.Provider = /*#__PURE__*/(0, _react.memo)(({
|
|
15
|
-
children,
|
|
16
|
-
config,
|
|
17
|
-
screenProperties
|
|
18
|
-
}) => {
|
|
19
|
-
const transformationY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
20
|
-
const transformationX = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
21
|
-
const currentYPosition = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
22
|
-
const gestureEnabled = (0, _reactNativeReanimated.useSharedValue)(true);
|
|
23
|
-
const currentScreenIndex = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
24
|
-
const navHeight = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
25
|
-
const headerHeight = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
26
|
-
const closeOffset = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
27
|
-
const topTabHeight = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
28
|
-
const topTapNativeRef = (0, _react.useRef)(_reactNativeGestureHandler.Gesture.Native()).current;
|
|
29
|
-
const screenRefs = (0, _TabHooks.useScreenRefs)(Object.keys(screenProperties));
|
|
30
|
-
|
|
31
|
-
//Hide header base on config
|
|
32
|
-
const inputRange = (0, _reactNativeReanimated.useDerivedValue)(() => config.map((_, idx) => idx), [config]);
|
|
33
|
-
const outputRange = (0, _reactNativeReanimated.useDerivedValue)(() => config.map(type => {
|
|
34
|
-
switch (type) {
|
|
35
|
-
case 'normal':
|
|
36
|
-
return 0;
|
|
37
|
-
case 'minimalized':
|
|
38
|
-
return -headerHeight.value;
|
|
39
|
-
default:
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
}), [config]);
|
|
43
|
-
(0, _reactNativeReanimated.useAnimatedReaction)(() => transformationX.value, value => {
|
|
44
|
-
if (currentYPosition.value === -headerHeight.value) return;
|
|
45
|
-
transformationY.value = (0, _reactNativeReanimated.interpolate)(value, inputRange.value, outputRange.value, 'clamp');
|
|
46
|
-
});
|
|
47
|
-
_TabContextHooks.TabContextHooks.useResetApproachingScreenScrollOffset({
|
|
48
|
-
screenRefs,
|
|
49
|
-
currentYPosition,
|
|
50
|
-
screenProperties,
|
|
51
|
-
transformationX
|
|
52
|
-
});
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Context.Provider, {
|
|
54
|
-
value: {
|
|
55
|
-
closeOffset,
|
|
56
|
-
config,
|
|
57
|
-
currentScreenIndex,
|
|
58
|
-
currentYPosition,
|
|
59
|
-
gestureEnabled,
|
|
60
|
-
headerHeight,
|
|
61
|
-
navHeight,
|
|
62
|
-
screenProperties,
|
|
63
|
-
topTabHeight,
|
|
64
|
-
topTapNativeRef,
|
|
65
|
-
transformationX,
|
|
66
|
-
transformationY,
|
|
67
|
-
screenRefs
|
|
68
|
-
},
|
|
69
|
-
children: children({
|
|
70
|
-
screenRefs,
|
|
71
|
-
closeOffset,
|
|
72
|
-
config,
|
|
73
|
-
currentScreenIndex,
|
|
74
|
-
currentYPosition,
|
|
75
|
-
gestureEnabled,
|
|
76
|
-
headerHeight,
|
|
77
|
-
navHeight,
|
|
78
|
-
screenProperties,
|
|
79
|
-
topTabHeight,
|
|
80
|
-
topTapNativeRef,
|
|
81
|
-
transformationX,
|
|
82
|
-
transformationY
|
|
83
|
-
})
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=TabContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeGestureHandler","_reactNativeReanimated","_TabHooks","_TabContextHooks","_jsxRuntime","Context","exports","createContext","Provider","memo","children","config","screenProperties","transformationY","useSharedValue","transformationX","currentYPosition","gestureEnabled","currentScreenIndex","navHeight","headerHeight","closeOffset","topTabHeight","topTapNativeRef","useRef","Gesture","Native","current","screenRefs","useScreenRefs","Object","keys","inputRange","useDerivedValue","map","_","idx","outputRange","type","value","useAnimatedReaction","interpolate","TabContextHooks","useResetApproachingScreenScrollOffset","jsx"],"sourceRoot":"../../../src","sources":["context/TabContext.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAMA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;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,QAAQA,IAAI;MACV,KAAK,QAAQ;QACX,OAAO,CAAC;MACV,KAAK,aAAa;QAChB,OAAO,CAAClB,YAAY,CAACmB,KAAK;MAC5B;QACE,OAAO,CAAC;IACZ;EACF,CAAC,CAAC,EACJ,CAAC5B,MAAM,CACT,CAAC;EAED,IAAA6B,0CAAmB,EACjB,MAAMzB,eAAe,CAACwB,KAAK,EAC1BA,KAAK,IAAK;IACT,IAAIvB,gBAAgB,CAACuB,KAAK,KAAK,CAACnB,YAAY,CAACmB,KAAK,EAAE;IACpD1B,eAAe,CAAC0B,KAAK,GAAG,IAAAE,kCAAW,EACjCF,KAAK,EACLP,UAAU,CAACO,KAAK,EAChBF,WAAW,CAACE,KAAK,EACjB,OACF,CAAC;EACH,CACF,CAAC;EAEDG,gCAAe,CAACC,qCAAqC,CAAC;IACpDf,UAAU;IACVZ,gBAAgB;IAChBJ,gBAAgB;IAChBG;EACF,CAAC,CAAC;EAEF,oBACE,IAAAX,WAAA,CAAAwC,GAAA,EAACvC,OAAO,CAACG,QAAQ;IACf+B,KAAK,EAAE;MACLlB,WAAW;MACXV,MAAM;MACNO,kBAAkB;MAClBF,gBAAgB;MAChBC,cAAc;MACdG,YAAY;MACZD,SAAS;MACTP,gBAAgB;MAChBU,YAAY;MACZC,eAAe;MACfR,eAAe;MACfF,eAAe;MACfe;IACF,CAAE;IAAAlB,QAAA,EAEDA,QAAQ,CAAC;MACRkB,UAAU;MACVP,WAAW;MACXV,MAAM;MACNO,kBAAkB;MAClBF,gBAAgB;MAChBC,cAAc;MACdG,YAAY;MACZD,SAAS;MACTP,gBAAgB;MAChBU,YAAY;MACZC,eAAe;MACfR,eAAe;MACfF;IACF,CAAC;EAAC,CACc,CAAC;AAEvB,CACF,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_native","require","_TabContext","_react","_interopRequireWildcard","React","_reactNativeReanimated","_reactNativeSafeAreaContext","_reactNative","_elements","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useTabContext","__DEV__","stack","Error","isOutsideLibrary","includes","console","warn","useContext","Context","exports","useScreenGesture","key","useRoute","screenProperties","nativeRef","nativeGesture","useScreenScrollable","height","useWindowDimensions","bottom","top","useSafeAreaInsets","currentYPosition","gestureEnabled","headerHeight","topTabHeight","transformationY","navigationHeader","HeaderHeightContext","animatedProps","useAnimatedProps","scrollEnabled","value","onScroll","useAnimatedScrollHandler","contentOffset","scrollPosition","scrollY","y","oppositeHeaderState","useDerivedValue","style","useAnimatedStyle","minHeight","bounces","contentContainerStyle","paddingBottom","useScreenProperties","screen","useHeader","transformationX","hideHeader","withTiming","useScreenRefs","keys","refs","current","reduce","prev","setRef","ref"],"sourceRoot":"../../../src","sources":["hooks/Tab.hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAmC,IAAAI,KAAA,GAAAF,MAAA;AACnC,IAAAG,sBAAA,GAAAL,OAAA;AAOA,IAAAM,2BAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAEA,IAAAQ,SAAA,GAAAR,OAAA;AAAiE,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAA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O,EAAE;MAAK;IACzB,CAAC,CAAC,EACF,CAAC,CACH;EACF,CAAC;EAED,MAAMG,MAAM,GAAGA,CAAChD,GAAW,EAAEiD,GAAQ,KAAK;IACxCL,IAAI,CAACC,OAAO,GAAG;MAAE,GAAGD,IAAI,CAACC,OAAO;MAAE,CAAC7C,GAAG,GAAGiD;IAAI,CAAC;EAChD,CAAC;EAED,OAAO;IAAED,MAAM;IAAEJ;EAAK,CAAC;AACzB,CAAC;AAAC9C,OAAA,CAAA4C,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { runOnJS, useAnimatedReaction } from 'react-native-reanimated';
|
|
4
|
-
const useResetApproachingScreenScrollOffset = ({
|
|
5
|
-
screenRefs,
|
|
6
|
-
transformationX,
|
|
7
|
-
screenProperties,
|
|
8
|
-
currentYPosition
|
|
9
|
-
}) => {
|
|
10
|
-
const resetApproachingScreenOffset = (index, shouldReset) => {
|
|
11
|
-
if (shouldReset) {
|
|
12
|
-
//NOTE: use reanimated scrollTo does not work
|
|
13
|
-
const {
|
|
14
|
-
scrollTo
|
|
15
|
-
} = Object.values(screenRefs.refs.current)[index]?.current ?? {
|
|
16
|
-
scrollTo: () => null
|
|
17
|
-
};
|
|
18
|
-
scrollTo({
|
|
19
|
-
y: 0,
|
|
20
|
-
animated: false
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
useAnimatedReaction(() => transformationX.value, (current, previous) => {
|
|
25
|
-
const approachingIndex = getTargetIndex(current, previous);
|
|
26
|
-
const approachingScreenOffset = Object.values(screenProperties).map(({
|
|
27
|
-
scrollY
|
|
28
|
-
}) => scrollY.value)[approachingIndex] ?? -1;
|
|
29
|
-
runOnJS(resetApproachingScreenOffset)(approachingIndex, approachingScreenOffset > 0 && currentYPosition.value === 0);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
const getTargetIndex = (currentValue, previousValue) => {
|
|
33
|
-
'worklet';
|
|
34
|
-
|
|
35
|
-
if (currentValue > (previousValue ?? 0)) {
|
|
36
|
-
return Math.ceil(currentValue);
|
|
37
|
-
} else {
|
|
38
|
-
return Math.floor(currentValue);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export const TabContextHooks = {
|
|
42
|
-
useResetApproachingScreenScrollOffset
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=TabContext.hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["runOnJS","useAnimatedReaction","useResetApproachingScreenScrollOffset","screenRefs","transformationX","screenProperties","currentYPosition","resetApproachingScreenOffset","index","shouldReset","scrollTo","Object","values","refs","current","y","animated","value","previous","approachingIndex","getTargetIndex","approachingScreenOffset","map","scrollY","currentValue","previousValue","Math","ceil","floor","TabContextHooks"],"sourceRoot":"../../../src","sources":["context/TabContext.hooks.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,mBAAmB,QAAQ,yBAAyB;AAGtE,MAAMC,qCAAqC,GAAGA,CAAC;EAC7CC,UAAU;EACVC,eAAe;EACfC,gBAAgB;EAChBC;AAIF,CAAC,KAAK;EACJ,MAAMC,4BAA4B,GAAGA,CACnCC,KAAa,EACbC,WAAoB,KACjB;IACH,IAAIA,WAAW,EAAE;MACf;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGC,MAAM,CAACC,MAAM,CAACT,UAAU,CAACU,IAAI,CAACC,OAAO,CAAC,CAACN,KAAK,CAAC,EAC9DM,OAAO,IAAI;QAAEJ,QAAQ,EAAEA,CAAA,KAAM;MAAK,CAAC;MAEvCA,QAAQ,CAAC;QAAEK,CAAC,EAAE,CAAC;QAAEC,QAAQ,EAAE;MAAM,CAAC,CAAC;IACrC;EACF,CAAC;EAEDf,mBAAmB,CACjB,MAAMG,eAAe,CAACa,KAAK,EAC3B,CAACH,OAAO,EAAEI,QAAQ,KAAK;IACrB,MAAMC,gBAAgB,GAAGC,cAAc,CAACN,OAAO,EAAEI,QAAQ,CAAC;IAE1D,MAAMG,uBAAuB,GAC3BV,MAAM,CAACC,MAAM,CAACP,gBAAgB,CAAC,CAACiB,GAAG,CAAC,CAAC;MAAEC;IAAQ,CAAC,KAAKA,OAAO,CAACN,KAAK,CAAC,CACjEE,gBAAgB,CACjB,IAAI,CAAC,CAAC;IAETnB,OAAO,CAACO,4BAA4B,CAAC,CACnCY,gBAAgB,EAChBE,uBAAuB,GAAG,CAAC,IAAIf,gBAAgB,CAACW,KAAK,KAAK,CAC5D,CAAC;EACH,CACF,CAAC;AACH,CAAC;AAED,MAAMG,cAAc,GAAGA,CAACI,YAAoB,EAAEC,aAA4B,KAAK;EAC7E,SAAS;;EACT,IAAID,YAAY,IAAIC,aAAa,IAAI,CAAC,CAAC,EAAE;IACvC,OAAOC,IAAI,CAACC,IAAI,CAACH,YAAY,CAAC;EAChC,CAAC,MAAM;IACL,OAAOE,IAAI,CAACE,KAAK,CAACJ,YAAY,CAAC;EACjC;AACF,CAAC;AAED,OAAO,MAAMK,eAAe,GAAG;EAC7B3B;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { createContext, memo, useRef } from 'react';
|
|
4
|
-
import { Gesture } from 'react-native-gesture-handler';
|
|
5
|
-
import { interpolate, useAnimatedReaction, useDerivedValue, useSharedValue } from 'react-native-reanimated';
|
|
6
|
-
import { useScreenRefs } from "../hooks/Tab.hooks.js";
|
|
7
|
-
import { TabContextHooks } from "./TabContext.hooks.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const Context = /*#__PURE__*/createContext({});
|
|
10
|
-
export const Provider = /*#__PURE__*/memo(({
|
|
11
|
-
children,
|
|
12
|
-
config,
|
|
13
|
-
screenProperties
|
|
14
|
-
}) => {
|
|
15
|
-
const transformationY = useSharedValue(0);
|
|
16
|
-
const transformationX = useSharedValue(0);
|
|
17
|
-
const currentYPosition = useSharedValue(0);
|
|
18
|
-
const gestureEnabled = useSharedValue(true);
|
|
19
|
-
const currentScreenIndex = useSharedValue(0);
|
|
20
|
-
const navHeight = useSharedValue(0);
|
|
21
|
-
const headerHeight = useSharedValue(0);
|
|
22
|
-
const closeOffset = useSharedValue(0);
|
|
23
|
-
const topTabHeight = useSharedValue(0);
|
|
24
|
-
const topTapNativeRef = useRef(Gesture.Native()).current;
|
|
25
|
-
const screenRefs = useScreenRefs(Object.keys(screenProperties));
|
|
26
|
-
|
|
27
|
-
//Hide header base on config
|
|
28
|
-
const inputRange = useDerivedValue(() => config.map((_, idx) => idx), [config]);
|
|
29
|
-
const outputRange = useDerivedValue(() => config.map(type => {
|
|
30
|
-
switch (type) {
|
|
31
|
-
case 'normal':
|
|
32
|
-
return 0;
|
|
33
|
-
case 'minimalized':
|
|
34
|
-
return -headerHeight.value;
|
|
35
|
-
default:
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
38
|
-
}), [config]);
|
|
39
|
-
useAnimatedReaction(() => transformationX.value, value => {
|
|
40
|
-
if (currentYPosition.value === -headerHeight.value) return;
|
|
41
|
-
transformationY.value = interpolate(value, inputRange.value, outputRange.value, 'clamp');
|
|
42
|
-
});
|
|
43
|
-
TabContextHooks.useResetApproachingScreenScrollOffset({
|
|
44
|
-
screenRefs,
|
|
45
|
-
currentYPosition,
|
|
46
|
-
screenProperties,
|
|
47
|
-
transformationX
|
|
48
|
-
});
|
|
49
|
-
return /*#__PURE__*/_jsx(Context.Provider, {
|
|
50
|
-
value: {
|
|
51
|
-
closeOffset,
|
|
52
|
-
config,
|
|
53
|
-
currentScreenIndex,
|
|
54
|
-
currentYPosition,
|
|
55
|
-
gestureEnabled,
|
|
56
|
-
headerHeight,
|
|
57
|
-
navHeight,
|
|
58
|
-
screenProperties,
|
|
59
|
-
topTabHeight,
|
|
60
|
-
topTapNativeRef,
|
|
61
|
-
transformationX,
|
|
62
|
-
transformationY,
|
|
63
|
-
screenRefs
|
|
64
|
-
},
|
|
65
|
-
children: children({
|
|
66
|
-
screenRefs,
|
|
67
|
-
closeOffset,
|
|
68
|
-
config,
|
|
69
|
-
currentScreenIndex,
|
|
70
|
-
currentYPosition,
|
|
71
|
-
gestureEnabled,
|
|
72
|
-
headerHeight,
|
|
73
|
-
navHeight,
|
|
74
|
-
screenProperties,
|
|
75
|
-
topTabHeight,
|
|
76
|
-
topTapNativeRef,
|
|
77
|
-
transformationX,
|
|
78
|
-
transformationY
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=TabContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","memo","useRef","Gesture","interpolate","useAnimatedReaction","useDerivedValue","useSharedValue","useScreenRefs","TabContextHooks","jsx","_jsx","Context","Provider","children","config","screenProperties","transformationY","transformationX","currentYPosition","gestureEnabled","currentScreenIndex","navHeight","headerHeight","closeOffset","topTabHeight","topTapNativeRef","Native","current","screenRefs","Object","keys","inputRange","map","_","idx","outputRange","type","value","useResetApproachingScreenScrollOffset"],"sourceRoot":"../../../src","sources":["context/TabContext.tsx"],"mappings":";;AACA,SAASA,aAAa,EAAEC,IAAI,EAAEC,MAAM,QAAQ,OAAO;AACnD,SAASC,OAAO,QAAQ,8BAA8B;AACtD,SACEC,WAAW,EACXC,mBAAmB,EACnBC,eAAe,EACfC,cAAc,QACT,yBAAyB;AAChC,SAASC,aAAa,QAAQ,uBAAoB;AAClD,SAASC,eAAe,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErD,OAAO,MAAMC,OAAO,gBAAGZ,aAAa,CAClC,CAAC,CACH,CAAC;AAED,OAAO,MAAMa,QAAQ,gBAAGZ,IAAI,CAC1B,CAAC;EACCa,QAAQ;EACRC,MAAM;EACNC;AAC6C,CAAC,KAAK;EACnD,MAAMC,eAAe,GAAGV,cAAc,CAAC,CAAC,CAAC;EACzC,MAAMW,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,WAAW,CAACE,KAAK,EACjB,OACF,CAAC;EACH,CACF,CAAC;EAED7B,eAAe,CAAC8B,qCAAqC,CAAC;IACpDV,UAAU;IACVV,gBAAgB;IAChBH,gBAAgB;IAChBE;EACF,CAAC,CAAC;EAEF,oBACEP,IAAA,CAACC,OAAO,CAACC,QAAQ;IACfyB,KAAK,EAAE;MACLd,WAAW;MACXT,MAAM;MACNM,kBAAkB;MAClBF,gBAAgB;MAChBC,cAAc;MACdG,YAAY;MACZD,SAAS;MACTN,gBAAgB;MAChBS,YAAY;MACZC,eAAe;MACfR,eAAe;MACfD,eAAe;MACfY;IACF,CAAE;IAAAf,QAAA,EAEDA,QAAQ,CAAC;MACRe,UAAU;MACVL,WAAW;MACXT,MAAM;MACNM,kBAAkB;MAClBF,gBAAgB;MAChBC,cAAc;MACdG,YAAY;MACZD,SAAS;MACTN,gBAAgB;MAChBS,YAAY;MACZC,eAAe;MACfR,eAAe;MACfD;IACF,CAAC;EAAC,CACc,CAAC;AAEvB,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useRoute } from '@react-navigation/native';
|
|
4
|
-
import { Context } from "../context/TabContext.js";
|
|
5
|
-
import { useContext } from 'react';
|
|
6
|
-
import { useAnimatedProps, useAnimatedScrollHandler, useAnimatedStyle, useDerivedValue, withTiming } from 'react-native-reanimated';
|
|
7
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
-
import { useWindowDimensions } from 'react-native';
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
import { HeaderHeightContext } from '@react-navigation/elements';
|
|
11
|
-
export const useTabContext = () => {
|
|
12
|
-
if (__DEV__) {
|
|
13
|
-
const stack = new Error().stack;
|
|
14
|
-
const isOutsideLibrary = stack && !stack.includes('react-navigation-reanimated-top-tabs');
|
|
15
|
-
if (isOutsideLibrary) {
|
|
16
|
-
console.warn('[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.');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return useContext(Context);
|
|
20
|
-
};
|
|
21
|
-
export const useScreenGesture = () => {
|
|
22
|
-
const {
|
|
23
|
-
key
|
|
24
|
-
} = useRoute();
|
|
25
|
-
const {
|
|
26
|
-
screenProperties
|
|
27
|
-
} = useTabContext();
|
|
28
|
-
const nativeRef = screenProperties[key]?.nativeGesture;
|
|
29
|
-
if (!nativeRef) throw 'GestureRef does not exist for this route';
|
|
30
|
-
return nativeRef;
|
|
31
|
-
};
|
|
32
|
-
export const useScreenScrollable = () => {
|
|
33
|
-
const {
|
|
34
|
-
key
|
|
35
|
-
} = useRoute();
|
|
36
|
-
const {
|
|
37
|
-
height
|
|
38
|
-
} = useWindowDimensions();
|
|
39
|
-
const {
|
|
40
|
-
bottom,
|
|
41
|
-
top
|
|
42
|
-
} = useSafeAreaInsets();
|
|
43
|
-
const {
|
|
44
|
-
currentYPosition,
|
|
45
|
-
gestureEnabled,
|
|
46
|
-
headerHeight,
|
|
47
|
-
screenProperties,
|
|
48
|
-
topTabHeight,
|
|
49
|
-
transformationY
|
|
50
|
-
} = useTabContext();
|
|
51
|
-
const navigationHeader = React.useContext(HeaderHeightContext) ?? 0;
|
|
52
|
-
const animatedProps = useAnimatedProps(() => ({
|
|
53
|
-
scrollEnabled: !gestureEnabled.value || currentYPosition.value === -headerHeight.value
|
|
54
|
-
}));
|
|
55
|
-
const onScroll = useAnimatedScrollHandler(({
|
|
56
|
-
contentOffset
|
|
57
|
-
}) => {
|
|
58
|
-
const scrollPosition = screenProperties[key]?.scrollY;
|
|
59
|
-
if (!scrollPosition) throw 'ScrollPosition property does not exist for this route';
|
|
60
|
-
scrollPosition.value = contentOffset.y;
|
|
61
|
-
});
|
|
62
|
-
const oppositeHeaderState = useDerivedValue(() => transformationY.value >= 0 ? headerHeight.value : 0);
|
|
63
|
-
const style = useAnimatedStyle(() => ({
|
|
64
|
-
minHeight: height - top - topTabHeight.value - oppositeHeaderState.value - navigationHeader
|
|
65
|
-
}));
|
|
66
|
-
return {
|
|
67
|
-
animatedProps,
|
|
68
|
-
bounces: false,
|
|
69
|
-
contentContainerStyle: {
|
|
70
|
-
paddingBottom: bottom
|
|
71
|
-
},
|
|
72
|
-
onScroll,
|
|
73
|
-
style
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
export const useScreenProperties = () => {
|
|
77
|
-
const {
|
|
78
|
-
key
|
|
79
|
-
} = useRoute();
|
|
80
|
-
const {
|
|
81
|
-
screenProperties
|
|
82
|
-
} = useTabContext();
|
|
83
|
-
const screen = screenProperties[key];
|
|
84
|
-
if (!screen) throw 'No screen properties registered for this route';
|
|
85
|
-
return screen;
|
|
86
|
-
};
|
|
87
|
-
export const useHeader = () => {
|
|
88
|
-
const {
|
|
89
|
-
headerHeight,
|
|
90
|
-
transformationX
|
|
91
|
-
} = useTabContext();
|
|
92
|
-
const hideHeader = () => {
|
|
93
|
-
transformationX.value = withTiming(-headerHeight.value);
|
|
94
|
-
};
|
|
95
|
-
return {
|
|
96
|
-
hideHeader
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
//TODO: make it private
|
|
101
|
-
export const useScreenRefs = keys => {
|
|
102
|
-
const refs = {
|
|
103
|
-
current: keys.reduce((prev, key) => ({
|
|
104
|
-
...prev,
|
|
105
|
-
[key]: {
|
|
106
|
-
current: null
|
|
107
|
-
}
|
|
108
|
-
}), {})
|
|
109
|
-
};
|
|
110
|
-
const setRef = (key, ref) => {
|
|
111
|
-
refs.current = {
|
|
112
|
-
...refs.current,
|
|
113
|
-
[key]: ref
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
return {
|
|
117
|
-
setRef,
|
|
118
|
-
refs
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
//# sourceMappingURL=Tab.hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useRoute","Context","useContext","useAnimatedProps","useAnimatedScrollHandler","useAnimatedStyle","useDerivedValue","withTiming","useSafeAreaInsets","useWindowDimensions","React","HeaderHeightContext","useTabContext","__DEV__","stack","Error","isOutsideLibrary","includes","console","warn","useScreenGesture","key","screenProperties","nativeRef","nativeGesture","useScreenScrollable","height","bottom","top","currentYPosition","gestureEnabled","headerHeight","topTabHeight","transformationY","navigationHeader","animatedProps","scrollEnabled","value","onScroll","contentOffset","scrollPosition","scrollY","y","oppositeHeaderState","style","minHeight","bounces","contentContainerStyle","paddingBottom","useScreenProperties","screen","useHeader","transformationX","hideHeader","useScreenRefs","keys","refs","current","reduce","prev","setRef","ref"],"sourceRoot":"../../../src","sources":["hooks/Tab.hooks.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,OAAO;AAClC,SACEC,gBAAgB,EAChBC,wBAAwB,EACxBC,gBAAgB,EAChBC,eAAe,EACfC,UAAU,QACL,yBAAyB;AAChC,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,mBAAmB,QAAQ,cAAc;AAClD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,IAAIC,OAAO,EAAE;IACX,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAC,CAACD,KAAK;IAC/B,MAAME,gBAAgB,GACpBF,KAAK,IAAI,CAACA,KAAK,CAACG,QAAQ,CAAC,sCAAsC,CAAC;IAElE,IAAID,gBAAgB,EAAE;MACpBE,OAAO,CAACC,IAAI,CACV,mLACF,CAAC;IACH;EACF;EACA,OAAOjB,UAAU,CAACD,OAAO,CAAC;AAC5B,CAAC;AAED,OAAO,MAAMmB,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAM;IAAEC;EAAI,CA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AAQ,KAAK;IACxCL,IAAI,CAACC,OAAO,GAAG;MAAE,GAAGD,IAAI,CAACC,OAAO;MAAE,CAACpC,GAAG,GAAGwC;IAAI,CAAC;EAChD,CAAC;EAED,OAAO;IAAED,MAAM;IAAEJ;EAAK,CAAC;AACzB,CAAC","ignoreList":[]}
|
|
@@ -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 +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,CAA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C;CAC3E"}
|
|
@@ -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 +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 +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 +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 +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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReanimatedTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../../src/navigator/createReanimatedTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EAGxB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAwK3D,eAAO,MAAM,+BAA+B,GAC1C,MAAM,SAAS,aAAa,+OAvJ3B,0BAA0B,CAAC,qBAAqB,6CA8J5B,CAAC"}
|