feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 React Navigation Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,5 @@
# `@react-navigation/elements`
UI Components for React Navigation.
Installation instructions and documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/elements/).

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Background;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
function Background(_ref) {
let {
style,
...rest
} = _ref;
const {
colors
} = (0, _native.useTheme)();
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({}, rest, {
style: [{
flex: 1,
backgroundColor: colors.background
}, style]
}));
}
//# sourceMappingURL=Background.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Background","style","rest","colors","useTheme","flex","backgroundColor","background"],"sourceRoot":"../../src","sources":["Background.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAA+C;AAAA;AAAA;AAMhC,SAASA,UAAU,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAE7B,oBACE,oBAAC,iBAAI,eACCF,IAAI;IACR,KAAK,EAAE,CAAC;MAAEG,IAAI,EAAE,CAAC;MAAEC,eAAe,EAAEH,MAAM,CAACI;IAAW,CAAC,EAAEN,KAAK;EAAE,GAChE;AAEN"}

View File

@@ -0,0 +1,243 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Header;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _getDefaultHeaderHeight = _interopRequireDefault(require("./getDefaultHeaderHeight"));
var _HeaderBackground = _interopRequireDefault(require("./HeaderBackground"));
var _HeaderShownContext = _interopRequireDefault(require("./HeaderShownContext"));
var _HeaderTitle = _interopRequireDefault(require("./HeaderTitle"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const warnIfHeaderStylesDefined = styles => {
Object.keys(styles).forEach(styleProp => {
const value = styles[styleProp];
if (styleProp === 'position' && value === 'absolute') {
console.warn("position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.");
} else if (value !== undefined) {
console.warn(`${styleProp} was given a value of ${value}, this has no effect on headerStyle.`);
}
});
};
function Header(props) {
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
const frame = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
const isParentHeaderShown = React.useContext(_HeaderShownContext.default);
// On models with Dynamic Island the status bar height is smaller than the safe area top inset.
const hasDynamicIsland = _reactNative.Platform.OS === 'ios' && insets.top > 50;
const statusBarHeight = hasDynamicIsland ? insets.top - 5 : insets.top;
const {
layout = frame,
modal = false,
title,
headerTitle: customTitle,
headerTitleAlign = _reactNative.Platform.select({
ios: 'center',
default: 'left'
}),
headerLeft,
headerLeftLabelVisible,
headerTransparent,
headerTintColor,
headerBackground,
headerRight,
headerTitleAllowFontScaling: titleAllowFontScaling,
headerTitleStyle: titleStyle,
headerLeftContainerStyle: leftContainerStyle,
headerRightContainerStyle: rightContainerStyle,
headerTitleContainerStyle: titleContainerStyle,
headerBackgroundContainerStyle: backgroundContainerStyle,
headerStyle: customHeaderStyle,
headerShadowVisible,
headerPressColor,
headerPressOpacity,
headerStatusBarHeight = isParentHeaderShown ? 0 : statusBarHeight
} = props;
const defaultHeight = (0, _getDefaultHeaderHeight.default)(layout, modal, headerStatusBarHeight);
const {
height = defaultHeight,
minHeight,
maxHeight,
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: web support for shadow
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform,
...unsafeStyles
} = _reactNative.StyleSheet.flatten(customHeaderStyle || {});
if (process.env.NODE_ENV !== 'production') {
warnIfHeaderStylesDefined(unsafeStyles);
}
const safeStyles = {
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: boxShadow is only for Web
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform
};
// Setting a property to undefined triggers default style
// So we need to filter them out
// Users can use `null` instead
for (const styleProp in safeStyles) {
// @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles
if (safeStyles[styleProp] === undefined) {
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete safeStyles[styleProp];
}
}
const backgroundStyle = [safeStyles, headerShadowVisible === false && {
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0
}];
const leftButton = headerLeft ? headerLeft({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity,
labelVisible: headerLeftLabelVisible
}) : null;
const rightButton = headerRight ? headerRight({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity
}) : null;
const headerTitle = typeof customTitle !== 'function' ? props => /*#__PURE__*/React.createElement(_HeaderTitle.default, props) : customTitle;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [_reactNative.StyleSheet.absoluteFill, {
zIndex: 0
}, backgroundContainerStyle]
}, headerBackground ? headerBackground({
style: backgroundStyle
}) : headerTransparent ? null : /*#__PURE__*/React.createElement(_HeaderBackground.default, {
style: backgroundStyle
})), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [{
height,
minHeight,
maxHeight,
opacity,
transform
}]
}, /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "none",
style: {
height: headerStatusBarHeight
}
}), /*#__PURE__*/React.createElement(_reactNative.View, {
pointerEvents: "box-none",
style: styles.content
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.left, headerTitleAlign === 'center' && styles.expand, {
marginStart: insets.left
}, leftContainerStyle]
}, leftButton), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.title, {
// Avoid the title from going offscreen or overlapping buttons
maxWidth: headerTitleAlign === 'center' ? layout.width - ((leftButton ? headerLeftLabelVisible !== false ? 80 : 32 : 16) + Math.max(insets.left, insets.right)) * 2 : layout.width - ((leftButton ? 72 : 16) + (rightButton ? 72 : 16) + insets.left - insets.right)
}, titleContainerStyle]
}, headerTitle({
children: title,
allowFontScaling: titleAllowFontScaling,
tintColor: headerTintColor,
style: titleStyle
})), /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
pointerEvents: "box-none",
style: [styles.right, styles.expand, {
marginEnd: insets.right
}, rightContainerStyle]
}, rightButton))));
}
const styles = _reactNative.StyleSheet.create({
content: {
flex: 1,
flexDirection: 'row',
alignItems: 'stretch'
},
title: {
marginHorizontal: 16,
justifyContent: 'center'
},
left: {
justifyContent: 'center',
alignItems: 'flex-start'
},
right: {
justifyContent: 'center',
alignItems: 'flex-end'
},
expand: {
flexGrow: 1,
flexBasis: 0
}
});
//# sourceMappingURL=Header.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,208 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderBackButton;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _MaskedView = _interopRequireDefault(require("../MaskedView"));
var _PlatformPressable = _interopRequireDefault(require("../PlatformPressable"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function HeaderBackButton(_ref) {
let {
disabled,
allowFontScaling,
backImage,
label,
labelStyle,
labelVisible = _reactNative.Platform.OS === 'ios',
onLabelLayout,
onPress,
pressColor,
pressOpacity,
screenLayout,
tintColor: customTintColor,
titleLayout,
truncatedLabel = 'Back',
accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',
testID,
style
} = _ref;
const {
colors
} = (0, _native.useTheme)();
const [initialLabelWidth, setInitialLabelWidth] = React.useState(undefined);
const tintColor = customTintColor !== undefined ? customTintColor : _reactNative.Platform.select({
ios: colors.primary,
default: colors.text
});
const handleLabelLayout = e => {
onLabelLayout === null || onLabelLayout === void 0 ? void 0 : onLabelLayout(e);
setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);
};
const shouldTruncateLabel = () => {
return !label || initialLabelWidth && titleLayout && screenLayout && (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26;
};
const renderBackImage = () => {
if (backImage) {
return backImage({
tintColor
});
} else {
return /*#__PURE__*/React.createElement(_reactNative.Image, {
style: [styles.icon, Boolean(labelVisible) && styles.iconWithLabel, Boolean(tintColor) && {
tintColor
}],
source: require('../assets/back-icon.png'),
fadeDuration: 0
});
}
};
const renderLabel = () => {
const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;
if (!labelVisible || leftLabelText === undefined) {
return null;
}
const labelElement = /*#__PURE__*/React.createElement(_reactNative.View, {
style: screenLayout ?
// We make the button extend till the middle of the screen
// Otherwise it appears to cut off when translating
[styles.labelWrapper, {
minWidth: screenLayout.width / 2 - 27
}] : null
}, /*#__PURE__*/React.createElement(_reactNative.Animated.Text, {
accessible: false,
onLayout:
// This measurement is used to determine if we should truncate the label when it doesn't fit
// Only measure it when label is not truncated because we want the measurement of full label
leftLabelText === label ? handleLabelLayout : undefined,
style: [styles.label, tintColor ? {
color: tintColor
} : null, labelStyle],
numberOfLines: 1,
allowFontScaling: !!allowFontScaling
}, leftLabelText));
if (backImage || _reactNative.Platform.OS !== 'ios') {
// When a custom backimage is specified, we can't mask the label
// Otherwise there might be weird effect due to our mask not being the same as the image
return labelElement;
}
return /*#__PURE__*/React.createElement(_MaskedView.default, {
maskElement: /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.iconMaskContainer
}, /*#__PURE__*/React.createElement(_reactNative.Image, {
source: require('../assets/back-icon-mask.png'),
style: styles.iconMask
}), /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.iconMaskFillerRect
}))
}, labelElement);
};
const handlePress = () => onPress && requestAnimationFrame(onPress);
return /*#__PURE__*/React.createElement(_PlatformPressable.default, {
disabled: disabled,
accessible: true,
accessibilityRole: "button",
accessibilityLabel: accessibilityLabel,
testID: testID,
onPress: disabled ? undefined : handlePress,
pressColor: pressColor,
pressOpacity: pressOpacity,
android_ripple: androidRipple,
style: [styles.container, disabled && styles.disabled, style],
hitSlop: _reactNative.Platform.select({
ios: undefined,
default: {
top: 16,
right: 16,
bottom: 16,
left: 16
}
})
}, /*#__PURE__*/React.createElement(React.Fragment, null, renderBackImage(), renderLabel()));
}
const androidRipple = {
borderless: true,
foreground: _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 23,
radius: 20
};
const styles = _reactNative.StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
minWidth: _reactNative.StyleSheet.hairlineWidth,
// Avoid collapsing when title is long
..._reactNative.Platform.select({
ios: null,
default: {
marginVertical: 3,
marginHorizontal: 11
}
})
},
disabled: {
opacity: 0.5
},
label: {
fontSize: 17,
// Title and back label are a bit different width due to title being bold
// Adjusting the letterSpacing makes them coincide better
letterSpacing: 0.35
},
labelWrapper: {
// These styles will make sure that the label doesn't fill the available space
// Otherwise it messes with the measurement of the label
flexDirection: 'row',
alignItems: 'flex-start'
},
icon: _reactNative.Platform.select({
ios: {
height: 21,
width: 13,
marginLeft: 8,
marginRight: 22,
marginVertical: 12,
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
},
default: {
height: 24,
width: 24,
margin: 3,
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
}
}),
iconWithLabel: _reactNative.Platform.OS === 'ios' ? {
marginRight: 6
} : {},
iconMaskContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center'
},
iconMaskFillerRect: {
flex: 1,
backgroundColor: '#000'
},
iconMask: {
height: 21,
width: 13,
marginLeft: -14.5,
marginVertical: 12,
alignSelf: 'center',
resizeMode: 'contain',
transform: [{
scaleX: _reactNative.I18nManager.getConstants().isRTL ? -1 : 1
}]
}
});
//# sourceMappingURL=HeaderBackButton.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderBackContext = (0, _getNamedContext.default)('HeaderBackContext', undefined);
var _default = HeaderBackContext;
exports.default = _default;
//# sourceMappingURL=HeaderBackContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderBackContext","getNamedContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderBackContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,iBAAiB,GAAG,IAAAC,wBAAe,EACvC,mBAAmB,EACnBC,SAAS,CACV;AAAC,eAEaF,iBAAiB;AAAA"}

