@react-navigation/stack 6.3.7 → 6.3.9
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/commonjs/TransitionConfigs/CardStyleInterpolators.js +12 -22
- package/lib/commonjs/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
- package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js +11 -16
- package/lib/commonjs/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js +10 -19
- package/lib/commonjs/TransitionConfigs/TransitionPresets.js.map +1 -1
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js +6 -8
- package/lib/commonjs/TransitionConfigs/TransitionSpecs.js.map +1 -1
- package/lib/commonjs/index.js +0 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createStackNavigator.js +9 -17
- package/lib/commonjs/navigators/createStackNavigator.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/CardAnimationContext.js +0 -5
- package/lib/commonjs/utils/CardAnimationContext.js.map +1 -1
- package/lib/commonjs/utils/GestureHandlerRefContext.js +0 -5
- package/lib/commonjs/utils/GestureHandlerRefContext.js.map +1 -1
- package/lib/commonjs/utils/ModalPresentationContext.js +0 -4
- package/lib/commonjs/utils/ModalPresentationContext.js.map +1 -1
- package/lib/commonjs/utils/conditional.js +1 -3
- package/lib/commonjs/utils/conditional.js.map +1 -1
- package/lib/commonjs/utils/debounce.js +0 -2
- package/lib/commonjs/utils/debounce.js.map +1 -1
- package/lib/commonjs/utils/getDistanceForDirection.js +0 -5
- package/lib/commonjs/utils/getDistanceForDirection.js.map +1 -1
- package/lib/commonjs/utils/getInvertedMultiplier.js +0 -5
- package/lib/commonjs/utils/getInvertedMultiplier.js.map +1 -1
- package/lib/commonjs/utils/memoize.js +0 -6
- package/lib/commonjs/utils/memoize.js.map +1 -1
- package/lib/commonjs/utils/useCardAnimation.js +0 -8
- package/lib/commonjs/utils/useCardAnimation.js.map +1 -1
- package/lib/commonjs/utils/useGestureHandlerRef.js +0 -8
- package/lib/commonjs/utils/useGestureHandlerRef.js.map +1 -1
- package/lib/commonjs/utils/useKeyboardManager.js +14 -20
- package/lib/commonjs/utils/useKeyboardManager.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.android.js +0 -2
- package/lib/commonjs/views/GestureHandler.android.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.ios.js +0 -2
- package/lib/commonjs/views/GestureHandler.ios.js.map +1 -1
- package/lib/commonjs/views/GestureHandler.js +0 -6
- package/lib/commonjs/views/GestureHandler.js.map +1 -1
- package/lib/commonjs/views/GestureHandlerNative.js +0 -8
- package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
- package/lib/commonjs/views/Header/Header.js +7 -18
- package/lib/commonjs/views/Header/Header.js.map +1 -1
- package/lib/commonjs/views/Header/HeaderContainer.js +10 -23
- package/lib/commonjs/views/Header/HeaderContainer.js.map +1 -1
- package/lib/commonjs/views/Header/HeaderSegment.js +6 -20
- package/lib/commonjs/views/Header/HeaderSegment.js.map +1 -1
- package/lib/commonjs/views/ModalStatusBarManager.js +1 -11
- package/lib/commonjs/views/ModalStatusBarManager.js.map +1 -1
- package/lib/commonjs/views/Screens.js +2 -16
- package/lib/commonjs/views/Screens.js.map +1 -1
- package/lib/commonjs/views/Stack/Card.js +17 -80
- package/lib/commonjs/views/Stack/Card.js.map +1 -1
- package/lib/commonjs/views/Stack/CardContainer.js +3 -30
- package/lib/commonjs/views/Stack/CardContainer.js.map +1 -1
- package/lib/commonjs/views/Stack/CardSheet.js +2 -11
- package/lib/commonjs/views/Stack/CardSheet.js.map +1 -1
- package/lib/commonjs/views/Stack/CardStack.js +23 -78
- package/lib/commonjs/views/Stack/CardStack.js.map +1 -1
- package/lib/commonjs/views/Stack/StackView.js +33 -65
- package/lib/commonjs/views/Stack/StackView.js.map +1 -1
- package/lib/module/TransitionConfigs/CardStyleInterpolators.js +12 -10
- package/lib/module/TransitionConfigs/CardStyleInterpolators.js.map +1 -1
- package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js +11 -9
- package/lib/module/TransitionConfigs/HeaderStyleInterpolators.js.map +1 -1
- package/lib/module/TransitionConfigs/TransitionPresets.js +10 -10
- package/lib/module/TransitionConfigs/TransitionPresets.js.map +1 -1
- package/lib/module/TransitionConfigs/TransitionSpecs.js +6 -7
- package/lib/module/TransitionConfigs/TransitionSpecs.js.map +1 -1
- package/lib/module/index.js +5 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createStackNavigator.js +9 -9
- package/lib/module/navigators/createStackNavigator.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/CardAnimationContext.js.map +1 -1
- package/lib/module/utils/GestureHandlerRefContext.js.map +1 -1
- package/lib/module/utils/ModalPresentationContext.js.map +1 -1
- package/lib/module/utils/conditional.js +1 -1
- package/lib/module/utils/conditional.js.map +1 -1
- package/lib/module/utils/debounce.js +0 -1
- package/lib/module/utils/debounce.js.map +1 -1
- package/lib/module/utils/getDistanceForDirection.js +0 -2
- package/lib/module/utils/getDistanceForDirection.js.map +1 -1
- package/lib/module/utils/getInvertedMultiplier.js +0 -3
- package/lib/module/utils/getInvertedMultiplier.js.map +1 -1
- package/lib/module/utils/memoize.js +0 -5
- package/lib/module/utils/memoize.js.map +1 -1
- package/lib/module/utils/useCardAnimation.js +0 -2
- package/lib/module/utils/useCardAnimation.js.map +1 -1
- package/lib/module/utils/useGestureHandlerRef.js +0 -2
- package/lib/module/utils/useGestureHandlerRef.js.map +1 -1
- package/lib/module/utils/useKeyboardManager.js +14 -13
- package/lib/module/utils/useKeyboardManager.js.map +1 -1
- package/lib/module/views/GestureHandler.android.js.map +1 -1
- package/lib/module/views/GestureHandler.ios.js.map +1 -1
- package/lib/module/views/GestureHandler.js +0 -2
- package/lib/module/views/GestureHandler.js.map +1 -1
- package/lib/module/views/GestureHandlerNative.js +0 -1
- package/lib/module/views/GestureHandlerNative.js.map +1 -1
- package/lib/module/views/Header/Header.js +7 -6
- package/lib/module/views/Header/Header.js.map +1 -1
- package/lib/module/views/Header/HeaderContainer.js +10 -12
- package/lib/module/views/Header/HeaderContainer.js.map +1 -1
- package/lib/module/views/Header/HeaderSegment.js +6 -10
- package/lib/module/views/Header/HeaderSegment.js.map +1 -1
- package/lib/module/views/ModalStatusBarManager.js +1 -3
- package/lib/module/views/ModalStatusBarManager.js.map +1 -1
- package/lib/module/views/Screens.js +2 -8
- package/lib/module/views/Screens.js.map +1 -1
- package/lib/module/views/Stack/Card.js +17 -58
- package/lib/module/views/Stack/Card.js.map +1 -1
- package/lib/module/views/Stack/CardContainer.js +3 -17
- package/lib/module/views/Stack/CardContainer.js.map +1 -1
- package/lib/module/views/Stack/CardSheet.js +2 -4
- package/lib/module/views/Stack/CardSheet.js.map +1 -1
- package/lib/module/views/Stack/CardStack.js +23 -60
- package/lib/module/views/Stack/CardStack.js.map +1 -1
- package/lib/module/views/Stack/StackView.js +34 -51
- package/lib/module/views/Stack/StackView.js.map +1 -1
- package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts +1 -0
- package/lib/typescript/src/TransitionConfigs/CardStyleInterpolators.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts +1 -0
- package/lib/typescript/src/TransitionConfigs/HeaderStyleInterpolators.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionPresets.d.ts.map +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts +1 -0
- package/lib/typescript/src/TransitionConfigs/TransitionSpecs.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/navigators/createStackNavigator.d.ts +1 -0
- package/lib/typescript/src/navigators/createStackNavigator.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/CardAnimationContext.d.ts +1 -0
- package/lib/typescript/src/utils/CardAnimationContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts +1 -0
- package/lib/typescript/src/utils/GestureHandlerRefContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/ModalPresentationContext.d.ts +1 -0
- package/lib/typescript/src/utils/ModalPresentationContext.d.ts.map +1 -0
- package/lib/typescript/src/utils/conditional.d.ts +1 -0
- package/lib/typescript/src/utils/conditional.d.ts.map +1 -0
- package/lib/typescript/src/utils/debounce.d.ts +1 -0
- package/lib/typescript/src/utils/debounce.d.ts.map +1 -0
- package/lib/typescript/src/utils/getDistanceForDirection.d.ts +1 -0
- package/lib/typescript/src/utils/getDistanceForDirection.d.ts.map +1 -0
- package/lib/typescript/src/utils/getInvertedMultiplier.d.ts +1 -0
- package/lib/typescript/src/utils/getInvertedMultiplier.d.ts.map +1 -0
- package/lib/typescript/src/utils/memoize.d.ts +1 -0
- package/lib/typescript/src/utils/memoize.d.ts.map +1 -0
- package/lib/typescript/src/utils/useCardAnimation.d.ts +1 -0
- package/lib/typescript/src/utils/useCardAnimation.d.ts.map +1 -0
- package/lib/typescript/src/utils/useGestureHandlerRef.d.ts +1 -0
- package/lib/typescript/src/utils/useGestureHandlerRef.d.ts.map +1 -0
- package/lib/typescript/src/utils/useKeyboardManager.d.ts +1 -0
- package/lib/typescript/src/utils/useKeyboardManager.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.android.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +1 -0
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +1 -0
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -0
- package/lib/typescript/src/views/Header/Header.d.ts +1 -0
- package/lib/typescript/src/views/Header/Header.d.ts.map +1 -0
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts +1 -0
- package/lib/typescript/src/views/Header/HeaderContainer.d.ts.map +1 -0
- package/lib/typescript/src/views/Header/HeaderSegment.d.ts +1 -0
- package/lib/typescript/src/views/Header/HeaderSegment.d.ts.map +1 -0
- package/lib/typescript/src/views/ModalStatusBarManager.d.ts +1 -0
- package/lib/typescript/src/views/ModalStatusBarManager.d.ts.map +1 -0
- package/lib/typescript/src/views/Screens.d.ts +1 -0
- package/lib/typescript/src/views/Screens.d.ts.map +1 -0
- package/lib/typescript/src/views/Stack/Card.d.ts +1 -0
- package/lib/typescript/src/views/Stack/Card.d.ts.map +1 -0
- package/lib/typescript/src/views/Stack/CardContainer.d.ts +1 -0
- package/lib/typescript/src/views/Stack/CardContainer.d.ts.map +1 -0
- package/lib/typescript/src/views/Stack/CardSheet.d.ts +1 -0
- package/lib/typescript/src/views/Stack/CardSheet.d.ts.map +1 -0
- package/lib/typescript/src/views/Stack/CardStack.d.ts +1 -0
- package/lib/typescript/src/views/Stack/CardStack.d.ts.map +1 -0
- package/lib/typescript/src/views/Stack/StackView.d.ts +1 -0
- package/lib/typescript/src/views/Stack/StackView.d.ts.map +1 -0
- package/package.json +5 -5
package/lib/commonjs/index.js
CHANGED
|
@@ -48,40 +48,22 @@ Object.defineProperty(exports, "useGestureHandlerRef", {
|
|
|
48
48
|
return _useGestureHandlerRef.default;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
|
|
52
51
|
var CardStyleInterpolators = _interopRequireWildcard(require("./TransitionConfigs/CardStyleInterpolators"));
|
|
53
|
-
|
|
54
52
|
exports.CardStyleInterpolators = CardStyleInterpolators;
|
|
55
|
-
|
|
56
53
|
var HeaderStyleInterpolators = _interopRequireWildcard(require("./TransitionConfigs/HeaderStyleInterpolators"));
|
|
57
|
-
|
|
58
54
|
exports.HeaderStyleInterpolators = HeaderStyleInterpolators;
|
|
59
|
-
|
|
60
55
|
var TransitionPresets = _interopRequireWildcard(require("./TransitionConfigs/TransitionPresets"));
|
|
61
|
-
|
|
62
56
|
exports.TransitionPresets = TransitionPresets;
|
|
63
|
-
|
|
64
57
|
var TransitionSpecs = _interopRequireWildcard(require("./TransitionConfigs/TransitionSpecs"));
|
|
65
|
-
|
|
66
58
|
exports.TransitionSpecs = TransitionSpecs;
|
|
67
|
-
|
|
68
59
|
var _createStackNavigator = _interopRequireDefault(require("./navigators/createStackNavigator"));
|
|
69
|
-
|
|
70
60
|
var _Header = _interopRequireDefault(require("./views/Header/Header"));
|
|
71
|
-
|
|
72
61
|
var _StackView = _interopRequireDefault(require("./views/Stack/StackView"));
|
|
73
|
-
|
|
74
62
|
var _CardAnimationContext = _interopRequireDefault(require("./utils/CardAnimationContext"));
|
|
75
|
-
|
|
76
63
|
var _GestureHandlerRefContext = _interopRequireDefault(require("./utils/GestureHandlerRefContext"));
|
|
77
|
-
|
|
78
64
|
var _useCardAnimation = _interopRequireDefault(require("./utils/useCardAnimation"));
|
|
79
|
-
|
|
80
65
|
var _useGestureHandlerRef = _interopRequireDefault(require("./utils/useGestureHandlerRef"));
|
|
81
|
-
|
|
82
66
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
-
|
|
84
67
|
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); }
|
|
85
|
-
|
|
86
68
|
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; }
|
|
87
69
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAqF;AACrF;AAAyF;AACzF;AAA2E;AAC3E;AAAuE;AAKvE;AAKA;AACA;AAeA;AACA;AACA;AACA;AAA+E;AAAA;AAAA"}
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _native = require("@react-navigation/native");
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _warnOnce = _interopRequireDefault(require("warn-once"));
|
|
13
|
-
|
|
14
10
|
var _StackView = _interopRequireDefault(require("../views/Stack/StackView"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
|
-
|
|
24
15
|
function StackNavigator(_ref) {
|
|
25
16
|
let {
|
|
26
17
|
id,
|
|
@@ -32,12 +23,14 @@ function StackNavigator(_ref) {
|
|
|
32
23
|
} = _ref;
|
|
33
24
|
// @ts-expect-error: mode is deprecated
|
|
34
25
|
const mode = rest.mode;
|
|
35
|
-
(0, _warnOnce.default)(mode != null, `Stack Navigator: 'mode="${mode}"' is deprecated. Use 'presentation: "${mode}"' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator#presentation for more details.`);
|
|
26
|
+
(0, _warnOnce.default)(mode != null, `Stack Navigator: 'mode="${mode}"' is deprecated. Use 'presentation: "${mode}"' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator#presentation for more details.`);
|
|
36
27
|
|
|
28
|
+
// @ts-expect-error: headerMode='none' is deprecated
|
|
37
29
|
const headerMode = rest.headerMode;
|
|
38
30
|
(0, _warnOnce.default)(headerMode === 'none', `Stack Navigator: 'headerMode="none"' is deprecated. Use 'headerShown: false' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headershown for more details.`);
|
|
39
|
-
(0, _warnOnce.default)(headerMode != null && headerMode !== 'none', `Stack Navigator: 'headerMode' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headermode for more details.`);
|
|
31
|
+
(0, _warnOnce.default)(headerMode != null && headerMode !== 'none', `Stack Navigator: 'headerMode' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headermode for more details.`);
|
|
40
32
|
|
|
33
|
+
// @ts-expect-error: headerMode='none' is deprecated
|
|
41
34
|
const keyboardHandlingEnabled = rest.keyboardHandlingEnabled;
|
|
42
35
|
(0, _warnOnce.default)(keyboardHandlingEnabled !== undefined, `Stack Navigator: 'keyboardHandlingEnabled' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#keyboardhandlingenabled for more details.`);
|
|
43
36
|
const defaultScreenOptions = {
|
|
@@ -61,17 +54,18 @@ function StackNavigator(_ref) {
|
|
|
61
54
|
});
|
|
62
55
|
React.useEffect(() => {
|
|
63
56
|
var _navigation$addListen;
|
|
64
|
-
|
|
65
57
|
return (// @ts-expect-error: there may not be a tab navigator in parent
|
|
66
58
|
(_navigation$addListen = navigation.addListener) === null || _navigation$addListen === void 0 ? void 0 : _navigation$addListen.call(navigation, 'tabPress', e => {
|
|
67
|
-
const isFocused = navigation.isFocused();
|
|
68
|
-
// This is necessary to know if preventDefault() has been called
|
|
59
|
+
const isFocused = navigation.isFocused();
|
|
69
60
|
|
|
61
|
+
// Run the operation in the next frame so we're sure all listeners have been run
|
|
62
|
+
// This is necessary to know if preventDefault() has been called
|
|
70
63
|
requestAnimationFrame(() => {
|
|
71
64
|
if (state.index > 0 && isFocused && !e.defaultPrevented) {
|
|
72
65
|
// When user taps on already focused tab and we're inside the tab,
|
|
73
66
|
// reset the stack to replicate native behaviour
|
|
74
|
-
navigation.dispatch({
|
|
67
|
+
navigation.dispatch({
|
|
68
|
+
..._native.StackActions.popToTop(),
|
|
75
69
|
target: state.key
|
|
76
70
|
});
|
|
77
71
|
}
|
|
@@ -85,8 +79,6 @@ function StackNavigator(_ref) {
|
|
|
85
79
|
navigation: navigation
|
|
86
80
|
})));
|
|
87
81
|
}
|
|
88
|
-
|
|
89
82
|
var _default = (0, _native.createNavigatorFactory)(StackNavigator);
|
|
90
|
-
|
|
91
83
|
exports.default = _default;
|
|
92
84
|
//# sourceMappingURL=createStackNavigator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StackNavigator","id","initialRouteName","children","screenListeners","screenOptions","rest","mode","warnOnce","headerMode","keyboardHandlingEnabled","undefined","defaultScreenOptions","presentation","headerShown","state","descriptors","navigation","NavigationContent","useNavigationBuilder","StackRouter","React","useEffect","addListener","e","isFocused","requestAnimationFrame","index","defaultPrevented","dispatch","StackActions","popToTop","target","key","createNavigatorFactory"],"
|
|
1
|
+
{"version":3,"names":["StackNavigator","id","initialRouteName","children","screenListeners","screenOptions","rest","mode","warnOnce","headerMode","keyboardHandlingEnabled","undefined","defaultScreenOptions","presentation","headerShown","state","descriptors","navigation","NavigationContent","useNavigationBuilder","StackRouter","React","useEffect","addListener","e","isFocused","requestAnimationFrame","index","defaultPrevented","dispatch","StackActions","popToTop","target","key","createNavigatorFactory"],"sourceRoot":"../../src","sources":["createStackNavigator.tsx"],"mappings":";;;;;;AAAA;AAYA;AACA;AAQA;AAAiD;AAAA;AAAA;AAAA;AAWjD,SAASA,cAAc,OAOb;EAAA,IAPc;IACtBC,EAAE;IACFC,gBAAgB;IAChBC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACb,GAAGC;EACE,CAAC;EACN;EACA,MAAMC,IAAI,GAAGD,IAAI,CAACC,IAAoC;EAEtD,IAAAC,iBAAQ,EACND,IAAI,IAAI,IAAI,EACX,2BAA0BA,IAAK,yCAAwCA,IAAK,uHAAsH,CACpM;;EAED;EACA,MAAME,UAAU,GAAGH,IAAI,CAACG,UAAkD;EAE1E,IAAAD,iBAAQ,EACNC,UAAU,KAAK,MAAM,EACpB,iMAAgM,CAClM;EAED,IAAAD,iBAAQ,EACNC,UAAU,IAAI,IAAI,IAAIA,UAAU,KAAK,MAAM,EAC1C,kMAAiM,CACnM;;EAED;EACA,MAAMC,uBAAuB,GAAGJ,IAAI,CAACI,uBAAuB;EAE5D,IAAAF,iBAAQ,EACNE,uBAAuB,KAAKC,SAAS,EACpC,4NAA2N,CAC7N;EAED,MAAMC,oBAA4C,GAAG;IACnDC,YAAY,EAAEN,IAAI;IAClBO,WAAW,EAAEL,UAAU,GAAGA,UAAU,KAAK,MAAM,GAAG,IAAI;IACtDA,UAAU,EAAEA,UAAU,IAAIA,UAAU,KAAK,MAAM,GAAGA,UAAU,GAAGE,SAAS;IACxED;EACF,CAAC;EAED,MAAM;IAAEK,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzD,IAAAC,4BAAoB,EAMlBC,mBAAW,EAAE;IACbnB,EAAE;IACFC,gBAAgB;IAChBC,QAAQ;IACRC,eAAe;IACfC,aAAa;IACbO;EACF,CAAC,CAAC;EAEJS,KAAK,CAACC,SAAS,CACb;IAAA;IAAA,OACE;MAAA,yBACAL,UAAU,CAACM,WAAW,0DAAtB,2BAAAN,UAAU,EAAe,UAAU,EAAGO,CAAC,IAAK;QAC1C,MAAMC,SAAS,GAAGR,UAAU,CAACQ,SAAS,EAAE;;QAExC;QACA;QACAC,qBAAqB,CAAC,MAAM;UAC1B,IACEX,KAAK,CAACY,KAAK,GAAG,CAAC,IACfF,SAAS,IACT,CAAED,CAAC,CAA2CI,gBAAgB,EAC9D;YACA;YACA;YACAX,UAAU,CAACY,QAAQ,CAAC;cAClB,GAAGC,oBAAY,CAACC,QAAQ,EAAE;cAC1BC,MAAM,EAAEjB,KAAK,CAACkB;YAChB,CAAC,CAAC;UACJ;QACF,CAAC,CAAC;MACJ,CAAC;IAAC;EAAA,GACJ,CAAChB,UAAU,EAAEF,KAAK,CAACY,KAAK,EAAEZ,KAAK,CAACkB,GAAG,CAAC,CACrC;EAED,oBACE,oBAAC,iBAAiB,qBAChB,oBAAC,kBAAS,eACJ3B,IAAI;IACR,KAAK,EAAES,KAAM;IACb,WAAW,EAAEC,WAAY;IACzB,UAAU,EAAEC;EAAW,GACvB,CACgB;AAExB;AAAC,eAEc,IAAAiB,8BAAsB,EAKnClC,cAAc,CAAC;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.tsx"],"sourcesContent":["import type {\n HeaderBackButton,\n HeaderBackButtonProps,\n HeaderButtonProps,\n HeaderOptions,\n HeaderTitleProps,\n} from '@react-navigation/elements';\nimport type {\n Descriptor,\n NavigationHelpers,\n NavigationProp,\n ParamListBase,\n Route,\n RouteProp,\n StackActionHelpers,\n StackNavigationState,\n} from '@react-navigation/native';\nimport type * as React from 'react';\nimport type { Animated, StyleProp, TextStyle, ViewStyle } from 'react-native';\n\nexport type StackNavigationEventMap = {\n /**\n * Event which fires when a transition animation starts.\n */\n transitionStart: { data: { closing: boolean } };\n /**\n * Event which fires when a transition animation ends.\n */\n transitionEnd: { data: { closing: boolean } };\n /**\n * Event which fires when navigation gesture starts.\n */\n gestureStart: { data: undefined };\n /**\n * Event which fires when navigation gesture is completed.\n */\n gestureEnd: { data: undefined };\n /**\n * Event which fires when navigation gesture is canceled.\n */\n gestureCancel: { data: undefined };\n};\n\nexport type StackNavigationHelpers = NavigationHelpers<\n ParamListBase,\n StackNavigationEventMap\n> &\n StackActionHelpers<ParamListBase>;\n\nexport type StackNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n StackNavigationState<ParamList>,\n StackNavigationOptions,\n StackNavigationEventMap\n> &\n StackActionHelpers<ParamList>;\n\nexport type StackScreenProps<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined\n> = {\n navigation: StackNavigationProp<ParamList, RouteName, NavigatorID>;\n route: RouteProp<ParamList, RouteName>;\n};\n\nexport type Layout = { width: number; height: number };\n\nexport type GestureDirection =\n | 'horizontal'\n | 'horizontal-inverted'\n | 'vertical'\n | 'vertical-inverted';\n\ntype SceneOptionsDefaults = TransitionPreset & {\n animationEnabled: boolean;\n gestureEnabled: boolean;\n cardOverlayEnabled: boolean;\n headerMode: StackHeaderMode;\n};\n\nexport type Scene = {\n /**\n * Route object for the current screen.\n */\n route: Route<string>;\n /**\n * Descriptor object for the screen.\n */\n descriptor: Omit<StackDescriptor, 'options'> & {\n options: Omit<StackDescriptor['options'], keyof SceneOptionsDefaults> &\n SceneOptionsDefaults;\n };\n /**\n * Animated nodes representing the progress of the animation.\n */\n progress: SceneProgress;\n};\n\nexport type SceneProgress = {\n /**\n * Progress value of the current screen.\n */\n current: Animated.AnimatedInterpolation;\n /**\n * Progress value for the screen after this one in the stack.\n * This can be `undefined` in case the screen animating is the last one.\n */\n next?: Animated.AnimatedInterpolation;\n /**\n * Progress value for the screen before this one in the stack.\n * This can be `undefined` in case the screen animating is the first one.\n */\n previous?: Animated.AnimatedInterpolation;\n};\n\nexport type StackHeaderMode = 'float' | 'screen';\n\nexport type StackPresentationMode = 'card' | 'modal';\n\nexport type StackHeaderOptions = Omit<\n HeaderOptions,\n 'headerLeft' | 'headerTitle' | 'headerRight'\n> & {\n /**\n * String or a function that returns a React Element to be used by the header.\n * Defaults to screen `title` or route name.\n *\n * It receives `allowFontScaling`, `tintColor`, `style` and `children` in the options object as an argument.\n * The title string is passed in `children`.\n */\n headerTitle?: string | ((props: HeaderTitleProps) => React.ReactNode);\n /**\n * Function which returns a React Element to display on the left side of the header.\n */\n headerLeft?: (props: HeaderBackButtonProps) => React.ReactNode;\n /**\n * Function which returns a React Element to display on the right side of the header.\n */\n headerRight?: (props: HeaderButtonProps) => React.ReactNode;\n /**\n * Whether back button title font should scale to respect Text Size accessibility settings. Defaults to `false`.\n */\n headerBackAllowFontScaling?: boolean;\n /**\n * Accessibility label for the header back button.\n */\n headerBackAccessibilityLabel?: string;\n /**\n * ID to locate this back button in tests.\n */\n headerBackTestID?: string;\n /**\n * Title string used by the back button on iOS.\n * Defaults to the previous screen's title, or \"Back\" if there's not enough space.\n * Use `headerBackTitleVisible: false` to hide it.\n */\n headerBackTitle?: string;\n /**\n * Whether the back button title should be visible or not.\n *\n * Defaults to `true` on iOS, `false on Android.\n */\n headerBackTitleVisible?: boolean;\n /**\n * Style object for the back title.\n */\n headerBackTitleStyle?: StyleProp<TextStyle>;\n /**\n * Title string used by the back button when `headerBackTitle` doesn't fit on the screen. `\"Back\"` by default.\n */\n headerTruncatedBackTitle?: string;\n /**\n * Function which returns a React Element to display custom image in header's back button.\n * It receives the `tintColor` in in the options object as an argument. object.\n * Defaults to Image component with a the default back icon image for the platform (a chevron on iOS and an arrow on Android).\n */\n headerBackImage?: React.ComponentProps<typeof HeaderBackButton>['backImage'];\n};\n\nexport type StackHeaderProps = {\n /**\n * Layout of the screen.\n */\n layout: Layout;\n /**\n * Options for the back button.\n */\n back?: {\n /**\n * Title of the previous screen.\n */\n title: string;\n };\n /**\n * Animated nodes representing the progress of the animation.\n */\n progress: SceneProgress;\n /**\n * Options for the current screen.\n */\n options: StackNavigationOptions;\n /**\n * Route object for the current screen.\n */\n route: Route<string>;\n /**\n * Navigation prop for the header.\n */\n navigation: StackNavigationProp<ParamListBase>;\n /**\n * Interpolated styles for various elements in the header.\n */\n styleInterpolator: StackHeaderStyleInterpolator;\n};\n\nexport type StackDescriptor = Descriptor<\n StackNavigationOptions,\n StackNavigationProp<ParamListBase>,\n RouteProp<ParamListBase>\n>;\n\nexport type StackDescriptorMap = Record<string, StackDescriptor>;\n\nexport type StackNavigationOptions = StackHeaderOptions &\n Partial<TransitionPreset> & {\n /**\n * String that can be displayed in the header as a fallback for `headerTitle`.\n */\n title?: string;\n /**\n * Function that given `HeaderProps` returns a React Element to display as a header.\n */\n header?: (props: StackHeaderProps) => React.ReactNode;\n /**\n * Whether the header floats above the screen or part of the screen.\n * Defaults to `float` on iOS for non-modals, and `screen` for the rest.\n */\n headerMode?: StackHeaderMode;\n /**\n * Whether to show the header. The header is shown by default.\n * Setting this to `false` hides the header.\n */\n headerShown?: boolean;\n /**\n * Whether a shadow is visible for the card during transitions. Defaults to `true`.\n */\n cardShadowEnabled?: boolean;\n /**\n * Whether to have a semi-transparent dark overlay visible under the card during transitions.\n * Defaults to `true` on Android and `false` on iOS.\n */\n cardOverlayEnabled?: boolean;\n /**\n * Function that returns a React Element to display as a overlay for the card.\n */\n cardOverlay?: (props: {\n style: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n }) => React.ReactNode;\n /**\n * Style object for the card in stack.\n * You can provide a custom background color to use instead of the default background here.\n *\n * You can also specify `{ backgroundColor: 'transparent' }` to make the previous screen visible underneath.\n * This is useful to implement things like modal dialogs.\n *\n * You should also specify `detachPreviousScreen: false` in options when using a transparent background\n * so that the previous screen isn't detached and stays below the current screen.\n *\n * You might also need to change the animation of the screen using `cardStyleInterpolator`\n * so that the previous screen isn't transformed or invisible.\n */\n cardStyle?: StyleProp<ViewStyle>;\n /**\n * Whether this screen should be presented as a modal or a regular card.\n *\n * Specifying this will configure several options:\n * - `card`: Use the default OS animations for iOS and Android screen transitions.\n * - `modal`: Use Modal animations. This changes a few things:\n * - Sets `headerMode` to `screen` for the screen unless specified otherwise.\n * - Changes the screen animation to match the platform behavior for modals.\n * - `transparentModal`: Similar to `modal`. This changes following things:\n * - Sets `headerMode` to `screen` for the screen unless specified otherwise.\n * - Sets background color of the screen to transparent, so previous screen is visible\n * - Adjusts the `detachPreviousScreen` option so that the previous screen stays rendered.\n * - Prevents the previous screen from animating from its last position.\n * - Changes the screen animation to a vertical slide animation.\n *\n * Defaults to 'card'.\n */\n presentation?: 'card' | 'modal' | 'transparentModal';\n /**\n * Whether transition animation should be enabled the screen.\n * If you set it to `false`, the screen won't animate when pushing or popping.\n * Defaults to `true` on Android and iOS, `false` on Web.\n */\n animationEnabled?: boolean;\n /**\n * The type of animation to use when this screen replaces another screen. Defaults to `push`.\n * When `pop` is used, the `pop` animation is applied to the screen being replaced.\n */\n animationTypeForReplace?: 'push' | 'pop';\n /**\n * Whether you can use gestures to dismiss this screen. Defaults to `true` on iOS, `false` on Android.\n * Not supported on Web.\n */\n gestureEnabled?: boolean;\n /**\n * Distance of touch start from the edge of the screen to recognize gestures.\n * Not supported on Web.\n */\n gestureResponseDistance?: number;\n /**\n * Number which determines the relevance of velocity for the gesture. Defaults to 0.3.\n * Not supported on Web.\n */\n gestureVelocityImpact?: number;\n /**\n * Whether to detach the previous screen from the view hierarchy to save memory.\n * Set it to `false` if you need the previous screen to be seen through the active screen.\n * Only applicable if `detachInactiveScreens` isn't set to `false`.\n * Defaults to `false` for the last screen for modals, otherwise `true`.\n */\n detachPreviousScreen?: boolean;\n /**\n * If `false`, the keyboard will NOT automatically dismiss when navigating to a new screen from this screen.\n * Defaults to `true`.\n */\n keyboardHandlingEnabled?: boolean;\n /**\n * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.\n * Defaults to `true` when `enableFreeze()` is run at the top of the application.\n * Requires `react-native-screens` version >=3.16.0.\n *\n * Only supported on iOS and Android.\n */\n freezeOnBlur?: boolean;\n };\n\nexport type StackNavigationConfig = {\n /**\n * Whether inactive screens should be detached from the view hierarchy to save memory.\n * This will have no effect if you disable `react-native-screens`.\n *\n * Defaults to `true`.\n */\n detachInactiveScreens?: boolean;\n};\n\nexport type TransitionSpec =\n | {\n animation: 'spring';\n config: Omit<\n Animated.SpringAnimationConfig,\n 'toValue' | keyof Animated.AnimationConfig\n >;\n }\n | {\n animation: 'timing';\n config: Omit<\n Animated.TimingAnimationConfig,\n 'toValue' | keyof Animated.AnimationConfig\n >;\n };\n\nexport type StackCardInterpolationProps = {\n /**\n * Values for the current screen.\n */\n current: {\n /**\n * Animated node representing the progress value of the current screen.\n */\n progress: Animated.AnimatedInterpolation;\n };\n /**\n * Values for the screen after this one in the stack.\n * This can be `undefined` in case the screen animating is the last one.\n */\n next?: {\n /**\n * Animated node representing the progress value of the next screen.\n */\n progress: Animated.AnimatedInterpolation;\n };\n /**\n * The index of the card with this interpolation in the stack.\n */\n index: number;\n /**\n * Animated node representing whether the card is closing (1 - closing, 0 - not closing).\n */\n closing: Animated.AnimatedInterpolation;\n /**\n * Animated node representing whether the card is being swiped (1 - swiping, 0 - not swiping).\n */\n swiping: Animated.AnimatedInterpolation;\n /**\n * Animated node representing multiplier when direction is inverted (-1 - inverted, 1 - normal).\n */\n inverted: Animated.AnimatedInterpolation;\n /**\n * Layout measurements for various items we use for animation.\n */\n layouts: {\n /**\n * Layout of the whole screen.\n */\n screen: Layout;\n };\n /**\n * Safe area insets\n */\n insets: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n};\n\nexport type StackCardInterpolatedStyle = {\n /**\n * Interpolated style for the container view wrapping the card.\n */\n containerStyle?: any;\n /**\n * Interpolated style for the view representing the card.\n */\n cardStyle?: any;\n /**\n * Interpolated style for the view representing the semi-transparent overlay below the card.\n */\n overlayStyle?: any;\n /**\n * Interpolated style representing the card shadow.\n */\n shadowStyle?: any;\n};\n\nexport type StackCardStyleInterpolator = (\n props: StackCardInterpolationProps\n) => StackCardInterpolatedStyle;\n\nexport type StackHeaderInterpolationProps = {\n /**\n * Values for the current screen (the screen which owns this header).\n */\n current: {\n /**\n * Animated node representing the progress value of the current screen.\n */\n progress: Animated.AnimatedInterpolation;\n };\n /**\n * Values for the screen after this one in the stack.\n * This can be `undefined` in case the screen animating is the last one.\n */\n next?: {\n /**\n * Animated node representing the progress value of the next screen.\n */\n progress: Animated.AnimatedInterpolation;\n };\n /**\n * Layout measurements for various items we use for animation.\n */\n layouts: {\n /**\n * Layout of the header\n */\n header: Layout;\n /**\n * Layout of the whole screen.\n */\n screen: Layout;\n /**\n * Layout of the title element.\n */\n title?: Layout;\n /**\n * Layout of the back button label.\n */\n leftLabel?: Layout;\n };\n};\n\nexport type StackHeaderInterpolatedStyle = {\n /**\n * Interpolated style for the label of the left button (back button label).\n */\n leftLabelStyle?: any;\n /**\n * Interpolated style for the left button (usually the back button).\n */\n leftButtonStyle?: any;\n /**\n * Interpolated style for the right button.\n */\n rightButtonStyle?: any;\n /**\n * Interpolated style for the header title text.\n */\n titleStyle?: any;\n /**\n * Interpolated style for the header background.\n */\n backgroundStyle?: any;\n};\n\nexport type StackHeaderStyleInterpolator = (\n props: StackHeaderInterpolationProps\n) => StackHeaderInterpolatedStyle;\n\nexport type TransitionPreset = {\n /**\n * The direction of swipe gestures, `horizontal` or `vertical`.\n */\n gestureDirection: GestureDirection;\n /**\n * Object which specifies the animation type (timing or spring) and their options (such as duration for timing).\n */\n transitionSpec: {\n /**\n * Transition configuration when adding a screen.\n */\n open: TransitionSpec;\n /**\n * Transition configuration when removing a screen.\n */\n close: TransitionSpec;\n };\n /**\n * Function which specifies interpolated styles for various parts of the card, e.g. the overlay, shadow etc.\n */\n cardStyleInterpolator: StackCardStyleInterpolator;\n /**\n * Function which specifies interpolated styles for various parts of the header, e.g. the title, left button etc.\n */\n headerStyleInterpolator: StackHeaderStyleInterpolator;\n};\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.tsx"],"mappings":""}
|
|
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
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); }
|
|
11
|
-
|
|
12
9
|
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; }
|
|
13
|
-
|
|
14
10
|
var _default = /*#__PURE__*/React.createContext(undefined);
|
|
15
|
-
|
|
16
11
|
exports.default = _default;
|
|
17
12
|
//# sourceMappingURL=CardAnimationContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","undefined"],"
|
|
1
|
+
{"version":3,"names":["React","createContext","undefined"],"sourceRoot":"../../src","sources":["CardAnimationContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAIhBA,KAAK,CAACC,aAAa,CAChCC,SAAS,CACV;AAAA"}
|
|
@@ -4,14 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
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); }
|
|
11
|
-
|
|
12
9
|
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; }
|
|
13
|
-
|
|
14
10
|
var _default = /*#__PURE__*/React.createContext(null);
|
|
15
|
-
|
|
16
11
|
exports.default = _default;
|
|
17
12
|
//# sourceMappingURL=GestureHandlerRefContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext"],"
|
|
1
|
+
{"version":3,"names":["React","createContext"],"sourceRoot":"../../src","sources":["GestureHandlerRefContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAAA,4BAEhBA,KAAK,CAACC,aAAa,CAExB,IAAI,CAAC;AAAA"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
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); }
|
|
11
|
-
|
|
12
9
|
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; }
|
|
13
|
-
|
|
14
10
|
const ModalPresentationContext = /*#__PURE__*/React.createContext(false);
|
|
15
11
|
var _default = ModalPresentationContext;
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ModalPresentationContext","React","createContext"],"
|
|
1
|
+
{"version":3,"names":["ModalPresentationContext","React","createContext"],"sourceRoot":"../../src","sources":["ModalPresentationContext.tsx"],"mappings":";;;;;;AAAA;AAA+B;AAAA;AAE/B,MAAMA,wBAAwB,gBAAGC,KAAK,CAACC,aAAa,CAAC,KAAK,CAAC;AAAC,eAE7CF,wBAAwB;AAAA"}
|
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = conditional;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
const {
|
|
11
9
|
add,
|
|
12
10
|
multiply
|
|
13
11
|
} = _reactNative.Animated;
|
|
12
|
+
|
|
14
13
|
/**
|
|
15
14
|
* Use an Animated Node based on a condition. Similar to Reanimated's `cond`.
|
|
16
15
|
*
|
|
@@ -18,7 +17,6 @@ const {
|
|
|
18
17
|
* @param main Animated Node to use if the condition is `true`
|
|
19
18
|
* @param fallback Animated Node to use if the condition is `false`
|
|
20
19
|
*/
|
|
21
|
-
|
|
22
20
|
function conditional(condition, main, fallback) {
|
|
23
21
|
// To implement this behavior, we multiply the main node with the condition.
|
|
24
22
|
// So if condition is 0, result will be 0, and if condition is 1, result will be main node.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["add","multiply","Animated","conditional","condition","main","fallback","interpolate","inputRange","outputRange"],"
|
|
1
|
+
{"version":3,"names":["add","multiply","Animated","conditional","condition","main","fallback","interpolate","inputRange","outputRange"],"sourceRoot":"../../src","sources":["conditional.tsx"],"mappings":";;;;;;AAAA;AAEA,MAAM;EAAEA,GAAG;EAAEC;AAAS,CAAC,GAAGC,qBAAQ;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,WAAW,CACjCC,SAAyC,EACzCC,IAAoC,EACpCC,QAAwC,EACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAON,GAAG,CACRC,QAAQ,CAACG,SAAS,EAAEC,IAAI,CAAC,EACzBJ,QAAQ,CACNG,SAAS,CAACG,WAAW,CAAC;IACpBC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;EACpB,CAAC,CAAC,EACFH,QAAQ,CACT,CACF;AACH"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = debounce;
|
|
7
|
-
|
|
8
7
|
function debounce(func, duration) {
|
|
9
8
|
let timeout;
|
|
10
9
|
return function () {
|
|
@@ -12,7 +11,6 @@ function debounce(func, duration) {
|
|
|
12
11
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
12
|
args[_key] = arguments[_key];
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
// eslint-disable-next-line babel/no-invalid-this
|
|
17
15
|
func.apply(this, args);
|
|
18
16
|
timeout = setTimeout(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["debounce","func","duration","timeout","args","apply","setTimeout","undefined"],"
|
|
1
|
+
{"version":3,"names":["debounce","func","duration","timeout","args","apply","setTimeout","undefined"],"sourceRoot":"../../src","sources":["debounce.tsx"],"mappings":";;;;;;AAAe,SAASA,QAAQ,CAC9BC,IAAO,EACPC,QAAgB,EACb;EACH,IAAIC,OAA4C;EAEhD,OAAO,YAA8B;IACnC,IAAI,CAACA,OAAO,EAAE;MAAA,kCADeC,IAAI;QAAJA,IAAI;MAAA;MAE/B;MACAH,IAAI,CAACI,KAAK,CAAC,IAAI,EAAED,IAAI,CAAC;MAEtBD,OAAO,GAAGG,UAAU,CAAC,MAAM;QACzBH,OAAO,GAAGI,SAAS;MACrB,CAAC,EAAEL,QAAQ,CAAC;IACd;EACF,CAAC;AACH"}
|
|
@@ -4,19 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getDistanceForDirection;
|
|
7
|
-
|
|
8
7
|
var _getInvertedMultiplier = _interopRequireDefault(require("./getInvertedMultiplier"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
function getDistanceForDirection(layout, gestureDirection) {
|
|
13
10
|
const multiplier = (0, _getInvertedMultiplier.default)(gestureDirection);
|
|
14
|
-
|
|
15
11
|
switch (gestureDirection) {
|
|
16
12
|
case 'vertical':
|
|
17
13
|
case 'vertical-inverted':
|
|
18
14
|
return layout.height * multiplier;
|
|
19
|
-
|
|
20
15
|
case 'horizontal':
|
|
21
16
|
case 'horizontal-inverted':
|
|
22
17
|
return layout.width * multiplier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDistanceForDirection","layout","gestureDirection","multiplier","getInvertedMultiplier","height","width"],"
|
|
1
|
+
{"version":3,"names":["getDistanceForDirection","layout","gestureDirection","multiplier","getInvertedMultiplier","height","width"],"sourceRoot":"../../src","sources":["getDistanceForDirection.tsx"],"mappings":";;;;;;AACA;AAA4D;AAE7C,SAASA,uBAAuB,CAC7CC,MAAc,EACdC,gBAAkC,EAC1B;EACR,MAAMC,UAAU,GAAG,IAAAC,8BAAqB,EAACF,gBAAgB,CAAC;EAE1D,QAAQA,gBAAgB;IACtB,KAAK,UAAU;IACf,KAAK,mBAAmB;MACtB,OAAOD,MAAM,CAACI,MAAM,GAAGF,UAAU;IACnC,KAAK,YAAY;IACjB,KAAK,qBAAqB;MACxB,OAAOF,MAAM,CAACK,KAAK,GAAGH,UAAU;EAAC;AAEvC"}
|
|
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getInvertedMultiplier;
|
|
7
|
-
|
|
8
7
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
8
|
function getInvertedMultiplier(gestureDirection) {
|
|
11
9
|
switch (gestureDirection) {
|
|
12
10
|
case 'vertical':
|
|
13
11
|
return 1;
|
|
14
|
-
|
|
15
12
|
case 'vertical-inverted':
|
|
16
13
|
return -1;
|
|
17
|
-
|
|
18
14
|
case 'horizontal':
|
|
19
15
|
return _reactNative.I18nManager.getConstants().isRTL ? -1 : 1;
|
|
20
|
-
|
|
21
16
|
case 'horizontal-inverted':
|
|
22
17
|
return _reactNative.I18nManager.getConstants().isRTL ? 1 : -1;
|
|
23
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getInvertedMultiplier","gestureDirection","I18nManager","getConstants","isRTL"],"
|
|
1
|
+
{"version":3,"names":["getInvertedMultiplier","gestureDirection","I18nManager","getConstants","isRTL"],"sourceRoot":"../../src","sources":["getInvertedMultiplier.tsx"],"mappings":";;;;;;AAAA;AAIe,SAASA,qBAAqB,CAC3CC,gBAAkC,EAC1B;EACR,QAAQA,gBAAgB;IACtB,KAAK,UAAU;MACb,OAAO,CAAC;IACV,KAAK,mBAAmB;MACtB,OAAO,CAAC,CAAC;IACX,KAAK,YAAY;MACf,OAAOC,wBAAW,CAACC,YAAY,EAAE,CAACC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC;IAClD,KAAK,qBAAqB;MACxB,OAAOF,wBAAW,CAACC,YAAY,EAAE,CAACC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;EAAC;AAEvD"}
|
|
@@ -4,17 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = memoize;
|
|
7
|
-
|
|
8
7
|
function memoize(callback) {
|
|
9
8
|
let previous;
|
|
10
9
|
let result;
|
|
11
10
|
return function () {
|
|
12
11
|
let hasChanged = false;
|
|
13
|
-
|
|
14
12
|
for (var _len = arguments.length, dependencies = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15
13
|
dependencies[_key] = arguments[_key];
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
if (previous) {
|
|
19
16
|
if (previous.length !== dependencies.length) {
|
|
20
17
|
hasChanged = true;
|
|
@@ -29,13 +26,10 @@ function memoize(callback) {
|
|
|
29
26
|
} else {
|
|
30
27
|
hasChanged = true;
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
previous = dependencies;
|
|
34
|
-
|
|
35
30
|
if (hasChanged || result === undefined) {
|
|
36
31
|
result = callback(...dependencies);
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
return result;
|
|
40
34
|
};
|
|
41
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memoize","callback","previous","result","hasChanged","dependencies","length","i","undefined"],"
|
|
1
|
+
{"version":3,"names":["memoize","callback","previous","result","hasChanged","dependencies","length","i","undefined"],"sourceRoot":"../../src","sources":["memoize.tsx"],"mappings":";;;;;;AAAe,SAASA,OAAO,CAC7BC,QAAmC,EACnC;EACA,IAAIC,QAA0B;EAC9B,IAAIC,MAA0B;EAE9B,OAAO,YAAmC;IACxC,IAAIC,UAAU,GAAG,KAAK;IAAC,kCADdC,YAAY;MAAZA,YAAY;IAAA;IAGrB,IAAIH,QAAQ,EAAE;MACZ,IAAIA,QAAQ,CAACI,MAAM,KAAKD,YAAY,CAACC,MAAM,EAAE;QAC3CF,UAAU,GAAG,IAAI;MACnB,CAAC,MAAM;QACL,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,QAAQ,CAACI,MAAM,EAAEC,CAAC,EAAE,EAAE;UACxC,IAAIL,QAAQ,CAACK,CAAC,CAAC,KAAKF,YAAY,CAACE,CAAC,CAAC,EAAE;YACnCH,UAAU,GAAG,IAAI;YACjB;UACF;QACF;MACF;IACF,CAAC,MAAM;MACLA,UAAU,GAAG,IAAI;IACnB;IAEAF,QAAQ,GAAGG,YAAY;IAEvB,IAAID,UAAU,IAAID,MAAM,KAAKK,SAAS,EAAE;MACtCL,MAAM,GAAGF,QAAQ,CAAC,GAAGI,YAAY,CAAC;IACpC;IAEA,OAAOF,MAAM;EACf,CAAC;AACH"}
|
|
@@ -4,24 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useCardAnimation;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _CardAnimationContext = _interopRequireDefault(require("./CardAnimationContext"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
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; }
|
|
17
|
-
|
|
18
12
|
function useCardAnimation() {
|
|
19
13
|
const animation = React.useContext(_CardAnimationContext.default);
|
|
20
|
-
|
|
21
14
|
if (animation === undefined) {
|
|
22
15
|
throw new Error("Couldn't find values for card animation. Are you inside a screen in Stack?");
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
return animation;
|
|
26
18
|
}
|
|
27
19
|
//# sourceMappingURL=useCardAnimation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCardAnimation","animation","React","useContext","CardAnimationContext","undefined","Error"],"
|
|
1
|
+
{"version":3,"names":["useCardAnimation","animation","React","useContext","CardAnimationContext","undefined","Error"],"sourceRoot":"../../src","sources":["useCardAnimation.tsx"],"mappings":";;;;;;AAAA;AAEA;AAA0D;AAAA;AAAA;AAE3C,SAASA,gBAAgB,GAAG;EACzC,MAAMC,SAAS,GAAGC,KAAK,CAACC,UAAU,CAACC,6BAAoB,CAAC;EAExD,IAAIH,SAAS,KAAKI,SAAS,EAAE;IAC3B,MAAM,IAAIC,KAAK,CACb,4EAA4E,CAC7E;EACH;EAEA,OAAOL,SAAS;AAClB"}
|
|
@@ -4,24 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useGestureHandlerRef;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _GestureHandlerRefContext = _interopRequireDefault(require("./GestureHandlerRefContext"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
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); }
|
|
15
|
-
|
|
16
11
|
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; }
|
|
17
|
-
|
|
18
12
|
function useGestureHandlerRef() {
|
|
19
13
|
const ref = React.useContext(_GestureHandlerRefContext.default);
|
|
20
|
-
|
|
21
14
|
if (ref === undefined) {
|
|
22
15
|
throw new Error("Couldn't find a ref for gesture handler. Are you inside a screen in Stack?");
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
return ref;
|
|
26
18
|
}
|
|
27
19
|
//# sourceMappingURL=useGestureHandlerRef.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useGestureHandlerRef","ref","React","useContext","StackGestureRefContext","undefined","Error"],"
|
|
1
|
+
{"version":3,"names":["useGestureHandlerRef","ref","React","useContext","StackGestureRefContext","undefined","Error"],"sourceRoot":"../../src","sources":["useGestureHandlerRef.tsx"],"mappings":";;;;;;AAAA;AAEA;AAAgE;AAAA;AAAA;AAEjD,SAASA,oBAAoB,GAAG;EAC7C,MAAMC,GAAG,GAAGC,KAAK,CAACC,UAAU,CAACC,iCAAsB,CAAC;EAEpD,IAAIH,GAAG,KAAKI,SAAS,EAAE;IACrB,MAAM,IAAIC,KAAK,CACb,4EAA4E,CAC7E;EACH;EAEA,OAAOL,GAAG;AACZ"}
|
|
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = useKeyboardManager;
|
|
7
|
-
|
|
8
7
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
9
|
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); }
|
|
13
|
-
|
|
14
10
|
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; }
|
|
15
|
-
|
|
16
11
|
function useKeyboardManager(isEnabled) {
|
|
17
12
|
// Numeric id of the previously focused text input
|
|
18
13
|
// When a gesture didn't change the tab, we can restore the focused input with this
|
|
@@ -29,51 +24,50 @@ function useKeyboardManager(isEnabled) {
|
|
|
29
24
|
if (!isEnabled()) {
|
|
30
25
|
return;
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
clearKeyboardTimeout();
|
|
28
|
+
const input = _reactNative.TextInput.State.currentlyFocusedInput();
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
// When a page change begins, blur the currently focused input
|
|
31
|
+
input === null || input === void 0 ? void 0 : input.blur();
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
previouslyFocusedTextInputRef.current = input; // Store timestamp for touch start
|
|
33
|
+
// Store the id of this input so we can refocus it if change was cancelled
|
|
34
|
+
previouslyFocusedTextInputRef.current = input;
|
|
41
35
|
|
|
36
|
+
// Store timestamp for touch start
|
|
42
37
|
startTimestampRef.current = Date.now();
|
|
43
38
|
}, [clearKeyboardTimeout, isEnabled]);
|
|
44
39
|
const onPageChangeConfirm = React.useCallback(force => {
|
|
45
40
|
if (!isEnabled()) {
|
|
46
41
|
return;
|
|
47
42
|
}
|
|
48
|
-
|
|
49
43
|
clearKeyboardTimeout();
|
|
50
|
-
|
|
51
44
|
if (force) {
|
|
52
45
|
// Always dismiss input, even if we don't have a ref to it
|
|
53
46
|
// We might not have the ref if onPageChangeStart was never called
|
|
54
47
|
// This can happen if page change was not from a gesture
|
|
55
48
|
_reactNative.Keyboard.dismiss();
|
|
56
49
|
} else {
|
|
57
|
-
const input = previouslyFocusedTextInputRef.current;
|
|
58
|
-
// This makes sure we don't dismiss input on going back and focusing an input
|
|
50
|
+
const input = previouslyFocusedTextInputRef.current;
|
|
59
51
|
|
|
52
|
+
// Dismiss the keyboard only if an input was a focused before
|
|
53
|
+
// This makes sure we don't dismiss input on going back and focusing an input
|
|
60
54
|
input === null || input === void 0 ? void 0 : input.blur();
|
|
61
|
-
}
|
|
62
|
-
|
|
55
|
+
}
|
|
63
56
|
|
|
57
|
+
// Cleanup the ID on successful page change
|
|
64
58
|
previouslyFocusedTextInputRef.current = undefined;
|
|
65
59
|
}, [clearKeyboardTimeout, isEnabled]);
|
|
66
60
|
const onPageChangeCancel = React.useCallback(() => {
|
|
67
61
|
if (!isEnabled()) {
|
|
68
62
|
return;
|
|
69
63
|
}
|
|
64
|
+
clearKeyboardTimeout();
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
// The page didn't change, we should restore the focus of text input
|
|
73
67
|
const input = previouslyFocusedTextInputRef.current;
|
|
74
|
-
|
|
75
68
|
if (input) {
|
|
76
69
|
// If the interaction was super short we should make sure keyboard won't hide again.
|
|
70
|
+
|
|
77
71
|
// Too fast input refocus will result only in keyboard flashing on screen and hiding right away.
|
|
78
72
|
// During first ~100ms keyboard will be dismissed no matter what,
|
|
79
73
|
// so we have to make sure it won't interrupt input refocus logic.
|