mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
Compare commits
7 Commits
@react-nav
...
@react-nav
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe6d20c10e | ||
|
|
7d74bd73a7 | ||
|
|
b46c433f1e | ||
|
|
7e71ee6c47 | ||
|
|
1287a784e6 | ||
|
|
56f7df5384 | ||
|
|
5996bbbce2 |
@@ -32,7 +32,7 @@
|
||||
"react-native-appearance": "~0.3.3",
|
||||
"react-native-gesture-handler": "~1.10.2",
|
||||
"react-native-pager-view": "~5.0.12",
|
||||
"react-native-paper": "^4.9.0",
|
||||
"react-native-paper": "^4.9.1",
|
||||
"react-native-reanimated": "~2.1.0",
|
||||
"react-native-safe-area-context": "~3.2.0",
|
||||
"react-native-screens": "~3.0.0",
|
||||
|
||||
@@ -7,14 +7,9 @@ const alias = Object.fromEntries(
|
||||
fs
|
||||
.readdirSync(packages)
|
||||
.filter((name) => !name.startsWith('.'))
|
||||
.map((name) => [
|
||||
`@react-navigation/${name}`,
|
||||
path.resolve(
|
||||
packages,
|
||||
name,
|
||||
require(`../../packages/${name}/package.json`).source
|
||||
),
|
||||
])
|
||||
.map((name) => [name, require(`../../packages/${name}/package.json`)])
|
||||
.filter(([, pak]) => pak.source != null)
|
||||
.map(([name, pak]) => [pak.name, path.resolve(packages, name, pak.source)])
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -8,8 +8,6 @@ const packages = path.resolve(__dirname, '..', 'packages');
|
||||
module.exports = async function (env, argv) {
|
||||
const config = await createExpoWebpackConfigAsync(env, argv);
|
||||
|
||||
config.context = path.resolve(__dirname, '..');
|
||||
|
||||
config.module.rules.push({
|
||||
test: /\.(js|ts|tsx)$/,
|
||||
include: /(packages|example)\/.+/,
|
||||
@@ -19,19 +17,25 @@ module.exports = async function (env, argv) {
|
||||
|
||||
Object.assign(config.resolve.alias, {
|
||||
'react': path.resolve(node_modules, 'react'),
|
||||
'react-native': path.resolve(node_modules, 'react-native-web'),
|
||||
'react-native-web': path.resolve(node_modules, 'react-native-web'),
|
||||
'react-native': path.resolve(__dirname, 'node_modules', 'react-native-web'),
|
||||
'react-native-web': path.resolve(
|
||||
__dirname,
|
||||
'node_modules',
|
||||
'react-native-web'
|
||||
),
|
||||
'@expo/vector-icons': path.resolve(node_modules, '@expo/vector-icons'),
|
||||
});
|
||||
|
||||
fs.readdirSync(packages)
|
||||
.filter((name) => !name.startsWith('.'))
|
||||
.forEach((name) => {
|
||||
config.resolve.alias[`@react-navigation/${name}`] = path.resolve(
|
||||
packages,
|
||||
name,
|
||||
require(`../packages/${name}/package.json`).source
|
||||
);
|
||||
const pak = require(`../packages/${name}/package.json`);
|
||||
|
||||
if (pak.source == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
config.resolve.alias[pak.name] = path.resolve(packages, name, pak.source);
|
||||
});
|
||||
|
||||
return config;
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [6.0.0-next.18](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@6.0.0-next.17...@react-navigation/bottom-tabs@6.0.0-next.18) (2021-06-01)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/bottom-tabs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [6.0.0-next.17](https://github.com/react-navigation/react-navigation/compare/@react-navigation/bottom-tabs@6.0.0-next.16...@react-navigation/bottom-tabs@6.0.0-next.17) (2021-05-29)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/bottom-tabs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/bottom-tabs",
|
||||
"description": "Bottom tab navigator following iOS design guidelines",
|
||||
"version": "6.0.0-next.17",
|
||||
"version": "6.0.0-next.18",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -36,7 +36,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/elements": "^1.0.0-next.16",
|
||||
"@react-navigation/elements": "^1.0.0-next.17",
|
||||
"color": "^3.1.3",
|
||||
"warn-once": "^0.1.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [6.0.0-next.17](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@6.0.0-next.16...@react-navigation/drawer@6.0.0-next.17) (2021-06-01)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/drawer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [6.0.0-next.16](https://github.com/react-navigation/react-navigation/compare/@react-navigation/drawer@6.0.0-next.15...@react-navigation/drawer@6.0.0-next.16) (2021-05-29)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/drawer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/drawer",
|
||||
"description": "Drawer navigator component with animated transitions and gesturess",
|
||||
"version": "6.0.0-next.16",
|
||||
"version": "6.0.0-next.17",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -41,7 +41,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/elements": "^1.0.0-next.16",
|
||||
"@react-navigation/elements": "^1.0.0-next.17",
|
||||
"color": "^3.1.3",
|
||||
"warn-once": "^0.1.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.0.0-next.17](https://github.com/react-navigation/react-navigation/compare/@react-navigation/elements@1.0.0-next.16...@react-navigation/elements@1.0.0-next.17) (2021-06-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* tweak opacity animation for PlatformPressable ([b46c433](https://github.com/react-navigation/react-navigation/commit/b46c433f1e012fc3215ec32ac787c7c018963505))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.0.0-next.16](https://github.com/react-navigation/react-navigation/compare/@react-navigation/elements@1.0.0-next.15...@react-navigation/elements@1.0.0-next.16) (2021-05-29)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/elements
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/elements",
|
||||
"description": "UI Components for React Navigation",
|
||||
"version": "1.0.0-next.16",
|
||||
"version": "1.0.0-next.17",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
"react-navigation",
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function PlatformPressable({
|
||||
};
|
||||
|
||||
const handlePressIn = (e: GestureResponderEvent) => {
|
||||
animateTo(pressOpacity, 150);
|
||||
animateTo(pressOpacity, 0);
|
||||
onPressIn?.(e);
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [6.0.0-next.14](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@6.0.0-next.13...@react-navigation/material-bottom-tabs@6.0.0-next.14) (2021-06-01)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [6.0.0-next.13](https://github.com/react-navigation/react-navigation/compare/@react-navigation/material-bottom-tabs@6.0.0-next.12...@react-navigation/material-bottom-tabs@6.0.0-next.13) (2021-05-29)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/material-bottom-tabs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/material-bottom-tabs",
|
||||
"description": "Integration for bottom navigation component from react-native-paper",
|
||||
"version": "6.0.0-next.13",
|
||||
"version": "6.0.0-next.14",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -41,7 +41,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/elements": "^1.0.0-next.16"
|
||||
"@react-navigation/elements": "^1.0.0-next.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@react-navigation/native": "^6.0.0-next.13",
|
||||
@@ -53,7 +53,7 @@
|
||||
"react": "~16.13.1",
|
||||
"react-native": "~0.63.4",
|
||||
"react-native-builder-bob": "^0.18.1",
|
||||
"react-native-paper": "^4.9.0",
|
||||
"react-native-paper": "^4.9.1",
|
||||
"react-native-safe-area-context": "~3.2.0",
|
||||
"react-native-vector-icons": "^8.1.0",
|
||||
"typescript": "^4.2.3"
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [6.0.0-next.7](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native-stack@6.0.0-next.6...@react-navigation/native-stack@6.0.0-next.7) (2021-06-01)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/native-stack
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [6.0.0-next.6](https://github.com/react-navigation/react-navigation/compare/@react-navigation/native-stack@6.0.0-next.5...@react-navigation/native-stack@6.0.0-next.6) (2021-05-29)
|
||||
|
||||
**Note:** Version bump only for package @react-navigation/native-stack
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/native-stack",
|
||||
"description": "Native stack navigator using react-native-screens",
|
||||
"version": "6.0.0-next.6",
|
||||
"version": "6.0.0-next.7",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -41,7 +41,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/elements": "^1.0.0-next.16",
|
||||
"@react-navigation/elements": "^1.0.0-next.17",
|
||||
"warn-once": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
33
packages/native-stack/src/views/DebugContainer.native.tsx
Normal file
33
packages/native-stack/src/views/DebugContainer.native.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as React from 'react';
|
||||
import { Platform, View, ViewProps } from 'react-native';
|
||||
// @ts-ignore Getting private component
|
||||
import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
|
||||
import type { StackPresentationTypes } from 'react-native-screens';
|
||||
|
||||
type ContainerProps = ViewProps & {
|
||||
stackPresentation: StackPresentationTypes;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
let Container = (View as unknown) as React.ComponentType<ContainerProps>;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const DebugContainer = (props: ContainerProps) => {
|
||||
const { stackPresentation, ...rest } = props;
|
||||
|
||||
if (Platform.OS === 'ios' && stackPresentation !== 'push') {
|
||||
// This is necessary for LogBox
|
||||
return (
|
||||
<AppContainer>
|
||||
<View {...rest} />
|
||||
</AppContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return <View {...rest} />;
|
||||
};
|
||||
|
||||
Container = DebugContainer;
|
||||
}
|
||||
|
||||
export default Container;
|
||||
14
packages/native-stack/src/views/DebugContainer.tsx
Normal file
14
packages/native-stack/src/views/DebugContainer.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import { View, ViewProps } from 'react-native';
|
||||
import type { StackPresentationTypes } from 'react-native-screens';
|
||||
|
||||
type ContainerProps = ViewProps & {
|
||||
stackPresentation: StackPresentationTypes;
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
export default function Container(props: ContainerProps) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { stackPresentation: _, ...rest } = props;
|
||||
return <View {...rest} />;
|
||||
}
|
||||
13
packages/native-stack/src/views/FontProcessor.native.tsx
Normal file
13
packages/native-stack/src/views/FontProcessor.native.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
// @ts-ignore: No declaration available
|
||||
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
|
||||
|
||||
export function processFonts(
|
||||
fontFamilies: (string | undefined)[]
|
||||
): (string | undefined)[] {
|
||||
// @ts-ignore: React Native types are incorrect here and don't consider fontFamily a style value
|
||||
const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;
|
||||
if (typeof fontFamilyProcessor === 'function') {
|
||||
return fontFamilies.map(fontFamilyProcessor);
|
||||
}
|
||||
return fontFamilies;
|
||||
}
|
||||
@@ -1,13 +1,5 @@
|
||||
// @ts-ignore: No declaration available
|
||||
import ReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes';
|
||||
|
||||
export function processFonts(
|
||||
fontFamilies: (string | undefined)[]
|
||||
_: (string | undefined)[]
|
||||
): (string | undefined)[] {
|
||||
// @ts-ignore: React Native types are incorrect here and don't consider fontFamily a style value
|
||||
const fontFamilyProcessor = ReactNativeStyleAttributes.fontFamily?.process;
|
||||
if (typeof fontFamilyProcessor === 'function') {
|
||||
return fontFamilies.map(fontFamilyProcessor);
|
||||
}
|
||||
return fontFamilies;
|
||||
throw new Error('Not supported on Web');
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@ import {
|
||||
useTheme,
|
||||
} from '@react-navigation/native';
|
||||
import * as React from 'react';
|
||||
import { Platform, StyleSheet, View, ViewProps } from 'react-native';
|
||||
// @ts-ignore Getting private component
|
||||
import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
|
||||
import { Platform, StyleSheet } from 'react-native';
|
||||
import {
|
||||
Screen,
|
||||
ScreenStack,
|
||||
@@ -22,33 +20,11 @@ import type {
|
||||
NativeStackNavigationHelpers,
|
||||
NativeStackNavigationOptions,
|
||||
} from '../types';
|
||||
import DebugContainer from './DebugContainer';
|
||||
import HeaderConfig from './HeaderConfig';
|
||||
|
||||
const isAndroid = Platform.OS === 'android';
|
||||
|
||||
type ContainerProps = ViewProps & { stackPresentation: StackPresentationTypes };
|
||||
|
||||
let Container = (View as unknown) as React.ComponentType<ContainerProps>;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const DebugContainer = (props: ContainerProps) => {
|
||||
const { stackPresentation, ...rest } = props;
|
||||
|
||||
if (Platform.OS === 'ios' && stackPresentation !== 'push') {
|
||||
// This is necessary for LogBox
|
||||
return (
|
||||
<AppContainer>
|
||||
<View {...rest} />
|
||||
</AppContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return <View {...rest} />;
|
||||
};
|
||||
|
||||
Container = DebugContainer;
|
||||
}
|
||||
|
||||
const MaybeNestedStack = ({
|
||||
options,
|
||||
route,
|
||||
@@ -81,7 +57,7 @@ const MaybeNestedStack = ({
|
||||
}, [headerShown, presentation, route.name]);
|
||||
|
||||
const content = (
|
||||
<Container
|
||||
<DebugContainer
|
||||
style={[
|
||||
styles.container,
|
||||
presentation !== 'transparentModal' &&
|
||||
@@ -93,7 +69,7 @@ const MaybeNestedStack = ({
|
||||
stackPresentation={presentation === 'card' ? 'push' : presentation}
|
||||
>
|
||||
{children}
|
||||
</Container>
|
||||
</DebugContainer>
|
||||
);
|
||||
|
||||
if (isHeaderInModal) {
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [6.0.0-next.25](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@6.0.0-next.24...@react-navigation/stack@6.0.0-next.25) (2021-06-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* tweak android q animation ([7d74bd7](https://github.com/react-navigation/react-navigation/commit/7d74bd73a7333f0b1373a05c9f06e981556feed2))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [6.0.0-next.24](https://github.com/react-navigation/react-navigation/compare/@react-navigation/stack@6.0.0-next.23...@react-navigation/stack@6.0.0-next.24) (2021-05-29)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-navigation/stack",
|
||||
"description": "Stack navigator component for iOS and Android with animated transitions and gestures",
|
||||
"version": "6.0.0-next.24",
|
||||
"version": "6.0.0-next.25",
|
||||
"keywords": [
|
||||
"react-native-component",
|
||||
"react-component",
|
||||
@@ -40,7 +40,7 @@
|
||||
"clean": "del lib"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-navigation/elements": "^1.0.0-next.16",
|
||||
"@react-navigation/elements": "^1.0.0-next.17",
|
||||
"color": "^3.1.3",
|
||||
"react-native-iphone-x-helper": "^1.3.0",
|
||||
"warn-once": "^0.1.0"
|
||||
|
||||
@@ -302,12 +302,12 @@ export function forScaleFromCenterAndroid({
|
||||
closing,
|
||||
current.progress.interpolate({
|
||||
inputRange: [0, 1],
|
||||
outputRange: [0.9, 1],
|
||||
outputRange: [0.925, 1],
|
||||
extrapolate: 'clamp',
|
||||
}),
|
||||
progress.interpolate({
|
||||
inputRange: [0, 1, 2],
|
||||
outputRange: [0.85, 1, 1.1],
|
||||
outputRange: [0.85, 1, 1.075],
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -18365,10 +18365,10 @@ react-native-pager-view@~5.0.12:
|
||||
resolved "https://registry.yarnpkg.com/react-native-pager-view/-/react-native-pager-view-5.0.12.tgz#5106735d944e7f876b006377ab6a18859bf7730c"
|
||||
integrity sha512-QmHUnQeP2qcxDofEOnKRmoUue0RaT55lhNJDfcQ1/SNuxif4Q2UyvDfqeItm1+toaE5tVnXqoreZh82FqUqnvw==
|
||||
|
||||
react-native-paper@^4.9.0:
|
||||
version "4.9.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-4.9.0.tgz#af67ae6fd92c13d8cf5e37700ad2b37aac85b2ed"
|
||||
integrity sha512-1+7V5wJgNcEdTE+sckGF+ABImLQbWdYFGTEqkVsqdsd1mKxRSVeHJXqeQAZwiFJAZJiHzxL403rKPNdi8ZpGng==
|
||||
react-native-paper@^4.9.1:
|
||||
version "4.9.1"
|
||||
resolved "https://registry.yarnpkg.com/react-native-paper/-/react-native-paper-4.9.1.tgz#9b2aadcb1bd48ff6825641df60821e20e0cc8276"
|
||||
integrity sha512-vGgNvQE/GlNSjwJw+1LW0yoULTh7enxln16bYfOoI9Xiz1NOKxhfyQN0/LlZn7JFhRdbXW+3+6yMBJ50Emt+ng==
|
||||
dependencies:
|
||||
"@callstack/react-theme-provider" "^3.0.6"
|
||||
color "^3.1.2"
|
||||
|
||||
Reference in New Issue
Block a user