View File

@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderBackground;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
function HeaderBackground(_ref) {
let {
style,
...rest
} = _ref;
const {
colors
} = (0, _native.useTheme)();
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({
style: [styles.container, {
backgroundColor: colors.card,
borderBottomColor: colors.border,
shadowColor: colors.border
}, style]
}, rest));
}
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
..._reactNative.Platform.select({
android: {
elevation: 4
},
ios: {
shadowOpacity: 0.85,
shadowRadius: 0,
shadowOffset: {
width: 0,
height: _reactNative.StyleSheet.hairlineWidth
}
},
default: {
borderBottomWidth: _reactNative.StyleSheet.hairlineWidth
}
})
}
});
//# sourceMappingURL=HeaderBackground.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderBackground","style","rest","colors","useTheme","styles","container","backgroundColor","card","borderBottomColor","border","shadowColor","StyleSheet","create","flex","Platform","select","android","elevation","ios","shadowOpacity","shadowRadius","shadowOffset","width","height","hairlineWidth","default","borderBottomWidth"],"sourceRoot":"../../../src","sources":["Header/HeaderBackground.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAOsB;AAAA;AAAA;AAOP,SAASA,gBAAgB,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAE7B,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEJ,MAAM,CAACK,IAAI;MAC5BC,iBAAiB,EAAEN,MAAM,CAACO,MAAM;MAChCC,WAAW,EAAER,MAAM,CAACO;IACtB,CAAC,EACDT,KAAK;EACL,GACEC,IAAI,EACR;AAEN;AAEA,MAAMG,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACP,GAAGC,qBAAQ,CAACC,MAAM,CAAC;MACjBC,OAAO,EAAE;QACPC,SAAS,EAAE;MACb,CAAC;MACDC,GAAG,EAAE;QACHC,aAAa,EAAE,IAAI;QACnBC,YAAY,EAAE,CAAC;QACfC,YAAY,EAAE;UACZC,KAAK,EAAE,CAAC;UACRC,MAAM,EAAEZ,uBAAU,CAACa;QACrB;MACF,CAAC;MACDC,OAAO,EAAE;QACPC,iBAAiB,EAAEf,uBAAU,CAACa;MAChC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderHeightContext = (0, _getNamedContext.default)('HeaderHeightContext', undefined);
var _default = HeaderHeightContext;
exports.default = _default;
//# sourceMappingURL=HeaderHeightContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderHeightContext","getNamedContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderHeightContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,mBAAmB,GAAG,IAAAC,wBAAe,EACzC,qBAAqB,EACrBC,SAAS,CACV;AAAC,eAEaF,mBAAmB;AAAA"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _getNamedContext = _interopRequireDefault(require("../getNamedContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HeaderShownContext = (0, _getNamedContext.default)('HeaderShownContext', false);
var _default = HeaderShownContext;
exports.default = _default;
//# sourceMappingURL=HeaderShownContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderShownContext","getNamedContext"],"sourceRoot":"../../../src","sources":["Header/HeaderShownContext.tsx"],"mappings":";;;;;;AAAA;AAAiD;AAEjD,MAAMA,kBAAkB,GAAG,IAAAC,wBAAe,EAAC,oBAAoB,EAAE,KAAK,CAAC;AAAC,eAEzDD,kBAAkB;AAAA"}

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = HeaderTitle;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
function HeaderTitle(_ref) {
let {
tintColor,
style,
...rest
} = _ref;
const {
colors
} = (0, _native.useTheme)();
return /*#__PURE__*/React.createElement(_reactNative.Animated.Text, _extends({
accessibilityRole: "header",
"aria-level": "1",
numberOfLines: 1
}, rest, {
style: [styles.title, {
color: tintColor === undefined ? colors.text : tintColor
}, style]
}));
}
const styles = _reactNative.StyleSheet.create({
title: _reactNative.Platform.select({
ios: {
fontSize: 17,
fontWeight: '600'
},
android: {
fontSize: 20,
fontFamily: 'sans-serif-medium',
fontWeight: 'normal'
},
default: {
fontSize: 18,
fontWeight: '500'
}
})
});
//# sourceMappingURL=HeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["HeaderTitle","tintColor","style","rest","colors","useTheme","styles","title","color","undefined","text","StyleSheet","create","Platform","select","ios","fontSize","fontWeight","android","fontFamily","default"],"sourceRoot":"../../../src","sources":["Header/HeaderTitle.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAOsB;AAAA;AAAA;AAOP,SAASA,WAAW,OAAuC;EAAA,IAAtC;IAAEC,SAAS;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EACtE,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,gBAAQ,GAAE;EAE7B,oBACE,oBAAC,qBAAQ,CAAC,IAAI;IACZ,iBAAiB,EAAC,QAAQ;IAC1B,cAAW,GAAG;IACd,aAAa,EAAE;EAAE,GACbF,IAAI;IACR,KAAK,EAAE,CACLG,MAAM,CAACC,KAAK,EACZ;MAAEC,KAAK,EAAEP,SAAS,KAAKQ,SAAS,GAAGL,MAAM,CAACM,IAAI,GAAGT;IAAU,CAAC,EAC5DC,KAAK;EACL,GACF;AAEN;AAEA,MAAMI,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,KAAK,EAAEM,qBAAQ,CAACC,MAAM,CAAC;IACrBC,GAAG,EAAE;MACHC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPF,QAAQ,EAAE,EAAE;MACZG,UAAU,EAAE,mBAAmB;MAC/BF,UAAU,EAAE;IACd,CAAC;IACDG,OAAO,EAAE;MACPJ,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd;EACF,CAAC;AACH,CAAC,CAAC"}

View File

@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getDefaultHeaderHeight;
var _reactNative = require("react-native");
function getDefaultHeaderHeight(layout, modalPresentation, statusBarHeight) {
let headerHeight;
const isLandscape = layout.width > layout.height;
if (_reactNative.Platform.OS === 'ios') {
if (_reactNative.Platform.isPad || _reactNative.Platform.isTV) {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 50;
}
} else {
if (isLandscape) {
headerHeight = 32;
} else {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 44;
}
}
}
} else if (_reactNative.Platform.OS === 'android') {
headerHeight = 56;
} else {
headerHeight = 64;
}
return headerHeight + statusBarHeight;
}
//# sourceMappingURL=getDefaultHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","Platform","OS","isPad","isTV"],"sourceRoot":"../../../src","sources":["Header/getDefaultHeaderHeight.tsx"],"mappings":";;;;;;AAAA;AAIe,SAASA,sBAAsB,CAC5CC,MAAc,EACdC,iBAA0B,EAC1BC,eAAuB,EACf;EACR,IAAIC,YAAY;EAEhB,MAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAK,GAAGL,MAAM,CAACM,MAAM;EAEhD,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,IAAID,qBAAQ,CAACE,KAAK,IAAIF,qBAAQ,CAACG,IAAI,EAAE;MACnC,IAAIT,iBAAiB,EAAE;QACrBE,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACLA,YAAY,GAAG,EAAE;MACnB;IACF,CAAC,MAAM;MACL,IAAIC,WAAW,EAAE;QACfD,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACL,IAAIF,iBAAiB,EAAE;UACrBE,YAAY,GAAG,EAAE;QACnB,CAAC,MAAM;UACLA,YAAY,GAAG,EAAE;QACnB;MACF;IACF;EACF,CAAC,MAAM,IAAII,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;IACpCL,YAAY,GAAG,EAAE;EACnB,CAAC,MAAM;IACLA,YAAY,GAAG,EAAE;EACnB;EAEA,OAAOA,YAAY,GAAGD,eAAe;AACvC"}

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getHeaderTitle;
function getHeaderTitle(options, fallback) {
return typeof options.headerTitle === 'string' ? options.headerTitle : options.title !== undefined ? options.title : fallback;
}
//# sourceMappingURL=getHeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"sourceRoot":"../../../src","sources":["Header/getHeaderTitle.tsx"],"mappings":";;;;;;AAEe,SAASA,cAAc,CACpCC,OAAuE,EACvEC,QAAgB,EACR;EACR,OAAO,OAAOD,OAAO,CAACE,WAAW,KAAK,QAAQ,GAC1CF,OAAO,CAACE,WAAW,GACnBF,OAAO,CAACG,KAAK,KAAKC,SAAS,GAC3BJ,OAAO,CAACG,KAAK,GACbF,QAAQ;AACd"}

