@react-navigation/bottom-tabs 7.3.8 → 7.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/typescript/src/TransitionConfigs/SceneStyleInterpolators.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightCallbackContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/BottomTabBarHeightContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/useAnimatedHashMap.d.ts.map +1 -0
- package/lib/typescript/src/utils/useBottomTabBarHeight.d.ts.map +1 -0
- package/lib/typescript/src/utils/useIsKeyboardShown.d.ts.map +1 -0
- package/lib/typescript/src/views/Badge.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -0
- package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -0
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -0
- package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -0
- package/package.json +14 -26
- package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js +0 -45
- package/lib/commonjs/TransitionConfigs/SceneStyleInterpolators.js.map +0 -1
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js +0 -17
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js.map +0 -1
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +0 -22
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js.map +0 -1
- package/lib/commonjs/index.js +0 -57
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/navigators/createBottomTabNavigator.js +0 -50
- package/lib/commonjs/navigators/createBottomTabNavigator.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/types.js +0 -6
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js +0 -11
- package/lib/commonjs/utils/BottomTabBarHeightCallbackContext.js.map +0 -1
- package/lib/commonjs/utils/BottomTabBarHeightContext.js +0 -11
- package/lib/commonjs/utils/BottomTabBarHeightContext.js.map +0 -1
- package/lib/commonjs/utils/useAnimatedHashMap.js +0 -29
- package/lib/commonjs/utils/useAnimatedHashMap.js.map +0 -1
- package/lib/commonjs/utils/useBottomTabBarHeight.js +0 -18
- package/lib/commonjs/utils/useBottomTabBarHeight.js.map +0 -1
- package/lib/commonjs/utils/useIsKeyboardShown.js +0 -28
- package/lib/commonjs/utils/useIsKeyboardShown.js.map +0 -1
- package/lib/commonjs/views/Badge.js +0 -92
- package/lib/commonjs/views/Badge.js.map +0 -1
- package/lib/commonjs/views/BottomTabBar.js +0 -376
- package/lib/commonjs/views/BottomTabBar.js.map +0 -1
- package/lib/commonjs/views/BottomTabItem.js +0 -227
- package/lib/commonjs/views/BottomTabItem.js.map +0 -1
- package/lib/commonjs/views/BottomTabView.js +0 -266
- package/lib/commonjs/views/BottomTabView.js.map +0 -1
- package/lib/commonjs/views/ScreenFallback.js +0 -50
- package/lib/commonjs/views/ScreenFallback.js.map +0 -1
- package/lib/commonjs/views/TabBarIcon.js +0 -102
- package/lib/commonjs/views/TabBarIcon.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/TransitionConfigs/SceneStyleInterpolators.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TransitionConfigs/TransitionPresets.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TransitionConfigs/TransitionSpecs.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/navigators/createBottomTabNavigator.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/BottomTabBarHeightCallbackContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/BottomTabBarHeightContext.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/useAnimatedHashMap.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/useBottomTabBarHeight.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils/useIsKeyboardShown.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/Badge.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/BottomTabBar.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/BottomTabItem.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/BottomTabView.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/ScreenFallback.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/views/TabBarIcon.d.ts.map +0 -1
- package/lib/typescript/module/src/TransitionConfigs/SceneStyleInterpolators.d.ts +0 -10
- package/lib/typescript/module/src/TransitionConfigs/SceneStyleInterpolators.d.ts.map +0 -1
- package/lib/typescript/module/src/TransitionConfigs/TransitionPresets.d.ts +0 -4
- package/lib/typescript/module/src/TransitionConfigs/TransitionPresets.d.ts.map +0 -1
- package/lib/typescript/module/src/TransitionConfigs/TransitionSpecs.d.ts +0 -4
- package/lib/typescript/module/src/TransitionConfigs/TransitionSpecs.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -27
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/navigators/createBottomTabNavigator.d.ts +0 -16
- package/lib/typescript/module/src/navigators/createBottomTabNavigator.d.ts.map +0 -1
- package/lib/typescript/module/src/types.d.ts +0 -328
- package/lib/typescript/module/src/types.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/BottomTabBarHeightCallbackContext.d.ts +0 -3
- package/lib/typescript/module/src/utils/BottomTabBarHeightCallbackContext.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/BottomTabBarHeightContext.d.ts +0 -3
- package/lib/typescript/module/src/utils/BottomTabBarHeightContext.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/useAnimatedHashMap.d.ts +0 -4
- package/lib/typescript/module/src/utils/useAnimatedHashMap.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/useBottomTabBarHeight.d.ts +0 -2
- package/lib/typescript/module/src/utils/useBottomTabBarHeight.d.ts.map +0 -1
- package/lib/typescript/module/src/utils/useIsKeyboardShown.d.ts +0 -2
- package/lib/typescript/module/src/utils/useIsKeyboardShown.d.ts.map +0 -1
- package/lib/typescript/module/src/views/Badge.d.ts +0 -22
- package/lib/typescript/module/src/views/Badge.d.ts.map +0 -1
- package/lib/typescript/module/src/views/BottomTabBar.d.ts +0 -22
- package/lib/typescript/module/src/views/BottomTabBar.d.ts.map +0 -1
- package/lib/typescript/module/src/views/BottomTabItem.d.ts +0 -126
- package/lib/typescript/module/src/views/BottomTabItem.d.ts.map +0 -1
- package/lib/typescript/module/src/views/BottomTabView.d.ts +0 -10
- package/lib/typescript/module/src/views/BottomTabView.d.ts.map +0 -1
- package/lib/typescript/module/src/views/ScreenFallback.d.ts +0 -18
- package/lib/typescript/module/src/views/ScreenFallback.d.ts.map +0 -1
- package/lib/typescript/module/src/views/TabBarIcon.d.ts +0 -24
- package/lib/typescript/module/src/views/TabBarIcon.d.ts.map +0 -1
- /package/lib/typescript/{module/package.json → package.json} +0 -0
- /package/lib/typescript/{commonjs/src → src}/TransitionConfigs/SceneStyleInterpolators.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/TransitionConfigs/TransitionPresets.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/TransitionConfigs/TransitionSpecs.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/index.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/navigators/createBottomTabNavigator.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/BottomTabBarHeightCallbackContext.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/BottomTabBarHeightContext.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/useAnimatedHashMap.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/useBottomTabBarHeight.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/utils/useIsKeyboardShown.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/Badge.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/BottomTabBar.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/BottomTabItem.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/BottomTabView.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/ScreenFallback.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/views/TabBarIcon.d.ts +0 -0
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BottomTabItem = BottomTabItem;
|
|
7
|
-
var _elements = require("@react-navigation/elements");
|
|
8
|
-
var _native = require("@react-navigation/native");
|
|
9
|
-
var _color = _interopRequireDefault(require("color"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _reactNative = require("react-native");
|
|
12
|
-
var _TabBarIcon = require("./TabBarIcon.js");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
const renderButtonDefault = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.PlatformPressable, {
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
18
|
-
const SUPPORTS_LARGE_CONTENT_VIEWER = _reactNative.Platform.OS === 'ios' && parseInt(_reactNative.Platform.Version, 10) >= 13;
|
|
19
|
-
function BottomTabItem({
|
|
20
|
-
route,
|
|
21
|
-
href,
|
|
22
|
-
focused,
|
|
23
|
-
descriptor,
|
|
24
|
-
label,
|
|
25
|
-
icon,
|
|
26
|
-
badge,
|
|
27
|
-
badgeStyle,
|
|
28
|
-
button = renderButtonDefault,
|
|
29
|
-
accessibilityLabel,
|
|
30
|
-
testID,
|
|
31
|
-
onPress,
|
|
32
|
-
onLongPress,
|
|
33
|
-
horizontal,
|
|
34
|
-
compact,
|
|
35
|
-
sidebar,
|
|
36
|
-
variant,
|
|
37
|
-
activeTintColor: customActiveTintColor,
|
|
38
|
-
inactiveTintColor: customInactiveTintColor,
|
|
39
|
-
activeBackgroundColor: customActiveBackgroundColor,
|
|
40
|
-
inactiveBackgroundColor = 'transparent',
|
|
41
|
-
showLabel = true,
|
|
42
|
-
// On iOS 13+, we use `largeContentTitle` for accessibility
|
|
43
|
-
// So we don't need the font to scale up
|
|
44
|
-
// https://developer.apple.com/documentation/uikit/uiview/3183939-largecontenttitle
|
|
45
|
-
allowFontScaling = SUPPORTS_LARGE_CONTENT_VIEWER ? false : undefined,
|
|
46
|
-
labelStyle,
|
|
47
|
-
iconStyle,
|
|
48
|
-
style
|
|
49
|
-
}) {
|
|
50
|
-
const {
|
|
51
|
-
colors,
|
|
52
|
-
fonts
|
|
53
|
-
} = (0, _native.useTheme)();
|
|
54
|
-
const activeTintColor = customActiveTintColor ?? (variant === 'uikit' && sidebar && horizontal ? (0, _color.default)(colors.primary).isDark() ? 'white' : (0, _color.default)(colors.primary).darken(0.71).string() : colors.primary);
|
|
55
|
-
const inactiveTintColor = customInactiveTintColor === undefined ? variant === 'material' ? (0, _color.default)(colors.text).alpha(0.68).rgb().string() : (0, _color.default)(colors.text).mix((0, _color.default)(colors.card), 0.5).hex() : customInactiveTintColor;
|
|
56
|
-
const activeBackgroundColor = customActiveBackgroundColor ?? (variant === 'material' ? (0, _color.default)(activeTintColor).alpha(0.12).rgb().string() : sidebar && horizontal ? colors.primary : 'transparent');
|
|
57
|
-
const {
|
|
58
|
-
options
|
|
59
|
-
} = descriptor;
|
|
60
|
-
const labelString = (0, _elements.getLabel)({
|
|
61
|
-
label: typeof options.tabBarLabel === 'string' ? options.tabBarLabel : undefined,
|
|
62
|
-
title: options.title
|
|
63
|
-
}, route.name);
|
|
64
|
-
let labelInactiveTintColor = inactiveTintColor;
|
|
65
|
-
let iconInactiveTintColor = inactiveTintColor;
|
|
66
|
-
if (variant === 'uikit' && sidebar && horizontal && customInactiveTintColor === undefined) {
|
|
67
|
-
iconInactiveTintColor = colors.primary;
|
|
68
|
-
labelInactiveTintColor = colors.text;
|
|
69
|
-
}
|
|
70
|
-
const renderLabel = ({
|
|
71
|
-
focused
|
|
72
|
-
}) => {
|
|
73
|
-
if (showLabel === false) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
const color = focused ? activeTintColor : labelInactiveTintColor;
|
|
77
|
-
if (typeof label !== 'string') {
|
|
78
|
-
return label({
|
|
79
|
-
focused,
|
|
80
|
-
color,
|
|
81
|
-
position: horizontal ? 'beside-icon' : 'below-icon',
|
|
82
|
-
children: labelString
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.Label, {
|
|
86
|
-
style: [horizontal ? [styles.labelBeside, variant === 'material' ? styles.labelSidebarMaterial : sidebar ? styles.labelSidebarUiKit : compact ? styles.labelBesideUikitCompact : styles.labelBesideUikit, icon == null && {
|
|
87
|
-
marginStart: 0
|
|
88
|
-
}] : styles.labelBeneath, compact || variant === 'uikit' && sidebar && horizontal ? fonts.regular : fonts.medium, labelStyle],
|
|
89
|
-
allowFontScaling: allowFontScaling,
|
|
90
|
-
tintColor: color,
|
|
91
|
-
children: label
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
const renderIcon = ({
|
|
95
|
-
focused
|
|
96
|
-
}) => {
|
|
97
|
-
if (icon === undefined) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
const activeOpacity = focused ? 1 : 0;
|
|
101
|
-
const inactiveOpacity = focused ? 0 : 1;
|
|
102
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabBarIcon.TabBarIcon, {
|
|
103
|
-
route: route,
|
|
104
|
-
variant: variant,
|
|
105
|
-
size: compact ? 'compact' : 'regular',
|
|
106
|
-
badge: badge,
|
|
107
|
-
badgeStyle: badgeStyle,
|
|
108
|
-
activeOpacity: activeOpacity,
|
|
109
|
-
allowFontScaling: allowFontScaling,
|
|
110
|
-
inactiveOpacity: inactiveOpacity,
|
|
111
|
-
activeTintColor: activeTintColor,
|
|
112
|
-
inactiveTintColor: iconInactiveTintColor,
|
|
113
|
-
renderIcon: icon,
|
|
114
|
-
style: iconStyle
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
const scene = {
|
|
118
|
-
route,
|
|
119
|
-
focused
|
|
120
|
-
};
|
|
121
|
-
const backgroundColor = focused ? activeBackgroundColor : inactiveBackgroundColor;
|
|
122
|
-
const {
|
|
123
|
-
flex
|
|
124
|
-
} = _reactNative.StyleSheet.flatten(style || {});
|
|
125
|
-
const borderRadius = variant === 'material' ? horizontal ? 56 : 16 : sidebar && horizontal ? 10 : 0;
|
|
126
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
127
|
-
style: [
|
|
128
|
-
// Clip ripple effect on Android
|
|
129
|
-
{
|
|
130
|
-
borderRadius,
|
|
131
|
-
overflow: variant === 'material' ? 'hidden' : 'visible'
|
|
132
|
-
}, style],
|
|
133
|
-
children: button({
|
|
134
|
-
href,
|
|
135
|
-
onPress,
|
|
136
|
-
onLongPress,
|
|
137
|
-
testID,
|
|
138
|
-
accessibilityLabel,
|
|
139
|
-
accessibilityLargeContentTitle: labelString,
|
|
140
|
-
accessibilityShowsLargeContentViewer: true,
|
|
141
|
-
// FIXME: accessibilityRole: 'tab' doesn't seem to work as expected on iOS
|
|
142
|
-
accessibilityRole: _reactNative.Platform.select({
|
|
143
|
-
ios: 'button',
|
|
144
|
-
default: 'tab'
|
|
145
|
-
}),
|
|
146
|
-
accessibilityState: {
|
|
147
|
-
selected: focused
|
|
148
|
-
},
|
|
149
|
-
// @ts-expect-error: keep for compatibility with older React Native versions
|
|
150
|
-
accessibilityStates: focused ? ['selected'] : [],
|
|
151
|
-
android_ripple: {
|
|
152
|
-
borderless: true
|
|
153
|
-
},
|
|
154
|
-
hoverEffect: variant === 'material' || sidebar && horizontal ? {
|
|
155
|
-
color: colors.text
|
|
156
|
-
} : undefined,
|
|
157
|
-
pressOpacity: 1,
|
|
158
|
-
style: [styles.tab, {
|
|
159
|
-
flex,
|
|
160
|
-
backgroundColor,
|
|
161
|
-
borderRadius
|
|
162
|
-
}, sidebar ? variant === 'material' ? horizontal ? styles.tabBarSidebarMaterial : styles.tabVerticalMaterial : horizontal ? styles.tabBarSidebarUiKit : styles.tabVerticalUiKit : variant === 'material' ? styles.tabVerticalMaterial : horizontal ? styles.tabHorizontalUiKit : styles.tabVerticalUiKit],
|
|
163
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.default.Fragment, {
|
|
164
|
-
children: [renderIcon(scene), renderLabel(scene)]
|
|
165
|
-
})
|
|
166
|
-
})
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
const styles = _reactNative.StyleSheet.create({
|
|
170
|
-
tab: {
|
|
171
|
-
alignItems: 'center',
|
|
172
|
-
// Roundness for iPad hover effect
|
|
173
|
-
borderRadius: 10
|
|
174
|
-
},
|
|
175
|
-
tabVerticalUiKit: {
|
|
176
|
-
justifyContent: 'flex-start',
|
|
177
|
-
flexDirection: 'column',
|
|
178
|
-
padding: 5
|
|
179
|
-
},
|
|
180
|
-
tabVerticalMaterial: {
|
|
181
|
-
padding: 10
|
|
182
|
-
},
|
|
183
|
-
tabHorizontalUiKit: {
|
|
184
|
-
justifyContent: 'center',
|
|
185
|
-
alignItems: 'center',
|
|
186
|
-
flexDirection: 'row',
|
|
187
|
-
padding: 5
|
|
188
|
-
},
|
|
189
|
-
tabBarSidebarUiKit: {
|
|
190
|
-
justifyContent: 'flex-start',
|
|
191
|
-
alignItems: 'center',
|
|
192
|
-
flexDirection: 'row',
|
|
193
|
-
paddingVertical: 7,
|
|
194
|
-
paddingHorizontal: 5
|
|
195
|
-
},
|
|
196
|
-
tabBarSidebarMaterial: {
|
|
197
|
-
justifyContent: 'flex-start',
|
|
198
|
-
alignItems: 'center',
|
|
199
|
-
flexDirection: 'row',
|
|
200
|
-
paddingVertical: 15,
|
|
201
|
-
paddingStart: 16,
|
|
202
|
-
paddingEnd: 24
|
|
203
|
-
},
|
|
204
|
-
labelSidebarMaterial: {
|
|
205
|
-
marginStart: 12
|
|
206
|
-
},
|
|
207
|
-
labelSidebarUiKit: {
|
|
208
|
-
fontSize: 17,
|
|
209
|
-
marginStart: 10
|
|
210
|
-
},
|
|
211
|
-
labelBeneath: {
|
|
212
|
-
fontSize: 10
|
|
213
|
-
},
|
|
214
|
-
labelBeside: {
|
|
215
|
-
marginEnd: 12,
|
|
216
|
-
lineHeight: 24
|
|
217
|
-
},
|
|
218
|
-
labelBesideUikit: {
|
|
219
|
-
fontSize: 13,
|
|
220
|
-
marginStart: 5
|
|
221
|
-
},
|
|
222
|
-
labelBesideUikitCompact: {
|
|
223
|
-
fontSize: 12,
|
|
224
|
-
marginStart: 5
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
//# sourceMappingURL=BottomTabItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_elements","require","_native","_color","_interopRequireDefault","_react","_reactNative","_TabBarIcon","_jsxRuntime","e","__esModule","default","renderButtonDefault","props","jsx","PlatformPressable","SUPPORTS_LARGE_CONTENT_VIEWER","Platform","OS","parseInt","Version","BottomTabItem","route","href","focused","descriptor","label","icon","badge","badgeStyle","button","accessibilityLabel","testID","onPress","onLongPress","horizontal","compact","sidebar","variant","activeTintColor","customActiveTintColor","inactiveTintColor","customInactiveTintColor","activeBackgroundColor","customActiveBackgroundColor","inactiveBackgroundColor","showLabel","allowFontScaling","undefined","labelStyle","iconStyle","style","colors","fonts","useTheme","Color","primary","isDark","darken","string","text","alpha","rgb","mix","card","hex","options","labelString","getLabel","tabBarLabel","title","name","labelInactiveTintColor","iconInactiveTintColor","renderLabel","color","position","children","Label","styles","labelBeside","labelSidebarMaterial","labelSidebarUiKit","labelBesideUikitCompact","labelBesideUikit","marginStart","labelBeneath","regular","medium","tintColor","renderIcon","activeOpacity","inactiveOpacity","TabBarIcon","size","scene","backgroundColor","flex","StyleSheet","flatten","borderRadius","View","overflow","accessibilityLargeContentTitle","accessibilityShowsLargeContentViewer","accessibilityRole","select","ios","accessibilityState","selected","accessibilityStates","android_ripple","borderless","hoverEffect","pressOpacity","tab","tabBarSidebarMaterial","tabVerticalMaterial","tabBarSidebarUiKit","tabVerticalUiKit","tabHorizontalUiKit","jsxs","Fragment","create","alignItems","justifyContent","flexDirection","padding","paddingVertical","paddingHorizontal","paddingStart","paddingEnd","fontSize","marginEnd","lineHeight"],"sourceRoot":"../../../src","sources":["views/BottomTabItem.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAeA,IAAAM,WAAA,GAAAN,OAAA;AAA0C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA8H1C,MAAMG,mBAAmB,GAAIC,KAA8B,iBACzD,IAAAL,WAAA,CAAAM,GAAA,EAACd,SAAA,CAAAe,iBAAiB;EAAA,GAAKF;AAAK,CAA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CAAC;EACDT,kBAAkB,EAAE;IAClBO,cAAc,EAAE,YAAY;IAC5BD,UAAU,EAAE,QAAQ;IACpBE,aAAa,EAAE,KAAK;IACpBE,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDb,qBAAqB,EAAE;IACrBS,cAAc,EAAE,YAAY;IAC5BD,UAAU,EAAE,QAAQ;IACpBE,aAAa,EAAE,KAAK;IACpBE,eAAe,EAAE,EAAE;IACnBE,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE;EACd,CAAC;EACDlD,oBAAoB,EAAE;IACpBI,WAAW,EAAE;EACf,CAAC;EACDH,iBAAiB,EAAE;IACjBkD,QAAQ,EAAE,EAAE;IACZ/C,WAAW,EAAE;EACf,CAAC;EACDC,YAAY,EAAE;IACZ8C,QAAQ,EAAE;EACZ,CAAC;EACDpD,WAAW,EAAE;IACXqD,SAAS,EAAE,EAAE;IACbC,UAAU,EAAE;EACd,CAAC;EACDlD,gBAAgB,EAAE;IAChBgD,QAAQ,EAAE,EAAE;IACZ/C,WAAW,EAAE;EACf,CAAC;EACDF,uBAAuB,EAAE;IACvBiD,QAAQ,EAAE,EAAE;IACZ/C,WAAW,EAAE;EACf;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BottomTabView = BottomTabView;
|
|
7
|
-
var _elements = require("@react-navigation/elements");
|
|
8
|
-
var _native = require("@react-navigation/native");
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
12
|
-
var _TransitionPresets = require("../TransitionConfigs/TransitionPresets.js");
|
|
13
|
-
var _BottomTabBarHeightCallbackContext = require("../utils/BottomTabBarHeightCallbackContext.js");
|
|
14
|
-
var _BottomTabBarHeightContext = require("../utils/BottomTabBarHeightContext.js");
|
|
15
|
-
var _useAnimatedHashMap = require("../utils/useAnimatedHashMap.js");
|
|
16
|
-
var _BottomTabBar = require("./BottomTabBar.js");
|
|
17
|
-
var _ScreenFallback = require("./ScreenFallback.js");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
-
const EPSILON = 1e-5;
|
|
22
|
-
const STATE_INACTIVE = 0;
|
|
23
|
-
const STATE_TRANSITIONING_OR_BELOW_TOP = 1;
|
|
24
|
-
const STATE_ON_TOP = 2;
|
|
25
|
-
const NAMED_TRANSITIONS_PRESETS = {
|
|
26
|
-
fade: _TransitionPresets.FadeTransition,
|
|
27
|
-
shift: _TransitionPresets.ShiftTransition,
|
|
28
|
-
none: {
|
|
29
|
-
sceneStyleInterpolator: undefined,
|
|
30
|
-
transitionSpec: {
|
|
31
|
-
animation: 'timing',
|
|
32
|
-
config: {
|
|
33
|
-
duration: 0
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const useNativeDriver = _reactNative.Platform.OS !== 'web';
|
|
39
|
-
const hasAnimation = options => {
|
|
40
|
-
const {
|
|
41
|
-
animation,
|
|
42
|
-
transitionSpec
|
|
43
|
-
} = options;
|
|
44
|
-
if (animation) {
|
|
45
|
-
return animation !== 'none';
|
|
46
|
-
}
|
|
47
|
-
return Boolean(transitionSpec);
|
|
48
|
-
};
|
|
49
|
-
const renderTabBarDefault = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomTabBar.BottomTabBar, {
|
|
50
|
-
...props
|
|
51
|
-
});
|
|
52
|
-
function BottomTabView(props) {
|
|
53
|
-
const {
|
|
54
|
-
tabBar = renderTabBarDefault,
|
|
55
|
-
state,
|
|
56
|
-
navigation,
|
|
57
|
-
descriptors,
|
|
58
|
-
safeAreaInsets,
|
|
59
|
-
detachInactiveScreens = _reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'android' || _reactNative.Platform.OS === 'ios'
|
|
60
|
-
} = props;
|
|
61
|
-
const focusedRouteKey = state.routes[state.index].key;
|
|
62
|
-
const {
|
|
63
|
-
direction
|
|
64
|
-
} = (0, _native.useLocale)();
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* List of loaded tabs, tabs will be loaded when navigated to.
|
|
68
|
-
*/
|
|
69
|
-
const [loaded, setLoaded] = React.useState([focusedRouteKey]);
|
|
70
|
-
if (!loaded.includes(focusedRouteKey)) {
|
|
71
|
-
// Set the current tab to be loaded if it was not loaded before
|
|
72
|
-
setLoaded([...loaded, focusedRouteKey]);
|
|
73
|
-
}
|
|
74
|
-
const previousRouteKeyRef = React.useRef(focusedRouteKey);
|
|
75
|
-
const tabAnims = (0, _useAnimatedHashMap.useAnimatedHashMap)(state);
|
|
76
|
-
React.useEffect(() => {
|
|
77
|
-
const previousRouteKey = previousRouteKeyRef.current;
|
|
78
|
-
let popToTopAction;
|
|
79
|
-
if (previousRouteKey !== focusedRouteKey && descriptors[previousRouteKey]?.options.popToTopOnBlur) {
|
|
80
|
-
const prevRoute = state.routes.find(route => route.key === previousRouteKey);
|
|
81
|
-
if (prevRoute?.state?.type === 'stack' && prevRoute.state.key) {
|
|
82
|
-
popToTopAction = {
|
|
83
|
-
..._native.StackActions.popToTop(),
|
|
84
|
-
target: prevRoute.state.key
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const animateToIndex = () => {
|
|
89
|
-
if (previousRouteKey !== focusedRouteKey) {
|
|
90
|
-
navigation.emit({
|
|
91
|
-
type: 'transitionStart',
|
|
92
|
-
target: focusedRouteKey
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
_reactNative.Animated.parallel(state.routes.map((route, index) => {
|
|
96
|
-
const {
|
|
97
|
-
options
|
|
98
|
-
} = descriptors[route.key];
|
|
99
|
-
const {
|
|
100
|
-
animation = 'none',
|
|
101
|
-
transitionSpec = NAMED_TRANSITIONS_PRESETS[animation].transitionSpec
|
|
102
|
-
} = options;
|
|
103
|
-
let spec = transitionSpec;
|
|
104
|
-
if (route.key !== previousRouteKey && route.key !== focusedRouteKey) {
|
|
105
|
-
// Don't animate if the screen is not previous one or new one
|
|
106
|
-
// This will avoid flicker for screens not involved in the transition
|
|
107
|
-
spec = NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
|
|
108
|
-
}
|
|
109
|
-
spec = spec ?? NAMED_TRANSITIONS_PRESETS.none.transitionSpec;
|
|
110
|
-
const toValue = index === state.index ? 0 : index >= state.index ? 1 : -1;
|
|
111
|
-
return _reactNative.Animated[spec.animation](tabAnims[route.key], {
|
|
112
|
-
...spec.config,
|
|
113
|
-
toValue,
|
|
114
|
-
useNativeDriver
|
|
115
|
-
});
|
|
116
|
-
}).filter(Boolean)).start(({
|
|
117
|
-
finished
|
|
118
|
-
}) => {
|
|
119
|
-
if (finished && popToTopAction) {
|
|
120
|
-
navigation.dispatch(popToTopAction);
|
|
121
|
-
}
|
|
122
|
-
if (previousRouteKey !== focusedRouteKey) {
|
|
123
|
-
navigation.emit({
|
|
124
|
-
type: 'transitionEnd',
|
|
125
|
-
target: focusedRouteKey
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
animateToIndex();
|
|
131
|
-
previousRouteKeyRef.current = focusedRouteKey;
|
|
132
|
-
}, [descriptors, focusedRouteKey, navigation, state.index, state.routes, tabAnims]);
|
|
133
|
-
const dimensions = _elements.SafeAreaProviderCompat.initialMetrics.frame;
|
|
134
|
-
const [tabBarHeight, setTabBarHeight] = React.useState(() => (0, _BottomTabBar.getTabBarHeight)({
|
|
135
|
-
state,
|
|
136
|
-
descriptors,
|
|
137
|
-
dimensions,
|
|
138
|
-
insets: {
|
|
139
|
-
..._elements.SafeAreaProviderCompat.initialMetrics.insets,
|
|
140
|
-
...props.safeAreaInsets
|
|
141
|
-
},
|
|
142
|
-
style: descriptors[state.routes[state.index].key].options.tabBarStyle
|
|
143
|
-
}));
|
|
144
|
-
const renderTabBar = () => {
|
|
145
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSafeAreaContext.SafeAreaInsetsContext.Consumer, {
|
|
146
|
-
children: insets => tabBar({
|
|
147
|
-
state: state,
|
|
148
|
-
descriptors: descriptors,
|
|
149
|
-
navigation: navigation,
|
|
150
|
-
insets: {
|
|
151
|
-
top: safeAreaInsets?.top ?? insets?.top ?? 0,
|
|
152
|
-
right: safeAreaInsets?.right ?? insets?.right ?? 0,
|
|
153
|
-
bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,
|
|
154
|
-
left: safeAreaInsets?.left ?? insets?.left ?? 0
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
const {
|
|
160
|
-
routes
|
|
161
|
-
} = state;
|
|
162
|
-
|
|
163
|
-
// If there is no animation, we only have 2 states: visible and invisible
|
|
164
|
-
const hasTwoStates = !routes.some(route => hasAnimation(descriptors[route.key].options));
|
|
165
|
-
const {
|
|
166
|
-
tabBarPosition = 'bottom'
|
|
167
|
-
} = descriptors[focusedRouteKey].options;
|
|
168
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_elements.SafeAreaProviderCompat, {
|
|
169
|
-
style: {
|
|
170
|
-
flexDirection: tabBarPosition === 'left' || tabBarPosition === 'right' ? tabBarPosition === 'left' && direction === 'ltr' || tabBarPosition === 'right' && direction === 'rtl' ? 'row-reverse' : 'row' : 'column'
|
|
171
|
-
},
|
|
172
|
-
children: [tabBarPosition === 'top' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomTabBarHeightCallbackContext.BottomTabBarHeightCallbackContext.Provider, {
|
|
173
|
-
value: setTabBarHeight,
|
|
174
|
-
children: renderTabBar()
|
|
175
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenFallback.MaybeScreenContainer, {
|
|
176
|
-
enabled: detachInactiveScreens,
|
|
177
|
-
hasTwoStates: hasTwoStates,
|
|
178
|
-
style: styles.screens,
|
|
179
|
-
children: routes.map((route, index) => {
|
|
180
|
-
const descriptor = descriptors[route.key];
|
|
181
|
-
const {
|
|
182
|
-
lazy = true,
|
|
183
|
-
animation = 'none',
|
|
184
|
-
sceneStyleInterpolator = NAMED_TRANSITIONS_PRESETS[animation].sceneStyleInterpolator
|
|
185
|
-
} = descriptor.options;
|
|
186
|
-
const isFocused = state.index === index;
|
|
187
|
-
const isPreloaded = state.preloadedRouteKeys.includes(route.key);
|
|
188
|
-
if (lazy && !loaded.includes(route.key) && !isFocused && !isPreloaded) {
|
|
189
|
-
// Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
const {
|
|
193
|
-
freezeOnBlur,
|
|
194
|
-
header = ({
|
|
195
|
-
layout,
|
|
196
|
-
options
|
|
197
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.Header, {
|
|
198
|
-
...options,
|
|
199
|
-
layout: layout,
|
|
200
|
-
title: (0, _elements.getHeaderTitle)(options, route.name)
|
|
201
|
-
}),
|
|
202
|
-
headerShown,
|
|
203
|
-
headerStatusBarHeight,
|
|
204
|
-
headerTransparent,
|
|
205
|
-
sceneStyle: customSceneStyle
|
|
206
|
-
} = descriptor.options;
|
|
207
|
-
const {
|
|
208
|
-
sceneStyle
|
|
209
|
-
} = sceneStyleInterpolator?.({
|
|
210
|
-
current: {
|
|
211
|
-
progress: tabAnims[route.key]
|
|
212
|
-
}
|
|
213
|
-
}) ?? {};
|
|
214
|
-
const animationEnabled = hasAnimation(descriptor.options);
|
|
215
|
-
const activityState = isFocused ? STATE_ON_TOP // the screen is on top after the transition
|
|
216
|
-
: animationEnabled // is animation is not enabled, immediately move to inactive state
|
|
217
|
-
? tabAnims[route.key].interpolate({
|
|
218
|
-
inputRange: [0, 1 - EPSILON, 1],
|
|
219
|
-
outputRange: [STATE_TRANSITIONING_OR_BELOW_TOP,
|
|
220
|
-
// screen visible during transition
|
|
221
|
-
STATE_TRANSITIONING_OR_BELOW_TOP, STATE_INACTIVE // the screen is detached after transition
|
|
222
|
-
],
|
|
223
|
-
extrapolate: 'extend'
|
|
224
|
-
}) : STATE_INACTIVE;
|
|
225
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenFallback.MaybeScreen, {
|
|
226
|
-
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
227
|
-
zIndex: isFocused ? 0 : -1
|
|
228
|
-
}],
|
|
229
|
-
active: activityState,
|
|
230
|
-
enabled: detachInactiveScreens,
|
|
231
|
-
freezeOnBlur: freezeOnBlur,
|
|
232
|
-
shouldFreeze: activityState === STATE_INACTIVE && !isPreloaded,
|
|
233
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomTabBarHeightContext.BottomTabBarHeightContext.Provider, {
|
|
234
|
-
value: tabBarPosition === 'bottom' ? tabBarHeight : 0,
|
|
235
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_elements.Screen, {
|
|
236
|
-
focused: isFocused,
|
|
237
|
-
route: descriptor.route,
|
|
238
|
-
navigation: descriptor.navigation,
|
|
239
|
-
headerShown: headerShown,
|
|
240
|
-
headerStatusBarHeight: headerStatusBarHeight,
|
|
241
|
-
headerTransparent: headerTransparent,
|
|
242
|
-
header: header({
|
|
243
|
-
layout: dimensions,
|
|
244
|
-
route: descriptor.route,
|
|
245
|
-
navigation: descriptor.navigation,
|
|
246
|
-
options: descriptor.options
|
|
247
|
-
}),
|
|
248
|
-
style: [customSceneStyle, animationEnabled && sceneStyle],
|
|
249
|
-
children: descriptor.render()
|
|
250
|
-
})
|
|
251
|
-
})
|
|
252
|
-
}, route.key);
|
|
253
|
-
})
|
|
254
|
-
}), tabBarPosition !== 'top' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BottomTabBarHeightCallbackContext.BottomTabBarHeightCallbackContext.Provider, {
|
|
255
|
-
value: setTabBarHeight,
|
|
256
|
-
children: renderTabBar()
|
|
257
|
-
}) : null]
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
const styles = _reactNative.StyleSheet.create({
|
|
261
|
-
screens: {
|
|
262
|
-
flex: 1,
|
|
263
|
-
overflow: 'hidden'
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
//# sourceMappingURL=BottomTabView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_elements","require","_native","React","_interopRequireWildcard","_reactNative","_reactNativeSafeAreaContext","_TransitionPresets","_BottomTabBarHeightCallbackContext","_BottomTabBarHeightContext","_useAnimatedHashMap","_BottomTabBar","_ScreenFallback","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","EPSILON","STATE_INACTIVE","STATE_TRANSITIONING_OR_BELOW_TOP","STATE_ON_TOP","NAMED_TRANSITIONS_PRESETS","fade","FadeTransition","shift","ShiftTransition","none","sceneStyleInterpolator","undefined","transitionSpec","animation","config","duration","useNativeDriver","Platform","OS","hasAnimation","options","Boolean","renderTabBarDefault","props","jsx","BottomTabBar","BottomTabView","tabBar","state","navigation","descriptors","safeAreaInsets","detachInactiveScreens","focusedRouteKey","routes","index","key","direction","useLocale","loaded","setLoaded","useState","includes","previousRouteKeyRef","useRef","tabAnims","useAnimatedHashMap","useEffect","previousRouteKey","current","popToTopAction","popToTopOnBlur","prevRoute","find","route","type","StackActions","popToTop","target","animateToIndex","emit","Animated","parallel","map","spec","toValue","filter","start","finished","dispatch","dimensions","SafeAreaProviderCompat","initialMetrics","frame","tabBarHeight","setTabBarHeight","getTabBarHeight","insets","style","tabBarStyle","renderTabBar","SafeAreaInsetsContext","Consumer","children","top","right","bottom","left","hasTwoStates","some","tabBarPosition","jsxs","flexDirection","BottomTabBarHeightCallbackContext","Provider","value","MaybeScreenContainer","enabled","styles","screens","descriptor","lazy","isFocused","isPreloaded","preloadedRouteKeys","freezeOnBlur","header","layout","Header","title","getHeaderTitle","name","headerShown","headerStatusBarHeight","headerTransparent","sceneStyle","customSceneStyle","progress","animationEnabled","activityState","interpolate","inputRange","outputRange","extrapolate","MaybeScreen","StyleSheet","absoluteFill","zIndex","active","shouldFreeze","BottomTabBarHeightContext","Screen","focused","render","create","flex","overflow"],"sourceRoot":"../../../src","sources":["views/BottomTabView.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAMA,IAAAC,OAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,2BAAA,GAAAL,OAAA;AAEA,IAAAM,kBAAA,GAAAN,OAAA;AAaA,IAAAO,kCAAA,GAAAP,OAAA;AACA,IAAAQ,0BAAA,GAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAX,OAAA;AAAqE,IAAAY,WAAA,GAAAZ,OAAA;AAAA,SAAAa,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAA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MAAAQ,QAAA,EAChEH,YAAY,CAAC;IAAC,CAC2B,CAAC,GAC3C,IAAI;EAAA,CACc,CAAC;AAE7B;AAEA,MAAMkB,MAAM,GAAG2B,uBAAU,CAACS,MAAM,CAAC;EAC/BnC,OAAO,EAAE;IACPoC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MaybeScreen = MaybeScreen;
|
|
7
|
-
exports.MaybeScreenContainer = void 0;
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
let Screens;
|
|
14
|
-
try {
|
|
15
|
-
Screens = require('react-native-screens');
|
|
16
|
-
} catch (e) {
|
|
17
|
-
// Ignore
|
|
18
|
-
}
|
|
19
|
-
const MaybeScreenContainer = ({
|
|
20
|
-
enabled,
|
|
21
|
-
...rest
|
|
22
|
-
}) => {
|
|
23
|
-
if (Screens?.screensEnabled?.()) {
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Screens.ScreenContainer, {
|
|
25
|
-
enabled: enabled,
|
|
26
|
-
...rest
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
30
|
-
...rest
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.MaybeScreenContainer = MaybeScreenContainer;
|
|
34
|
-
function MaybeScreen({
|
|
35
|
-
enabled,
|
|
36
|
-
active,
|
|
37
|
-
...rest
|
|
38
|
-
}) {
|
|
39
|
-
if (Screens?.screensEnabled?.()) {
|
|
40
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Screens.Screen, {
|
|
41
|
-
enabled: enabled,
|
|
42
|
-
activityState: active,
|
|
43
|
-
...rest
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
47
|
-
...rest
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=ScreenFallback.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Screens","MaybeScreenContainer","enabled","rest","screensEnabled","jsx","ScreenContainer","View","exports","MaybeScreen","active","Screen","activityState"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMsB,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wB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