chore: sync latest stack

This commit is contained in:
Satyajit Sahoo
2020-01-23 12:43:29 +01:00
parent 86dedf12e2
commit 7cfb15e0b7
5 changed files with 132 additions and 67 deletions

View File

@@ -50,7 +50,7 @@
"@expo/vector-icons": "^10.0.6",
"@react-native-community/bob": "^0.7.0",
"@react-native-community/masked-view": "^0.1.5",
"@react-navigation/stack": "^5.0.0-alpha.59",
"@react-navigation/stack": "^5.0.0-alpha.62",
"@release-it/conventional-changelog": "^1.1.0",
"@types/color": "^3.0.1",
"@types/jest": "^24.0.25",

View File

@@ -1,6 +1,6 @@
diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.tsx
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/index.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/index.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/index.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -3,11 +3,6 @@
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
@@ -13,7 +13,7 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t
export const Assets = [
// eslint-disable-next-line import/no-commonjs
require('./views/assets/back-icon.png'),
@@ -48,9 +43,10 @@
@@ -49,9 +44,10 @@
* Types
*/
export {
@@ -28,9 +28,9 @@ diff -Naur node_modules/@react-navigation/stack/src/index.tsx src/vendor/index.t
StackHeaderTitleProps,
StackCardInterpolatedStyle,
diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx src/vendor/navigators/createStackNavigator.tsx
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-09 03:40:24.000000000 +0100
--- node_modules/@react-navigation/stack/src/navigators/createStackNavigator.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/navigators/createStackNavigator.tsx 1970-01-01 01:00:00.000000000 +0100
@@ -1,77 +0,0 @@
@@ -1,81 +0,0 @@
-import * as React from 'react';
-import {
- useNavigationBuilder,
@@ -75,13 +75,17 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga
- React.useEffect(
- () =>
- navigation.addListener &&
- navigation.addListener('tabPress', (e: EventArg<'tabPress'>) => {
- navigation.addListener('tabPress', e => {
- const isFocused = navigation.isFocused();
-
- // Run the operation in the next frame so we're sure all listeners have been run
- // This is necessary to know if preventDefault() has been called
- requestAnimationFrame(() => {
- if (state.index > 0 && isFocused && !e.defaultPrevented) {
- if (
- state.index > 0 &&
- isFocused &&
- !(e as EventArg<'tabPress', true>).defaultPrevented
- ) {
- // When user taps on already focused tab and we're inside the tab,
- // reset the stack to replicate native behaviour
- navigation.dispatch({
@@ -109,8 +113,8 @@ diff -Naur node_modules/@react-navigation/stack/src/navigators/createStackNaviga
- typeof StackNavigator
->(StackNavigator);
diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.tsx
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/types.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/types.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/types.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,13 +8,28 @@
} from 'react-native';
import { EdgeInsets } from 'react-native-safe-area-context';
@@ -147,7 +151,7 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t
export type StackNavigationEventMap = {
/**
@@ -27,42 +42,29 @@
transitionEnd: { closing: boolean };
transitionEnd: { data: { closing: boolean } };
};
-export type StackNavigationHelpers = NavigationHelpers<
@@ -255,8 +259,8 @@ diff -Naur node_modules/@react-navigation/stack/src/types.tsx src/vendor/types.t
export type StackNavigationConfig = {
diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/vendor/views/Header/Header.tsx
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/Header.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/Header.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,13 @@
import * as React from 'react';
-import { StackActions } from '@react-navigation/routers';
@@ -325,8 +329,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/Header.tsx src/
+
+export default Header;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx src/vendor/views/Header/HeaderBackButton.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackButton.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderBackButton.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,9 +8,9 @@
StyleSheet,
LayoutChangeEvent,
@@ -339,19 +343,19 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackButto
type Props = StackHeaderLeftButtonProps;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx src/vendor/views/Header/HeaderBackground.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderBackground.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderBackground.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform, ViewProps } from 'react-native';
-import { useTheme } from '@react-navigation/native';
+import useTheme from '../../../utils/useTheme';
export default function HeaderBackground({ style, ...rest }: ViewProps) {
const { colors } = useTheme();
type Props = ViewProps & {
children?: React.ReactNode;
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx src/vendor/views/Header/HeaderContainer.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-09 03:42:01.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderContainer.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderContainer.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,7 @@
import * as React from 'react';
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -366,15 +370,15 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer
import { EdgeInsets } from 'react-native-safe-area-context';
import Header from './Header';
@@ -14,6 +10,7 @@
forNoAnimation,
@@ -16,6 +12,7 @@
forSlideRight,
} from '../../TransitionConfigs/HeaderStyleInterpolators';
import {
+ Route,
Layout,
Scene,
StackHeaderStyleInterpolator,
@@ -94,9 +91,7 @@
@@ -99,9 +96,7 @@
insets,
scene,
previous,
@@ -386,8 +390,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderContainer
mode === 'float'
? isHeaderStatic
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx src/vendor/views/Header/HeaderSegment.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderSegment.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -8,7 +8,7 @@
ViewStyle,
} from 'react-native';
@@ -407,8 +411,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderSegment.t
};
diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx src/vendor/views/Header/HeaderTitle.tsx
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Header/HeaderTitle.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Animated, StyleSheet, Platform, TextProps } from 'react-native';
@@ -418,9 +422,9 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Header/HeaderTitle.tsx
type Props = TextProps & {
tintColor?: string;
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/vendor/views/Stack/Card.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-01-09 03:40:42.000000000 +0100
@@ -483,7 +483,7 @@
--- node_modules/@react-navigation/stack/src/views/Stack/Card.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/Card.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -485,7 +485,7 @@
pointerEvents="none"
/>
) : null}
@@ -430,8 +434,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/Card.tsx src/ven
<CardAnimationContext.Provider value={animationContext}>
{children}
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx src/vendor/views/Stack/CardContainer.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/CardContainer.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,11 +1,17 @@
import * as React from 'react';
import { Animated, View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
@@ -463,8 +467,8 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardContainer.ts
>
<View style={styles.container}>
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx src/vendor/views/Stack/CardStack.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-09 03:40:42.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/CardStack.tsx 2020-01-23 12:44:26.000000000 +0100
@@ -11,8 +11,7 @@
import { EdgeInsets } from 'react-native-safe-area-context';
// eslint-disable-next-line import/no-unresolved
@@ -483,9 +487,18 @@ diff -Naur node_modules/@react-navigation/stack/src/views/Stack/CardStack.tsx sr
Layout,
StackHeaderMode,
StackCardMode,
@@ -96,7 +96,7 @@
<View
collapsable={!enabled}
removeClippedSubviews={Platform.OS !== 'ios' && enabled}
- style={[style, { overflow: 'hidden' }]}
+ style={[style, { overflow: 'hidden' }] as any}
{...rest}
/>
);
diff -Naur node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx src/vendor/views/Stack/StackView.tsx
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-09 03:40:24.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-01-09 03:44:43.000000000 +0100
--- node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx 2020-01-23 12:34:48.000000000 +0100
+++ src/vendor/views/Stack/StackView.tsx 2020-01-23 12:43:56.000000000 +0100
@@ -1,8 +1,11 @@
import * as React from 'react';
import { Platform } from 'react-native';

View File

@@ -3,12 +3,19 @@
exports[`Nested navigators renders succesfully as direct child 1`] = `
Array [
<View
collapsable={true}
onLayout={[Function]}
removeClippedSubviews={false}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Object {
"overflow": "hidden",
},
]
}
>
<View
@@ -17,9 +24,15 @@ Array [
Object {
"bottom": 0,
"left": 0,
"overflow": "hidden",
"position": "absolute",
"right": 0,
"top": 0,
"transform": Array [
Object {
"translateY": 0,
},
],
}
}
>
@@ -157,12 +170,19 @@ Array [
}
>
<View
collapsable={true}
onLayout={[Function]}
removeClippedSubviews={false}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Object {
"overflow": "hidden",
},
]
}
>
<View
@@ -171,9 +191,15 @@ Array [
Object {
"bottom": 0,
"left": 0,
"overflow": "hidden",
"position": "absolute",
"right": 0,
"top": 0,
"transform": Array [
Object {
"translateY": 0,
},
],
}
}
>

View File

@@ -3,12 +3,19 @@
exports[`StackNavigator applies correct values when headerRight is present 1`] = `
Array [
<View
collapsable={true}
onLayout={[Function]}
removeClippedSubviews={false}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Object {
"overflow": "hidden",
},
]
}
>
<View
@@ -17,9 +24,15 @@ Array [
Object {
"bottom": 0,
"left": 0,
"overflow": "hidden",
"position": "absolute",
"right": 0,
"top": 0,
"transform": Array [
Object {
"translateY": 0,
},
],
}
}
>
@@ -300,12 +313,19 @@ Array [
exports[`StackNavigator renders successfully 1`] = `
Array [
<View
collapsable={true}
onLayout={[Function]}
removeClippedSubviews={false}
style={
Object {
"flex": 1,
"overflow": "hidden",
}
Array [
Object {
"flex": 1,
"overflow": "hidden",
},
Object {
"overflow": "hidden",
},
]
}
>
<View
@@ -314,9 +334,15 @@ Array [
Object {
"bottom": 0,
"left": 0,
"overflow": "hidden",
"position": "absolute",
"right": 0,
"top": 0,
"transform": Array [
Object {
"translateY": 0,
},
],
}
}
>

View File

@@ -1369,10 +1369,10 @@
query-string "^6.4.2"
react-is "^16.8.6"
"@react-navigation/core@^5.0.0-alpha.33":
version "5.0.0-alpha.33"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.33.tgz#940f55fd29cd6bb81b7be84e86a88a0662df645d"
integrity sha512-lVWKbK6XR9aPCO/972qxZeAkPO1xvDsSGiAmrnQXM74ihnkXLnAqtSZaqP9JfXa/NrgqIi+LSKpocPpcy8/hiA==
"@react-navigation/core@^5.0.0-alpha.36":
version "5.0.0-alpha.36"
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-5.0.0-alpha.36.tgz#6047cfd2e73aea802800eab68f068764ff3f8d4d"
integrity sha512-VfuUd46N/e4Oe7/cKywy1IIRetXQH9NP58QhxznmMOAG/XCIsD5+EA/nIY0NdRem57A3gnrgVxK83h6/g8mZVw==
dependencies:
escape-string-regexp "^2.0.0"
query-string "^6.9.0"
@@ -1388,20 +1388,20 @@
react-native-safe-area-view "^0.14.1"
react-native-screens "^1.0.0 || ^1.0.0-alpha"
"@react-navigation/routers@^5.0.0-alpha.23":
version "5.0.0-alpha.23"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.23.tgz#a2ffda30d2000f074419bd2722edbfab1adaeb20"
integrity sha512-ea9nWS/BYtI6fAitLMobg60VsWa89KuL5QIX3A2ExivofG3fU1P1Ic8MIhicRFfcSV/36rmF5ilCKYesHHnTrA==
"@react-navigation/routers@^5.0.0-alpha.26":
version "5.0.0-alpha.26"
resolved "https://registry.yarnpkg.com/@react-navigation/routers/-/routers-5.0.0-alpha.26.tgz#139c097c55e556c11dcd96e78409165080c3a75b"
integrity sha512-y/Z4dseD0gCrrWA/Frz4+2k2ZMUjXfIdw+Jd+qhXEkcOTGb6NoGujgZndozHsBYZ7zuUwURKhf6vE3lVulAldA==
dependencies:
"@react-navigation/core" "^5.0.0-alpha.33"
"@react-navigation/core" "^5.0.0-alpha.36"
shortid "^2.2.15"
"@react-navigation/stack@^5.0.0-alpha.59":
version "5.0.0-alpha.59"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.59.tgz#fed7e2ed51aea2c607366dda7c82ffc80dd44797"
integrity sha512-10xUKYRh79nW7Aea9VRAfdsMf88yajKYDOmq7ZPFZvqe2Ugyj75fzLtiAPoYoKRNcn9WuV/7lQWAAOP4luZcjg==
"@react-navigation/stack@^5.0.0-alpha.62":
version "5.0.0-alpha.62"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-5.0.0-alpha.62.tgz#fea465ddfe70c150de1d9e03e82ae3e30a572419"
integrity sha512-Bo6y3dD1DODBVLw9Xqcim+nXKHE/mCBmpdeCgFi+3VX5QS2bm+NotbRHz8AQNI8d4w6qWQs8EairfcxlTr11NA==
dependencies:
"@react-navigation/routers" "^5.0.0-alpha.23"
"@react-navigation/routers" "^5.0.0-alpha.26"
color "^3.1.2"
react-native-iphone-x-helper "^1.2.1"