View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useHeaderHeight;
var React = _interopRequireWildcard(require("react"));
var _HeaderHeightContext = _interopRequireDefault(require("./HeaderHeightContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function useHeaderHeight() {
const height = React.useContext(_HeaderHeightContext.default);
if (height === undefined) {
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
}
return height;
}
//# sourceMappingURL=useHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useHeaderHeight","height","React","useContext","HeaderHeightContext","undefined","Error"],"sourceRoot":"../../../src","sources":["Header/useHeaderHeight.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAwD;AAAA;AAAA;AAEzC,SAASA,eAAe,GAAG;EACxC,MAAMC,MAAM,GAAGC,KAAK,CAACC,UAAU,CAACC,4BAAmB,CAAC;EAEpD,IAAIH,MAAM,KAAKI,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,wFAAwF,CACzF;EACH;EAEA,OAAOL,MAAM;AACf"}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _MaskedViewNative.default;
}
});
var _MaskedViewNative = _interopRequireDefault(require("./MaskedViewNative"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=MaskedView.android.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../src","sources":["MaskedView.android.tsx"],"mappings":";;;;;;;;;;;AAAA;AAA6C"}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _MaskedViewNative.default;
}
});
var _MaskedViewNative = _interopRequireDefault(require("./MaskedViewNative"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=MaskedView.ios.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../src","sources":["MaskedView.ios.tsx"],"mappings":";;;;;;;;;;;AAAA;AAA6C"}

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = MaskedView;
/**
* Use a stub for MaskedView on all Platforms that don't support it.
*/
function MaskedView(_ref) {
let {
children
} = _ref;
return children;
}
//# sourceMappingURL=MaskedView.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["MaskedView","children"],"sourceRoot":"../../src","sources":["MaskedView.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;;AAQe,SAASA,UAAU,OAAsB;EAAA,IAArB;IAAEC;EAAgB,CAAC;EACpD,OAAOA,QAAQ;AACjB"}

View File

@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = MaskedView;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/**
* The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
*/
let RNCMaskedView;
try {
// Add try/catch to support usage even if it's not installed, since it's optional.
// Newer versions of Metro will handle it properly.
RNCMaskedView = require('@react-native-masked-view/masked-view').default;
} catch (e) {
// Ignore
}
const isMaskedViewAvailable = _reactNative.UIManager.getViewManagerConfig('RNCMaskedView') != null;
function MaskedView(_ref) {
let {
children,
...rest
} = _ref;
if (isMaskedViewAvailable && RNCMaskedView) {
return /*#__PURE__*/React.createElement(RNCMaskedView, rest, children);
}
return children;
}
//# sourceMappingURL=MaskedViewNative.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["RNCMaskedView","require","default","e","isMaskedViewAvailable","UIManager","getViewManagerConfig","MaskedView","children","rest"],"sourceRoot":"../../src","sources":["MaskedViewNative.tsx"],"mappings":";;;;;;AAGA;AACA;AAAyC;AAAA;AAJzC;AACA;AACA;;AAWA,IAAIA,aAAyC;AAE7C,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAuC,CAAC,CAACC,OAAO;AAC1E,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,MAAMC,qBAAqB,GACzBC,sBAAS,CAACC,oBAAoB,CAAC,eAAe,CAAC,IAAI,IAAI;AAE1C,SAASC,UAAU,OAA+B;EAAA,IAA9B;IAAEC,QAAQ;IAAE,GAAGC;EAAY,CAAC;EAC7D,IAAIL,qBAAqB,IAAIJ,aAAa,EAAE;IAC1C,oBAAO,oBAAC,aAAa,EAAKS,IAAI,EAAGD,QAAQ,CAAiB;EAC5D;EAEA,OAAOA,QAAQ;AACjB"}

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = MissingIcon;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function MissingIcon(_ref) {
let {
color,
size,
style
} = _ref;
return /*#__PURE__*/React.createElement(_reactNative.Text, {
style: [styles.icon, {
color,
fontSize: size
}, style]
}, "\u23F7");
}
const styles = _reactNative.StyleSheet.create({
icon: {
backgroundColor: 'transparent'
}
});
//# sourceMappingURL=MissingIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["MissingIcon","color","size","style","styles","icon","fontSize","StyleSheet","create","backgroundColor"],"sourceRoot":"../../src","sources":["MissingIcon.tsx"],"mappings":";;;;;;AAAA;AACA;AAAsE;AAAA;AAQvD,SAASA,WAAW,OAAgC;EAAA,IAA/B;IAAEC,KAAK;IAAEC,IAAI;IAAEC;EAAa,CAAC;EAC/D,oBAAO,oBAAC,iBAAI;IAAC,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAE;MAAEJ,KAAK;MAAEK,QAAQ,EAAEJ;IAAK,CAAC,EAAEC,KAAK;EAAE,YAAS;AAC/E;AAEA,MAAMC,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,IAAI,EAAE;IACJI,eAAe,EAAE;EACnB;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,65 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = PlatformPressable;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
const AnimatedPressable = _reactNative.Animated.createAnimatedComponent(_reactNative.Pressable);
const ANDROID_VERSION_LOLLIPOP = 21;
const ANDROID_SUPPORTS_RIPPLE = _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= ANDROID_VERSION_LOLLIPOP;
/**
* PlatformPressable provides an abstraction on top of Pressable to handle platform differences.
*/
function PlatformPressable(_ref) {
let {
onPressIn,
onPressOut,
android_ripple,
pressColor,
pressOpacity = 0.3,
style,
...rest
} = _ref;
const {
dark
} = (0, _native.useTheme)();
const [opacity] = React.useState(() => new _reactNative.Animated.Value(1));
const animateTo = (toValue, duration) => {
if (ANDROID_SUPPORTS_RIPPLE) {
return;
}
_reactNative.Animated.timing(opacity, {
toValue,
duration,
easing: _reactNative.Easing.inOut(_reactNative.Easing.quad),
useNativeDriver: true
}).start();
};
const handlePressIn = e => {
animateTo(pressOpacity, 0);
onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
};
const handlePressOut = e => {
animateTo(1, 200);
onPressOut === null || onPressOut === void 0 ? void 0 : onPressOut(e);
};
return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
onPressIn: handlePressIn,
onPressOut: handlePressOut,
android_ripple: ANDROID_SUPPORTS_RIPPLE ? {
color: pressColor !== undefined ? pressColor : dark ? 'rgba(255, 255, 255, .32)' : 'rgba(0, 0, 0, .32)',
...android_ripple
} : undefined,
style: [{
opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1
}, style]
}, rest));
}
//# sourceMappingURL=PlatformPressable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["AnimatedPressable","Animated","createAnimatedComponent","Pressable","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","Platform","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","useTheme","opacity","React","useState","Value","animateTo","toValue","duration","timing","easing","Easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sourceRoot":"../../src","sources":["Plat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B,CAAC;EAED,oBACE,oBAAC,iBAAiB;IAChB,SAAS,EAAED,aAAc;IACzB,UAAU,EAAEE,cAAe;IAC3B,cAAc,EACZ9B,uBAAuB,GACnB;MACE+B,KAAK,EACHvB,UAAU,KAAKwB,SAAS,GACpBxB,UAAU,GACVI,IAAI,GACJ,0BAA0B,GAC1B,oBAAoB;MAC1B,GAAGL;IACL,CAAC,GACDyB,SACL;IACD,KAAK,EAAE,CAAC;MAAElB,OAAO,EAAE,CAACd,uBAAuB,GAAGc,OAAO,GAAG;IAAE,CAAC,EAAEJ,KAAK;EAAE,GAChEC,IAAI,EACR;AAEN"}

View File

