react-navigation-reanimated-top-tabs 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -17
- 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/useScreenScrollable.js +64 -0
- 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 +34 -80
- 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 +33 -8
- 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/{module/src → src}/components/elements/TabBarBaseComponent.d.ts +1 -2
- package/lib/typescript/src/components/elements/TabBarBaseComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/components/elements/TabBarLabelBaseComponent.d.ts +1 -2
- 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/TopTabContext.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/src/index.d.ts +45 -0
- 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 +7 -3
- package/src/components/elements/TabBarLabelBaseComponent.tsx +4 -3
- 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 +34 -10
- 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/TopTabContext.hooks.js +0 -48
- package/lib/commonjs/context/TopTabContext.hooks.js.map +0 -1
- package/lib/commonjs/context/TopTabContext.js +0 -86
- package/lib/commonjs/context/TopTabContext.js.map +0 -1
- package/lib/commonjs/hooks/TopTab.hooks.js +0 -120
- package/lib/commonjs/hooks/TopTab.hooks.js.map +0 -1
- package/lib/module/context/TopTabContext.hooks.js +0 -44
- package/lib/module/context/TopTabContext.hooks.js.map +0 -1
- package/lib/module/context/TopTabContext.js +0 -82
- package/lib/module/context/TopTabContext.js.map +0 -1
- package/lib/module/hooks/TopTab.hooks.js +0 -110
- package/lib/module/hooks/TopTab.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 +0 -24
- 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/TopTabContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/context/TopTabContext.hooks.d.ts +0 -5
- package/lib/typescript/commonjs/src/context/TopTabContext.hooks.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/TopTab.hooks.d.ts +0 -33
- package/lib/typescript/commonjs/src/hooks/TopTab.hooks.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -10
- 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.map +0 -1
- package/lib/typescript/module/src/components/elements/TabBarLabelBaseComponent.d.ts +0 -8
- 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/TopTabContext.d.ts +0 -4
- package/lib/typescript/module/src/context/TopTabContext.d.ts.map +0 -1
- package/lib/typescript/module/src/context/TopTabContext.hooks.d.ts +0 -5
- package/lib/typescript/module/src/context/TopTabContext.hooks.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/TopTab.hooks.d.ts +0 -33
- package/lib/typescript/module/src/hooks/TopTab.hooks.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -10
- 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/TopTabContext.hooks.ts +0 -55
- package/src/context/TopTabContext.tsx +0 -115
- package/src/hooks/TopTab.hooks.ts +0 -112
- /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/wrappers/ScreenWrapper.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/navigator/createReanimatedTopTabNavigator.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -14,11 +14,10 @@ export interface RenderTabsParams {
|
|
|
14
14
|
navigationState: NavigationState;
|
|
15
15
|
position: SharedValue<number>;
|
|
16
16
|
}
|
|
17
|
-
interface TabBarProps extends RenderTabsParams {
|
|
17
|
+
export interface TabBarProps extends RenderTabsParams {
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
navigate: (route: Route) => void;
|
|
20
20
|
style?: AnimatedStyle;
|
|
21
21
|
}
|
|
22
22
|
export declare const TabBarBaseComponent: ({ children, navigate, navigationState, position, style, }: TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|
|
24
23
|
//# sourceMappingURL=TabBarBaseComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAIjC,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"}
|
package/lib/typescript/{commonjs/src → src}/components/elements/TabBarLabelBaseComponent.d.ts
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
interface TabBarLabelTypes {
|
|
1
|
+
export interface TabBarLabelTypes {
|
|
2
2
|
focused: boolean;
|
|
3
3
|
index: number;
|
|
4
4
|
title: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const TabBarLabelBaseComponent: ({ index, ...props }: TabBarLabelTypes) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
7
|
//# sourceMappingURL=TabBarLabelBaseComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabBarLabelBaseComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/elements/TabBarLabelBaseComponent.tsx"],"names":[],"mappings":"AAQA,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface GestureWrapperProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const GestureWrapper: ({ children }: GestureWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=GestureWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GestureWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/wrappers/GestureWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAezD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,iBAAkB,mBAAmB,4CAiH/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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;AAIzE,MAAM,WAAW,kBACf,SAAQ,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;CAAG;AAEvD,eAAO,MAAM,aAAa,+BAGvB,kBAAkB,4CAepB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ScrollViewProps } from 'react-native';
|
|
2
|
+
import { type AnimatedProps } from 'react-native-reanimated';
|
|
3
|
+
export type ScreenWrapperProps = AnimatedProps<Omit<ScrollViewProps, 'onScroll' | 'onLayout' | 'bounces'>> & Pick<ScrollViewProps, 'onLayout'> & {};
|
|
4
|
+
export declare const ScrollView: ({ children, style, contentContainerStyle, onLayout, ...props }: ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=ScrollView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAQzE,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAC5C,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC,CAC3D,GACC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC;AAEzC,eAAO,MAAM,UAAU,mEAMpB,kBAAkB,4CAyCpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ReanimatedTopTabNavigation } from '../types';
|
|
2
2
|
export declare const Context: import("react").Context<ReanimatedTopTabNavigation.ContextType>;
|
|
3
|
-
export declare const Provider: import("react").MemoExoticComponent<({ children, config,
|
|
4
|
-
//# sourceMappingURL=
|
|
3
|
+
export declare const Provider: import("react").MemoExoticComponent<({ children, config, context, }: ReanimatedTopTabNavigation.TopTabContextProps) => import("react/jsx-runtime").JSX.Element>;
|
|
4
|
+
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/context/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAM3D,eAAO,MAAM,OAAO,iEAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ,uEAKhB,0BAA0B,CAAC,kBAAkB,6CAqDjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.helpers.d.ts","sourceRoot":"","sources":["../../../../src/context/Context.helpers.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc;mCATW,MAAM,iBAAiB,MAAM,GAAG,IAAI;CAS1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReanimatedTopTabNavigation } from '../types';
|
|
2
|
+
import type { ParamListBase, TabNavigationState } from '@react-navigation/native';
|
|
3
|
+
export declare const ContextHooks: {
|
|
4
|
+
useResetApproachingScreenScrollOffset: ({ context, transformationX, currentYPosition, }: Pick<ReanimatedTopTabNavigation.ContextType, "context" | "currentYPosition" | "transformationX">) => void;
|
|
5
|
+
usePrepareContext: ({ state, }: {
|
|
6
|
+
state: TabNavigationState<ParamListBase>;
|
|
7
|
+
}) => ReanimatedTopTabNavigation.TopTabContextProps["context"];
|
|
8
|
+
useTransformHeaderOnTabChange: ({ config, }: Pick<ReanimatedTopTabNavigation.ContextType, "config">) => {
|
|
9
|
+
transformationY: import("react-native-reanimated").SharedValue<number>;
|
|
10
|
+
transformationX: import("react-native-reanimated").SharedValue<number>;
|
|
11
|
+
currentYPosition: import("react-native-reanimated").SharedValue<number>;
|
|
12
|
+
headerHeight: import("react-native-reanimated").SharedValue<number>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Context.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.hooks.d.ts","sourceRoot":"","sources":["../../../../src/context/Context.hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AA2OlC,eAAO,MAAM,YAAY;6FArNtB,IAAI,CACL,0BAA0B,CAAC,WAAW,EACtC,SAAS,GAAG,kBAAkB,GAAG,iBAAiB,CACnD;oCA8IE;QACD,KAAK,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;KAC1C,KAAG,0BAA0B,CAAC,kBAAkB,CAAC,SAAS,CAAC;iDAuBzD,IAAI,CAAC,0BAA0B,CAAC,WAAW,EAAE,QAAQ,CAAC;;;;;;CA+CxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHeader.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHeader.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,SAAS;;;;;;;;CAsBrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenGesture.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useScreenGesture.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,2GAS5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useScreenProperties: () => {
|
|
2
|
+
innerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
3
|
+
nativeGesture: import("react-native-gesture-handler").NativeGesture;
|
|
4
|
+
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
5
|
+
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
6
|
+
scrollRef: {
|
|
7
|
+
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | null;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useScreenProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenProperties.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useScreenProperties.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;;;CAO/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const useScreenScrollable: () => {
|
|
2
|
+
animatedProps: Partial<{
|
|
3
|
+
scrollEnabled: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
bounces: boolean;
|
|
6
|
+
contentContainerStyle: {
|
|
7
|
+
paddingBottom: number;
|
|
8
|
+
};
|
|
9
|
+
onScroll: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
10
|
+
style: {
|
|
11
|
+
minHeight: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useScreenScrollable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenScrollable.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useScreenScrollable.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CAqD/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTabContext.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,2DAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTabOffset.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTabOffset.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,8DAGxB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { type ReanimatedTopTabNavigation } from './types';
|
|
2
|
+
export { createReanimatedTopTabNavigator } from './navigator/createReanimatedTopTabNavigator';
|
|
3
|
+
export declare const TabHooks: {
|
|
4
|
+
useHeader: () => {
|
|
5
|
+
hideHeader: () => void;
|
|
6
|
+
defaultStyle: {
|
|
7
|
+
transform: {
|
|
8
|
+
translateY: number;
|
|
9
|
+
}[];
|
|
10
|
+
zIndex: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
useScreenProperties: () => {
|
|
14
|
+
innerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
15
|
+
nativeGesture: import("react-native-gesture-handler").NativeGesture;
|
|
16
|
+
outerLayout: import("react-native-reanimated").SharedValue<import("react-native").LayoutRectangle>;
|
|
17
|
+
scrollY: import("react-native-reanimated").SharedValue<number>;
|
|
18
|
+
scrollRef: {
|
|
19
|
+
current: import("react-native-reanimated/lib/typescript/Animated").ScrollView | null;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
useScreenScrollable: () => {
|
|
23
|
+
animatedProps: Partial<{
|
|
24
|
+
scrollEnabled: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
bounces: boolean;
|
|
27
|
+
contentContainerStyle: {
|
|
28
|
+
paddingBottom: number;
|
|
29
|
+
};
|
|
30
|
+
onScroll: import("react-native-reanimated").ScrollHandlerProcessed<Record<string, unknown>>;
|
|
31
|
+
style: {
|
|
32
|
+
minHeight: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
useScreenGesture: () => import("react-native-gesture-handler/lib/typescript/handlers/gestures/nativeGesture").NativeGesture;
|
|
36
|
+
useTabContext: () => import("./types").ReanimatedTopTabNavigation.ContextType;
|
|
37
|
+
useTabOffset: () => import("react-native-reanimated").DerivedValue<number>;
|
|
38
|
+
};
|
|
39
|
+
export declare const Tab: {
|
|
40
|
+
ScrollView: ({ children, style, contentContainerStyle, onLayout, ...props }: import("./components/wrappers/ScrollView").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
ScreenWrapper: ({ children, ...viewProps }: import("./components/wrappers/ScreenWrapper").ScreenWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
TabBarBaseComponent: ({ children, navigate, navigationState, position, style, }: import("./components/elements/TabBarBaseComponent").TabBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
TabBarLabelBaseComponent: ({ index, ...props }: import("./components/elements/TabBarLabelBaseComponent").TabBarLabelTypes) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAU9F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAC;AAEF,eAAO,MAAM,GAAG;;;;;CAKf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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;AAgJ3D,eAAO,MAAM,+BAA+B,GAC1C,MAAM,SAAS,aAAa,+OAlI3B,0BAA0B,CAAC,qBAAqB,6CAyI5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Warning.service.d.ts","sourceRoot":"","sources":["../../../../src/services/Warning.service.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAU1B,CAAC"}
|
|
@@ -3,18 +3,10 @@ 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
|
export declare namespace ReanimatedTopTabNavigation {
|
|
9
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
10
|
closeOffset: SharedValue<number>;
|
|
19
11
|
config: string[];
|
|
20
12
|
currentScreenIndex: SharedValue<number>;
|
|
@@ -22,16 +14,31 @@ export declare namespace ReanimatedTopTabNavigation {
|
|
|
22
14
|
gestureEnabled: SharedValue<boolean>;
|
|
23
15
|
headerHeight: SharedValue<number>;
|
|
24
16
|
navHeight: SharedValue<number>;
|
|
25
|
-
screenProperties: Record<string, {
|
|
26
|
-
innerLayout: SharedValue<LayoutRectangle>;
|
|
27
|
-
nativeGesture: NativeGesture;
|
|
28
|
-
outerLayout: SharedValue<LayoutRectangle>;
|
|
29
|
-
scrollY: SharedValue<number>;
|
|
30
|
-
}>;
|
|
31
17
|
topTabHeight: SharedValue<number>;
|
|
32
|
-
|
|
18
|
+
topTabNativeGesture: NativeGesture;
|
|
33
19
|
transformationX: SharedValue<number>;
|
|
34
20
|
transformationY: SharedValue<number>;
|
|
21
|
+
context: {
|
|
22
|
+
screen: {
|
|
23
|
+
properties: Record<string, {
|
|
24
|
+
innerLayout: SharedValue<LayoutRectangle>;
|
|
25
|
+
nativeGesture: NativeGesture;
|
|
26
|
+
outerLayout: SharedValue<LayoutRectangle>;
|
|
27
|
+
scrollY: SharedValue<number>;
|
|
28
|
+
scrollRef: {
|
|
29
|
+
current: Reanimated.ScrollView | null;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
setRef(key: string, ref: Reanimated.ScrollView | null): void;
|
|
33
|
+
getRef(key: string): {
|
|
34
|
+
current: Reanimated.ScrollView | null;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
route: {
|
|
38
|
+
map: Record<number, string>;
|
|
39
|
+
getKeyForIndex(index: number): string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
35
42
|
}
|
|
36
43
|
interface TabViewNavigatorProps {
|
|
37
44
|
HeaderComponent?: React.ComponentType<Pick<ContextType, 'transformationY' | 'headerHeight'>>;
|
|
@@ -41,7 +48,7 @@ export declare namespace ReanimatedTopTabNavigation {
|
|
|
41
48
|
initialRouteName?: string;
|
|
42
49
|
screenOptions?: StackNavigationOptions;
|
|
43
50
|
}
|
|
44
|
-
type TopTabContextProps = Pick<ContextType, '
|
|
51
|
+
type TopTabContextProps = Pick<ContextType, 'config' | 'context'> & {
|
|
45
52
|
children: (props: ContextType) => React.ReactNode;
|
|
46
53
|
};
|
|
47
54
|
interface NavigationOptions {
|
|
@@ -0,0 +1 @@
|
|
|
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,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,UAAU,EAAE,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,yBAAiB,0BAA0B,CAAC;IAC1C,UAAiB,WAAW;QAC1B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACxC,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACtC,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC/B,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,mBAAmB,EAAE,aAAa,CAAC;QACnC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACrC,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM,CAChB,MAAM,EACN;oBACE,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;oBAC1C,aAAa,EAAE,aAAa,CAAC;oBAC7B,WAAW,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;oBAC1C,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;oBAC7B,SAAS,EAAE;wBAAE,OAAO,EAAE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAA;qBAAE,CAAC;iBACtD,CACF,CAAC;gBACF,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;gBAC7D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG;oBAAE,OAAO,EAAE,UAAU,CAAC,UAAU,GAAG,IAAI,CAAA;iBAAE,CAAC;aAChE,CAAC;YACF,KAAK,EAAE;gBACL,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAC5B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;aACvC,CAAC;SACH,CAAC;KACH;IAED,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,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;QACzE,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"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-navigation-reanimated-top-tabs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "react-navigation-reanimated-top-tabs",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
7
7
|
"module": "./lib/module/index.js",
|
|
8
|
-
"
|
|
9
|
-
".": {
|
|
10
|
-
"import": {
|
|
11
|
-
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
-
"default": "./lib/module/index.js"
|
|
13
|
-
},
|
|
14
|
-
"require": {
|
|
15
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
-
"default": "./lib/commonjs/index.js"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
8
|
+
"types": "lib/typescript/src/index.d.ts",
|
|
20
9
|
"files": [
|
|
21
10
|
"src",
|
|
22
11
|
"lib",
|
|
@@ -66,6 +55,10 @@
|
|
|
66
55
|
"@commitlint/config-conventional": "^17.0.2",
|
|
67
56
|
"@evilmartians/lefthook": "^1.5.0",
|
|
68
57
|
"@react-native/eslint-config": "^0.73.1",
|
|
58
|
+
"@react-navigation/elements": "^1.3.31",
|
|
59
|
+
"@react-navigation/native": "^6.1.18",
|
|
60
|
+
"@react-navigation/routers": "^6.1.9",
|
|
61
|
+
"@react-navigation/stack": "^6.4.1",
|
|
69
62
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
70
63
|
"@types/jest": "^29.5.5",
|
|
71
64
|
"@types/lodash": "^4.17.10",
|
|
@@ -77,10 +70,16 @@
|
|
|
77
70
|
"eslint-config-prettier": "^9.0.0",
|
|
78
71
|
"eslint-plugin-prettier": "^5.0.1",
|
|
79
72
|
"jest": "^29.7.0",
|
|
73
|
+
"lodash": "^4.17.21",
|
|
80
74
|
"prettier": "^3.0.3",
|
|
81
75
|
"react": "18.2.0",
|
|
82
76
|
"react-native": "0.74.5",
|
|
83
77
|
"react-native-builder-bob": "^0.30.2",
|
|
78
|
+
"react-native-gesture-handler": "^2.16.1",
|
|
79
|
+
"react-native-reanimated": "^3.10.1",
|
|
80
|
+
"react-native-safe-area-context": "^4.9.0",
|
|
81
|
+
"react-native-screens": "^3.31.1",
|
|
82
|
+
"react-native-web": "~0.19.10",
|
|
84
83
|
"release-it": "^15.0.0",
|
|
85
84
|
"typescript": "^5.2.2"
|
|
86
85
|
},
|
|
@@ -88,12 +87,18 @@
|
|
|
88
87
|
"@types/react": "^18.2.44"
|
|
89
88
|
},
|
|
90
89
|
"peerDependencies": {
|
|
91
|
-
"@react-navigation/
|
|
90
|
+
"@react-navigation/elements": ">=1.3.0",
|
|
91
|
+
"@react-navigation/native": ">=6.0.0",
|
|
92
|
+
"@react-navigation/routers": ">=6.0.0",
|
|
93
|
+
"@react-navigation/stack": ">=6.0.0",
|
|
94
|
+
"lodash": "^4.17.21",
|
|
92
95
|
"react": ">=16.8.0 || ^17.0.0 || ^18.0.0",
|
|
93
|
-
"react-native-reanimated": ">3.0.0",
|
|
94
96
|
"react-native": ">=0.60.0",
|
|
95
97
|
"react-native-gesture-handler": ">=2.0.0",
|
|
96
|
-
"react-native-
|
|
98
|
+
"react-native-reanimated": ">3.0.0",
|
|
99
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
100
|
+
"react-native-screens": ">=3.0.0",
|
|
101
|
+
"react-native-web": ">=0.19.0"
|
|
97
102
|
},
|
|
98
103
|
"workspaces": [
|
|
99
104
|
"example"
|
|
@@ -165,22 +170,15 @@
|
|
|
165
170
|
"output": "lib",
|
|
166
171
|
"targets": [
|
|
167
172
|
[
|
|
168
|
-
"commonjs"
|
|
169
|
-
{
|
|
170
|
-
"esm": true
|
|
171
|
-
}
|
|
173
|
+
"commonjs"
|
|
172
174
|
],
|
|
173
175
|
[
|
|
174
|
-
"module"
|
|
175
|
-
{
|
|
176
|
-
"esm": true
|
|
177
|
-
}
|
|
176
|
+
"module"
|
|
178
177
|
],
|
|
179
178
|
[
|
|
180
179
|
"typescript",
|
|
181
180
|
{
|
|
182
|
-
"project": "tsconfig.build.json"
|
|
183
|
-
"esm": true
|
|
181
|
+
"project": "tsconfig.build.json"
|
|
184
182
|
}
|
|
185
183
|
]
|
|
186
184
|
]
|
|
@@ -188,17 +186,5 @@
|
|
|
188
186
|
"create-react-native-library": {
|
|
189
187
|
"type": "library",
|
|
190
188
|
"version": "0.41.2"
|
|
191
|
-
},
|
|
192
|
-
"dependencies": {
|
|
193
|
-
"@react-navigation/elements": "^1.3.31",
|
|
194
|
-
"@react-navigation/native": "6.1.18",
|
|
195
|
-
"@react-navigation/routers": "^6.1.9",
|
|
196
|
-
"@react-navigation/stack": "^6.4.1",
|
|
197
|
-
"lodash": "^4.17.21",
|
|
198
|
-
"react-native-gesture-handler": "2.16.1",
|
|
199
|
-
"react-native-reanimated": "3.10.1",
|
|
200
|
-
"react-native-safe-area-context": "4.10.5",
|
|
201
|
-
"react-native-screens": "3.31.1",
|
|
202
|
-
"react-native-web": "~0.19.10"
|
|
203
189
|
}
|
|
204
190
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
GestureDetector,
|
|
6
6
|
GestureHandlerRootView,
|
|
7
7
|
} from 'react-native-gesture-handler';
|
|
8
|
-
import
|
|
8
|
+
import Reanimated, {
|
|
9
9
|
Extrapolation,
|
|
10
10
|
interpolate,
|
|
11
11
|
LinearTransition,
|
|
@@ -78,6 +78,7 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
78
78
|
.failOffsetY(10)
|
|
79
79
|
.activeOffsetX([-20, 20])
|
|
80
80
|
.onChange((event) => {
|
|
81
|
+
'worklet';
|
|
81
82
|
scrollPosition.value = AnimationHelper.onChange(
|
|
82
83
|
event,
|
|
83
84
|
scrollPosition.value,
|
|
@@ -86,6 +87,7 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
86
87
|
);
|
|
87
88
|
})
|
|
88
89
|
.onEnd((event) => {
|
|
90
|
+
'worklet';
|
|
89
91
|
const state = AnimationHelper.onEnd(
|
|
90
92
|
event,
|
|
91
93
|
minimumValueToChangeView,
|
|
@@ -168,10 +170,10 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
168
170
|
|
|
169
171
|
return (
|
|
170
172
|
<GestureHandlerRootView style={defaultStyles.flex}>
|
|
171
|
-
<
|
|
173
|
+
<Reanimated.View layout={LinearTransition} style={defaultStyles.flex}>
|
|
172
174
|
{renderTabBar ? renderTabBar({ navigationState, position }) : null}
|
|
173
175
|
<GestureDetector gesture={panGesture}>
|
|
174
|
-
<
|
|
176
|
+
<Reanimated.View
|
|
175
177
|
layout={LinearTransition}
|
|
176
178
|
style={[
|
|
177
179
|
scrollPositionStyle,
|
|
@@ -181,15 +183,14 @@ export const ReanimatedTabView = React.memo<ReanimatedTabViewProps>(
|
|
|
181
183
|
]}
|
|
182
184
|
>
|
|
183
185
|
{Routes}
|
|
184
|
-
</
|
|
186
|
+
</Reanimated.View>
|
|
185
187
|
</GestureDetector>
|
|
186
|
-
</
|
|
188
|
+
</Reanimated.View>
|
|
187
189
|
</GestureHandlerRootView>
|
|
188
190
|
);
|
|
189
191
|
}
|
|
190
192
|
);
|
|
191
193
|
|
|
192
|
-
//NOTE: purposely use of StyleSheet - simplify migration to library
|
|
193
194
|
const defaultStyles = StyleSheet.create({
|
|
194
195
|
flex: {
|
|
195
196
|
flex: 1,
|
|
@@ -6,7 +6,8 @@ import Reanimated, {
|
|
|
6
6
|
type SharedValue,
|
|
7
7
|
useAnimatedReaction,
|
|
8
8
|
} from 'react-native-reanimated';
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
import { useTabContext } from '../../hooks/useTabContext';
|
|
10
11
|
|
|
11
12
|
export interface Route {
|
|
12
13
|
key: string;
|
|
@@ -22,7 +23,7 @@ export interface RenderTabsParams {
|
|
|
22
23
|
position: SharedValue<number>;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
interface TabBarProps extends RenderTabsParams {
|
|
26
|
+
export interface TabBarProps extends RenderTabsParams {
|
|
26
27
|
children?: React.ReactNode;
|
|
27
28
|
navigate: (route: Route) => void;
|
|
28
29
|
style?: AnimatedStyle;
|
|
@@ -72,7 +73,7 @@ export const TabBarBaseComponent = ({
|
|
|
72
73
|
{route.tabBarLabel ? (
|
|
73
74
|
route.tabBarLabel()
|
|
74
75
|
) : (
|
|
75
|
-
<Text style={
|
|
76
|
+
<Text style={styles.label}>{route.title}</Text>
|
|
76
77
|
)}
|
|
77
78
|
</Pressable>
|
|
78
79
|
))}
|
|
@@ -89,6 +90,9 @@ const styles = StyleSheet.create({
|
|
|
89
90
|
alignItems: 'center',
|
|
90
91
|
justifyContent: 'center',
|
|
91
92
|
},
|
|
93
|
+
label: {
|
|
94
|
+
color: 'red',
|
|
95
|
+
},
|
|
92
96
|
wrapper: {
|
|
93
97
|
width: '100%',
|
|
94
98
|
flexDirection: 'row',
|
|
@@ -3,9 +3,10 @@ import Reanimated, {
|
|
|
3
3
|
interpolateColor,
|
|
4
4
|
useAnimatedStyle,
|
|
5
5
|
} from 'react-native-reanimated';
|
|
6
|
-
import { useTabContext } from '../../hooks/TopTab.hooks';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
import { useTabOffset } from '../../hooks/useTabOffset';
|
|
8
|
+
|
|
9
|
+
export interface TabBarLabelTypes {
|
|
9
10
|
focused: boolean;
|
|
10
11
|
index: number;
|
|
11
12
|
title: string;
|
|
@@ -15,7 +16,7 @@ export const TabBarLabelBaseComponent = ({
|
|
|
15
16
|
index,
|
|
16
17
|
...props
|
|
17
18
|
}: TabBarLabelTypes) => {
|
|
18
|
-
const
|
|
19
|
+
const transformationX = useTabOffset();
|
|
19
20
|
|
|
20
21
|
const style = useAnimatedStyle(
|
|
21
22
|
() => ({
|