This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,7 @@
// @ts-ignore this file extension is parsed only in managed workflow, so `expo-font` should be always available there
// eslint-disable-next-line import/no-unresolved
import { processFontFamily } from 'expo-font';
export function processFonts(fontFamilies) {
return fontFamilies.map(fontFamily => processFontFamily(fontFamily));
}
//# sourceMappingURL=FontProcessor.expo.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["FontProcessor.expo.tsx"],"names":["processFontFamily","processFonts","fontFamilies","map","fontFamily"],"mappings":"AAAA;AACA;AACA,SAASA,iBAAT,QAAkC,WAAlC;AAEA,OAAO,SAASC,YAAT,CACLC,YADK,EAEmB;AACxB,SAAOA,YAAY,CAACC,GAAb,CAAkBC,UAAD,IAAgBJ,iBAAiB,CAACI,UAAD,CAAlD,CAAP;AACD","sourcesContent":["// @ts-ignore this file extension is parsed only in managed workflow, so `expo-font` should be always available there\n// eslint-disable-next-line import/no-unresolved\nimport { processFontFamily } from 'expo-font';\n\nexport function processFonts(\n fontFamilies: (string | undefined)[]\n): (string | undefined)[] {\n return fontFamilies.map((fontFamily) => processFontFamily(fontFamily));\n}\n"]}

View File

@ -0,0 +1,5 @@
// do nothing outside of expo
export function processFonts(fontFamilies) {
return fontFamilies;
}
//# sourceMappingURL=FontProcessor.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["FontProcessor.tsx"],"names":["processFonts","fontFamilies"],"mappings":"AAAA;AACA,OAAO,SAASA,YAAT,CACLC,YADK,EAEmB;AACxB,SAAOA,YAAP;AACD","sourcesContent":["// do nothing outside of expo\nexport function processFonts(\n fontFamilies: (string | undefined)[]\n): (string | undefined)[] {\n return fontFamilies;\n}\n"]}

View File