@@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ResourceSavingScene;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
function ResourceSavingScene(_ref) {
let {
visible,
children,
style,
...rest
} = _ref;
if (_reactNative.Platform.OS === 'web') {
return /*#__PURE__*/React.createElement(_reactNative.View
// @ts-expect-error: hidden exists on web, but not in React Native
, _extends({
hidden: !visible,
style: [{
display: visible ? 'flex' : 'none'
}, styles.container, style],
pointerEvents: visible ? 'auto' : 'none'
}, rest), children);
}
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, style]
// box-none doesn't seem to work properly on Android
,
pointerEvents: visible ? 'auto' : 'none'
}, /*#__PURE__*/React.createElement(_reactNative.View, {
collapsable: false,
removeClippedSubviews:
// On iOS & macOS, set removeClippedSubviews to true only when not focused
// This is an workaround for a bug where the clipped view never re-appears
_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'macos' ? !visible : true,
pointerEvents: visible ? 'auto' : 'none',
style: visible ? styles.attached : styles.detached
}, children));
}
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
overflow: 'hidden'
},
attached: {
flex: 1
},
detached: {
flex: 1,
top: FAR_FAR_AWAY
}
});
//# sourceMappingURL=ResourceSavingView.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","Platform","OS","display","styles","container","attached","detached","StyleSheet","create","flex","overflow","top"],"sourceRoot":"../../src","sources":["ResourceSavingView.tsx"],"mappings":";;;;;;AAAA;AACA;AAAgF;AAAA;AAAA;AAQhF,MAAMA,YAAY,GAAG,KAAK,CAAC,CAAC;;AAEb,SAASC,mBAAmB,OAKjC;EAAA,IALkC;IAC1CC,OAAO;IACPC,QAAQ;IACRC,KAAK;IACL,GAAGC;EACE,CAAC;EACN,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,oBACE,oBAAC;IACC;IAAA;MACA,MAAM,EAAE,CAACL,OAAQ;MACjB,KAAK,EAAE,CACL;QAAEM,OAAO,EAAEN,OAAO,GAAG,MAAM,GAAG;MAAO,CAAC,EACtCO,MAAM,CAACC,SAAS,EAChBN,KAAK,CACL;MACF,aAAa,EAAEF,OAAO,GAAG,MAAM,GAAG;IAAO,GACrCG,IAAI,GAEPF,QAAQ,CACJ;EAEX;EAEA,oBACE,oBAAC,iBAAI;IACH,KAAK,EAAE,CAACM,MAAM,CAACC,SAAS,EAAEN,KAAK;IAC/B;IAAA;IACA,aAAa,EAAEF,OAAO,GAAG,MAAM,GAAG;EAAO,gBAEzC,oBAAC,iBAAI;IACH,WAAW,EAAE,KAAM;IACnB,qBAAqB;IACnB;IACA;IACAI,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAID,qBAAQ,CAACC,EAAE,KAAK,OAAO,GAAG,CAACL,OAAO,GAAG,IAC/D;IACD,aAAa,EAAEA,OAAO,GAAG,MAAM,GAAG,MAAO;IACzC,KAAK,EAAEA,OAAO,GAAGO,MAAM,CAACE,QAAQ,GAAGF,MAAM,CAACG;EAAS,GAElDT,QAAQ,CACJ,CACF;AAEX;AAEA,MAAMM,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ,CAAC;EACDL,QAAQ,EAAE;IACRI,IAAI,EAAE;EACR,CAAC;EACDH,QAAQ,EAAE;IACRG,IAAI,EAAE,CAAC;IACPE,GAAG,EAAEjB;EACP;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,125 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = SafeAreaProviderCompat;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const {
width = 0,
height = 0
} = _reactNative.Dimensions.get('window');
// To support SSR on web, we need to have empty insets for initial values
// Otherwise there can be mismatch between SSR and client output
// We also need to specify empty values to support tests environments
const initialMetrics = _reactNative.Platform.OS === 'web' || _reactNativeSafeAreaContext.initialWindowMetrics == null ? {
frame: {
x: 0,
y: 0,
width,
height
},
insets: {
top: 0,
left: 0,
right: 0,
bottom: 0
}
} : _reactNativeSafeAreaContext.initialWindowMetrics;
function SafeAreaProviderCompat(_ref) {
let {
children,
style
} = _ref;
const insets = React.useContext(_reactNativeSafeAreaContext.SafeAreaInsetsContext);
if (insets) {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// https://github.com/react-navigation/react-navigation/issues/174
return /*#__PURE__*/React.createElement(_reactNative.View, {
style: [styles.container, style]
}, children);
}
if (_reactNative.Platform.OS === 'web') {
children = /*#__PURE__*/React.createElement(SafeAreaFrameProvider, {
initialMetrics: initialMetrics
}, children);
}
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaProvider, {
initialMetrics: initialMetrics,
style: style
}, children);
}
// FIXME: On the Web, the safe area frame value doesn't update on resize
// So we workaround this by measuring the frame on resize
const SafeAreaFrameProvider = _ref2 => {
let {
initialMetrics,
children
} = _ref2;
const element = React.useRef(null);
const [frame, setFrame] = React.useState(initialMetrics.frame);
React.useEffect(() => {
if (element.current == null) {
return;
}
const rect = element.current.getBoundingClientRect();
setFrame({
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
});
let timeout;
const observer = new ResizeObserver(entries => {
const entry = entries[0];
if (entry) {
const {
x,
y,
width,
height
} = entry.contentRect;
// Debounce the frame updates to avoid too many updates in a short time
clearTimeout(timeout);
timeout = setTimeout(() => {
setFrame({
x,
y,
width,
height
});
}, 100);
}
});
observer.observe(element.current);
return () => {
observer.disconnect();
clearTimeout(timeout);
};
}, []);
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaFrameContext.Provider, {
value: frame
}, /*#__PURE__*/React.createElement("div", {
ref: element,
style: {
..._reactNative.StyleSheet.absoluteFillObject,
pointerEvents: 'none',
visibility: 'hidden'
}
}), children);
};
SafeAreaProviderCompat.initialMetrics = initialMetrics;
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1
}
});
//# sourceMappingURL=SafeAreaProviderCompat.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["width","height","Dimensions","get","initialMetrics","Platform","OS","initialWindowMetrics","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","React","useContext","SafeAreaInsetsContext","styles","container","SafeAreaFrameProvider","element","useRef","setFrame","useState","useEffect","current","rect","getBoundingClientRect","timeout","observer","ResizeObserver","entries","entry","contentRect","clearTimeout","setTimeout","observe","disconnect","StyleSheet","absoluteFillObject","pointerEvents","visibility","create","flex"],"sourceRoot":"../../src","sources":["SafeAreaProviderCompat.tsx"],"mappings":";;;;;;AAAA;AACA;AAQA;AAMwC;AAAA;AAOxC,MAAM;EAAEA,KAAK,GAAG,CAAC;EAAEC,MAAM,GAAG;AAAE,CAAC,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;;AAE1D;AACA;AACA;AACA,MAAM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qB,uBAAU,CAACI,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IACTyB,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,76 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Screen;
var _native = require("@react-navigation/native");
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
var _Background = _interopRequireDefault(require("./Background"));
var _getDefaultHeaderHeight = _interopRequireDefault(require("./Header/getDefaultHeaderHeight"));
var _HeaderHeightContext = _interopRequireDefault(require("./Header/HeaderHeightContext"));
var _HeaderShownContext = _interopRequireDefault(require("./Header/HeaderShownContext"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function Screen(props) {
const dimensions = (0, _reactNativeSafeAreaContext.useSafeAreaFrame)();
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
const isParentHeaderShown = React.useContext(_HeaderShownContext.default);
const parentHeaderHeight = React.useContext(_HeaderHeightContext.default);
const {
focused,
modal = false,
header,
headerShown = true,
headerTransparent,
headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,
navigation,
route,
children,
style
} = props;
const [headerHeight, setHeaderHeight] = React.useState(() => (0, _getDefaultHeaderHeight.default)(dimensions, modal, headerStatusBarHeight));
return /*#__PURE__*/React.createElement(_Background.default, {
accessibilityElementsHidden: !focused,
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
style: [styles.container, style]
}, /*#__PURE__*/React.createElement(_reactNative.View, {
style: styles.content
}, /*#__PURE__*/React.createElement(_HeaderShownContext.default.Provider, {
value: isParentHeaderShown || headerShown !== false
}, /*#__PURE__*/React.createElement(_HeaderHeightContext.default.Provider, {
value: headerShown ? headerHeight : parentHeaderHeight ?? 0
}, children))), headerShown ? /*#__PURE__*/React.createElement(_native.NavigationContext.Provider, {
value: navigation
}, /*#__PURE__*/React.createElement(_native.NavigationRouteContext.Provider, {
value: route
}, /*#__PURE__*/React.createElement(_reactNative.View, {
onLayout: e => {
const {
height
} = e.nativeEvent.layout;
setHeaderHeight(height);
},
style: headerTransparent ? styles.absolute : null
}, header))) : null);
}
const styles = _reactNative.StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column-reverse'
},
// This is necessary to avoid applying 'column-reverse' to screen content
content: {
flex: 1
},
absolute: {
position: 'absolute',
top: 0,
left: 0,
right: 0
}
});
//# sourceMappingURL=Screen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Screen","props","dimensions","useSafeAreaFrame","insets","useSafeAreaInsets","isParentHeaderShown","React","useContext","HeaderShownContext","parentHeaderHeight","HeaderHeightContext","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","getDefaultHeaderHeight","styles","container","content","e","height","nativeEvent","layout","absolute","StyleSheet","create","flex","flexDirection","position","left","right"],"sourceRoot":"../../src","sources":["Screen.tsx"],"mappings":";;;;;;AAAA;AAOA;AACA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EAAEI;EAAW,gBAC5C,oBAAC,8BAAsB,CAAC,QAAQ;IAAC,KAAK,EAAEC;EAAM,gBAC5C,oBAAC,iBAAI;IACH,QAAQ,EAAGU,CAAC,IAAK;MACf,MAAM;QAAEC;MAAO,CAAC,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM;MAEvCT,eAAe,CAACO,MAAM,CAAC;IACzB,CAAE;IACF,KAAK,EAAEf,iBAAiB,GAAGW,MAAM,CAACO,QAAQ,GAAG;EAAK,GAEjDpB,MAAM,CACF,CACyB,CACP,GAC3B,IAAI,CACG;AAEjB;AAEA,MAAMa,MAAM,GAAGQ,uBAAU,CAACC,MAAM,CAAC;EAC/BR,SAAS,EAAE;IACTS,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE;EACjB,CAAC;EACD;EACAT,OAAO,EAAE;IACPQ,IAAI,EAAE;EACR,CAAC;EACDH,QAAQ,EAAE;IACRK,QAAQ,EAAE,UAAU;IACpBrB,GAAG,EAAE,CAAC;IACNsB,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE;EACT;AACF,CAAC,CAAC"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getNamedContext;
var React = _interopRequireWildcard(require("react"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const contexts = '__react_navigation__elements_contexts';
// We use a global variable to keep our contexts so that we can reuse same contexts across packages
global[contexts] = global[contexts] ?? new Map();
function getNamedContext(name, initialValue) {
let context = global[contexts].get(name);
if (context) {
return context;
}
context = /*#__PURE__*/React.createContext(initialValue);
context.displayName = name;
global[contexts].set(name, context);
return context;
}
//# sourceMappingURL=getNamedContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["contexts","global","Map","getNamedContext","name","initialValue","context","get","React","createContext","displayName","set"],"sourceRoot":"../../src","sources":["getNamedContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAE/B,MAAMA,QAAQ,GAAG,uCAAuC;AAMxD;AACAC,MAAM,CAACD,QAAQ,CAAC,GAAGC,MAAM,CAACD,QAAQ,CAAC,IAAI,IAAIE,GAAG,EAA8B;AAE7D,SAASC,eAAe,CACrCC,IAAY,EACZC,YAAe,EACG;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAQ,CAAC,CAACO,GAAG,CAACH,IAAI,CAAC;EAExC,IAAIE,OAAO,EAAE;IACX,OAAOA,OAAO;EAChB;EAEAA,OAAO,gBAAGE,KAAK,CAACC,aAAa,CAAIJ,YAAY,CAAC;EAC9CC,OAAO,CAACI,WAAW,GAAGN,IAAI;EAE1BH,MAAM,CAACD,QAAQ,CAAC,CAACW,GAAG,CAACP,IAAI,EAAEE,OAAO,CAAC;EAEnC,OAAOA,OAAO;AAChB"}

View File

@@ -0,0 +1,157 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
Assets: true,
Background: true,
getDefaultHeaderHeight: true,
getHeaderTitle: true,
Header: true,
HeaderBackButton: true,
HeaderBackContext: true,
HeaderBackground: true,
HeaderHeightContext: true,
HeaderShownContext: true,
HeaderTitle: true,
useHeaderHeight: true,
MissingIcon: true,
PlatformPressable: true,
ResourceSavingView: true,
SafeAreaProviderCompat: true,
Screen: true
};
exports.Assets = void 0;
Object.defineProperty(exports, "Background", {
enumerable: true,
get: function () {
return _Background.default;
}
});
Object.defineProperty(exports, "Header", {
enumerable: true,
get: function () {
return _Header.default;
}
});
Object.defineProperty(exports, "HeaderBackButton", {
enumerable: true,
get: function () {
return _HeaderBackButton.default;
}
});
Object.defineProperty(exports, "HeaderBackContext", {
enumerable: true,
get: function () {
return _HeaderBackContext.default;
}
});
Object.defineProperty(exports, "HeaderBackground", {
enumerable: true,
get: function () {
return _HeaderBackground.default;
}
});
Object.defineProperty(exports, "HeaderHeightContext", {
enumerable: true,
get: function () {
return _HeaderHeightContext.default;
}
});
Object.defineProperty(exports, "HeaderShownContext", {
enumerable: true,
get: function () {
return _HeaderShownContext.default;
}
});
Object.defineProperty(exports, "HeaderTitle", {
enumerable: true,
get: function () {
return _HeaderTitle.default;
}
});
Object.defineProperty(exports, "MissingIcon", {
enumerable: true,
get: function () {
return _MissingIcon.default;
}
});
Object.defineProperty(exports, "PlatformPressable", {
enumerable: true,
get: function () {
return _PlatformPressable.default;
}
});
Object.defineProperty(exports, "ResourceSavingView", {
enumerable: true,
get: function () {
return _ResourceSavingView.default;
}
});
Object.defineProperty(exports, "SafeAreaProviderCompat", {
enumerable: true,
get: function () {
return _SafeAreaProviderCompat.default;
}
});
Object.defineProperty(exports, "Screen", {
enumerable: true,
get: function () {
return _Screen.default;
}
});
Object.defineProperty(exports, "getDefaultHeaderHeight", {
enumerable: true,
get: function () {
return _getDefaultHeaderHeight.default;
}
});
Object.defineProperty(exports, "getHeaderTitle", {
enumerable: true,
get: function () {
return _getHeaderTitle.default;
}
});
Object.defineProperty(exports, "useHeaderHeight", {
enumerable: true,
get: function () {
return _useHeaderHeight.default;
}
});
var _Background = _interopRequireDefault(require("./Background"));
var _getDefaultHeaderHeight = _interopRequireDefault(require("./Header/getDefaultHeaderHeight"));
var _getHeaderTitle = _interopRequireDefault(require("./Header/getHeaderTitle"));
var _Header = _interopRequireDefault(require("./Header/Header"));
var _HeaderBackButton = _interopRequireDefault(require("./Header/HeaderBackButton"));
var _HeaderBackContext = _interopRequireDefault(require("./Header/HeaderBackContext"));
var _HeaderBackground = _interopRequireDefault(require("./Header/HeaderBackground"));
var _HeaderHeightContext = _interopRequireDefault(require("./Header/HeaderHeightContext"));
var _HeaderShownContext = _interopRequireDefault(require("./Header/HeaderShownContext"));
var _HeaderTitle = _interopRequireDefault(require("./Header/HeaderTitle"));
var _useHeaderHeight = _interopRequireDefault(require("./Header/useHeaderHeight"));
var _MissingIcon = _interopRequireDefault(require("./MissingIcon"));
var _PlatformPressable = _interopRequireDefault(require("./PlatformPressable"));
var _ResourceSavingView = _interopRequireDefault(require("./ResourceSavingView"));
var _SafeAreaProviderCompat = _interopRequireDefault(require("./SafeAreaProviderCompat"));
var _Screen = _interopRequireDefault(require("./Screen"));
var _types = require("./types");
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _types[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _types[key];
}
});
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const Assets = [
// eslint-disable-next-line import/no-commonjs
require('./assets/back-icon.png'),
// eslint-disable-next-line import/no-commonjs
require('./assets/back-icon-mask.png')];
exports.Assets = Assets;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Assets","require"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAAwB;AAPjB,MAAMA,MAAM,GAAG;AACpB;AACAC,OAAO,CAAC,wBAAwB,CAAC;AACjC;AACAA,OAAO,CAAC,6BAA6B,CAAC,CACvC;AAAC"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}

View File

@@ -0,0 +1,20 @@
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { View } from 'react-native';
export default function Background(_ref) {
let {
style,
...rest
} = _ref;
const {
colors
} = useTheme();
return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
style: [{
flex: 1,
backgroundColor: colors.background
}, style]
}));
}
//# sourceMappingURL=Background.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useTheme","React","View","Background","style","rest","colors","flex","backgroundColor","background"],"sourceRoot":"../../src","sources":["Background.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAM9C,eAAe,SAASC,UAAU,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAGN,QAAQ,EAAE;EAE7B,oBACE,oBAAC,IAAI,eACCK,IAAI;IACR,KAAK,EAAE,CAAC;MAAEE,IAAI,EAAE,CAAC;MAAEC,eAAe,EAAEF,MAAM,CAACG;IAAW,CAAC,EAAEL,KAAK;EAAE,GAChE;AAEN"}

View File

@@ -0,0 +1,234 @@
import * as React from 'react';
import { Animated, Platform, StyleSheet, View } from 'react-native';
import { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';
import getDefaultHeaderHeight from './getDefaultHeaderHeight';
import HeaderBackground from './HeaderBackground';
import HeaderShownContext from './HeaderShownContext';
import HeaderTitle from './HeaderTitle';
const warnIfHeaderStylesDefined = styles => {
Object.keys(styles).forEach(styleProp => {
const value = styles[styleProp];
if (styleProp === 'position' && value === 'absolute') {
console.warn("position: 'absolute' is not supported on headerStyle. If you would like to render content under the header, use the 'headerTransparent' option.");
} else if (value !== undefined) {
console.warn(`${styleProp} was given a value of ${value}, this has no effect on headerStyle.`);
}
});
};
export default function Header(props) {
const insets = useSafeAreaInsets();
const frame = useSafeAreaFrame();
const isParentHeaderShown = React.useContext(HeaderShownContext);
// On models with Dynamic Island the status bar height is smaller than the safe area top inset.
const hasDynamicIsland = Platform.OS === 'ios' && insets.top > 50;
const statusBarHeight = hasDynamicIsland ? insets.top - 5 : insets.top;
const {
layout = frame,
modal = false,
title,
headerTitle: customTitle,
headerTitleAlign = Platform.select({
ios: 'center',
default: 'left'
}),
headerLeft,
headerLeftLabelVisible,
headerTransparent,
headerTintColor,
headerBackground,
headerRight,
headerTitleAllowFontScaling: titleAllowFontScaling,
headerTitleStyle: titleStyle,
headerLeftContainerStyle: leftContainerStyle,
headerRightContainerStyle: rightContainerStyle,
headerTitleContainerStyle: titleContainerStyle,
headerBackgroundContainerStyle: backgroundContainerStyle,
headerStyle: customHeaderStyle,
headerShadowVisible,
headerPressColor,
headerPressOpacity,
headerStatusBarHeight = isParentHeaderShown ? 0 : statusBarHeight
} = props;
const defaultHeight = getDefaultHeaderHeight(layout, modal, headerStatusBarHeight);
const {
height = defaultHeight,
minHeight,
maxHeight,
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: web support for shadow
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform,
...unsafeStyles
} = StyleSheet.flatten(customHeaderStyle || {});
if (process.env.NODE_ENV !== 'production') {
warnIfHeaderStylesDefined(unsafeStyles);
}
const safeStyles = {
backgroundColor,
borderBottomColor,
borderBottomEndRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
borderBottomStartRadius,
borderBottomWidth,
borderColor,
borderEndColor,
borderEndWidth,
borderLeftColor,
borderLeftWidth,
borderRadius,
borderRightColor,
borderRightWidth,
borderStartColor,
borderStartWidth,
borderStyle,
borderTopColor,
borderTopEndRadius,
borderTopLeftRadius,
borderTopRightRadius,
borderTopStartRadius,
borderTopWidth,
borderWidth,
// @ts-expect-error: boxShadow is only for Web
boxShadow,
elevation,
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
opacity,
transform
};
// Setting a property to undefined triggers default style
// So we need to filter them out
// Users can use `null` instead
for (const styleProp in safeStyles) {
// @ts-expect-error: typescript wrongly complains that styleProp cannot be used to index safeStyles
if (safeStyles[styleProp] === undefined) {
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete safeStyles[styleProp];
}
}
const backgroundStyle = [safeStyles, headerShadowVisible === false && {
elevation: 0,
shadowOpacity: 0,
borderBottomWidth: 0
}];
const leftButton = headerLeft ? headerLeft({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity,
labelVisible: headerLeftLabelVisible
}) : null;
const rightButton = headerRight ? headerRight({
tintColor: headerTintColor,
pressColor: headerPressColor,
pressOpacity: headerPressOpacity
}) : null;
const headerTitle = typeof customTitle !== 'function' ? props => /*#__PURE__*/React.createElement(HeaderTitle, props) : customTitle;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Animated.View, {
pointerEvents: "box-none",
style: [StyleSheet.absoluteFill, {
zIndex: 0
}, backgroundContainerStyle]
}, headerBackground ? headerBackground({
style: backgroundStyle
}) : headerTransparent ? null : /*#__PURE__*/React.createElement(HeaderBackground, {
style: backgroundStyle
})), /*#__PURE__*/React.createElement(Animated.View, {
pointerEvents: "box-none",
style: [{
height,
minHeight,
maxHeight,
opacity,
transform
}]
}, /*#__PURE__*/React.createElement(View, {
pointerEvents: "none",
style: {
height: headerStatusBarHeight
}
}), /*#__PURE__*/React.createElement(View, {
pointerEvents: "box-none",
style: styles.content
}, /*#__PURE__*/React.createElement(Animated.View, {
pointerEvents: "box-none",
style: [styles.left, headerTitleAlign === 'center' && styles.expand, {
marginStart: insets.left
}, leftContainerStyle]
}, leftButton), /*#__PURE__*/React.createElement(Animated.View, {
pointerEvents: "box-none",
style: [styles.title, {
// Avoid the title from going offscreen or overlapping buttons
maxWidth: headerTitleAlign === 'center' ? layout.width - ((leftButton ? headerLeftLabelVisible !== false ? 80 : 32 : 16) + Math.max(insets.left, insets.right)) * 2 : layout.width - ((leftButton ? 72 : 16) + (rightButton ? 72 : 16) + insets.left - insets.right)
}, titleContainerStyle]
}, headerTitle({
children: title,
allowFontScaling: titleAllowFontScaling,
tintColor: headerTintColor,
style: titleStyle
})), /*#__PURE__*/React.createElement(Animated.View, {
pointerEvents: "box-none",
style: [styles.right, styles.expand, {
marginEnd: insets.right
}, rightContainerStyle]
}, rightButton))));
}
const styles = StyleSheet.create({
content: {
flex: 1,
flexDirection: 'row',
alignItems: 'stretch'
},
title: {
marginHorizontal: 16,
justifyContent: 'center'
},
left: {
justifyContent: 'center',
alignItems: 'flex-start'
},
right: {
justifyContent: 'center',
alignItems: 'flex-end'
},
expand: {
flexGrow: 1,
flexBasis: 0
}
});
//# sourceMappingURL=Header.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,199 @@
import { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Animated, I18nManager, Image, Platform, StyleSheet, View } from 'react-native';
import MaskedView from '../MaskedView';
import PlatformPressable from '../PlatformPressable';
export default function HeaderBackButton(_ref) {
let {
disabled,
allowFontScaling,
backImage,
label,
labelStyle,
labelVisible = Platform.OS === 'ios',
onLabelLayout,
onPress,
pressColor,
pressOpacity,
screenLayout,
tintColor: customTintColor,
titleLayout,
truncatedLabel = 'Back',
accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',
testID,
style
} = _ref;
const {
colors
} = useTheme();
const [initialLabelWidth, setInitialLabelWidth] = React.useState(undefined);
const tintColor = customTintColor !== undefined ? customTintColor : Platform.select({
ios: colors.primary,
default: colors.text
});
const handleLabelLayout = e => {
onLabelLayout === null || onLabelLayout === void 0 ? void 0 : onLabelLayout(e);
setInitialLabelWidth(e.nativeEvent.layout.x + e.nativeEvent.layout.width);
};
const shouldTruncateLabel = () => {
return !label || initialLabelWidth && titleLayout && screenLayout && (screenLayout.width - titleLayout.width) / 2 < initialLabelWidth + 26;
};
const renderBackImage = () => {
if (backImage) {
return backImage({
tintColor
});
} else {
return /*#__PURE__*/React.createElement(Image, {
style: [styles.icon, Boolean(labelVisible) && styles.iconWithLabel, Boolean(tintColor) && {
tintColor
}],
source: require('../assets/back-icon.png'),
fadeDuration: 0
});
}
};
const renderLabel = () => {
const leftLabelText = shouldTruncateLabel() ? truncatedLabel : label;
if (!labelVisible || leftLabelText === undefined) {
return null;
}
const labelElement = /*#__PURE__*/React.createElement(View, {
style: screenLayout ?
// We make the button extend till the middle of the screen
// Otherwise it appears to cut off when translating
[styles.labelWrapper, {
minWidth: screenLayout.width / 2 - 27
}] : null
}, /*#__PURE__*/React.createElement(Animated.Text, {
accessible: false,
onLayout:
// This measurement is used to determine if we should truncate the label when it doesn't fit
// Only measure it when label is not truncated because we want the measurement of full label
leftLabelText === label ? handleLabelLayout : undefined,
style: [styles.label, tintColor ? {
color: tintColor
} : null, labelStyle],
numberOfLines: 1,
allowFontScaling: !!allowFontScaling
}, leftLabelText));
if (backImage || Platform.OS !== 'ios') {
// When a custom backimage is specified, we can't mask the label
// Otherwise there might be weird effect due to our mask not being the same as the image
return labelElement;
}
return /*#__PURE__*/React.createElement(MaskedView, {
maskElement: /*#__PURE__*/React.createElement(View, {
style: styles.iconMaskContainer
}, /*#__PURE__*/React.createElement(Image, {
source: require('../assets/back-icon-mask.png'),
style: styles.iconMask
}), /*#__PURE__*/React.createElement(View, {
style: styles.iconMaskFillerRect
}))
}, labelElement);
};
const handlePress = () => onPress && requestAnimationFrame(onPress);
return /*#__PURE__*/React.createElement(PlatformPressable, {
disabled: disabled,
accessible: true,
accessibilityRole: "button",
accessibilityLabel: accessibilityLabel,
testID: testID,
onPress: disabled ? undefined : handlePress,
pressColor: pressColor,
pressOpacity: pressOpacity,
android_ripple: androidRipple,
style: [styles.container, disabled && styles.disabled, style],
hitSlop: Platform.select({
ios: undefined,
default: {
top: 16,
right: 16,
bottom: 16,
left: 16
}
})
}, /*#__PURE__*/React.createElement(React.Fragment, null, renderBackImage(), renderLabel()));
}
const androidRipple = {
borderless: true,
foreground: Platform.OS === 'android' && Platform.Version >= 23,
radius: 20
};
const styles = StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
minWidth: StyleSheet.hairlineWidth,
// Avoid collapsing when title is long
...Platform.select({
ios: null,
default: {
marginVertical: 3,
marginHorizontal: 11
}
})
},
disabled: {
opacity: 0.5
},
label: {
fontSize: 17,
// Title and back label are a bit different width due to title being bold
// Adjusting the letterSpacing makes them coincide better
letterSpacing: 0.35
},
labelWrapper: {
// These styles will make sure that the label doesn't fill the available space
// Otherwise it messes with the measurement of the label
flexDirection: 'row',
alignItems: 'flex-start'
},
icon: Platform.select({
ios: {
height: 21,
width: 13,
marginLeft: 8,
marginRight: 22,
marginVertical: 12,
resizeMode: 'contain',
transform: [{
scaleX: I18nManager.getConstants().isRTL ? -1 : 1
}]
},
default: {
height: 24,
width: 24,
margin: 3,
resizeMode: 'contain',
transform: [{
scaleX: I18nManager.getConstants().isRTL ? -1 : 1
}]
}
}),
iconWithLabel: Platform.OS === 'ios' ? {
marginRight: 6
} : {},
iconMaskContainer: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center'
},
iconMaskFillerRect: {
flex: 1,
backgroundColor: '#000'
},
iconMask: {
height: 21,
width: 13,
marginLeft: -14.5,
marginVertical: 12,
alignSelf: 'center',
resizeMode: 'contain',
transform: [{
scaleX: I18nManager.getConstants().isRTL ? -1 : 1
}]
}
});
//# sourceMappingURL=HeaderBackButton.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import getNamedContext from '../getNamedContext';
const HeaderBackContext = getNamedContext('HeaderBackContext', undefined);
export default HeaderBackContext;
//# sourceMappingURL=HeaderBackContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getNamedContext","HeaderBackContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderBackContext.tsx"],"mappings":"AAAA,OAAOA,eAAe,MAAM,oBAAoB;AAEhD,MAAMC,iBAAiB,GAAGD,eAAe,CACvC,mBAAmB,EACnBE,SAAS,CACV;AAED,eAAeD,iBAAiB"}