@ -0,0 +1,77 @@
import { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { ScreenStackHeaderBackButtonImage, ScreenStackHeaderCenterView, ScreenStackHeaderConfig, ScreenStackHeaderLeftView, ScreenStackHeaderRightView } from 'react-native-screens';
import { processFonts } from './FontProcessor';
export default function HeaderConfig({
backButtonImage,
backButtonInCustomView,
direction,
headerBackTitle,
headerBackTitleStyle = {},
headerBackTitleVisible = true,
headerCenter,
headerHideBackButton,
headerHideShadow,
headerLargeStyle = {},
headerLargeTitle,
headerLargeTitleHideShadow,
headerLargeTitleStyle = {},
headerLeft,
headerRight,
headerShown,
headerStyle = {},
headerTintColor,
headerTitle,
headerTitleStyle = {},
headerTopInsetEnabled = true,
headerTranslucent,
route,
statusBarAnimation,
statusBarHidden,
statusBarStyle,
title
}) {
const {
colors
} = useTheme();
const tintColor = headerTintColor !== null && headerTintColor !== void 0 ? headerTintColor : colors.primary;
const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = processFonts([headerBackTitleStyle.fontFamily, headerLargeTitleStyle.fontFamily, headerTitleStyle.fontFamily]);
return /*#__PURE__*/React.createElement(ScreenStackHeaderConfig, {
backButtonInCustomView: backButtonInCustomView,
backgroundColor: headerStyle.backgroundColor ? headerStyle.backgroundColor : colors.card,
backTitle: headerBackTitleVisible ? headerBackTitle : ' ',
backTitleFontFamily: backTitleFontFamily,
backTitleFontSize: headerBackTitleStyle.fontSize,
blurEffect: headerStyle.blurEffect,
color: tintColor,
direction: direction,
hidden: headerShown === false,
hideBackButton: headerHideBackButton,
hideShadow: headerHideShadow,
largeTitle: headerLargeTitle,
largeTitleBackgroundColor: headerLargeStyle.backgroundColor,
largeTitleColor: headerLargeTitleStyle.color,
largeTitleFontFamily: largeTitleFontFamily,
largeTitleFontSize: headerLargeTitleStyle.fontSize,
largeTitleHideShadow: headerLargeTitleHideShadow,
statusBarAnimation: statusBarAnimation,
statusBarHidden: statusBarHidden,
statusBarStyle: statusBarStyle,
title: headerTitle !== undefined ? headerTitle : title !== undefined ? title : route.name,
titleColor: headerTitleStyle.color !== undefined ? headerTitleStyle.color : headerTintColor !== undefined ? headerTintColor : colors.text,
titleFontFamily: titleFontFamily,
titleFontSize: headerTitleStyle.fontSize,
topInsetEnabled: headerTopInsetEnabled,
translucent: headerTranslucent === true
}, headerRight !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderRightView, null, headerRight({
tintColor
})) : null, backButtonImage !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderBackButtonImage, {
key: "backImage",
source: backButtonImage
}) : null, headerLeft !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderLeftView, null, headerLeft({
tintColor
})) : null, headerCenter !== undefined ? /*#__PURE__*/React.createElement(ScreenStackHeaderCenterView, null, headerCenter({
tintColor
})) : null);
}
//# sourceMappingURL=HeaderConfig.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,132 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { StackActions, useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native'; // @ts-ignore Getting private component
import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';
import { Screen as ScreenComponent, ScreenStack } from 'react-native-screens';
import HeaderConfig from './HeaderConfig';
const Screen = ScreenComponent;
const isAndroid = Platform.OS === 'android';
let Container = View;
if (__DEV__) {
const DebugContainer = props => {
const {
stackAnimation,
...rest
} = props;
if (Platform.OS === 'ios' && stackAnimation !== 'push') {
return /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(View, rest));
}
return /*#__PURE__*/React.createElement(View, rest);
}; // @ts-ignore Wrong props
Container = DebugContainer;
}
export default function NativeStackView({
state,
navigation,
descriptors
}) {
const {
key,
routes
} = state;
const {
colors
} = useTheme();
return /*#__PURE__*/React.createElement(ScreenStack, {
style: styles.container
}, routes.map(route => {
const {
options,
render: renderScene
} = descriptors[route.key];
const {
gestureEnabled,
replaceAnimation = 'pop',
stackPresentation = 'push',
stackAnimation,
contentStyle
} = options;
const viewStyles = [styles.container, stackPresentation !== 'transparentModal' && {
backgroundColor: colors.background
}, contentStyle];
return /*#__PURE__*/React.createElement(Screen, {
key: route.key,
style: StyleSheet.absoluteFill,
gestureEnabled: isAndroid ? false : gestureEnabled,
replaceAnimation: replaceAnimation,
stackPresentation: stackPresentation,
stackAnimation: stackAnimation,
onWillAppear: () => {
navigation.emit({
type: 'transitionStart',
data: {
closing: false
},
target: route.key
});
},
onWillDisappear: () => {
navigation.emit({
type: 'transitionStart',
data: {
closing: true
},
target: route.key
});
},
onAppear: () => {
navigation.emit({
type: 'appear',
target: route.key
});
navigation.emit({
type: 'transitionEnd',
data: {
closing: false
},
target: route.key
});
},
onDisappear: () => {
navigation.emit({
type: 'transitionEnd',
data: {
closing: true
},
target: route.key
});
},
onDismissed: () => {
navigation.emit({
type: 'dismiss',
target: route.key
});
navigation.dispatch({ ...StackActions.pop(),
source: route.key,
target: key
});
}
}, /*#__PURE__*/React.createElement(HeaderConfig, _extends({}, options, {
route: route
})), /*#__PURE__*/React.createElement(Container, {
style: viewStyles // @ts-ignore Wrong props passed to View
,
stackPresentation: stackPresentation
}, renderScene()));
}));
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
//# sourceMappingURL=NativeStackView.js.map

File diff suppressed because one or more lines are too long