View File

@@ -0,0 +1,42 @@
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Animated, Platform, StyleSheet } from 'react-native';
export default function HeaderBackground(_ref) {
let {
style,
...rest
} = _ref;
const {
colors
} = useTheme();
return /*#__PURE__*/React.createElement(Animated.View, _extends({
style: [styles.container, {
backgroundColor: colors.card,
borderBottomColor: colors.border,
shadowColor: colors.border
}, style]
}, rest));
}
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
android: {
elevation: 4
},
ios: {
shadowOpacity: 0.85,
shadowRadius: 0,
shadowOffset: {
width: 0,
height: StyleSheet.hairlineWidth
}
},
default: {
borderBottomWidth: StyleSheet.hairlineWidth
}
})
}
});
//# sourceMappingURL=HeaderBackground.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useTheme","React","Animated","Platform","StyleSheet","HeaderBackground","style","rest","colors","styles","container","backgroundColor","card","borderBottomColor","border","shadowColor","create","flex","select","android","elevation","ios","shadowOpacity","shadowRadius","shadowOffset","width","height","hairlineWidth","default","borderBottomWidth"],"sourceRoot":"../../../src","sources":["Header/HeaderBackground.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,QAAQ,EAERC,UAAU,QAGL,cAAc;AAOrB,eAAe,SAASC,gBAAgB,OAA4B;EAAA,IAA3B;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGR,QAAQ,EAAE;EAE7B,oBACE,oBAAC,QAAQ,CAAC,IAAI;IACZ,KAAK,EAAE,CACLS,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEH,MAAM,CAACI,IAAI;MAC5BC,iBAAiB,EAAEL,MAAM,CAACM,MAAM;MAChCC,WAAW,EAAEP,MAAM,CAACM;IACtB,CAAC,EACDR,KAAK;EACL,GACEC,IAAI,EACR;AAEN;AAEA,MAAME,MAAM,GAAGL,UAAU,CAACY,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,IAAI,EAAE,CAAC;IACP,GAAGd,QAAQ,CAACe,MAAM,CAAC;MACjBC,OAAO,EAAE;QACPC,SAAS,EAAE;MACb,CAAC;MACDC,GAAG,EAAE;QACHC,aAAa,EAAE,IAAI;QACnBC,YAAY,EAAE,CAAC;QACfC,YAAY,EAAE;UACZC,KAAK,EAAE,CAAC;UACRC,MAAM,EAAEtB,UAAU,CAACuB;QACrB;MACF,CAAC;MACDC,OAAO,EAAE;QACPC,iBAAiB,EAAEzB,UAAU,CAACuB;MAChC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,4 @@
import getNamedContext from '../getNamedContext';
const HeaderHeightContext = getNamedContext('HeaderHeightContext', undefined);
export default HeaderHeightContext;
//# sourceMappingURL=HeaderHeightContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getNamedContext","HeaderHeightContext","undefined"],"sourceRoot":"../../../src","sources":["Header/HeaderHeightContext.tsx"],"mappings":"AAAA,OAAOA,eAAe,MAAM,oBAAoB;AAEhD,MAAMC,mBAAmB,GAAGD,eAAe,CACzC,qBAAqB,EACrBE,SAAS,CACV;AAED,eAAeD,mBAAmB"}

View File

@@ -0,0 +1,4 @@
import getNamedContext from '../getNamedContext';
const HeaderShownContext = getNamedContext('HeaderShownContext', false);
export default HeaderShownContext;
//# sourceMappingURL=HeaderShownContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getNamedContext","HeaderShownContext"],"sourceRoot":"../../../src","sources":["Header/HeaderShownContext.tsx"],"mappings":"AAAA,OAAOA,eAAe,MAAM,oBAAoB;AAEhD,MAAMC,kBAAkB,GAAGD,eAAe,CAAC,oBAAoB,EAAE,KAAK,CAAC;AAEvE,eAAeC,kBAAkB"}

View File

@@ -0,0 +1,41 @@
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Animated, Platform, StyleSheet } from 'react-native';
export default function HeaderTitle(_ref) {
let {
tintColor,
style,
...rest
} = _ref;
const {
colors
} = useTheme();
return /*#__PURE__*/React.createElement(Animated.Text, _extends({
accessibilityRole: "header",
"aria-level": "1",
numberOfLines: 1
}, rest, {
style: [styles.title, {
color: tintColor === undefined ? colors.text : tintColor
}, style]
}));
}
const styles = StyleSheet.create({
title: Platform.select({
ios: {
fontSize: 17,
fontWeight: '600'
},
android: {
fontSize: 20,
fontFamily: 'sans-serif-medium',
fontWeight: 'normal'
},
default: {
fontSize: 18,
fontWeight: '500'
}
})
});
//# sourceMappingURL=HeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useTheme","React","Animated","Platform","StyleSheet","HeaderTitle","tintColor","style","rest","colors","styles","title","color","undefined","text","create","select","ios","fontSize","fontWeight","android","fontFamily","default"],"sourceRoot":"../../../src","sources":["Header/HeaderTitle.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,QAAQ,EAERC,UAAU,QAGL,cAAc;AAOrB,eAAe,SAASC,WAAW,OAAuC;EAAA,IAAtC;IAAEC,SAAS;IAAEC,KAAK;IAAE,GAAGC;EAAY,CAAC;EACtE,MAAM;IAAEC;EAAO,CAAC,GAAGT,QAAQ,EAAE;EAE7B,oBACE,oBAAC,QAAQ,CAAC,IAAI;IACZ,iBAAiB,EAAC,QAAQ;IAC1B,cAAW,GAAG;IACd,aAAa,EAAE;EAAE,GACbQ,IAAI;IACR,KAAK,EAAE,CACLE,MAAM,CAACC,KAAK,EACZ;MAAEC,KAAK,EAAEN,SAAS,KAAKO,SAAS,GAAGJ,MAAM,CAACK,IAAI,GAAGR;IAAU,CAAC,EAC5DC,KAAK;EACL,GACF;AAEN;AAEA,MAAMG,MAAM,GAAGN,UAAU,CAACW,MAAM,CAAC;EAC/BJ,KAAK,EAAER,QAAQ,CAACa,MAAM,CAAC;IACrBC,GAAG,EAAE;MACHC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPF,QAAQ,EAAE,EAAE;MACZG,UAAU,EAAE,mBAAmB;MAC/BF,UAAU,EAAE;IACd,CAAC;IACDG,OAAO,EAAE;MACPJ,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd;EACF,CAAC;AACH,CAAC,CAAC"}

View File

@@ -0,0 +1,30 @@
import { Platform } from 'react-native';
export default function getDefaultHeaderHeight(layout, modalPresentation, statusBarHeight) {
let headerHeight;
const isLandscape = layout.width > layout.height;
if (Platform.OS === 'ios') {
if (Platform.isPad || Platform.isTV) {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 50;
}
} else {
if (isLandscape) {
headerHeight = 32;
} else {
if (modalPresentation) {
headerHeight = 56;
} else {
headerHeight = 44;
}
}
}
} else if (Platform.OS === 'android') {
headerHeight = 56;
} else {
headerHeight = 64;
}
return headerHeight + statusBarHeight;
}
//# sourceMappingURL=getDefaultHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Platform","getDefaultHeaderHeight","layout","modalPresentation","statusBarHeight","headerHeight","isLandscape","width","height","OS","isPad","isTV"],"sourceRoot":"../../../src","sources":["Header/getDefaultHeaderHeight.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAIvC,eAAe,SAASC,sBAAsB,CAC5CC,MAAc,EACdC,iBAA0B,EAC1BC,eAAuB,EACf;EACR,IAAIC,YAAY;EAEhB,MAAMC,WAAW,GAAGJ,MAAM,CAACK,KAAK,GAAGL,MAAM,CAACM,MAAM;EAEhD,IAAIR,QAAQ,CAACS,EAAE,KAAK,KAAK,EAAE;IACzB,IAAIT,QAAQ,CAACU,KAAK,IAAIV,QAAQ,CAACW,IAAI,EAAE;MACnC,IAAIR,iBAAiB,EAAE;QACrBE,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACLA,YAAY,GAAG,EAAE;MACnB;IACF,CAAC,MAAM;MACL,IAAIC,WAAW,EAAE;QACfD,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACL,IAAIF,iBAAiB,EAAE;UACrBE,YAAY,GAAG,EAAE;QACnB,CAAC,MAAM;UACLA,YAAY,GAAG,EAAE;QACnB;MACF;IACF;EACF,CAAC,MAAM,IAAIL,QAAQ,CAACS,EAAE,KAAK,SAAS,EAAE;IACpCJ,YAAY,GAAG,EAAE;EACnB,CAAC,MAAM;IACLA,YAAY,GAAG,EAAE;EACnB;EAEA,OAAOA,YAAY,GAAGD,eAAe;AACvC"}

View File

@@ -0,0 +1,4 @@
export default function getHeaderTitle(options, fallback) {
return typeof options.headerTitle === 'string' ? options.headerTitle : options.title !== undefined ? options.title : fallback;
}
//# sourceMappingURL=getHeaderTitle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getHeaderTitle","options","fallback","headerTitle","title","undefined"],"sourceRoot":"../../../src","sources":["Header/getHeaderTitle.tsx"],"mappings":"AAEA,eAAe,SAASA,cAAc,CACpCC,OAAuE,EACvEC,QAAgB,EACR;EACR,OAAO,OAAOD,OAAO,CAACE,WAAW,KAAK,QAAQ,GAC1CF,OAAO,CAACE,WAAW,GACnBF,OAAO,CAACG,KAAK,KAAKC,SAAS,GAC3BJ,OAAO,CAACG,KAAK,GACbF,QAAQ;AACd"}

View File

@@ -0,0 +1,10 @@
import * as React from 'react';
import HeaderHeightContext from './HeaderHeightContext';
export default function useHeaderHeight() {
const height = React.useContext(HeaderHeightContext);
if (height === undefined) {
throw new Error("Couldn't find the header height. Are you inside a screen in a navigator with a header?");
}
return height;
}
//# sourceMappingURL=useHeaderHeight.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","HeaderHeightContext","useHeaderHeight","height","useContext","undefined","Error"],"sourceRoot":"../../../src","sources":["Header/useHeaderHeight.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,mBAAmB,MAAM,uBAAuB;AAEvD,eAAe,SAASC,eAAe,GAAG;EACxC,MAAMC,MAAM,GAAGH,KAAK,CAACI,UAAU,CAACH,mBAAmB,CAAC;EAEpD,IAAIE,MAAM,KAAKE,SAAS,EAAE;IACxB,MAAM,IAAIC,KAAK,CACb,wFAAwF,CACzF;EACH;EAEA,OAAOH,MAAM;AACf"}

View File

@@ -0,0 +1,2 @@
export { default } from './MaskedViewNative';
//# sourceMappingURL=MaskedView.android.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["default"],"sourceRoot":"../../src","sources":["MaskedView.android.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,oBAAoB"}

View File

@@ -0,0 +1,2 @@
export { default } from './MaskedViewNative';
//# sourceMappingURL=MaskedView.ios.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["default"],"sourceRoot":"../../src","sources":["MaskedView.ios.tsx"],"mappings":"AAAA,SAASA,OAAO,QAAQ,oBAAoB"}

View File

@@ -0,0 +1,11 @@
/**
* Use a stub for MaskedView on all Platforms that don't support it.
*/
export default function MaskedView(_ref) {
let {
children
} = _ref;
return children;
}
//# sourceMappingURL=MaskedView.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["MaskedView","children"],"sourceRoot":"../../src","sources":["MaskedView.tsx"],"mappings":"AAAA;AACA;AACA;;AAQA,eAAe,SAASA,UAAU,OAAsB;EAAA,IAArB;IAAEC;EAAgB,CAAC;EACpD,OAAOA,QAAQ;AACjB"}

View File

@@ -0,0 +1,25 @@
/**
* The native MaskedView that we explicitly re-export for supported platforms: Android, iOS.
*/
import * as React from 'react';
import { UIManager } from 'react-native';
let RNCMaskedView;
try {
// Add try/catch to support usage even if it's not installed, since it's optional.
// Newer versions of Metro will handle it properly.
RNCMaskedView = require('@react-native-masked-view/masked-view').default;
} catch (e) {
// Ignore
}
const isMaskedViewAvailable = UIManager.getViewManagerConfig('RNCMaskedView') != null;
export default function MaskedView(_ref) {
let {
children,
...rest
} = _ref;
if (isMaskedViewAvailable && RNCMaskedView) {
return /*#__PURE__*/React.createElement(RNCMaskedView, rest, children);
}
return children;
}
//# sourceMappingURL=MaskedViewNative.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","UIManager","RNCMaskedView","require","default","e","isMaskedViewAvailable","getViewManagerConfig","MaskedView","children","rest"],"sourceRoot":"../../src","sources":["MaskedViewNative.tsx"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,cAAc;AASxC,IAAIC,aAAyC;AAE7C,IAAI;EACF;EACA;EACAA,aAAa,GAAGC,OAAO,CAAC,uCAAuC,CAAC,CAACC,OAAO;AAC1E,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,MAAMC,qBAAqB,GACzBL,SAAS,CAACM,oBAAoB,CAAC,eAAe,CAAC,IAAI,IAAI;AAEzD,eAAe,SAASC,UAAU,OAA+B;EAAA,IAA9B;IAAEC,QAAQ;IAAE,GAAGC;EAAY,CAAC;EAC7D,IAAIJ,qBAAqB,IAAIJ,aAAa,EAAE;IAC1C,oBAAO,oBAAC,aAAa,EAAKQ,IAAI,EAAGD,QAAQ,CAAiB;EAC5D;EAEA,OAAOA,QAAQ;AACjB"}

View File

@@ -0,0 +1,21 @@
import * as React from 'react';
import { StyleSheet, Text } from 'react-native';
export default function MissingIcon(_ref) {
let {
color,
size,
style
} = _ref;
return /*#__PURE__*/React.createElement(Text, {
style: [styles.icon, {
color,
fontSize: size
}, style]
}, "\u23F7");
}
const styles = StyleSheet.create({
icon: {
backgroundColor: 'transparent'
}
});
//# sourceMappingURL=MissingIcon.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","StyleSheet","Text","MissingIcon","color","size","style","styles","icon","fontSize","create","backgroundColor"],"sourceRoot":"../../src","sources":["MissingIcon.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAQrE,eAAe,SAASC,WAAW,OAAgC;EAAA,IAA/B;IAAEC,KAAK;IAAEC,IAAI;IAAEC;EAAa,CAAC;EAC/D,oBAAO,oBAAC,IAAI;IAAC,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAE;MAAEJ,KAAK;MAAEK,QAAQ,EAAEJ;IAAK,CAAC,EAAEC,KAAK;EAAE,YAAS;AAC/E;AAEA,MAAMC,MAAM,GAAGN,UAAU,CAACS,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJG,eAAe,EAAE;EACnB;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,57 @@
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 { useTheme } from '@react-navigation/native';
import * as React from 'react';
import { Animated, Easing, Platform, Pressable } from 'react-native';
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
const ANDROID_VERSION_LOLLIPOP = 21;
const ANDROID_SUPPORTS_RIPPLE = Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;
/**
* PlatformPressable provides an abstraction on top of Pressable to handle platform differences.
*/
export default function PlatformPressable(_ref) {
let {
onPressIn,
onPressOut,
android_ripple,
pressColor,
pressOpacity = 0.3,
style,
...rest
} = _ref;
const {
dark
} = useTheme();
const [opacity] = React.useState(() => new Animated.Value(1));
const animateTo = (toValue, duration) => {
if (ANDROID_SUPPORTS_RIPPLE) {
return;
}
Animated.timing(opacity, {
toValue,
duration,
easing: Easing.inOut(Easing.quad),
useNativeDriver: true
}).start();
};
const handlePressIn = e => {
animateTo(pressOpacity, 0);
onPressIn === null || onPressIn === void 0 ? void 0 : onPressIn(e);
};
const handlePressOut = e => {
animateTo(1, 200);
onPressOut === null || onPressOut === void 0 ? void 0 : onPressOut(e);
};
return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
onPressIn: handlePressIn,
onPressOut: handlePressOut,
android_ripple: ANDROID_SUPPORTS_RIPPLE ? {
color: pressColor !== undefined ? pressColor : dark ? 'rgba(255, 255, 255, .32)' : 'rgba(0, 0, 0, .32)',
...android_ripple
} : undefined,
style: [{
opacity: !ANDROID_SUPPORTS_RIPPLE ? opacity : 1
}, style]
}, rest));
}
//# sourceMappingURL=PlatformPressable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["useTheme","React","Animated","Easing","Platform","Pressable","AnimatedPressable","createAnimatedComponent","ANDROID_VERSION_LOLLIPOP","ANDROID_SUPPORTS_RIPPLE","OS","Version","PlatformPressable","onPressIn","onPressOut","android_ripple","pressColor","pressOpacity","style","rest","dark","opacity","useState","Value","animateTo","toValue","duration","timing","easing","inOut","quad","useNativeDriver","start","handlePressIn","e","handlePressOut","color","undefined"],"sourceRoot":"../../src","sources":["PlatformPressable.tsx"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,MAAM,EAENC,QAAQ,EACRC,SAAS,QAIJ,cAAc;AASrB,MAAMC,iBAAiB,GAAGJ,QAAQ,CAACK,uBAAuB,CAACF,SAAS,CAAC;AAErE,MAAMG,wBAAwB,GAAG,EAAE;AACnC,MAAMC,uBAAuB,GAC3BL,QAAQ,CAACM,EAAE,KAAK,S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MAC1B,GAAGL;IACL,CAAC,GACDsB,SACL;IACD,KAAK,EAAE,CAAC;MAAEhB,OAAO,EAAE,CAACZ,uBAAuB,GAAGY,OAAO,GAAG;IAAE,CAAC,EAAEH,KAAK;EAAE,GAChEC,IAAI,EACR;AAEN"}

View File

@@ -0,0 +1,52 @@
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
const FAR_FAR_AWAY = 30000; // this should be big enough to move the whole view out of its container
export default function ResourceSavingScene(_ref) {
let {
visible,
children,
style,
...rest
} = _ref;
if (Platform.OS === 'web') {
return /*#__PURE__*/React.createElement(View
// @ts-expect-error: hidden exists on web, but not in React Native
, _extends({
hidden: !visible,
style: [{
display: visible ? 'flex' : 'none'
}, styles.container, style],
pointerEvents: visible ? 'auto' : 'none'
}, rest), children);
}
return /*#__PURE__*/React.createElement(View, {
style: [styles.container, style]
// box-none doesn't seem to work properly on Android
,
pointerEvents: visible ? 'auto' : 'none'
}, /*#__PURE__*/React.createElement(View, {
collapsable: false,
removeClippedSubviews:
// On iOS & macOS, set removeClippedSubviews to true only when not focused
// This is an workaround for a bug where the clipped view never re-appears
Platform.OS === 'ios' || Platform.OS === 'macos' ? !visible : true,
pointerEvents: visible ? 'auto' : 'none',
style: visible ? styles.attached : styles.detached
}, children));
}
const styles = StyleSheet.create({
container: {
flex: 1,
overflow: 'hidden'
},
attached: {
flex: 1
},
detached: {
flex: 1,
top: FAR_FAR_AWAY
}
});
//# sourceMappingURL=ResourceSavingView.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Platform","StyleSheet","View","FAR_FAR_AWAY","ResourceSavingScene","visible","children","style","rest","OS","display","styles","container","attached","detached","create","flex","overflow","top"],"sourceRoot":"../../src","sources":["ResourceSavingView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R,CAAC;EACDF,QAAQ,EAAE;IACRE,IAAI,EAAE,CAAC;IACPE,GAAG,EAAEf;EACP;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,117 @@
import * as React from 'react';
import { Dimensions, Platform, StyleSheet, View } from 'react-native';
import { initialWindowMetrics, SafeAreaFrameContext, SafeAreaInsetsContext, SafeAreaProvider } from 'react-native-safe-area-context';
const {
width = 0,
height = 0
} = Dimensions.get('window');
// To support SSR on web, we need to have empty insets for initial values
// Otherwise there can be mismatch between SSR and client output
// We also need to specify empty values to support tests environments
const initialMetrics = Platform.OS === 'web' || initialWindowMetrics == null ? {
frame: {
x: 0,
y: 0,
width,
height
},
insets: {
top: 0,
left: 0,
right: 0,
bottom: 0
}
} : initialWindowMetrics;
export default function SafeAreaProviderCompat(_ref) {
let {
children,
style
} = _ref;
const insets = React.useContext(SafeAreaInsetsContext);
if (insets) {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// https://github.com/react-navigation/react-navigation/issues/174
return /*#__PURE__*/React.createElement(View, {
style: [styles.container, style]
}, children);
}
if (Platform.OS === 'web') {
children = /*#__PURE__*/React.createElement(SafeAreaFrameProvider, {
initialMetrics: initialMetrics
}, children);
}
return /*#__PURE__*/React.createElement(SafeAreaProvider, {
initialMetrics: initialMetrics,
style: style
}, children);
}
// FIXME: On the Web, the safe area frame value doesn't update on resize
// So we workaround this by measuring the frame on resize
const SafeAreaFrameProvider = _ref2 => {
let {
initialMetrics,
children
} = _ref2;
const element = React.useRef(null);
const [frame, setFrame] = React.useState(initialMetrics.frame);
React.useEffect(() => {
if (element.current == null) {
return;
}
const rect = element.current.getBoundingClientRect();
setFrame({
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
});
let timeout;
const observer = new ResizeObserver(entries => {
const entry = entries[0];
if (entry) {
const {
x,
y,
width,
height
} = entry.contentRect;
// Debounce the frame updates to avoid too many updates in a short time
clearTimeout(timeout);
timeout = setTimeout(() => {
setFrame({
x,
y,
width,
height
});
}, 100);
}
});
observer.observe(element.current);
return () => {
observer.disconnect();
clearTimeout(timeout);
};
}, []);
return /*#__PURE__*/React.createElement(SafeAreaFrameContext.Provider, {
value: frame
}, /*#__PURE__*/React.createElement("div", {
ref: element,
style: {
...StyleSheet.absoluteFillObject,
pointerEvents: 'none',
visibility: 'hidden'
}
}), children);
};
SafeAreaProviderCompat.initialMetrics = initialMetrics;
const styles = StyleSheet.create({
container: {
flex: 1
}
});
//# sourceMappingURL=SafeAreaProviderCompat.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Dimensions","Platform","StyleSheet","View","initialWindowMetrics","SafeAreaFrameContext","SafeAreaInsetsContext","SafeAreaProvider","width","height","get","initialMetrics","OS","frame","x","y","insets","top","left","right","bottom","SafeAreaProviderCompat","children","style","useContext","styles","container","SafeAreaFrameProvider","element","useRef","setFrame","useState","useEffect","current","rect","getBoundingClientRect","timeout","observer","ResizeObserver","entries","entry","contentRect","clearTimeout","setTimeout","observe","disconnect","absoluteFillObject","pointerEvents","visibility","create","flex"],"sourceRoot":"../../src","sources":["SafeAreaProviderCompat.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,UAAU,EACVC,QAAQ,EAERC,UAAU,EACVC,IAAI,QAEC,cAAc;AACrB,SACEC,oBAAoB,EAEpBC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,gCAAgC;AAOvC,MAAM;EAAEC,KAAK,GAAG,CAAC;EAAEC,MAAM,GAAG;AAAE,CAAC,GAAGT,UAAU,CAACU,GAAG,CAAC,QAAQ,CAAC;;AAE1D;AACA;AACA;AACA,MAAMC,cAAc,GAClBV,QAAQ,CAACW,EAAE,KAAK,KAAK,IAAIR,oBAAoB,IAAI,IAAI,GACjD;EACES,KAAK,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEP,KAAK;IAAEC;EAAO,CAAC;EACpCO,MAA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AAK,EAAE0B,IAAI,CAAC1B,KAAK;MACjBC,MAAM,EAAEyB,IAAI,CAACzB;IACf,CAAC,CAAC;IAEF,IAAI2B,OAAuB;IAE3B,MAAMC,QAAQ,GAAG,IAAIC,cAAc,CAAEC,OAAO,IAAK;MAC/C,MAAMC,KAAK,GAAGD,OAAO,CAAC,CAAC,CAAC;MAExB,IAAIC,KAAK,EAAE;QACT,MAAM;UAAE1B,CAAC;UAAEC,CAAC;UAAEP,KAAK;UAAEC;QAAO,CAAC,GAAG+B,KAAK,CAACC,WAAW;;QAEjD;QACAC,YAAY,CAACN,OAAO,CAAC;QACrBA,OAAO,GAAGO,UAAU,CAAC,MAAM;UACzBb,QAAQ,CAAC;YAAEhB,CAAC;YAAEC,CAAC;YAAEP,KAAK;YAAEC;UAAO,CAAC,CAAC;QACnC,CAAC,EAAE,GAAG,CAAC;MACT;IACF,CAAC,CAAC;IAEF4B,QAAQ,CAACO,OAAO,CAAChB,OAAO,CAACK,OAAO,CAAC;IAEjC,OAAO,MAAM;MACXI,QAAQ,CAACQ,UAAU,EAAE;MACrBH,YAAY,CAACN,OAAO,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE,oBAAC,oBAAoB,CAAC,QAAQ;IAAC,KAAK,EAAEvB;EAAM,gBAC1C;IACE,GAAG,EAAEe,OAAQ;IACb,KAAK,EAAE;MACL,GAAG1B,UAAU,CAAC4C,kBAAkB;MAChCC,aAAa,EAAE,MAAM;MACrBC,UAAU,EAAE;IACd;EAAE,EACF,EACD1B,QAAQ,CACqB;AAEpC,CAAC;AAEDD,sBAAsB,CAACV,cAAc,GAAGA,cAAc;AAEtD,MAAMc,MAAM,GAAGvB,UAAU,CAAC+C,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}

View File

@@ -0,0 +1,67 @@
import { NavigationContext, NavigationRouteContext } from '@react-navigation/native';
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
import { useSafeAreaFrame, useSafeAreaInsets } from 'react-native-safe-area-context';
import Background from './Background';
import getDefaultHeaderHeight from './Header/getDefaultHeaderHeight';
import HeaderHeightContext from './Header/HeaderHeightContext';
import HeaderShownContext from './Header/HeaderShownContext';
export default function Screen(props) {
const dimensions = useSafeAreaFrame();
const insets = useSafeAreaInsets();
const isParentHeaderShown = React.useContext(HeaderShownContext);
const parentHeaderHeight = React.useContext(HeaderHeightContext);
const {
focused,
modal = false,
header,
headerShown = true,
headerTransparent,
headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,
navigation,
route,
children,
style
} = props;
const [headerHeight, setHeaderHeight] = React.useState(() => getDefaultHeaderHeight(dimensions, modal, headerStatusBarHeight));
return /*#__PURE__*/React.createElement(Background, {
accessibilityElementsHidden: !focused,
importantForAccessibility: focused ? 'auto' : 'no-hide-descendants',
style: [styles.container, style]
}, /*#__PURE__*/React.createElement(View, {
style: styles.content
}, /*#__PURE__*/React.createElement(HeaderShownContext.Provider, {
value: isParentHeaderShown || headerShown !== false
}, /*#__PURE__*/React.createElement(HeaderHeightContext.Provider, {
value: headerShown ? headerHeight : parentHeaderHeight ?? 0
}, children))), headerShown ? /*#__PURE__*/React.createElement(NavigationContext.Provider, {
value: navigation
}, /*#__PURE__*/React.createElement(NavigationRouteContext.Provider, {
value: route
}, /*#__PURE__*/React.createElement(View, {
onLayout: e => {
const {
height
} = e.nativeEvent.layout;
setHeaderHeight(height);
},
style: headerTransparent ? styles.absolute : null
}, header))) : null);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column-reverse'
},
// This is necessary to avoid applying 'column-reverse' to screen content
content: {
flex: 1
},
absolute: {
position: 'absolute',
top: 0,
left: 0,
right: 0
}
});
//# sourceMappingURL=Screen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["NavigationContext","NavigationRouteContext","React","StyleSheet","View","useSafeAreaFrame","useSafeAreaInsets","Background","getDefaultHeaderHeight","HeaderHeightContext","HeaderShownContext","Screen","props","dimensions","insets","isParentHeaderShown","useContext","parentHeaderHeight","focused","modal","header","headerShown","headerTransparent","headerStatusBarHeight","top","navigation","route","children","style","headerHeight","setHeaderHeight","useState","styles","container","content","e","height","nativeEvent","layout","absolute","create","flex","flexDirection","position","left","right"],"sourceRoot":"../../src","sources":["Screen.tsx"],"mappings":"AAAA,SACEA,iBAAiB,EAEjBC,sBAAsB,QAGjB,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACrE,SACEC,gBAAgB,EAChBC,iBAAiB,QACZ,gCAAgC;AAEvC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,sBAAsB,MAAM,iCAAiC;AACpE,OAAOC,mBAAmB,MAAM,8BAA8B;AAC9D,OAAOC,kBAAkB,MAAM,6BAA6B;AAe5D,eAAe,SAASC,MAAM,CAACC,KAAY,EAAE;EAC3C,MAAMC,UAAU,GAAGR,gBAAgB,EAAE;EACrC,MAAMS,MAAM,GAAGR,iBAAiB,EAAE;EAElC,MAAMS,mBAAmB,GAAGb,KAAK,CAACc,UAAU,CAACN,kBAAkB,CAAC;EAChE,MAAMO,kBAAkB,GAAGf,KAAK,CAACc,UAAU,CAACP,mBAAmB,CAAC;EAEhE,MAAM;IACJS,OAAO;IACPC,KAAK,GAAG,KAAK;IACbC,MAAM;IACNC,WAAW,GAAG,IAAI;IAClBC,iBAAiB;IACjBC,qBAAqB,GAAGR,mBAAmB,GAAG,CAAC,GAAGD,MAAM,CAACU,GAAG;IAC5DC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC;EACF,CAAC,GAAGhB,KAAK;EAET,MAAM,CAACiB,YAAY,EAAEC,eAAe,CAAC,GAAG5B,KAAK,CAAC6B,QAAQ,CAAC,MACrDvB,sBAAsB,CAACK,UAAU,EAAEM,KAAK,EAAEI,qBAAqB,CAAC,CACjE;EAED,oBACE,oBAAC,UAAU;IACT,2BA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